From 42d9537ad13c0a9446dfa150c22fd214552e92aa Mon Sep 17 00:00:00 2001 From: Heejune Kim Date: Sun, 13 Dec 2015 20:40:57 +0900 Subject: [PATCH 001/316] Resolving a bug #1247 (Sending files to channels) Signed-off-by: Heejune Kim (github: heejune) --- Telegram/SourceFiles/historywidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 02762346c9..afe6316dfd 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4575,6 +4575,8 @@ void HistoryWidget::onDocumentSelect() { void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) { if (!_history) return; + if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + _attachDrag = getDragState(e->mimeData()); updateDragAreas(); @@ -4876,6 +4878,8 @@ void HistoryWidget::onPhotoDrop(const QMimeData *data) { void HistoryWidget::onDocumentDrop(const QMimeData *data) { if (!_history) return; + if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + QStringList files = getMediasFromMime(data); if (files.isEmpty()) return; @@ -4883,6 +4887,9 @@ void HistoryWidget::onDocumentDrop(const QMimeData *data) { } void HistoryWidget::onFilesDrop(const QMimeData *data) { + + if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + QStringList files = getMediasFromMime(data); if (files.isEmpty()) { if (data->hasImage()) { From 4ee52afc4d0c408d870dd2799435372084e19ed1 Mon Sep 17 00:00:00 2001 From: Heejune Kim Date: Fri, 18 Dec 2015 10:48:29 +0900 Subject: [PATCH 002/316] Fix a build error when TDESKTOP_DISABLE_AUTOUPDATE preprocessor defined Signed-off-by: Heejune Kim (github: heejune) --- Telegram/SourceFiles/autoupdater.cpp | 3 ++- Telegram/SourceFiles/autoupdater.h | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index d560cfbc60..a34a471c6e 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -569,6 +569,8 @@ bool checkReadyUpdate() { return true; } +#endif + QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp if (cBetaPrivateKey().isEmpty()) { LOG(("Error: Trying to count beta version signature without beta private key!")); @@ -613,4 +615,3 @@ QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp return QString::fromUtf8(signature.mid(19, 32)); } -#endif diff --git a/Telegram/SourceFiles/autoupdater.h b/Telegram/SourceFiles/autoupdater.h index 0bee6fae30..e15d7fe09e 100644 --- a/Telegram/SourceFiles/autoupdater.h +++ b/Telegram/SourceFiles/autoupdater.h @@ -66,6 +66,11 @@ private: bool checkReadyUpdate(); -QString countBetaVersionSignature(uint64 version); +#else +class UpdateDownloader : public QObject { + Q_OBJECT +}; #endif + +QString countBetaVersionSignature(uint64 version); From a6e82cf954aac37e3b9e7f140b18f7e5fc0817e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Escales=20Lo=C3=AFc?= Date: Thu, 24 Dec 2015 10:12:41 +0100 Subject: [PATCH 003/316] Use linux icon theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Loïc Escales L0L022@openmailbox.org (github: L0L022) --- Telegram/SourceFiles/pspecific_linux.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 67137e9779..aa0ad91b95 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -520,7 +520,7 @@ namespace { }; PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), -posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(icon256), wndIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)), _psCheckStatusIconLeft(100), _psLastIndicatorUpdate(0) { +posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(icon256), wndIcon(QIcon::fromTheme("telegram", QIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)))), _psCheckStatusIconLeft(100), _psLastIndicatorUpdate(0) { connect(&_psCheckStatusIconTimer, SIGNAL(timeout()), this, SLOT(psStatusIconCheck())); _psCheckStatusIconTimer.setSingleShot(false); @@ -1172,13 +1172,15 @@ void psRegisterCustomScheme() { DEBUG_LOG(("App Info: placing .desktop file")); if (QDir(home + qsl(".local/")).exists()) { QString apps = home + qsl(".local/share/applications/"); + QString icons = home + qsl(".local/share/icons/"); if (!QDir(apps).exists()) QDir().mkpath(apps); + if (!QDir(icons).exists()) QDir().mkpath(icons); QString path = cWorkingDir() + qsl("tdata/"), file = path + qsl("telegramdesktop.desktop"); QDir().mkpath(path); QFile f(file); if (f.open(QIODevice::WriteOnly)) { - QString icon = path + qsl("icon.png"); + QString icon = icons + qsl("telegram.png"); if (!QFile(icon).exists()) { if (QFile(qsl(":/gui/art/icon256.png")).copy(icon)) { DEBUG_LOG(("App Info: Icon copied to 'tdata'")); @@ -1194,7 +1196,7 @@ void psRegisterCustomScheme() { s << "Name=Telegram Desktop\n"; s << "Comment=Official desktop version of Telegram messaging app\n"; s << "Exec=" << escapeShell(cExeDir() + cExeName()) << " -- %u\n"; - s << "Icon=" << icon << "\n"; + s << "Icon=telegram\n"; s << "Terminal=false\n"; s << "StartupWMClass=Telegram\n"; s << "Type=Application\n"; From 61b7da069e9448ccb6b70b0862a23114d90f926c Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Thu, 24 Dec 2015 21:45:55 +0100 Subject: [PATCH 004/316] Add instructions to squash commits to CONTRIBUTING.md --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f906731af4..435e40e9dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,7 @@ This document describes how you can contribute to Telegram Desktop. Please read * [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly) * [How to get your pull request accepted](#how-to-get-your-pull-request-accepted) * [Keep your pull requests limited to a single issue](#keep-your-pull-requests-limited-to-a-single-issue) + * [Squash your commits to a single commit](#squash-your-commits-to-a-single-commit) * [Don't mix code changes with whitespace cleanup](#dont-mix-code-changes-with-whitespace-cleanup) * [Keep your code simple!](#keep-your-code-simple) * [Test your changes!](#test-your-changes) @@ -107,6 +108,21 @@ Pull requests should be as small/atomic as possible. Large, wide-sweeping change * If you are making spelling corrections in the docs, don't modify other files. * If you are adding new functions don't '*cleanup*' unrelated functions. That cleanup belongs in another pull request. +#### Squash your commits to a single commit + +To keep the history of the project clean, you should make one commit per pull request. +If you already have multiple commits, you can add the commits together (squash them) with the following commands in Git Bash: + +1. Open `Git Bash` (or `Git Shell`) +2. Enter following command to squash the recent {N} commits: `git reset --soft HEAD~{N} && git commit` (replace `{N}` with the number of commits you want to squash) +3. Press i to get into Insert-mode +4. Enter the commit message of the new commit (and add the [signature](#sign-your-work) at the and) +5. After adding the message, press ESC to get out of the Insert-mode +6. Write `:wq` and press Enter to save the new message or write `:q!` to discard your changes +7. Enter `git push --force` to push the new commit to the remote repository + +For example, if you want to squash the last 5 commits, use `git reset --soft HEAD~5 && git commit` + ### Don't mix code changes with whitespace cleanup If you change two lines of code and correct 200 lines of whitespace issues in a file the diff on that pull request is functionally unreadable and will be **rejected**. Whitespace cleanups need to be in their own pull request. From f4d159b2f094e3d7e3416662366870a59ffac679 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 5 Jan 2016 12:28:06 +0800 Subject: [PATCH 005/316] version 0.9.18: crashfix + fix of transparent gifs sending --- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/dropdown.cpp | 13 ++++++------- Telegram/SourceFiles/gui/animation.cpp | 21 ++++++++++++++------- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/localimageloader.cpp | 10 ++++++---- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 6 +++--- 9 files changed, 43 insertions(+), 35 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index c3ebc74865..ceef089c4b 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9017; -static const wchar_t *AppVersionStr = L"0.9.17"; +static const int32 AppVersion = 9018; +static const wchar_t *AppVersionStr = L"0.9.18"; static const bool DevVersion = false; //#define BETA_VERSION (9015008ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 87d9fd97b2..faa204bfb5 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1912,9 +1912,7 @@ int32 StickerPanInner::refreshInlineRows(UserData *bot, const InlineResults &res return 0; } - if (_showingInlineItems) { - clearSelection(true); - } + clearSelection(true); t_assert(_inlineBot != 0); _inlineBotTitle = lng_inline_bot_results(lt_inline_bot, _inlineBot->username.isEmpty() ? _inlineBot->name : ('@' + _inlineBot->username)); @@ -1942,10 +1940,9 @@ int32 StickerPanInner::refreshInlineRows(UserData *bot, const InlineResults &res update(); emit refreshIcons(); - if (_showingInlineItems) { - _lastMousePos = QCursor::pos(); - updateSelected(); - } + + _lastMousePos = QCursor::pos(); + updateSelected(); return added; } @@ -2440,10 +2437,12 @@ void StickerPanInner::showStickerSet(uint64 setId) { void StickerPanInner::updateShowingSavedGifs() { if (cShowingSavedGifs()) { if (!_showingInlineItems) { + clearSelection(true); _showingSavedGifs = _showingInlineItems = true; if (_inlineRows.isEmpty()) refreshSavedGifs(); } } else if (!_showingInlineItems) { + clearSelection(true); _showingSavedGifs = false; } } diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index ee49bb92c1..e096845cde 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -189,18 +189,25 @@ QPixmap _prepareFrame(const ClipFrameRequest &request, const QImage &original, b bool needOuter = (request.outerw != request.framew) || (request.outerh != request.frameh); if (badSize || needOuter || hasAlpha || request.rounded) { int32 factor(request.factor); - bool fill = false; - if (cache.width() != request.outerw || cache.height() != request.outerh) { + bool newcache = (cache.width() != request.outerw || cache.height() != request.outerh); + if (newcache) { cache = QImage(request.outerw, request.outerh, QImage::Format_ARGB32_Premultiplied); - if (request.framew < request.outerw || request.frameh < request.outerh || hasAlpha) { - fill = true; - } cache.setDevicePixelRatio(factor); } { Painter p(&cache); - if (fill) { - p.fillRect(0, 0, cache.width() / factor, cache.height() / factor, st::black); + if (newcache) { + if (request.framew < request.outerw) { + p.fillRect(0, 0, (request.outerw - request.framew) / (2 * factor), cache.height() / factor, st::black); + p.fillRect((request.outerw - request.framew) / (2 * factor) + (request.framew / factor), 0, (cache.width() / factor) - ((request.outerw - request.framew) / (2 * factor) + (request.framew / factor)), cache.height() / factor, st::black); + } + if (request.frameh < request.outerh) { + p.fillRect(qMax(0, (request.outerw - request.framew) / (2 * factor)), 0, qMin(cache.width(), request.framew) / factor, (request.outerh - request.frameh) / (2 * factor), st::black); + p.fillRect(qMax(0, (request.outerw - request.framew) / (2 * factor)), (request.outerh - request.frameh) / (2 * factor) + (request.frameh / factor), qMin(cache.width(), request.framew) / factor, (cache.height() / factor) - ((request.outerh - request.frameh) / (2 * factor) + (request.frameh / factor)), st::black); + } + } + if (hasAlpha) { + p.fillRect(qMax(0, (request.outerw - request.framew) / (2 * factor)), qMax(0, (request.outerh - request.frameh) / (2 * factor)), qMin(cache.width(), request.framew) / factor, qMin(cache.height(), request.frameh) / factor, st::white); } QPoint position((request.outerw - request.framew) / (2 * factor), (request.outerh - request.frameh) / (2 * factor)); if (badSize) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8adc6896bc..aee3391aa8 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4575,7 +4575,7 @@ void HistoryGif::draw(Painter &p, const HistoryItem *parent, const QRect &r, boo if (_data->loaded() && !radial) { icon = (selected ? st::msgFileInPlaySelected : st::msgFileInPlay); } else if (radial || _data->loading()) { - if (parent->id > 0) { + if (parent->id > 0 || _data->uploading()) { icon = (selected ? st::msgFileInCancelSelected : st::msgFileInCancel); } } else { diff --git a/Telegram/SourceFiles/localimageloader.cpp b/Telegram/SourceFiles/localimageloader.cpp index e2596a7c2b..3b1f8d797a 100644 --- a/Telegram/SourceFiles/localimageloader.cpp +++ b/Telegram/SourceFiles/localimageloader.cpp @@ -135,7 +135,7 @@ TaskQueue::~TaskQueue() { void TaskQueueWorker::onTaskAdded() { if (_inTaskAdded) return; _inTaskAdded = true; - + bool someTasksLeft = false; do { TaskPtr task; @@ -326,7 +326,7 @@ void FileLoadTask::process() { } } } - if (filemime == qstr("video/mp4") || filename.endsWith(qstr(".mp4"), Qt::CaseInsensitive)) { + if (filemime == qstr("video/mp4") || filename.endsWith(qstr(".mp4"), Qt::CaseInsensitive) || animated) { QImage cover; MTPDocumentAttribute animatedAttribute = clipReadAnimatedAttributes(_filepath, _content, cover); if (animatedAttribute.type() == mtpc_documentAttributeVideo) { @@ -350,7 +350,9 @@ void FileLoadTask::process() { thumbId = MTP::nonce(); - filemime = qstr("video/mp4"); + if (filename.endsWith(qstr(".mp4"), Qt::CaseInsensitive)) { + filemime = qstr("video/mp4"); + } } } } @@ -414,7 +416,7 @@ void FileLoadTask::process() { _type = PrepareDocument; } } - + _result->type = _type; _result->filepath = _filepath; _result->content = _content; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 1ce05ba2a3..f6bb209621 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.17 + 0.9.18 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index b4ef2e97d9..c7e7c48bd9 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,17,0 - PRODUCTVERSION 0,9,17,0 + FILEVERSION 0,9,18,0 + PRODUCTVERSION 0,9,18,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.17.0" + VALUE "FileVersion", "0.9.18.0" VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.17.0" + VALUE "ProductVersion", "0.9.18.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 6716e5cc2a..cd6cc53379 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1701,7 +1701,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.17; + CURRENT_PROJECT_VERSION = 0.9.18; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.17; + CURRENT_PROJECT_VERSION = 0.9.18; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1747,10 +1747,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.17; + CURRENT_PROJECT_VERSION = 0.9.18; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.17; + DYLIB_CURRENT_VERSION = 0.9.18; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1882,10 +1882,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.17; + CURRENT_PROJECT_VERSION = 0.9.18; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.17; + DYLIB_CURRENT_VERSION = 0.9.18; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 38e8f55ba2..cbec672c63 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9017 +AppVersion 9018 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.17 -AppVersionStr 0.9.17 +AppVersionStrSmall 0.9.18 +AppVersionStr 0.9.18 DevChannel 0 BetaVersion 0 9015008 From 2c7fb8270841f18df2ab4c9321a01e7a0b2d680d Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 5 Jan 2016 12:52:40 +0800 Subject: [PATCH 006/316] fixed broken typing statuses, 0.9.18 --- Telegram/SourceFiles/history.cpp | 24 +++++++++++------------- Telegram/SourceFiles/history.h | 4 ++-- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index aee3391aa8..9406884483 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -321,8 +321,7 @@ void History::clearLastKeyboard() { lastKeyboardFrom = 0; } -bool History::updateTyping(uint64 ms, uint32 dots, bool force) { - if (!ms) ms = getms(true); +bool History::updateTyping(uint64 ms, bool force) { bool changed = force; for (TypingUsers::iterator i = typing.begin(), e = typing.end(); i != e;) { if (ms >= i.value()) { @@ -369,7 +368,7 @@ bool History::updateTyping(uint64 ms, uint32 dots, bool force) { } } if (!typingStr.isEmpty()) { - if (typingText.lastDots(dots % 4)) { + if (typingText.lastDots(typingDots % 4)) { changed = true; } } @@ -1245,7 +1244,7 @@ void Histories::regSendAction(History *history, UserData *user, const MTPSendMes return; } - uint64 ms = getms(true); + uint64 ms = getms(); switch (action.type()) { case mtpc_sendMessageTypingAction: history->typing[user] = ms + 6000; break; case mtpc_sendMessageRecordVideoAction: history->sendActions.insert(user, SendAction(SendActionRecordVideo, ms + 6000)); break; @@ -1264,17 +1263,16 @@ void Histories::regSendAction(History *history, UserData *user, const MTPSendMes TypingHistories::const_iterator i = typing.find(history); if (i == typing.cend()) { typing.insert(history, ms); - history->typingFrame = 0; + history->typingDots = 0; + _a_typings.start(); } - - history->updateTyping(ms, history->typingFrame, true); - _a_typings.start(); + history->updateTyping(ms, true); } void Histories::step_typings(uint64 ms, bool timer) { for (TypingHistories::iterator i = typing.begin(), e = typing.end(); i != e;) { - uint32 typingFrame = (ms - i.value()) / 150; - i.key()->updateTyping(ms, typingFrame); + i.key()->typingDots = (ms - i.value()) / 150; + i.key()->updateTyping(ms); if (i.key()->typing.isEmpty() && i.key()->sendActions.isEmpty()) { i = typing.erase(i); } else { @@ -1815,16 +1813,16 @@ void History::unregTyping(UserData *from) { uint64 updateAtMs = 0; TypingUsers::iterator i = typing.find(from); if (i != typing.end()) { - updateAtMs = getms(true); + updateAtMs = getms(); i.value() = updateAtMs; } SendActionUsers::iterator j = sendActions.find(from); if (j != sendActions.end()) { - if (!updateAtMs) updateAtMs = getms(true); + if (!updateAtMs) updateAtMs = getms(); j.value().until = updateAtMs; } if (updateAtMs) { - updateTyping(updateAtMs, 0, true); + updateTyping(updateAtMs, true); } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index b6a3821696..063e4bf42b 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -264,7 +264,7 @@ public: } void paintDialog(Painter &p, int32 w, bool sel) const; - bool updateTyping(uint64 ms = 0, uint32 dots = 0, bool force = false); + bool updateTyping(uint64 ms, bool force = false); void clearLastKeyboard(); typedef QList Blocks; @@ -310,7 +310,7 @@ public: SendActionUsers sendActions; QString typingStr; Text typingText; - uint32 typingFrame; + uint32 typingDots; QMap mySendActions; typedef QList MediaOverview; From f2824f79f635a2254ae33a087bc7d5b615caa71f Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 5 Jan 2016 14:11:18 +0800 Subject: [PATCH 007/316] improved forwarded media display, 0.9.18 --- Telegram/SourceFiles/history.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 063e4bf42b..d192044d7b 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1323,7 +1323,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const { - return !_caption.isEmpty() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return _caption.isEmpty(); @@ -1331,9 +1331,6 @@ public: bool hideFromName() const { return true; } - bool hideForwardedFrom() const { - return true; - } protected: @@ -1392,7 +1389,7 @@ public: ImagePtr replyPreview(); bool needsBubble(const HistoryItem *parent) const { - return !_caption.isEmpty() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return _caption.isEmpty(); @@ -1400,9 +1397,6 @@ public: bool hideFromName() const { return true; } - bool hideForwardedFrom() const { - return true; - } protected: @@ -1628,7 +1622,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const { - return !_caption.isEmpty() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return _caption.isEmpty(); @@ -1636,9 +1630,6 @@ public: bool hideFromName() const { return true; } - bool hideForwardedFrom() const { - return true; - } ~HistoryGif(); @@ -2165,7 +2156,7 @@ public: } QString selectedText(uint32 selection) const; bool displayForwardedFrom() const { - return via() || !_media || !_media->isDisplayed() || !_media->hideForwardedFrom(); + return via() || !_media || !_media->isDisplayed() || (fwdFrom->isChannel() || !_media->hideForwardedFrom()); } HistoryForwarded *toHistoryForwarded() { From afb40b8289b9afbe0e2c38a1cf3a383c69f73dba Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 5 Jan 2016 14:59:57 +0800 Subject: [PATCH 008/316] ffmpeg threadsafety critical bug fixed, display gif time and status / views added, 0.9.18 --- Telegram/SourceFiles/audio.cpp | 17 +++++------- Telegram/SourceFiles/history.cpp | 9 +++---- Telegram/SourceFiles/main.cpp | 2 +- Telegram/SourceFiles/types.cpp | 44 +++++++++++++++++++++++++++----- Telegram/SourceFiles/types.h | 8 +++--- 5 files changed, 51 insertions(+), 29 deletions(-) diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 6a5be7b68d..1f86108be0 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -97,11 +97,6 @@ bool _checkALError() { Q_DECLARE_METATYPE(AudioMsgId); Q_DECLARE_METATYPE(SongMsgId); void audioInit() { - if (!audioDevice) { - av_register_all(); - avcodec_register_all(); - } - if (!capture) { capture = new AudioCapture(); cSetHasAudioCapture(capture->check()); @@ -114,7 +109,7 @@ void audioInit() { LOG(("Audio Error: default sound device not present.")); return; } - + ALCint attributes[] = { ALC_STEREO_SOURCES, 8, 0 }; audioContext = alcCreateContext(audioDevice, attributes); alcMakeContextCurrent(audioContext); @@ -516,7 +511,7 @@ void AudioPlayer::play(const SongMsgId &song, int64 position) { bool AudioPlayer::checkCurrentALError(MediaOverviewType type) { if (_checkALError()) return true; - + switch (type) { case OverviewAudios: setStoppedState(&_audioData[_audioCurrent], AudioPlayerStoppedAtError); @@ -1091,7 +1086,7 @@ protected: QFile f; int32 dataPos; - + bool openFile() { if (data.isEmpty()) { if (f.isOpen()) f.close(); @@ -1884,7 +1879,7 @@ void AudioCaptureInner::onInit() { } void AudioCaptureInner::onStart() { - + // Start OpenAL Capture const ALCchar *dName = alcGetString(0, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER); DEBUG_LOG(("Audio Info: Capture device name '%1'").arg(dName)); @@ -1905,7 +1900,7 @@ void AudioCaptureInner::onStart() { // Create encoding context d->ioBuffer = (uchar*)av_malloc(AVBlockSize); - + d->ioContext = avio_alloc_context(d->ioBuffer, AVBlockSize, 1, static_cast(d), &AudioCapturePrivate::_read_data, &AudioCapturePrivate::_write_data, &AudioCapturePrivate::_seek_data); int res = 0; char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; @@ -2390,7 +2385,7 @@ public: QString title() { return _title; } - + QString performer() { return _performer; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 9406884483..9d3180ad6b 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4596,18 +4596,15 @@ void HistoryGif::draw(Painter &p, const HistoryItem *parent, const QRect &r, boo p.setFont(st::normalFont); p.setPen(st::white); p.drawTextLeft(statusX, statusY, _width, _statusText, statusW - 2 * st::msgDateImgPadding.x()); - - // date - if (_caption.isEmpty() && parent->getMedia() == this) { - int32 fullRight = skipx + width, fullBottom = skipy + height; - parent->drawInfo(p, fullRight, fullBottom, 2 * skipx + width, selected, InfoDisplayOverImage); - } } } if (!_caption.isEmpty()) { p.setPen(st::black); _caption.draw(p, st::msgPadding.left(), skipy + height + st::mediaPadding.bottom() + st::mediaCaptionSkip, captionw); + } else if (parent->getMedia() == this) { + int32 fullRight = skipx + width, fullBottom = skipy + height; + parent->drawInfo(p, fullRight, fullBottom, 2 * skipx + width, selected, InfoDisplayOverImage); } } diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 5fa9627cc0..deb1e3918a 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -32,7 +32,7 @@ int main(int argc, char *argv[]) { //signal(SIGSEGV, _sigsegvHandler); #endif - InitOpenSSL _init; + LibrariesInitializer _init; settingsParseArgs(argc, argv); for (int32 i = 0; i < argc; ++i) { diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 25a198f234..6d9e7e275b 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -99,7 +99,7 @@ namespace { clock_gettime(CLOCK_REALTIME, &ts); _msgIdMsStart = 1000000000 * uint64(ts.tv_sec) + uint64(ts.tv_nsec); #endif - + uint32 msgIdRand; memset_rand(&msgIdRand, sizeof(uint32)); _msgIdStart = (((uint64)((uint32)unixtime()) << 32) | (uint64)msgIdRand); @@ -187,6 +187,32 @@ namespace { delete l; } + int _ffmpegLockManager(void **mutex, AVLockOp op) { + switch (op) { + case AV_LOCK_CREATE: { + t_assert(*mutex == 0); + *mutex = reinterpret_cast(new QMutex()); + } break; + + case AV_LOCK_OBTAIN: { + t_assert(*mutex != 0); + reinterpret_cast(*mutex)->lock(); + } break; + + case AV_LOCK_RELEASE: { + t_assert(*mutex != 0); + reinterpret_cast(*mutex)->unlock(); + }; break; + + case AV_LOCK_DESTROY: { + t_assert(*mutex != 0); + delete reinterpret_cast(*mutex); + *mutex = 0; + } break; + } + return 0; + } + float64 _msFreq; float64 _msgIdCoef; int64 _msStart = 0, _msAddToMsStart = 0, _msAddToUnixtime = 0; @@ -238,7 +264,7 @@ namespace { _MsStarter _msStarter; } -InitOpenSSL::InitOpenSSL() { +LibrariesInitializer::LibrariesInitializer() { if (!RAND_status()) { // should be always inited in all modern OS char buf[16]; memcpy(buf, &_msStart, 8); @@ -262,10 +288,17 @@ InitOpenSSL::InitOpenSSL() { CRYPTO_set_dynlock_lock_callback(_sslLockFunction); CRYPTO_set_dynlock_destroy_callback(_sslDestroyFunction); + av_register_all(); + avcodec_register_all(); + + av_lockmgr_register(_ffmpegLockManager); + _sslInited = true; } -InitOpenSSL::~InitOpenSSL() { +LibrariesInitializer::~LibrariesInitializer() { + av_lockmgr_register(0); + delete[] _sslLocks; _sslLocks = 0; } @@ -640,10 +673,7 @@ char *hashMd5Hex(const int32 *hashmd5, void *dest) { } void memset_rand(void *data, uint32 len) { - if (!_sslInited) { - LOG(("Critical Error: memset_rand() called before OpenSSL init!")); - exit(-1); - } + t_assert(_sslInited); RAND_bytes((uchar*)data, len); } diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index e40a8d1dc5..0a6359661c 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -133,10 +133,10 @@ inline void mylocaltime(struct tm * _Tm, const time_t * _Time) { #endif } -class InitOpenSSL { +class LibrariesInitializer { public: - InitOpenSSL(); - ~InitOpenSSL(); + LibrariesInitializer(); + ~LibrariesInitializer(); }; bool checkms(); // returns true if time has changed @@ -144,7 +144,7 @@ uint64 getms(bool checked = false); class SingleTimer : public QTimer { // single shot timer with check Q_OBJECT - + public: SingleTimer(); From 47dee02de40af6aefd40f857014a3aeaa2a75a83 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 5 Jan 2016 15:23:44 +0800 Subject: [PATCH 009/316] fixed warning, 0.9.18 --- Telegram/SourceFiles/gui/animation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index e096845cde..dcadbbbf43 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -484,7 +484,7 @@ public: , _frameDelay(0) { } - bool readNextFrame(QImage &to, bool &hasAlpha, const QSize &size) { + bool readNextFrame() { if (_reader) _frameDelay = _reader->nextImageDelay(); if (_framesLeft < 1 && !jumpToStart()) { return false; From 931c249afe3262c151572e73ac9030e6576b5bb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 5 Jan 2016 15:42:36 +0800 Subject: [PATCH 010/316] fixed frame duration count, 0.9.18 version --- Telegram/SourceFiles/gui/animation.cpp | 37 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index dcadbbbf43..f5d59a9381 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -594,6 +594,11 @@ public: } bool readNextFrame() { + if (_frameRead) { + av_frame_unref(_frame); + _frameRead = false; + } + int res; while (true) { if (_avpkt.size > 0) { // previous packet not finished @@ -645,6 +650,20 @@ public: } if (got_frame) { + int64 duration = av_frame_get_pkt_duration(_frame); + int64 framePts = (_frame->pkt_pts == AV_NOPTS_VALUE) ? _frame->pkt_dts : _frame->pkt_pts; + int64 frameMs = (framePts * 1000LL * _fmtContext->streams[_streamId]->time_base.num) / _fmtContext->streams[_streamId]->time_base.den; + _currentFrameDelay = _nextFrameDelay; + if (_frameMs + _currentFrameDelay < frameMs) { + _currentFrameDelay = int32(frameMs - _frameMs); + } + if (duration == AV_NOPTS_VALUE) { + _nextFrameDelay = 0; + } else { + _nextFrameDelay = (duration * 1000LL * _fmtContext->streams[_streamId]->time_base.num) / _fmtContext->streams[_streamId]->time_base.den; + } + _frameMs = frameMs; + _hadFrame = _frameRead = true; return true; } @@ -707,20 +726,6 @@ public: } } - int64 duration = av_frame_get_pkt_duration(_frame); - int64 framePts = (_frame->pkt_pts == AV_NOPTS_VALUE) ? _frame->pkt_dts : _frame->pkt_pts; - int64 frameMs = (framePts * 1000LL * _fmtContext->streams[_streamId]->time_base.num) / _fmtContext->streams[_streamId]->time_base.den; - _currentFrameDelay = _nextFrameDelay; - if (_frameMs + _currentFrameDelay < frameMs) { - _currentFrameDelay = int32(frameMs - _frameMs); - } - if (duration == AV_NOPTS_VALUE) { - _nextFrameDelay = 0; - } else { - _nextFrameDelay = (duration * 1000LL * _fmtContext->streams[_streamId]->time_base.num) / _fmtContext->streams[_streamId]->time_base.den; - } - _frameMs = frameMs; - av_frame_unref(_frame); return true; } @@ -799,6 +804,10 @@ public: } ~FFMpegReaderImplementation() { + if (_frameRead) { + av_frame_unref(_frame); + _frameRead = false; + } if (_ioContext) av_free(_ioContext); if (_codecContext) avcodec_close(_codecContext); if (_swsContext) sws_freeContext(_swsContext); From 709c18e6fc04a125cc8e35d3f56eb144502c3bb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 6 Jan 2016 18:21:07 +0800 Subject: [PATCH 011/316] fixed crash when deleting replyTo msg via inline bot --- Telegram/SourceFiles/history.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 9d3180ad6b..cd309b382f 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7086,10 +7086,16 @@ HistoryItem *HistoryReply::replyToMessage() const { void HistoryReply::replyToReplaced(HistoryItem *oldItem, HistoryItem *newItem) { if (replyToMsg == oldItem) { + delete _replyToVia; + _replyToVia = 0; replyToMsg = newItem; if (!newItem) { replyToMsgId = 0; initDimensions(); + } else if (!replyToMsg->toHistoryForwarded()) { + if (UserData *bot = replyToMsg->viaBot()) { + _replyToVia = new HistoryMessageVia(peerToUser(bot->id)); + } } } } From 30785448924e40ac6f5c18a3d83c0b53562eaf15 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 7 Jan 2016 17:49:54 +0800 Subject: [PATCH 012/316] new media unsupported message and via @inlinebot are added to langs, links don't break on / now, cancel upload langs fixed --- Telegram/Resources/lang.strings | 6 ++-- Telegram/SourceFiles/gui/text.cpp | 37 +++++++++++++------- Telegram/SourceFiles/history.cpp | 48 ++++++++++++-------------- Telegram/SourceFiles/historywidget.cpp | 12 +++---- Telegram/SourceFiles/historywidget.h | 4 +-- Telegram/SourceFiles/mainwidget.cpp | 3 +- 6 files changed, 61 insertions(+), 49 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 7d8eddad43..79aee3ad76 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "Are you sure, you want to delete this group? All members will be removed and all messages will be lost."; "lng_message_empty" = "Empty Message"; -"lng_media_unsupported" = "Media Unsupported"; +"lng_message_unsupported" = "This message is not supported by your version of Telegram Desktop. Please update to the last version in Settings or install it from {link}"; "lng_action_add_user" = "{from} added {user}"; "lng_action_add_users_many" = "{from} added {users}"; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "Saved GIFs"; "lng_inline_bot_results" = "Results from {inline_bot}"; "lng_inline_bot_no_results" = "No results"; +"lng_inline_bot_via" = "via {inline_bot}"; "lng_box_remove" = "Remove"; @@ -793,7 +794,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_delete" = "Delete"; "lng_selected_forward" = "Forward"; "lng_selected_count" = "{count:_not_used_|# message|# messages}"; -"lng_selected_cancel_sure_this" = "Do you want to cancel this upload?"; +"lng_selected_cancel_sure_this" = "Cancel uploading?"; +"lng_selected_upload_stop" = "Stop"; "lng_selected_delete_sure_this" = "Do you want to delete this message?"; "lng_selected_delete_sure" = "Do you want to delete {count:_not_used_|# message|# messages}?"; "lng_box_delete" = "Delete"; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index fb8401019e..ac47b58e4d 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -263,7 +263,7 @@ const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink) class TextParser { public: - + static Qt::LayoutDirection stringDirection(const QString &str, int32 from, int32 to) { const ushort *p = reinterpret_cast(str.unicode()) + from; const ushort *end = p + (to - from); @@ -340,7 +340,7 @@ public: void getLinkData(const QString &original, QString &result, int32 &fullDisplayed) { if (!original.isEmpty() && original.at(0) == '/') { result = original; - fullDisplayed = -4; // bot command + fullDisplayed = -4; // bot command } else if (!original.isEmpty() && original.at(0) == '@') { result = original; fullDisplayed = -3; // mention @@ -454,7 +454,7 @@ public: while (waitingEntity != entitiesEnd && waitingEntity->length <= 0) ++waitingEntity; } } - + bool readCommand() { const QChar *afterCmd = textSkipCommand(ptr, end, links.size() < 0x7FFF); if (afterCmd == ptr) { @@ -975,7 +975,7 @@ public: void initParagraphBidi() { if (!_parLength || !_parAnalysis.isEmpty()) return; - + Text::TextBlocks::const_iterator i = _parStartBlock, e = _t->_blocks.cend(), n = i + 1; bool ignore = false; @@ -1340,7 +1340,7 @@ public: *_getSymbolAfter = false; *_getSymbolUpon = ((_lnkX >= _x) && (_lineStart > 0)) ? true : false; } - return false; + return false; } else if (_lnkX >= x + (_w - _wLeft)) { if (_parDirection == Qt::RightToLeft) { *_getSymbol = _lineStart; @@ -2428,7 +2428,7 @@ private: style::font _f; QFixed _x, _w, _wLeft; int32 _y, _yDelta, _lineHeight, _fontHeight; - + // elided hack support int32 _blocksSize; int32 _elideSavedIndex; @@ -2913,7 +2913,7 @@ QString Text::original(uint16 selectedFrom, uint16 selectedTo, ExpandLinksMode m result.reserve(_text.size()); int32 lnkFrom = 0, lnkIndex = 0; - for (TextBlocks::const_iterator i = _blocks.cbegin(), e = _blocks.cend(); true; ++i) { + for (TextBlocks::const_iterator i = _blocks.cbegin(), e = _blocks.cend(); true; ++i) { int32 blockLnkIndex = (i == e) ? 0 : (*i)->lnkIndex(); int32 blockFrom = (i == e) ? _text.size() : (*i)->from(); if (blockLnkIndex != lnkIndex) { @@ -3156,7 +3156,8 @@ namespace { class BlockParser { public: - BlockParser(QTextEngine *e, TextBlock *b, QFixed minResizeWidth, int32 blockFrom) : block(b), eng(e) { + BlockParser(QTextEngine *e, TextBlock *b, QFixed minResizeWidth, int32 blockFrom, const QString &str) + : block(b), eng(e), str(str) { parseWords(minResizeWidth, blockFrom); } @@ -3234,7 +3235,7 @@ public: if (lbh.currentPosition >= eng->layoutData->string.length() || attributes[lbh.currentPosition].whiteSpace - || attributes[lbh.currentPosition].lineBreak) { + || isLineBreak(attributes, lbh.currentPosition)) { lbh.adjustRightBearing(); block->_words.push_back(TextWord(wordStart + blockFrom, lbh.tmpData.textWidth, qMin(QFixed(), lbh.rightBearing))); block->_width += lbh.tmpData.textWidth; @@ -3281,10 +3282,19 @@ public: } } + bool isLineBreak(const QCharAttributes *attributes, int32 index) { + bool lineBreak = attributes[index].lineBreak; + if (lineBreak && block->lnkIndex() > 0 && index > 0 && str.at(index - 1) == '/') { + return false; // don't break after / in links + } + return lineBreak; + } + private: TextBlock *block; QTextEngine *eng; + const QString &str; }; @@ -3318,14 +3328,15 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi } } - QStackTextEngine engine(str.mid(_from, length), blockFont->f); + QString part = str.mid(_from, length); + QStackTextEngine engine(part, blockFont->f); engine.itemize(); QTextLayout layout(&engine); layout.beginLayout(); layout.createLine(); - BlockParser parser(&engine, this, minResizeWidth, _from); + BlockParser parser(&engine, this, minResizeWidth, _from, part); layout.endLayout(); } @@ -3687,7 +3698,7 @@ void initLinkSets() { namespace { // accent char list taken from https://github.com/aristus/accent-folding - inline QChar chNoAccent(int32 code) { + inline QChar chNoAccent(int32 code) { switch (code) { case 7834: return QChar(97); case 193: return QChar(97); @@ -4411,7 +4422,7 @@ QString textAccentFold(const QString &text) { result[i] = noAccent; } else { if (copying) result[i] = *ch; - ++ch, ++i; + ++ch, ++i; if (copying) result[i] = *ch; } } else { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index cd309b382f..2cc47fda1c 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1390,10 +1390,13 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo case mtpc_messageMediaUnsupported: default: badMedia = 1; break; } - if (false && badMedia == 1) { -// QString text(lng_message_unsupported(lt_link, qsl("https://desktop.telegram.org"))); + if (badMedia == 1) { + 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, 0); } else if (badMedia) { - result = new HistoryServiceMsg(this, block, m.vid.v, date(m.vdate), lang((badMedia == 2) ? lng_message_empty : lng_media_unsupported), m.vflags.v, 0, m.has_from_id() ? m.vfrom_id.v : 0); + 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); } else { if ((m.has_fwd_date() && m.vfwd_date.v > 0) || (m.has_fwd_from_id() && peerFromMTP(m.vfwd_from_id) != 0)) { result = new HistoryForwarded(this, block, m); @@ -5979,10 +5982,10 @@ void ViaInlineBotLink::onClick(Qt::MouseButton button) const { } HistoryMessageVia::HistoryMessageVia(int32 userId) - : bot(App::userLoaded(peerFromUser(userId))) - , width(0) - , maxWidth(st::msgServiceNameFont->width(qsl("via @") + bot->username)) - , lnk(new ViaInlineBotLink(bot)) { +: bot(App::userLoaded(peerFromUser(userId))) +, width(0) +, maxWidth(bot ? st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + bot->username)) : 0) +, lnk(new ViaInlineBotLink(bot)) { } bool HistoryMessageVia::isNull() const { @@ -5990,22 +5993,17 @@ bool HistoryMessageVia::isNull() const { } void HistoryMessageVia::resize(int32 availw) { - if (width < maxWidth && availw > width) { + if (availw < 0) { + text = QString(); + width = 0; + } else { + text = lng_inline_bot_via(lt_inline_bot, '@' + bot->username); if (availw < maxWidth) { - text = st::msgServiceNameFont->elided(qsl("via @") + bot->username, availw); + text = st::msgServiceNameFont->elided(text, availw); width = st::msgServiceNameFont->width(text); - } else { - text = qsl("via @") + bot->username; + } else if (width < maxWidth) { width = maxWidth; } - } else if (availw < width) { - if (availw > 0) { - text = st::msgServiceNameFont->elided(qsl("via @") + bot->username, availw); - width = st::msgServiceNameFont->width(text); - } else { - text = QString(); - width = 0; - } } } @@ -6024,11 +6022,11 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, const MTPD } HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, HistoryMedia *fromMedia) : -HistoryItem(history, block, msgId, flags, date, from) +HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via(viaBotId ? new HistoryMessageVia(viaBotId) : 0) +, _via((flags & MTPDmessage::flag_via_bot_id) ? new HistoryMessageVia(viaBotId) : 0) , _media(0) , _views(fromChannel() ? 1 : -1) { initTime(); @@ -6040,11 +6038,11 @@ HistoryItem(history, block, msgId, flags, date, from) } 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, from) +HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via(viaBotId ? new HistoryMessageVia(viaBotId) : 0) +, _via((flags & MTPDmessage::flag_via_bot_id) ? new HistoryMessageVia(viaBotId) : 0) , _media(0) , _views(fromChannel() ? 1 : -1) { initTime(); @@ -6053,11 +6051,11 @@ HistoryItem(history, block, msgId, flags, date, from) } 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, from) +HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via(viaBotId ? new HistoryMessageVia(viaBotId) : 0) +, _via((flags & MTPDmessage::flag_via_bot_id) ? new HistoryMessageVia(viaBotId) : 0) , _media(0) , _views(fromChannel() ? 1 : -1) { initTime(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 703aa35efb..bc412b9d0a 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6368,11 +6368,11 @@ void HistoryWidget::onFieldTabbed() { } void HistoryWidget::onStickerSend(DocumentData *sticker) { - sendExistingDocument(sticker, QString(), 0); + sendExistingDocument(sticker, QString()); } void HistoryWidget::onPhotoSend(PhotoData *photo) { - sendExistingPhoto(photo, QString(), 0); + sendExistingPhoto(photo, QString()); } void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { @@ -6495,7 +6495,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { _field.setFocus(); } -void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &caption, UserData *bot) { +void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &caption) { if (!_history || !doc || !canSendMessages(_peer)) return; App::main()->readServerHistory(_history, false); @@ -6519,7 +6519,7 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti } else { flags |= MTPDmessage::flag_from_id; } - _history->addNewDocument(newId.msg, flags, bot ? peerToUser(bot->id) : 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), doc, caption); + _history->addNewDocument(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), 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); App::main()->finishForwarding(_history, _broadcast.checked()); @@ -6536,7 +6536,7 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti _field.setFocus(); } -void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption, UserData *bot) { +void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption) { if (!_history || !photo || !canSendMessages(_peer)) return; App::main()->readServerHistory(_history, false); @@ -6560,7 +6560,7 @@ void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption, } else { flags |= MTPDmessage::flag_from_id; } - _history->addNewPhoto(newId.msg, flags, bot ? peerToUser(bot->id) : 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), photo, caption); + _history->addNewPhoto(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), 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); App::main()->finishForwarding(_history, _broadcast.checked()); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 24a9bdad5b..1936ccbb4e 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -693,8 +693,8 @@ private: IconedButton _replyForwardPreviewCancel; void updateReplyToName(); - void sendExistingDocument(DocumentData *doc, const QString &caption, UserData *bot); - void sendExistingPhoto(PhotoData *photo, const QString &caption, UserData *bot); + void sendExistingDocument(DocumentData *doc, const QString &caption); + void sendExistingPhoto(PhotoData *photo, const QString &caption); void drawField(Painter &p); void drawRecordButton(Painter &p); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 28cf54a838..a846f9aed3 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -907,7 +907,8 @@ void MainWidget::forwardLayer(int32 forwardSelected) { void MainWidget::deleteLayer(int32 selectedCount) { QString str((selectedCount < 0) ? lang(selectedCount < -1 ? lng_selected_cancel_sure_this : lng_selected_delete_sure_this) : lng_selected_delete_sure(lt_count, selectedCount)); - ConfirmBox *box = new ConfirmBox((selectedCount < 0) ? str : str.arg(selectedCount), lang(lng_box_delete)); + QString btn(lang((selectedCount < -1) ? lng_selected_upload_stop : lng_box_delete)), cancel(lang((selectedCount < -1) ? lng_continue : lng_cancel)); + ConfirmBox *box = new ConfirmBox(str, btn, st::defaultBoxButton, cancel); if (selectedCount < 0) { if (selectedCount < -1) { if (HistoryItem *item = App::contextItem()) { From a39810a9c51333bac6f71972b218c7d61fcbc91f Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Jan 2016 11:25:50 +0800 Subject: [PATCH 013/316] text render fixed when having text blocks that contain only spaces --- Telegram/SourceFiles/gui/text.cpp | 47 +++++++++++++++---------------- Telegram/SourceFiles/history.cpp | 2 +- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index ac47b58e4d..328762ab26 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -1111,6 +1111,15 @@ public: if (_btype == TextBlockTText) { TextBlock *t = static_cast(b); + if (t->_words.isEmpty()) { // no words in this block, spaces only => layout this block in the same line + last_rPadding += lpadding; + + _lineHeight = qMax(_lineHeight, blockHeight); + + longWordLine = false; + continue; + } + QFixed f_wLeft = _wLeft; // vars for saving state of the last word start int32 f_lineHeight = _lineHeight; // f points to the last word-start element of t->_words for (TextBlock::TextWords::const_iterator j = t->_words.cbegin(), en = t->_words.cend(), f = j; j != en; ++j) { @@ -1166,28 +1175,6 @@ public: f_wLeft = _wLeft; f_lineHeight = _lineHeight; } - if (lpadding > 0) { // no words in this block, spaces only - int32 elidedLineHeight = qMax(_lineHeight, blockHeight); - bool elidedLine = _elideLast && (_y + elidedLineHeight >= _yToElide); - if (elidedLine) { - _lineHeight = elidedLineHeight; - } - ushort nextStart = _blockEnd(_t, i, e); - if (!drawLine(nextStart, i + 1, e)) return; - _y += _lineHeight; - _lineHeight = qMax(0, blockHeight); - _lineStart = nextStart; - _lineStartBlock = blockIndex + 1; - - last_rBearing = _rb; - last_rPadding = b->rpadding(); - _wLeft = _w; - if (_elideLast && _elideRemoveFromEnd > 0 && (_y + blockHeight >= _yToElide)) { - _wLeft -= _elideRemoveFromEnd; - } - - longWordLine = true; - } continue; } @@ -2762,8 +2749,8 @@ int32 Text::countHeight(int32 w) const { longWordLine = true; continue; } - widthLeft -= b->f_lpadding(); - QFixed newWidthLeft = widthLeft - last_rBearing - (last_rPadding + b->f_width() - _rb); + QFixed lpadding = b->f_lpadding(); + QFixed newWidthLeft = widthLeft - lpadding - last_rBearing - (last_rPadding + b->f_width() - _rb); if (newWidthLeft >= 0) { last_rBearing = _rb; last_rPadding = b->f_rpadding(); @@ -2777,13 +2764,23 @@ int32 Text::countHeight(int32 w) const { if (_btype == TextBlockTText) { TextBlock *t = static_cast(b); + if (t->_words.isEmpty()) { // no words in this block, spaces only => layout this block in the same line + last_rPadding += lpadding; + + lineHeight = qMax(lineHeight, blockHeight); + + longWordLine = false; + continue; + } + QFixed f_wLeft = widthLeft; int32 f_lineHeight = lineHeight; for (TextBlock::TextWords::const_iterator j = t->_words.cbegin(), e = t->_words.cend(), f = j; j != e; ++j) { bool wordEndsHere = (j->width >= 0); QFixed j_width = wordEndsHere ? j->width : -j->width; - QFixed newWidthLeft = widthLeft - last_rBearing - (last_rPadding + j_width - j->f_rbearing()); + QFixed newWidthLeft = widthLeft - lpadding - last_rBearing - (last_rPadding + j_width - j->f_rbearing()); + lpadding = 0; if (newWidthLeft >= 0) { last_rBearing = j->f_rbearing(); last_rPadding = j->rpadding; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2cc47fda1c..333ca80b0d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6542,7 +6542,7 @@ void HistoryMessage::drawMessageText(Painter &p, QRect trect, uint32 selection) p.setFont(st::msgFont); 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::AlignLeft, 0, -1, selectedFrom, selectedTo); + _text.draw(p, trect.x(), trect.y(), trect.width(), style::al_left, 0, -1, selectedFrom, selectedTo); } void HistoryMessage::destroy() { From f66c54ee6b3849f2711f7e7724151e6960d5bd75 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 9 Jan 2016 15:11:23 +0800 Subject: [PATCH 014/316] not loaded thumbs are now white, always initDimensions() when media is updated --- Telegram/SourceFiles/app.cpp | 6 +- Telegram/SourceFiles/gui/flatbutton.cpp | 24 +++-- Telegram/SourceFiles/gui/images.cpp | 21 ++++- Telegram/SourceFiles/history.cpp | 113 ++++++++++++------------ Telegram/SourceFiles/history.h | 30 +++---- Telegram/SourceFiles/mainwidget.cpp | 11 ++- 6 files changed, 110 insertions(+), 95 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 045f77865a..5898cf1aca 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -902,12 +902,12 @@ 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->updateMedia(m.has_media() ? (&m.vmedia) : 0, true); existing->addToOverview(AddToOverviewNew); - existing->setViewsCount(m.has_views() ? m.vviews.v : -1); if (!existing->detached()) { App::checkSavedGif(existing); @@ -929,6 +929,8 @@ namespace App { Local::writeSavedGifs(); if (App::main()) emit App::main()->savedGifsUpdated(); + cSetLastSavedGifsUpdate(0); + App::main()->updateStickers(); } } diff --git a/Telegram/SourceFiles/gui/flatbutton.cpp b/Telegram/SourceFiles/gui/flatbutton.cpp index e41f13b355..1df0ac6642 100644 --- a/Telegram/SourceFiles/gui/flatbutton.cpp +++ b/Telegram/SourceFiles/gui/flatbutton.cpp @@ -311,21 +311,19 @@ void EmojiButton::paintEvent(QPaintEvent *e) { p.drawPixmap(t, App::sprite(), i); } - QRect inner(QPoint((width() - st::emojiCircle.width()) / 2, st::emojiCircleTop), st::emojiCircle); - int32 full = 5760; - int32 start = qRound(full * float64(ms % uint64(st::emojiCirclePeriod)) / st::emojiCirclePeriod), part = qRound(full / st::emojiCirclePart); - - p.setBrush(Qt::NoBrush); - p.setRenderHint(QPainter::HighQualityAntialiasing); - - p.setPen(QPen(st::emojiCircleFg->c, st::emojiCircleLine)); p.setOpacity(a_opacity.current() * _opacity); - p.drawEllipse(inner); - - p.setPen(QPen(st::white->c, st::emojiCircleLine)); - p.setOpacity(loading); - p.drawArc(inner, (full - start) % full, part); + p.setPen(QPen(st::emojiCircleFg, st::emojiCircleLine)); + p.setBrush(Qt::NoBrush); + p.setRenderHint(QPainter::HighQualityAntialiasing); + QRect inner(QPoint((width() - st::emojiCircle.width()) / 2, st::emojiCircleTop), st::emojiCircle); + if (loading > 0) { + int32 full = 5760; + int32 start = qRound(full * float64(ms % uint64(st::emojiCirclePeriod)) / st::emojiCirclePeriod), part = qRound(loading * full / st::emojiCirclePart); + p.drawArc(inner, start, full - part); + } else { + p.drawEllipse(inner); + } p.setRenderHint(QPainter::HighQualityAntialiasing, false); } diff --git a/Telegram/SourceFiles/gui/images.cpp b/Telegram/SourceFiles/gui/images.cpp index f8e3b18718..6437abf3f2 100644 --- a/Telegram/SourceFiles/gui/images.cpp +++ b/Telegram/SourceFiles/gui/images.cpp @@ -365,7 +365,7 @@ yi += stride; #undef update } - + delete[] rgb; } } @@ -444,7 +444,7 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r { QPainter p(&result); if (w < outerw || h < outerh) { - p.fillRect(0, 0, result.width(), result.height(), st::black->b); + p.fillRect(0, 0, result.width(), result.height(), st::black); } p.drawImage((result.width() - img.width()) / (2 * cIntRetinaFactor()), (result.height() - img.height()) / (2 * cIntRetinaFactor()), img); } @@ -459,7 +459,12 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) const { if (!loading()) const_cast(this)->load(); restore(); - if (_data.isNull()) return blank()->pix(); + if (_data.isNull()) { + if (h <= 0 && height() > 0) { + h = qRound(width() * w / float64(height())); + } + return blank()->pixNoCache(w, h, smooth, blurred, rounded, outerw, outerh); + } if (isNull() && outerw > 0 && outerh > 0) { outerw *= cIntRetinaFactor(); @@ -470,7 +475,15 @@ QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool roun { QPainter p(&result); - p.fillRect(0, 0, result.width(), result.height(), st::black); + if (w < outerw) { + p.fillRect(0, 0, (outerw - w) / 2, result.height(), st::black); + p.fillRect(((outerw - w) / 2) + w, 0, result.width() - (((outerw - w) / 2) + w), result.height(), st::black); + } + if (h < outerh) { + p.fillRect(qMax(0, (outerw - w) / 2), 0, qMin(result.width(), w), (outerh - h) / 2, st::black); + p.fillRect(qMax(0, (outerw - w) / 2), ((outerh - h) / 2) + h, qMin(result.width(), w), result.height() - (((outerh - h) / 2) + h), st::black); + } + 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); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 333ca80b0d..7fc28f5f18 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1318,7 +1318,11 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo result->attach(block); } if (msg.type() == mtpc_message) { - result->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0, (block ? false : true)); + result->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0); + result->initDimensions(); + if (!block) { + Notify::historyItemResized(result); + } if (applyServiceAction) { App::checkSavedGif(result); } @@ -3430,7 +3434,7 @@ void HistoryPhoto::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x } } -void HistoryPhoto::updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { +void HistoryPhoto::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaPhoto) { const MTPPhoto &photo(media.c_messageMediaPhoto().vphoto); App::feedPhoto(photo, _data); @@ -3628,9 +3632,7 @@ void HistoryVideo::draw(Painter &p, const HistoryItem *parent, const QRect &r, b } QRect rthumb(rtlrect(skipx, skipy, width, height, _width)); - - QPixmap pix = _data->thumb->pixBlurredSingle(_thumbw, 0, width, height); - p.drawPixmap(rthumb.topLeft(), pix); + p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(_thumbw, 0, width, height)); if (selected) { App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); } @@ -3929,7 +3931,7 @@ void HistoryAudio::unregItem(HistoryItem *item) { App::unregAudioItem(_data, item); } -void HistoryAudio::updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { +void HistoryAudio::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaAudio) { App::feedAudio(media.c_messageMediaAudio().vaudio, _data); if (!_data->data().isEmpty()) { @@ -3990,18 +3992,6 @@ HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, if (!caption.isEmpty()) { _caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent)); } - - if (withThumb()) { - _data->thumb->load(); - int32 tw = _data->thumb->width(), th = _data->thumb->height(); - if (tw > th) { - _thumbw = (tw * st::msgFileThumbSize) / th; - } else { - _thumbw = st::msgFileThumbSize; - } - } else { - _thumbw = 0; - } } HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedia() @@ -4021,6 +4011,18 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) { _caption.setSkipBlock(parent->skipBlockWidth(), parent->skipBlockHeight()); } + if (withThumb()) { + _data->thumb->load(); + int32 tw = _data->thumb->width(), th = _data->thumb->height(); + if (tw > th) { + _thumbw = (tw * st::msgFileThumbSize) / th; + } else { + _thumbw = st::msgFileThumbSize; + } + } else { + _thumbw = 0; + } + _maxw = st::msgFileMinWidth; int32 tleft = 0, tright = 0; @@ -4098,12 +4100,8 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r bottom = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); QRect rthumb(rtlrect(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbSize, st::msgFileThumbSize, _width)); - if (_data->thumb->loaded()) { - QPixmap thumb = loaded ? _data->thumb->pixSingle(_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize) : _data->thumb->pixBlurredSingle(_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize); - p.drawPixmap(rthumb.topLeft(), thumb); - } else { - App::roundRect(p, rthumb, st::black, BlackCorners); - } + QPixmap thumb = loaded ? _data->thumb->pixSingle(_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize) : _data->thumb->pixBlurredSingle(_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize); + p.drawPixmap(rthumb.topLeft(), thumb); if (selected) { App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); } @@ -4348,7 +4346,7 @@ void HistoryDocument::unregItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } -void HistoryDocument::updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { +void HistoryDocument::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaDocument) { App::feedDocument(media.c_messageMediaDocument().vdocument, _data); } @@ -4689,7 +4687,7 @@ void HistoryGif::unregItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } -void HistoryGif::updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { +void HistoryGif::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaDocument) { App::feedDocument(media.c_messageMediaDocument().vdocument, _data); } @@ -4884,7 +4882,7 @@ void HistorySticker::unregItem(HistoryItem *item) { App::unregDocumentItem(_data, item); } -void HistorySticker::updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { +void HistorySticker::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaDocument) { App::feedDocument(media.c_messageMediaDocument().vdocument, _data); if (!_data->data().isEmpty()) { @@ -5057,14 +5055,12 @@ void HistoryContact::unregItem(HistoryItem *item) { } } -void HistoryContact::updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { +void HistoryContact::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaContact) { if (_userId != media.c_messageMediaContact().vuser_id.v) { unregItem(parent); _userId = media.c_messageMediaContact().vuser_id.v; regItem(parent); - parent->initDimensions(); - if (allowEmitResize) Notify::historyItemResized(parent); } } } @@ -5887,7 +5883,7 @@ void HistoryImageLink::draw(Painter &p, const HistoryItem *parent, const QRect & } p.drawPixmap(QPoint(skipx, skipy), pix); } else { - App::roundRect(p, skipx, skipy, width, height, st::black, BlackCorners); + App::roundRect(p, skipx, skipy, width, height, st::white, MessageInCorners); } if (selected) { App::roundRect(p, skipx, skipy, width, height, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); @@ -6194,9 +6190,17 @@ void HistoryMessage::initDimensions() { if (maxw > _maxw) _maxw = maxw; _minh += _media->minHeight(); } - if (!_media && !displayFromName() && via() && !toHistoryForwarded()) { - if (st::msgPadding.left() + via()->maxWidth + st::msgPadding.right() > _maxw) { - _maxw = st::msgPadding.left() + via()->maxWidth + st::msgPadding.right(); + if (!_media) { + if (displayFromName()) { + int32 namew = st::msgPadding.left() + _from->nameText.maxWidth() + st::msgPadding.right(); + if (via() && !toHistoryForwarded()) { + namew += st::msgServiceFont->spacew + via()->maxWidth; + } + if (namew > _maxw) _maxw = namew; + } else if (via() && !toHistoryForwarded()) { + if (st::msgPadding.left() + via()->maxWidth + st::msgPadding.right() > _maxw) { + _maxw = st::msgPadding.left() + via()->maxWidth + st::msgPadding.right(); + } } } } else { @@ -6204,7 +6208,6 @@ void HistoryMessage::initDimensions() { _maxw = _media->maxWidth(); _minh = _media->minHeight(); } - fromNameUpdated(); } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { @@ -6227,13 +6230,12 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { } } -void HistoryMessage::fromNameUpdated() const { - if (!_media && displayFromName()) { - int32 namew = st::msgPadding.left() + _from->nameText.maxWidth() + st::msgPadding.right(); +void HistoryMessage::fromNameUpdated(int32 width) const { + _fromVersion = _from->nameVersion; + if (drawBubble() && displayFromName()) { if (via() && !toHistoryForwarded()) { - namew += st::msgServiceFont->spacew + via()->maxWidth; + via()->resize(width - st::msgPadding.left() - st::msgPadding.right() - _from->nameText.maxWidth() - st::msgServiceFont->spacew); } - if (namew > _maxw) _maxw = namew; } } @@ -6287,7 +6289,7 @@ HistoryMedia *HistoryMessage::getMedia(bool inOverview) const { return _media; } -void HistoryMessage::setMedia(const MTPMessageMedia *media, bool allowEmitResize) { +void HistoryMessage::setMedia(const MTPMessageMedia *media) { if ((!_media || _media->isImageLink()) && (!media || media->type() == mtpc_messageMediaEmpty)) return; bool mediaWasDisplayed = false; @@ -6307,8 +6309,6 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media, bool allowEmitResize _textWidth = 0; _textHeight = 0; } - initDimensions(); - if (allowEmitResize) Notify::historyItemResized(this); } void HistoryMessage::setText(const QString &text, const EntitiesInText &entities) { @@ -6413,7 +6413,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width } } -void HistoryMessage::setViewsCount(int32 count) { +void HistoryMessage::setViewsCount(int32 count, bool reinit) { if (_views == count || (count >= 0 && _views > count)) return; int32 was = _viewsWidth; @@ -6428,8 +6428,10 @@ void HistoryMessage::setViewsCount(int32 count) { _textWidth = 0; _textHeight = 0; } - initDimensions(); - Notify::historyItemResized(this); + if (reinit) { + initDimensions(); + Notify::historyItemResized(this); + } } } @@ -6468,13 +6470,12 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m } } - if (_from->nameVersion > _fromVersion) { -// fromNameUpdated(); - _fromVersion = _from->nameVersion; - } - int32 left = 0, width = 0; countPositionAndSize(left, width); + if (_from->nameVersion > _fromVersion) { + fromNameUpdated(width); + } + if (displayFromPhoto()) { p.drawPixmap(left - st::msgPhotoSkip, _height - st::msgMargin.bottom() - st::msgPhotoSize, _from->photo->pixRounded(st::msgPhotoSize)); } @@ -6579,17 +6580,19 @@ int32 HistoryMessage::resize(int32 width) { } if (media) _height += _media->resize(width, this); } + + int32 l = 0, w = 0; + countPositionAndSize(l, w); + if (displayFromName()) { if (emptyText()) { _height += st::msgPadding.top() + st::msgNameFont->height + st::mediaHeaderSkip; } else { _height += st::msgNameFont->height; } - if (via() && !toHistoryForwarded()) { - via()->resize(width - st::msgPadding.left() - st::msgPadding.right() - _from->nameText.maxWidth() - st::msgServiceFont->spacew); - } + fromNameUpdated(w); } else if (via() && !toHistoryForwarded()) { - via()->resize(width - st::msgPadding.left() - st::msgPadding.right()); + via()->resize(w - st::msgPadding.left() - st::msgPadding.right()); if (emptyText() && !displayFromName()) { _height += st::msgPadding.top() + st::msgNameFont->height + st::mediaHeaderSkip; } else { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index d192044d7b..f176fc6f32 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -897,7 +897,7 @@ public: virtual bool serviceMsg() const { return false; } - virtual void updateMedia(const MTPMessageMedia *media, bool allowEmitResize) { + virtual void updateMedia(const MTPMessageMedia *media) { } virtual int32 addToOverview(AddToOverviewMethod method) { return 0; @@ -918,7 +918,7 @@ public: virtual void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const { } - virtual void setViewsCount(int32 count) { + virtual void setViewsCount(int32 count, bool reinit = true) { } virtual void setId(MsgId newId); virtual void setDate(const QDateTime &date) { // for date items @@ -1161,7 +1161,7 @@ public: virtual void unregItem(HistoryItem *item) { } - virtual void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize) { + virtual void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { } virtual bool isImageLink() const { @@ -1309,7 +1309,7 @@ public: return _data; } - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); void regItem(HistoryItem *item); void unregItem(HistoryItem *item); @@ -1451,7 +1451,7 @@ public: void regItem(HistoryItem *item); void unregItem(HistoryItem *item); - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); bool needsBubble(const HistoryItem *parent) const { return true; @@ -1519,7 +1519,7 @@ public: void regItem(HistoryItem *item); void unregItem(HistoryItem *item); - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); bool hasReplyPreview() const { return !_data->thumb->isNull(); @@ -1611,7 +1611,7 @@ public: void regItem(HistoryItem *item); void unregItem(HistoryItem *item); - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); bool hasReplyPreview() const { return !_data->thumb->isNull(); @@ -1686,7 +1686,7 @@ public: void regItem(HistoryItem *item); void unregItem(HistoryItem *item); - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); bool needsBubble(const HistoryItem *parent) const { return false; @@ -1745,7 +1745,7 @@ public: void regItem(HistoryItem *item); void unregItem(HistoryItem *item); - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); bool needsBubble(const HistoryItem *parent) const { return true; @@ -1988,7 +1988,7 @@ public: void initMedia(const MTPMessageMedia *media, QString ¤tText); void initMediaFromDocument(DocumentData *doc, const QString &caption); void initDimensions(); - void fromNameUpdated() const; + void fromNameUpdated(int32 width) const; virtual HistoryMessageVia *via() const { return (_via && !_via->isNull()) ? _via : 0; @@ -2017,7 +2017,7 @@ public: } void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const; - void setViewsCount(int32 count); + void setViewsCount(int32 count, bool reinit = true); void setId(MsgId newId); void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; @@ -2047,11 +2047,11 @@ public: QString notificationHeader() const; QString notificationText() const; - void updateMedia(const MTPMessageMedia *media, bool allowEmitResize) { + void updateMedia(const MTPMessageMedia *media) { if (media && _media && _media->type() != MediaTypeWebPage) { - _media->updateFrom(*media, this, allowEmitResize); + _media->updateFrom(*media, this); } else { - setMedia(media, allowEmitResize); + setMedia(media); } } int32 addToOverview(AddToOverviewMethod method); @@ -2060,7 +2060,7 @@ public: QString selectedText(uint32 selection) const; QString inDialogsText() const; HistoryMedia *getMedia(bool inOverview = false) const; - void setMedia(const MTPMessageMedia *media, bool allowEmitResize); + void setMedia(const MTPMessageMedia *media); void setText(const QString &text, const EntitiesInText &entities); QString originalText() const; EntitiesInText originalEntities() const; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index a846f9aed3..5ba5539b8e 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4128,12 +4128,11 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { feedUpdate(MTP_updateMessageID(d.vid, MTP_long(randomId))); // ignore real date if (peerId) { if (HistoryItem *item = App::histItemById(peerToChannel(peerId), d.vid.v)) { - if (!text.isEmpty()) { - item->setText(text, d.has_entities() ? entitiesFromMTP(d.ventities.c_vector().v) : EntitiesInText()); - item->initDimensions(); - Notify::historyItemResized(item); - } - item->updateMedia(d.has_media() ? (&d.vmedia) : 0, true); + 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); } } From a72a31e722044ec84b394bfd4274a462df0e0096 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 9 Jan 2016 19:24:16 +0800 Subject: [PATCH 015/316] stickers by alt suggestions in mentions dropdown --- Telegram/SourceFiles/apiwrap.cpp | 10 +- Telegram/SourceFiles/app.cpp | 1 + Telegram/SourceFiles/boxes/stickersetbox.cpp | 10 +- Telegram/SourceFiles/dropdown.cpp | 320 +++++++++++++------ Telegram/SourceFiles/dropdown.h | 25 +- Telegram/SourceFiles/facades.cpp | 80 +++++ Telegram/SourceFiles/facades.h | 26 ++ Telegram/SourceFiles/gui/emoji_config.h | 25 +- Telegram/SourceFiles/gui/flatinput.cpp | 16 +- Telegram/SourceFiles/gui/flattextarea.cpp | 2 +- Telegram/SourceFiles/gui/text.cpp | 5 +- Telegram/SourceFiles/history.cpp | 11 +- Telegram/SourceFiles/historywidget.cpp | 39 ++- Telegram/SourceFiles/historywidget.h | 2 + Telegram/SourceFiles/localstorage.cpp | 8 + Telegram/SourceFiles/logs.h | 8 +- Telegram/SourceFiles/main.cpp | 4 +- Telegram/SourceFiles/mainwidget.cpp | 10 +- Telegram/SourceFiles/settings.cpp | 1 - Telegram/SourceFiles/structs.cpp | 3 + Telegram/SourceFiles/types.cpp | 4 +- Telegram/SourceFiles/types.h | 10 +- 22 files changed, 471 insertions(+), 149 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 46b95ce1c3..6ae7881c1d 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -430,7 +430,7 @@ void ApiWrap::requestBots(ChannelData *peer) { void ApiWrap::gotChat(PeerData *peer, const MTPmessages_Chats &result) { _peerRequests.remove(peer); - + if (result.type() == mtpc_messages_chats) { const QVector &v(result.c_messages_chats().vchats.c_vector().v); bool badVersion = false; @@ -682,10 +682,11 @@ void ApiWrap::requestStickerSets() { void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) { _stickerSetRequests.remove(setId); - + if (result.type() != mtpc_messages_stickerSet) return; const MTPDmessages_stickerSet &d(result.c_messages_stickerSet()); - + const QVector &v(d.vpacks.c_vector().v); + if (d.vset.type() != mtpc_stickerSet) return; const MTPDstickerSet &s(d.vset.c_stickerSet()); @@ -731,12 +732,15 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) ++i; } } + + Global::StickersByEmoji_RemovePack(it->stickers); if (pack.isEmpty()) { int32 removeIndex = cStickerSetsOrder().indexOf(setId); if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); sets.erase(it); } else { it->stickers = pack; + Global::StickersByEmoji_AddPack(it->stickers); } if (writeRecent) { diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 5898cf1aca..31194084eb 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1969,6 +1969,7 @@ namespace App { if (api()) api()->clearWebPageRequests(); cSetRecentStickers(RecentStickerPack()); cSetStickerSets(StickerSets()); + Global::SetStickersByEmoji(StickersByEmojiMap()); cSetStickerSetsOrder(StickerSetsOrder()); cSetLastStickersUpdate(0); cSetSavedGifs(SavedGifs()); diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index b47ee602fd..b7f62f22be 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -50,7 +50,7 @@ void StickerSetInner::gotSet(const MTPmessages_StickerSet &set) { for (int32 i = 0, l = v.size(); i < l; ++i) { DocumentData *doc = App::feedDocument(v.at(i)); if (!doc || !doc->sticker()) continue; - + _pack.push_back(doc); } if (d.vset.type() == mtpc_stickerSet) { @@ -92,6 +92,7 @@ void StickerSetInner::installDone(const MTPBool &result) { _setFlags &= ~MTPDstickerSet::flag_disabled; sets.insert(_setId, StickerSet(_setId, _setAccess, _setTitle, _setShortName, _setCount, _setHash, _setFlags)).value().stickers = _pack; + Global::StickersByEmoji_AddPack(_pack); StickerSetsOrder &order(cRefStickerSetsOrder()); int32 insertAtIndex = 0, currentIndex = order.indexOf(_setId); @@ -507,7 +508,7 @@ void StickersInner::onUpdateSelected() { float64 StickersInner::aboveShadowOpacity() const { if (_above < 0) return 0; - + int32 dx = 0; int32 dy = qAbs(_above * _rowHeight + _rows.at(_above)->yadd.current() - _started * _rowHeight); return qMin((dx + dy) * 2. / _rowHeight, 1.); @@ -613,7 +614,7 @@ void StickersInner::rebuild() { clear(); const StickerSetsOrder &order(cStickerSetsOrder()); _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)); @@ -867,6 +868,7 @@ void StickersBox::onSave() { if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); sets.erase(it); } + Global::StickersByEmoji_RemovePack(it->stickers); } } } @@ -879,6 +881,7 @@ void StickersBox::onSave() { 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; + Global::StickersByEmoji_AddPack(it->stickers); } order.push_back(reorder.at(i)); } @@ -887,6 +890,7 @@ void StickersBox::onSave() { if (it->id == CustomStickerSetId || it->id == RecentStickerSetId || order.contains(it->id)) { ++it; } else { + Global::StickersByEmoji_RemovePack(it->stickers); it = sets.erase(it); } } diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index faa204bfb5..df94fa22f9 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -3564,6 +3564,7 @@ void EmojiPan::onRemoveSetSure() { Ui::hideLayer(); StickerSets::iterator it = cRefStickerSets().find(_removingSetId); if (it != cRefStickerSets().cend() && !(it->flags & MTPDstickerSet::flag_official)) { + Global::StickersByEmoji_RemovePack(it->stickers); if (it->id && it->access) { MTP::send(MTPmessages_UninstallStickerSet(MTP_inputStickerSetID(MTP_long(it->id), MTP_long(it->access)))); } else if (!it->shortName.isEmpty()) { @@ -3841,24 +3842,74 @@ void EmojiPan::recountContentMaxHeight() { updateContentHeight(); } -MentionsInner::MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows) +MentionsInner::MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows, StickerByEmojiRows *srows) : _parent(parent) , _mrows(mrows) , _hrows(hrows) , _brows(brows) +, _srows(srows) +, _stickersPerRow(1) +, _recentInlineBotsInRows(0) , _sel(-1) , _mouseSel(false) , _overDelete(false) { } void MentionsInner::paintEvent(QPaintEvent *e) { - QPainter p(this); + Painter p(this); + + QRect r(e->rect()); + if (r != rect()) p.setClipRect(r); int32 atwidth = st::mentionFont->width('@'), hashwidth = st::mentionFont->width('#'); int32 mentionleft = 2 * st::mentionPadding.left() + st::mentionPhotoSize; int32 mentionwidth = width() - mentionleft - 2 * st::mentionPadding.right(); int32 htagleft = st::btnAttachPhoto.width + st::taMsgField.textMrg.left() - st::lineWidth, htagwidth = width() - st::mentionPadding.right() - htagleft - st::mentionScroll.width; + if (!_srows->isEmpty()) { + int32 rows = rowscount(_srows->size(), _stickersPerRow); + int32 fromrow = floorclamp(r.y() - st::stickerPanPadding, st::stickerPanSize.height(), 0, rows); + int32 torow = ceilclamp(r.y() + r.height() - st::stickerPanPadding, st::stickerPanSize.height(), 0, rows); + int32 fromcol = floorclamp(r.x() - st::stickerPanPadding, st::stickerPanSize.width(), 0, _stickersPerRow); + int32 tocol = ceilclamp(r.x() + r.width() - st::stickerPanPadding, st::stickerPanSize.width(), 0, _stickersPerRow); + for (int32 row = fromrow; row < torow; ++row) { + for (int32 col = fromcol; col < tocol; ++col) { + int32 index = row * _stickersPerRow + col; + if (index >= _srows->size()) break; + + DocumentData *sticker = _srows->at(index); + if (!sticker->sticker()) continue; + + QPoint pos(st::stickerPanPadding + col * st::stickerPanSize.width(), st::stickerPanPadding + row * st::stickerPanSize.height()); + if (_sel == index) { + QPoint tl(pos); + if (rtl()) tl.setX(width() - tl.x() - st::stickerPanSize.width()); + App::roundRect(p, QRect(tl, st::stickerPanSize), st::emojiPanHover, StickerHoverCorners); + } + + bool goodThumb = !sticker->thumb->isNull() && ((sticker->thumb->width() >= 128) || (sticker->thumb->height() >= 128)); + if (goodThumb) { + sticker->thumb->load(); + } else { + sticker->checkSticker(); + } + + float64 coef = qMin((st::stickerPanSize.width() - st::msgRadius * 2) / float64(sticker->dimensions.width()), (st::stickerPanSize.height() - st::msgRadius * 2) / float64(sticker->dimensions.height())); + if (coef > 1) coef = 1; + int32 w = qRound(coef * sticker->dimensions.width()), h = qRound(coef * sticker->dimensions.height()); + if (w < 1) w = 1; + if (h < 1) h = 1; + QPoint ppos = pos + QPoint((st::stickerPanSize.width() - w) / 2, (st::stickerPanSize.height() - h) / 2); + if (goodThumb) { + p.drawPixmapLeft(ppos, width(), sticker->thumb->pix(w, h)); + } else if (!sticker->sticker()->img->isNull()) { + p.drawPixmapLeft(ppos, width(), sticker->sticker()->img->pix(w, h)); + } + } + } + return; + } + int32 from = qFloor(e->rect().top() / st::mentionHeight), to = qFloor(e->rect().bottom() / st::mentionHeight) + 1; int32 last = _mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size(); bool hasUsername = _parent->filter().indexOf('@') > 1; @@ -3970,6 +4021,10 @@ void MentionsInner::paintEvent(QPaintEvent *e) { p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerBottom() - st::lineWidth, width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); } +void MentionsInner::resizeEvent(QResizeEvent *e) { + _stickersPerRow = int32(width() - 2 * st::stickerPanPadding) / int32(st::stickerPanSize.width()); +} + void MentionsInner::mouseMoveEvent(QMouseEvent *e) { _mousePos = mapToGlobal(e->pos()); _mouseSel = true; @@ -3978,29 +4033,47 @@ void MentionsInner::mouseMoveEvent(QMouseEvent *e) { void MentionsInner::clearSel() { _mouseSel = _overDelete = false; - setSel((_mrows->isEmpty() && _brows->isEmpty() && _hrows->isEmpty()) ? -1 : 0); + setSel((_mrows->isEmpty() && _brows->isEmpty() && _hrows->isEmpty() && _srows->isEmpty()) ? -1 : 0); } -bool MentionsInner::moveSel(int direction) { +bool MentionsInner::moveSel(int key) { _mouseSel = false; - int32 maxSel = (_mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size()); + int32 maxSel = (_mrows->isEmpty() ? (_hrows->isEmpty() ? (_brows->isEmpty() ? _srows->size() : _brows->size()) : _hrows->size()) : _mrows->size()); + int32 direction = (key == Qt::Key_Up) ? -1 : (key == Qt::Key_Down ? 1 : 0); + if (!_srows->isEmpty()) { + if (key == Qt::Key_Left) { + direction = -1; + } else if (key == Qt::Key_Right) { + direction = 1; + } else { + direction *= _stickersPerRow; + } + } if (_sel >= maxSel || _sel < 0) { - if (direction < 0) { + if (direction < -1) { + setSel(((maxSel - 1) / _stickersPerRow) * _stickersPerRow, true); + } else if (direction < 0) { setSel(maxSel - 1, true); } else { setSel(0, true); } return (_sel >= 0 && _sel < maxSel); } - setSel((_sel + direction >= maxSel) ? -1 : (_sel + direction), true); + setSel((_sel + direction >= maxSel || _sel + direction < 0) ? -1 : (_sel + direction), true); return true; } bool MentionsInner::select() { - QString sel = getSelected(); - if (!sel.isEmpty()) { - emit chosen(sel); - return true; + if (!_srows->isEmpty()) { + if (_sel >= 0 && _sel < _srows->size()) { + emit selected(_srows->at(_sel)); + } + } else { + QString sel = getSelected(); + if (!sel.isEmpty()) { + emit chosen(sel); + return true; + } } return false; } @@ -4086,21 +4159,51 @@ void MentionsInner::leaveEvent(QEvent *e) { } } +void MentionsInner::updateSelectedRow() { + if (_sel >= 0) { + if (_srows->isEmpty()) { + update(0, _sel * st::mentionHeight, width(), st::mentionHeight); + } else { + int32 row = _sel / _stickersPerRow, col = _sel % _stickersPerRow; + update(st::stickerPanPadding + col * st::stickerPanSize.width(), st::stickerPanPadding + row * st::stickerPanSize.height(), st::stickerPanSize.width(), st::stickerPanSize.height()); + } + } +} + void MentionsInner::setSel(int sel, bool scroll) { - if (_sel >= 0) update(0, _sel * st::mentionHeight, width(), st::mentionHeight); + updateSelectedRow(); _sel = sel; - if (_sel >= 0) update(0, _sel * st::mentionHeight, width(), st::mentionHeight); - int32 maxSel = _mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size(); - if (scroll && _sel >= 0 && _sel < maxSel) emit mustScrollTo(_sel * st::mentionHeight, (_sel + 1) * st::mentionHeight); + updateSelectedRow(); + + if (scroll && _sel >= 0) { + if (_srows->isEmpty()) { + emit mustScrollTo(_sel * st::mentionHeight, (_sel + 1) * st::mentionHeight); + } else { + int32 row = _sel / _stickersPerRow; + emit mustScrollTo(st::stickerPanPadding + row * st::stickerPanSize.height(), st::stickerPanPadding + (row + 1) * st::stickerPanSize.height()); + } + } } void MentionsInner::onUpdateSelected(bool force) { QPoint mouse(mapFromGlobal(_mousePos)); if ((!force && !rect().contains(mouse)) || !_mouseSel) return; - int w = width(), mouseY = mouse.y(); - int32 sel = mouseY / int32(st::mentionHeight), maxSel = _mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size(); - _overDelete = (!_hrows->isEmpty() || (!_mrows->isEmpty() && sel < _recentInlineBotsInRows)) ? (mouse.x() >= w - st::mentionHeight) : false; + int32 sel = -1, maxSel = 0; + if (!_srows->isEmpty()) { + int32 rows = rowscount(_srows->size(), _stickersPerRow); + int32 row = (mouse.y() >= st::stickerPanPadding) ? ((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) : -1; + int32 col = (mouse.x() >= st::stickerPanPadding) ? ((mouse.x() - st::stickerPanPadding) / st::stickerPanSize.width()) : -1; + if (row >= 0 && col >= 0) { + sel = row * _stickersPerRow + col; + } + maxSel = _srows->size(); + _overDelete = false; + } else { + sel = mouse.y() / int32(st::mentionHeight); + maxSel = _mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size(); + _overDelete = (!_hrows->isEmpty() || (!_mrows->isEmpty() && sel < _recentInlineBotsInRows)) ? (mouse.x() >= width() - st::mentionHeight) : false; + } if (sel < 0 || sel >= maxSel) { sel = -1; } @@ -4119,7 +4222,7 @@ void MentionsInner::onParentGeometryChanged() { MentionsDropdown::MentionsDropdown(QWidget *parent) : TWidget(parent) , _scroll(this, st::mentionScroll) -, _inner(this, &_mrows, &_hrows, &_brows) +, _inner(this, &_mrows, &_hrows, &_brows, &_srows) , _chat(0) , _user(0) , _channel(0) @@ -4130,6 +4233,7 @@ MentionsDropdown::MentionsDropdown(QWidget *parent) : TWidget(parent) _hideTimer.setSingleShot(true); connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideStart())); connect(&_inner, SIGNAL(chosen(QString)), this, SIGNAL(chosen(QString))); + connect(&_inner, SIGNAL(selected(DocumentData*)), this, SIGNAL(stickerSelected(DocumentData*))); connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int))); connect(App::wnd(), SIGNAL(imageLoaded()), &_inner, SLOT(update())); @@ -4150,7 +4254,7 @@ MentionsDropdown::MentionsDropdown(QWidget *parent) : TWidget(parent) } void MentionsDropdown::paintEvent(QPaintEvent *e) { - QPainter p(this); + Painter p(this); if (_a_appearance.animating()) { p.setOpacity(a_opacity.current()); @@ -4158,29 +4262,43 @@ void MentionsDropdown::paintEvent(QPaintEvent *e) { return; } - p.fillRect(rect(), st::white->b); - + p.fillRect(rect(), st::white); } void MentionsDropdown::showFiltered(PeerData *peer, QString query, bool start) { - if (query.isEmpty() || (peer->isUser() && query.at(0) == '@' && (!start || cRecentInlineBots().isEmpty()))) { - if (!isHidden()) { - hideStart(); - } - return; - } - _chat = peer->asChat(); _user = peer->asUser(); _channel = peer->asChannel(); + if (query.isEmpty()) { + rowsUpdated(MentionRows(), HashtagRows(), BotCommandRows(), _srows, false); + return; + } + + _emoji = EmojiPtr(); + query = query.toLower(); - bool toDown = (_filter != query); - if (toDown) { + bool resetScroll = (_filter != query); + if (resetScroll) { _filter = query; } _addInlineBots = start; - updateFiltered(toDown); + updateFiltered(resetScroll); +} + +void MentionsDropdown::showStickers(EmojiPtr emoji) { + bool resetScroll = (_emoji != emoji); + _emoji = emoji; + if (!emoji) { + rowsUpdated(_mrows, _hrows, _brows, StickerByEmojiRows(), false); + return; + } + + _chat = 0; + _user = 0; + _channel = 0; + + updateFiltered(resetScroll); } bool MentionsDropdown::clearFilteredBotCommands() { @@ -4189,12 +4307,22 @@ bool MentionsDropdown::clearFilteredBotCommands() { return true; } -void MentionsDropdown::updateFiltered(bool toDown) { +void MentionsDropdown::updateFiltered(bool resetScroll) { int32 now = unixtime(), recentInlineBots = 0; MentionRows mrows; HashtagRows hrows; BotCommandRows brows; - if (_filter.at(0) == '@') { + StickerByEmojiRows srows; + if (_emoji) { + const StickersByEmojiMap &stickers(Global::StickersByEmoji()); + StickersByEmojiMap::const_iterator it = stickers.constFind(emojiGetNoColor(_emoji)); + if (it != stickers.cend() && !it->isEmpty()) { + srows.reserve(it->size()); + for (StickersByEmojiList::const_iterator i = it->cbegin(), e = it->cend(); i != e; ++i) { + srows.push_back(i.key()); + } + } + } else if (_filter.at(0) == '@') { if (_chat) { mrows.reserve((_addInlineBots ? cRecentInlineBots().size() : 0) + (_chat->participants.isEmpty() ? _chat->lastAuthors.size() : _chat->participants.size())); } else if (_channel && _channel->isMegagroup()) { @@ -4214,46 +4342,46 @@ void MentionsDropdown::updateFiltered(bool toDown) { ++recentInlineBots; } } - } - if (_filter.at(0) == '@' && _chat) { - QMultiMap ordered; - mrows.reserve(mrows.size() + (_chat->participants.isEmpty() ? _chat->lastAuthors.size() : _chat->participants.size())); - if (_chat->noParticipantInfo()) { - if (App::api()) App::api()->requestFullPeer(_chat); - } else if (!_chat->participants.isEmpty()) { - for (ChatData::Participants::const_iterator i = _chat->participants.cbegin(), e = _chat->participants.cend(); i != e; ++i) { - UserData *user = i.key(); - if (user->username.isEmpty()) continue; - if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; - ordered.insertMulti(App::onlineForSort(user, now), user); + if (_chat) { + QMultiMap ordered; + mrows.reserve(mrows.size() + (_chat->participants.isEmpty() ? _chat->lastAuthors.size() : _chat->participants.size())); + if (_chat->noParticipantInfo()) { + if (App::api()) App::api()->requestFullPeer(_chat); + } else if (!_chat->participants.isEmpty()) { + for (ChatData::Participants::const_iterator i = _chat->participants.cbegin(), e = _chat->participants.cend(); i != e; ++i) { + UserData *user = i.key(); + if (user->username.isEmpty()) continue; + if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; + ordered.insertMulti(App::onlineForSort(user, now), user); + } } - } - for (MentionRows::const_iterator i = _chat->lastAuthors.cbegin(), e = _chat->lastAuthors.cend(); i != e; ++i) { - UserData *user = *i; - if (user->username.isEmpty()) continue; - if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; - mrows.push_back(user); - if (!ordered.isEmpty()) { - ordered.remove(App::onlineForSort(user, now), user); - } - } - if (!ordered.isEmpty()) { - for (QMultiMap::const_iterator i = ordered.cend(), b = ordered.cbegin(); i != b;) { - --i; - mrows.push_back(i.value()); - } - } - } else if (_filter.at(0) == '@' && _channel && _channel->isMegagroup()) { - QMultiMap ordered; - if (_channel->mgInfo->lastParticipants.isEmpty() || _channel->lastParticipantsCountOutdated()) { - if (App::api()) App::api()->requestLastParticipants(_channel); - } else { - mrows.reserve(mrows.size() + _channel->mgInfo->lastParticipants.size()); - for (MegagroupInfo::LastParticipants::const_iterator i = _channel->mgInfo->lastParticipants.cbegin(), e = _channel->mgInfo->lastParticipants.cend(); i != e; ++i) { + for (MentionRows::const_iterator i = _chat->lastAuthors.cbegin(), e = _chat->lastAuthors.cend(); i != e; ++i) { UserData *user = *i; if (user->username.isEmpty()) continue; if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; mrows.push_back(user); + if (!ordered.isEmpty()) { + ordered.remove(App::onlineForSort(user, now), user); + } + } + if (!ordered.isEmpty()) { + for (QMultiMap::const_iterator i = ordered.cend(), b = ordered.cbegin(); i != b;) { + --i; + mrows.push_back(i.value()); + } + } + } else if (_channel && _channel->isMegagroup()) { + QMultiMap ordered; + if (_channel->mgInfo->lastParticipants.isEmpty() || _channel->lastParticipantsCountOutdated()) { + if (App::api()) App::api()->requestLastParticipants(_channel); + } else { + mrows.reserve(mrows.size() + _channel->mgInfo->lastParticipants.size()); + for (MegagroupInfo::LastParticipants::const_iterator i = _channel->mgInfo->lastParticipants.cbegin(), e = _channel->mgInfo->lastParticipants.cend(); i != e; ++i) { + UserData *user = *i; + if (user->username.isEmpty()) continue; + if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; + mrows.push_back(user); + } } } } else if (_filter.at(0) == '#') { @@ -4332,28 +4460,31 @@ void MentionsDropdown::updateFiltered(bool toDown) { } } } - rowsUpdated(mrows, hrows, brows, toDown); + rowsUpdated(mrows, hrows, brows, srows, resetScroll); _inner.setRecentInlineBotsInRows(recentInlineBots); } -void MentionsDropdown::rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, bool toDown) { - if (mrows.isEmpty() && hrows.isEmpty() && brows.isEmpty()) { +void MentionsDropdown::rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, const StickerByEmojiRows &srows, bool resetScroll) { + if (mrows.isEmpty() && hrows.isEmpty() && brows.isEmpty() && srows.isEmpty()) { if (!isHidden()) { hideStart(); } _mrows.clear(); _hrows.clear(); _brows.clear(); + _srows.clear(); } else { _mrows = mrows; _hrows = hrows; _brows = brows; + _srows = srows; + bool hidden = _hiding || isHidden(); if (hidden) { show(); _scroll.show(); } - recount(toDown); + recount(resetScroll); if (hidden) { hide(); showStart(); @@ -4363,31 +4494,37 @@ void MentionsDropdown::rowsUpdated(const MentionRows &mrows, const HashtagRows & void MentionsDropdown::setBoundings(QRect boundings) { _boundings = boundings; - resize(_boundings.width(), height()); - _scroll.resize(size()); - _inner.resize(width(), _inner.height()); recount(); } -void MentionsDropdown::recount(bool toDown) { - int32 h = (_mrows.isEmpty() ? (_hrows.isEmpty() ? _brows.size() : _hrows.size()) : _mrows.size()) * st::mentionHeight, oldst = _scroll.scrollTop(), st = oldst; +void MentionsDropdown::recount(bool resetScroll) { + int32 h = 0, oldst = _scroll.scrollTop(), st = oldst, maxh = 4.5 * st::mentionHeight; + if (!_srows.isEmpty()) { + int32 stickersPerRow = int32(_boundings.width() - 2 * st::stickerPanPadding) / int32(st::stickerPanSize.width()); + int32 rows = rowscount(_srows.size(), stickersPerRow); + h = st::stickerPanPadding + rows * st::stickerPanSize.height(); + } else if (!_mrows.isEmpty()) { + h = _mrows.size() * st::mentionHeight; + } else if (!_hrows.isEmpty()) { + h = _hrows.size() * st::mentionHeight; + } else if (!_brows.isEmpty()) { + h = _brows.size() * st::mentionHeight; + } - if (_inner.height() != h) { -// st += h - _inner.height(); - _inner.resize(width(), h); + if (_inner.width() != _boundings.width() || _inner.height() != h) { + _inner.resize(_boundings.width(), h); } if (h > _boundings.height()) h = _boundings.height(); - if (h > 4.5 * st::mentionHeight) h = 4.5 * st::mentionHeight; - if (height() != h) { -// st += _scroll.height() - h; - setGeometry(0, _boundings.height() - h, width(), h); - _scroll.resize(width(), h); + if (h > maxh) h = maxh; + if (width() != _boundings.width() || height() != h) { + setGeometry(0, _boundings.height() - h, _boundings.width(), h); + _scroll.resize(_boundings.width(), h); } else if (y() != _boundings.height() - h) { move(0, _boundings.height() - h); } - if (toDown) st = 0;// _scroll.scrollTopMax(); + if (resetScroll) st = 0; if (st != oldst) _scroll.scrollToY(st); - if (toDown) _inner.clearSel(); + if (resetScroll) _inner.clearSel(); } void MentionsDropdown::fastHide() { @@ -4487,11 +4624,8 @@ bool MentionsDropdown::eventFilter(QObject *obj, QEvent *e) { if (isHidden()) return QWidget::eventFilter(obj, e); if (e->type() == QEvent::KeyPress) { QKeyEvent *ev = static_cast(e); - if (ev->key() == Qt::Key_Up) { - _inner.moveSel(-1); - return true; - } else if (ev->key() == Qt::Key_Down) { - return _inner.moveSel(1); + if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down || (!_srows.isEmpty() && (ev->key() == Qt::Key_Left || ev->key() == Qt::Key_Right))) { + return _inner.moveSel(ev->key()); } else if (ev->key() == Qt::Key_Enter || ev->key() == Qt::Key_Return) { return _inner.select(); } diff --git a/Telegram/SourceFiles/dropdown.h b/Telegram/SourceFiles/dropdown.h index b0cac7d405..e6dcd1d3de 100644 --- a/Telegram/SourceFiles/dropdown.h +++ b/Telegram/SourceFiles/dropdown.h @@ -727,6 +727,7 @@ private: typedef QList MentionRows; typedef QList HashtagRows; typedef QList > BotCommandRows; +typedef QList StickerByEmojiRows; class MentionsDropdown; class MentionsInner : public TWidget { @@ -734,9 +735,10 @@ class MentionsInner : public TWidget { public: - MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows); + MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows, StickerByEmojiRows *srows); void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e); void enterEvent(QEvent *e); void leaveEvent(QEvent *e); @@ -745,7 +747,7 @@ public: void mouseMoveEvent(QMouseEvent *e); void clearSel(); - bool moveSel(int direction); + bool moveSel(int key); bool select(); void setRecentInlineBotsInRows(int32 bots); @@ -755,6 +757,7 @@ public: signals: void chosen(QString mentionOrHashtag); + void selected(DocumentData *sticker); void mustScrollTo(int scrollToTop, int scrollToBottom); public slots: @@ -764,13 +767,15 @@ public slots: private: + void updateSelectedRow(); void setSel(int sel, bool scroll = false); MentionsDropdown *_parent; MentionRows *_mrows; HashtagRows *_hrows; BotCommandRows *_brows; - int32 _recentInlineBotsInRows; + StickerByEmojiRows *_srows; + int32 _stickersPerRow, _recentInlineBotsInRows; int32 _sel; bool _mouseSel; QPoint _mousePos; @@ -791,7 +796,8 @@ public: bool clearFilteredBotCommands(); void showFiltered(PeerData *peer, QString query, bool start); - void updateFiltered(bool toDown = false); + void showStickers(EmojiPtr emoji); + void updateFiltered(bool resetScroll = false); void setBoundings(QRect boundings); void step_appearance(float64 ms, bool timer); @@ -807,6 +813,10 @@ public: bool eventFilter(QObject *obj, QEvent *e); QString getSelected() const; + bool stickersShown() const { + return !_srows.isEmpty(); + } + bool overlaps(const QRect &globalRect) { if (isHidden() || !testAttribute(Qt::WA_OpaquePaintEvent)) return false; @@ -818,6 +828,7 @@ public: signals: void chosen(QString mentionOrHashtag); + void stickerSelected(DocumentData *sticker); public slots: @@ -828,14 +839,15 @@ public slots: private: - void recount(bool toDown = false); + void recount(bool resetScroll = false); QPixmap _cache; MentionRows _mrows; HashtagRows _hrows; BotCommandRows _brows; + StickerByEmojiRows _srows; - void rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, bool toDown); + void rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, const StickerByEmojiRows &srows, bool resetScroll); ScrollArea _scroll; MentionsInner _inner; @@ -843,6 +855,7 @@ private: ChatData *_chat; UserData *_user; ChannelData *_channel; + EmojiPtr _emoji; QString _filter; QRect _boundings; bool _addInlineBots; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 09b1327402..bdfd52eea1 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -174,3 +174,83 @@ namespace Notify { } } + +namespace Global { + + struct Data { + uint64 LaunchId; + + StickersByEmojiMap StickersByEmoji; + }; + + Data *_data = 0; + + Initializer::Initializer() { + initThirdParty(); + _data = new Data(); + memset_rand(&_data->LaunchId, sizeof(_data->LaunchId)); + } + + Initializer::~Initializer() { + deinitThirdParty(); + } + +#define DefineGlobalReadOnly(Type, Name) const Type &Name() { \ + t_assert_full(_data != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ + return _data->Name; \ +} +#define DefineGlobal(Type, Name) DefineGlobalReadOnly(Type, Name) \ +void Set##Name(const Type &Name) { \ + t_assert_full(_data != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ + _data->Name = Name; \ +} \ +Type &Ref##Name() { \ + t_assert_full(_data != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ + return _data->Name; \ +} + + DefineGlobalReadOnly(uint64, LaunchId); + + DefineGlobal(StickersByEmojiMap, StickersByEmoji); + + void StickersByEmoji_Add(DocumentData *doc) { + if (StickerData *sticker = doc->sticker()) { + if (EmojiPtr emoji = emojiGetNoColor(emojiFromText(sticker->alt))) { + RefStickersByEmoji()[emoji].insert(doc); + } + } + } + + bool StickersByEmoji_Remove(DocumentData *doc) { + if (StickerData *sticker = doc->sticker()) { + if (EmojiPtr emoji = emojiGetNoColor(emojiFromText(sticker->alt))) { + StickersByEmojiMap stickers(RefStickersByEmoji()); + StickersByEmojiMap::iterator iList = stickers.find(emoji); + if (iList != stickers.cend()) { + StickersByEmojiList::iterator iEntry = iList->find(doc); + if (iEntry != iList->cend()) { + iList->erase(iEntry); + if (iList->isEmpty()) { + stickers.erase(iList); + } + return true; + } + } + } + } + return false; + } + + void StickersByEmoji_AddPack(const StickerPack &pack) { + for (StickerPack::const_iterator i = pack.cbegin(), e = pack.cend(); i != e; ++i) { + StickersByEmoji_Add(*i); + } + } + + void StickersByEmoji_RemovePack(const StickerPack &pack) { + for (StickerPack::const_iterator i = pack.cbegin(), e = pack.cend(); i != e; ++i) { + StickersByEmoji_Remove(*i); + } + } + +}; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index ed7ee718cf..14db6d2d1c 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -95,3 +95,29 @@ namespace Notify { void automaticLoadSettingsChangedGif(); }; + +typedef OrderedSet StickersByEmojiList; +typedef QMap StickersByEmojiMap; + +namespace Global { + + class Initializer { + public: + Initializer(); + ~Initializer(); + }; + +#define DeclareGlobalReadOnly(Type, Name) const Type &Name(); +#define DeclareGlobal(Type, Name) DeclareGlobalReadOnly(Type, Name) \ + void Set##Name(const Type &Name); \ + Type &Ref##Name(); + + DeclareGlobalReadOnly(uint64, LaunchId); + + DeclareGlobal(StickersByEmojiMap, StickersByEmoji); + void StickersByEmoji_Add(DocumentData *doc); + bool StickersByEmoji_Remove(DocumentData *doc); + void StickersByEmoji_AddPack(const StickerPack &pack); + void StickersByEmoji_RemovePack(const StickerPack &pack); + +}; diff --git a/Telegram/SourceFiles/gui/emoji_config.h b/Telegram/SourceFiles/gui/emoji_config.h index e377374ba1..1734d3d827 100644 --- a/Telegram/SourceFiles/gui/emoji_config.h +++ b/Telegram/SourceFiles/gui/emoji_config.h @@ -83,7 +83,7 @@ inline EmojiPtr emojiFromUrl(const QString &url) { return emojiFromKey(url.midRef(10).toULongLong(0, 16)); // skip emoji://e. } -inline EmojiPtr emojiFromText(const QChar *ch, const QChar *e, int &len) { +inline EmojiPtr emojiFromText(const QChar *ch, const QChar *e, int *plen = 0) { EmojiPtr emoji = 0; if (ch + 1 < e && ((ch->isHighSurrogate() && (ch + 1)->isLowSurrogate()) || (((ch->unicode() >= 0x30 && ch->unicode() < 0x3A) || ch->unicode() == 0x23 || ch->unicode() == 0x2A) && (ch + 1)->unicode() == 0x20E3))) { uint32 code = (ch->unicode() << 16) | (ch + 1)->unicode(); @@ -108,15 +108,15 @@ inline EmojiPtr emojiFromText(const QChar *ch, const QChar *e, int &len) { } else if (ch + 2 < e && ((ch->unicode() >= 0x30 && ch->unicode() < 0x3A) || ch->unicode() == 0x23 || ch->unicode() == 0x2A) && (ch + 1)->unicode() == 0xFE0F && (ch + 2)->unicode() == 0x20E3) { uint32 code = (ch->unicode() << 16) | (ch + 2)->unicode(); emoji = emojiGet(code); - len = emoji->len + 1; + if (plen) *plen = emoji->len + 1; return emoji; } else if (ch < e) { emoji = emojiGet(ch->unicode()); - Q_ASSERT(emoji != TwoSymbolEmoji); + t_assert(emoji != TwoSymbolEmoji); } if (emoji) { - len = emoji->len + ((ch + emoji->len < e && (ch + emoji->len)->unicode() == 0xFE0F) ? 1 : 0); + int32 len = emoji->len + ((ch + emoji->len < e && (ch + emoji->len)->unicode() == 0xFE0F) ? 1 : 0); if (emoji->color && (ch + len + 1 < e && (ch + len)->isHighSurrogate() && (ch + len + 1)->isLowSurrogate())) { // color uint32 color = ((uint32((ch + len)->unicode()) << 16) | uint32((ch + len + 1)->unicode())); EmojiPtr col = emojiGet(emoji, color); @@ -128,8 +128,21 @@ inline EmojiPtr emojiFromText(const QChar *ch, const QChar *e, int &len) { } } } + if (plen) *plen = len; + } + + return emoji; +} + +inline EmojiPtr emojiFromText(const QString &text, int32 *plen = 0) { + return text.isEmpty() ? EmojiPtr(0) : emojiFromText(text.constBegin(), text.constEnd(), plen); +} + +inline EmojiPtr emojiGetNoColor(EmojiPtr emoji) { + if (emoji && emoji->color && (emoji->color & 0xFFFF0000U) != 0xFFFF0000U) { + EmojiPtr result = emojiGet(emoji->code); + return (result == TwoSymbolEmoji) ? emojiGet(emoji->code, emoji->code2) : result; } - return emoji; } @@ -180,7 +193,7 @@ inline QString replaceEmojis(const QString &text, EntitiesInText &entities) { if (canFindEmoji) { emojiFind(ch, e, newEmojiEnd, emojiCode); } - + while (currentEntity < entitiesCount && ch >= emojiStart + entities[currentEntity].offset + entities[currentEntity].length) { ++currentEntity; } diff --git a/Telegram/SourceFiles/gui/flatinput.cpp b/Telegram/SourceFiles/gui/flatinput.cpp index 5d0a25ace8..a7f4241a02 100644 --- a/Telegram/SourceFiles/gui/flatinput.cpp +++ b/Telegram/SourceFiles/gui/flatinput.cpp @@ -66,7 +66,7 @@ FlatInput::FlatInput(QWidget *parent, const style::flatInput &st, const QString , _notingBene(0) , _st(st) { resize(_st.width, _st.height); - + setFont(_st.font->f); setAlignment(_st.align); @@ -959,7 +959,7 @@ void InputArea::processDocumentContentsChange(int position, int charsAdded) { const QChar *ch = t.constData(), *e = ch + t.size(); for (; ch != e; ++ch, ++fp) { int32 emojiLen = 0; - emoji = emojiFromText(ch, e, emojiLen); + emoji = emojiFromText(ch, e, &emojiLen); if (emoji) { if (replacePosition >= 0) { emoji = 0; // replace tilde char format first @@ -1331,7 +1331,7 @@ InputField::InputField(QWidget *parent, const style::InputField &st, const QStri connect(&_inner, SIGNAL(undoAvailable(bool)), this, SLOT(onUndoAvailable(bool))); connect(&_inner, SIGNAL(redoAvailable(bool)), this, SLOT(onRedoAvailable(bool))); if (App::wnd()) connect(&_inner, SIGNAL(selectionChanged()), App::wnd(), SLOT(updateGlobalMenu())); - + setCursor(style::cur_text); if (!val.isEmpty()) { _inner.setPlainText(val); @@ -1412,7 +1412,7 @@ void InputField::paintEvent(QPaintEvent *e) { if (_st.iconSprite.pxWidth()) { p.drawSpriteLeft(_st.iconPosition, width(), _st.iconSprite); } - + bool drawPlaceholder = _placeholderVisible; if (_a_placeholderShift.animating()) { p.setOpacity(a_placeholderOpacity.current()); @@ -1425,11 +1425,11 @@ void InputField::paintEvent(QPaintEvent *e) { QRect r(rect().marginsRemoved(_st.textMargins + _st.placeholderMargins)); r.moveLeft(r.left() + a_placeholderLeft.current()); if (rtl()) r.moveLeft(width() - r.left() - r.width()); - + p.setFont(_st.font); p.setPen(a_placeholderFg.current()); p.drawText(r, _placeholder, _st.placeholderAlign); - + p.restore(); } TWidget::paintEvent(e); @@ -1663,7 +1663,7 @@ void InputField::processDocumentContentsChange(int position, int charsAdded) { } int32 emojiLen = 0; - emoji = emojiFromText(ch, e, emojiLen); + emoji = emojiFromText(ch, e, &emojiLen); if (emoji) { if (replacePosition >= 0) { emoji = 0; // replace tilde char format first @@ -2028,7 +2028,7 @@ MaskedInputField::MaskedInputField(QWidget *parent, const style::InputField &st, setStyle(&_inputFieldStyle); QLineEdit::setTextMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0); - + setAttribute(Qt::WA_AcceptTouchEvents); _touchTimer.setSingleShot(true); connect(&_touchTimer, SIGNAL(timeout()), this, SLOT(onTouchTimer())); diff --git a/Telegram/SourceFiles/gui/flattextarea.cpp b/Telegram/SourceFiles/gui/flattextarea.cpp index 4f27183e77..3340bb1ab5 100644 --- a/Telegram/SourceFiles/gui/flattextarea.cpp +++ b/Telegram/SourceFiles/gui/flattextarea.cpp @@ -738,7 +738,7 @@ void FlatTextarea::processDocumentContentsChange(int position, int charsAdded) { const QChar *ch = t.constData(), *e = ch + t.size(); for (; ch != e; ++ch, ++fp) { int32 emojiLen = 0; - emoji = emojiFromText(ch, e, emojiLen); + emoji = emojiFromText(ch, e, &emojiLen); if (emoji) { if (replacePosition >= 0) { emoji = 0; // replace tilde char format first diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 328762ab26..0dad2f9f4c 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -598,7 +598,7 @@ public: void parseEmojiFromCurrent() { int len = 0; - EmojiPtr e = emojiFromText(ptr - emojiLookback, end, len); + EmojiPtr e = emojiFromText(ptr - emojiLookback, end, &len); if (!e) return; for (int l = len - emojiLookback - 1; l > 0; --l) { @@ -4502,8 +4502,7 @@ goodCanBreakEntity = canBreakEntity;\ #undef MARK_GOOD_AS_LEVEL int elen = 0; - EmojiPtr e = emojiFromText(ch, end, elen); - if (e) { + if (EmojiPtr e = emojiFromText(ch, end, &elen)) { for (int i = 0; i < elen; ++i, ++ch, ++s) { if (ch->isHighSurrogate() && i + 1 < elen && (ch + 1)->isLowSurrogate()) { ++ch; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 7fc28f5f18..f76055744d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4744,14 +4744,11 @@ bool HistoryGif::dataLoaded() const { HistorySticker::HistorySticker(DocumentData *document) : HistoryMedia() , _pixw(1) , _pixh(1) -, _data(document) { +, _data(document) +, _emoji(_data->sticker()->alt) { _data->thumb->load(); - if (!_data->sticker()->alt.isEmpty()) { - _emoji = _data->sticker()->alt; - int32 elen = 0; - if (EmojiPtr e = emojiFromText(_emoji.constData(), _emoji.constEnd(), elen)) { - _emoji = emojiString(e); - } + if (EmojiPtr e = emojiFromText(_emoji)) { + _emoji = emojiString(e); } } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index bc412b9d0a..f44979901f 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2763,6 +2763,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) _attachMention.hide(); connect(&_attachMention, SIGNAL(chosen(QString)), this, SLOT(onMentionHashtagOrBotCommandInsert(QString))); + connect(&_attachMention, SIGNAL(stickerSelected(DocumentData*)), this, SLOT(onStickerSend(DocumentData*))); _field.installEventFilter(&_attachMention); _field.setCtrlEnterSubmit(cCtrlEnter()); @@ -2807,7 +2808,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) } void HistoryWidget::start() { - connect(App::main(), SIGNAL(stickersUpdated()), &_emojiPan, SLOT(refreshStickers())); + connect(App::main(), SIGNAL(stickersUpdated()), this, SLOT(onStickersUpdated())); connect(App::main(), SIGNAL(savedGifsUpdated()), &_emojiPan, SLOT(refreshSavedGifs())); updateRecentStickers(); @@ -2816,6 +2817,11 @@ void HistoryWidget::start() { connect(App::api(), SIGNAL(fullPeerUpdated(PeerData*)), this, SLOT(onFullPeerUpdated(PeerData*))); } +void HistoryWidget::onStickersUpdated() { + _emojiPan.refreshStickers(); + updateStickersByEmoji(); +} + void HistoryWidget::onMentionHashtagOrBotCommandInsert(QString str) { if (str.at(0) == '/') { // bot command App::sendBotCommand(str); @@ -2867,8 +2873,23 @@ void HistoryWidget::updateInlineBotQuery() { } } +void HistoryWidget::updateStickersByEmoji() { + int32 len = 0; + if (EmojiPtr emoji = emojiFromText(_field.getLastText(), &len)) { + if (_field.getLastText().size() <= len) { + _attachMention.showStickers(emoji); + } else { + len = 0; + } + } + if (!len) { + _attachMention.showStickers(EmojiPtr(0)); + } +} + void HistoryWidget::onTextChange() { updateInlineBotQuery(); + updateStickersByEmoji(); if (_peer && (!_peer->isChannel() || _peer->isMegagroup() || !_peer->asChannel()->canPublish() || (!_peer->asChannel()->isBroadcast() && !_broadcast.checked()))) { if (!_inlineBot && (_textUpdateEventsFlags & TextUpdateEventsSendTyping)) { @@ -3180,6 +3201,7 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { ++i; } } + Global::StickersByEmoji_RemovePack(it->stickers); it = sets.erase(it); } } @@ -5405,10 +5427,10 @@ void HistoryWidget::onFieldFocused() { } void HistoryWidget::onCheckMentionDropdown() { - if (!_history || _a_show.animating() || _inlineBot) return; + if (!_history || _a_show.animating()) return; bool start = false; - QString query = _field.getMentionHashtagBotCommandPart(start); + QString query = _inlineBot ? QString() : _field.getMentionHashtagBotCommandPart(start); if (!query.isEmpty()) { if (query.at(0) == '#' && cRecentWriteHashtags().isEmpty() && cRecentSearchHashtags().isEmpty()) Local::readRecentHashtagsAndBots(); if (query.at(0) == '@' && cRecentInlineBots().isEmpty()) Local::readRecentHashtagsAndBots(); @@ -6529,6 +6551,13 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti App::historyRegRandom(randomId, newId); + if (_attachMention.stickersShown()) { + setFieldText(QString()); + _saveDraftText = true; + _saveDraftStart = getms(); + onDraftSave(); + } + if (!_attachMention.isHidden()) _attachMention.hideStart(); if (!_attachType.isHidden()) _attachType.hideStart(); if (!_emojiPan.isHidden()) _emojiPan.hideStart(); @@ -6813,7 +6842,9 @@ void HistoryWidget::updatePreview() { void HistoryWidget::onCancel() { if (_inlineBot && _field.getLastText().startsWith('@' + _inlineBot->username + ' ')) { setFieldText(QString(), TextUpdateEventsSaveDraft, false); - } else { + } else if (!_attachMention.isHidden()) { + _attachMention.hideStart(); + } else { Ui::showChatsList(); emit cancelled(); } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 1936ccbb4e..6aae8e548e 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -452,6 +452,7 @@ public: void updateFieldPlaceholder(); void updateInlineBotQuery(); + void updateStickersByEmoji(); void uploadImage(const QImage &img, PrepareMediaType type, FileLoadForceConfirmType confirm = FileLoadNoForceConfirm, const QString &source = QString(), bool withText = false); void uploadFile(const QString &file, PrepareMediaType type, FileLoadForceConfirmType confirm = FileLoadNoForceConfirm, bool withText = false); // with confirmation @@ -643,6 +644,7 @@ public slots: void onCmdStart(); void activate(); + void onStickersUpdated(); void onMentionHashtagOrBotCommandInsert(QString str); void onTextChange(); diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 2e34afc7ff..c527f87811 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -2920,6 +2920,8 @@ namespace Local { RecentStickerPack &recent(cRefRecentStickers()); recent.clear(); + Global::SetStickersByEmoji(StickersByEmojiMap()); + 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()); @@ -2993,6 +2995,8 @@ namespace Local { StickerSetsOrder &order(cRefStickerSetsOrder()); order.clear(); + Global::SetStickersByEmoji(StickersByEmojiMap()); + quint32 cnt; QByteArray hash; stickers.stream >> cnt >> hash; // ignore hash, it is counted @@ -3073,6 +3077,10 @@ namespace Local { set.stickers.push_back(doc); ++set.count; } + + if (setId != CustomStickerSetId) { + Global::StickersByEmoji_AddPack(set.stickers); + } } } diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index d1bd7199e3..bb54a12d52 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -84,11 +84,13 @@ void logWrite(const QString &v); static volatile int *t_assert_nullptr = 0; inline void t_noop() {} -inline void t_assert_fail(const char *condition, const char *file, int32 line) { - LOG(("Assertion Failed! \"%1\" %2:%3").arg(condition).arg(file).arg(line)); +inline void t_assert_fail(const char *message, const char *file, int32 line) { + LOG(("Assertion Failed! %1 %2:%3").arg(message).arg(file).arg(line)); *t_assert_nullptr = 0; } -#define t_assert(cond) ((!(cond)) ? t_assert_fail(#cond, __FILE__, __LINE__) : t_noop()) +#define t_assert_full(condition, message, file, line) ((!(condition)) ? t_assert_fail(message, file, line) : t_noop()) +#define t_assert_c(condition, comment) t_assert_full(condition, "\"" #condition "\" (" comment ")", __FILE__, __LINE__) +#define t_assert(condition) t_assert_full(condition, "\"" #condition "\"", __FILE__, __LINE__) void logsInit(); void logsInitDebug(); diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index deb1e3918a..a64c8641df 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -32,8 +32,6 @@ int main(int argc, char *argv[]) { //signal(SIGSEGV, _sigsegvHandler); #endif - LibrariesInitializer _init; - settingsParseArgs(argc, argv); for (int32 i = 0; i < argc; ++i) { if (string("-fixprevious") == argv[i]) { @@ -44,6 +42,8 @@ int main(int argc, char *argv[]) { } logsInit(); + Global::Initializer _init; + Local::readSettings(); if (Local::oldSettingsVersion() < AppVersion) { psNewVersion(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 5ba5539b8e..c553246693 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4607,8 +4607,14 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { const MTPDstickerSet &s(set.vset.c_stickerSet()); StickerSets &sets(cRefStickerSets()); - - 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)).value().stickers = pack; + StickerSets::iterator it = sets.find(s.vid.v); + if (it != sets.cend()) { + Global::StickersByEmoji_RemovePack(it->stickers); + } else { + 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->stickers = pack; + Global::StickersByEmoji_AddPack(pack); StickerSetsOrder &order(cRefStickerSetsOrder()); int32 insertAtIndex = 0, currentIndex = order.indexOf(s.vid.v); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 8b2700c4ee..b5d4009778 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -190,7 +190,6 @@ void settingsParseArgs(int argc, char *argv[]) { gCustomNotifies = false; } #endif - memset_rand(&gInstance, sizeof(gInstance)); gExeDir = psCurrentExeDirectory(argc, argv); gExeName = psCurrentExeName(argc, argv); for (int32 i = 0; i < argc; ++i) { diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 34bd47fba4..de8acf32ee 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -1513,6 +1513,8 @@ void DocumentData::setattributes(const QVector &attributes _additional = 0; } break; case mtpc_documentAttributeSticker: { + bool wasByEmoji = Global::StickersByEmoji_Remove(this); + const MTPDdocumentAttributeSticker &d(attributes[i].c_documentAttributeSticker()); if (type == FileDocument) { type = StickerDocument; @@ -1522,6 +1524,7 @@ void DocumentData::setattributes(const QVector &attributes if (sticker()) { sticker()->alt = qs(d.valt); sticker()->set = d.vstickerset; + if (wasByEmoji) Global::StickersByEmoji_Add(this); } } break; case mtpc_documentAttributeVideo: { diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 6d9e7e275b..0b34064264 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -264,7 +264,7 @@ namespace { _MsStarter _msStarter; } -LibrariesInitializer::LibrariesInitializer() { +void initThirdParty() { if (!RAND_status()) { // should be always inited in all modern OS char buf[16]; memcpy(buf, &_msStart, 8); @@ -296,7 +296,7 @@ LibrariesInitializer::LibrariesInitializer() { _sslInited = true; } -LibrariesInitializer::~LibrariesInitializer() { +void deinitThirdParty() { av_lockmgr_register(0); delete[] _sslLocks; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 0a6359661c..264e4cfc14 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -133,11 +133,8 @@ inline void mylocaltime(struct tm * _Tm, const time_t * _Time) { #endif } -class LibrariesInitializer { -public: - LibrariesInitializer(); - ~LibrariesInitializer(); -}; +void initThirdParty(); // called by Global::Initializer +void deinitThirdParty(); bool checkms(); // returns true if time has changed uint64 getms(bool checked = false); @@ -458,6 +455,9 @@ MimeType mimeTypeForName(const QString &mime); MimeType mimeTypeForFile(const QFileInfo &file); MimeType mimeTypeForData(const QByteArray &data); +inline int32 rowscount(int32 count, int32 perrow) { + return (count + perrow - 1) / perrow; +} inline int32 floorclamp(int32 value, int32 step, int32 lowest, int32 highest) { return qMin(qMax(value / step, lowest), highest); } From b13579c7d9795ec0c3d2d00b1c516cb78841797b Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 9 Jan 2016 20:51:42 +0800 Subject: [PATCH 016/316] dev version 0.9.19 sending stickers by emoji --- Telegram/SourceFiles/apiwrap.cpp | 24 ++++++++-- Telegram/SourceFiles/app.cpp | 1 - Telegram/SourceFiles/application.cpp | 5 +- Telegram/SourceFiles/boxes/stickersetbox.cpp | 29 ++++++++++-- Telegram/SourceFiles/boxes/stickersetbox.h | 7 +-- Telegram/SourceFiles/config.h | 6 +-- Telegram/SourceFiles/dropdown.cpp | 36 ++++++++++----- Telegram/SourceFiles/dropdown.h | 9 ++-- Telegram/SourceFiles/facades.cpp | 45 +----------------- Telegram/SourceFiles/facades.h | 9 ---- Telegram/SourceFiles/historywidget.cpp | 27 ++++++----- Telegram/SourceFiles/localstorage.cpp | 45 +++++++++++++++--- Telegram/SourceFiles/mainwidget.cpp | 48 +++++++++++++------- Telegram/SourceFiles/settings.h | 3 ++ Telegram/SourceFiles/structs.cpp | 3 -- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++-- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++--- Telegram/Version | 8 ++-- 19 files changed, 184 insertions(+), 143 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 6ae7881c1d..69366c14ce 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -672,9 +672,9 @@ void ApiWrap::scheduleStickerSetRequest(uint64 setId, uint64 access) { void ApiWrap::requestStickerSets() { for (QMap >::iterator i = _stickerSetRequests.begin(), j = i, e = _stickerSetRequests.end(); i != e; i = j) { + ++j; if (i.value().second) continue; - ++j; int32 wait = (j == e) ? 0 : 10; i.value().second = MTP::send(MTPmessages_GetStickerSet(MTP_inputStickerSetID(MTP_long(i.key()), MTP_long(i.value().first))), rpcDone(&ApiWrap::gotStickerSet, i.key()), rpcFail(&ApiWrap::gotStickerSetFail, i.key()), 0, wait); } @@ -685,7 +685,6 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) if (result.type() != mtpc_messages_stickerSet) return; const MTPDmessages_stickerSet &d(result.c_messages_stickerSet()); - const QVector &v(d.vpacks.c_vector().v); if (d.vset.type() != mtpc_stickerSet) return; const MTPDstickerSet &s(d.vset.c_stickerSet()); @@ -733,14 +732,31 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result) } } - Global::StickersByEmoji_RemovePack(it->stickers); if (pack.isEmpty()) { int32 removeIndex = cStickerSetsOrder().indexOf(setId); if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); sets.erase(it); } else { it->stickers = pack; - Global::StickersByEmoji_AddPack(it->stickers); + it->emoji.clear(); + const QVector &v(d.vpacks.c_vector().v); + for (int32 i = 0, l = v.size(); i < l; ++i) { + if (v.at(i).type() != mtpc_stickerPack) continue; + + const MTPDstickerPack &pack(v.at(i).c_stickerPack()); + if (EmojiPtr e = emojiGetNoColor(emojiFromText(qs(pack.vemoticon)))) { + const QVector &stickers(pack.vdocuments.c_vector().v); + StickerPack p; + p.reserve(stickers.size()); + for (int32 j = 0, c = stickers.size(); j < c; ++j) { + DocumentData *doc = App::document(stickers.at(j).v); + if (!doc || !doc->sticker()) continue; + + p.push_back(doc); + } + it->emoji.insert(e, p); + } + } } if (writeRecent) { diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 31194084eb..5898cf1aca 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1969,7 +1969,6 @@ namespace App { if (api()) api()->clearWebPageRequests(); cSetRecentStickers(RecentStickerPack()); cSetStickerSets(StickerSets()); - Global::SetStickersByEmoji(StickersByEmojiMap()); cSetStickerSetsOrder(StickerSetsOrder()); cSetLastStickersUpdate(0); cSetSavedGifs(SavedGifs()); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index ca89de07c0..b455cb6424 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -705,9 +705,8 @@ void Application::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if (cDevVersion() && Local::oldMapVersion() < 9016) { -// versionFeatures = QString::fromUtf8("\xe2\x80\x94 Sticker management: manually rearrange your sticker packs, pack order is now synced across all your devices\n\xe2\x80\x94 Click and hold on a sticker to preview it before sending\n\xe2\x80\x94 New context menu for chats in chats list\n\xe2\x80\x94 Support for all existing emoji");// .replace('@', qsl("@") + QChar(0x200D)); - versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); + if (cDevVersion() && Local::oldMapVersion() < 9019) { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Choose an emoticon and see the suggested stickers\n\xe2\x80\x94 Bug fixes in minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } else if (Local::oldMapVersion() < 9016) { versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); } else { diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index b7f62f22be..d8112e5307 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -43,6 +43,7 @@ _input(set), _installRequest(0) { void StickerSetInner::gotSet(const MTPmessages_StickerSet &set) { _pack.clear(); + _emoji.clear(); if (set.type() == mtpc_messages_stickerSet) { const MTPDmessages_stickerSet &d(set.c_messages_stickerSet()); const QVector &v(d.vdocuments.c_vector().v); @@ -53,6 +54,23 @@ void StickerSetInner::gotSet(const MTPmessages_StickerSet &set) { _pack.push_back(doc); } + const QVector &packs(d.vpacks.c_vector().v); + for (int32 i = 0, l = packs.size(); i < l; ++i) { + if (packs.at(i).type() != mtpc_stickerPack) continue; + const MTPDstickerPack &pack(packs.at(i).c_stickerPack()); + if (EmojiPtr e = emojiGetNoColor(emojiFromText(qs(pack.vemoticon)))) { + const QVector &stickers(pack.vdocuments.c_vector().v); + StickerPack p; + p.reserve(stickers.size()); + for (int32 j = 0, c = stickers.size(); j < c; ++j) { + DocumentData *doc = App::document(stickers.at(j).v); + if (!doc || !doc->sticker()) continue; + + p.push_back(doc); + } + _emoji.insert(e, p); + } + } if (d.vset.type() == mtpc_stickerSet) { const MTPDstickerSet &s(d.vset.c_stickerSet()); _setTitle = stickerSetTitle(s); @@ -91,8 +109,12 @@ void StickerSetInner::installDone(const MTPBool &result) { StickerSets &sets(cRefStickerSets()); _setFlags &= ~MTPDstickerSet::flag_disabled; - sets.insert(_setId, StickerSet(_setId, _setAccess, _setTitle, _setShortName, _setCount, _setHash, _setFlags)).value().stickers = _pack; - Global::StickersByEmoji_AddPack(_pack); + StickerSets::iterator it = sets.find(_setId); + if (it == sets.cend()) { + it = sets.insert(_setId, StickerSet(_setId, _setAccess, _setTitle, _setShortName, _setCount, _setHash, _setFlags)); + } + it.value().stickers = _pack; + it.value().emoji = _emoji; StickerSetsOrder &order(cRefStickerSetsOrder()); int32 insertAtIndex = 0, currentIndex = order.indexOf(_setId); @@ -868,7 +890,6 @@ void StickersBox::onSave() { if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex); sets.erase(it); } - Global::StickersByEmoji_RemovePack(it->stickers); } } } @@ -881,7 +902,6 @@ void StickersBox::onSave() { 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; - Global::StickersByEmoji_AddPack(it->stickers); } order.push_back(reorder.at(i)); } @@ -890,7 +910,6 @@ void StickersBox::onSave() { if (it->id == CustomStickerSetId || it->id == RecentStickerSetId || order.contains(it->id)) { ++it; } else { - Global::StickersByEmoji_RemovePack(it->stickers); it = sets.erase(it); } } diff --git a/Telegram/SourceFiles/boxes/stickersetbox.h b/Telegram/SourceFiles/boxes/stickersetbox.h index 901dd586b8..7fbd2b9720 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.h +++ b/Telegram/SourceFiles/boxes/stickersetbox.h @@ -32,7 +32,7 @@ public: void init(); void paintEvent(QPaintEvent *e); - + bool loaded() const; int32 notInstalled() const; bool official() const; @@ -60,6 +60,7 @@ private: bool installFailed(const RPCError &error); StickerPack _pack; + StickersByEmojiMap _emoji; bool _loaded; uint64 _setId, _setAccess; QString _title, _setTitle, _setShortName; @@ -118,7 +119,7 @@ public: void mousePressEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); - + void rebuild(); bool savingStart() { if (_saving) return false; @@ -201,7 +202,7 @@ public: StickersBox(); void resizeEvent(QResizeEvent *e); void paintEvent(QPaintEvent *e); - + void closePressed(); public slots: diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index ceef089c4b..4a1637ba04 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9018; -static const wchar_t *AppVersionStr = L"0.9.18"; -static const bool DevVersion = false; +static const int32 AppVersion = 9019; +static const wchar_t *AppVersionStr = L"0.9.19"; +static const bool DevVersion = true; //#define BETA_VERSION (9015008ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index df94fa22f9..dc38319ad9 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -3564,7 +3564,6 @@ void EmojiPan::onRemoveSetSure() { Ui::hideLayer(); StickerSets::iterator it = cRefStickerSets().find(_removingSetId); if (it != cRefStickerSets().cend() && !(it->flags & MTPDstickerSet::flag_official)) { - Global::StickersByEmoji_RemovePack(it->stickers); if (it->id && it->access) { MTP::send(MTPmessages_UninstallStickerSet(MTP_inputStickerSetID(MTP_long(it->id), MTP_long(it->access)))); } else if (!it->shortName.isEmpty()) { @@ -3842,7 +3841,7 @@ void EmojiPan::recountContentMaxHeight() { updateContentHeight(); } -MentionsInner::MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows, StickerByEmojiRows *srows) +MentionsInner::MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows, StickerPack *srows) : _parent(parent) , _mrows(mrows) , _hrows(hrows) @@ -4290,7 +4289,7 @@ void MentionsDropdown::showStickers(EmojiPtr emoji) { bool resetScroll = (_emoji != emoji); _emoji = emoji; if (!emoji) { - rowsUpdated(_mrows, _hrows, _brows, StickerByEmojiRows(), false); + rowsUpdated(_mrows, _hrows, _brows, StickerPack(), false); return; } @@ -4312,16 +4311,31 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { MentionRows mrows; HashtagRows hrows; BotCommandRows brows; - StickerByEmojiRows srows; + StickerPack srows; if (_emoji) { - const StickersByEmojiMap &stickers(Global::StickersByEmoji()); - StickersByEmojiMap::const_iterator it = stickers.constFind(emojiGetNoColor(_emoji)); - if (it != stickers.cend() && !it->isEmpty()) { - srows.reserve(it->size()); - for (StickersByEmojiList::const_iterator i = it->cbegin(), e = it->cend(); i != e; ++i) { - srows.push_back(i.key()); + 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)); + if (it != sets.cend()) { + if (it->emoji.isEmpty()) { + setsToRequest.insert(it->id, it->access); + it->flags |= MTPDstickerSet_flag_NOT_LOADED; + } else { + StickersByEmojiMap::const_iterator i = it->emoji.constFind(emojiGetNoColor(_emoji)); + if (i != it->emoji.cend()) { + srows.append(*i); + } + } } } + if (!setsToRequest.isEmpty() && App::api()) { + for (QMap::const_iterator i = setsToRequest.cbegin(), e = setsToRequest.cend(); i != e; ++i) { + App::api()->scheduleStickerSetRequest(i.key(), i.value()); + } + App::api()->requestStickerSets(); + } } else if (_filter.at(0) == '@') { if (_chat) { mrows.reserve((_addInlineBots ? cRecentInlineBots().size() : 0) + (_chat->participants.isEmpty() ? _chat->lastAuthors.size() : _chat->participants.size())); @@ -4464,7 +4478,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { _inner.setRecentInlineBotsInRows(recentInlineBots); } -void MentionsDropdown::rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, const StickerByEmojiRows &srows, bool resetScroll) { +void MentionsDropdown::rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, const StickerPack &srows, bool resetScroll) { if (mrows.isEmpty() && hrows.isEmpty() && brows.isEmpty() && srows.isEmpty()) { if (!isHidden()) { hideStart(); diff --git a/Telegram/SourceFiles/dropdown.h b/Telegram/SourceFiles/dropdown.h index e6dcd1d3de..36146697b4 100644 --- a/Telegram/SourceFiles/dropdown.h +++ b/Telegram/SourceFiles/dropdown.h @@ -727,7 +727,6 @@ private: typedef QList MentionRows; typedef QList HashtagRows; typedef QList > BotCommandRows; -typedef QList StickerByEmojiRows; class MentionsDropdown; class MentionsInner : public TWidget { @@ -735,7 +734,7 @@ class MentionsInner : public TWidget { public: - MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows, StickerByEmojiRows *srows); + MentionsInner(MentionsDropdown *parent, MentionRows *mrows, HashtagRows *hrows, BotCommandRows *brows, StickerPack *srows); void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); @@ -774,7 +773,7 @@ private: MentionRows *_mrows; HashtagRows *_hrows; BotCommandRows *_brows; - StickerByEmojiRows *_srows; + StickerPack *_srows; int32 _stickersPerRow, _recentInlineBotsInRows; int32 _sel; bool _mouseSel; @@ -845,9 +844,9 @@ private: MentionRows _mrows; HashtagRows _hrows; BotCommandRows _brows; - StickerByEmojiRows _srows; + StickerPack _srows; - void rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, const StickerByEmojiRows &srows, bool resetScroll); + void rowsUpdated(const MentionRows &mrows, const HashtagRows &hrows, const BotCommandRows &brows, const StickerPack &srows, bool resetScroll); ScrollArea _scroll; MentionsInner _inner; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index bdfd52eea1..b8befffe4e 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -179,8 +179,6 @@ namespace Global { struct Data { uint64 LaunchId; - - StickersByEmojiMap StickersByEmoji; }; Data *_data = 0; @@ -188,6 +186,7 @@ namespace Global { Initializer::Initializer() { initThirdParty(); _data = new Data(); + memset_rand(&_data->LaunchId, sizeof(_data->LaunchId)); } @@ -211,46 +210,4 @@ Type &Ref##Name() { \ DefineGlobalReadOnly(uint64, LaunchId); - DefineGlobal(StickersByEmojiMap, StickersByEmoji); - - void StickersByEmoji_Add(DocumentData *doc) { - if (StickerData *sticker = doc->sticker()) { - if (EmojiPtr emoji = emojiGetNoColor(emojiFromText(sticker->alt))) { - RefStickersByEmoji()[emoji].insert(doc); - } - } - } - - bool StickersByEmoji_Remove(DocumentData *doc) { - if (StickerData *sticker = doc->sticker()) { - if (EmojiPtr emoji = emojiGetNoColor(emojiFromText(sticker->alt))) { - StickersByEmojiMap stickers(RefStickersByEmoji()); - StickersByEmojiMap::iterator iList = stickers.find(emoji); - if (iList != stickers.cend()) { - StickersByEmojiList::iterator iEntry = iList->find(doc); - if (iEntry != iList->cend()) { - iList->erase(iEntry); - if (iList->isEmpty()) { - stickers.erase(iList); - } - return true; - } - } - } - } - return false; - } - - void StickersByEmoji_AddPack(const StickerPack &pack) { - for (StickerPack::const_iterator i = pack.cbegin(), e = pack.cend(); i != e; ++i) { - StickersByEmoji_Add(*i); - } - } - - void StickersByEmoji_RemovePack(const StickerPack &pack) { - for (StickerPack::const_iterator i = pack.cbegin(), e = pack.cend(); i != e; ++i) { - StickersByEmoji_Remove(*i); - } - } - }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 14db6d2d1c..1a80278c75 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -96,9 +96,6 @@ namespace Notify { }; -typedef OrderedSet StickersByEmojiList; -typedef QMap StickersByEmojiMap; - namespace Global { class Initializer { @@ -114,10 +111,4 @@ namespace Global { DeclareGlobalReadOnly(uint64, LaunchId); - DeclareGlobal(StickersByEmojiMap, StickersByEmoji); - void StickersByEmoji_Add(DocumentData *doc); - bool StickersByEmoji_Remove(DocumentData *doc); - void StickersByEmoji_AddPack(const StickerPack &pack); - void StickersByEmoji_RemovePack(const StickerPack &pack); - }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index f44979901f..df34ca5cb1 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3164,24 +3164,24 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { for (int32 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 i = sets.find(set.vid.v); + StickerSets::iterator it = sets.find(set.vid.v); QString title = stickerSetTitle(set); - if (i == sets.cend()) { - i = 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)); + 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)); } else { - i->access = set.vaccess_hash.v; - i->title = title; - i->shortName = qs(set.vshort_name); - i->flags = set.vflags.v; - if (i->count != set.vcount.v || i->hash != set.vhash.v) { - i->count = set.vcount.v; - i->hash = set.vhash.v; - i->flags |= MTPDstickerSet_flag_NOT_LOADED; // need to request this set + it->access = set.vaccess_hash.v; + it->title = title; + it->shortName = qs(set.vshort_name); + it->flags = set.vflags.v; + 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 } } - if (!(i->flags & MTPDstickerSet::flag_disabled) || (i->flags & MTPDstickerSet::flag_official)) { + if (!(it->flags & MTPDstickerSet::flag_disabled) || (it->flags & MTPDstickerSet::flag_official)) { setsOrder.push_back(set.vid.v); - if (i->stickers.isEmpty() || (i->flags & MTPDstickerSet_flag_NOT_LOADED)) { + if (it->stickers.isEmpty() || (it->flags & MTPDstickerSet_flag_NOT_LOADED)) { setsToRequest.insert(set.vid.v, set.vaccess_hash.v); } } @@ -3201,7 +3201,6 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { ++i; } } - Global::StickersByEmoji_RemovePack(it->stickers); it = sets.erase(it); } } diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index c527f87811..6aaa61710a 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -2843,6 +2843,16 @@ namespace Local { } _writeStorageImageLocation(stream, doc->sticker()->loc); } + + if (AppVersion > 9018) { + stream << qint32(it->emoji.size()); + for (StickersByEmojiMap::const_iterator j = it->emoji.cbegin(), e = it->emoji.cend(); j != e; ++j) { + stream << emojiString(j.key()) << qint32(j->size()); + for (int32 k = 0, l = j->size(); k < l; ++k) { + stream << quint64(j->at(k)->id); + } + } + } } void writeStickers() { @@ -2881,6 +2891,14 @@ namespace Local { // loc size += _storageImageLocationSize(); } + + if (AppVersion > 9018) { + size += sizeof(qint32); // emojiCount + for (StickersByEmojiMap::const_iterator j = i->emoji.cbegin(), e = i->emoji.cend(); j != e; ++j) { + size += _stringSize(emojiString(j.key())) + sizeof(qint32) + (j->size() * sizeof(quint64)); + } + } + ++setsCount; } @@ -2920,8 +2938,6 @@ namespace Local { RecentStickerPack &recent(cRefRecentStickers()); recent.clear(); - Global::SetStickersByEmoji(StickersByEmojiMap()); - 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()); @@ -2995,8 +3011,6 @@ namespace Local { StickerSetsOrder &order(cRefStickerSetsOrder()); order.clear(); - Global::SetStickersByEmoji(StickersByEmojiMap()); - quint32 cnt; QByteArray hash; stickers.stream >> cnt >> hash; // ignore hash, it is counted @@ -3078,8 +3092,27 @@ namespace Local { ++set.count; } - if (setId != CustomStickerSetId) { - Global::StickersByEmoji_AddPack(set.stickers); + if (stickers.version > 9018) { + qint32 emojiCount; + stickers.stream >> emojiCount; + for (int32 j = 0; j < emojiCount; ++j) { + QString emojiString; + qint32 stickersCount; + stickers.stream >> emojiString >> stickersCount; + StickerPack pack; + pack.reserve(stickersCount); + for (int32 k = 0; k < stickersCount; ++k) { + quint64 id; + stickers.stream >> id; + DocumentData *doc = App::document(id); + if (!doc || !doc->sticker()) continue; + + pack.push_back(doc); + } + if (EmojiPtr e = emojiGetNoColor(emojiFromText(emojiString))) { + set.emoji.insert(e, pack); + } + } } } } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index c553246693..c1b69b3c2b 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4594,27 +4594,41 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { if (d.vstickerset.type() == mtpc_messages_stickerSet) { const MTPDmessages_stickerSet &set(d.vstickerset.c_messages_stickerSet()); if (set.vset.type() == mtpc_stickerSet) { - const QVector &v(set.vdocuments.c_vector().v); - StickerPack pack; - pack.reserve(v.size()); - for (int32 i = 0, l = v.size(); i < l; ++i) { - DocumentData *doc = App::feedDocument(v.at(i)); - if (!doc || !doc->sticker()) continue; - - pack.push_back(doc); - } - const MTPDstickerSet &s(set.vset.c_stickerSet()); StickerSets &sets(cRefStickerSets()); StickerSets::iterator it = sets.find(s.vid.v); - if (it != sets.cend()) { - Global::StickersByEmoji_RemovePack(it->stickers); - } else { + 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->stickers = pack; - Global::StickersByEmoji_AddPack(pack); + + const QVector &v(set.vdocuments.c_vector().v); + it->stickers.clear(); + it->stickers.reserve(v.size()); + for (int32 i = 0, l = v.size(); i < l; ++i) { + DocumentData *doc = App::feedDocument(v.at(i)); + if (!doc || !doc->sticker()) continue; + + it->stickers.push_back(doc); + } + it->emoji.clear(); + const QVector &packs(set.vpacks.c_vector().v); + for (int32 i = 0, l = packs.size(); i < l; ++i) { + if (packs.at(i).type() != mtpc_stickerPack) continue; + const MTPDstickerPack &pack(packs.at(i).c_stickerPack()); + if (EmojiPtr e = emojiGetNoColor(emojiFromText(qs(pack.vemoticon)))) { + const QVector &stickers(pack.vdocuments.c_vector().v); + StickerPack p; + p.reserve(stickers.size()); + for (int32 j = 0, c = stickers.size(); j < c; ++j) { + DocumentData *doc = App::document(stickers.at(j).v); + if (!doc || !doc->sticker()) continue; + + p.push_back(doc); + } + it->emoji.insert(e, p); + } + } StickerSetsOrder &order(cRefStickerSetsOrder()); int32 insertAtIndex = 0, currentIndex = order.indexOf(s.vid.v); @@ -4627,8 +4641,8 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { StickerSets::iterator custom = sets.find(CustomStickerSetId); if (custom != sets.cend()) { - for (int32 i = 0, l = pack.size(); i < l; ++i) { - int32 removeIndex = custom->stickers.indexOf(pack.at(i)); + for (int32 i = 0, l = it->stickers.size(); i < l; ++i) { + int32 removeIndex = custom->stickers.indexOf(it->stickers.at(i)); if (removeIndex >= 0) custom->stickers.removeAt(removeIndex); } if (custom->stickers.isEmpty()) { diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index b84578a442..561de9062c 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -209,6 +209,8 @@ DeclareRefSetting(RecentStickerPack, RecentStickers); 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 @@ -219,6 +221,7 @@ struct StickerSet { QString title, shortName; int32 count, hash, flags; StickerPack stickers; + StickersByEmojiMap emoji; }; typedef QMap StickerSets; DeclareRefSetting(StickerSets, StickerSets); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index de8acf32ee..34bd47fba4 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -1513,8 +1513,6 @@ void DocumentData::setattributes(const QVector &attributes _additional = 0; } break; case mtpc_documentAttributeSticker: { - bool wasByEmoji = Global::StickersByEmoji_Remove(this); - const MTPDdocumentAttributeSticker &d(attributes[i].c_documentAttributeSticker()); if (type == FileDocument) { type = StickerDocument; @@ -1524,7 +1522,6 @@ void DocumentData::setattributes(const QVector &attributes if (sticker()) { sticker()->alt = qs(d.valt); sticker()->set = d.vstickerset; - if (wasByEmoji) Global::StickersByEmoji_Add(this); } } break; case mtpc_documentAttributeVideo: { diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index f6bb209621..77a056a54b 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.18 + 0.9.19 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index c7e7c48bd9..e22500f40a 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,18,0 - PRODUCTVERSION 0,9,18,0 + FILEVERSION 0,9,19,0 + PRODUCTVERSION 0,9,19,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.18.0" + VALUE "FileVersion", "0.9.19.0" VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.18.0" + VALUE "ProductVersion", "0.9.19.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index cd6cc53379..336683034d 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1701,7 +1701,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.18; + CURRENT_PROJECT_VERSION = 0.9.19; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.18; + CURRENT_PROJECT_VERSION = 0.9.19; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1747,10 +1747,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.18; + CURRENT_PROJECT_VERSION = 0.9.19; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.18; + DYLIB_CURRENT_VERSION = 0.9.19; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1882,10 +1882,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.18; + CURRENT_PROJECT_VERSION = 0.9.19; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.18; + DYLIB_CURRENT_VERSION = 0.9.19; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index cbec672c63..9aa9665cef 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9018 +AppVersion 9019 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.18 -AppVersionStr 0.9.18 -DevChannel 0 +AppVersionStrSmall 0.9.19 +AppVersionStr 0.9.19 +DevChannel 1 BetaVersion 0 9015008 From 5531f49c3e72ceed1a366adfe9291f722cd01cca Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 9 Jan 2016 21:00:50 +0800 Subject: [PATCH 017/316] moved instance id to Global namespace, 0.9.19 dev version --- Telegram/SourceFiles/pspecific_mac_p.mm | 10 +++++----- Telegram/SourceFiles/settings.cpp | 1 - Telegram/SourceFiles/settings.h | 2 -- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index edcf519488..f5013dd781 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -208,10 +208,10 @@ public: } - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification { - NSNumber *instObj = [[notification userInfo] objectForKey:@"inst"]; + NSNumber *instObj = [[notification userInfo] objectForKey:@"launch"]; unsigned long long instLong = instObj ? [instObj unsignedLongLongValue] : 0; DEBUG_LOG(("Received notification with instance %1").arg(instLong)); - if (instLong != cInstance()) { // other app instance notification + if (instLong != Global::LaunchId()) { // other app instance notification return; } if (notification.activationType == NSUserNotificationActivationTypeReplied) { @@ -283,8 +283,8 @@ void PsMacWindowPrivate::showNotify(uint64 peer, int32 msgId, const QPixmap &pix NSUserNotification *notification = [[NSUserNotification alloc] init]; NSImage *img = qt_mac_create_nsimage(pix); - DEBUG_LOG(("Sending notification with userinfo: peer %1, msgId %2 and instance %3").arg(peer).arg(msgId).arg(cInstance())); - [notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:cInstance()],@"inst",nil]]; + DEBUG_LOG(("Sending notification with userinfo: peer %1, msgId %2 and instance %3").arg(peer).arg(msgId).arg(Global::LaunchId())); + [notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:Global::LaunchId()],@"launch",nil]]; [notification setTitle:QNSString(title).s()]; [notification setSubtitle:QNSString(subtitle).s()]; @@ -352,7 +352,7 @@ void PsMacWindowPrivate::clearNotifies(unsigned long long peer) { NSArray *notifies = [center deliveredNotifications]; for (id notify in notifies) { NSDictionary *dict = [notify userInfo]; - if ([[dict objectForKey:@"peer"] unsignedLongLongValue] == peer && [[dict objectForKey:@"inst"] unsignedLongLongValue] == cInstance()) { + if ([[dict objectForKey:@"peer"] unsignedLongLongValue] == peer && [[dict objectForKey:@"launch"] unsignedLongLongValue] == Global::LaunchId()) { [center removeDeliveredNotification:notify]; } } diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index b5d4009778..6860e244a7 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -134,7 +134,6 @@ bool gRetina = false; float64 gRetinaFactor = 1.; int32 gIntRetinaFactor = 1; bool gCustomNotifies = true; -uint64 gInstance = 0.; #ifdef Q_OS_WIN DBIPlatform gPlatform = dbipWindows; diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 561de9062c..e14f92ddc0 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -309,8 +309,6 @@ DeclareSetting(float64, RetinaFactor); DeclareSetting(int32, IntRetinaFactor); DeclareSetting(bool, CustomNotifies); -DeclareReadSetting(uint64, Instance); - DeclareReadSetting(DBIPlatform, Platform); DeclareReadSetting(bool, IsElCapitan); DeclareReadSetting(QUrl, UpdateURL); From 810c60fd8ce424e67a7c7ee89764b18fe9465c8d Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 9 Jan 2016 21:11:18 +0800 Subject: [PATCH 018/316] fixed build for old Qt version --- Telegram/SourceFiles/dropdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index dc38319ad9..326a6d8dac 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4325,7 +4325,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { } else { StickersByEmojiMap::const_iterator i = it->emoji.constFind(emojiGetNoColor(_emoji)); if (i != it->emoji.cend()) { - srows.append(*i); + srows += *i; } } } From 71f588a4fe7f4f51adace131ed54bc6df9d4aeb7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 10 Jan 2016 14:05:23 +0800 Subject: [PATCH 019/316] started signal handlers, shadow fixed in sticker-by-emoji, via @bot resize fixed --- Telegram/SourceFiles/_other/updater.cpp | 22 ++- Telegram/SourceFiles/_other/updater.h | 5 +- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/application.cpp | 8 +- Telegram/SourceFiles/dropdown.cpp | 204 +++++++++++------------ Telegram/SourceFiles/facades.cpp | 2 +- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/logs.cpp | 19 +-- Telegram/SourceFiles/logs.h | 2 +- Telegram/SourceFiles/main.cpp | 14 +- Telegram/SourceFiles/pspecific_linux.cpp | 14 +- Telegram/SourceFiles/pspecific_mac.cpp | 12 +- Telegram/SourceFiles/pspecific_wnd.cpp | 74 ++++---- Telegram/SourceFiles/pspecific_wnd.h | 3 +- Telegram/SourceFiles/settings.cpp | 8 +- Telegram/SourceFiles/stdafx.h | 6 - Telegram/SourceFiles/types.cpp | 43 +++++ Telegram/SourceFiles/types.h | 15 ++ 18 files changed, 253 insertions(+), 202 deletions(-) diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index 103803a882..a1dd35aa01 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -333,9 +333,8 @@ void updateRegistry() { int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdParamarg, int cmdShow) { openLog(); -#ifdef _NEED_WIN_GENERATE_DUMP _oldWndExceptionFilter = SetUnhandledExceptionFilter(_exceptionFilter); -#endif +// CAPIHook apiHook("kernel32.dll", "SetUnhandledExceptionFilter", (PROC)RedirectedSetUnhandledExceptionFilter); writeLog(L"Updaters started.."); @@ -465,7 +464,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara return 0; } -#ifdef _NEED_WIN_GENERATE_DUMP static const WCHAR *_programName = L"Telegram Desktop"; // folder in APPDATA, if current path is unavailable for writing static const WCHAR *_exeName = L"Updater.exe"; @@ -507,10 +505,10 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { GetLocalTime(&stLocalTime); - wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, updaterVersionStr, - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, + wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", + szPath, szExeName, updaterVersionStr, + stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, + stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, GetCurrentProcessId(), GetCurrentThreadId()); return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); } @@ -546,7 +544,7 @@ void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) { hDumpFile = _generateDumpFileAtPath(wstrPath); } } - + if (!hDumpFile || hDumpFile == INVALID_HANDLE_VALUE) { return; } @@ -564,4 +562,10 @@ LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) { return _oldWndExceptionFilter ? (*_oldWndExceptionFilter)(pExceptionPointers) : EXCEPTION_CONTINUE_SEARCH; } -#endif +// see http://www.codeproject.com/Articles/154686/SetUnhandledExceptionFilter-and-the-C-C-Runtime-Li +LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) { + // When the CRT calls SetUnhandledExceptionFilter with NULL parameter + // our handler will not get removed. + _oldWndExceptionFilter = lpTopLevelExceptionFilter; + return 0; +} diff --git a/Telegram/SourceFiles/_other/updater.h b/Telegram/SourceFiles/_other/updater.h index 6afd341a33..b7f8fd8c0b 100644 --- a/Telegram/SourceFiles/_other/updater.h +++ b/Telegram/SourceFiles/_other/updater.h @@ -32,12 +32,9 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org using std::deque; using std::wstring; -#define _NEED_WIN_GENERATE_DUMP - -#ifdef _NEED_WIN_GENERATE_DUMP extern LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter; LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); -#endif _NEED_WIN_GENERATE_DUMP +LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); static int updaterVersion = 1000; static const WCHAR *updaterVersionStr = L"0.1.0"; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 5898cf1aca..c375fea478 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -935,7 +935,7 @@ namespace App { } void checkSavedGif(HistoryItem *item) { - if (!item->toHistoryForwarded() && item->out()) { + if (!item->toHistoryForwarded() && (item->out() || item->history()->peer == App::self())) { if (HistoryMedia *media = item->getMedia()) { if (DocumentData *doc = media->getDocument()) { if (doc->isGifv()) { diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index b455cb6424..856174b53f 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -208,7 +208,7 @@ void Application::updateGotCurrent() { if (!updateReply || updateThread) return; cSetLastUpdateCheck(unixtime()); - QRegularExpressionMatch m = QRegularExpression(qsl("^\\s*(\\d+)\\s*:\\s*([\\x21-\\x7f]+)\\s*$")).match(QString::fromUtf8(updateReply->readAll())); + QRegularExpressionMatch m = QRegularExpression(qsl("^\\s*(\\d+)\\s*:\\s*([\\x21-\\x7f]+)\\s*$")).match(QString::fromLatin1(updateReply->readAll())); if (m.hasMatch()) { uint64 currentVersion = m.captured(1).toULongLong(); QString url = m.captured(2); @@ -642,7 +642,7 @@ void Application::socketConnected() { } commands += qsl("CMD:show;"); DEBUG_LOG(("Application Info: writing commands %1").arg(commands)); - socket.write(commands.toLocal8Bit()); + socket.write(commands.toLatin1()); } void Application::socketWritten(qint64/* bytes*/) { @@ -799,13 +799,13 @@ void Application::readClients() { for (ClientSockets::iterator i = clients.begin(), e = clients.end(); i != e; ++i) { i->second.append(i->first->readAll()); if (i->second.size()) { - QString cmds(QString::fromLocal8Bit(i->second)); + QString cmds(QString::fromLatin1(i->second)); int32 from = 0, l = cmds.length(); for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) { QStringRef cmd(&cmds, from, to - from); if (cmd.startsWith(qsl("CMD:"))) { execExternal(cmds.mid(from + 4, to - from - 4)); - QByteArray response(qsl("RES:%1;").arg(QCoreApplication::applicationPid()).toUtf8()); + QByteArray response(qsl("RES:%1;").arg(QCoreApplication::applicationPid()).toLatin1()); i->first->write(response.data(), response.size()); } else if (cmd.startsWith(qsl("SEND:"))) { if (cSendPaths().isEmpty()) { diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index dc38319ad9..0c706f7dc3 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -3906,122 +3906,120 @@ void MentionsInner::paintEvent(QPaintEvent *e) { } } } - return; - } + } else { + int32 from = qFloor(e->rect().top() / st::mentionHeight), to = qFloor(e->rect().bottom() / st::mentionHeight) + 1; + int32 last = _mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size(); + bool hasUsername = _parent->filter().indexOf('@') > 1; + for (int32 i = from; i < to; ++i) { + if (i >= last) break; - int32 from = qFloor(e->rect().top() / st::mentionHeight), to = qFloor(e->rect().bottom() / st::mentionHeight) + 1; - int32 last = _mrows->isEmpty() ? (_hrows->isEmpty() ? _brows->size() : _hrows->size()) : _mrows->size(); - bool hasUsername = _parent->filter().indexOf('@') > 1; - for (int32 i = from; i < to; ++i) { - if (i >= last) break; - - bool selected = (i == _sel); - if (selected) { - p.fillRect(0, i * st::mentionHeight, width(), st::mentionHeight, st::mentionBgOver->b); - int skip = (st::mentionHeight - st::notifyClose.icon.pxHeight()) / 2; - if (!_hrows->isEmpty() || (!_mrows->isEmpty() && i < _recentInlineBotsInRows)) p.drawPixmap(QPoint(width() - st::notifyClose.icon.pxWidth() - skip, i * st::mentionHeight + skip), App::sprite(), st::notifyClose.icon); - } - p.setPen(st::black->p); - if (!_mrows->isEmpty()) { - UserData *user = _mrows->at(i); - QString first = (_parent->filter().size() < 2) ? QString() : ('@' + user->username.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('@' + user->username) : user->username.mid(_parent->filter().size() - 1); - int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second), unamewidth = firstwidth + secondwidth, namewidth = user->nameText.maxWidth(); - if (mentionwidth < unamewidth + namewidth) { - namewidth = (mentionwidth * namewidth) / (namewidth + unamewidth); - unamewidth = mentionwidth - namewidth; - if (firstwidth < unamewidth + st::mentionFont->elidew) { - if (firstwidth < unamewidth) { - first = st::mentionFont->elided(first, unamewidth); - } else if (!second.isEmpty()) { - first = st::mentionFont->elided(first + second, unamewidth); - second = QString(); + bool selected = (i == _sel); + if (selected) { + p.fillRect(0, i * st::mentionHeight, width(), st::mentionHeight, st::mentionBgOver->b); + int skip = (st::mentionHeight - st::notifyClose.icon.pxHeight()) / 2; + if (!_hrows->isEmpty() || (!_mrows->isEmpty() && i < _recentInlineBotsInRows)) p.drawPixmap(QPoint(width() - st::notifyClose.icon.pxWidth() - skip, i * st::mentionHeight + skip), App::sprite(), st::notifyClose.icon); + } + p.setPen(st::black->p); + if (!_mrows->isEmpty()) { + UserData *user = _mrows->at(i); + QString first = (_parent->filter().size() < 2) ? QString() : ('@' + user->username.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('@' + user->username) : user->username.mid(_parent->filter().size() - 1); + int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second), unamewidth = firstwidth + secondwidth, namewidth = user->nameText.maxWidth(); + if (mentionwidth < unamewidth + namewidth) { + namewidth = (mentionwidth * namewidth) / (namewidth + unamewidth); + unamewidth = mentionwidth - namewidth; + if (firstwidth < unamewidth + st::mentionFont->elidew) { + if (firstwidth < unamewidth) { + first = st::mentionFont->elided(first, unamewidth); + } else if (!second.isEmpty()) { + first = st::mentionFont->elided(first + second, unamewidth); + second = QString(); + } + } else { + second = st::mentionFont->elided(second, unamewidth - firstwidth); } - } else { - 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->nameText.drawElided(p, 2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop, namewidth); - - p.setFont(st::mentionFont->f); - p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p); - p.drawText(mentionleft + namewidth + st::mentionPadding.right(), i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first); - if (!second.isEmpty()) { - p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); - p.drawText(mentionleft + namewidth + st::mentionPadding.right() + firstwidth, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, second); - } - } else if (!_hrows->isEmpty()) { - QString hrow = _hrows->at(i); - QString first = (_parent->filter().size() < 2) ? QString() : ('#' + hrow.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('#' + hrow) : hrow.mid(_parent->filter().size() - 1); - int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second); - if (htagwidth < firstwidth + secondwidth) { - if (htagwidth < firstwidth + st::mentionFont->elidew) { - first = st::mentionFont->elided(first + second, htagwidth); - second = QString(); - } else { - second = st::mentionFont->elided(second, htagwidth - firstwidth); - } - } - - p.setFont(st::mentionFont->f); - if (!first.isEmpty()) { - p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p); - p.drawText(htagleft, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first); - } - if (!second.isEmpty()) { - p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); - p.drawText(htagleft + firstwidth, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, second); - } - } else { - UserData *user = _brows->at(i).first; - - const BotCommand *command = _brows->at(i).second; - QString toHighlight = command->command; - int32 botStatus = _parent->chat() ? _parent->chat()->botStatus : ((_parent->channel() && _parent->channel()->isMegagroup()) ? _parent->channel()->mgInfo->botStatus : -1); - 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->nameText.drawElided(p, 2 * st::mentionPadding.left() + st::mentionPhotoSize, i * st::mentionHeight + st::mentionTop, namewidth); - 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); - int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second); - if (widthleft < firstwidth + secondwidth) { - if (widthleft < firstwidth + st::mentionFont->elidew) { - first = st::mentionFont->elided(first + second, widthleft); - second = QString(); - } else { - second = st::mentionFont->elided(second, widthleft - firstwidth); + p.setFont(st::mentionFont->f); + p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p); + p.drawText(mentionleft + namewidth + st::mentionPadding.right(), i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first); + if (!second.isEmpty()) { + p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); + p.drawText(mentionleft + namewidth + st::mentionPadding.right() + firstwidth, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, second); + } + } else if (!_hrows->isEmpty()) { + QString hrow = _hrows->at(i); + QString first = (_parent->filter().size() < 2) ? QString() : ('#' + hrow.mid(0, _parent->filter().size() - 1)), second = (_parent->filter().size() < 2) ? ('#' + hrow) : hrow.mid(_parent->filter().size() - 1); + int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second); + if (htagwidth < firstwidth + secondwidth) { + if (htagwidth < firstwidth + st::mentionFont->elidew) { + first = st::mentionFont->elided(first + second, htagwidth); + second = QString(); + } else { + second = st::mentionFont->elided(second, htagwidth - firstwidth); + } + } + + p.setFont(st::mentionFont->f); + if (!first.isEmpty()) { + p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p); + p.drawText(htagleft, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first); + } + if (!second.isEmpty()) { + p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); + p.drawText(htagleft + firstwidth, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, second); + } + } else { + UserData *user = _brows->at(i).first; + + const BotCommand *command = _brows->at(i).second; + QString toHighlight = command->command; + int32 botStatus = _parent->chat() ? _parent->chat()->botStatus : ((_parent->channel() && _parent->channel()->isMegagroup()) ? _parent->channel()->mgInfo->botStatus : -1); + 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)); + } + + 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); + int32 firstwidth = st::mentionFont->width(first), secondwidth = st::mentionFont->width(second); + if (widthleft < firstwidth + secondwidth) { + if (widthleft < firstwidth + st::mentionFont->elidew) { + first = st::mentionFont->elided(first + second, widthleft); + second = QString(); + } else { + second = st::mentionFont->elided(second, widthleft - firstwidth); + } + } + p.setFont(st::mentionFont->f); + if (!first.isEmpty()) { + p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p); + p.drawText(mentionleft, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first); + } + if (!second.isEmpty()) { + p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); + p.drawText(mentionleft + firstwidth, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, second); + } + addleft += firstwidth + secondwidth + st::mentionPadding.left(); + widthleft -= firstwidth + secondwidth + st::mentionPadding.left(); + if (widthleft > st::mentionFont->elidew && !command->descriptionText().isEmpty()) { + p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); + command->descriptionText().drawElided(p, mentionleft + addleft, i * st::mentionHeight + st::mentionTop, widthleft, 1, style::al_right); } } - p.setFont(st::mentionFont->f); - if (!first.isEmpty()) { - p.setPen((selected ? st::mentionFgOverActive : st::mentionFgActive)->p); - p.drawText(mentionleft, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, first); - } - if (!second.isEmpty()) { - p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); - p.drawText(mentionleft + firstwidth, i * st::mentionHeight + st::mentionTop + st::mentionFont->ascent, second); - } - addleft += firstwidth + secondwidth + st::mentionPadding.left(); - widthleft -= firstwidth + secondwidth + st::mentionPadding.left(); - if (widthleft > st::mentionFont->elidew && !command->descriptionText().isEmpty()) { - p.setPen((selected ? st::mentionFgOver : st::mentionFg)->p); - command->descriptionText().drawElided(p, mentionleft + addleft, i * st::mentionHeight + st::mentionTop, widthleft, 1, style::al_right); - } } + p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerBottom() - st::lineWidth, width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); } - p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerTop(), width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); - p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerBottom() - st::lineWidth, width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); } void MentionsInner::resizeEvent(QResizeEvent *e) { - _stickersPerRow = int32(width() - 2 * st::stickerPanPadding) / int32(st::stickerPanSize.width()); + _stickersPerRow = qMax(1, int32(width() - 2 * st::stickerPanPadding) / int32(st::stickerPanSize.width())); } void MentionsInner::mouseMoveEvent(QMouseEvent *e) { @@ -4514,7 +4512,7 @@ void MentionsDropdown::setBoundings(QRect boundings) { void MentionsDropdown::recount(bool resetScroll) { int32 h = 0, oldst = _scroll.scrollTop(), st = oldst, maxh = 4.5 * st::mentionHeight; if (!_srows.isEmpty()) { - int32 stickersPerRow = int32(_boundings.width() - 2 * st::stickerPanPadding) / int32(st::stickerPanSize.width()); + int32 stickersPerRow = qMax(1, int32(_boundings.width() - 2 * st::stickerPanPadding) / int32(st::stickerPanSize.width())); int32 rows = rowscount(_srows.size(), stickersPerRow); h = st::stickerPanPadding + rows * st::stickerPanSize.height(); } else if (!_mrows.isEmpty()) { diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index b8befffe4e..683b3cd277 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -178,7 +178,7 @@ namespace Notify { namespace Global { struct Data { - uint64 LaunchId; + uint64 LaunchId = 0; }; Data *_data = 0; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f76055744d..8f49eed683 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2499,6 +2499,7 @@ MsgId History::msgIdForRead() const { int32 History::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem) { if (width != newWidth) resizedItem = 0; // recount all items if (width != newWidth || resizedItem) { + width = newWidth; int32 y = 0; for (Blocks::iterator i = blocks.begin(), e = blocks.end(); i != e; ++i) { HistoryBlock *block = *i; @@ -2513,7 +2514,6 @@ int32 History::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem * ytransform = 0; } } - width = newWidth; height = y; } return height; diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 41529c94aa..9004d46abb 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -30,13 +30,6 @@ namespace { QMutex debugLogMutex, mainLogMutex; - class _StreamCreator { - public: - ~_StreamCreator() { - logsClose(); - } - }; - QString debugLogEntryStart() { static uint32 logEntry = 0; @@ -45,7 +38,7 @@ namespace { QThread *thread = QThread::currentThread(); MTPThread *mtpThread = qobject_cast(thread); uint32 threadId = mtpThread ? mtpThread->getThreadId() : 0; - + return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, zero)).arg(++logEntry, 7, 10, zero); } } @@ -179,9 +172,8 @@ void moveOldDataFiles(const QString &wasDir) { } } -void logsInit() { - static _StreamCreator streamCreator; - if (mainLogStream) return; +bool logsInit() { + t_assert(mainLogStream == 0); QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta")); if (cBetaVersion()) { @@ -283,6 +275,7 @@ void logsInit() { } QDir().setCurrent(cWorkingDir()); + return true; } void logsInitDebug() { @@ -398,7 +391,7 @@ void logsClose() { } QString logVectorLong(const QVector &ids) { - if (!ids.size()) return "[void list]"; + if (!ids.size()) return "[]"; QString idsStr = QString("[%1").arg(ids.cbegin()->v); for (QVector::const_iterator i = ids.cbegin() + 1, e = ids.cend(); i != e; ++i) { idsStr += QString(", %2").arg(i->v); @@ -407,7 +400,7 @@ QString logVectorLong(const QVector &ids) { } QString logVectorLong(const QVector &ids) { - if (!ids.size()) return "[void list]"; + if (!ids.size()) return "[]"; QString idsStr = QString("[%1").arg(*ids.cbegin()); for (QVector::const_iterator i = ids.cbegin() + 1, e = ids.cend(); i != e; ++i) { idsStr += QString(", %2").arg(*i); diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index bb54a12d52..ff75a6f21d 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -92,6 +92,6 @@ inline void t_assert_fail(const char *message, const char *file, int32 line) { #define t_assert_c(condition, comment) t_assert_full(condition, "\"" #condition "\" (" comment ")", __FILE__, __LINE__) #define t_assert(condition) t_assert_full(condition, "\"" #condition "\"", __FILE__, __LINE__) -void logsInit(); +bool logsInit(); void logsInitDebug(); void logsClose(); diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index a64c8641df..13e86c4d15 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -25,11 +25,9 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "localstorage.h" int main(int argc, char *argv[]) { -#ifdef _NEED_WIN_GENERATE_DUMP +#ifdef Q_OS_WIN _oldWndExceptionFilter = SetUnhandledExceptionFilter(_exceptionFilter); -#endif -#ifdef _NEED_LINUX_GENERATE_DUMP - //signal(SIGSEGV, _sigsegvHandler); +// CAPIHook apiHook("kernel32.dll", "SetUnhandledExceptionFilter", (PROC)RedirectedSetUnhandledExceptionFilter); #endif settingsParseArgs(argc, argv); @@ -40,7 +38,11 @@ int main(int argc, char *argv[]) { return psCleanup(); } } - logsInit(); + if (!logsInit()) { + return 0; + } + + installSignalHandlers(); Global::Initializer _init; @@ -58,7 +60,7 @@ int main(int argc, char *argv[]) { if (cDebug()) { LOG(("Application Info: Telegram started in debug mode")); for (int32 i = 0; i < argc; ++i) { - LOG(("Argument: %1").arg(QString::fromLocal8Bit(argv[i]))); + LOG(("Argument: %1").arg(fromUtf8Safe(argv[i]))); } QStringList logs = psInitLogs(); for (int32 i = 0, l = logs.size(); i < l; ++i) { diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index b4efe2a772..35e208f8ab 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -1,17 +1,17 @@ /* 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. - + Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ @@ -667,7 +667,7 @@ void PsMainWindow::psUpdateCounter() { } else if (trayIcon) { int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; - + style::color bg = muted ? st::counterMuteBG : st::counterBG; QIcon iconSmall; iconSmall.addPixmap(QPixmap::fromImage(iconWithCounter(16, counter, bg, true), Qt::ColorOnly)); @@ -1072,7 +1072,7 @@ QString psCurrentLanguage() { namespace { QString _psHomeDir() { struct passwd *pw = getpwuid(getuid()); - return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (QString::fromLocal8Bit(pw->pw_dir) + '/') : QString(); + return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (fromUtf8Safe(pw->pw_dir) + '/') : QString(); } } @@ -1086,7 +1086,7 @@ QString psDownloadPath() { } QString psCurrentExeDirectory(int argc, char *argv[]) { - QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString(); + QString first = argc ? fromUtf8Safe(argv[0]) : QString(); if (!first.isEmpty()) { QFileInfo info(first); if (info.isSymLink()) { @@ -1100,7 +1100,7 @@ QString psCurrentExeDirectory(int argc, char *argv[]) { } QString psCurrentExeName(int argc, char *argv[]) { - QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString(); + QString first = argc ? fromUtf8Safe(argv[0]) : QString(); if (!first.isEmpty()) { QFileInfo info(first); if (info.isSymLink()) { diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 420ff8ad94..266da76f12 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -1,17 +1,17 @@ /* 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. - + Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ @@ -83,7 +83,7 @@ void MacPrivate::notifyClicked(unsigned long long peer, int msgid) { void MacPrivate::notifyReplied(unsigned long long peer, int msgid, const char *str) { History *history = App::history(PeerId(peer)); - + App::main()->sendMessage(history, QString::fromUtf8(str), (msgid > 0 && !history->peer->isUser()) ? msgid : 0, false); } @@ -592,7 +592,7 @@ QString psDownloadPath() { } QString psCurrentExeDirectory(int argc, char *argv[]) { - QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString(); + QString first = argc ? fromUtf8Safe(argv[0]) : QString(); if (!first.isEmpty()) { QFileInfo info(first); if (info.exists()) { @@ -603,7 +603,7 @@ QString psCurrentExeDirectory(int argc, char *argv[]) { } QString psCurrentExeName(int argc, char *argv[]) { - QString first = argc ? QString::fromLocal8Bit(argv[0]) : QString(); + QString first = argc ? fromUtf8Safe(argv[0]) : QString(); if (!first.isEmpty()) { QFileInfo info(first); if (info.exists()) { diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 6f5c0794f6..9db1afd292 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -106,7 +106,7 @@ namespace { bool sessionLoggedOff = false; UINT tbCreatedMsgId = 0; - + ComPtr taskbarList; ComPtr toastNotificationManager; @@ -132,7 +132,7 @@ namespace { HWND createTaskbarHider() { HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); HWND hWnd = 0; - + QString cn = QString("TelegramTaskbarHider"); LPCWSTR _cn = (LPCWSTR)cn.utf16(); WNDCLASSEX wc; @@ -153,7 +153,7 @@ namespace { 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())); @@ -186,12 +186,12 @@ namespace { 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) { @@ -251,7 +251,7 @@ namespace { 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; @@ -460,7 +460,7 @@ namespace { from = _fullsize - (_size - _shift); max_w *= 2; for (int i = 0; i < 4; i += 2) { - DeleteObject(bitmaps[i]); + DeleteObject(bitmaps[i]); bitmaps[i] = CreateCompatibleBitmap(screenDC, max_w, _size); SelectObject(dcs[i], bitmaps[i]); } @@ -549,7 +549,7 @@ namespace { _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); @@ -680,7 +680,7 @@ namespace { 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; @@ -695,7 +695,7 @@ namespace { 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; @@ -849,7 +849,7 @@ namespace { QTimer::singleShot(0, Application::wnd(), SLOT(updateCounter())); Application::wnd()->update(); } return false; - + case WM_NCPAINT: if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) return false; *result = 0; return true; case WM_NCCALCSIZE: { @@ -936,7 +936,7 @@ namespace { case HitTestBottomLeft: *result = HTBOTTOMLEFT; break; case HitTestLeft: *result = HTLEFT; break; case HitTestTopLeft: *result = HTTOPLEFT; break; - case HitTestNone: + case HitTestNone: default: *result = HTTRANSPARENT; break; }; } return true; @@ -951,7 +951,7 @@ namespace { GetWindowRect(hWnd, &r); HitTestType res = Application::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); switch (res) { - case HitTestIcon: + case HitTestIcon: if (menuHidden && getms() < menuHidden + 10) { menuHidden = 0; if (getms() < menuShown + GetDoubleClickTime()) { @@ -1229,7 +1229,7 @@ void PsMainWindow::psInitFrameless() { if (!ps_hWnd) return; if (useWtsapi) wtsRegisterSessionNotification(ps_hWnd, NOTIFY_FOR_THIS_SESSION); - + if (frameless) { setWindowFlags(Qt::FramelessWindowHint); } @@ -1395,7 +1395,7 @@ void PsMainWindow::psUpdateMargins() { RECT w, m; GetWindowRect(ps_hWnd, &w); m = w; - + HMONITOR hMonitor = MonitorFromRect(&w, MONITOR_DEFAULTTONEAREST); if (hMonitor) { MONITORINFO mi; @@ -1915,7 +1915,7 @@ void psDoFixPrevious() { 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; @@ -2048,7 +2048,7 @@ bool psShowOpenWithMenu(int x, int y, const QString &file) { 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; @@ -2063,7 +2063,7 @@ bool psShowOpenWithMenu(int x, int y, const QString &file) { } else { handler->Release(); } - } while (hr != S_FALSE); + } while (hr != S_FALSE); assocHandlers->Release(); } @@ -2201,7 +2201,7 @@ namespace { } return true; } - + bool _psSetKeyValue(HKEY rkey, LPCWSTR value, QString v) { static const int bufSize = 4096; DWORD defaultType, defaultSize = bufSize * 2; @@ -2352,7 +2352,6 @@ void psUpdateOverlayed(TWidget *widget) { if (!wv) widget->setAttribute(Qt::WA_WState_Visible, false); } -#ifdef _NEED_WIN_GENERATE_DUMP static const WCHAR *_programName = AppName; // folder in APPDATA, if current path is unavailable for writing static const WCHAR *_exeName = L"Telegram.exe"; @@ -2396,16 +2395,16 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { GetLocalTime(&stLocalTime); if (cBetaVersion()) { - wsprintf(szFileName, L"%s%s-%ld-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, cBetaVersion(), - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, + wsprintf(szFileName, L"%s%s-%ld-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", + szPath, szExeName, cBetaVersion(), + stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, + stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, GetCurrentProcessId(), GetCurrentThreadId()); } else { - wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, AppVersionStr, - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, + wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", + szPath, szExeName, AppVersionStr, + stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, + stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, GetCurrentProcessId(), GetCurrentThreadId()); } return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); @@ -2455,9 +2454,16 @@ void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) { LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) { _generateDump(pExceptionPointers); - return _oldWndExceptionFilter ? (*_oldWndExceptionFilter)(pExceptionPointers) : EXCEPTION_CONTINUE_SEARCH; + return _oldWndExceptionFilter ? (*_oldWndExceptionFilter)(pExceptionPointers) : EXCEPTION_CONTINUE_SEARCH; +} + +// see http://www.codeproject.com/Articles/154686/SetUnhandledExceptionFilter-and-the-C-C-Runtime-Li +LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) { + // When the CRT calls SetUnhandledExceptionFilter with NULL parameter + // our handler will not get removed. + _oldWndExceptionFilter = lpTopLevelExceptionFilter; + return 0; } -#endif class StringReferenceWrapper { public: @@ -2595,7 +2601,7 @@ public: ~ToastEventHandler() { } - // DesktopToastActivatedEventHandler + // DesktopToastActivatedEventHandler IFACEMETHODIMP Invoke(_In_ IToastNotification *sender, _In_ IInspectable* args) { ToastNotifications::iterator i = toastNotifications.find(_peerId); if (i != toastNotifications.cend()) { @@ -2867,7 +2873,7 @@ void CheckPinnedAppUserModelId() { 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 }; @@ -2913,7 +2919,7 @@ void CheckPinnedAppUserModelId() { 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); @@ -3005,7 +3011,7 @@ void CleanupAppUserModelIdShortcut() { 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()); diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index 279de4c607..2d4232bf10 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -113,10 +113,9 @@ private: void psDestroyIcons(); }; -#ifdef _NEED_WIN_GENERATE_DUMP extern LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter; LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); -#endif +LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); class PsApplication : public QApplication { Q_OBJECT diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 6860e244a7..0992e6a9fe 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -199,7 +199,7 @@ void settingsParseArgs(int argc, char *argv[]) { } else if (string("-many") == argv[i]) { gManyInstance = true; } else if (string("-key") == argv[i] && i + 1 < argc) { - gKeyFile = QString::fromLocal8Bit(argv[++i]); + gKeyFile = fromUtf8Safe(argv[++i]); } else if (string("-autostart") == argv[i]) { gFromAutoStart = true; } else if (string("-noupdate") == argv[i]) { @@ -210,15 +210,15 @@ void settingsParseArgs(int argc, char *argv[]) { gStartInTray = true; } else if (string("-sendpath") == argv[i] && i + 1 < argc) { for (++i; i < argc; ++i) { - gSendPaths.push_back(QString::fromLocal8Bit(argv[i])); + gSendPaths.push_back(fromUtf8Safe(argv[i])); } } else if (string("-workdir") == argv[i] && i + 1 < argc) { - QString dir = QString::fromLocal8Bit(argv[++i]); + QString dir = fromUtf8Safe(argv[++i]); if (QDir().exists(dir)) { gWorkingDir = dir; } } else if (string("--") == argv[i] && i + 1 < argc) { - gStartUrl = QString::fromLocal8Bit(argv[++i]); + gStartUrl = fromUtf8Safe(argv[++i]); } } } diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 104079dc6d..bc67e11838 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -45,12 +45,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #endif -#if defined Q_OS_WIN -#define _NEED_WIN_GENERATE_DUMP -#elif defined Q_OS_LINUX32 || defined Q_OS_LINUX64 -#define _NEED_LINUX_GENERATE_DUMP -#endif - extern "C" { #include diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 0b34064264..ca7c917b40 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -22,6 +22,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "application.h" +#include + uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; #ifdef Q_OS_WIN @@ -303,6 +305,47 @@ void deinitThirdParty() { _sslLocks = 0; } +namespace { + FILE *_crashDump = 0; + int _crashDumpNo = 0; +} + +void _signalHandler(int signum) { + const char* name = 0; + switch (signum) { + case SIGABRT: name = "SIGABRT"; break; + case SIGSEGV: name = "SIGSEGV"; break; + case SIGILL: name = "SIGILL"; break; + case SIGFPE: name = "SIGFPE"; break; +#ifndef Q_OS_WIN + case SIGBUS: name = "SIGBUS"; break; + case SIGSYS: name = "SIGSYS"; break; +#endif + } + LOG(("Caught signal %1").arg(name)); + if (name) + fprintf(stdout, "Caught signal %d (%s)\n", signum, name); + else + fprintf(stdout, "Caught signal %d\n", signum); + + + //printStackTrace(); +} + +void installSignalHandlers() { + _crashDump = fopen((cWorkingDir() + qsl("tdata/working")).toUtf8().constData(), "wb"); + if (_crashDump) _crashDumpNo = fileno(_crashDump); + + signal(SIGABRT, _signalHandler); + signal(SIGSEGV, _signalHandler); + signal(SIGILL, _signalHandler); + signal(SIGFPE, _signalHandler); +#ifndef Q_OS_WIN + signal(SIGBUS, _signalHandler); + signal(SIGSYS, _signalHandler); +#endif +} + bool checkms() { int64 unixms = (myunixtime() - _timeStart) * 1000LL + _msAddToUnixtime; int64 ms = int64(getms(true)); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 264e4cfc14..3406ef1f08 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -133,6 +133,8 @@ inline void mylocaltime(struct tm * _Tm, const time_t * _Time) { #endif } +void installSignalHandlers(); + void initThirdParty(); // called by Global::Initializer void deinitThirdParty(); @@ -233,6 +235,19 @@ private: #define qsl(s) QStringLiteral(s) #define qstr(s) QLatin1String(s, sizeof(s) - 1) +inline QString fromUtf8Safe(const char *str, int32 size = -1) { + if (!str || !size) return QString(); + if (size < 0) size = int32(strlen(str)); + QString result(QString::fromUtf8(str, size)); + QByteArray back = result.toUtf8(); + if (back.size() != size || memcmp(back.constData(), str, size)) return QString::fromLocal8Bit(str, size); + return result; +} + +inline QString fromUtf8Safe(const QByteArray &str) { + return fromUtf8Safe(str.constData(), str.size()); +} + static const QRegularExpression::PatternOptions reMultiline(QRegularExpression::DotMatchesEverythingOption | QRegularExpression::MultilineOption); template From fc02f96ef1c815c144fd673e4a3881ec5d6701aa Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 11 Jan 2016 12:45:07 +0800 Subject: [PATCH 020/316] via @bot fixed in forwarded, stickers requested in stickersbox, sticker not autoselected in dropdown, forwarded messages to chats fixed from_id and via_bot_id --- Telegram/SourceFiles/boxes/stickersetbox.cpp | 1 + Telegram/SourceFiles/dropdown.cpp | 2 +- Telegram/SourceFiles/history.cpp | 18 +++++++++++++----- Telegram/SourceFiles/history.h | 7 +++++++ Telegram/SourceFiles/structs.h | 4 ---- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index d8112e5307..4424755959 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -727,6 +727,7 @@ StickersBox::StickersBox() : ItemListBox(st::boxScroll) setMaxHeight(snap(countHeight(), int32(st::sessionsHeight), int32(st::boxMaxListHeight))); connect(App::main(), SIGNAL(stickersUpdated()), this, SLOT(onStickersUpdated())); + App::main()->updateStickers(); connect(&_cancel, SIGNAL(clicked()), this, SLOT(onClose())); connect(&_save, SIGNAL(clicked()), this, SLOT(onSave())); diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 0c706f7dc3..d16cb8c21f 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4030,7 +4030,7 @@ void MentionsInner::mouseMoveEvent(QMouseEvent *e) { void MentionsInner::clearSel() { _mouseSel = _overDelete = false; - setSel((_mrows->isEmpty() && _brows->isEmpty() && _hrows->isEmpty() && _srows->isEmpty()) ? -1 : 0); + setSel((_mrows->isEmpty() && _brows->isEmpty() && _hrows->isEmpty()) ? -1 : 0); } bool MentionsInner::moveSel(int key) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8f49eed683..ef73e71ac3 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6578,17 +6578,18 @@ int32 HistoryMessage::resize(int32 width) { if (media) _height += _media->resize(width, this); } - int32 l = 0, w = 0; - countPositionAndSize(l, w); - if (displayFromName()) { if (emptyText()) { _height += st::msgPadding.top() + st::msgNameFont->height + st::mediaHeaderSkip; } else { _height += st::msgNameFont->height; } + int32 l = 0, w = 0; + countPositionAndSize(l, w); fromNameUpdated(w); } else if (via() && !toHistoryForwarded()) { + int32 l = 0, w = 0; + countPositionAndSize(l, w); via()->resize(w - st::msgPadding.left() - st::msgPadding.right()); if (emptyText() && !displayFromName()) { _height += st::msgPadding.top() + st::msgNameFont->height + st::mediaHeaderSkip; @@ -6788,7 +6789,7 @@ HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const } HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg) -: HistoryMessage(history, block, id, newMessageFlags(history->peer) | (!history->peer->isChannel() && msg->getMedia() && (msg->getMedia()->type() == MediaTypeAudio/* || msg->getMedia()->type() == MediaTypeVideo*/) ? MTPDmessage::flag_media_unread : 0), msg->via() ? peerToUser(msg->viaBot()->id) : 0, date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->getMedia()) +: HistoryMessage(history, block, id, newForwardedFlags(history->peer, from, msg), msg->via() ? peerToUser(msg->viaBot()->id) : 0, date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->getMedia()) , fwdDate(msg->dateForwarded()) , fwdFrom(msg->fromForwarded()) , fwdFromVersion(fwdFrom->nameVersion) @@ -6818,6 +6819,11 @@ void HistoryForwarded::initDimensions() { void HistoryForwarded::fwdNameUpdated() const { QString fwdName((via() && fwdFrom->isUser()) ? fwdFrom->asUser()->firstName : App::peerName(fwdFrom)); fwdFromName.setText(st::msgServiceNameFont, fwdName, _textNameOptions); + if (via()) { + int32 l = 0, w = 0; + countPositionAndSize(l, w); + via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - fromWidth - fwdFromName.maxWidth() - st::msgServiceFont->spacew); + } } void HistoryForwarded::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { @@ -6870,7 +6876,9 @@ int32 HistoryForwarded::resize(int32 width) { _height += st::msgServiceNameFont->height; } if (via()) { - via()->resize(width - st::msgPadding.left() - st::msgPadding.right() - fromWidth - fwdFromName.maxWidth() - st::msgServiceFont->spacew); + int32 l = 0, w = 0; + countPositionAndSize(l, w); + via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - fromWidth - fwdFromName.maxWidth() - st::msgServiceFont->spacew); } } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index f176fc6f32..360d2cedc7 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -2235,6 +2235,13 @@ 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 int32 newForwardedFlags(PeerData *p, int32 from, HistoryMessage *msg) { + return newMessageFlags(p) | (from ? MTPDmessage::flag_from_id : 0) | (msg->via() ? MTPDmessage::flag_via_bot_id : 0) | (!p->isChannel() && msg->getMedia() && (msg->getMedia()->type() == MediaTypeAudio/* || msg->getMedia()->type() == MediaTypeVideo*/) ? MTPDmessage::flag_media_unread : 0); +} + class HistoryServiceMsg : public HistoryItem { public: diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 4da22636dc..8de9bf0c5d 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -717,10 +717,6 @@ inline bool PeerData::canWrite() const { return isChannel() ? asChannel()->canWrite() : (isChat() ? asChat()->canWrite() : (isUser() ? asUser()->canWrite() : false)); } -inline int32 newMessageFlags(PeerData *p) { - return p->isSelf() ? 0 : (((p->isChat() || (p->isUser() && !p->asUser()->botInfo)) ? MTPDmessage::flag_unread : 0) | MTPDmessage::flag_out); -} - enum ActionOnLoad { ActionOnLoadNone, ActionOnLoadOpen, From 58777dbc21b39f5dd4b0b19e01470514bf37e84a Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 11 Jan 2016 23:43:29 +0800 Subject: [PATCH 021/316] moved almost all Application to AppClass (autoupdate and singleinstance left), logs rewritten --- Telegram/SourceFiles/app.cpp | 10 +- Telegram/SourceFiles/app.h | 4 +- Telegram/SourceFiles/application.cpp | 1433 +++++++++-------- Telegram/SourceFiles/application.h | 190 ++- Telegram/SourceFiles/audio.cpp | 2 +- Telegram/SourceFiles/autoupdater.cpp | 59 +- Telegram/SourceFiles/autoupdater.h | 8 +- Telegram/SourceFiles/boxes/aboutbox.cpp | 2 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 2 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 4 +- Telegram/SourceFiles/boxes/usernamebox.cpp | 2 +- Telegram/SourceFiles/facades.cpp | 143 +- Telegram/SourceFiles/facades.h | 29 +- Telegram/SourceFiles/gui/button.cpp | 1 - Telegram/SourceFiles/gui/popupmenu.cpp | 2 +- Telegram/SourceFiles/gui/text.cpp | 9 - Telegram/SourceFiles/history.cpp | 4 +- Telegram/SourceFiles/intro/intro.cpp | 2 +- Telegram/SourceFiles/intro/introphone.cpp | 6 +- Telegram/SourceFiles/intro/introsteps.cpp | 2 +- Telegram/SourceFiles/localstorage.cpp | 21 +- Telegram/SourceFiles/localstorage.h | 2 +- Telegram/SourceFiles/logs.cpp | 598 ++++--- Telegram/SourceFiles/logs.h | 123 +- Telegram/SourceFiles/main.cpp | 65 +- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/mediaview.cpp | 8 +- Telegram/SourceFiles/mtproto/generate.py | 5 +- Telegram/SourceFiles/mtproto/mtpAuthKey.h | 2 +- .../SourceFiles/mtproto/mtpConnection.cpp | 152 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp | 8 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 9 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 3 - Telegram/SourceFiles/mtproto/mtpScheme.h | 4 - Telegram/SourceFiles/mtproto/mtpSession.cpp | 8 +- Telegram/SourceFiles/pspecific.h | 9 + Telegram/SourceFiles/pspecific_linux.cpp | 90 +- Telegram/SourceFiles/pspecific_linux.h | 27 +- Telegram/SourceFiles/pspecific_mac.cpp | 29 +- Telegram/SourceFiles/pspecific_mac.h | 24 +- Telegram/SourceFiles/pspecific_mac_p.mm | 48 +- Telegram/SourceFiles/pspecific_wnd.cpp | 86 +- Telegram/SourceFiles/pspecific_wnd.h | 15 +- Telegram/SourceFiles/settings.cpp | 17 +- Telegram/SourceFiles/settings.h | 14 +- Telegram/SourceFiles/settingswidget.cpp | 22 +- Telegram/SourceFiles/stdafx.h | 2 + Telegram/SourceFiles/sysbuttons.cpp | 4 +- Telegram/SourceFiles/title.cpp | 12 +- Telegram/SourceFiles/types.cpp | 68 +- Telegram/SourceFiles/types.h | 18 +- Telegram/SourceFiles/window.cpp | 2 +- Telegram/Telegram.pro | 4 +- Telegram/Telegram.vcxproj | 260 +-- Telegram/Telegram.xcodeproj/project.pbxproj | 2 - 55 files changed, 1904 insertions(+), 1773 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index c375fea478..e12b643c21 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -151,12 +151,12 @@ namespace App { return result; } - Application *app() { - return Application::app(); + AppClass *app() { + return AppClass::app(); } Window *wnd() { - return Application::wnd(); + return AppClass::wnd(); } MainWidget *main() { @@ -2279,9 +2279,7 @@ namespace App { if (wnd()) { wnd()->quit(); } - if (app()) { - app()->quit(); - } + Application::quit(); } bool quiting() { diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index c01fdf9802..4e55647340 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -22,7 +22,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "types.h" -class Application; +class AppClass; class Window; class MainWidget; class SettingsWidget; @@ -59,7 +59,7 @@ struct ReplyMarkup { class LayeredWidget; namespace App { - Application *app(); + AppClass *app(); Window *wnd(); MainWidget *main(); SettingsWidget *settings(); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 856174b53f..794503b956 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -35,10 +35,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "autoupdater.h" namespace { - Application *mainApp = 0; - FileUploader *uploader = 0; - QString lng; - void mtpStateChanged(int32 dc, int32 state) { if (App::wnd()) { App::wnd()->mtpStateChanged(dc, state); @@ -55,7 +51,6 @@ namespace { public: EventFilterForKeys(QObject *parent) : QObject(parent) { - } bool eventFilter(QObject *o, QEvent *e) { if (e->type() == QEvent::KeyPress) { @@ -94,502 +89,7 @@ namespace { } }; -} -Application::Application(int &argc, char **argv) : PsApplication(argc, argv), - serverName(psServerPrefix() + cGUIDStr()), closing(false), - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - updateRequestId(0), updateReply(0), updateThread(0), updateDownloader(0), - #endif - _translator(0) { - - DEBUG_LOG(("Application Info: creation..")); - - QByteArray d(QDir((cPlatform() == dbipWindows ? cExeDir() : cWorkingDir()).toLower()).absolutePath().toUtf8()); - char h[33] = { 0 }; - hashMd5Hex(d.constData(), d.size(), h); - serverName = psServerPrefix() + h + '-' + cGUIDStr(); - - if (mainApp) { - DEBUG_LOG(("Application Error: another Application was created, terminating..")); - exit(0); - } - mainApp = this; - - installEventFilter(new EventFilterForKeys(this)); - - QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Regular.ttf")); - QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Bold.ttf")); - QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Semibold.ttf")); - - float64 dpi = primaryScreen()->logicalDotsPerInch(); - if (dpi <= 108) { // 0-96-108 - cSetScreenScale(dbisOne); - } else if (dpi <= 132) { // 108-120-132 - cSetScreenScale(dbisOneAndQuarter); - } else if (dpi <= 168) { // 132-144-168 - cSetScreenScale(dbisOneAndHalf); - } else { // 168-192-inf - cSetScreenScale(dbisTwo); - } - - if (devicePixelRatio() > 1) { - cSetRetina(true); - cSetRetinaFactor(devicePixelRatio()); - cSetIntRetinaFactor(int32(cRetinaFactor())); - cSetConfigScale(dbisOne); - cSetRealScale(dbisOne); - } - - if (cLang() < languageTest) { - cSetLang(languageId()); - } - if (cLang() == languageTest) { - if (QFileInfo(cLangFile()).exists()) { - LangLoaderPlain loader(cLangFile()); - cSetLangErrors(loader.errors()); - if (!cLangErrors().isEmpty()) { - LOG(("Lang load errors: %1").arg(cLangErrors())); - } else if (!loader.warnings().isEmpty()) { - LOG(("Lang load warnings: %1").arg(loader.warnings())); - } - } else { - cSetLang(languageDefault); - } - } else if (cLang() > languageDefault && cLang() < languageCount) { - LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[cLang()] + qsl(".strings")); - if (!loader.errors().isEmpty()) { - LOG(("Lang load errors: %1").arg(loader.errors())); - } else if (!loader.warnings().isEmpty()) { - LOG(("Lang load warnings: %1").arg(loader.warnings())); - } - } - - installTranslator(_translator = new Translator()); - - style::startManager(); - anim::startManager(); - historyInit(); - - DEBUG_LOG(("Application Info: inited..")); - - window = new Window(); - - psInstallEventFilter(); - - connect(&socket, SIGNAL(connected()), this, SLOT(socketConnected())); - connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); - connect(&socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(socketError(QLocalSocket::LocalSocketError))); - connect(&socket, SIGNAL(bytesWritten(qint64)), this, SLOT(socketWritten(qint64))); - connect(&socket, SIGNAL(readyRead()), this, SLOT(socketReading())); - connect(&server, SIGNAL(newConnection()), this, SLOT(newInstanceConnected())); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(closeApplication())); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - connect(&updateCheckTimer, SIGNAL(timeout()), this, SLOT(startUpdateCheck())); - connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); - connect(this, SIGNAL(updateReady()), this, SLOT(onUpdateReady())); - #endif - connect(this, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); - - connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause())); - - connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions())); - - if (cManyInstance()) { - startApp(); - } else { - DEBUG_LOG(("Application Info: connecting local socket to %1..").arg(serverName)); - socket.connectToServer(serverName); - } -} - -#ifndef TDESKTOP_DISABLE_AUTOUPDATE -void Application::updateGotCurrent() { - if (!updateReply || updateThread) return; - - cSetLastUpdateCheck(unixtime()); - QRegularExpressionMatch m = QRegularExpression(qsl("^\\s*(\\d+)\\s*:\\s*([\\x21-\\x7f]+)\\s*$")).match(QString::fromLatin1(updateReply->readAll())); - if (m.hasMatch()) { - uint64 currentVersion = m.captured(1).toULongLong(); - QString url = m.captured(2); - bool betaVersion = false; - if (url.startsWith(qstr("beta_"))) { - betaVersion = true; - url = url.mid(5) + '_' + countBetaVersionSignature(currentVersion); - } - if ((!betaVersion || cBetaVersion()) && currentVersion > (betaVersion ? cBetaVersion() : uint64(AppVersion))) { - updateThread = new QThread(); - connect(updateThread, SIGNAL(finished()), updateThread, SLOT(deleteLater())); - updateDownloader = new UpdateDownloader(updateThread, url); - updateThread->start(); - } - } - if (updateReply) updateReply->deleteLater(); - updateReply = 0; - if (!updateThread) { - QDir updates(cWorkingDir() + "tupdates"); - if (updates.exists()) { - QFileInfoList list = updates.entryInfoList(QDir::Files); - for (QFileInfoList::iterator i = list.begin(), e = list.end(); i != e; ++i) { - if (QRegularExpression("^(tupdate|tmacupd|tmac32upd|tlinuxupd|tlinux32upd)\\d+(_[a-z\\d]+)?$", QRegularExpression::CaseInsensitiveOption).match(i->fileName()).hasMatch()) { - QFile(i->absoluteFilePath()).remove(); - } - } - } - emit updateLatest(); - } - startUpdateCheck(true); - Local::writeSettings(); -} - -void Application::updateFailedCurrent(QNetworkReply::NetworkError e) { - LOG(("App Error: could not get current version (update check): %1").arg(e)); - if (updateReply) updateReply->deleteLater(); - updateReply = 0; - - emit updateFailed(); - startUpdateCheck(true); -} - -void Application::onUpdateReady() { - if (updateDownloader) { - updateDownloader->deleteLater(); - updateDownloader = 0; - } - updateCheckTimer.stop(); - - cSetLastUpdateCheck(unixtime()); - Local::writeSettings(); -} - -void Application::onUpdateFailed() { - if (updateDownloader) { - updateDownloader->deleteLater(); - updateDownloader = 0; - if (updateThread) updateThread->quit(); - updateThread = 0; - } - - cSetLastUpdateCheck(unixtime()); - Local::writeSettings(); -} -#endif - -void Application::regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId) { - photoUpdates.insert(msgId, peer); -} - -void Application::clearPhotoUpdates() { - photoUpdates.clear(); -} - -bool Application::isPhotoUpdating(const PeerId &peer) { - for (QMap::iterator i = photoUpdates.begin(), e = photoUpdates.end(); i != e; ++i) { - if (i.value() == peer) { - return true; - } - } - return false; -} - -void Application::cancelPhotoUpdate(const PeerId &peer) { - for (QMap::iterator i = photoUpdates.begin(), e = photoUpdates.end(); i != e;) { - if (i.value() == peer) { - i = photoUpdates.erase(i); - } else { - ++i; - } - } -} - -void Application::mtpPause() { - MTP::pause(); - _mtpUnpauseTimer.start(st::slideDuration * 2); -} - -void Application::mtpUnpause() { - _mtpUnpauseTimer.start(1); -} - -void Application::doMtpUnpause() { - MTP::unpause(); -} - -void Application::selfPhotoCleared(const MTPUserProfilePhoto &result) { - if (!App::self()) return; - App::self()->setPhoto(result); - emit peerPhotoDone(App::self()->id); -} - -void Application::chatPhotoCleared(PeerId peer, const MTPUpdates &updates) { - if (App::main()) { - App::main()->sentUpdatesReceived(updates); - } - cancelPhotoUpdate(peer); - emit peerPhotoDone(peer); -} - -void Application::selfPhotoDone(const MTPphotos_Photo &result) { - if (!App::self()) return; - const MTPDphotos_photo &photo(result.c_photos_photo()); - App::feedPhoto(photo.vphoto); - App::feedUsers(photo.vusers); - cancelPhotoUpdate(App::self()->id); - emit peerPhotoDone(App::self()->id); -} - -void Application::chatPhotoDone(PeerId peer, const MTPUpdates &updates) { - if (App::main()) { - App::main()->sentUpdatesReceived(updates); - } - cancelPhotoUpdate(peer); - emit peerPhotoDone(peer); -} - -bool Application::peerPhotoFail(PeerId peer, const RPCError &error) { - if (mtpIsFlood(error)) return false; - - LOG(("Application Error: update photo failed %1: %2").arg(error.type()).arg(error.description())); - cancelPhotoUpdate(peer); - emit peerPhotoFail(peer); - return true; -} - -void Application::peerClearPhoto(PeerId id) { - if (MTP::authedId() && peerToUser(id) == MTP::authedId()) { - MTP::send(MTPphotos_UpdateProfilePhoto(MTP_inputPhotoEmpty(), MTP_inputPhotoCropAuto()), rpcDone(&Application::selfPhotoCleared), rpcFail(&Application::peerPhotoFail, id)); - } else if (peerIsChat(id)) { - MTP::send(MTPmessages_EditChatPhoto(peerToBareMTPInt(id), MTP_inputChatPhotoEmpty()), rpcDone(&Application::chatPhotoCleared, id), rpcFail(&Application::peerPhotoFail, id)); - } else if (peerIsChannel(id)) { - if (ChannelData *channel = App::channelLoaded(id)) { - MTP::send(MTPchannels_EditPhoto(channel->inputChannel, MTP_inputChatPhotoEmpty()), rpcDone(&Application::chatPhotoCleared, id), rpcFail(&Application::peerPhotoFail, id)); - } - } -} - -void Application::killDownloadSessionsStart(int32 dc) { - if (killDownloadSessionTimes.constFind(dc) == killDownloadSessionTimes.cend()) { - killDownloadSessionTimes.insert(dc, getms() + MTPAckSendWaiting + MTPKillFileSessionTimeout); - } - if (!killDownloadSessionsTimer.isActive()) { - killDownloadSessionsTimer.start(MTPAckSendWaiting + MTPKillFileSessionTimeout + 5); - } -} - -void Application::killDownloadSessionsStop(int32 dc) { - killDownloadSessionTimes.remove(dc); - if (killDownloadSessionTimes.isEmpty() && killDownloadSessionsTimer.isActive()) { - killDownloadSessionsTimer.stop(); - } -} - -void Application::checkLocalTime() { - if (App::main()) App::main()->checkLastUpdate(checkms()); -} - -void Application::onAppStateChanged(Qt::ApplicationState state) { - checkLocalTime(); - if (window) window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); -} - -void Application::killDownloadSessions() { - uint64 ms = getms(), left = MTPAckSendWaiting + MTPKillFileSessionTimeout; - for (QMap::iterator i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) { - if (i.value() <= ms) { - for (int j = 0; j < MTPDownloadSessionsCount; ++j) { - MTP::stopSession(MTP::dld[j] + i.key()); - } - i = killDownloadSessionTimes.erase(i); - } else { - if (i.value() - ms < left) { - left = i.value() - ms; - } - ++i; - } - } - if (!killDownloadSessionTimes.isEmpty()) { - killDownloadSessionsTimer.start(left); - } -} - -void Application::photoUpdated(const FullMsgId &msgId, const MTPInputFile &file) { - if (!App::self()) return; - - QMap::iterator i = photoUpdates.find(msgId); - if (i != photoUpdates.end()) { - PeerId id = i.value(); - if (MTP::authedId() && peerToUser(id) == MTP::authedId()) { - MTP::send(MTPphotos_UploadProfilePhoto(file, MTP_string(""), MTP_inputGeoPointEmpty(), MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100))), rpcDone(&Application::selfPhotoDone), rpcFail(&Application::peerPhotoFail, id)); - } else if (peerIsChat(id)) { - History *hist = App::history(id); - hist->sendRequestId = MTP::send(MTPmessages_EditChatPhoto(hist->peer->asChat()->inputChat, MTP_inputChatUploadedPhoto(file, MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100)))), rpcDone(&Application::chatPhotoDone, id), rpcFail(&Application::peerPhotoFail, id), 0, 0, hist->sendRequestId); - } else if (peerIsChannel(id)) { - History *hist = App::history(id); - hist->sendRequestId = MTP::send(MTPchannels_EditPhoto(hist->peer->asChannel()->inputChannel, MTP_inputChatUploadedPhoto(file, MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100)))), rpcDone(&Application::chatPhotoDone, id), rpcFail(&Application::peerPhotoFail, id), 0, 0, hist->sendRequestId); - } - } -} - -void Application::onSwitchDebugMode() { - if (cDebug()) { - QFile(cWorkingDir() + qsl("tdata/withdebug")).remove(); - cSetDebug(false); - cSetRestarting(true); - cSetRestartingToSettings(true); - App::quit(); - } else { - logsInitDebug(); - cSetDebug(true); - QFile f(cWorkingDir() + qsl("tdata/withdebug")); - if (f.open(QIODevice::WriteOnly)) { - f.write("1"); - f.close(); - } - Ui::hideLayer(); - } -} - -void Application::onSwitchTestMode() { - if (cTestMode()) { - QFile(cWorkingDir() + qsl("tdata/withtestmode")).remove(); - cSetTestMode(false); - } else { - QFile f(cWorkingDir() + qsl("tdata/withtestmode")); - if (f.open(QIODevice::WriteOnly)) { - f.write("1"); - f.close(); - } - cSetTestMode(true); - } - cSetRestarting(true); - cSetRestartingToSettings(true); - App::quit(); -} - -Application::UpdatingState Application::updatingState() { - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - if (!updateThread) return Application::UpdatingNone; - if (!updateDownloader) return Application::UpdatingReady; - return Application::UpdatingDownload; - #else - return Application::UpdatingNone; - #endif -} - -#ifndef TDESKTOP_DISABLE_AUTOUPDATE -int32 Application::updatingSize() { - if (!updateDownloader) return 0; - return updateDownloader->size(); -} - -int32 Application::updatingReady() { - if (!updateDownloader) return 0; - return updateDownloader->ready(); -} -#endif - -FileUploader *Application::uploader() { - if (!::uploader && !App::quiting()) ::uploader = new FileUploader(); - return ::uploader; -} - -void Application::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId) { - PreparedPhotoThumbs photoThumbs; - QVector photoSizes; - - QPixmap thumb = QPixmap::fromImage(tosend.scaled(160, 160, Qt::KeepAspectRatio, Qt::SmoothTransformation), Qt::ColorOnly); - photoThumbs.insert('a', thumb); - photoSizes.push_back(MTP_photoSize(MTP_string("a"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(thumb.width()), MTP_int(thumb.height()), MTP_int(0))); - - QPixmap medium = QPixmap::fromImage(tosend.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation), Qt::ColorOnly); - photoThumbs.insert('b', medium); - photoSizes.push_back(MTP_photoSize(MTP_string("b"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(medium.width()), MTP_int(medium.height()), MTP_int(0))); - - QPixmap full = QPixmap::fromImage(tosend, Qt::ColorOnly); - photoThumbs.insert('c', full); - photoSizes.push_back(MTP_photoSize(MTP_string("c"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(full.width()), MTP_int(full.height()), MTP_int(0))); - - QByteArray jpeg; - QBuffer jpegBuffer(&jpeg); - full.save(&jpegBuffer, "JPG", 87); - - PhotoId id = MTP::nonce(); - - MTPPhoto photo(MTP_photo(MTP_long(id), MTP_long(0), MTP_int(unixtime()), MTP_vector(photoSizes))); - - QString file, filename; - int32 filesize = 0; - QByteArray data; - - ReadyLocalMedia ready(PreparePhoto, file, filename, filesize, data, id, id, qsl("jpg"), peerId, photo, MTP_audioEmpty(MTP_long(0)), photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, false, false, 0); - - connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&, const MTPInputFile&)), App::app(), SLOT(photoUpdated(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); - - FullMsgId newId(peerToChannel(peerId), clientMsgId()); - App::app()->regPhotoUpdate(peerId, newId); - App::uploader()->uploadMedia(newId, ready); -} - -#ifndef TDESKTOP_DISABLE_AUTOUPDATE -void Application::stopUpdate() { - if (updateReply) { - updateReply->abort(); - updateReply->deleteLater(); - updateReply = 0; - } - if (updateDownloader) { - updateDownloader->deleteLater(); - updateDownloader = 0; - if (updateThread) updateThread->quit(); - updateThread = 0; - } -} - -void Application::startUpdateCheck(bool forceWait) { - updateCheckTimer.stop(); - if (updateRequestId || updateThread || updateReply || !cAutoUpdate()) return; - - int32 constDelay = cBetaVersion() ? 600 : UpdateDelayConstPart, randDelay = cBetaVersion() ? 300 : UpdateDelayRandPart; - int32 updateInSecs = cLastUpdateCheck() + constDelay + int32(MTP::nonce() % randDelay) - unixtime(); - bool sendRequest = (updateInSecs <= 0 || updateInSecs > (constDelay + randDelay)); - if (!sendRequest && !forceWait) { - QDir updates(cWorkingDir() + "tupdates"); - if (updates.exists()) { - QFileInfoList list = updates.entryInfoList(QDir::Files); - for (QFileInfoList::iterator i = list.begin(), e = list.end(); i != e; ++i) { - if (QRegularExpression("^(tupdate|tmacupd|tmac32upd|tlinuxupd|tlinux32upd)\\d+(_[a-z\\d]+)?$", QRegularExpression::CaseInsensitiveOption).match(i->fileName()).hasMatch()) { - sendRequest = true; - } - } - } - } - if (cManyInstance() && !cDebug()) return; // only main instance is updating - - if (sendRequest) { - QUrl url(cUpdateURL()); - if (cBetaVersion()) { - url.setQuery(qsl("version=%1&beta=%2").arg(AppVersion).arg(cBetaVersion())); - } else if (cDevVersion()) { - url.setQuery(qsl("version=%1&dev=1").arg(AppVersion)); - } else { - url.setQuery(qsl("version=%1").arg(AppVersion)); - } - QString u = url.toString(); - QNetworkRequest checkVersion(url); - if (updateReply) updateReply->deleteLater(); - - App::setProxySettings(updateManager); - updateReply = updateManager.get(checkVersion); - connect(updateReply, SIGNAL(finished()), this, SLOT(updateGotCurrent())); - connect(updateReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(updateFailedCurrent(QNetworkReply::NetworkError))); - emit updateChecking(); - } else { - updateCheckTimer.start((updateInSecs + 5) * 1000); - } -} -#endif - -namespace { QChar _toHex(ushort v) { v = v & 0x000F; return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v)); @@ -629,9 +129,73 @@ namespace { } } +AppClass *AppObject = 0; + +Application::Application(int &argc, char **argv) : QApplication(argc, argv) +, _secondInstance(false) +#ifndef TDESKTOP_DISABLE_AUTOUPDATE +, _updateReply(0) +, _updateThread(0) +, _updateChecker(0) +#endif +{ + if (!Logs::started()) { + // show error window + quit(); + return; + } + + QByteArray d(QDir(cWorkingDir()).absolutePath().toUtf8()); + char h[33] = { 0 }; + hashMd5Hex(d.constData(), d.size(), h); + _localServerName = psServerPrefix() + h + '-' + cGUIDStr(); + + connect(&_localSocket, SIGNAL(connected()), this, SLOT(socketConnected())); + connect(&_localSocket, SIGNAL(disconnected()), this, SLOT(socketDisconnected())); + connect(&_localSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(socketError(QLocalSocket::LocalSocketError))); + connect(&_localSocket, SIGNAL(bytesWritten(qint64)), this, SLOT(socketWritten(qint64))); + connect(&_localSocket, SIGNAL(readyRead()), this, SLOT(socketReading())); + connect(&_localSocket, SIGNAL(newConnection()), this, SLOT(newInstanceConnected())); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + connect(&_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck())); + connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); + connect(this, SIGNAL(updateReady()), this, SLOT(onUpdateReady())); +#endif + + if (cManyInstance()) { + singleInstanceChecked(); + } else { + DEBUG_LOG(("Application Info: connecting local socket to %1..").arg(_localServerName)); + _localSocket.connectToServer(_localServerName); + } +} + +Application::~Application() { + App::setQuiting(); + + Global::finish(); + + delete AppObject; + + _localSocket.close(); + closeApplication(); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + delete _updateReply; + _updateReply = 0; + if (_updateChecker) _updateChecker->deleteLater(); + _updateChecker = 0; + if (_updateThread) _updateThread->quit(); + _updateThread = 0; +#endif +} + + void Application::socketConnected() { DEBUG_LOG(("Application Info: socket connected, this is not the first application instance, sending show command..")); - closing = true; + _secondInstance = true; + QString commands; const QStringList &lst(cSendPaths()); for (QStringList::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { @@ -641,29 +205,30 @@ void Application::socketConnected() { commands += qsl("OPEN:") + _escapeTo7bit(cStartUrl()) + ';'; } commands += qsl("CMD:show;"); + DEBUG_LOG(("Application Info: writing commands %1").arg(commands)); - socket.write(commands.toLatin1()); + _localSocket.write(commands.toLatin1()); } void Application::socketWritten(qint64/* bytes*/) { - if (socket.state() != QLocalSocket::ConnectedState) { - DEBUG_LOG(("Application Error: socket is not connected %1").arg(socket.state())); + if (_localSocket.state() != QLocalSocket::ConnectedState) { + DEBUG_LOG(("Application Error: socket is not connected %1").arg(_localSocket.state())); return; } - if (socket.bytesToWrite()) { + if (_localSocket.bytesToWrite()) { return; } DEBUG_LOG(("Application Info: show command written, waiting response..")); } void Application::socketReading() { - if (socket.state() != QLocalSocket::ConnectedState) { - DEBUG_LOG(("Application Error: socket is not connected %1").arg(socket.state())); + if (_localSocket.state() != QLocalSocket::ConnectedState) { + DEBUG_LOG(("Application Error: socket is not connected %1").arg(_localSocket.state())); return; } - socketRead.append(socket.readAll()); - if (QRegularExpression("RES:(\\d+);").match(socketRead).hasMatch()) { - uint64 pid = socketRead.mid(4, socketRead.length() - 5).toULongLong(); + _localSocketReadData.append(_localSocket.readAll()); + if (QRegularExpression("RES:(\\d+);").match(_localSocketReadData).hasMatch()) { + uint64 pid = _localSocketReadData.mid(4, _localSocketReadData.length() - 5).toULongLong(); psActivateProcess(pid); DEBUG_LOG(("Application Info: show command response received, pid = %1, activating and quiting..").arg(pid)); return App::quit(); @@ -671,7 +236,7 @@ void Application::socketReading() { } void Application::socketError(QLocalSocket::LocalSocketError e) { - if (closing) { + if (_secondInstance) { DEBUG_LOG(("Application Error: could not write show command, error %1, quiting..").arg(e)); return App::quit(); } @@ -681,104 +246,36 @@ void Application::socketError(QLocalSocket::LocalSocketError e) { } else { DEBUG_LOG(("Application Info: socket connect error %1, starting server and app..").arg(e)); } - socket.close(); + _localSocket.close(); - psCheckLocalSocket(serverName); + psCheckLocalSocket(_localServerName); - if (!server.listen(serverName)) { - DEBUG_LOG(("Application Error: failed to start listening to %1 server, error %2").arg(serverName).arg(int(server.serverError()))); + if (!_localServer.listen(_localServerName)) { + DEBUG_LOG(("Application Error: failed to start listening to %1 server, error %2").arg(_localServerName).arg(int(_localServer.serverError()))); return App::quit(); } - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE if (!cNoStartUpdate() && checkReadyUpdate()) { cSetRestartingUpdate(true); DEBUG_LOG(("Application Info: installing update instead of starting app..")); return App::quit(); } - #endif +#endif - startApp(); + singleInstanceChecked(); } -void Application::checkMapVersion() { - if (Local::oldMapVersion() < AppVersion) { - if (Local::oldMapVersion()) { - QString versionFeatures; - if (cDevVersion() && Local::oldMapVersion() < 9019) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Choose an emoticon and see the suggested stickers\n\xe2\x80\x94 Bug fixes in minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); - } else if (Local::oldMapVersion() < 9016) { - versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); - } else { - versionFeatures = lang(lng_new_version_minor).trimmed(); - } - if (!versionFeatures.isEmpty()) { - versionFeatures = lng_new_version_wrap(lt_version, QString::fromStdWString(AppVersionStr), lt_changes, versionFeatures, lt_link, qsl("https://desktop.telegram.org/#changelog")); - window->serviceNotification(versionFeatures); - } - } - } - if (cNeedConfigResave()) { - Local::writeUserSettings(); - } -} +void Application::singleInstanceChecked() { + Global::start(); -void Application::startApp() { - cChangeTimeFormat(QLocale::system().timeFormat(QLocale::ShortFormat)); + // if crashed, show window and try to autoupdate - DEBUG_LOG(("Application Info: starting app..")); - - QMimeDatabase().mimeTypeForName(qsl("text/plain")); // create mime database - - window->createWinId(); - window->init(); - - DEBUG_LOG(("Application Info: window created..")); - - initImageLinkManager(); - App::initMedia(); - - Local::ReadMapState state = Local::readMap(QByteArray()); - if (state == Local::ReadMapPassNeeded) { - cSetHasPasscode(true); - DEBUG_LOG(("Application Info: passcode nneded..")); - } else { - DEBUG_LOG(("Application Info: local map read..")); - MTP::start(); - } - - MTP::setStateChangedHandler(mtpStateChanged); - MTP::setSessionResetHandler(mtpSessionReset); - - DEBUG_LOG(("Application Info: MTP started..")); - - DEBUG_LOG(("Application Info: showing.")); - if (state == Local::ReadMapPassNeeded) { - window->setupPasscode(false); - } else { - if (MTP::authedId()) { - window->setupMain(false); - } else { - window->setupIntro(false); - } - } - window->firstShow(); - - if (cStartToSettings()) { - window->showSettings(); - } - - QNetworkProxyFactory::setUseSystemConfiguration(true); - - if (state != Local::ReadMapPassNeeded) { - checkMapVersion(); - } - - window->updateIsActive(cOnlineFocusTimeout()); + new AppClass(); } void Application::socketDisconnected() { - if (closing) { + if (_secondInstance) { DEBUG_LOG(("Application Error: socket disconnected before command response received, quiting..")); return App::quit(); } @@ -786,8 +283,8 @@ void Application::socketDisconnected() { void Application::newInstanceConnected() { DEBUG_LOG(("Application Info: new local socket connected")); - for (QLocalSocket *client = server.nextPendingConnection(); client; client = server.nextPendingConnection()) { - clients.push_back(ClientSocket(client, QByteArray())); + for (QLocalSocket *client = _localServer.nextPendingConnection(); client; client = _localServer.nextPendingConnection()) { + _localClients.push_back(LocalClient(client, QByteArray())); connect(client, SIGNAL(readyRead()), this, SLOT(readClients())); connect(client, SIGNAL(disconnected()), this, SLOT(removeClients())); } @@ -796,7 +293,7 @@ void Application::newInstanceConnected() { void Application::readClients() { QString startUrl; QStringList toSend; - for (ClientSockets::iterator i = clients.begin(), e = clients.end(); i != e; ++i) { + for (LocalClients::iterator i = _localClients.begin(), e = _localClients.end(); i != e; ++i) { i->second.append(i->first->readAll()); if (i->second.size()) { QString cmds(QString::fromLatin1(i->second)); @@ -804,7 +301,7 @@ void Application::readClients() { for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) { QStringRef cmd(&cmds, from, to - from); if (cmd.startsWith(qsl("CMD:"))) { - execExternal(cmds.mid(from + 4, to - from - 4)); + App::app()->execExternal(cmds.mid(from + 4, to - from - 4)); QByteArray response(qsl("RES:%1;").arg(QCoreApplication::applicationPid()).toLatin1()); i->first->write(response.data(), response.size()); } else if (cmd.startsWith(qsl("SEND:"))) { @@ -845,65 +342,705 @@ void Application::readClients() { } void Application::removeClients() { - DEBUG_LOG(("Application Info: remove clients slot called, clients %1").arg(clients.size())); - for (ClientSockets::iterator i = clients.begin(), e = clients.end(); i != e;) { + DEBUG_LOG(("Application Info: remove clients slot called, clients %1").arg(_localClients.size())); + for (LocalClients::iterator i = _localClients.begin(), e = _localClients.end(); i != e;) { if (i->first->state() != QLocalSocket::ConnectedState) { DEBUG_LOG(("Application Info: removing client")); - i = clients.erase(i); - e = clients.end(); + i = _localClients.erase(i); + e = _localClients.end(); } else { ++i; } } } -void Application::execExternal(const QString &cmd) { - DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd)); - if (cmd == "show") { - window->activate(); - } -} - void Application::closeApplication() { - // close server - server.close(); - for (ClientSockets::iterator i = clients.begin(), e = clients.end(); i != e; ++i) { + _localServer.close(); + for (LocalClients::iterator i = _localClients.begin(), e = _localClients.end(); i != e; ++i) { disconnect(i->first, SIGNAL(disconnected()), this, SLOT(removeClients())); i->first->close(); } - clients.clear(); + _localClients.clear(); MTP::stop(); } -Application::~Application() { - App::setQuiting(); +#ifndef TDESKTOP_DISABLE_AUTOUPDATE +void Application::updateCheck() { + startUpdateCheck(false); +} - window->setParent(0); +void Application::updateGotCurrent() { + if (!_updateReply || _updateThread) return; + + cSetLastUpdateCheck(unixtime()); + QRegularExpressionMatch m = QRegularExpression(qsl("^\\s*(\\d+)\\s*:\\s*([\\x21-\\x7f]+)\\s*$")).match(QString::fromLatin1(_updateReply->readAll())); + if (m.hasMatch()) { + uint64 currentVersion = m.captured(1).toULongLong(); + QString url = m.captured(2); + bool betaVersion = false; + if (url.startsWith(qstr("beta_"))) { + betaVersion = true; + url = url.mid(5) + '_' + countBetaVersionSignature(currentVersion); + } + if ((!betaVersion || cBetaVersion()) && currentVersion > (betaVersion ? cBetaVersion() : uint64(AppVersion))) { + _updateThread = new QThread(); + connect(_updateThread, SIGNAL(finished()), _updateThread, SLOT(deleteLater())); + _updateChecker = new UpdateChecker(_updateThread, url); + _updateThread->start(); + } + } + if (_updateReply) _updateReply->deleteLater(); + _updateReply = 0; + if (!_updateThread) { + QDir updates(cWorkingDir() + "tupdates"); + if (updates.exists()) { + QFileInfoList list = updates.entryInfoList(QDir::Files); + for (QFileInfoList::iterator i = list.begin(), e = list.end(); i != e; ++i) { + if (QRegularExpression("^(tupdate|tmacupd|tmac32upd|tlinuxupd|tlinux32upd)\\d+(_[a-z\\d]+)?$", QRegularExpression::CaseInsensitiveOption).match(i->fileName()).hasMatch()) { + QFile(i->absoluteFilePath()).remove(); + } + } + } + emit updateLatest(); + } + startUpdateCheck(true); + Local::writeSettings(); +} + +void Application::updateFailedCurrent(QNetworkReply::NetworkError e) { + LOG(("App Error: could not get current version (update check): %1").arg(e)); + if (_updateReply) _updateReply->deleteLater(); + _updateReply = 0; + + emit updateFailed(); + startUpdateCheck(true); +} + +void Application::onUpdateReady() { + if (_updateChecker) { + _updateChecker->deleteLater(); + _updateChecker = 0; + } + _updateCheckTimer.stop(); + + cSetLastUpdateCheck(unixtime()); + Local::writeSettings(); +} + +void Application::onUpdateFailed() { + if (_updateChecker) { + _updateChecker->deleteLater(); + _updateChecker = 0; + if (_updateThread) _updateThread->quit(); + _updateThread = 0; + } + + cSetLastUpdateCheck(unixtime()); + Local::writeSettings(); +} + +Application::UpdatingState Application::updatingState() { + if (!_updateThread) return Application::UpdatingNone; + if (!_updateChecker) return Application::UpdatingReady; + return Application::UpdatingDownload; +} + +int32 Application::updatingSize() { + if (!_updateChecker) return 0; + return _updateChecker->size(); +} + +int32 Application::updatingReady() { + if (!_updateChecker) return 0; + return _updateChecker->ready(); +} + +void Application::stopUpdate() { + if (_updateReply) { + _updateReply->abort(); + _updateReply->deleteLater(); + _updateReply = 0; + } + if (_updateChecker) { + _updateChecker->deleteLater(); + _updateChecker = 0; + if (_updateThread) _updateThread->quit(); + _updateThread = 0; + } +} + +void Application::startUpdateCheck(bool forceWait) { + _updateCheckTimer.stop(); + if (_updateThread || _updateReply || !cAutoUpdate()) return; + + int32 constDelay = cBetaVersion() ? 600 : UpdateDelayConstPart, randDelay = cBetaVersion() ? 300 : UpdateDelayRandPart; + int32 updateInSecs = cLastUpdateCheck() + constDelay + int32(MTP::nonce() % randDelay) - unixtime(); + bool sendRequest = (updateInSecs <= 0 || updateInSecs > (constDelay + randDelay)); + if (!sendRequest && !forceWait) { + QDir updates(cWorkingDir() + "tupdates"); + if (updates.exists()) { + QFileInfoList list = updates.entryInfoList(QDir::Files); + for (QFileInfoList::iterator i = list.begin(), e = list.end(); i != e; ++i) { + if (QRegularExpression("^(tupdate|tmacupd|tmac32upd|tlinuxupd|tlinux32upd)\\d+(_[a-z\\d]+)?$", QRegularExpression::CaseInsensitiveOption).match(i->fileName()).hasMatch()) { + sendRequest = true; + } + } + } + } + if (cManyInstance() && !cDebug()) return; // only main instance is updating + + if (sendRequest) { + QUrl url(cUpdateURL()); + if (cBetaVersion()) { + url.setQuery(qsl("version=%1&beta=%2").arg(AppVersion).arg(cBetaVersion())); + } else if (cDevVersion()) { + url.setQuery(qsl("version=%1&dev=1").arg(AppVersion)); + } else { + url.setQuery(qsl("version=%1").arg(AppVersion)); + } + QString u = url.toString(); + QNetworkRequest checkVersion(url); + if (_updateReply) _updateReply->deleteLater(); + + App::setProxySettings(_updateManager); + _updateReply = _updateManager.get(checkVersion); + connect(_updateReply, SIGNAL(finished()), this, SLOT(updateGotCurrent())); + connect(_updateReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(updateFailedCurrent(QNetworkReply::NetworkError))); + emit updateChecking(); + } else { + _updateCheckTimer.start((updateInSecs + 5) * 1000); + } +} + +#endif + +inline Application *application() { + return qobject_cast(QApplication::instance()); +} + +namespace Sandboxer { + + void setClipboardText(const QString &text) { + if (Application *a = application()) { + a->clipboard()->setText(text); + } + } + + QRect availableGeometry() { + if (Application *a = application()) { + return a->desktop()->availableGeometry(); + } + return QDesktopWidget().availableGeometry(); + } + + QRect screenGeometry(const QPoint &p) { + if (Application *a = application()) { + return a->desktop()->screenGeometry(p); + } + return QDesktopWidget().screenGeometry(p); + } + + void setActiveWindow(QWidget *window) { + if (Application *a = application()) { + a->setActiveWindow(window); + } + } + + bool isSavingSession() { + if (Application *a = application()) { + return a->isSavingSession(); + } + return false; + } + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + + void startUpdateCheck() { + if (Application *a = application()) { + return a->startUpdateCheck(false); + } + } + + void stopUpdate() { + if (Application *a = application()) { + return a->stopUpdate(); + } + } + + Application::UpdatingState updatingState() { + if (Application *a = application()) { + return a->updatingState(); + } + return Application::UpdatingNone; + } + + int32 updatingSize() { + if (Application *a = application()) { + return a->updatingSize(); + } + return 0; + } + + int32 updatingReady() { + if (Application *a = application()) { + return a->updatingReady(); + } + return 0; + } + + void updateChecking() { + if (Application *a = application()) { + emit a->updateChecking(); + } + } + + void updateLatest() { + if (Application *a = application()) { + emit a->updateLatest(); + } + } + + void updateProgress(qint64 ready, qint64 total) { + if (Application *a = application()) { + emit a->updateProgress(ready, total); + } + } + + void updateFailed() { + if (Application *a = application()) { + emit a->updateFailed(); + } + } + + void updateReady() { + if (Application *a = application()) { + emit a->updateReady(); + } + } + + void connect(const char *signal, QObject *object, const char *method) { + if (Application *a = application()) { + a->connect(a, signal, object, method); + } + } + +#endif + +} + +AppClass::AppClass() : QObject() +, _uploader(0) { + AppObject = this; + + installSignalHandlers(); + + ThirdParty::start(); + Sandbox::start(); + Local::start(); + if (Local::oldSettingsVersion() < AppVersion) { + psNewVersion(); + } + + if (cLaunchMode() == LaunchModeAutoStart && !cAutoStart()) { + psAutoStart(false, true); + application()->quit(); + return; + } + + application()->installEventFilter(new EventFilterForKeys(this)); + + QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Regular.ttf")); + QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Bold.ttf")); + QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Semibold.ttf")); + + float64 dpi = QApplication::primaryScreen()->logicalDotsPerInch(); + if (dpi <= 108) { // 0-96-108 + cSetScreenScale(dbisOne); + } else if (dpi <= 132) { // 108-120-132 + cSetScreenScale(dbisOneAndQuarter); + } else if (dpi <= 168) { // 132-144-168 + cSetScreenScale(dbisOneAndHalf); + } else { // 168-192-inf + cSetScreenScale(dbisTwo); + } + + if (application()->devicePixelRatio() > 1) { + cSetRetina(true); + cSetRetinaFactor(application()->devicePixelRatio()); + cSetIntRetinaFactor(int32(cRetinaFactor())); + cSetConfigScale(dbisOne); + cSetRealScale(dbisOne); + } + + if (cLang() < languageTest) { + cSetLang(Global::LangSystem()); + } + if (cLang() == languageTest) { + if (QFileInfo(cLangFile()).exists()) { + LangLoaderPlain loader(cLangFile()); + cSetLangErrors(loader.errors()); + if (!cLangErrors().isEmpty()) { + LOG(("Lang load errors: %1").arg(cLangErrors())); + } else if (!loader.warnings().isEmpty()) { + LOG(("Lang load warnings: %1").arg(loader.warnings())); + } + } else { + cSetLang(languageDefault); + } + } else if (cLang() > languageDefault && cLang() < languageCount) { + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[cLang()] + qsl(".strings")); + if (!loader.errors().isEmpty()) { + LOG(("Lang load errors: %1").arg(loader.errors())); + } else if (!loader.warnings().isEmpty()) { + LOG(("Lang load warnings: %1").arg(loader.warnings())); + } + } + + application()->installTranslator(_translator = new Translator()); + + style::startManager(); + anim::startManager(); + historyInit(); + + DEBUG_LOG(("Application Info: inited..")); + + application()->installNativeEventFilter(psNativeEventFilter()); + + connect(this, SIGNAL(aboutToQuit()), this, SLOT(closeApplication())); + connect(this, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); + + connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause())); + + connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions())); + + cChangeTimeFormat(QLocale::system().timeFormat(QLocale::ShortFormat)); + + DEBUG_LOG(("Application Info: starting app..")); + + QMimeDatabase().mimeTypeForName(qsl("text/plain")); // create mime database + + _window.createWinId(); + _window.init(); + + DEBUG_LOG(("Application Info: window created..")); + + initImageLinkManager(); + App::initMedia(); + + Local::ReadMapState state = Local::readMap(QByteArray()); + if (state == Local::ReadMapPassNeeded) { + cSetHasPasscode(true); + DEBUG_LOG(("Application Info: passcode nneded..")); + } else { + DEBUG_LOG(("Application Info: local map read..")); + MTP::start(); + } + + MTP::setStateChangedHandler(mtpStateChanged); + MTP::setSessionResetHandler(mtpSessionReset); + + DEBUG_LOG(("Application Info: MTP started..")); + + DEBUG_LOG(("Application Info: showing.")); + if (state == Local::ReadMapPassNeeded) { + _window.setupPasscode(false); + } else { + if (MTP::authedId()) { + _window.setupMain(false); + } else { + _window.setupIntro(false); + } + } + _window.firstShow(); + + if (cStartToSettings()) { + _window.showSettings(); + } + + QNetworkProxyFactory::setUseSystemConfiguration(true); + + if (state != Local::ReadMapPassNeeded) { + checkMapVersion(); + } + + _window.updateIsActive(cOnlineFocusTimeout()); +} + +void AppClass::regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId) { + photoUpdates.insert(msgId, peer); +} + +void AppClass::clearPhotoUpdates() { + photoUpdates.clear(); +} + +bool AppClass::isPhotoUpdating(const PeerId &peer) { + for (QMap::iterator i = photoUpdates.begin(), e = photoUpdates.end(); i != e; ++i) { + if (i.value() == peer) { + return true; + } + } + return false; +} + +void AppClass::cancelPhotoUpdate(const PeerId &peer) { + for (QMap::iterator i = photoUpdates.begin(), e = photoUpdates.end(); i != e;) { + if (i.value() == peer) { + i = photoUpdates.erase(i); + } else { + ++i; + } + } +} + +void AppClass::mtpPause() { + MTP::pause(); + _mtpUnpauseTimer.start(st::slideDuration * 2); +} + +void AppClass::mtpUnpause() { + _mtpUnpauseTimer.start(1); +} + +void AppClass::doMtpUnpause() { + MTP::unpause(); +} + +void AppClass::selfPhotoCleared(const MTPUserProfilePhoto &result) { + if (!App::self()) return; + App::self()->setPhoto(result); + emit peerPhotoDone(App::self()->id); +} + +void AppClass::chatPhotoCleared(PeerId peer, const MTPUpdates &updates) { + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } + cancelPhotoUpdate(peer); + emit peerPhotoDone(peer); +} + +void AppClass::selfPhotoDone(const MTPphotos_Photo &result) { + if (!App::self()) return; + const MTPDphotos_photo &photo(result.c_photos_photo()); + App::feedPhoto(photo.vphoto); + App::feedUsers(photo.vusers); + cancelPhotoUpdate(App::self()->id); + emit peerPhotoDone(App::self()->id); +} + +void AppClass::chatPhotoDone(PeerId peer, const MTPUpdates &updates) { + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } + cancelPhotoUpdate(peer); + emit peerPhotoDone(peer); +} + +bool AppClass::peerPhotoFail(PeerId peer, const RPCError &error) { + if (mtpIsFlood(error)) return false; + + LOG(("Application Error: update photo failed %1: %2").arg(error.type()).arg(error.description())); + cancelPhotoUpdate(peer); + emit peerPhotoFail(peer); + return true; +} + +void AppClass::peerClearPhoto(PeerId id) { + if (MTP::authedId() && peerToUser(id) == MTP::authedId()) { + MTP::send(MTPphotos_UpdateProfilePhoto(MTP_inputPhotoEmpty(), MTP_inputPhotoCropAuto()), rpcDone(&AppClass::selfPhotoCleared), rpcFail(&AppClass::peerPhotoFail, id)); + } else if (peerIsChat(id)) { + MTP::send(MTPmessages_EditChatPhoto(peerToBareMTPInt(id), MTP_inputChatPhotoEmpty()), rpcDone(&AppClass::chatPhotoCleared, id), rpcFail(&AppClass::peerPhotoFail, id)); + } else if (peerIsChannel(id)) { + if (ChannelData *channel = App::channelLoaded(id)) { + MTP::send(MTPchannels_EditPhoto(channel->inputChannel, MTP_inputChatPhotoEmpty()), rpcDone(&AppClass::chatPhotoCleared, id), rpcFail(&AppClass::peerPhotoFail, id)); + } + } +} + +void AppClass::killDownloadSessionsStart(int32 dc) { + if (killDownloadSessionTimes.constFind(dc) == killDownloadSessionTimes.cend()) { + killDownloadSessionTimes.insert(dc, getms() + MTPAckSendWaiting + MTPKillFileSessionTimeout); + } + if (!killDownloadSessionsTimer.isActive()) { + killDownloadSessionsTimer.start(MTPAckSendWaiting + MTPKillFileSessionTimeout + 5); + } +} + +void AppClass::killDownloadSessionsStop(int32 dc) { + killDownloadSessionTimes.remove(dc); + if (killDownloadSessionTimes.isEmpty() && killDownloadSessionsTimer.isActive()) { + killDownloadSessionsTimer.stop(); + } +} + +void AppClass::checkLocalTime() { + if (App::main()) App::main()->checkLastUpdate(checkms()); +} + +void AppClass::onAppStateChanged(Qt::ApplicationState state) { + checkLocalTime(); + _window.updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); +} + +void AppClass::killDownloadSessions() { + uint64 ms = getms(), left = MTPAckSendWaiting + MTPKillFileSessionTimeout; + for (QMap::iterator i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) { + if (i.value() <= ms) { + for (int j = 0; j < MTPDownloadSessionsCount; ++j) { + MTP::stopSession(MTP::dld[j] + i.key()); + } + i = killDownloadSessionTimes.erase(i); + } else { + if (i.value() - ms < left) { + left = i.value() - ms; + } + ++i; + } + } + if (!killDownloadSessionTimes.isEmpty()) { + killDownloadSessionsTimer.start(left); + } +} + +void AppClass::photoUpdated(const FullMsgId &msgId, const MTPInputFile &file) { + if (!App::self()) return; + + QMap::iterator i = photoUpdates.find(msgId); + if (i != photoUpdates.end()) { + PeerId id = i.value(); + if (MTP::authedId() && peerToUser(id) == MTP::authedId()) { + MTP::send(MTPphotos_UploadProfilePhoto(file, MTP_string(""), MTP_inputGeoPointEmpty(), MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100))), rpcDone(&AppClass::selfPhotoDone), rpcFail(&AppClass::peerPhotoFail, id)); + } else if (peerIsChat(id)) { + History *hist = App::history(id); + hist->sendRequestId = MTP::send(MTPmessages_EditChatPhoto(hist->peer->asChat()->inputChat, MTP_inputChatUploadedPhoto(file, MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100)))), rpcDone(&AppClass::chatPhotoDone, id), rpcFail(&AppClass::peerPhotoFail, id), 0, 0, hist->sendRequestId); + } else if (peerIsChannel(id)) { + History *hist = App::history(id); + hist->sendRequestId = MTP::send(MTPchannels_EditPhoto(hist->peer->asChannel()->inputChannel, MTP_inputChatUploadedPhoto(file, MTP_inputPhotoCrop(MTP_double(0), MTP_double(0), MTP_double(100)))), rpcDone(&AppClass::chatPhotoDone, id), rpcFail(&AppClass::peerPhotoFail, id), 0, 0, hist->sendRequestId); + } + } +} + +void AppClass::onSwitchDebugMode() { + if (cDebug()) { + QFile(cWorkingDir() + qsl("tdata/withdebug")).remove(); + cSetDebug(false); + cSetRestarting(true); + cSetRestartingToSettings(true); + App::quit(); + } else { + cSetDebug(true); + DEBUG_LOG(("Debug logs started.")); + QFile f(cWorkingDir() + qsl("tdata/withdebug")); + if (f.open(QIODevice::WriteOnly)) { + f.write("1"); + f.close(); + } + Ui::hideLayer(); + } +} + +void AppClass::onSwitchTestMode() { + if (cTestMode()) { + QFile(cWorkingDir() + qsl("tdata/withtestmode")).remove(); + cSetTestMode(false); + } else { + QFile f(cWorkingDir() + qsl("tdata/withtestmode")); + if (f.open(QIODevice::WriteOnly)) { + f.write("1"); + f.close(); + } + cSetTestMode(true); + } + cSetRestarting(true); + cSetRestartingToSettings(true); + App::quit(); +} + +FileUploader *AppClass::uploader() { + if (!_uploader && !App::quiting()) _uploader = new FileUploader(); + return _uploader; +} + +void AppClass::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId) { + PreparedPhotoThumbs photoThumbs; + QVector photoSizes; + + QPixmap thumb = QPixmap::fromImage(tosend.scaled(160, 160, Qt::KeepAspectRatio, Qt::SmoothTransformation), Qt::ColorOnly); + photoThumbs.insert('a', thumb); + photoSizes.push_back(MTP_photoSize(MTP_string("a"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(thumb.width()), MTP_int(thumb.height()), MTP_int(0))); + + QPixmap medium = QPixmap::fromImage(tosend.scaled(320, 320, Qt::KeepAspectRatio, Qt::SmoothTransformation), Qt::ColorOnly); + photoThumbs.insert('b', medium); + photoSizes.push_back(MTP_photoSize(MTP_string("b"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(medium.width()), MTP_int(medium.height()), MTP_int(0))); + + QPixmap full = QPixmap::fromImage(tosend, Qt::ColorOnly); + photoThumbs.insert('c', full); + photoSizes.push_back(MTP_photoSize(MTP_string("c"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(full.width()), MTP_int(full.height()), MTP_int(0))); + + QByteArray jpeg; + QBuffer jpegBuffer(&jpeg); + full.save(&jpegBuffer, "JPG", 87); + + PhotoId id = MTP::nonce(); + + MTPPhoto photo(MTP_photo(MTP_long(id), MTP_long(0), MTP_int(unixtime()), MTP_vector(photoSizes))); + + QString file, filename; + int32 filesize = 0; + QByteArray data; + + ReadyLocalMedia ready(PreparePhoto, file, filename, filesize, data, id, id, qsl("jpg"), peerId, photo, MTP_audioEmpty(MTP_long(0)), photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, false, false, 0); + + connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&, const MTPInputFile&)), App::app(), SLOT(photoUpdated(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); + + FullMsgId newId(peerToChannel(peerId), clientMsgId()); + App::app()->regPhotoUpdate(peerId, newId); + App::uploader()->uploadMedia(newId, ready); +} + +void AppClass::checkMapVersion() { + if (Local::oldMapVersion() < AppVersion) { + if (Local::oldMapVersion()) { + QString versionFeatures; + if (cDevVersion() && Local::oldMapVersion() < 9019) { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Choose an emoticon and see the suggested stickers\n\xe2\x80\x94 Bug fixes in minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + } else if (Local::oldMapVersion() < 9016) { + versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); + } else { + versionFeatures = lang(lng_new_version_minor).trimmed(); + } + if (!versionFeatures.isEmpty()) { + versionFeatures = lng_new_version_wrap(lt_version, QString::fromStdWString(AppVersionStr), lt_changes, versionFeatures, lt_link, qsl("https://desktop.telegram.org/#changelog")); + _window.serviceNotification(versionFeatures); + } + } + } + if (cNeedConfigResave()) { + Local::writeUserSettings(); + } +} + +void AppClass::execExternal(const QString &cmd) { + DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd)); + if (cmd == "show") { + _window.activate(); + } +} + +AppClass::~AppClass() { + _window.setParent(0); anim::stopManager(); - socket.close(); - closeApplication(); stopWebLoadManager(); App::deinitMedia(); deinitImageLinkManager(); - mainApp = 0; - delete ::uploader; - - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - delete updateReply; - updateReply = 0; - if (updateDownloader) updateDownloader->deleteLater(); - updateDownloader = 0; - if (updateThread) updateThread->quit(); - updateThread = 0; - #endif - - Window *w = window; - window = 0; - delete w; + AppObject = 0; + deleteAndMark(_uploader); + deleteAndMark(_translator); delete cChatBackground(); cSetChatBackground(0); @@ -913,37 +1050,19 @@ Application::~Application() { style::stopManager(); - delete _translator; + Local::finish(); + Sandbox::finish(); + ThirdParty::finish(); } -Application *Application::app() { - return mainApp; +AppClass *AppClass::app() { + return AppObject; } -Window *Application::wnd() { - return mainApp ? mainApp->window : 0; +Window *AppClass::wnd() { + return AppObject ? &AppObject->_window : 0; } -QString Application::language() { - if (!lng.length()) { - lng = psCurrentLanguage(); - } - if (!lng.length()) { - lng = "en"; - } - return lng; -} - -int32 Application::languageId() { - QByteArray l = language().toLatin1(); - for (int32 i = 0; i < languageCount; ++i) { - if (l.at(0) == LanguageCodes[i][0] && l.at(1) == LanguageCodes[i][1]) { - return i; - } - } - return languageDefault; -} - -MainWidget *Application::main() { - return mainApp ? mainApp->window->mainWidget() : 0; +MainWidget *AppClass::main() { + return AppObject ? AppObject->_window.mainWidget() : 0; } diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index 21866e49fa..f1671f2dd0 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -20,31 +20,52 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #pragma once -#include -#include -#include - #include "window.h" #include "pspecific.h" -class MainWidget; -class FileUploader; -class Translator; -class UpdateDownloader; - -class Application : public PsApplication, public RPCSender { +class UpdateChecker; +class Application : public QApplication { Q_OBJECT public: Application(int &argc, char **argv); ~Application(); - - static Application *app(); - static Window *wnd(); - static QString language(); - static int32 languageId(); - static MainWidget *main(); + +// Single instance application +public slots: + + void socketConnected(); + void socketError(QLocalSocket::LocalSocketError e); + void socketDisconnected(); + void socketWritten(qint64 bytes); + void socketReading(); + void newInstanceConnected(); + void closeApplication(); + + void readClients(); + void removeClients(); + +private: + + typedef QPair LocalClient; + typedef QList LocalClients; + + QString _localServerName, _localSocketReadData; + QLocalServer _localServer; + QLocalSocket _localSocket; + LocalClients _localClients; + bool _secondInstance; + + void singleInstanceChecked(); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + +// Autoupdating +public: + + void startUpdateCheck(bool forceWait); + void stopUpdate(); enum UpdatingState { UpdatingNone, @@ -52,11 +73,81 @@ public: UpdatingReady, }; UpdatingState updatingState(); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE int32 updatingSize(); int32 updatingReady(); + +signals: + + void updateChecking(); + void updateLatest(); + void updateProgress(qint64 ready, qint64 total); + void updateReady(); + void updateFailed(); + +public slots: + + void updateCheck(); + + void updateGotCurrent(); + void updateFailedCurrent(QNetworkReply::NetworkError e); + + void onUpdateReady(); + void onUpdateFailed(); + +private: + + SingleTimer _updateCheckTimer; + QNetworkReply *_updateReply; + QNetworkAccessManager _updateManager; + QThread *_updateThread; + UpdateChecker *_updateChecker; + +#endif +}; + +namespace Sandboxer { + + void setClipboardText(const QString &text); + QRect availableGeometry(); + QRect screenGeometry(const QPoint &p); + void setActiveWindow(QWidget *window); + bool isSavingSession(); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + + void startUpdateCheck(); void stopUpdate(); - #endif + + Application::UpdatingState updatingState(); + int32 updatingSize(); + int32 updatingReady(); + + void updateChecking(); + void updateLatest(); + void updateProgress(qint64 ready, qint64 total); + void updateFailed(); + void updateReady(); + void connect(const char *signal, QObject *object, const char *method); + +#endif + +} + +class MainWidget; +class FileUploader; +class Translator; + +class AppClass : public QObject, public RPCSender { + Q_OBJECT + +public: + + AppClass(); + ~AppClass(); + + static AppClass *app(); + static Window *wnd(); + static MainWidget *main(); FileUploader *uploader(); void uploadProfilePhoto(const QImage &tosend, const PeerId &peerId); @@ -83,15 +174,9 @@ public: void checkLocalTime(); void checkMapVersion(); -signals: + void execExternal(const QString &cmd); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - void updateChecking(); - void updateLatest(); - void updateDownloading(qint64 ready, qint64 total); - void updateReady(); - void updateFailed(); - #endif +signals: void peerPhotoDone(PeerId peer); void peerPhotoFail(PeerId peer); @@ -100,30 +185,8 @@ signals: public slots: - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - void startUpdateCheck(bool forceWait = false); - #endif - void socketConnected(); - void socketError(QLocalSocket::LocalSocketError e); - void socketDisconnected(); - void socketWritten(qint64 bytes); - void socketReading(); - void newInstanceConnected(); - void closeApplication(); - void doMtpUnpause(); - void readClients(); - void removeClients(); - - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - void updateGotCurrent(); - void updateFailedCurrent(QNetworkReply::NetworkError e); - - void onUpdateReady(); - void onUpdateFailed(); - #endif - void photoUpdated(const FullMsgId &msgId, const MTPInputFile &file); void onSwitchDebugMode(); @@ -139,35 +202,12 @@ private: QMap killDownloadSessionTimes; SingleTimer killDownloadSessionsTimer; - void startApp(); + uint64 _lastActionTime; - typedef QPair ClientSocket; - typedef QVector ClientSockets; - - QString serverName; - QLocalSocket socket; - QString socketRead; - QLocalServer server; - ClientSockets clients; - bool closing; - - uint64 lastActionTime; - - void execExternal(const QString &cmd); - - Window *window; - - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - mtpRequestId updateRequestId; - QNetworkAccessManager updateManager; - QNetworkReply *updateReply; - SingleTimer updateCheckTimer; - QThread *updateThread; - UpdateDownloader *updateDownloader; - #endif + Window _window; + FileUploader *_uploader; + Translator *_translator; SingleTimer _mtpUnpauseTimer; - Translator *_translator; - }; diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 1f86108be0..57bf5f9f6b 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -2059,7 +2059,7 @@ void AudioCaptureInner::onStop(bool needResult) { } } } - DEBUG_LOG(("Audio Capture: stopping (need result: %1), size: %2, samples: %3").arg(logBool(needResult)).arg(d->data.size()).arg(d->fullSamples)); + DEBUG_LOG(("Audio Capture: stopping (need result: %1), size: %2, samples: %3").arg(Logs::b(needResult)).arg(d->data.size()).arg(d->fullSamples)); _captured = QByteArray(); // Finish stream diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index a1a77a4ff0..7c4796585c 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -34,7 +34,7 @@ typedef int VerInt; typedef wchar_t VerChar; #endif -UpdateDownloader::UpdateDownloader(QThread *thread, const QString &url) : reply(0), already(0), full(0) { +UpdateChecker::UpdateChecker(QThread *thread, const QString &url) : reply(0), already(0), full(0) { updateUrl = url; moveToThread(thread); manager.moveToThread(thread); @@ -44,7 +44,7 @@ UpdateDownloader::UpdateDownloader(QThread *thread, const QString &url) : reply( initOutput(); } -void UpdateDownloader::initOutput() { +void UpdateChecker::initOutput() { QString fileName; QRegularExpressionMatch m = QRegularExpression(qsl("/([^/\\?]+)(\\?|$)")).match(updateUrl); if (m.hasMatch()) { @@ -99,11 +99,11 @@ void UpdateDownloader::initOutput() { } } -void UpdateDownloader::start() { +void UpdateChecker::start() { sendRequest(); } -void UpdateDownloader::sendRequest() { +void UpdateChecker::sendRequest() { QNetworkRequest req(updateUrl); QByteArray rangeHeaderValue = "bytes=" + QByteArray::number(already) + "-"; req.setRawHeader("Range", rangeHeaderValue); @@ -115,7 +115,7 @@ void UpdateDownloader::sendRequest() { connect(reply, SIGNAL(metaDataChanged()), this, SLOT(partMetaGot())); } -void UpdateDownloader::partMetaGot() { +void UpdateChecker::partMetaGot() { typedef QList Pairs; Pairs pairs = reply->rawHeaderPairs(); for (Pairs::iterator i = pairs.begin(), e = pairs.end(); i != e; ++i) { @@ -126,23 +126,24 @@ void UpdateDownloader::partMetaGot() { QMutexLocker lock(&mutex); full = m.captured(1).toInt(); } - emit App::app()->updateDownloading(already, full); + + Sandboxer::updateProgress(already, full); } } } } -int32 UpdateDownloader::ready() { +int32 UpdateChecker::ready() { QMutexLocker lock(&mutex); return already; } -int32 UpdateDownloader::size() { +int32 UpdateChecker::size() { QMutexLocker lock(&mutex); return full; } -void UpdateDownloader::partFinished(qint64 got, qint64 total) { +void UpdateChecker::partFinished(qint64 got, qint64 total) { if (!reply) return; QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); @@ -179,11 +180,11 @@ void UpdateDownloader::partFinished(qint64 got, qint64 total) { outputFile.close(); unpackUpdate(); } else { - emit App::app()->updateDownloading(already, full); + Sandboxer::updateProgress(already, full); } } -void UpdateDownloader::partFailed(QNetworkReply::NetworkError e) { +void UpdateChecker::partFailed(QNetworkReply::NetworkError e) { if (!reply) return; QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); @@ -198,15 +199,15 @@ void UpdateDownloader::partFailed(QNetworkReply::NetworkError e) { } } LOG(("Update Error: failed to download part starting from %1, error %2").arg(already).arg(e)); - emit App::app()->updateFailed(); + Sandboxer::updateFailed(); } -void UpdateDownloader::fatalFail() { +void UpdateChecker::fatalFail() { clearAll(); - emit App::app()->updateFailed(); + Sandboxer::updateFailed(); } -void UpdateDownloader::clearAll() { +void UpdateChecker::clearAll() { psDeleteDir(cWorkingDir() + qsl("tupdates")); } @@ -225,7 +226,7 @@ void UpdateDownloader::clearAll() { // return QString::fromWCharArray(errMsg); //} -void UpdateDownloader::unpackUpdate() { +void UpdateChecker::unpackUpdate() { QByteArray packed; if (!outputFile.open(QIODevice::ReadOnly)) { LOG(("Update Error: cant read updates file!")); @@ -465,10 +466,10 @@ void UpdateDownloader::unpackUpdate() { } outputFile.remove(); - emit App::app()->updateReady(); + Sandboxer::updateReady(); } -UpdateDownloader::~UpdateDownloader() { +UpdateChecker::~UpdateChecker() { delete reply; reply = 0; } @@ -477,7 +478,7 @@ bool checkReadyUpdate() { QString readyFilePath = cWorkingDir() + qsl("tupdates/temp/ready"), readyPath = cWorkingDir() + qsl("tupdates/temp"); if (!QFile(readyFilePath).exists()) { if (QDir(cWorkingDir() + qsl("tupdates/ready")).exists() || QDir(cWorkingDir() + qsl("tupdates/temp")).exists()) { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); } return false; } @@ -488,30 +489,30 @@ bool checkReadyUpdate() { QFile fVersion(versionPath); if (!fVersion.open(QIODevice::ReadOnly)) { LOG(("Update Error: cant read version file '%1'").arg(versionPath)); - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } VerInt versionNum; if (fVersion.read((char*)&versionNum, sizeof(VerInt)) != sizeof(VerInt)) { LOG(("Update Error: cant read version from file '%1'").arg(versionPath)); - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } if (versionNum == 0x7FFFFFFF) { // beta version quint64 betaVersion = 0; if (fVersion.read((char*)&betaVersion, sizeof(quint64)) != sizeof(quint64)) { LOG(("Update Error: cant read beta version from file '%1'").arg(versionPath)); - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } if (!cBetaVersion() || betaVersion <= cBetaVersion()) { LOG(("Update Error: cant install beta version %1 having beta version %2").arg(betaVersion).arg(cBetaVersion())); - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } } else if (versionNum <= AppVersion) { LOG(("Update Error: cant install version %1 having version %2").arg(versionNum).arg(AppVersion)); - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } fVersion.close(); @@ -530,11 +531,11 @@ bool checkReadyUpdate() { if (!updater.exists()) { QFileInfo current(curUpdater); if (!current.exists()) { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } if (!QFile(current.absoluteFilePath()).copy(updater.absoluteFilePath())) { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } } @@ -545,12 +546,12 @@ bool checkReadyUpdate() { cSetWriteProtected(true); return true; } else { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } } if (DeleteFile(updater.absoluteFilePath().toStdWString().c_str()) == FALSE) { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } #elif defined Q_OS_MAC @@ -578,7 +579,7 @@ QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp } QByteArray signedData = (qstr("TelegramBeta_") + QString::number(version, 16).toLower()).toUtf8(); - + static const int32 shaSize = 20, keySize = 128; uchar sha1Buffer[shaSize]; diff --git a/Telegram/SourceFiles/autoupdater.h b/Telegram/SourceFiles/autoupdater.h index e15d7fe09e..7394035ddd 100644 --- a/Telegram/SourceFiles/autoupdater.h +++ b/Telegram/SourceFiles/autoupdater.h @@ -26,11 +26,11 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #include -class UpdateDownloader : public QObject { +class UpdateChecker : public QObject { Q_OBJECT public: - UpdateDownloader(QThread *thread, const QString &url); + UpdateChecker(QThread *thread, const QString &url); void unpackUpdate(); @@ -39,7 +39,7 @@ public: static void clearAll(); - ~UpdateDownloader(); + ~UpdateChecker(); public slots: @@ -67,7 +67,7 @@ private: bool checkReadyUpdate(); #else -class UpdateDownloader : public QObject { +class UpdateChecker : public QObject { Q_OBJECT }; diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index a6bad679e4..357410b5ef 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -82,7 +82,7 @@ void AboutBox::onVersion() { } url = url.arg(qsl("tbeta%1_%2").arg(cRealBetaVersion()).arg(countBetaVersionSignature(cRealBetaVersion()))); - App::app()->clipboard()->setText(url); + Sandboxer::setClipboardText(url); Ui::showLayer(new InformBox("The link to the current private beta version of Telegram Desktop was copied to the clipboard.")); } else { diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 3ba4eac434..7db72e9a69 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -750,7 +750,7 @@ void SetupChannelBox::mouseMoveEvent(QMouseEvent *e) { void SetupChannelBox::mousePressEvent(QMouseEvent *e) { mouseMoveEvent(e); if (_linkOver) { - App::app()->clipboard()->setText(_channel->invitationUrl); + Sandboxer::setClipboardText(_channel->invitationUrl); _goodTextLink = lang(lng_create_channel_link_copied); a_goodOpacity = anim::fvalue(1, 0); _a_goodFade.start(); diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index e6dd0269a9..af570091d5 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -34,7 +34,7 @@ TextParseOptions _confirmBoxTextOptions = { Qt::LayoutDirectionAuto, // dir }; -ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const style::BoxButton &doneStyle, const QString &cancelText, const style::BoxButton &cancelStyle) : AbstractBox(st::boxWidth), +ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const style::BoxButton &doneStyle, const QString &cancelText, const style::BoxButton &cancelStyle) : AbstractBox(st::boxWidth), _informative(false), _text(100), _confirm(this, doneText.isEmpty() ? lang(lng_box_ok) : doneText, doneStyle), @@ -212,7 +212,7 @@ void MaxInviteBox::mouseMoveEvent(QMouseEvent *e) { void MaxInviteBox::mousePressEvent(QMouseEvent *e) { mouseMoveEvent(e); if (_linkOver) { - App::app()->clipboard()->setText(_link); + Sandboxer::setClipboardText(_link); _goodTextLink = lang(lng_create_channel_link_copied); a_goodOpacity = anim::fvalue(1, 0); _a_good.start(); diff --git a/Telegram/SourceFiles/boxes/usernamebox.cpp b/Telegram/SourceFiles/boxes/usernamebox.cpp index 71e0a99481..fa40dcfe9a 100644 --- a/Telegram/SourceFiles/boxes/usernamebox.cpp +++ b/Telegram/SourceFiles/boxes/usernamebox.cpp @@ -191,7 +191,7 @@ void UsernameBox::onChanged() { } void UsernameBox::onLinkClick() { - App::app()->clipboard()->setText(qsl("https://telegram.me/") + getName()); + Sandboxer::setClipboardText(qsl("https://telegram.me/") + getName()); _copiedTextLink = lang(lng_username_copied); update(); } diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 683b3cd277..1be6560e19 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -24,6 +24,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "mainwidget.h" #include "layerwidget.h" +#include "lang.h" namespace App { @@ -175,39 +176,143 @@ namespace Notify { } +struct GlobalDataStruct { + QString LangSystemISO; + int32 LangSystem = languageDefault; +}; +GlobalDataStruct *GlobalData = 0; + namespace Global { - struct Data { - uint64 LaunchId = 0; - }; + bool CheckBetaVersionDir() { + QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta")); + if (cBetaVersion()) { + cForceWorkingDir(cExeDir() + qsl("TelegramBeta_data/")); + if (*BetaPrivateKey) { + cSetBetaPrivateKey(QByteArray(BetaPrivateKey)); + } + if (beta.open(QIODevice::WriteOnly)) { + QDataStream dataStream(&beta); + dataStream.setVersion(QDataStream::Qt_5_3); + dataStream << quint64(cRealBetaVersion()) << cBetaPrivateKey(); + } else { + LOG(("Error: could not open '%1' for writing private key!").arg(beta.fileName())); + return false; + } + } else if (beta.exists()) { + cForceWorkingDir(cExeDir() + qsl("TelegramBeta_data/")); + if (beta.open(QIODevice::ReadOnly)) { + QDataStream dataStream(&beta); + dataStream.setVersion(QDataStream::Qt_5_3); - Data *_data = 0; - - Initializer::Initializer() { - initThirdParty(); - _data = new Data(); - - memset_rand(&_data->LaunchId, sizeof(_data->LaunchId)); + quint64 v; + QByteArray k; + dataStream >> v >> k; + if (dataStream.status() == QDataStream::Ok) { + cSetBetaVersion(qMax(v, AppVersion * 1000ULL)); + cSetBetaPrivateKey(k); + cSetRealBetaVersion(v); + } else { + LOG(("Error: '%1' is corrupted, reinstall private beta!").arg(beta.fileName())); + return false; + } + } else { + LOG(("Error: could not open '%1' for reading private key!").arg(beta.fileName())); + return false; + } + } + return true; } - Initializer::~Initializer() { - deinitThirdParty(); + void WorkingDirReady() { + if (QFile(cWorkingDir() + qsl("tdata/withtestmode")).exists()) { + cSetTestMode(true); + } + if (!cDebug() && QFile(cWorkingDir() + qsl("tdata/withdebug")).exists()) { + cSetDebug(true); + } + if (cBetaVersion()) { + cSetDevVersion(false); + } else if (!cDevVersion() && QFile(cWorkingDir() + qsl("tdata/devversion")).exists()) { + cSetDevVersion(true); + } else if (DevVersion) { + QFile f(cWorkingDir() + qsl("tdata/devversion")); + if (!f.exists() && f.open(QIODevice::WriteOnly)) { + f.write("1"); + } + } + } + + void start() { + GlobalData = new GlobalDataStruct(); + + GlobalData->LangSystemISO = psCurrentLanguage(); + if (GlobalData->LangSystemISO.isEmpty()) GlobalData->LangSystemISO = qstr("en"); + QByteArray l = LangSystemISO().toLatin1(); + for (int32 i = 0; i < languageCount; ++i) { + if (l.at(0) == LanguageCodes[i][0] && l.at(1) == LanguageCodes[i][1]) { + GlobalData->LangSystem = i; + break; + } + } + } + + void finish() { + delete GlobalData; + GlobalData = 0; } #define DefineGlobalReadOnly(Type, Name) const Type &Name() { \ - t_assert_full(_data != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ - return _data->Name; \ + t_assert_full(GlobalData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ + return GlobalData->Name; \ } #define DefineGlobal(Type, Name) DefineGlobalReadOnly(Type, Name) \ void Set##Name(const Type &Name) { \ - t_assert_full(_data != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ - _data->Name = Name; \ + t_assert_full(GlobalData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ + GlobalData->Name = Name; \ } \ Type &Ref##Name() { \ - t_assert_full(_data != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ - return _data->Name; \ + t_assert_full(GlobalData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ + return GlobalData->Name; \ } - DefineGlobalReadOnly(uint64, LaunchId); + DefineGlobalReadOnly(QString, LangSystemISO); + DefineGlobalReadOnly(int32, LangSystem); + +} + +struct SandboxDataStruct { + uint64 LaunchId = 0; +}; +SandboxDataStruct *SandboxData = 0; + +namespace Sandbox { + + void start() { + SandboxData = new SandboxDataStruct(); + + memset_rand(&SandboxData->LaunchId, sizeof(SandboxData->LaunchId)); + } + + void finish() { + delete SandboxData; + SandboxData = 0; + } + +#define DefineSandboxReadOnly(Type, Name) const Type &Name() { \ + t_assert_full(SandboxData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ + return SandboxData->Name; \ +} +#define DefineSandbox(Type, Name) DefineSandboxReadOnly(Type, Name) \ +void Set##Name(const Type &Name) { \ + t_assert_full(SandboxData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ + SandboxData->Name = Name; \ +} \ +Type &Ref##Name() { \ + t_assert_full(SandboxData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ + return SandboxData->Name; \ +} + + DefineSandboxReadOnly(uint64, LaunchId); }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 1a80278c75..70749a67f2 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -37,7 +37,7 @@ namespace App { }; -namespace Ui { // openssl doesn't allow me to use UI :( +namespace Ui { void showStickerPreview(DocumentData *sticker); void hideStickerPreview(); @@ -98,17 +98,32 @@ namespace Notify { namespace Global { - class Initializer { - public: - Initializer(); - ~Initializer(); - }; + bool CheckBetaVersionDir(); + void WorkingDirReady(); + + void start(); + void finish(); #define DeclareGlobalReadOnly(Type, Name) const Type &Name(); #define DeclareGlobal(Type, Name) DeclareGlobalReadOnly(Type, Name) \ void Set##Name(const Type &Name); \ Type &Ref##Name(); - DeclareGlobalReadOnly(uint64, LaunchId); + DeclareGlobalReadOnly(QString, LangSystemISO); + DeclareGlobalReadOnly(int32, LangSystem); + +} + +namespace Sandbox { + + void start(); + void finish(); + +#define DeclareSandboxReadOnly(Type, Name) const Type &Name(); +#define DeclareSandbox(Type, Name) DeclareSandboxReadOnly(Type, Name) \ + void Set##Name(const Type &Name); \ + Type &Ref##Name(); + + DeclareSandboxReadOnly(uint64, LaunchId); }; diff --git a/Telegram/SourceFiles/gui/button.cpp b/Telegram/SourceFiles/gui/button.cpp index 53f0e19507..05217d585e 100644 --- a/Telegram/SourceFiles/gui/button.cpp +++ b/Telegram/SourceFiles/gui/button.cpp @@ -80,7 +80,6 @@ void Button::mouseReleaseEvent(QMouseEvent *e) { } void Button::setOver(bool over, ButtonStateChangeSource source) { -// LOG(("Set over: %1, by: %2 AT %3").arg(logBool(over)).arg(source).arg(dynamic_cast(this) ? dynamic_cast(this)->getText() : qsl("Unknown"))); if (over && !(_state & StateOver)) { int oldState = _state; _state |= StateOver; diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 21fefa3e1d..349fec1af3 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -464,7 +464,7 @@ void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, PressSource source) _parent = parent; QPoint w = p - QPoint(0, _padding.top()); - QRect r = App::app() ? App::app()->desktop()->screenGeometry(p) : QDesktopWidget().screenGeometry(p); + QRect r = Sandboxer::screenGeometry(p); if (rtl()) { if (w.x() - width() < r.x() - _padding.left()) { if (_parent && w.x() + _parent->width() - _padding.left() - _padding.right() + width() - _padding.right() <= r.x() + r.width()) { diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 0dad2f9f4c..466c3321fe 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -2571,15 +2571,6 @@ void Text::setMarkedText(style::font font, const QString &text, const EntitiesIn _font = font; clean(); { -// QByteArray ba = text.toUtf8(); // chars for OS X crash investigation -// const char *ch = ba.constData(); -// LOG(("STR: %1").arg(text)); -// LOG(("BYTES: %1").arg(mb(ba.constData(), ba.size()).str())); -// for (int32 i = 0; i < text.size(); ++i) { -// LOG(("LETTER %1: '%2' - %3").arg(i).arg(text.at(i)).arg(text.at(i).unicode())); -// } -// int32 w = _font->width(text); - // QString newText; // utf16 of the text for emoji // newText.reserve(8 * text.size()); // for (const QChar *ch = text.constData(), *e = ch + text.size(); ch != e; ++ch) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index ef73e71ac3..4cd226f2db 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2601,10 +2601,10 @@ void History::overviewSliceDone(int32 overviewIndex, const MTPmessages_Messages if (peer->isChannel()) { peer->asChannel()->ptsReceived(d.vpts.v); } else { - LOG(("API Error: received messages.channelMessages when no channel was passed! (History::overviewSliceDone, onlyCounts %1)").arg(logBool(onlyCounts))); + LOG(("API Error: received messages.channelMessages when no channel was passed! (History::overviewSliceDone, onlyCounts %1)").arg(Logs::b(onlyCounts))); } if (d.has_collapsed()) { // should not be returned - LOG(("API Error: channels.getMessages and messages.getMessages should not return collapsed groups! (History::overviewSliceDone, onlyCounts %1)").arg(logBool(onlyCounts))); + LOG(("API Error: channels.getMessages and messages.getMessages should not return collapsed groups! (History::overviewSliceDone, onlyCounts %1)").arg(Logs::b(onlyCounts))); } App::feedUsers(d.vusers); diff --git a/Telegram/SourceFiles/intro/intro.cpp b/Telegram/SourceFiles/intro/intro.cpp index e1fff29629..b921672f4f 100644 --- a/Telegram/SourceFiles/intro/intro.cpp +++ b/Telegram/SourceFiles/intro/intro.cpp @@ -47,7 +47,7 @@ namespace { emit signalEmitOn->countryChanged(); } #ifndef TDESKTOP_DISABLE_AUTOUPDATE - if (App::app()) App::app()->startUpdateCheck(); + Sandboxer::startUpdateCheck(); #endif } } diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index 21ea020ee1..ccd5f227ee 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -230,7 +230,7 @@ void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) { checkRequest.start(1000); - sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(5), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Application::language())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(5), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Global::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); } else { showError(lang(lng_bad_phone_noreg), true); enableAll(true); @@ -240,7 +240,7 @@ void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) { void IntroPhone::phoneSubmitDone(const MTPauth_SentCode &result) { stopCheck(); enableAll(false); - + if (result.type() == mtpc_auth_sentCode) { const MTPDauth_sentCode &d(result.c_auth_sentCode()); intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), mtpIsTrue(d.vphone_registered)); @@ -260,7 +260,7 @@ void IntroPhone::toSignUp() { checkRequest.start(1000); - sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(0), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Application::language())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(0), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Global::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); } bool IntroPhone::phoneSubmitFail(const RPCError &error) { diff --git a/Telegram/SourceFiles/intro/introsteps.cpp b/Telegram/SourceFiles/intro/introsteps.cpp index 69ec1d1cc7..eb33f2a3d9 100644 --- a/Telegram/SourceFiles/intro/introsteps.cpp +++ b/Telegram/SourceFiles/intro/introsteps.cpp @@ -36,7 +36,7 @@ _next(this, lang(lng_start_msgs), st::btnIntroNext) { _changeLang.hide(); if (cLang() == languageDefault) { - int32 l = App::app()->languageId(); + int32 l = Global::LangSystem(); if (l != languageDefault) { LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[l] + qsl(".strings"), LangLoaderRequest(lng_switch_to_this)); QString text = loader.found().value(lng_switch_to_this); diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 6aaa61710a..e37284d513 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -412,7 +412,7 @@ namespace { continue; } if (memcmp(magic, tdfMagic, tdfMagicLen)) { - DEBUG_LOG(("App Info: bad magic %1 in '%2'").arg(mb(magic, tdfMagicLen).str()).arg(name)); + DEBUG_LOG(("App Info: bad magic %1 in '%2'").arg(Logs::mb(magic, tdfMagicLen).str()).arg(name)); continue; } @@ -863,7 +863,7 @@ namespace { stream.readRawData((char*)key, 256); if (!_checkStreamStatus(stream)) return false; - DEBUG_LOG(("MTP Info: key found, dc %1, key: %2").arg(dcId).arg(mb(key, 256).str())); + DEBUG_LOG(("MTP Info: key found, dc %1, key: %2").arg(dcId).arg(Logs::mb(key, 256).str())); dcId = dcId % _mtp_internal::dcShift; mtpAuthKeyPtr keyPtr(new mtpAuthKey()); keyPtr->setKey(key); @@ -1983,15 +1983,7 @@ namespace _local_inner { namespace Local { - void start() { - if (!_started) { - _started = true; - _manager = new _local_inner::Manager(); - _localLoader = new TaskQueue(0, FileLoaderQueueStopTimeout); - } - } - - void stop() { + void finish() { if (_manager) { _writeMap(WriteMapNow); _manager->finish(); @@ -2002,8 +1994,11 @@ namespace Local { } } - void readSettings() { - Local::start(); + void start() { + t_assert(_manager == 0); + + _manager = new _local_inner::Manager(); + _localLoader = new TaskQueue(0, FileLoaderQueueStopTimeout); _basePath = cWorkingDir() + qsl("tdata/"); if (!QDir().exists(_basePath)) QDir().mkpath(_basePath); diff --git a/Telegram/SourceFiles/localstorage.h b/Telegram/SourceFiles/localstorage.h index 6bf8e7c9dd..30ed83b629 100644 --- a/Telegram/SourceFiles/localstorage.h +++ b/Telegram/SourceFiles/localstorage.h @@ -54,7 +54,7 @@ namespace _local_inner { namespace Local { void start(); - void stop(); + void finish(); void readSettings(); void writeSettings(); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 9004d46abb..69817a2c41 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -22,111 +22,313 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #include "pspecific.h" -namespace { - QFile debugLog, tcpLog, mtpLog, mainLog; - QTextStream *debugLogStream = 0, *tcpLogStream = 0, *mtpLogStream = 0, *mainLogStream = 0; - int32 part = -1; - QChar zero('0'); +enum LogDataType { + LogDataMain, + LogDataDebug, + LogDataTcp, + LogDataMtp, - QMutex debugLogMutex, mainLogMutex; + LogDataCount +}; - QString debugLogEntryStart() { - static uint32 logEntry = 0; +QMutex *LogsMutexes = 0; +QMutex *_logsMutex(LogDataType type) { + if (!LogsMutexes) { + LogsMutexes = new QMutex[LogDataCount]; + } + return &LogsMutexes[type]; +} +QString _logsFilePath(LogDataType type, const QString &postfix = QString()) { + QString path(cWorkingDir()); + switch (type) { + case LogDataMain: path += qstr("log.txt"); break; + case LogDataDebug: path += qstr("DebugLogs/log") + postfix + qstr(".txt"); break; + case LogDataTcp: path += qstr("DebugLogs/tcp") + postfix + qstr(".txt"); break; + case LogDataMtp: path += qstr("DebugLogs/mtp") + postfix + qstr(".txt"); break; + } + return path; +} +class LogsDataFields { +public: + QString entryStart() { QDateTime tm(QDateTime::currentDateTime()); QThread *thread = QThread::currentThread(); MTPThread *mtpThread = qobject_cast(thread); - uint32 threadId = mtpThread ? mtpThread->getThreadId() : 0; + uint threadId = mtpThread ? mtpThread->getThreadId() : 0; - return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, zero)).arg(++logEntry, 7, 10, zero); + return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, QChar('0'))).arg(++index, 7, 10, QChar('0')); + } + + bool openMain() { + QMutexLocker lock(_logsMutex(LogDataMain)); + return reopen(LogDataMain, 0, QString()); + } + + void write(LogDataType type, const QString &msg) { + QMutexLocker lock(_logsMutex(type)); + if (type != LogDataMain) reopenDebug(); + if (!streams[type].device()) return; + + streams[type] << msg; + streams[type].flush(); + } + +private: + + QFile files[LogDataCount]; + QTextStream streams[LogDataCount]; + + int32 part = -1, index = 0; + + bool reopen(LogDataType type, int32 dayIndex, const QString &postfix) { + if (streams[type].device()) { + if (type == LogDataMain) { + return true; + } + streams[type].setDevice(0); + files[type].close(); + } + + files[type].setFileName(_logsFilePath(type, postfix)); + QFlags mode = QIODevice::WriteOnly | QIODevice::Text; + if (type != LogDataMain) { + if (files[type].exists()) { + if (files[type].open(QIODevice::ReadOnly | QIODevice::Text)) { + if (QString::fromUtf8(files[type].readLine()).toInt() == dayIndex) { + mode |= QIODevice::Append; + } + files[type].close(); + } + } else { + QDir().mkdir(cWorkingDir() + qstr("DebugLogs")); + } + } + if (files[type].open(mode)) { + streams[type].setDevice(&files[type]); + streams[type].setCodec("UTF-8"); + + if (type != LogDataMain) { + streams[type] << ((mode & QIODevice::Append) ? qsl("----------------------------------------------------------------\nNEW LOGGING INSTANCE STARTED!!!\n----------------------------------------------------------------\n") : qsl("%1\n").arg(dayIndex)); + streams[type].flush(); + } + + return true; + } + return false; + } + + void reopenDebug() { + time_t t = time(NULL); + struct tm tm; + mylocaltime(&tm, &t); + + static const int switchEach = 15; // minutes + int32 newPart = (tm.tm_min + tm.tm_hour * 60) / switchEach; + if (newPart == part) return; + + part = newPart; + + int32 dayIndex = (tm.tm_year + 1900) * 10000 + (tm.tm_mon + 1) * 100 + tm.tm_mday; + QString postfix = QString("_%4_%5").arg((part * switchEach) / 60, 2, 10, QChar('0')).arg((part * switchEach) % 60, 2, 10, QChar('0')); + + reopen(LogDataDebug, dayIndex, postfix); + reopen(LogDataTcp, dayIndex, postfix); + reopen(LogDataMtp, dayIndex, postfix); + } + +}; + +LogsDataFields *LogsData = 0; + +typedef QList > LogsInMemoryList; +LogsInMemoryList *LogsInMemory = 0; +LogsInMemoryList *DeletedLogsInMemory = SharedMemoryLocation(); +void _logsWrite(LogDataType type, const QString &msg) { + if (LogsData) { + if (type == LogDataMain || cDebug()) { + LogsData->write(type, msg); + } + } else if (LogsInMemory != DeletedLogsInMemory) { + if (!LogsInMemory) { + LogsInMemory = new LogsInMemoryList; + } + LogsInMemory->push_back(qMakePair(LogDataMain, msg)); } } -void debugLogWrite(const char *file, int32 line, const QString &v) { - if (!cDebug() || !debugLogStream) return; +void _moveOldDataFiles(const QString &from); - const char *last = strstr(file, "/"), *found = 0; - while (last) { - found = last; - last = strstr(last + 1, "/"); - } - last = strstr(file, "\\"); - while (last) { - found = last; - last = strstr(last + 1, "\\"); - } - if (found) { - file = found + 1; - } +namespace Logs { - { - QMutexLocker lock(&debugLogMutex); - if (!cDebug() || !debugLogStream) return; + Initializer::Initializer() { + t_assert(LogsData == 0); - logsInitDebug(); // maybe need to reopen new file + if (!Global::CheckBetaVersionDir()) { + return; + } + bool workingDirChosen = cBetaVersion(); + + QString moveOldDataFrom; + if (cBetaVersion()) { + cSetDebug(true); +#if (defined Q_OS_MAC || defined Q_OS_LINUX) + } else { + QString wasDir = QDir(cWorkingDir()).absolutePath() + '/'; + +#ifdef _DEBUG + cForceWorkingDir(cExeDir()); +#else + if (cWorkingDir().isEmpty()) { + cForceWorkingDir(psAppDataPath()); + } +#endif + workingDirChosen = true; + +#if (defined Q_OS_LINUX && !defined _DEBUG) // fix first version + moveOldDataFrom = wasDir; +#endif + +#endif + } + + LogsData = new LogsDataFields(); + if (!workingDirChosen) { + cForceWorkingDir(cWorkingDir()); + if (!LogsData->openMain()) { + cForceWorkingDir(cExeDir()); + if (!LogsData->openMain()) { + cForceWorkingDir(psAppDataPath()); + } + } + } + + cForceWorkingDir(QDir(cWorkingDir()).absolutePath() + '/'); + QDir().setCurrent(cWorkingDir()); + + Global::WorkingDirReady(); + + LOG(("Launched version: %1, dev: %2, beta: %3, debug mode: %4, test dc: %5").arg(AppVersion).arg(Logs::b(cDevVersion())).arg(cBetaVersion()).arg(Logs::b(cDebug())).arg(Logs::b(cTestMode()))); + LOG(("Executable dir: %1, name: %2").arg(cExeDir()).arg(cExeName())); + LOG(("Working dir: %1").arg(cWorkingDir())); + LOG(("Arguments: %1").arg(cArguments())); + + if (!LogsData->openMain()) { + delete LogsData; + LogsData = 0; + LOG(("Error: could not open '%1' for writing log!").arg(_logsFilePath(LogDataMain))); + return; + } - QString msg(QString("%1 %2 (%3 : %4)\n").arg(debugLogEntryStart()).arg(v).arg(file).arg(line)); - (*debugLogStream) << msg; - debugLogStream->flush(); #ifdef Q_OS_WIN -// OutputDebugString(reinterpret_cast(msg.utf16())); + if (cWorkingDir() == psAppDataPath()) { // fix old "Telegram Win (Unofficial)" version + moveOldDataFrom = psAppDataPathOld(); + } +#endif + if (!moveOldDataFrom.isEmpty()) { + _moveOldDataFiles(moveOldDataFrom); + } + + if (LogsInMemory) { + t_assert(LogsInMemory != DeletedLogsInMemory); + LogsInMemoryList list = *LogsInMemory; + for (LogsInMemoryList::const_iterator i = list.cbegin(), e = list.cend(); i != e; ++i) { + _logsWrite(i->first, i->second); + } + } + if (LogsInMemory) { + t_assert(LogsInMemory != DeletedLogsInMemory); + delete LogsInMemory; + LogsInMemory = DeletedLogsInMemory; + } + + LOG(("Logs started.")); + DEBUG_LOG(("Debug logs started.")); + } + + Initializer::~Initializer() { + delete LogsData; + LogsData = 0; + + delete[] LogsMutexes; + LogsMutexes = 0; + } + + bool started() { + return LogsData != 0; + } + + void writeMain(const QString &v) { + time_t t = time(NULL); + struct tm tm; + mylocaltime(&tm, &t); + + QString msg(QString("[%1.%2.%3 %4:%5:%6] %7\n").arg(tm.tm_year + 1900).arg(tm.tm_mon + 1, 2, 10, QChar('0')).arg(tm.tm_mday, 2, 10, QChar('0')).arg(tm.tm_hour, 2, 10, QChar('0')).arg(tm.tm_min, 2, 10, QChar('0')).arg(tm.tm_sec, 2, 10, QChar('0')).arg(v)); + _logsWrite(LogDataMain, msg); + + QString debugmsg(QString("%1 %2\n").arg(LogsData->entryStart()).arg(v)); + _logsWrite(LogDataDebug, debugmsg); + } + + void writeDebug(const char *file, int32 line, const QString &v) { + const char *last = strstr(file, "/"), *found = 0; + while (last) { + found = last; + last = strstr(last + 1, "/"); + } + last = strstr(file, "\\"); + while (last) { + found = last; + last = strstr(last + 1, "\\"); + } + if (found) { + file = found + 1; + } + + QString msg(QString("%1 %2 (%3 : %4)\n").arg(LogsData->entryStart()).arg(v).arg(file).arg(line)); + _logsWrite(LogDataDebug, msg); + +#ifdef Q_OS_WIN + //OutputDebugString(reinterpret_cast(msg.utf16())); #elif defined Q_OS_MAC - objc_outputDebugString(msg); + //objc_outputDebugString(msg); #elif defined Q_OS_LINUX && defined _DEBUG -// std::cout << msg.toUtf8().constData(); + //std::cout << msg.toUtf8().constData(); #endif } -} -void tcpLogWrite(const QString &v) { - if (!cDebug() || !tcpLogStream) return; - - { - QMutexLocker lock(&debugLogMutex); - if (!cDebug() || !tcpLogStream) return; - - logsInitDebug(); // maybe need to reopen new file - - (*tcpLogStream) << QString("%1 %2\n").arg(debugLogEntryStart()).arg(v); - tcpLogStream->flush(); - } -} - -void mtpLogWrite(int32 dc, const QString &v) { - if (!cDebug() || !mtpLogStream) return; - - { - QMutexLocker lock(&debugLogMutex); - if (!cDebug() || !mtpLogStream) return; - - logsInitDebug(); // maybe need to reopen new file - - (*mtpLogStream) << QString("%1 (dc:%2) %3\n").arg(debugLogEntryStart()).arg(dc).arg(v); - mtpLogStream->flush(); - } -} - -void logWrite(const QString &v) { - if (!mainLogStream) return; - - time_t t = time(NULL); - struct tm tm; - mylocaltime(&tm, &t); - - { - QMutexLocker lock(&mainLogMutex); - if (!mainLogStream) return; - - QString msg(QString("[%1.%2.%3 %4:%5:%6] %7\n").arg(tm.tm_year + 1900).arg(tm.tm_mon + 1, 2, 10, zero).arg(tm.tm_mday, 2, 10, zero).arg(tm.tm_hour, 2, 10, zero).arg(tm.tm_min, 2, 10, zero).arg(tm.tm_sec, 2, 10, zero).arg(v)); - (*mainLogStream) << msg; - mainLogStream->flush(); + void writeTcp(const QString &v) { + QString msg(QString("%1 %2\n").arg(LogsData->entryStart()).arg(v)); + _logsWrite(LogDataTcp, msg); + } + + void writeMtp(int32 dc, const QString &v) { + QString msg(QString("%1 (dc:%2) %3\n").arg(LogsData->entryStart()).arg(dc).arg(v)); + _logsWrite(LogDataMtp, msg); + } + + QString vector(const QVector &ids) { + if (!ids.size()) return "[]"; + QString idsStr = QString("[%1").arg(ids.cbegin()->v); + for (QVector::const_iterator i = ids.cbegin() + 1, e = ids.cend(); i != e; ++i) { + idsStr += QString(", %2").arg(i->v); + } + return idsStr + "]"; + } + + QString vector(const QVector &ids) { + if (!ids.size()) return "[]"; + QString idsStr = QString("[%1").arg(*ids.cbegin()); + for (QVector::const_iterator i = ids.cbegin() + 1, e = ids.cend(); i != e; ++i) { + idsStr += QString(", %2").arg(*i); + } + return idsStr + "]"; } - if (cDebug()) debugLogWrite("logs", 0, v); } -void moveOldDataFiles(const QString &wasDir) { +void _moveOldDataFiles(const QString &wasDir) { QFile data(wasDir + "data"), dataConfig(wasDir + "data_config"), tdataConfig(wasDir + "tdata/config"); if (data.exists() && dataConfig.exists() && !QFileInfo(cWorkingDir() + "data").exists() && !QFileInfo(cWorkingDir() + "data_config").exists()) { // move to home dir LOG(("Copying data to home dir '%1' from '%2'").arg(cWorkingDir()).arg(wasDir)); @@ -171,239 +373,3 @@ void moveOldDataFiles(const QString &wasDir) { } } } - -bool logsInit() { - t_assert(mainLogStream == 0); - - QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta")); - if (cBetaVersion()) { - cForceWorkingDir(cExeDir() + qsl("TelegramBeta_data/")); - if (*BetaPrivateKey) { - cSetBetaPrivateKey(QByteArray(BetaPrivateKey)); - } - if (beta.open(QIODevice::WriteOnly)) { - QDataStream dataStream(&beta); - dataStream.setVersion(QDataStream::Qt_5_3); - dataStream << quint64(cRealBetaVersion()) << cBetaPrivateKey(); - } else { - LOG(("Error: could not open \"beta\" file for writing private key!")); - } - } else if (beta.exists()) { - if (beta.open(QIODevice::ReadOnly)) { - QDataStream dataStream(&beta); - dataStream.setVersion(QDataStream::Qt_5_3); - - quint64 v; - QByteArray k; - dataStream >> v >> k; - if (dataStream.status() == QDataStream::Ok) { - cSetBetaVersion(qMax(v, AppVersion * 1000ULL)); - cSetBetaPrivateKey(k); - cSetRealBetaVersion(v); - - cForceWorkingDir(cExeDir() + qsl("TelegramBeta_data/")); - } - } - } - - if (cBetaVersion()) { - cSetDebug(true); - } else { - QString wasDir = cWorkingDir(); -#if (defined Q_OS_MAC || defined Q_OS_LINUX) - -#ifdef _DEBUG - cForceWorkingDir(cExeDir()); -#else - if(cWorkingDir().isEmpty()){ - cForceWorkingDir(psAppDataPath()); - } -#endif - -#if (defined Q_OS_LINUX && !defined _DEBUG) // fix first version - moveOldDataFiles(wasDir); -#endif - -#endif - } - - QString rightDir = cWorkingDir(); - cForceWorkingDir(rightDir); - mainLog.setFileName(cWorkingDir() + "log.txt"); - mainLog.open(QIODevice::WriteOnly | QIODevice::Text); - if (!cBetaVersion() && !mainLog.isOpen()) { - cForceWorkingDir(cExeDir()); - mainLog.setFileName(cWorkingDir() + "log.txt"); - mainLog.open(QIODevice::WriteOnly | QIODevice::Text); - if (!mainLog.isOpen()) { - cForceWorkingDir(psAppDataPath()); - mainLog.setFileName(cWorkingDir() + "log.txt"); - mainLog.open(QIODevice::WriteOnly | QIODevice::Text); - } - } - if (mainLog.isOpen()) { - mainLogStream = new QTextStream(); - mainLogStream->setDevice(&mainLog); - mainLogStream->setCodec("UTF-8"); - } else { - cForceWorkingDir(rightDir); - } - cForceWorkingDir(QDir(cWorkingDir()).absolutePath() + '/'); - - if (QFile(cWorkingDir() + qsl("tdata/withtestmode")).exists()) { - cSetTestMode(true); - LOG(("Switched to test mode!")); - } - -#ifdef Q_OS_WIN - if (cWorkingDir() == psAppDataPath()) { // fix old "Telegram Win (Unofficial)" version - moveOldDataFiles(psAppDataPathOld()); - } -#endif - - if (cDebug()) { - logsInitDebug(); - } else if (QFile(cWorkingDir() + qsl("tdata/withdebug")).exists()) { - logsInitDebug(); - cSetDebug(true); - } - - if (cBetaVersion()) { - cSetDevVersion(false); - } else if (!cDevVersion() && QFile(cWorkingDir() + qsl("tdata/devversion")).exists()) { - cSetDevVersion(true); - } - - QDir().setCurrent(cWorkingDir()); - return true; -} - -void logsInitDebug() { - time_t t = time(NULL); - struct tm tm; - mylocaltime(&tm, &t); - - static const int switchEach = 15; // minutes - int32 newPart = (tm.tm_min + tm.tm_hour * 60) / switchEach; - if (newPart == part) return; - - part = newPart; - - int32 dayIndex = (tm.tm_year + 1900) * 10000 + (tm.tm_mon + 1) * 100 + tm.tm_mday; - QString logPostfix = QString("_%4_%5").arg((part * switchEach) / 60, 2, 10, zero).arg((part * switchEach) % 60, 2, 10, zero); - - if (debugLogStream) { - delete debugLogStream; - debugLogStream = 0; - debugLog.close(); - } - debugLog.setFileName(cWorkingDir() + qsl("DebugLogs/log") + logPostfix + qsl(".txt")); - QIODevice::OpenMode debugLogMode = QIODevice::WriteOnly | QIODevice::Text; - if (debugLog.exists()) { - if (debugLog.open(QIODevice::ReadOnly | QIODevice::Text)) { - if (QString::fromUtf8(debugLog.readLine()).toInt() == dayIndex) { - debugLogMode |= QIODevice::Append; - } - debugLog.close(); - } - } - if (!debugLog.open(debugLogMode)) { - QDir dir(QDir::current()); - dir.mkdir(cWorkingDir() + qsl("DebugLogs")); - debugLog.open(debugLogMode); - } - if (debugLog.isOpen()) { - debugLogStream = new QTextStream(); - debugLogStream->setDevice(&debugLog); - debugLogStream->setCodec("UTF-8"); - (*debugLogStream) << ((debugLogMode & QIODevice::Append) ? qsl("----------------------------------------------------------------\nNEW LOGGING INSTANCE STARTED!!!\n----------------------------------------------------------------\n") : qsl("%1\n").arg(dayIndex)); - debugLogStream->flush(); - } - if (tcpLogStream) { - delete tcpLogStream; - tcpLogStream = 0; - tcpLog.close(); - } - tcpLog.setFileName(cWorkingDir() + qsl("DebugLogs/tcp") + logPostfix + qsl(".txt")); - QIODevice::OpenMode tcpLogMode = QIODevice::WriteOnly | QIODevice::Text; - if (tcpLog.exists()) { - if (tcpLog.open(QIODevice::ReadOnly | QIODevice::Text)) { - if (QString::fromUtf8(tcpLog.readLine()).toInt() == dayIndex) { - tcpLogMode |= QIODevice::Append; - } - tcpLog.close(); - } - } - if (tcpLog.open(tcpLogMode)) { - tcpLogStream = new QTextStream(); - tcpLogStream->setDevice(&tcpLog); - tcpLogStream->setCodec("UTF-8"); - (*tcpLogStream) << ((tcpLogMode & QIODevice::Append) ? qsl("----------------------------------------------------------------\nNEW LOGGING INSTANCE STARTED!!!\n----------------------------------------------------------------\n") : qsl("%1\n").arg(dayIndex)); - tcpLogStream->flush(); - } - if (mtpLogStream) { - delete mtpLogStream; - mtpLogStream = 0; - mtpLog.close(); - } - mtpLog.setFileName(cWorkingDir() + qsl("DebugLogs/mtp") + logPostfix + qsl(".txt")); - QIODevice::OpenMode mtpLogMode = QIODevice::WriteOnly | QIODevice::Text; - if (mtpLog.exists()) { - if (mtpLog.open(QIODevice::ReadOnly | QIODevice::Text)) { - if (QString::fromUtf8(mtpLog.readLine()).toInt() == dayIndex) { - mtpLogMode |= QIODevice::Append; - } - mtpLog.close(); - } - } - if (mtpLog.open(mtpLogMode)) { - mtpLogStream = new QTextStream(); - mtpLogStream->setDevice(&mtpLog); - mtpLogStream->setCodec("UTF-8"); - (*mtpLogStream) << ((mtpLogMode & QIODevice::Append) ? qsl("----------------------------------------------------------------\nNEW LOGGING INSTANCE STARTED!!!\n----------------------------------------------------------------\n") : qsl("%1\n").arg(dayIndex)); - mtpLogStream->flush(); - } -} - -void logsClose() { - if (cDebug()) { - if (debugLogStream) { - delete debugLogStream; - debugLogStream = 0; - debugLog.close(); - } - if (tcpLogStream) { - delete tcpLogStream; - tcpLogStream = 0; - tcpLog.close(); - } - if (mtpLogStream) { - delete mtpLogStream; - mtpLogStream = 0; - mtpLog.close(); - } - } - if (mainLogStream) { - delete mainLogStream; - mainLogStream = 0; - mainLog.close(); - } -} - -QString logVectorLong(const QVector &ids) { - if (!ids.size()) return "[]"; - QString idsStr = QString("[%1").arg(ids.cbegin()->v); - for (QVector::const_iterator i = ids.cbegin() + 1, e = ids.cend(); i != e; ++i) { - idsStr += QString(", %2").arg(i->v); - } - return idsStr + "]"; -} - -QString logVectorLong(const QVector &ids) { - if (!ids.size()) return "[]"; - QString idsStr = QString("[%1").arg(*ids.cbegin()); - for (QVector::const_iterator i = ids.cbegin() + 1, e = ids.cend(); i != e; ++i) { - idsStr += QString(", %2").arg(*i); - } - return idsStr + "]"; -} diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index ff75a6f21d..d50a93f5cd 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -20,78 +20,63 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #pragma once -#ifdef Q_OS_WIN -#define OUTPUT_LOG(msg) (OutputDebugString((QString msg + "\n").toStdWString().c_str())) -#endif - -#if (defined _DEBUG || defined _WITH_DEBUG) - -struct DebugLogMemoryBuffer { - DebugLogMemoryBuffer(const void *ptr, uint32 size) : p(ptr), s(size) { - } - QString str() const { - QString result; - const uchar *buf((const uchar*)p); - const char *hex = "0123456789ABCDEF"; - result.reserve(s * 3); - for (uint32 i = 0; i < s; ++i) { - result += hex[(buf[i] >> 4)]; - result += hex[buf[i] & 0x0F]; - result += ' '; - } - result.chop(1); - return result; - } - - const void *p; - uint32 s; -}; - -inline DebugLogMemoryBuffer mb(const void *ptr, uint32 size) { - return DebugLogMemoryBuffer(ptr, size); -} - -void debugLogWrite(const char *file, int32 line, const QString &v); -#define DEBUG_LOG(msg) { if (cDebug()) debugLogWrite(__FILE__, __LINE__, QString msg); } -//usage DEBUG_LOG(("log: %1 %2").arg(1).arg(2)) - -void tcpLogWrite(const QString &v); -#define TCP_LOG(msg) { if (cDebug()) tcpLogWrite(QString msg); } -//usage TCP_LOG(("log: %1 %2").arg(1).arg(2)) - -void mtpLogWrite(int32 dc, const QString &v); -#define MTP_LOG(dc, msg) { if (cDebug()) mtpLogWrite(dc, QString msg); } -//usage MTP_LOG(dc, ("log: %1 %2").arg(1).arg(2)) - -#else -#define DEBUG_LOG(msg) (void(0)) -#define TCP_LOG(msg) (void(0)) -#define MTP_LOG(dc, msg) (void(0)) -#endif - -inline const char *logBool(bool v) { - return v ? "[TRUE]" : "[FALSE]"; -} - class MTPlong; -QString logVectorLong(const QVector &ids); -QString logVectorLong(const QVector &ids); +namespace Logs { -void logWrite(const QString &v); + struct Initializer { + Initializer(); + ~Initializer(); + }; + bool started(); -#define LOG(msg) (logWrite(QString msg)) + void writeMain(const QString &v); + + void writeDebug(const char *file, int32 line, const QString &v); + void writeTcp(const QString &v); + void writeMtp(int32 dc, const QString &v); + + inline const char *b(bool v) { + return v ? "[TRUE]" : "[FALSE]"; + } + + struct MemoryBuffer { + MemoryBuffer(const void *ptr, uint32 size) : p(ptr), s(size) { + } + QString str() const { + QString result; + const uchar *buf((const uchar*)p); + const char *hex = "0123456789ABCDEF"; + result.reserve(s * 3); + for (uint32 i = 0; i < s; ++i) { + result += hex[(buf[i] >> 4)]; + result += hex[buf[i] & 0x0F]; + result += ' '; + } + result.chop(1); + return result; + } + + const void *p; + uint32 s; + }; + + inline MemoryBuffer mb(const void *ptr, uint32 size) { + return MemoryBuffer(ptr, size); + } + + QString vector(const QVector &ids); + QString vector(const QVector &ids); + +} + +#define LOG(msg) (Logs::writeMain(QString msg)) //usage LOG(("log: %1 %2").arg(1).arg(2)) -static volatile int *t_assert_nullptr = 0; -inline void t_noop() {} -inline void t_assert_fail(const char *message, const char *file, int32 line) { - LOG(("Assertion Failed! %1 %2:%3").arg(message).arg(file).arg(line)); - *t_assert_nullptr = 0; -} -#define t_assert_full(condition, message, file, line) ((!(condition)) ? t_assert_fail(message, file, line) : t_noop()) -#define t_assert_c(condition, comment) t_assert_full(condition, "\"" #condition "\" (" comment ")", __FILE__, __LINE__) -#define t_assert(condition) t_assert_full(condition, "\"" #condition "\"", __FILE__, __LINE__) +#define DEBUG_LOG(msg) { if (cDebug() || !Logs::started()) Logs::writeDebug(__FILE__, __LINE__, QString msg); } +//usage DEBUG_LOG(("log: %1 %2").arg(1).arg(2)) -bool logsInit(); -void logsInitDebug(); -void logsClose(); +#define TCP_LOG(msg) { if (cDebug() || !Logs::started()) Logs::writeTcp(QString msg); } +//usage TCP_LOG(("log: %1 %2").arg(1).arg(2)) + +#define MTP_LOG(dc, msg) { if (cDebug() || !Logs::started()) Logs::writeMtp(dc, QString msg); } +//usage MTP_LOG(dc, ("log: %1 %2").arg(1).arg(2)) diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 13e86c4d15..dde5bfaa69 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -25,56 +25,25 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "localstorage.h" int main(int argc, char *argv[]) { + int result = 0; + #ifdef Q_OS_WIN _oldWndExceptionFilter = SetUnhandledExceptionFilter(_exceptionFilter); // CAPIHook apiHook("kernel32.dll", "SetUnhandledExceptionFilter", (PROC)RedirectedSetUnhandledExceptionFilter); #endif settingsParseArgs(argc, argv); - for (int32 i = 0; i < argc; ++i) { - if (string("-fixprevious") == argv[i]) { - return psFixPrevious(); - } else if (string("-cleanup") == argv[i]) { - return psCleanup(); - } - } - if (!logsInit()) { - return 0; + if (cLaunchMode() == LaunchModeFixPrevious) { + return psFixPrevious(); + } else if (cLaunchMode() == LaunchModeCleanup) { + return psCleanup(); } - installSignalHandlers(); - - Global::Initializer _init; - - Local::readSettings(); - if (Local::oldSettingsVersion() < AppVersion) { - psNewVersion(); - } - if (cFromAutoStart() && !cAutoStart()) { - psAutoStart(false, true); - Local::stop(); - return 0; - } - - DEBUG_LOG(("Application Info: Telegram started, test mode: %1, exe dir: %2").arg(logBool(cTestMode())).arg(cExeDir())); - if (cDebug()) { - LOG(("Application Info: Telegram started in debug mode")); - for (int32 i = 0; i < argc; ++i) { - LOG(("Argument: %1").arg(fromUtf8Safe(argv[i]))); - } - QStringList logs = psInitLogs(); - for (int32 i = 0, l = logs.size(); i < l; ++i) { - LOG(("Init Log: %1").arg(logs.at(i))); - } - } - psClearInitLogs(); - - DEBUG_LOG(("Application Info: ideal thread count: %1, using %2 connections per session").arg(QThread::idealThreadCount()).arg(cConnectionsInSession())); - - psStart(); - int result = 0; + Logs::Initializer _logs; { - QByteArray args[] = { "-style=0" }; // prepare fake args + PlatformSpecific::Initializer _ps; + + QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable static const int a_cnt = sizeof(args) / sizeof(args[0]); int a_argc = a_cnt + 1; char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; @@ -84,22 +53,11 @@ int main(int argc, char *argv[]) { result = app.exec(); } } - psFinish(); - Local::stop(); - DEBUG_LOG(("Application Info: Telegram done, result: %1").arg(result)); + DEBUG_LOG(("Telegram finished, result: %1").arg(result)); #ifndef TDESKTOP_DISABLE_AUTOUPDATE if (cRestartingUpdate()) { - if (!cBetaVersion() && DevVersion) { - LOG(("Writing 'devversion' file before launching the Updater!")); - QFile f(cWorkingDir() + qsl("tdata/devversion")); - if (!f.exists() && f.open(QIODevice::WriteOnly)) { - f.write("1"); - f.close(); - } - } - DEBUG_LOG(("Application Info: executing updater to install update..")); psExecUpdater(); } else @@ -109,6 +67,5 @@ int main(int argc, char *argv[]) { psExecTelegram(); } - logsClose(); return result; } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index c1b69b3c2b..e27a7cfab4 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -3459,7 +3459,7 @@ void MainWidget::start(const MTPUser &user) { cSetOtherOnline(0); App::feedUsers(MTP_vector(1, user)); #ifndef TDESKTOP_DISABLE_AUTOUPDATE - App::app()->startUpdateCheck(); + Sandboxer::startUpdateCheck(); #endif MTP::send(MTPupdates_GetState(), rpcDone(&MainWidget::gotState)); update(); diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 11875e5435..18a4fec497 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -179,7 +179,7 @@ void MediaView::moveToScreen() { } QPoint wndCenter(App::wnd()->x() + App::wnd()->width() / 2, App::wnd()->y() + App::wnd()->height() / 2); - QRect avail = App::app() ? App::app()->desktop()->screenGeometry(wndCenter) : QDesktopWidget().screenGeometry(wndCenter); + QRect avail = Sandboxer::screenGeometry(wndCenter); if (avail != geometry()) { setGeometry(avail); } @@ -586,7 +586,7 @@ void MediaView::onSaveAs() { } } activateWindow(); - App::app()->setActiveWindow(this); + Sandboxer::setActiveWindow(this); setFocus(); } @@ -1074,7 +1074,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty show(); psShowOverAll(this); activateWindow(); - App::app()->setActiveWindow(this); + Sandboxer::setActiveWindow(this); setFocus(); } } @@ -1990,7 +1990,7 @@ void MediaView::onCheckActive() { if (App::wnd() && isVisible()) { if (App::wnd()->isActiveWindow() && App::wnd()->hasFocus()) { activateWindow(); - App::app()->setActiveWindow(this); + Sandboxer::setActiveWindow(this); setFocus(); } } diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index 8947014417..017eca81a6 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -793,7 +793,7 @@ 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// Inline methods definition\n' + inlineMethods); -out.write('\n// Human-readable text serialization\n#if (defined _DEBUG || defined _WITH_DEBUG)\n\nvoid mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons);\n\n#endif\n'); +out.write('\n// Human-readable text serialization\nvoid mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons);\n'); outCpp = open('mtpScheme.cpp', 'w'); outCpp.write('/*\n'); @@ -816,7 +816,6 @@ outCpp.write('Full license: https://github.com/telegramdesktop/tdesktop/blob/mas outCpp.write('Copyright (c) 2014 John Preston, https://desktop.telegram.org\n'); outCpp.write('*/\n'); outCpp.write('#include "stdafx.h"\n#include "mtpScheme.h"\n\n'); -outCpp.write('#if (defined _DEBUG || defined _WITH_DEBUG)\n\n'); outCpp.write('typedef QVector Types;\ntypedef QVector StagesFlags;\n\n'); outCpp.write(textSerializeMethods); outCpp.write('namespace {\n'); @@ -825,7 +824,7 @@ outCpp.write('\ttypedef QMap TextSerializers;\n\tT outCpp.write('\tvoid initTextSerializers() {\n'); outCpp.write(textSerializeInit); outCpp.write('\t}\n}\n'); -outCpp.write(textSerializeFull + '\n#endif\n'); +outCpp.write(textSerializeFull + '\n'); print('Done, written {0} constructors, {1} functions.'.format(consts, funcs)); diff --git a/Telegram/SourceFiles/mtproto/mtpAuthKey.h b/Telegram/SourceFiles/mtproto/mtpAuthKey.h index 1b0d71f7b2..aff25083df 100644 --- a/Telegram/SourceFiles/mtproto/mtpAuthKey.h +++ b/Telegram/SourceFiles/mtproto/mtpAuthKey.h @@ -52,7 +52,7 @@ public: } void prepareAES(const MTPint128 &msgKey, MTPint256 &aesKey, MTPint256 &aesIV, bool send = true) const { - if (!_isset) throw mtpErrorKeyNotReady(QString("prepareAES(.., %1)").arg(logBool(send))); + if (!_isset) throw mtpErrorKeyNotReady(QString("prepareAES(.., %1)").arg(Logs::b(send))); uint32 x = send ? 0 : 8; diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 90d1f8e719..9ae550360a 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -78,14 +78,14 @@ namespace { ) { ERR_load_crypto_strings(); LOG(("BigNum Error: BN_bin2bn failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(mb(&g_be, sizeof(uint32)).str()).arg(mb(power, 64 * sizeof(uint32)).str()).arg(mb(modul, 64 * sizeof(uint32)).str())); + DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); return false; } if (!BN_mod_exp(&bnResult, &bn_g, &bnPower, &bnModul, ctx)) { ERR_load_crypto_strings(); LOG(("BigNum Error: BN_mod_exp failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(mb(&g_be, sizeof(uint32)).str()).arg(mb(power, 64 * sizeof(uint32)).str()).arg(mb(modul, 64 * sizeof(uint32)).str())); + DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); return false; } @@ -109,7 +109,7 @@ namespace { if (!BN_mod_exp(&bnResult, &bn_g_a, &bnPower, &bnModul, ctx)) { ERR_load_crypto_strings(); LOG(("BigNum Error: BN_mod_exp failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(mb(&g_be, sizeof(uint32)).str()).arg(mb(power, 64 * sizeof(uint32)).str()).arg(mb(modul, 64 * sizeof(uint32)).str())); + DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); return false; } @@ -123,7 +123,7 @@ namespace { DEBUG_LOG(("BigNum Error: bad g_aResult export len (%1)").arg(resultLen)); return false; } - + BN_add_word(&bn_g_a, 1); // check g_a < dh_prime - 1 if (BN_cmp(&bn_g_a, &bnModul) >= 0) { DEBUG_LOG(("BigNum Error: bad g_a >= dh_prime - 1")); @@ -169,7 +169,7 @@ namespace { ) { ERR_load_crypto_strings(); LOG(("BigNum PT Error: BN_bin2bn failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum PT Error: prime %1").arg(mb(pData, 64 * sizeof(uint32)).str())); + DEBUG_LOG(("BigNum PT Error: prime %1").arg(Logs::mb(pData, 64 * sizeof(uint32)).str())); return false; } @@ -412,12 +412,12 @@ namespace { } if (packet[0] != int32(size * sizeof(mtpPrime))) { LOG(("TCP Error: bad packet header")); - TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(mb(packet, size * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, size * sizeof(mtpPrime)).str())); return mtpBuffer(1, -500); } if (packet[size - 1] != hashCrc32(packet, (size - 1) * sizeof(mtpPrime))) { LOG(("TCP Error: bad packet checksum")); - TCP_LOG(("TCP Error: bad packet checksum, packet: %1").arg(mb(packet, size * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad packet checksum, packet: %1").arg(Logs::mb(packet, size * sizeof(mtpPrime)).str())); return mtpBuffer(1, -500); } TCP_LOG(("TCP Info: packet received, num = %1, size = %2").arg(packet[1]).arg(size * sizeof(mtpPrime))); @@ -500,18 +500,18 @@ namespace { uint32 len = buffer.size(); if (len < 5) { LOG(("Fake PQ Error: bad request answer, len = %1").arg(len * sizeof(mtpPrime))); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(mb(answer, len * sizeof(mtpPrime)).str())); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); throw Exception("bad pq reply"); } if (answer[0] != 0 || answer[1] != 0 || (((uint32)answer[2]) & 0x03) != 1/* || (unixtime() - answer[3] > 300) || (answer[3] - unixtime() > 60)*/) { // didnt sync time yet LOG(("Fake PQ Error: bad request answer start (%1 %2 %3)").arg(answer[0]).arg(answer[1]).arg(answer[2])); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(mb(answer, len * sizeof(mtpPrime)).str())); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); throw Exception("bad pq reply"); } uint32 answerLen = (uint32)answer[4]; if (answerLen != (len - 5) * sizeof(mtpPrime)) { LOG(("Fake PQ Error: bad request answer %1 <> %2").arg(answerLen).arg((len - 5) * sizeof(mtpPrime))); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(mb(answer, len * sizeof(mtpPrime)).str())); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); throw Exception("bad pq reply"); } const mtpPrime *from(answer + 5), *end(from + len - 5); @@ -692,7 +692,7 @@ void MTPautoConnection::sendData(mtpBuffer &buffer) { if (buffer.size() < 3) { LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad packet %1").arg(mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); emit error(); return; } @@ -979,7 +979,7 @@ void MTPtcpConnection::sendData(mtpBuffer &buffer) { if (buffer.size() < 3) { LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad packet %1").arg(mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); emit error(); return; } @@ -989,7 +989,7 @@ void MTPtcpConnection::sendData(mtpBuffer &buffer) { buffer[0] = len; buffer[1] = packetNum++; buffer[size - 1] = hashCrc32(&buffer[0], len - 4); - TCP_LOG(("TCP Info: write %1 packet %2 bytes %3").arg(packetNum).arg(len).arg(mb(&buffer[0], len).str())); + TCP_LOG(("TCP Info: write %1 packet %2 bytes %3").arg(packetNum).arg(len).arg(Logs::mb(&buffer[0], len).str())); sock.write((const char*)&buffer[0], len); } @@ -1068,18 +1068,18 @@ void MTPhttpConnection::sendData(mtpBuffer &buffer) { if (buffer.size() < 3) { LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad packet %1").arg(mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); emit error(); return; } - + int32 requestSize = (buffer.size() - 3) * sizeof(mtpPrime); QNetworkRequest request(address); request.setHeader(QNetworkRequest::ContentLengthHeader, QVariant(requestSize)); request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(qsl("application/x-www-form-urlencoded"))); - TCP_LOG(("HTTP Info: sending %1 len request %2").arg(requestSize).arg(mb(&buffer[2], requestSize).str())); + TCP_LOG(("HTTP Info: sending %1 len request %2").arg(requestSize).arg(Logs::mb(&buffer[2], requestSize).str())); requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); } @@ -1521,7 +1521,7 @@ mtpMsgId MTProtoConnectionPrivate::replaceMsgId(mtpRequest &request, mtpMsgId ne } mtpMsgId m = msgid(); if (m <= newId) break; // wtf - + newId = m; } @@ -1956,7 +1956,7 @@ void MTProtoConnectionPrivate::restart(bool mayBeBadKey) { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData) return; - DEBUG_LOG(("MTP Info: restarting MTProtoConnection, maybe bad key = %1").arg(logBool(mayBeBadKey))); + DEBUG_LOG(("MTP Info: restarting MTProtoConnection, maybe bad key = %1").arg(Logs::b(mayBeBadKey))); _waitForReceivedTimer.stop(); _waitForConnectedTimer.stop(); @@ -2083,7 +2083,7 @@ void MTProtoConnectionPrivate::onWaitConnectedFailed() { void MTProtoConnectionPrivate::onWaitIPv4Failed() { _conn = _conn6; destroyConn(&_conn4); - + if (_conn) { DEBUG_LOG(("MTP Info: can't connect through IPv4, using IPv6 connection.")); @@ -2144,14 +2144,14 @@ void MTProtoConnectionPrivate::handleReceived() { const mtpPrime *encrypted(encryptedBuf.data()); if (len < 18) { // 2 auth_key_id, 4 msg_key, 2 salt, 2 session, 2 msg_id, 1 seq_no, 1 length, (1 data + 3 padding) min LOG(("TCP Error: bad message received, len %1").arg(len * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad message %1").arg(mb(encrypted, len * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad message %1").arg(Logs::mb(encrypted, len * sizeof(mtpPrime)).str())); lockFinished.unlock(); return restart(); } if (keyId != *(uint64*)encrypted) { LOG(("TCP Error: bad auth_key_id %1 instead of %2 received").arg(keyId).arg(*(uint64*)encrypted)); - TCP_LOG(("TCP Error: bad message %1").arg(mb(encrypted, len * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad message %1").arg(Logs::mb(encrypted, len * sizeof(mtpPrime)).str())); lockFinished.unlock(); return restart(); @@ -2161,7 +2161,7 @@ void MTProtoConnectionPrivate::handleReceived() { mtpPrime *data((mtpPrime*)dataBuffer.data()), *msg = data + 8; const mtpPrime *from(msg), *end; MTPint128 msgKey(*(MTPint128*)(encrypted + 2)); - + aesDecrypt(encrypted + 6, data, dataBuffer.size(), key, msgKey); uint64 serverSalt = *(uint64*)&data[0], session = *(uint64*)&data[2], msgId = *(uint64*)&data[4]; @@ -2170,7 +2170,7 @@ void MTProtoConnectionPrivate::handleReceived() { if (uint32(dataBuffer.size()) < msgLen + 8 * sizeof(mtpPrime) || (msgLen & 0x03)) { LOG(("TCP Error: bad msg_len received %1, data size: %2").arg(msgLen).arg(dataBuffer.size())); - TCP_LOG(("TCP Error: bad message %1").arg(mb(encrypted, len * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad message %1").arg(Logs::mb(encrypted, len * sizeof(mtpPrime)).str())); _conn->received().pop_front(); lockFinished.unlock(); @@ -2179,13 +2179,13 @@ void MTProtoConnectionPrivate::handleReceived() { uchar sha1Buffer[20]; if (memcmp(&msgKey, hashSha1(data, msgLen + 8 * sizeof(mtpPrime), sha1Buffer) + 1, sizeof(msgKey))) { LOG(("TCP Error: bad SHA1 hash after aesDecrypt in message")); - TCP_LOG(("TCP Error: bad message %1").arg(mb(encrypted, len * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad message %1").arg(Logs::mb(encrypted, len * sizeof(mtpPrime)).str())); _conn->received().pop_front(); lockFinished.unlock(); return restart(); } - TCP_LOG(("TCP Info: decrypted message %1,%2,%3 is %4 len").arg(msgId).arg(seqNo).arg(logBool(needAck)).arg(msgLen + 8 * sizeof(mtpPrime))); + TCP_LOG(("TCP Info: decrypted message %1,%2,%3 is %4 len").arg(msgId).arg(seqNo).arg(Logs::b(needAck)).arg(msgLen + 8 * sizeof(mtpPrime))); uint64 serverSession = sessionData->getSession(); if (session != serverSession) { @@ -2261,7 +2261,7 @@ void MTProtoConnectionPrivate::handleReceived() { // send acks uint32 toAckSize = ackRequestData.size(); if (toAckSize) { - DEBUG_LOG(("MTP Info: will send %1 acks, ids: %2").arg(toAckSize).arg(logVectorLong(ackRequestData))); + DEBUG_LOG(("MTP Info: will send %1 acks, ids: %2").arg(toAckSize).arg(Logs::vector(ackRequestData))); emit sendAnythingAsync(MTPAckSendWaiting); } @@ -2273,7 +2273,7 @@ void MTProtoConnectionPrivate::handleReceived() { DEBUG_LOG(("MTP Info: emitting needToReceive() - need to parse in another thread, haveReceivedMap.size() = %1").arg(sessionData->haveReceivedMap().size())); } } - + if (emitSignal) { emit needToReceive(); } @@ -2344,7 +2344,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt bool needAck = (inSeqNo.v & 0x01); if (needAck) ackRequestData.push_back(inMsgId); - DEBUG_LOG(("Message Info: message from container, msg_id: %1, needAck: %2").arg(inMsgId.v).arg(logBool(needAck))); + DEBUG_LOG(("Message Info: message from container, msg_id: %1, needAck: %2").arg(inMsgId.v).arg(Logs::b(needAck))); otherEnd = from + (bytes.v >> 2); if (otherEnd > end) throw mtpErrorInsufficient(); @@ -2373,7 +2373,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt const QVector &ids(msg.c_msgs_ack().vmsg_ids.c_vector().v); uint32 idsCount = ids.size(); - DEBUG_LOG(("Message Info: acks received, ids: %1").arg(logVectorLong(ids))); + DEBUG_LOG(("Message Info: acks received, ids: %1").arg(Logs::vector(ids))); if (!idsCount) return (badTime ? 0 : 1); if (badTime) { @@ -2500,7 +2500,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt MTPMsgsStateReq msg(from, end); const QVector ids(msg.c_msgs_state_req().vmsg_ids.c_vector().v); uint32 idsCount = ids.size(); - DEBUG_LOG(("Message Info: msgs_state_req received, ids: %1").arg(logVectorLong(ids))); + DEBUG_LOG(("Message Info: msgs_state_req received, ids: %1").arg(Logs::vector(ids))); if (!idsCount) return 1; QByteArray info(idsCount, Qt::Uninitialized); @@ -2546,11 +2546,11 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt case mtpc_msgs_state_info: { MTPMsgsStateInfo msg(from, end); const MTPDmsgs_state_info &data(msg.c_msgs_state_info()); - + uint64 reqMsgId = data.vreq_msg_id.v; const string &states(data.vinfo.c_string().v); - DEBUG_LOG(("Message Info: msg state received, msgId %1, reqMsgId: %2, HEX states %3").arg(msgId).arg(reqMsgId).arg(mb(states.data(), states.length()).str())); + DEBUG_LOG(("Message Info: msg state received, msgId %1, reqMsgId: %2, HEX states %3").arg(msgId).arg(reqMsgId).arg(Logs::mb(states.data(), states.length()).str())); mtpRequest requestBuffer; { // find this request in session-shared sent requests map QReadLocker locker(sessionData->haveSentMutex()); @@ -2607,7 +2607,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt QVector toAck; - DEBUG_LOG(("Message Info: msgs all info received, msgId %1, reqMsgIds: %2, states %3").arg(msgId).arg(logVectorLong(ids)).arg(mb(states.data(), states.length()).str())); + DEBUG_LOG(("Message Info: msgs all info received, msgId %1, reqMsgIds: %2, states %3").arg(msgId).arg(Logs::vector(ids)).arg(Logs::mb(states.data(), states.length()).str())); handleMsgsStates(ids, states, toAck); requestsAcked(toAck); @@ -2669,13 +2669,13 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt resendRequestData.push_back(resMsgId); } } return 1; - + case mtpc_msg_resend_req: { MTPMsgResendReq msg(from, end); const QVector &ids(msg.c_msg_resend_req().vmsg_ids.c_vector().v); uint32 idsCount = ids.size(); - DEBUG_LOG(("Message Info: resend of msgs requested, ids: %1").arg(logVectorLong(ids))); + DEBUG_LOG(("Message Info: resend of msgs requested, ids: %1").arg(Logs::vector(ids))); if (!idsCount) return (badTime ? 0 : 1); QVector toResend(ids.size(), Qt::Uninitialized); @@ -2762,7 +2762,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt mtpBuffer update(from - start); if (from > start) memcpy(update.data(), start, (from - start) * sizeof(mtpPrime)); - + QWriteLocker locker(sessionData->haveReceivedMutex()); mtpResponseMap &haveReceived(sessionData->haveReceivedMap()); mtpRequestId fakeRequestId = sessionData->nextFakeRequestId(); @@ -2782,7 +2782,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt MTPPong msg(from, end); const MTPDpong &data(msg.c_pong()); DEBUG_LOG(("Message Info: pong received, msg_id: %1, ping_id: %2").arg(data.vmsg_id.v).arg(data.vping_id.v)); - + if (!wasSent(data.vmsg_id.v)) { DEBUG_LOG(("Message Error: such msg_id %1 ping_id %2 was not sent recently").arg(data.vmsg_id.v).arg(data.vping_id.v)); return 0; @@ -2817,7 +2817,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt mtpBuffer update(end - from); if (end > from) memcpy(update.data(), from, (end - from) * sizeof(mtpPrime)); - + QWriteLocker locker(sessionData->haveReceivedMutex()); mtpResponseMap &haveReceived(sessionData->haveReceivedMap()); mtpRequestId fakeRequestId = sessionData->nextFakeRequestId(); @@ -2859,14 +2859,14 @@ mtpBuffer MTProtoConnectionPrivate::ungzip(const mtpPrime *from, const mtpPrime if (res != Z_OK && res != Z_STREAM_END) { inflateEnd(&stream); LOG(("RPC Error: could not unpack gziped data, code: %1").arg(res)); - DEBUG_LOG(("RPC Error: bad gzip: %1").arg(mb(&packed.c_string().v[0], packedLen).str())); + DEBUG_LOG(("RPC Error: bad gzip: %1").arg(Logs::mb(&packed.c_string().v[0], packedLen).str())); return mtpBuffer(); } } if (stream.avail_out & 0x03) { uint32 badSize = result.size() * sizeof(mtpPrime) - stream.avail_out; LOG(("RPC Error: bad length of unpacked data %1").arg(badSize)); - DEBUG_LOG(("RPC Error: bad unpacked data %1").arg(mb(result.data(), badSize).str())); + DEBUG_LOG(("RPC Error: bad unpacked data %1").arg(Logs::mb(result.data(), badSize).str())); return mtpBuffer(); } result.resize(result.size() - (stream.avail_out >> 2)); @@ -2893,7 +2893,7 @@ bool MTProtoConnectionPrivate::requestsFixTimeSalt(const QVector &ids, void MTProtoConnectionPrivate::requestsAcked(const QVector &ids, bool byResponse) { uint32 idsCount = ids.size(); - DEBUG_LOG(("Message Info: requests acked, ids %1").arg(logVectorLong(ids))); + DEBUG_LOG(("Message Info: requests acked, ids %1").arg(Logs::vector(ids))); RPCCallbackClears clearedAcked; QVector toAckMore; @@ -2995,7 +2995,7 @@ void MTProtoConnectionPrivate::handleMsgsStates(const QVector &ids, con DEBUG_LOG(("Message Info: void ids vector in handleMsgsStates()")); return; } - + acked.reserve(acked.size() + idsCount); for (uint32 i = 0, count = idsCount; i < count; ++i) { @@ -3137,7 +3137,7 @@ void MTProtoConnectionPrivate::updateAuthKey() { clearMessages(); keyId = newKeyId; } - DEBUG_LOG(("AuthKey Info: MTProtoConnection update key from MTProtoSession, dc %1 result: %2").arg(dc).arg(mb(&keyId, sizeof(keyId)).str())); + DEBUG_LOG(("AuthKey Info: MTProtoConnection update key from MTProtoSession, dc %1 result: %2").arg(dc).arg(Logs::mb(&keyId, sizeof(keyId)).str())); if (keyId) { return authKeyCreated(); } @@ -3186,7 +3186,7 @@ void MTProtoConnectionPrivate::pqAnswered() { const MTPDresPQ &res_pq_data(res_pq.c_resPQ()); if (res_pq_data.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in res_pq)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&res_pq_data.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&res_pq_data.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); return restart(); } @@ -3225,7 +3225,7 @@ void MTProtoConnectionPrivate::pqAnswered() { if (!parsePQ(pq, p, q)) { LOG(("AuthKey Error: could not factor pq!")); - DEBUG_LOG(("AuthKey Error: problematic pq: %1").arg(mb(&pq[0], pq.length()).str())); + DEBUG_LOG(("AuthKey Error: problematic pq: %1").arg(Logs::mb(&pq[0], pq.length()).str())); return restart(); } @@ -3247,7 +3247,7 @@ void MTProtoConnectionPrivate::pqAnswered() { tmp.reserve(encSize); p_q_inner.write(tmp); LOG(("AuthKey Error: too large data for RSA encrypt, size %1").arg(encSize * sizeof(mtpPrime))); - DEBUG_LOG(("AuthKey Error: bad data for RSA encrypt %1").arg(mb(&tmp[0], tmp.size() * 4).str())); + DEBUG_LOG(("AuthKey Error: bad data for RSA encrypt %1").arg(Logs::mb(&tmp[0], tmp.size() * 4).str())); return restart(); // can't be 255-byte string } @@ -3291,12 +3291,12 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { const MTPDserver_DH_params_ok &encDH(res_DH_params.c_server_DH_params_ok()); if (encDH.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in server_DH_params_ok)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&encDH.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&encDH.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); return restart(); } if (encDH.vserver_nonce != authKeyData->server_nonce) { LOG(("AuthKey Error: received server_nonce <> sent server_nonce (in server_DH_params_ok)!")); - DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(mb(&encDH.vserver_nonce, 16).str()).arg(mb(&authKeyData->server_nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(Logs::mb(&encDH.vserver_nonce, 16).str()).arg(Logs::mb(&authKeyData->server_nonce, 16).str())); return restart(); } @@ -3304,7 +3304,7 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { uint32 encDHLen = encDHStr.length(), encDHBufLen = encDHLen >> 2; if ((encDHLen & 0x03) || encDHBufLen < 6) { LOG(("AuthKey Error: bad encrypted data length %1 (in server_DH_params_ok)!").arg(encDHLen)); - DEBUG_LOG(("AuthKey Error: received encrypted data %1").arg(mb(&encDHStr[0], encDHLen).str())); + DEBUG_LOG(("AuthKey Error: received encrypted data %1").arg(Logs::mb(&encDHStr[0], encDHLen).str())); return restart(); } @@ -3334,18 +3334,18 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { const MTPDserver_DH_inner_data &dh_inner_data(dh_inner.c_server_DH_inner_data()); if (dh_inner_data.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in server_DH_inner_data)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&dh_inner_data.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&dh_inner_data.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); return restart(); } if (dh_inner_data.vserver_nonce != authKeyData->server_nonce) { LOG(("AuthKey Error: received server_nonce <> sent server_nonce (in server_DH_inner_data)!")); - DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(mb(&dh_inner_data.vserver_nonce, 16).str()).arg(mb(&authKeyData->server_nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(Logs::mb(&dh_inner_data.vserver_nonce, 16).str()).arg(Logs::mb(&authKeyData->server_nonce, 16).str())); return restart(); } uchar sha1Buffer[20]; if (memcmp(&decBuffer[0], hashSha1(&decBuffer[5], (to - from) * sizeof(mtpPrime), sha1Buffer), 20)) { LOG(("AuthKey Error: sha1 hash of encrypted part did not match!")); - DEBUG_LOG(("AuthKey Error: sha1 did not match, server_nonce: %1, new_nonce %2, encrypted data %3").arg(mb(&authKeyData->server_nonce, 16).str()).arg(mb(&authKeyData->new_nonce, 16).str()).arg(mb(&encDHStr[0], encDHLen).str())); + DEBUG_LOG(("AuthKey Error: sha1 did not match, server_nonce: %1, new_nonce %2, encrypted data %3").arg(Logs::mb(&authKeyData->server_nonce, 16).str()).arg(Logs::mb(&authKeyData->new_nonce, 16).str()).arg(Logs::mb(&encDHStr[0], encDHLen).str())); return restart(); } unixtimeSet(dh_inner_data.vserver_time.v); @@ -3353,15 +3353,15 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { const string &dhPrime(dh_inner_data.vdh_prime.c_string().v), &g_a(dh_inner_data.vg_a.c_string().v); if (dhPrime.length() != 256 || g_a.length() != 256) { LOG(("AuthKey Error: bad dh_prime len (%1) or g_a len (%2)").arg(dhPrime.length()).arg(g_a.length())); - DEBUG_LOG(("AuthKey Error: dh_prime %1, g_a %2").arg(mb(&dhPrime[0], dhPrime.length()).str()).arg(mb(&g_a[0], g_a.length()).str())); + DEBUG_LOG(("AuthKey Error: dh_prime %1, g_a %2").arg(Logs::mb(&dhPrime[0], dhPrime.length()).str()).arg(Logs::mb(&g_a[0], g_a.length()).str())); return restart(); } - + // check that dhPrime and (dhPrime - 1) / 2 are really prime using openssl BIGNUM methods _BigNumPrimeTest bnPrimeTest; if (!bnPrimeTest.isPrimeAndGood(&dhPrime[0], MTPMillerRabinIterCount, dh_inner_data.vg.v)) { LOG(("AuthKey Error: bad dh_prime primality!").arg(dhPrime.length()).arg(g_a.length())); - DEBUG_LOG(("AuthKey Error: dh_prime %1").arg(mb(&dhPrime[0], dhPrime.length()).str())); + DEBUG_LOG(("AuthKey Error: dh_prime %1").arg(Logs::mb(&dhPrime[0], dhPrime.length()).str())); return restart(); } @@ -3376,18 +3376,18 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { const MTPDserver_DH_params_fail &encDH(res_DH_params.c_server_DH_params_fail()); if (encDH.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in server_DH_params_fail)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&encDH.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&encDH.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); return restart(); } if (encDH.vserver_nonce != authKeyData->server_nonce) { LOG(("AuthKey Error: received server_nonce <> sent server_nonce (in server_DH_params_fail)!")); - DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(mb(&encDH.vserver_nonce, 16).str()).arg(mb(&authKeyData->server_nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(Logs::mb(&encDH.vserver_nonce, 16).str()).arg(Logs::mb(&authKeyData->server_nonce, 16).str())); return restart(); } uchar sha1Buffer[20]; if (encDH.vnew_nonce_hash != *(MTPint128*)(hashSha1(&authKeyData->new_nonce, 32, sha1Buffer) + 1)) { LOG(("AuthKey Error: received new_nonce_hash did not match!")); - DEBUG_LOG(("AuthKey Error: received new_nonce_hash: %1, new_nonce: %2").arg(mb(&encDH.vnew_nonce_hash, 16).str()).arg(mb(&authKeyData->new_nonce, 32).str())); + DEBUG_LOG(("AuthKey Error: received new_nonce_hash: %1, new_nonce: %2").arg(Logs::mb(&encDH.vnew_nonce_hash, 16).str()).arg(Logs::mb(&authKeyData->new_nonce, 32).str())); return restart(); } LOG(("AuthKey Error: server_DH_params_fail received!")); @@ -3430,7 +3430,7 @@ void MTProtoConnectionPrivate::dhClientParamsSend() { MTPSet_client_DH_params req_client_DH_params; req_client_DH_params.vnonce = authKeyData->nonce; req_client_DH_params.vserver_nonce = authKeyData->server_nonce; - + string &sdhEncString(req_client_DH_params.vencrypted_data._string().v); uint32 client_dh_inner_size = client_dh_inner.innerLength(), encSize = (client_dh_inner_size >> 2) + 5, encFullSize = encSize; @@ -3477,14 +3477,14 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { const MTPDdh_gen_ok &resDH(res_client_DH_params.c_dh_gen_ok()); if (resDH.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in dh_gen_ok)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&resDH.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&resDH.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); lockFinished.unlock(); return restart(); } if (resDH.vserver_nonce != authKeyData->server_nonce) { LOG(("AuthKey Error: received server_nonce <> sent server_nonce (in dh_gen_ok)!")); - DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(mb(&resDH.vserver_nonce, 16).str()).arg(mb(&authKeyData->server_nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(Logs::mb(&resDH.vserver_nonce, 16).str()).arg(Logs::mb(&authKeyData->server_nonce, 16).str())); lockFinished.unlock(); return restart(); @@ -3493,7 +3493,7 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { uchar sha1Buffer[20]; if (resDH.vnew_nonce_hash1 != *(MTPint128*)(hashSha1(authKeyData->new_nonce_buf, 41, sha1Buffer) + 1)) { LOG(("AuthKey Error: received new_nonce_hash1 did not match!")); - DEBUG_LOG(("AuthKey Error: received new_nonce_hash1: %1, new_nonce_buf: %2").arg(mb(&resDH.vnew_nonce_hash1, 16).str()).arg(mb(authKeyData->new_nonce_buf, 41).str())); + DEBUG_LOG(("AuthKey Error: received new_nonce_hash1: %1, new_nonce_buf: %2").arg(Logs::mb(&resDH.vnew_nonce_hash1, 16).str()).arg(Logs::mb(authKeyData->new_nonce_buf, 41).str())); lockFinished.unlock(); return restart(); @@ -3506,7 +3506,7 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { authKey->setKey(authKeyData->auth_key); authKey->setDC(dc % _mtp_internal::dcShift); - DEBUG_LOG(("AuthKey Info: auth key gen succeed, id: %1, server salt: %2, auth key: %3").arg(authKey->keyId()).arg(serverSalt).arg(mb(authKeyData->auth_key, 256).str())); + DEBUG_LOG(("AuthKey Info: auth key gen succeed, id: %1, server salt: %2, auth key: %3").arg(authKey->keyId()).arg(serverSalt).arg(Logs::mb(authKeyData->auth_key, 256).str())); sessionData->owner()->notifyKeyCreated(authKey); // slot will call authKeyCreated() sessionData->clear(); @@ -3517,14 +3517,14 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { const MTPDdh_gen_retry &resDH(res_client_DH_params.c_dh_gen_retry()); if (resDH.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in dh_gen_retry)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&resDH.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&resDH.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); lockFinished.unlock(); return restart(); } if (resDH.vserver_nonce != authKeyData->server_nonce) { LOG(("AuthKey Error: received server_nonce <> sent server_nonce (in dh_gen_retry)!")); - DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(mb(&resDH.vserver_nonce, 16).str()).arg(mb(&authKeyData->server_nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(Logs::mb(&resDH.vserver_nonce, 16).str()).arg(Logs::mb(&authKeyData->server_nonce, 16).str())); lockFinished.unlock(); return restart(); @@ -3533,7 +3533,7 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { uchar sha1Buffer[20]; if (resDH.vnew_nonce_hash2 != *(MTPint128*)(hashSha1(authKeyData->new_nonce_buf, 41, sha1Buffer) + 1)) { LOG(("AuthKey Error: received new_nonce_hash2 did not match!")); - DEBUG_LOG(("AuthKey Error: received new_nonce_hash2: %1, new_nonce_buf: %2").arg(mb(&resDH.vnew_nonce_hash2, 16).str()).arg(mb(authKeyData->new_nonce_buf, 41).str())); + DEBUG_LOG(("AuthKey Error: received new_nonce_hash2: %1, new_nonce_buf: %2").arg(Logs::mb(&resDH.vnew_nonce_hash2, 16).str()).arg(Logs::mb(authKeyData->new_nonce_buf, 41).str())); lockFinished.unlock(); return restart(); @@ -3545,14 +3545,14 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { const MTPDdh_gen_fail &resDH(res_client_DH_params.c_dh_gen_fail()); if (resDH.vnonce != authKeyData->nonce) { LOG(("AuthKey Error: received nonce <> sent nonce (in dh_gen_fail)!")); - DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(mb(&resDH.vnonce, 16).str()).arg(mb(&authKeyData->nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received nonce: %1, sent nonce: %2").arg(Logs::mb(&resDH.vnonce, 16).str()).arg(Logs::mb(&authKeyData->nonce, 16).str())); lockFinished.unlock(); return restart(); } if (resDH.vserver_nonce != authKeyData->server_nonce) { LOG(("AuthKey Error: received server_nonce <> sent server_nonce (in dh_gen_fail)!")); - DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(mb(&resDH.vserver_nonce, 16).str()).arg(mb(&authKeyData->server_nonce, 16).str())); + DEBUG_LOG(("AuthKey Error: received server_nonce: %1, sent server_nonce: %2").arg(Logs::mb(&resDH.vserver_nonce, 16).str()).arg(Logs::mb(&authKeyData->server_nonce, 16).str())); lockFinished.unlock(); return restart(); @@ -3561,7 +3561,7 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { uchar sha1Buffer[20]; if (resDH.vnew_nonce_hash3 != *(MTPint128*)(hashSha1(authKeyData->new_nonce_buf, 41, sha1Buffer) + 1)) { LOG(("AuthKey Error: received new_nonce_hash3 did not match!")); - DEBUG_LOG(("AuthKey Error: received new_nonce_hash3: %1, new_nonce_buf: %2").arg(mb(&resDH.vnew_nonce_hash3, 16).str()).arg(mb(authKeyData->new_nonce_buf, 41).str())); + DEBUG_LOG(("AuthKey Error: received new_nonce_hash3: %1, new_nonce_buf: %2").arg(Logs::mb(&resDH.vnew_nonce_hash3, 16).str()).arg(Logs::mb(authKeyData->new_nonce_buf, 41).str())); lockFinished.unlock(); return restart(); @@ -3622,7 +3622,7 @@ void MTProtoConnectionPrivate::onError4(bool mayBeBadKey) { destroyConn(); _waitForConnectedTimer.stop(); - MTP_LOG(dc, ("Restarting after error in IPv4 connection, maybe bad key: %1..").arg(logBool(mayBeBadKey))); + MTP_LOG(dc, ("Restarting after error in IPv4 connection, maybe bad key: %1..").arg(Logs::b(mayBeBadKey))); return restart(mayBeBadKey); } else { destroyConn(&_conn4); @@ -3636,7 +3636,7 @@ void MTProtoConnectionPrivate::onError6(bool mayBeBadKey) { destroyConn(); _waitForConnectedTimer.stop(); - MTP_LOG(dc, ("Restarting after error in IPv6 connection, maybe bad key: %1..").arg(logBool(mayBeBadKey))); + MTP_LOG(dc, ("Restarting after error in IPv6 connection, maybe bad key: %1..").arg(Logs::b(mayBeBadKey))); return restart(mayBeBadKey); } else { destroyConn(&_conn6); @@ -3692,18 +3692,18 @@ bool MTProtoConnectionPrivate::readResponseNotSecure(TResponse &response) { uint32 len = buffer.size(); if (len < 5) { LOG(("AuthKey Error: bad request answer, len = %1").arg(len * sizeof(mtpPrime))); - DEBUG_LOG(("AuthKey Error: answer bytes %1").arg(mb(answer, len * sizeof(mtpPrime)).str())); + DEBUG_LOG(("AuthKey Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); return false; } if (answer[0] != 0 || answer[1] != 0 || (((uint32)answer[2]) & 0x03) != 1/* || (unixtime() - answer[3] > 300) || (answer[3] - unixtime() > 60)*/) { // didnt sync time yet LOG(("AuthKey Error: bad request answer start (%1 %2 %3)").arg(answer[0]).arg(answer[1]).arg(answer[2])); - DEBUG_LOG(("AuthKey Error: answer bytes %1").arg(mb(answer, len * sizeof(mtpPrime)).str())); + DEBUG_LOG(("AuthKey Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); return false; } uint32 answerLen = (uint32)answer[4]; if (answerLen != (len - 5) * sizeof(mtpPrime)) { LOG(("AuthKey Error: bad request answer %1 <> %2").arg(answerLen).arg((len - 5) * sizeof(mtpPrime))); - DEBUG_LOG(("AuthKey Error: answer bytes %1").arg(mb(answer, len * sizeof(mtpPrime)).str())); + DEBUG_LOG(("AuthKey Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); return false; } const mtpPrime *from(answer + 5), *end(from + len - 5); @@ -3720,7 +3720,7 @@ bool MTProtoConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResp uint32 messageSize = mtpRequestData::messageSize(request); if (messageSize < 5 || fullSize < messageSize + 4) return false; - + ReadLockerAttempt lock(sessionData->keyMutex()); if (!lock) { DEBUG_LOG(("MTP Info: could not lock key for read in sendBuffer(), dc %1, restarting..").arg(dc)); @@ -3758,7 +3758,7 @@ bool MTProtoConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResp *((MTPint128*)&result[4]) = msgKey; aesEncrypt(request->constData(), &result[8], fullSize * sizeof(mtpPrime), key, msgKey); - + DEBUG_LOG(("MTP Info: sending request, size: %1, num: %2, time: %3").arg(fullSize + 6).arg((*request)[4]).arg((*request)[5])); _conn->setSentEncrypted(); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp index b1d00fb1ea..dd0a82ae4e 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp @@ -23,8 +23,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "lang.h" -#if defined _DEBUG || defined _WITH_DEBUG - QString mtpWrapNumber(float64 number) { return QString::number(number); } @@ -63,9 +61,9 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP if (str.toUtf8() == strUtf8) { to.add("\"").add(str.replace('\\', "\\\\").replace('"', "\\\"").replace('\n', "\\n")).add("\" [STRING]"); } else if (strUtf8.size() < 64) { - to.add(mb(strUtf8.constData(), strUtf8.size()).str()).add(" [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); + to.add(Logs::mb(strUtf8.constData(), strUtf8.size()).str()).add(" [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); } else { - to.add(mb(strUtf8.constData(), 16).str()).add(".. [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); + to.add(Logs::mb(strUtf8.constData(), 16).str()).add(".. [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); } } break; @@ -151,8 +149,6 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP } } -#endif - QString stickerSetTitle(const MTPDstickerSet &s) { QString title = qs(s.vtitle); if ((s.vflags.v & MTPDstickerSet::flag_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) { diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index d0ed98c4db..abdb10eb29 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -162,7 +162,7 @@ typedef QMap mtpPreRequestMap; typedef QMap mtpRequestMap; typedef QMap mtpMsgIdsSet; class mtpMsgIdsMap : public QMap { -public: +public: typedef QMap ParentType; bool insert(const mtpMsgId &k, bool v) { @@ -595,7 +595,7 @@ inline bool operator!=(const MTPint256 &a, const MTPint256 &b) { class MTPdouble { public: float64 v; - + MTPdouble() { } MTPdouble(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_double) { @@ -702,7 +702,7 @@ public: from += ((l + 1) >> 2) + (((l + 1) & 0x03) ? 1 : 0); } if (from > end) throw mtpErrorInsufficient(); - + if (!data) setData(new MTPDstring()); MTPDstring &v(_string()); v.v.resize(l); @@ -895,7 +895,6 @@ inline bool operator!=(const MTPvector &a, const MTPvector &b) { } // Human-readable text serialization -#if (defined _DEBUG || defined _WITH_DEBUG) template QString mtpWrapNumber(Type number, int32 base = 10) { @@ -965,8 +964,6 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end) { return QString::fromUtf8(to.p, to.size); } -#endif - #include "mtpScheme.h" inline MTPbool MTP_bool(bool v) { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 6693765ba6..aa213c7eda 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -22,8 +22,6 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "stdafx.h" #include "mtpScheme.h" -#if (defined _DEBUG || defined _WITH_DEBUG) - typedef QVector Types; typedef QVector StagesFlags; @@ -8266,4 +8264,3 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } } -#endif diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index bb52437c28..09450332c4 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -31439,8 +31439,4 @@ inline MTPmessages_botResults MTP_messages_botResults(MTPint _flags, const MTPlo } // Human-readable text serialization -#if (defined _DEBUG || defined _WITH_DEBUG) - void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons); - -#endif diff --git a/Telegram/SourceFiles/mtproto/mtpSession.cpp b/Telegram/SourceFiles/mtproto/mtpSession.cpp index ddb3a8db8b..ee49811a8c 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.cpp +++ b/Telegram/SourceFiles/mtproto/mtpSession.cpp @@ -86,7 +86,7 @@ void MTProtoSession::start(int32 dcenter) { DEBUG_LOG(("Session Info: MTProtoSession::start called on already started session")); return; } - + msSendCall = msWait = 0; connect(&timeouter, SIGNAL(timeout()), this, SLOT(checkRequestsByTimer())); @@ -265,7 +265,7 @@ void MTProtoSession::checkRequestsByTimer() { } if (stateRequestIds.size()) { - DEBUG_LOG(("MTP Info: requesting state of msgs: %1").arg(logVectorLong(stateRequestIds))); + DEBUG_LOG(("MTP Info: requesting state of msgs: %1").arg(Logs::vector(stateRequestIds))); { QWriteLocker locker(data.stateRequestMutex()); for (uint32 i = 0, l = stateRequestIds.size(); i < l; ++i) { @@ -398,7 +398,7 @@ mtpRequestId MTProtoSession::resend(quint64 msgId, quint64 msCanWait, bool force if (sendMsgStateInfo) { char cantResend[2] = {1, 0}; DEBUG_LOG(("Message Info: cant resend %1, request not found").arg(msgId)); - + return send(MTP_msgs_state_info(MTP_long(msgId), MTP_string(string(cantResend, cantResend + 1)))); } return 0; @@ -485,7 +485,7 @@ void MTProtoSession::layerWasInitedForDC(bool wasInited) { } void MTProtoSession::notifyLayerInited(bool wasInited) { - DEBUG_LOG(("MTP Info: emitting MTProtoDC::layerWasInited(%1), dcWithShift %2").arg(logBool(wasInited)).arg(dcWithShift)); + DEBUG_LOG(("MTP Info: emitting MTProtoDC::layerWasInited(%1), dcWithShift %2").arg(Logs::b(wasInited)).arg(dcWithShift)); dc->setConnectionInited(wasInited); emit dc->layerWasInited(wasInited); } diff --git a/Telegram/SourceFiles/pspecific.h b/Telegram/SourceFiles/pspecific.h index 47927ca8e5..0b1442ad63 100644 --- a/Telegram/SourceFiles/pspecific.h +++ b/Telegram/SourceFiles/pspecific.h @@ -35,3 +35,12 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #ifdef Q_OS_WIN #include "pspecific_wnd.h" #endif + +namespace PlatformSpecific { + + struct Initializer { + Initializer(); + ~Initializer(); + }; + +} diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 35e208f8ab..5696398934 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -197,8 +197,6 @@ namespace { typedef UnityLauncherEntry* (*f_unity_launcher_entry_get_for_desktop_id)(const gchar* desktop_id); f_unity_launcher_entry_get_for_desktop_id ps_unity_launcher_entry_get_for_desktop_id = 0; - QStringList _initLogs; - template bool loadFunction(QLibrary &lib, const char *name, TFunction &func) { if (!lib.isLoaded()) return false; @@ -207,7 +205,7 @@ namespace { if (func) { return true; } else { - _initLogs.push_back(QString("Init Error: Failed to load '%1' function!").arg(name)); + LOG(("Error: failed to load '%1' function!").arg(name)); return false; } } @@ -362,26 +360,24 @@ namespace { if (noQtTrayIcon) cSetSupportTray(false); - std::cout << "libs init..\n"; + DEBUG_LOG(("Loading libraries")); setupGtk(); setupUnity(); } bool loadLibrary(QLibrary &lib, const char *name, int version) { - std::cout << "loading " << name << " with version " << version << "..\n"; + DEBUG_LOG(("Loading '%1' with version %2..").arg(QLatin1String(name)).arg(version)); lib.setFileNameAndVersion(QLatin1String(name), version); if (lib.load()) { - std::cout << "loaded " << name << " with version " << version << "!\n"; - _initLogs.push_back(QString("Loaded '%1' version %2 library").arg(name).arg(version)); + DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); return true; - } + } lib.setFileNameAndVersion(QLatin1String(name), QString()); if (lib.load()) { - std::cout << "loaded " << name << " without version!\n"; - _initLogs.push_back(QString("Loaded '%1' without version library").arg(name)); + DEBUG_LOG(("Loaded '%1' without version!").arg(QLatin1String(name))); return true; - } - std::cout << "could not load " << name << " without version.\n"; + } + LOG(("Could not load '%1' with version %2 :(").arg(QLatin1String(name)).arg(version)); return false; } @@ -406,7 +402,7 @@ namespace { if (!loadFunction(lib_gtk, "g_object_unref", ps_g_object_unref)) return; useGtkBase = true; - std::cout << "loaded gtk funcs!\n"; + DEBUG_LOG(("Library gtk functions loaded!")); } void setupAppIndicator(QLibrary &lib_indicator) { @@ -415,7 +411,7 @@ namespace { if (!loadFunction(lib_indicator, "app_indicator_set_menu", ps_app_indicator_set_menu)) return; if (!loadFunction(lib_indicator, "app_indicator_set_icon_full", ps_app_indicator_set_icon_full)) return; useAppIndicator = true; - std::cout << "loaded appindicator funcs!\n"; + DEBUG_LOG(("Library appindicator functions loaded!")); } void setupGtk() { @@ -461,13 +457,12 @@ namespace { } if (!useGtkBase && lib_gtk.isLoaded()) { - std::cout << "no appindicator, trying to load gtk..\n"; + LOG(("Could not load appindicator, trying to load gtk..")); setupGtkBase(lib_gtk); } if (!useGtkBase) { useAppIndicator = false; - _initLogs.push_back(QString("Init Error: Failed to load 'gtk-x11-2.0' library!")); - std::cout << "no appindicator :(\n"; + LOG(("Could not load gtk-x11-2.0!")); return; } @@ -485,8 +480,8 @@ namespace { if (!loadFunction(lib_gtk, "gtk_get_current_event_time", ps_gtk_get_current_event_time)) return; if (!loadFunction(lib_gtk, "g_idle_add", ps_g_idle_add)) return; useStatusIcon = true; - std::cout << "status icon api loaded\n"; - } + DEBUG_LOG(("Status icon api loaded!")); + } void setupUnity() { if (noTryUnity) return; @@ -498,7 +493,7 @@ namespace { if (!loadFunction(lib_unity, "unity_launcher_entry_set_count", ps_unity_launcher_entry_set_count)) return; if (!loadFunction(lib_unity, "unity_launcher_entry_set_count_visible", ps_unity_launcher_entry_set_count_visible)) return; useUnityCount = true; - std::cout << "unity count api loaded\n"; + DEBUG_LOG(("Unity count api loaded!")); } }; @@ -508,7 +503,7 @@ namespace { } bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) { - Window *wnd = Application::wnd(); + Window *wnd = App::wnd(); if (!wnd) return false; return false; @@ -889,7 +884,7 @@ void PsMainWindow::psFirstShow() { setWindowState(Qt::WindowMaximized); } - if ((cFromAutoStart() && cStartMinimized()) || cStartInTray()) { + if ((cLaunchMode() == LaunchModeAutoStart && cStartMinimized()) || cStartInTray()) { setWindowState(Qt::WindowMinimized); if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { hide(); @@ -972,20 +967,10 @@ void PsMainWindow::psNotifyShown(NotifyWindow *w) { void PsMainWindow::psPlatformNotify(HistoryItem *item, int32 fwdCount) { } -PsApplication::PsApplication(int &argc, char **argv) : QApplication(argc, argv) { - _PsInitializer _psInitializer; - Q_UNUSED(_psInitializer); -} - -void PsApplication::psInstallEventFilter() { +QAbstractNativeEventFilter *psNativeEventFilter() { delete _psEventFilter; _psEventFilter = new _PsEventFilter(); - installNativeEventFilter(_psEventFilter); -} - -PsApplication::~PsApplication() { - delete _psEventFilter; - _psEventFilter = 0; + return _psEventFilter; } bool _removeDirectory(const QString &path) { // from http://stackoverflow.com/questions/2256945/removing-a-non-empty-directory-programmatically-in-c-or-c @@ -1047,14 +1032,6 @@ bool psSkipDesktopNotify() { return false; } -QStringList psInitLogs() { - return _initLogs; -} - -void psClearInitLogs() { - _initLogs = QStringList(); -} - void psActivateProcess(uint64 pid) { // objc_activateProgram(); } @@ -1146,10 +1123,16 @@ void psShowInFolder(const QString &name) { system((qsl("xdg-open ") + escapeShell(QFileInfo(name).absoluteDir().absolutePath())).toUtf8().constData()); } -void psStart() { -} +namespace PlatformSpecific { + + Initializer::Initializer() { + } + + Initializer::~Initializer() { + delete _psEventFilter; + _psEventFilter = 0; + } -void psFinish() { } namespace { @@ -1275,7 +1258,7 @@ bool _execUpdater(bool update = true) { args[argIndex++] = p_noupdate; args[argIndex++] = p_tosettings; } - if (cFromAutoStart()) args[argIndex++] = p_autostart; + if (cLaunchMode() == LaunchModeAutoStart) args[argIndex++] = p_autostart; if (cDebug()) args[argIndex++] = p_debug; if (cStartInTray()) args[argIndex++] = p_startintray; if (cTestMode()) args[argIndex++] = p_testmode; @@ -1370,18 +1353,3 @@ bool linuxMoveFile(const char *from, const char *to) { return true; } - -#ifdef _NEED_LINUX_GENERATE_DUMP -void _sigsegvHandler(int sig) { - void *array[50] = {0}; - size_t size; - - // get void*'s for all entries on the stack - size = backtrace(array, 50); - - // print out all the frames to stderr - fprintf(stderr, "Error: signal %d:\n", sig); - backtrace_symbols_fd(array, size, STDERR_FILENO); - exit(1); -} -#endif diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index 4aac22c218..6fd3356515 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -1,17 +1,17 @@ /* 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. - + Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ @@ -113,27 +113,12 @@ private: uint64 _psLastIndicatorUpdate; }; -#ifdef _NEED_LINUX_GENERATE_DUMP -void _sigsegvHandler(int sig); -#endif - -class PsApplication : public QApplication { - Q_OBJECT - -public: - - PsApplication(int &argc, char **argv); - void psInstallEventFilter(); - ~PsApplication(); - -}; - void psDeleteDir(const QString &dir); void psUserActionDone(); bool psIdleSupported(); uint64 psIdleTime(); - + bool psSkipAudioNotify(); bool psSkipDesktopNotify(); @@ -166,8 +151,8 @@ 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); -void psStart(); -void psFinish(); + +QAbstractNativeEventFilter *psNativeEventFilter(); void psNewVersion(); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 266da76f12..f27e29dd3b 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -307,7 +307,7 @@ void PsMainWindow::psFirstShow() { setWindowState(Qt::WindowMaximized); } - if ((cFromAutoStart() && cStartMinimized()) || cStartInTray()) { + if ((cLaunchMode() == LaunchModeAutoStart && cStartMinimized()) || cStartInTray()) { setWindowState(Qt::WindowMinimized); if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { hide(); @@ -516,20 +516,12 @@ bool PsMainWindow::eventFilter(QObject *obj, QEvent *evt) { return QMainWindow::eventFilter(obj, evt); } -PsApplication::PsApplication(int &argc, char **argv) : QApplication(argc, argv) { -} - -void PsApplication::psInstallEventFilter() { +QAbstractNativeEventFilter *psNativeEventFilter() { delete _psEventFilter; _psEventFilter = new _PsEventFilter(); installNativeEventFilter(_psEventFilter); } -PsApplication::~PsApplication() { - delete _psEventFilter; - _psEventFilter = 0; -} - void psDeleteDir(const QString &dir) { objc_deleteDir(dir); } @@ -649,12 +641,19 @@ void psShowInFolder(const QString &name) { objc_showInFinder(name, QFileInfo(name).absolutePath()); } -void psStart() { - objc_start(); -} +namespace PlatformSpecific { + + Initializer::Initializer() { + objc_start(); + } + + Initializer::~Initializer() { + delete _psEventFilter; + _psEventFilter = 0; + + objc_finish(); + } -void psFinish() { - objc_finish(); } void psNewVersion() { diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index 1ac5a42941..19082eedd2 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -1,17 +1,17 @@ /* 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. - + Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ @@ -31,7 +31,7 @@ inline void psCheckLocalSocket(const QString &serverName) { class MacPrivate : public PsMacWindowPrivate { public: - + void activeSpaceChanged(); void darkModeChanged(); void notifyClicked(unsigned long long peer, int msgid); @@ -140,18 +140,6 @@ private: }; - -class PsApplication : public QApplication { - Q_OBJECT - -public: - - PsApplication(int &argc, char **argv); - void psInstallEventFilter(); - ~PsApplication(); - -}; - void psDeleteDir(const QString &dir); void psUserActionDone(); @@ -190,8 +178,8 @@ 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); -void psStart(); -void psFinish(); + +QAbstractNativeEventFilter *psNativeEventFilter(); void psNewVersion(); diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index f5013dd781..0de2db7f8e 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -1,17 +1,17 @@ /* 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. - + Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ @@ -142,7 +142,7 @@ QString objcString(NSString *str) { class PsMacWindowData { public: - + PsMacWindowData(PsMacWindowPrivate *wnd) : wnd(wnd), observerHelper([[ObserverHelper alloc] init:wnd]), @@ -156,7 +156,7 @@ public: int msgId = msgObj ? [msgObj intValue] : 0; wnd->notifyClicked(peerLong, msgId); } - + void onNotifyReply(NSUserNotification *notification) { NSDictionary *dict = [notification userInfo]; NSNumber *peerObj = [dict objectForKey:@"peer"], *msgObj = [dict objectForKey:@"msgid"]; @@ -164,12 +164,12 @@ public: int msgId = msgObj ? [msgObj intValue] : 0; wnd->notifyReplied(peerLong, msgId, [[[notification response] string] UTF8String]); } - + ~PsMacWindowData() { [observerHelper release]; [notifyHandler release]; } - + PsMacWindowPrivate *wnd; ObserverHelper *observerHelper; NotifyHandler *notifyHandler; @@ -384,9 +384,9 @@ bool objc_idleTime(int64 &idleTime) { // taken from https://github.com/trueinter mach_port_t masterPort; io_iterator_t iter; io_registry_entry_t curObj; - + IOMasterPort(MACH_PORT_NULL, &masterPort); - + /* Get IOHIDSystem */ IOServiceGetMatchingServices(masterPort, IOServiceMatching("IOHIDSystem"), &iter); if (iter == 0) { @@ -400,11 +400,11 @@ bool objc_idleTime(int64 &idleTime) { // taken from https://github.com/trueinter } else { return false; } - + uint64 err = ~0L, result = err; if (obj) { CFTypeID type = CFGetTypeID(obj); - + if (type == CFDataGetTypeID()) { CFDataGetBytes((CFDataRef) obj, CFRangeMake(0, sizeof(result)), (UInt8*)&result); } else if (type == CFNumberGetTypeID()) { @@ -412,16 +412,16 @@ bool objc_idleTime(int64 &idleTime) { // taken from https://github.com/trueinter } else { // error } - + CFRelease(obj); - + if (result != err) { result /= 1000000; // return as ms } } else { // error } - + CFRelease((CFTypeRef)properties); IOObjectRelease(curObj); IOObjectRelease(iter); @@ -761,7 +761,7 @@ void objc_showInFinder(const QString &file, const QString &path) { } } } - + return NO; } @@ -790,20 +790,20 @@ void objc_openFile(const QString &f, bool openwith) { NSArray *names =[url pathComponents]; NSString *name = [names count] ? [names lastObject] : @""; NSArray *apps = (NSArray*)LSCopyApplicationURLsForURL(CFURLRef(url), kLSRolesAll); - + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; NSRect fullRect = { { 0., 0. }, { st::macAccessory.width() * 1., st::macAccessory.height() * 1. } }; NSView *accessory = [[NSView alloc] initWithFrame:fullRect]; - + [accessory setAutoresizesSubviews:YES]; - + NSPopUpButton *selector = [[NSPopUpButton alloc] init]; [accessory addSubview:selector]; [selector addItemWithTitle:objc_lang(lng_mac_recommended_apps).s()]; [selector addItemWithTitle:objc_lang(lng_mac_all_apps).s()]; [selector sizeToFit]; - + NSTextField *enableLabel = [[NSTextField alloc] init]; [accessory addSubview:enableLabel]; [enableLabel setStringValue:objc_lang(lng_mac_enable_filter).s()]; @@ -848,7 +848,7 @@ void objc_openFile(const QString &f, bool openwith) { goodFrame.origin.x = (fullRect.size.width - goodFrame.size.width) / 2.; goodFrame.origin.y = alwaysRect.origin.y - goodFrame.size.height - st::macAppHintTop; [goodLabel setFrame:goodFrame]; - + NSTextField *badLabel = [[NSTextField alloc] init]; [badLabel setStringValue:QNSString(lng_mac_not_known_app(lt_file, objcString(name))).s()]; [badLabel setFont:[goodLabel font]]; @@ -861,7 +861,7 @@ void objc_openFile(const QString &f, bool openwith) { NSImage *badImage = [NSImage imageNamed:NSImageNameCaution]; [badIcon setImage:badImage]; [badIcon setFrame:NSMakeRect(0, 0, st::macCautionIconSize.width(), st::macCautionIconSize.height())]; - + NSRect badFrame = [badLabel frame], badIconFrame = [badIcon frame]; badFrame.origin.x = (fullRect.size.width - badFrame.size.width + badIconFrame.size.width) / 2.; badIconFrame.origin.x = (fullRect.size.width - badFrame.size.width - badIconFrame.size.width) / 2.; @@ -874,14 +874,14 @@ void objc_openFile(const QString &f, bool openwith) { ChooseApplicationDelegate *delegate = [[ChooseApplicationDelegate alloc] init:apps withPanel:openPanel withSelector:selector withGood:goodLabel withBad:badLabel withIcon:badIcon withAccessory:accessory]; [openPanel setDelegate:delegate]; - + [openPanel setCanChooseDirectories:NO]; [openPanel setCanChooseFiles:YES]; [openPanel setAllowsMultipleSelection:NO]; [openPanel setResolvesAliases:YES]; [openPanel setTitle:objc_lang(lng_mac_choose_app).s()]; [openPanel setMessage:QNSString(lng_mac_choose_text(lt_file, objcString(name))).s()]; - + NSArray *appsPaths = [[NSFileManager defaultManager] URLsForDirectory:NSApplicationDirectory inDomains:NSLocalDomainMask]; if ([appsPaths count]) [openPanel setDirectoryURL:[appsPaths firstObject]]; [openPanel beginWithCompletionHandler:^(NSInteger result){ @@ -964,7 +964,7 @@ BOOL _execUpdater(BOOL update = YES) { [args addObject:[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]]]; if (cRestartingToSettings()) [args addObject:@"-tosettings"]; if (!update) [args addObject:@"-noupdate"]; - if (cFromAutoStart()) [args addObject:@"-autostart"]; + if (cLaunchMode() == LaunchModeAutoStart) [args addObject:@"-autostart"]; if (cDebug()) [args addObject:@"-debug"]; if (cStartInTray()) [args addObject:@"-startintray"]; if (cTestMode()) [args addObject:@"-testmode"]; diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 9db1afd292..847cb761f5 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -127,7 +127,7 @@ namespace { }; typedef QMap ToastImages; ToastImages toastImages; - bool toastImageSaved = false; + bool ToastImageSavedFlag = false; HWND createTaskbarHider() { HINSTANCE appinst = (HINSTANCE)GetModuleHandle(0); @@ -267,14 +267,14 @@ namespace { return false; } - QRect avail(App::app() ? App::app()->desktop()->availableGeometry() : QDesktopWidget().availableGeometry()); + QRect avail(Sandboxer::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 = Application::wnd() ? Application::wnd()->psHwnd() : 0; + HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; for (int i = 0; i < 4; ++i) { QString cn = QString("TelegramShadow%1").arg(i); @@ -402,7 +402,7 @@ namespace { } void update(int changes, WINDOWPOS *pos = 0) { - HWND hwnd = Application::wnd() ? Application::wnd()->psHwnd() : 0; + HWND hwnd = App::wnd() ? App::wnd()->psHwnd() : 0; if (!hwnd || !hwnds[0]) return; if (changes == _PsShadowActivate) { @@ -421,7 +421,7 @@ namespace { } return; } - if (!Application::wnd()->psPosInited()) 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))) { @@ -614,7 +614,7 @@ namespace { switch (msg) { case WM_CLOSE: - Application::wnd()->close(); + App::wnd()->close(); break; case WM_NCHITTEST: { int32 xPos = GET_X_LPARAM(lParam), yPos = GET_Y_LPARAM(lParam); @@ -797,7 +797,7 @@ namespace { } bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) { - Window *wnd = Application::wnd(); + Window *wnd = App::wnd(); if (!wnd) return false; MSG *msg = (MSG*)message; @@ -846,8 +846,8 @@ namespace { } else { _psShadowWindows.setColor(_shInactive); } - QTimer::singleShot(0, Application::wnd(), SLOT(updateCounter())); - Application::wnd()->update(); + QTimer::singleShot(0, App::wnd(), SLOT(updateCounter())); + App::wnd()->update(); } return false; case WM_NCPAINT: if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) return false; *result = 0; return true; @@ -922,7 +922,7 @@ namespace { POINTS p = MAKEPOINTS(lParam); RECT r; GetWindowRect(hWnd, &r); - HitTestType res = Application::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + 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; @@ -949,22 +949,22 @@ namespace { POINTS p = MAKEPOINTS(lParam); RECT r; GetWindowRect(hWnd, &r); - HitTestType res = Application::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + 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()) { - Application::wnd()->close(); + App::wnd()->close(); } } else { - QRect icon = Application::wnd()->iconRect(); + QRect icon = App::wnd()->iconRect(); p.x = r.left - dleft + icon.left(); p.y = r.top - dtop + icon.top() + icon.height(); - Application::wnd()->psUpdateSysMenu(Application::wnd()->windowHandle()->windowState()); + App::wnd()->psUpdateSysMenu(App::wnd()->windowHandle()->windowState()); menuShown = getms(); menuHidden = 0; - TrackPopupMenu(Application::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); + TrackPopupMenu(App::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); menuHidden = getms(); } return true; @@ -975,17 +975,17 @@ namespace { POINTS p = MAKEPOINTS(lParam); RECT r; GetWindowRect(hWnd, &r); - HitTestType res = Application::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); + HitTestType res = App::wnd()->hitTest(QPoint(p.x - r.left + dleft, p.y - r.top + dtop)); switch (res) { - case HitTestIcon: Application::wnd()->close(); return true; + case HitTestIcon: App::wnd()->close(); return true; }; } return false; case WM_SYSCOMMAND: { if (wParam == SC_MOUSEMENU) { POINTS p = MAKEPOINTS(lParam); - Application::wnd()->psUpdateSysMenu(Application::wnd()->windowHandle()->windowState()); - TrackPopupMenu(Application::wnd()->psMenu(), TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON, p.x, p.y, 0, hWnd, 0); + 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; @@ -993,10 +993,10 @@ namespace { if (HIWORD(wParam)) return false; int cmd = LOWORD(wParam); switch (cmd) { - case SC_CLOSE: Application::wnd()->close(); return true; - case SC_MINIMIZE: Application::wnd()->setWindowState(Qt::WindowMinimized); return true; - case SC_MAXIMIZE: Application::wnd()->setWindowState(Qt::WindowMaximized); return true; - case SC_RESTORE: Application::wnd()->setWindowState(Qt::WindowNoState); return true; + 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; @@ -1190,7 +1190,7 @@ void PsMainWindow::psInitSize() { setMinimumHeight(st::wndMinHeight); TWindowPos pos(cWindowPos()); - QRect avail(App::app() ? App::app()->desktop()->availableGeometry() : QDesktopWidget().availableGeometry()); + QRect avail(Sandboxer::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) { @@ -1309,7 +1309,7 @@ void PsMainWindow::psFirstShow() { setWindowState(Qt::WindowMaximized); } - if ((cFromAutoStart() && cStartMinimized()) || cStartInTray()) { + if ((cLaunchMode() == LaunchModeAutoStart && cStartMinimized()) || cStartInTray()) { setWindowState(Qt::WindowMinimized); if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { hide(); @@ -1553,18 +1553,10 @@ void PsMainWindow::psPlatformNotify(HistoryItem *item, int32 fwdCount) { CreateToast(item->history()->peer, item->id, showpix, title, subtitle, msg); } -PsApplication::PsApplication(int &argc, char **argv) : QApplication(argc, argv) { -} - -void PsApplication::psInstallEventFilter() { +QAbstractNativeEventFilter *psNativeEventFilter() { delete _psEventFilter; _psEventFilter = new _PsEventFilter(); - installNativeEventFilter(_psEventFilter); -} - -PsApplication::~PsApplication() { - delete _psEventFilter; - _psEventFilter = 0; + return _psEventFilter; } void psDeleteDir(const QString &dir) { @@ -2159,13 +2151,21 @@ void psShowInFolder(const QString &name) { ShellExecute(0, 0, qsl("explorer").toStdWString().c_str(), (qsl("/select,") + nameEscaped).toStdWString().c_str(), 0, SW_SHOWNORMAL); } -void psStart() { -} -void psFinish() { - if (toastImageSaved) { - psDeleteDir(cWorkingDir() + qsl("tdata/temp")); +namespace PlatformSpecific { + + Initializer::Initializer() { } + + Initializer::~Initializer() { + delete _psEventFilter; + _psEventFilter = 0; + + if (ToastImageSavedFlag) { + psDeleteDir(cWorkingDir() + qsl("tdata/temp")); + } + } + } namespace { @@ -2250,7 +2250,7 @@ void psNewVersion() { void psExecUpdater() { QString targs = qsl("-update"); - if (cFromAutoStart()) targs += qsl(" -autostart"); + if (cLaunchMode() == LaunchModeAutoStart) targs += qsl(" -autostart"); if (cDebug()) targs += qsl(" -debug"); if (cStartInTray()) targs += qsl(" -startintray"); if (cWriteProtected()) targs += qsl(" -writeprotected \"") + cExeDir() + '"'; @@ -2270,7 +2270,7 @@ void psExecUpdater() { void psExecTelegram() { QString targs = qsl("-noupdate"); if (cRestartingToSettings()) targs += qsl(" -tosettings"); - if (cFromAutoStart()) targs += qsl(" -autostart"); + if (cLaunchMode() == LaunchModeAutoStart) targs += qsl(" -autostart"); if (cDebug()) targs += qsl(" -debug"); if (cStartInTray()) targs += qsl(" -startintray"); if (cTestMode()) targs += qsl(" -testmode"); @@ -2741,7 +2741,7 @@ QString toastImage(const StorageKey &key, PeerData *peer) { App::wnd()->iconLarge().save(v.path, "PNG"); } i = toastImages.insert(key, v); - toastImageSaved = true; + ToastImageSavedFlag = true; } return i->path; } diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index 2d4232bf10..b5f09d427d 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -117,17 +117,6 @@ extern LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter; LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); -class PsApplication : public QApplication { - Q_OBJECT - -public: - - PsApplication(int &argc, char **argv); - void psInstallEventFilter(); - ~PsApplication(); - -}; - void psDeleteDir(const QString &dir); void psUserActionDone(); @@ -167,8 +156,8 @@ 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); -void psStart(); -void psFinish(); + +QAbstractNativeEventFilter *psNativeEventFilter(); void psNewVersion(); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 0992e6a9fe..d025443e97 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -26,6 +26,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org bool gRtl = false; Qt::LayoutDirection gLangDir = gRtl ? Qt::RightToLeft : Qt::LeftToRight; +QString gArguments; + mtpDcOptions gDcOptions; bool gDevVersion = DevVersion; @@ -57,7 +59,7 @@ bool gAutoStart = false; bool gSendToMenu = false; bool gAutoUpdate = true; TWindowPos gWindowPos; -bool gFromAutoStart = false; +LaunchMode gLaunchMode = LaunchModeNormal; bool gSupportTray = true; DBIWorkMode gWorkMode = dbiwmWindowAndTray; DBIConnectionType gConnectionType = dbictAuto; @@ -189,6 +191,13 @@ void settingsParseArgs(int argc, char *argv[]) { gCustomNotifies = false; } #endif + + QStringList args; + for (int32 i = 0; i < argc; ++i) { + args.push_back('"' + fromUtf8Safe(argv[i]) + '"'); + } + gArguments = args.join(' '); + gExeDir = psCurrentExeDirectory(argc, argv); gExeName = psCurrentExeName(argc, argv); for (int32 i = 0; i < argc; ++i) { @@ -201,7 +210,11 @@ void settingsParseArgs(int argc, char *argv[]) { } else if (string("-key") == argv[i] && i + 1 < argc) { gKeyFile = fromUtf8Safe(argv[++i]); } else if (string("-autostart") == argv[i]) { - gFromAutoStart = true; + gLaunchMode = LaunchModeAutoStart; + } else if (string("-fixprevious") == argv[i]) { + gLaunchMode = LaunchModeFixPrevious; + } else if (string("-cleanup") == argv[i]) { + gLaunchMode = LaunchModeCleanup; } else if (string("-noupdate") == argv[i]) { gNoStartUpdate = true; } else if (string("-tosettings") == argv[i]) { diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index e14f92ddc0..ffbb8ea3a4 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -24,10 +24,8 @@ extern bool gDebug; inline bool cDebug() { #if defined _DEBUG return true; -#elif defined _WITH_DEBUG - return gDebug; #else - return false; + return gDebug; #endif } inline void cSetDebug(bool debug) { @@ -55,6 +53,8 @@ inline bool rtl() { return cRtl(); } +DeclareReadSetting(QString, Arguments); + struct mtpDcOption { mtpDcOption(int id, int flags, const string &ip, int port) : id(id), flags(flags), ip(ip), port(port) { } @@ -82,7 +82,13 @@ DeclareSetting(bool, AutoStart); DeclareSetting(bool, StartMinimized); DeclareSetting(bool, StartInTray); DeclareSetting(bool, SendToMenu); -DeclareReadSetting(bool, FromAutoStart); +enum LaunchMode { + LaunchModeNormal = 0, + LaunchModeAutoStart, + LaunchModeFixPrevious, + LaunchModeCleanup, +}; +DeclareReadSetting(LaunchMode, LaunchMode); DeclareSetting(QString, WorkingDir); inline void cForceWorkingDir(const QString &newDir) { cSetWorkingDir(newDir); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index ea3cfe7e85..7294a6c4ad 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -269,11 +269,11 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) _newVersionWidth = st::linkFont->width(_newVersionText); #ifndef TDESKTOP_DISABLE_AUTOUPDATE - connect(App::app(), SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); - connect(App::app(), SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); - connect(App::app(), SIGNAL(updateDownloading(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); - connect(App::app(), SIGNAL(updateReady()), this, SLOT(onUpdateReady())); - connect(App::app(), SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); + Sandboxer::connect(SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); + Sandboxer::connect(SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); + Sandboxer::connect(SIGNAL(updateProgress(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); + Sandboxer::connect(SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); + Sandboxer::connect(SIGNAL(updateReady()), this, SLOT(onUpdateReady())); #endif // chat options @@ -330,10 +330,10 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) updateOnlineDisplay(); #ifndef TDESKTOP_DISABLE_AUTOUPDATE - switch (App::app()->updatingState()) { + switch (Sandboxer::updatingState()) { case Application::UpdatingDownload: setUpdatingState(UpdatingDownload, true); - setDownloadProgress(App::app()->updatingReady(), App::app()->updatingSize()); + setDownloadProgress(Sandboxer::updatingReady(), Sandboxer::updatingSize()); break; case Application::UpdatingReady: setUpdatingState(UpdatingReady, true); break; default: setUpdatingState(UpdatingNone, true); break; @@ -1261,14 +1261,14 @@ void SettingsInner::onAutoUpdate() { Local::writeSettings(); resizeEvent(0); if (cAutoUpdate()) { - App::app()->startUpdateCheck(); + Sandboxer::startUpdateCheck(); if (_updatingState == UpdatingNone) { _checkNow.show(); } else if (_updatingState == UpdatingReady) { _restartNow.show(); } } else { - App::app()->stopUpdate(); + Sandboxer::stopUpdate(); _restartNow.hide(); _checkNow.hide(); } @@ -1279,7 +1279,7 @@ void SettingsInner::onCheckNow() { if (!cAutoUpdate()) return; cSetLastUpdateCheck(0); - App::app()->startUpdateCheck(); + Sandboxer::startUpdateCheck(); } #endif @@ -1785,7 +1785,7 @@ SettingsWidget::SettingsWidget(Window *parent) : TWidget(parent) connect(App::wnd(), SIGNAL(resized(const QSize&)), this, SLOT(onParentResize(const QSize&))); connect(&_close, SIGNAL(clicked()), App::wnd(), SLOT(showSettings())); - setGeometry(QRect(0, st::titleHeight, Application::wnd()->width(), Application::wnd()->height() - st::titleHeight)); + setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight)); showAll(); } diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index bc67e11838..44098d9e14 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -38,6 +38,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #include #include +#include +#include #ifdef Q_OS_WIN // use Lzma SDK for win #include diff --git a/Telegram/SourceFiles/sysbuttons.cpp b/Telegram/SourceFiles/sysbuttons.cpp index 5aad225969..163ba004e4 100644 --- a/Telegram/SourceFiles/sysbuttons.cpp +++ b/Telegram/SourceFiles/sysbuttons.cpp @@ -79,7 +79,7 @@ void SysBtn::paintEvent(QPaintEvent *e) { } p.fillRect(x, y, _st.img.pxWidth(), _st.img.pxHeight(), c); p.drawPixmap(QPoint(x, y), App::sprite(), _st.img); - + if (!_text.isEmpty()) { p.setFont(st::titleTextButton.font->f); p.setPen(c); @@ -151,7 +151,7 @@ void UpdateBtn::onClick() { #ifndef TDESKTOP_DISABLE_AUTOUPDATE checkReadyUpdate(); #endif - if (App::app()->updatingState() == Application::UpdatingReady) { + if (Sandboxer::updatingState() == Application::UpdatingReady) { cSetRestartingUpdate(true); } else { cSetRestarting(true); diff --git a/Telegram/SourceFiles/title.cpp b/Telegram/SourceFiles/title.cpp index 58a7c5506e..83cb690900 100644 --- a/Telegram/SourceFiles/title.cpp +++ b/Telegram/SourceFiles/title.cpp @@ -73,7 +73,7 @@ TitleWidget::TitleWidget(Window *window) : TWidget(window) _update.hide(); _cancel.hide(); _back.hide(); - if (App::app()->updatingState() == Application::UpdatingReady || cHasPasscode()) { + if (Sandboxer::updatingState() == Application::UpdatingReady || cHasPasscode()) { showUpdateBtn(); } stateChanged(); @@ -87,7 +87,7 @@ TitleWidget::TitleWidget(Window *window) : TWidget(window) #ifndef TDESKTOP_DISABLE_AUTOUPDATE connect(App::app(), SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); #endif - + if (cPlatform() != dbipWindows) { _minimize.hide(); _maximize.hide(); @@ -173,10 +173,10 @@ void TitleWidget::resizeEvent(QResizeEvent *e) { if (cPlatform() == dbipWindows) { p.setX(p.x() - _close.width()); _close.move(p); - + p.setX(p.x() - _maximize.width()); _restore.move(p); _maximize.move(p); - + p.setX(p.x() - _minimize.width()); _minimize.move(p); } @@ -264,7 +264,7 @@ void TitleWidget::updateCounter() { bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; style::color bg = muted ? st::counterMuteBG : st::counterBG; - + if (counter > 0) { int32 size = cRetina() ? -32 : -16; switch (cScale()) { @@ -322,7 +322,7 @@ void TitleWidget::showUpdateBtn() { } else { _lock.hide(); } - bool updateReady = App::app()->updatingState() == Application::UpdatingReady; + bool updateReady = (Sandboxer::updatingState() == Application::UpdatingReady); if (updateReady || cEvalScale(cConfigScale()) != cEvalScale(cRealScale())) { _update.setText(lang(updateReady ? lng_menu_update : lng_menu_restart)); _update.show(); diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index ca7c917b40..6835e4956f 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -266,43 +266,47 @@ namespace { _MsStarter _msStarter; } -void initThirdParty() { - if (!RAND_status()) { // should be always inited in all modern OS - char buf[16]; - memcpy(buf, &_msStart, 8); - memcpy(buf + 8, &_msFreq, 8); - uchar sha256Buffer[32]; - RAND_seed(hashSha256(buf, 16, sha256Buffer), 32); - if (!RAND_status()) { - LOG(("MTP Error: Could not init OpenSSL rand, RAND_status() is 0..")); +namespace ThirdParty { + + void start() { + if (!RAND_status()) { // should be always inited in all modern OS + char buf[16]; + memcpy(buf, &_msStart, 8); + memcpy(buf + 8, &_msFreq, 8); + uchar sha256Buffer[32]; + RAND_seed(hashSha256(buf, 16, sha256Buffer), 32); + if (!RAND_status()) { + LOG(("MTP Error: Could not init OpenSSL rand, RAND_status() is 0..")); + } } + + int32 numLocks = CRYPTO_num_locks(); + if (numLocks) { + _sslLocks = new QMutex[numLocks]; + CRYPTO_set_locking_callback(_sslLockingCallback); + } else { + LOG(("MTP Error: Could not init OpenSSL threads, CRYPTO_num_locks() returned zero!")); + } + CRYPTO_THREADID_set_callback(_sslThreadId); + CRYPTO_set_dynlock_create_callback(_sslCreateFunction); + CRYPTO_set_dynlock_lock_callback(_sslLockFunction); + CRYPTO_set_dynlock_destroy_callback(_sslDestroyFunction); + + av_register_all(); + avcodec_register_all(); + + av_lockmgr_register(_ffmpegLockManager); + + _sslInited = true; } - int32 numLocks = CRYPTO_num_locks(); - if (numLocks) { - _sslLocks = new QMutex[numLocks]; - CRYPTO_set_locking_callback(_sslLockingCallback); - } else { - LOG(("MTP Error: Could not init OpenSSL threads, CRYPTO_num_locks() returned zero!")); + void finish() { + av_lockmgr_register(0); + + delete[] _sslLocks; + _sslLocks = 0; } - CRYPTO_THREADID_set_callback(_sslThreadId); - CRYPTO_set_dynlock_create_callback(_sslCreateFunction); - CRYPTO_set_dynlock_lock_callback(_sslLockFunction); - CRYPTO_set_dynlock_destroy_callback(_sslDestroyFunction); - av_register_all(); - avcodec_register_all(); - - av_lockmgr_register(_ffmpegLockManager); - - _sslInited = true; -} - -void deinitThirdParty() { - av_lockmgr_register(0); - - delete[] _sslLocks; - _sslLocks = 0; } namespace { diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 3406ef1f08..50ddd51e99 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -84,6 +84,16 @@ using std::swap; #include "logs.h" +static volatile int *t_assert_nullptr = 0; +inline void t_noop() {} +inline void t_assert_fail(const char *message, const char *file, int32 line) { + LOG(("Assertion Failed! %1 %2:%3").arg(message).arg(file).arg(line)); + *t_assert_nullptr = 0; +} +#define t_assert_full(condition, message, file, line) ((!(condition)) ? t_assert_fail(message, file, line) : t_noop()) +#define t_assert_c(condition, comment) t_assert_full(condition, "\"" #condition "\" (" comment ")", __FILE__, __LINE__) +#define t_assert(condition) t_assert_full(condition, "\"" #condition "\"", __FILE__, __LINE__) + class Exception : public exception { public: @@ -135,8 +145,12 @@ inline void mylocaltime(struct tm * _Tm, const time_t * _Time) { void installSignalHandlers(); -void initThirdParty(); // called by Global::Initializer -void deinitThirdParty(); +namespace ThirdParty { + + void start(); + void finish(); + +} bool checkms(); // returns true if time has changed uint64 getms(bool checked = false); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 9a35a4ef68..004a88fee0 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1212,7 +1212,7 @@ void Window::toggleDisplayNotifyFromTray() { } void Window::closeEvent(QCloseEvent *e) { - if (MTP::authedId() && !App::app()->isSavingSession() && minimizeToTray()) { + if (MTP::authedId() && !Sandboxer::isSavingSession() && minimizeToTray()) { e->ignore(); } else { App::quit(); diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 6712fba13b..e99dd40d4c 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -10,7 +10,7 @@ CONFIG(debug, debug|release) { DESTDIR = ./../Debug } CONFIG(release, debug|release) { - DEFINES += _WITH_DEBUG CUSTOM_API_ID + DEFINES += CUSTOM_API_ID OBJECTS_DIR = ./../ReleaseIntermediate MOC_DIR = ./GenFiles/Release RCC_DIR = ./GenFiles @@ -47,7 +47,7 @@ style_classes_h.depends = ./../../Telegram/Resources/style_classes.txt numbers_cpp.target = ./GeneratedFiles/numbers.cpp numbers_cpp.depends = FORCE numbers_cpp.commands = mkdir -p ./../../Telegram/GeneratedFiles && ./../DebugStyle/MetaStyle -classes_in ./../../Telegram/Resources/style_classes.txt -classes_out ./../../Telegram/GeneratedFiles/style_classes.h -styles_in ./../../Telegram/Resources/style.txt -styles_out ./../../Telegram/GeneratedFiles/style_auto.h -path_to_sprites ./../../Telegram/SourceFiles/art/ -numbers_cpp.depends = ./../../Telegram/Resources/numbers.txt +numbers_cpp.depends = ./../../Telegram/Resources/numbers.txt lang_auto_cpp.target = ./GeneratedFiles/lang_auto.cpp lang_auto_cpp.depends = FORCE diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 598fe1ae4f..5530f46a48 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -95,7 +95,7 @@ - AL_LIBTYPE_STATIC;UNICODE;_WITH_DEBUG;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\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 MultiThreaded @@ -125,7 +125,7 @@ - AL_LIBTYPE_STATIC;CUSTOM_API_ID;UNICODE;_WITH_DEBUG;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AL_LIBTYPE_STATIC;CUSTOM_API_ID;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\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 MultiThreaded @@ -1059,7 +1059,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1067,7 +1067,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" Moc%27ing window.h... @@ -1077,8 +1077,8 @@ Moc%27ing window.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1109,8 +1109,8 @@ Moc%27ing application.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1123,7 +1123,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1131,7 +1131,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1142,8 +1142,8 @@ Moc%27ing aboutbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1156,8 +1156,8 @@ Moc%27ing addcontactbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1170,8 +1170,8 @@ Moc%27ing confirmbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1184,8 +1184,8 @@ Moc%27ing connectionbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1198,8 +1198,8 @@ Moc%27ing contactsbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1212,8 +1212,8 @@ Moc%27ing photocropbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1226,8 +1226,8 @@ Moc%27ing photosendbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1240,8 +1240,8 @@ Moc%27ing emojibox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1254,8 +1254,8 @@ Moc%27ing downloadpathbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1264,7 +1264,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1272,13 +1272,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 usernamebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1286,13 +1286,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 languagebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1300,13 +1300,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 backgroundbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1314,13 +1314,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 autolockbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1328,13 +1328,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 passcodebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1342,13 +1342,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 sessionsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1356,13 +1356,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 abstractbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1370,13 +1370,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 stickersetbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1384,13 +1384,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 autoupdater.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1398,7 +1398,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1409,8 +1409,8 @@ Moc%27ing animation.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1423,8 +1423,8 @@ Moc%27ing button.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1437,8 +1437,8 @@ Moc%27ing flatbutton.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1451,8 +1451,8 @@ Moc%27ing flatinput.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1465,8 +1465,8 @@ Moc%27ing countryinput.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1480,8 +1480,8 @@ Moc%27ing scrollarea.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1494,8 +1494,8 @@ Moc%27ing dialogswidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1508,8 +1508,8 @@ Moc%27ing flattextarea.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1522,8 +1522,8 @@ Moc%27ing fileuploader.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1536,8 +1536,8 @@ Moc%27ing dropdown.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1548,7 +1548,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" "-fstdafx.h" "-f../../SourceFiles/gui/popupmenu.h" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1556,7 +1556,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" "-fstdafx.h" "-f../../SourceFiles/gui/popupmenu.h" -DAL_LIBTYPE_STATIC -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1567,8 +1567,8 @@ Moc%27ing flatcheckbox.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1602,8 +1602,8 @@ Moc%27ing flatlabel.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1616,8 +1616,8 @@ Moc%27ing twidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1627,13 +1627,13 @@ Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/history.h" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" "-fstdafx.h" "-f../../SourceFiles/history.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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\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 history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/history.h" -DAL_LIBTYPE_STATIC -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1646,8 +1646,8 @@ Moc%27ing historywidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1660,8 +1660,8 @@ Moc%27ing intro.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.h" - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.h" + "$(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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1674,8 +1674,8 @@ Moc%27ing introcode.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1688,8 +1688,8 @@ Moc%27ing introphone.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1702,8 +1702,8 @@ Moc%27ing introsignup.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1712,7 +1712,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1720,7 +1720,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1731,8 +1731,8 @@ Moc%27ing layerwidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1745,8 +1745,8 @@ Moc%27ing localimageloader.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1757,7 +1757,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1765,7 +1765,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1796,8 +1796,8 @@ Moc%27ing mtpConnection.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1810,8 +1810,8 @@ Moc%27ing mainwidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1824,8 +1824,8 @@ Moc%27ing mtp.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1834,7 +1834,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1842,7 +1842,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1853,8 +1853,8 @@ Moc%27ing mtpFileLoader.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1869,8 +1869,8 @@ Moc%27ing mtpDC.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1885,8 +1885,8 @@ Moc%27ing mtpSession.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1899,8 +1899,8 @@ Moc%27ing settingswidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1913,8 +1913,8 @@ Moc%27ing profilewidget.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1927,8 +1927,8 @@ Moc%27ing pspecific_wnd.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) @@ -1938,7 +1938,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1946,13 +1946,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 passcodewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1960,13 +1960,13 @@ $(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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 playerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DAL_LIBTYPE_STATIC -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1974,7 +1974,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1982,7 +1982,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1990,7 +1990,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" true true true @@ -1999,7 +1999,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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -2007,7 +2007,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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" true true true @@ -2047,8 +2047,8 @@ Moc%27ing sysbuttons.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -2061,8 +2061,8 @@ Moc%27ing title.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 -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DCUSTOM_API_ID -DUNICODE -D_WITH_DEBUG -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 336683034d..4f7b757471 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1806,7 +1806,6 @@ "-Wall", "-W", "-fPIE", - "-D_WITH_DEBUG", "-DQT_WIDGETS_LIB", "-DQT_NETWORK_LIB", "-DQT_GUI_LIB", @@ -1827,7 +1826,6 @@ "-Wall", "-W", "-fPIE", - "-D_WITH_DEBUG", "-DQT_WIDGETS_LIB", "-DQT_NETWORK_LIB", "-DQT_GUI_LIB", From d2f3fbe3f70e27e8c1edc5ae6ab8c16ee1a2a8b3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 17 Jan 2016 07:28:54 +0800 Subject: [PATCH 022/316] mentions regexp start with one letter instead of three --- Telegram/SourceFiles/gui/text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 466c3321fe..9fe984d736 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -36,7 +36,7 @@ namespace { const QRegularExpression _reMailName(qsl("[a-zA-Z\\-_\\.0-9]{1,256}$")); const QRegularExpression _reMailStart(qsl("^[a-zA-Z\\-_\\.0-9]{1,256}\\@")); const QRegularExpression _reHashtag(qsl("(^|[\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\%\\^\\*\\(\\)\\-\\+=\\x10])#[\\w]{2,64}([\\W]|$)"), QRegularExpression::UseUnicodePropertiesOption); - const QRegularExpression _reMention(qsl("(^|[\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\%\\^\\*\\(\\)\\-\\+=\\x10])@[A-Za-z_0-9]{3,32}([\\W]|$)"), QRegularExpression::UseUnicodePropertiesOption); + const QRegularExpression _reMention(qsl("(^|[\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\%\\^\\*\\(\\)\\-\\+=\\x10])@[A-Za-z_0-9]{1,32}([\\W]|$)"), QRegularExpression::UseUnicodePropertiesOption); const QRegularExpression _reBotCommand(qsl("(^|[\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\%\\^\\*\\(\\)\\-\\+=\\x10])/[A-Za-z_0-9]{1,64}(@[A-Za-z_0-9]{5,32})?([\\W]|$)")); const QRegularExpression _rePre(qsl("(^|[\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\?\\%\\^\\*\\(\\)\\-\\+=\\x10])(````?)[\\s\\S]+?(````?)([\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\?\\%\\^\\*\\(\\)\\-\\+=\\x10]|$)"), QRegularExpression::UseUnicodePropertiesOption); const QRegularExpression _reCode(qsl("(^|[\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\?\\%\\^\\*\\(\\)\\-\\+=\\x10])(`)[^\\n]+?(`)([\\s\\.,:;<>|'\"\\[\\]\\{\\}`\\~\\!\\?\\%\\^\\*\\(\\)\\-\\+=\\x10]|$)"), QRegularExpression::UseUnicodePropertiesOption); From 5f84567bbb348e675de02c29468db8c199fb22a1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 17 Jan 2016 13:01:14 +0800 Subject: [PATCH 023/316] initial logging improved, debug logs disabled for -many instance param --- Telegram/SourceFiles/application.cpp | 37 ++-- Telegram/SourceFiles/logs.cpp | 246 ++++++++++++++++++++++----- Telegram/SourceFiles/logs.h | 5 + 3 files changed, 232 insertions(+), 56 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 794503b956..60f831665a 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -139,12 +139,6 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) , _updateChecker(0) #endif { - if (!Logs::started()) { - // show error window - quit(); - return; - } - QByteArray d(QDir(cWorkingDir()).absolutePath().toUtf8()); char h[33] = { 0 }; hashMd5Hex(d.constData(), d.size(), h); @@ -164,9 +158,10 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #endif if (cManyInstance()) { + LOG(("Many instance allowed, starting..")); singleInstanceChecked(); } else { - DEBUG_LOG(("Application Info: connecting local socket to %1..").arg(_localServerName)); + LOG(("Connecting local socket to %1..").arg(_localServerName)); _localSocket.connectToServer(_localServerName); } } @@ -193,7 +188,7 @@ Application::~Application() { void Application::socketConnected() { - DEBUG_LOG(("Application Info: socket connected, this is not the first application instance, sending show command..")); + LOG(("Socket connected, this is not the first application instance, sending show command..")); _secondInstance = true; QString commands; @@ -212,46 +207,46 @@ void Application::socketConnected() { void Application::socketWritten(qint64/* bytes*/) { if (_localSocket.state() != QLocalSocket::ConnectedState) { - DEBUG_LOG(("Application Error: socket is not connected %1").arg(_localSocket.state())); + LOG(("Socket is not connected %1").arg(_localSocket.state())); return; } if (_localSocket.bytesToWrite()) { return; } - DEBUG_LOG(("Application Info: show command written, waiting response..")); + LOG(("Show command written, waiting response..")); } void Application::socketReading() { if (_localSocket.state() != QLocalSocket::ConnectedState) { - DEBUG_LOG(("Application Error: socket is not connected %1").arg(_localSocket.state())); + LOG(("Socket is not connected %1").arg(_localSocket.state())); return; } _localSocketReadData.append(_localSocket.readAll()); if (QRegularExpression("RES:(\\d+);").match(_localSocketReadData).hasMatch()) { uint64 pid = _localSocketReadData.mid(4, _localSocketReadData.length() - 5).toULongLong(); psActivateProcess(pid); - DEBUG_LOG(("Application Info: show command response received, pid = %1, activating and quiting..").arg(pid)); + LOG(("Show command response received, pid = %1, activating and quiting..").arg(pid)); return App::quit(); } } void Application::socketError(QLocalSocket::LocalSocketError e) { if (_secondInstance) { - DEBUG_LOG(("Application Error: could not write show command, error %1, quiting..").arg(e)); + LOG(("Could not write show command, error %1, quiting..").arg(e)); return App::quit(); } if (e == QLocalSocket::ServerNotFoundError) { - DEBUG_LOG(("Application Info: this is the only instance of Telegram, starting server and app..")); + LOG(("This is the only instance of Telegram, starting server and app..")); } else { - DEBUG_LOG(("Application Info: socket connect error %1, starting server and app..").arg(e)); + LOG(("Socket connect error %1, starting server and app..").arg(e)); } _localSocket.close(); psCheckLocalSocket(_localServerName); if (!_localServer.listen(_localServerName)) { - DEBUG_LOG(("Application Error: failed to start listening to %1 server, error %2").arg(_localServerName).arg(int(_localServer.serverError()))); + LOG(("Failed to start listening to %1 server, error %2").arg(_localServerName).arg(int(_localServer.serverError()))); return App::quit(); } @@ -267,6 +262,16 @@ void Application::socketError(QLocalSocket::LocalSocketError e) { } void Application::singleInstanceChecked() { + if (cManyInstance()) { + Logs::multipleInstances(); + } + if ((!cManyInstance() && !Logs::instanceChecked()) || !Logs::started()) { + MessageBox(0, (QString::fromStdWString(L"Could not initialize logs!\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); + // show error window + App::quit(); + return; + } + Global::start(); // if crashed, show window and try to autoupdate diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 69817a2c41..d957bdd131 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -31,17 +31,21 @@ enum LogDataType { LogDataCount }; -QMutex *LogsMutexes = 0; -QMutex *_logsMutex(LogDataType type) { - if (!LogsMutexes) { +QMutex *_logsMutex(LogDataType type, bool clear = false) { + static QMutex *LogsMutexes = 0; + if (clear) { + delete[] LogsMutexes; + LogsMutexes = 0; + } else if (!LogsMutexes) { LogsMutexes = new QMutex[LogDataCount]; } return &LogsMutexes[type]; } + QString _logsFilePath(LogDataType type, const QString &postfix = QString()) { QString path(cWorkingDir()); switch (type) { - case LogDataMain: path += qstr("log.txt"); break; + case LogDataMain: path += qstr("log") + postfix + qstr(".txt"); break; case LogDataDebug: path += qstr("DebugLogs/log") + postfix + qstr(".txt"); break; case LogDataTcp: path += qstr("DebugLogs/tcp") + postfix + qstr(".txt"); break; case LogDataMtp: path += qstr("DebugLogs/mtp") + postfix + qstr(".txt"); break; @@ -49,23 +53,47 @@ QString _logsFilePath(LogDataType type, const QString &postfix = QString()) { return path; } +int32 LogsStartIndexChosen = -1; +QString _logsEntryStart() { + static int32 index = 0; + QDateTime tm(QDateTime::currentDateTime()); + + QThread *thread = QThread::currentThread(); + MTPThread *mtpThread = qobject_cast(thread); + uint threadId = mtpThread ? mtpThread->getThreadId() : 0; + + return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, QChar('0'))).arg(++index, 7, 10, QChar('0')); +} + class LogsDataFields { public: - QString entryStart() { - QDateTime tm(QDateTime::currentDateTime()); - QThread *thread = QThread::currentThread(); - MTPThread *mtpThread = qobject_cast(thread); - uint threadId = mtpThread ? mtpThread->getThreadId() : 0; - - return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, QChar('0'))).arg(++index, 7, 10, QChar('0')); + LogsDataFields() { + for (int32 i = 0; i < LogDataCount; ++i) { + files[i].reset(new QFile()); + } } bool openMain() { - QMutexLocker lock(_logsMutex(LogDataMain)); + return reopen(LogDataMain, 0, qsl("start")); + } + + bool instanceChecked() { return reopen(LogDataMain, 0, QString()); } + QString full() { + if (!streams[LogDataMain].device()) { + return QString(); + } + + QFile out(files[LogDataMain]->fileName()); + if (out.open(QIODevice::ReadOnly)) { + return QString::fromUtf8(out.readAll()); + } + return QString(); + } + void write(LogDataType type, const QString &msg) { QMutexLocker lock(_logsMutex(type)); if (type != LogDataMain) reopenDebug(); @@ -77,7 +105,7 @@ public: private: - QFile files[LogDataCount]; + QSharedPointer files[LogDataCount]; QTextStream streams[LogDataCount]; int32 part = -1, index = 0; @@ -85,28 +113,90 @@ private: bool reopen(LogDataType type, int32 dayIndex, const QString &postfix) { if (streams[type].device()) { if (type == LogDataMain) { - return true; + if (!postfix.isEmpty()) { + return true; + } + } else { + streams[type].setDevice(0); + files[type]->close(); } - streams[type].setDevice(0); - files[type].close(); } - files[type].setFileName(_logsFilePath(type, postfix)); QFlags mode = QIODevice::WriteOnly | QIODevice::Text; - if (type != LogDataMain) { - if (files[type].exists()) { - if (files[type].open(QIODevice::ReadOnly | QIODevice::Text)) { - if (QString::fromUtf8(files[type].readLine()).toInt() == dayIndex) { + if (type == LogDataMain) { // we can call LOG() in LogDataMain reopen - mutex not locked + if (postfix.isEmpty()) { // instance checked, need to move to log.txt + t_assert(!files[type]->fileName().isEmpty()); // one of log_startXX.txt should've been opened already + + QSharedPointer to(new QFile(_logsFilePath(type, postfix))); + if (to->exists() && !to->remove()) { + LOG(("Could not delete '%1' file to start new logging!").arg(to->fileName())); + return false; + } + if (!QFile(files[type]->fileName()).copy(to->fileName())) { // don't close files[type] yet + LOG(("Could not copy '%1' to '%2' to start new logging!").arg(files[type]->fileName()).arg(to->fileName())); + return false; + } + if (to->open(mode | QIODevice::Append)) { + qSwap(files[type], to); + streams[type].setDevice(files[type].data()); + streams[type].setCodec("UTF-8"); + LOG(("Moved logging from '%1' to '%2'!").arg(to->fileName()).arg(files[type]->fileName())); + to->remove(); + + LogsStartIndexChosen = -1; + + QDir working(cWorkingDir()); // delete all other log_startXX.txt that we can + QStringList oldlogs = working.entryList(QStringList("log_start*.txt"), QDir::Files); + for (QStringList::const_iterator i = oldlogs.cbegin(), e = oldlogs.cend(); i != e; ++i) { + QString oldlog = cWorkingDir() + *i, oldlogend = i->mid(qstr("log_start").size()); + if (oldlogend.size() == 1 + qstr(".txt").size() && oldlogend.at(0).isDigit() && oldlogend.midRef(1) == qstr(".txt")) { + bool removed = QFile(*i).remove(); + LOG(("Old start log '%1' found, deleted: %2").arg(*i).arg(Logs::b(removed))); + } + } + + return true; + } + LOG(("Could not open '%1' file to start new logging!").arg(to->fileName())); + return false; + } else { + bool found = false; + int32 oldest = -1; // find not existing log_startX.txt or pick the oldest one (by lastModified) + QDateTime oldestLastModified; + for (int32 i = 0; i < 10; ++i) { + QString trying = _logsFilePath(type, qsl("_start%1").arg(i)); + files[type]->setFileName(trying); + if (!files[type]->exists()) { + LogsStartIndexChosen = i; + found = true; + break; + } + QDateTime lastModified = QFileInfo(trying).lastModified(); + if (oldest < 0 || lastModified < oldestLastModified) { + oldestLastModified = lastModified; + oldest = i; + } + } + if (!found) { + files[type]->setFileName(_logsFilePath(type, qsl("_start%1").arg(oldest))); + LogsStartIndexChosen = oldest; + } + } + } else { + files[type]->setFileName(_logsFilePath(type, postfix)); + if (files[type]->exists()) { + if (files[type]->open(QIODevice::ReadOnly | QIODevice::Text)) { + if (QString::fromUtf8(files[type]->readLine()).toInt() == dayIndex) { mode |= QIODevice::Append; } - files[type].close(); + files[type]->close(); } } else { QDir().mkdir(cWorkingDir() + qstr("DebugLogs")); } } - if (files[type].open(mode)) { - streams[type].setDevice(&files[type]); + if (files[type]->open(mode)) { + streams[type].setDevice(files[type].data()); streams[type].setCodec("UTF-8"); if (type != LogDataMain) { @@ -115,6 +205,8 @@ private: } return true; + } else if (type != LogDataMain) { + LOG(("Could not open debug log '%1'!").arg(files[type]->fileName())); } return false; } @@ -145,8 +237,11 @@ LogsDataFields *LogsData = 0; typedef QList > LogsInMemoryList; LogsInMemoryList *LogsInMemory = 0; LogsInMemoryList *DeletedLogsInMemory = SharedMemoryLocation(); + +QString LogsBeforeSingleInstanceChecked; // LogsInMemory already dumped in LogsData, but LogsData is about to be deleted + void _logsWrite(LogDataType type, const QString &msg) { - if (LogsData) { + if (LogsData && (type == LogDataMain || LogsStartIndexChosen < 0)) { if (type == LogDataMain || cDebug()) { LogsData->write(type, msg); } @@ -154,7 +249,9 @@ void _logsWrite(LogDataType type, const QString &msg) { if (!LogsInMemory) { LogsInMemory = new LogsInMemoryList; } - LogsInMemory->push_back(qMakePair(LogDataMain, msg)); + LogsInMemory->push_back(qMakePair(type, msg)); + } else if (!LogsBeforeSingleInstanceChecked.isEmpty() && type == LogDataMain) { + LogsBeforeSingleInstanceChecked += msg; } } @@ -217,7 +314,7 @@ namespace Logs { if (!LogsData->openMain()) { delete LogsData; LogsData = 0; - LOG(("Error: could not open '%1' for writing log!").arg(_logsFilePath(LogDataMain))); + LOG(("Could not open '%1' for writing log!").arg(_logsFilePath(LogDataMain, qsl("_startXX")))); return; } @@ -234,31 +331,76 @@ namespace Logs { t_assert(LogsInMemory != DeletedLogsInMemory); LogsInMemoryList list = *LogsInMemory; for (LogsInMemoryList::const_iterator i = list.cbegin(), e = list.cend(); i != e; ++i) { - _logsWrite(i->first, i->second); + if (i->first == LogDataMain) { + _logsWrite(i->first, i->second); + } } } - if (LogsInMemory) { - t_assert(LogsInMemory != DeletedLogsInMemory); - delete LogsInMemory; - LogsInMemory = DeletedLogsInMemory; - } LOG(("Logs started.")); - DEBUG_LOG(("Debug logs started.")); } Initializer::~Initializer() { delete LogsData; LogsData = 0; - delete[] LogsMutexes; - LogsMutexes = 0; + if (LogsInMemory && LogsInMemory != DeletedLogsInMemory) { + delete LogsInMemory; + } + LogsInMemory = DeletedLogsInMemory; + + _logsMutex(LogDataMain, true); } bool started() { return LogsData != 0; } + bool instanceChecked() { + if (!LogsData) return false; + + if (!LogsData->instanceChecked()) { + LogsBeforeSingleInstanceChecked = Logs::full(); + + delete LogsData; + LogsData = 0; + LOG(("Could not move logging to '%1'!").arg(_logsFilePath(LogDataMain))); + return false; + } + + if (LogsInMemory) { + t_assert(LogsInMemory != DeletedLogsInMemory); + LogsInMemoryList list = *LogsInMemory; + for (LogsInMemoryList::const_iterator i = list.cbegin(), e = list.cend(); i != e; ++i) { + if (i->first != LogDataMain) { + _logsWrite(i->first, i->second); + } + } + } + if (LogsInMemory) { + t_assert(LogsInMemory != DeletedLogsInMemory); + delete LogsInMemory; + } + LogsInMemory = DeletedLogsInMemory; + + DEBUG_LOG(("Debug logs started.")); + LogsBeforeSingleInstanceChecked.clear(); + return true; + } + + void multipleInstances() { + if (LogsInMemory) { + t_assert(LogsInMemory != DeletedLogsInMemory); + delete LogsInMemory; + } + LogsInMemory = DeletedLogsInMemory; + + if (cDebug()) { + LOG(("WARNING: debug logs are not written in multiple instances mode!")); + } + LogsBeforeSingleInstanceChecked.clear(); + } + void writeMain(const QString &v) { time_t t = time(NULL); struct tm tm; @@ -267,7 +409,7 @@ namespace Logs { QString msg(QString("[%1.%2.%3 %4:%5:%6] %7\n").arg(tm.tm_year + 1900).arg(tm.tm_mon + 1, 2, 10, QChar('0')).arg(tm.tm_mday, 2, 10, QChar('0')).arg(tm.tm_hour, 2, 10, QChar('0')).arg(tm.tm_min, 2, 10, QChar('0')).arg(tm.tm_sec, 2, 10, QChar('0')).arg(v)); _logsWrite(LogDataMain, msg); - QString debugmsg(QString("%1 %2\n").arg(LogsData->entryStart()).arg(v)); + QString debugmsg(QString("%1 %2\n").arg(_logsEntryStart()).arg(v)); _logsWrite(LogDataDebug, debugmsg); } @@ -286,7 +428,7 @@ namespace Logs { file = found + 1; } - QString msg(QString("%1 %2 (%3 : %4)\n").arg(LogsData->entryStart()).arg(v).arg(file).arg(line)); + QString msg(QString("%1 %2 (%3 : %4)\n").arg(_logsEntryStart()).arg(v).arg(file).arg(line)); _logsWrite(LogDataDebug, msg); #ifdef Q_OS_WIN @@ -299,15 +441,39 @@ namespace Logs { } void writeTcp(const QString &v) { - QString msg(QString("%1 %2\n").arg(LogsData->entryStart()).arg(v)); + QString msg(QString("%1 %2\n").arg(_logsEntryStart()).arg(v)); _logsWrite(LogDataTcp, msg); } void writeMtp(int32 dc, const QString &v) { - QString msg(QString("%1 (dc:%2) %3\n").arg(LogsData->entryStart()).arg(dc).arg(v)); + QString msg(QString("%1 (dc:%2) %3\n").arg(_logsEntryStart()).arg(dc).arg(v)); _logsWrite(LogDataMtp, msg); } + QString full() { + if (LogsData) { + return LogsData->full(); + } + if (!LogsInMemory || LogsInMemory == DeletedLogsInMemory) { + return LogsBeforeSingleInstanceChecked; + } + + int32 size = 0; + for (LogsInMemoryList::const_iterator i = LogsInMemory->cbegin(), e = LogsInMemory->cend(); i != e; ++i) { + if (i->first == LogDataMain) { + size += i->second.size(); + } + } + QString result; + result.reserve(size); + for (LogsInMemoryList::const_iterator i = LogsInMemory->cbegin(), e = LogsInMemory->cend(); i != e; ++i) { + if (i->first == LogDataMain) { + result += i->second; + } + } + return result; + } + QString vector(const QVector &ids) { if (!ids.size()) return "[]"; QString idsStr = QString("[%1").arg(ids.cbegin()->v); diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index d50a93f5cd..bbfbc46abb 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -29,12 +29,17 @@ namespace Logs { }; bool started(); + bool instanceChecked(); + void multipleInstances(); + void writeMain(const QString &v); void writeDebug(const char *file, int32 line, const QString &v); void writeTcp(const QString &v); void writeMtp(int32 dc, const QString &v); + QString full(); + inline const char *b(bool v) { return v ? "[TRUE]" : "[FALSE]"; } From d672353ff9788e14ab260587cc95845948b7f12d Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 17 Jan 2016 13:03:57 +0800 Subject: [PATCH 024/316] fixed single instance checking --- Telegram/SourceFiles/application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 60f831665a..686db06b7b 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -149,7 +149,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) connect(&_localSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(socketError(QLocalSocket::LocalSocketError))); connect(&_localSocket, SIGNAL(bytesWritten(qint64)), this, SLOT(socketWritten(qint64))); connect(&_localSocket, SIGNAL(readyRead()), this, SLOT(socketReading())); - connect(&_localSocket, SIGNAL(newConnection()), this, SLOT(newInstanceConnected())); + connect(&_localServer, SIGNAL(newConnection()), this, SLOT(newInstanceConnected())); #ifndef TDESKTOP_DISABLE_AUTOUPDATE connect(&_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck())); From 0f4405dbaf93e9cb9397b03a950c8a58c6e88a06 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 21 Jan 2016 14:58:58 +0800 Subject: [PATCH 025/316] backtrace output for win platform added, testing with abort() call in ~AppClass() --- Telegram/SourceFiles/application.cpp | 39 ++- Telegram/SourceFiles/facades.cpp | 3 + Telegram/SourceFiles/facades.h | 1 + Telegram/SourceFiles/logs.cpp | 149 +++++++++++- Telegram/SourceFiles/logs.h | 19 ++ Telegram/SourceFiles/main.cpp | 1 + Telegram/SourceFiles/pspecific_wnd.cpp | 318 ++++++++++++++++++++++++- Telegram/SourceFiles/pspecific_wnd.h | 2 + Telegram/SourceFiles/stdafx.h | 2 + Telegram/SourceFiles/types.cpp | 43 ---- Telegram/SourceFiles/types.h | 2 - 11 files changed, 507 insertions(+), 72 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 686db06b7b..d8137a1136 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -231,6 +231,8 @@ void Application::socketReading() { } void Application::socketError(QLocalSocket::LocalSocketError e) { + if (App::quiting()) return; + if (_secondInstance) { LOG(("Could not write show command, error %1, quiting..").arg(e)); return App::quit(); @@ -265,18 +267,33 @@ void Application::singleInstanceChecked() { if (cManyInstance()) { Logs::multipleInstances(); } - if ((!cManyInstance() && !Logs::instanceChecked()) || !Logs::started()) { - MessageBox(0, (QString::fromStdWString(L"Could not initialize logs!\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); - // show error window - App::quit(); - return; - } Global::start(); - // if crashed, show window and try to autoupdate - - new AppClass(); + if (!Logs::started() || (!cManyInstance() && !Logs::instanceChecked())) { + // show error window + MessageBox(0, (QString::fromStdWString(L"Could not start Telegram Dekstop! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); + App::quit(); + } else { + SignalHandlers::Status status = SignalHandlers::start(); + if (status == SignalHandlers::CantOpen) { + // show error window + MessageBox(0, (QString::fromStdWString(L"Could not start Telegram Dekstop! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); + App::quit(); + } else { + if (status == SignalHandlers::LastCrashed) { + // show error window + MessageBox(0, (QString::fromStdWString(L"Last time Telegram Dekstop crashed! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); + if (SignalHandlers::restart() == SignalHandlers::CantOpen) { + // show error window + MessageBox(0, (QString::fromStdWString(L"Could not start Telegram Dekstop! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); + App::quit(); + return; + } + } + new AppClass(); + } + } } void Application::socketDisconnected() { @@ -638,8 +655,6 @@ AppClass::AppClass() : QObject() , _uploader(0) { AppObject = this; - installSignalHandlers(); - ThirdParty::start(); Sandbox::start(); Local::start(); @@ -1035,6 +1050,8 @@ void AppClass::execExternal(const QString &cmd) { } AppClass::~AppClass() { + abort(); + _window.setParent(0); anim::stopManager(); diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 1be6560e19..2c3fd675fb 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -179,6 +179,8 @@ namespace Notify { struct GlobalDataStruct { QString LangSystemISO; int32 LangSystem = languageDefault; + + QByteArray LastCrashDump; }; GlobalDataStruct *GlobalData = 0; @@ -278,6 +280,7 @@ Type &Ref##Name() { \ DefineGlobalReadOnly(QString, LangSystemISO); DefineGlobalReadOnly(int32, LangSystem); + DefineGlobal(QByteArray, LastCrashDump); } diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 70749a67f2..e86c125d92 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -111,6 +111,7 @@ namespace Global { DeclareGlobalReadOnly(QString, LangSystemISO); DeclareGlobalReadOnly(int32, LangSystem); + DeclareGlobal(QByteArray, LastCrashDump); } diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index d957bdd131..4869f079db 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -267,13 +267,11 @@ namespace Logs { } bool workingDirChosen = cBetaVersion(); - QString moveOldDataFrom; + QString initialWorkingDir = QDir(cWorkingDir()).absolutePath() + '/', moveOldDataFrom; if (cBetaVersion()) { cSetDebug(true); #if (defined Q_OS_MAC || defined Q_OS_LINUX) } else { - QString wasDir = QDir(cWorkingDir()).absolutePath() + '/'; - #ifdef _DEBUG cForceWorkingDir(cExeDir()); #else @@ -284,7 +282,7 @@ namespace Logs { workingDirChosen = true; #if (defined Q_OS_LINUX && !defined _DEBUG) // fix first version - moveOldDataFrom = wasDir; + moveOldDataFrom = initialWorkingDir; #endif #endif @@ -303,17 +301,22 @@ namespace Logs { cForceWorkingDir(QDir(cWorkingDir()).absolutePath() + '/'); QDir().setCurrent(cWorkingDir()); + QDir().mkpath(cWorkingDir() + qstr("tdata")); Global::WorkingDirReady(); - LOG(("Launched version: %1, dev: %2, beta: %3, debug mode: %4, test dc: %5").arg(AppVersion).arg(Logs::b(cDevVersion())).arg(cBetaVersion()).arg(Logs::b(cDebug())).arg(Logs::b(cTestMode()))); - LOG(("Executable dir: %1, name: %2").arg(cExeDir()).arg(cExeName())); - LOG(("Working dir: %1").arg(cWorkingDir())); - LOG(("Arguments: %1").arg(cArguments())); - if (!LogsData->openMain()) { delete LogsData; LogsData = 0; + } + + LOG(("Launched version: %1, dev: %2, beta: %3, debug mode: %4, test dc: %5").arg(AppVersion).arg(Logs::b(cDevVersion())).arg(cBetaVersion()).arg(Logs::b(cDebug())).arg(Logs::b(cTestMode()))); + LOG(("Executable dir: %1, name: %2").arg(cExeDir()).arg(cExeName())); + LOG(("Initial working dir: %1").arg(initialWorkingDir)); + LOG(("Working dir: %1").arg(cWorkingDir())); + LOG(("Arguments: %1").arg(cArguments())); + + if (!LogsData) { LOG(("Could not open '%1' for writing log!").arg(_logsFilePath(LogDataMain, qsl("_startXX")))); return; } @@ -333,11 +336,12 @@ namespace Logs { for (LogsInMemoryList::const_iterator i = list.cbegin(), e = list.cend(); i != e; ++i) { if (i->first == LogDataMain) { _logsWrite(i->first, i->second); + LOG(("First: %1, %2").arg(i->first).arg(i->second)); } } } - LOG(("Logs started.")); + LOG(("Logs started")); } Initializer::~Initializer() { @@ -368,6 +372,8 @@ namespace Logs { return false; } + + if (LogsInMemory) { t_assert(LogsInMemory != DeletedLogsInMemory); LogsInMemoryList list = *LogsInMemory; @@ -539,3 +545,126 @@ void _moveOldDataFiles(const QString &wasDir) { } } } + +namespace SignalHandlers { + + QByteArray CrashDumpPath; + FILE *CrashDumpFile = 0; + int CrashDumpFileNo = 0; + + void _writeChar(char ch) { + fwrite(&ch, 1, 1, CrashDumpFile); + } + + dump::~dump() { + if (CrashDumpFile) { + fflush(CrashDumpFile); + } + } + + const dump &operator<<(const dump &stream, const char *str) { + if (!CrashDumpFile) return stream; + + fwrite(str, 1, strlen(str), CrashDumpFile); + return stream; + } + + const dump &operator<<(const dump &stream, int num) { + if (!CrashDumpFile) return stream; + + if (num < 0) { + _writeChar('-'); + num = -num; + } + int upper = 1, prev = num / 10; + while (prev >= upper) { + upper *= 10; + } + while (upper > 0) { + int digit = (num / upper); + _writeChar('0' + digit); + num -= digit * upper; + upper /= 10; + } + return stream; + } + + void Handler(int signum) { + const char* name = 0; + switch (signum) { + case SIGABRT: name = "SIGABRT"; break; + case SIGSEGV: name = "SIGSEGV"; break; + case SIGILL: name = "SIGILL"; break; + case SIGFPE: name = "SIGFPE"; break; +#ifndef Q_OS_WIN + case SIGBUS: name = "SIGBUS"; break; + case SIGSYS: name = "SIGSYS"; break; +#endif + } + + if (name) { + dump() << "Caught signal " << signum << " (" << name << ")\n"; + } else { + dump() << "Caught signal " << signum << "\n"; + } + dump() << "Platform: "; + switch (cPlatform()) { + case dbipWindows: dump() << "win"; break; + case dbipMac: dump() << "mac"; break; + case dbipMacOld: dump() << "macold"; break; + case dbipLinux64: dump() << "linux64"; break; + case dbipLinux32: dump() << "linux32"; break; + } + dump() << "\n\nBacktrace:\n"; + psWriteStackTrace(CrashDumpFileNo); + } + + Status start() { + CrashDumpPath = (cWorkingDir() + qsl("tdata/working")).toUtf8(); + if (FILE *f = fopen(CrashDumpPath.constData(), "rb")) { + QByteArray lastdump; + char buffer[64 * 1024] = { 0 }; + int32 read = 0; + while ((read = fread(buffer, 1, 64 * 1024, f)) > 0) { + lastdump.append(buffer, read); + } + fclose(f); + + Global::SetLastCrashDump(lastdump); + + LOG(("Opened '%1' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: %2").arg(QString::fromUtf8(CrashDumpPath)).arg(lastdump.size())); + + return LastCrashed; + } + return restart(); + } + + Status restart() { + CrashDumpFile = fopen(CrashDumpPath.constData(), "wb"); + if (CrashDumpFile) { + CrashDumpFileNo = fileno(CrashDumpFile); + + signal(SIGABRT, SignalHandlers::Handler); + signal(SIGSEGV, SignalHandlers::Handler); + signal(SIGILL, SignalHandlers::Handler); + signal(SIGFPE, SignalHandlers::Handler); +#ifndef Q_OS_WIN + signal(SIGBUS, SignalHandlers::Handler); + signal(SIGSYS, SignalHandlers::Handler); +#endif + return Started; + } + + LOG(("Could not open '%1' for writing!").arg(QString::fromUtf8(CrashDumpPath))); + + return CantOpen; + } + + void finish() { + if (CrashDumpFile) { + fclose(CrashDumpFile); + unlink(CrashDumpPath.constData()); + } + } + +} diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index bbfbc46abb..d706ba289c 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -85,3 +85,22 @@ namespace Logs { #define MTP_LOG(dc, msg) { if (cDebug() || !Logs::started()) Logs::writeMtp(dc, QString msg); } //usage MTP_LOG(dc, ("log: %1 %2").arg(1).arg(2)) + +namespace SignalHandlers { + + struct dump { + ~dump(); + }; + const dump &operator<<(const dump &stream, const char *str); + const dump &operator<<(const dump &stream, int num); + + enum Status { + CantOpen, + LastCrashed, + Started + }; + Status start(); + Status restart(); // can be only CantOpen or Started + void finish(); + +} diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index dde5bfaa69..e98700fdac 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -67,5 +67,6 @@ int main(int argc, char *argv[]) { psExecTelegram(); } + SignalHandlers::finish(); return result; } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 847cb761f5..3aa0aaef02 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2368,6 +2368,88 @@ typedef BOOL (FAR STDAPICALLTYPE *t_miniDumpWriteDump)( ); t_miniDumpWriteDump miniDumpWriteDump = 0; +//// SymCleanup() +//typedef BOOL(__stdcall *tSC)(IN HANDLE hProcess); +//tSC pSC; +// +// SymFunctionTableAccess64() +typedef PVOID (FAR STDAPICALLTYPE *t_SymFunctionTableAccess64)(HANDLE hProcess, DWORD64 AddrBase); +t_SymFunctionTableAccess64 symFunctionTableAccess64 = 0; + +//// SymGetLineFromAddr64() +//typedef BOOL(__stdcall *tSGLFA)(IN HANDLE hProcess, IN DWORD64 dwAddr, +// OUT PDWORD pdwDisplacement, OUT PIMAGEHLP_LINE64 Line); +//tSGLFA pSGLFA; +// +// SymGetModuleBase64() +typedef DWORD64 (FAR STDAPICALLTYPE *t_SymGetModuleBase64)(IN HANDLE hProcess, IN DWORD64 dwAddr); +t_SymGetModuleBase64 symGetModuleBase64 = 0; + +//// SymGetModuleInfo64() +//typedef BOOL(__stdcall *tSGMI)(IN HANDLE hProcess, IN DWORD64 dwAddr, OUT IMAGEHLP_MODULE64_V2 *ModuleInfo); +//tSGMI pSGMI; + +// // SymGetModuleInfo64() +// typedef BOOL (__stdcall *tSGMI_V3)( IN HANDLE hProcess, IN DWORD64 dwAddr, OUT IMAGEHLP_MODULE64_V3 *ModuleInfo ); +// tSGMI_V3 pSGMI_V3; + +//// SymGetOptions() +//typedef DWORD(__stdcall *tSGO)(VOID); +//tSGO pSGO; +// +//// SymGetSymFromAddr64() +//typedef BOOL(__stdcall *tSGSFA)(IN HANDLE hProcess, IN DWORD64 dwAddr, +// OUT PDWORD64 pdwDisplacement, OUT PIMAGEHLP_SYMBOL64 Symbol); +//tSGSFA pSGSFA; +// +//// SymInitialize() +//typedef BOOL(__stdcall *tSI)(IN HANDLE hProcess, IN PSTR UserSearchPath, IN BOOL fInvadeProcess); +//tSI pSI; +// +//// SymLoadModule64() +//typedef DWORD64(__stdcall *tSLM)(IN HANDLE hProcess, IN HANDLE hFile, +// IN PSTR ImageName, IN PSTR ModuleName, IN DWORD64 BaseOfDll, IN DWORD SizeOfDll); +//tSLM pSLM; +// +//// SymSetOptions() +//typedef DWORD(__stdcall *tSSO)(IN DWORD SymOptions); +//tSSO pSSO; + +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; + +//// UnDecorateSymbolName() +//typedef DWORD(__stdcall WINAPI *tUDSN)(PCSTR DecoratedName, PSTR UnDecoratedName, +// DWORD UndecoratedLength, DWORD Flags); +//tUDSN pUDSN; +// +//typedef BOOL(__stdcall WINAPI *tSGSP)(HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength); +//tSGSP pSGSP; + +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; + //printf("ReadMemory: hProcess: %p, baseAddr: %p, buffer: %p, size: %d, read: %d, result: %d\n", hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, (DWORD) st, (DWORD) bRet); + return bRet; +} + HANDLE _generateDumpFileAtPath(const WCHAR *path) { static const int maxFileLen = MAX_PATH * 10; @@ -2381,7 +2463,7 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { } } - WCHAR szFileName[maxFileLen]; + WCHAR szFileName[maxFileLen]; WCHAR szExeName[maxFileLen]; wcscpy_s(szExeName, _exeName); @@ -2410,14 +2492,94 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); } +bool LoadDbgHelp() { + if (miniDumpWriteDump) return true; + + HMODULE hDll = 0; + + WCHAR szTemp[4096]; + if (GetModuleFileName(NULL, szTemp, 4096) > 0) { + wcscat(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"); + // 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(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; + + miniDumpWriteDump = (t_miniDumpWriteDump)GetProcAddress(hDll, "MiniDumpWriteDump"); + + //pSI = (tSI)GetProcAddress(m_hDbhHelp, "SymInitialize"); + //pSC = (tSC)GetProcAddress(m_hDbhHelp, "SymCleanup"); + + stackWalk64 = (t_StackWalk64)GetProcAddress(hDll, "StackWalk64"); + //pSGO = (tSGO)GetProcAddress(m_hDbhHelp, "SymGetOptions"); + //pSSO = (tSSO)GetProcAddress(m_hDbhHelp, "SymSetOptions"); + + symFunctionTableAccess64 = (t_SymFunctionTableAccess64)GetProcAddress(hDll, "SymFunctionTableAccess64"); + //pSGLFA = (tSGLFA)GetProcAddress(m_hDbhHelp, "SymGetLineFromAddr64"); + symGetModuleBase64 = (t_SymGetModuleBase64)GetProcAddress(hDll, "SymGetModuleBase64"); + //pSGMI = (tSGMI)GetProcAddress(m_hDbhHelp, "SymGetModuleInfo64"); + ////pSGMI_V3 = (tSGMI_V3) GetProcAddress(m_hDbhHelp, "SymGetModuleInfo64" ); + //pSGSFA = (tSGSFA)GetProcAddress(m_hDbhHelp, "SymGetSymFromAddr64"); + //pUDSN = (tUDSN)GetProcAddress(m_hDbhHelp, "UnDecorateSymbolName"); + //pSLM = (tSLM)GetProcAddress(m_hDbhHelp, "SymLoadModule64"); + //pSGSP = (tSGSP)GetProcAddress(m_hDbhHelp, "SymGetSearchPath"); + + if (!miniDumpWriteDump || + !stackWalk64) { + miniDumpWriteDump = 0; + return false; + } + + //// SymInitialize + //if (szSymPath != NULL) + // m_szSymPath = _strdup(szSymPath); + //if (this->pSI(m_hProcess, m_szSymPath, FALSE) == FALSE) + // this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0); + + //DWORD symOptions = this->pSGO(); // SymGetOptions + //symOptions |= SYMOPT_LOAD_LINES; + //symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS; + ////symOptions |= SYMOPT_NO_PROMPTS; + //// SymSetOptions + //symOptions = this->pSSO(symOptions); + + //char buf[StackWalker::STACKWALK_MAX_NAMELEN] = { 0 }; + //if (this->pSGSP != NULL) + //{ + // if (this->pSGSP(m_hProcess, buf, StackWalker::STACKWALK_MAX_NAMELEN) == FALSE) + // this->m_parent->OnDbgHelpErr("SymGetSearchPath", GetLastError(), 0); + //} + //char szUserName[1024] = { 0 }; + //DWORD dwSize = 1024; + //GetUserNameA(szUserName, &dwSize); + //this->m_parent->OnSymInit(buf, symOptions, szUserName); + + return true; +} + void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) { static const int maxFileLen = MAX_PATH * 10; - HMODULE hDll = LoadLibrary(L"DBGHELP.DLL"); - if (!hDll) return; - - miniDumpWriteDump = (t_miniDumpWriteDump)GetProcAddress(hDll, "MiniDumpWriteDump"); - if (!miniDumpWriteDump) return; + if (!LoadDbgHelp()) return; HANDLE hDumpFile = 0; @@ -2465,6 +2627,150 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_op return 0; } +// stack walking code taken from StackWalker +static const int StackEntryMaxNameLength = 1024; +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; + CHAR lineFileName[StackEntryMaxNameLength]; + DWORD symType; + LPCSTR symTypeString; + CHAR moduleName[StackEntryMaxNameLength]; + DWORD64 baseOfImage; + CHAR loadedImageName[StackEntryMaxNameLength]; +}; + +enum StackEntryType { + StackEntryFirst, + StackEntryNext, + StackEntryLast, +}; + +struct IMAGEHLP_MODULE64_V2 { + DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_MODULE64) + DWORD64 BaseOfImage; // base load address of module + DWORD ImageSize; // virtual size of the loaded module + DWORD TimeDateStamp; // date/time stamp from pe header + DWORD CheckSum; // checksum from the pe header + DWORD NumSyms; // number of symbols in the symbol table + SYM_TYPE SymType; // type of symbols loaded + CHAR ModuleName[32]; // module name + CHAR ImageName[256]; // image name + CHAR LoadedImageName[256]; // symbol file name +}; + +char ImageHlpSymbol64[sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength]; + +void psWriteStackTrace(int n) { + if (!LoadDbgHelp()) return; + + HANDLE hThread = GetCurrentThread(), hProcess = GetCurrentProcess(); + const CONTEXT *context = NULL; + LPVOID pUserData = NULL; + + CONTEXT c; + StackEntry csEntry; + IMAGEHLP_SYMBOL64 *pSym = NULL; + IMAGEHLP_MODULE64_V2 Module; + IMAGEHLP_LINE64 Line; + int frameNum; + + if (!LoadDbgHelp()) { + SignalHandlers::dump() << "ERROR: Could not load dbghelp.dll!\n"; + return; + } + + 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 + + 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); + + for (frameNum = 0; ; ++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; + } + + csEntry.offset = s.AddrPC.Offset; + 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 (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: diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index b5f09d427d..cbda8dc02d 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -117,6 +117,8 @@ extern LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter; LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); +void psWriteStackTrace(int n); + void psDeleteDir(const QString &dir); void psUserActionDone(); diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 44098d9e14..8f285ba201 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -22,6 +22,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #define PSAPI_VERSION 1 // fix WinXP //#define Q_NO_TEMPLATE_FRIENDS // fix some compiler difference issues +#include + #include #include #include diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 6835e4956f..7a1bdd1701 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -22,8 +22,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "application.h" -#include - uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; #ifdef Q_OS_WIN @@ -309,47 +307,6 @@ namespace ThirdParty { } -namespace { - FILE *_crashDump = 0; - int _crashDumpNo = 0; -} - -void _signalHandler(int signum) { - const char* name = 0; - switch (signum) { - case SIGABRT: name = "SIGABRT"; break; - case SIGSEGV: name = "SIGSEGV"; break; - case SIGILL: name = "SIGILL"; break; - case SIGFPE: name = "SIGFPE"; break; -#ifndef Q_OS_WIN - case SIGBUS: name = "SIGBUS"; break; - case SIGSYS: name = "SIGSYS"; break; -#endif - } - LOG(("Caught signal %1").arg(name)); - if (name) - fprintf(stdout, "Caught signal %d (%s)\n", signum, name); - else - fprintf(stdout, "Caught signal %d\n", signum); - - - //printStackTrace(); -} - -void installSignalHandlers() { - _crashDump = fopen((cWorkingDir() + qsl("tdata/working")).toUtf8().constData(), "wb"); - if (_crashDump) _crashDumpNo = fileno(_crashDump); - - signal(SIGABRT, _signalHandler); - signal(SIGSEGV, _signalHandler); - signal(SIGILL, _signalHandler); - signal(SIGFPE, _signalHandler); -#ifndef Q_OS_WIN - signal(SIGBUS, _signalHandler); - signal(SIGSYS, _signalHandler); -#endif -} - bool checkms() { int64 unixms = (myunixtime() - _timeStart) * 1000LL + _msAddToUnixtime; int64 ms = int64(getms(true)); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 50ddd51e99..d7043d70bb 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -143,8 +143,6 @@ inline void mylocaltime(struct tm * _Tm, const time_t * _Time) { #endif } -void installSignalHandlers(); - namespace ThirdParty { void start(); From c8d7d23ee6b9a1ebe0e705583075aa8eca1ed3b6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 25 Jan 2016 13:22:58 +0300 Subject: [PATCH 026/316] windows backtrace logging done, showing error when cant start telegram or previous launch was not finished properly --- Telegram/SourceFiles/application.cpp | 23 +- Telegram/SourceFiles/history.cpp | 4 +- Telegram/SourceFiles/logs.cpp | 83 +++- Telegram/SourceFiles/logs.h | 2 + Telegram/SourceFiles/main.cpp | 2 + Telegram/SourceFiles/pspecific_wnd.cpp | 615 +++++++++++++++++++------ Telegram/SourceFiles/pspecific_wnd.h | 4 +- Telegram/SourceFiles/settings.cpp | 3 + Telegram/SourceFiles/settings.h | 1 + Telegram/SourceFiles/types.cpp | 2 +- Telegram/SourceFiles/window.cpp | 59 +++ Telegram/SourceFiles/window.h | 41 +- 12 files changed, 661 insertions(+), 178 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index d8137a1136..49baf5714c 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -271,26 +271,14 @@ void Application::singleInstanceChecked() { Global::start(); if (!Logs::started() || (!cManyInstance() && !Logs::instanceChecked())) { - // show error window - MessageBox(0, (QString::fromStdWString(L"Could not start Telegram Dekstop! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); - App::quit(); + new NotStartedWindow(); } else { SignalHandlers::Status status = SignalHandlers::start(); if (status == SignalHandlers::CantOpen) { - // show error window - MessageBox(0, (QString::fromStdWString(L"Could not start Telegram Dekstop! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); - App::quit(); + new NotStartedWindow(); + } else if (status == SignalHandlers::LastCrashed) { + new LastCrashedWindow(); } else { - if (status == SignalHandlers::LastCrashed) { - // show error window - MessageBox(0, (QString::fromStdWString(L"Last time Telegram Dekstop crashed! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); - if (SignalHandlers::restart() == SignalHandlers::CantOpen) { - // show error window - MessageBox(0, (QString::fromStdWString(L"Could not start Telegram Dekstop! Log:\n\n") + Logs::full()).toStdWString().c_str(), L"Error!", MB_ICONERROR); - App::quit(); - return; - } - } new AppClass(); } } @@ -1050,10 +1038,7 @@ void AppClass::execExternal(const QString &cmd) { } AppClass::~AppClass() { - abort(); - _window.setParent(0); - anim::stopManager(); stopWebLoadManager(); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 4cd226f2db..2168eaccaf 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4000,7 +4000,8 @@ HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedi , _linkcancell(new DocumentCancelLink(_data)) , _name(other._name) , _namew(other._namew) -, _thumbw(other._thumbw) { +, _thumbw(other._thumbw) +, _caption(other._caption) { setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); setStatusSize(other._statusSize); @@ -4378,6 +4379,7 @@ HistoryGif::HistoryGif(const HistoryGif &other) : HistoryFileMedia() , _data(other._data) , _thumbw(other._thumbw) , _thumbh(other._thumbh) +, _caption(other._caption) , _gif(0) { setLinks(new GifOpenLink(_data), new GifOpenLink(_data), new DocumentCancelLink(_data)); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 4869f079db..46c8cc9df0 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -551,6 +551,7 @@ namespace SignalHandlers { QByteArray CrashDumpPath; FILE *CrashDumpFile = 0; int CrashDumpFileNo = 0; + char LaunchedDateTimeStr[32] = { 0 }; void _writeChar(char ch) { fwrite(&ch, 1, 1, CrashDumpFile); @@ -569,26 +570,43 @@ namespace SignalHandlers { return stream; } - const dump &operator<<(const dump &stream, int num) { + template + const dump &_writeNumber(const dump &stream, Type number) { if (!CrashDumpFile) return stream; - if (num < 0) { + if (number < 0) { _writeChar('-'); - num = -num; + number = -number; } - int upper = 1, prev = num / 10; + Type upper = 1, prev = number / 10; while (prev >= upper) { upper *= 10; } while (upper > 0) { - int digit = (num / upper); + int digit = (number / upper); _writeChar('0' + digit); - num -= digit * upper; + number -= digit * upper; upper /= 10; } return stream; } + const dump &operator<<(const dump &stream, int num) { + return _writeNumber(stream, num); + } + + const dump &operator<<(const dump &stream, DWORD num) { + return _writeNumber(stream, num); + } + + const dump &operator<<(const dump &stream, DWORD64 num) { + return _writeNumber(stream, num); + } + + Qt::HANDLE LoggingCrashThreadId = 0; + bool LoggingCrashHeaderWritten = false; + QMutex LoggingCrashMutex; + void Handler(int signum) { const char* name = 0; switch (signum) { @@ -602,21 +620,48 @@ namespace SignalHandlers { #endif } + Qt::HANDLE thread = QThread::currentThreadId(); + if (thread == LoggingCrashThreadId) return; + + QMutexLocker lock(&LoggingCrashMutex); + LoggingCrashThreadId = thread; + + if (!LoggingCrashHeaderWritten) { + LoggingCrashHeaderWritten = true; + if (cBetaVersion()) { + dump() << "Version: " << cBetaVersion() << " beta\n"; + } else { + dump() << "Version: " << AppVersion; + if (cDevVersion()) { + dump() << " dev\n"; + } else { + dump() << "\n"; + } + } + dump() << "Launched: " << LaunchedDateTimeStr << "\n"; + dump() << "Platform: "; + switch (cPlatform()) { + case dbipWindows: dump() << "win"; break; + case dbipMac: dump() << "mac"; break; + case dbipMacOld: dump() << "macold"; break; + case dbipLinux64: dump() << "linux64"; break; + case dbipLinux32: dump() << "linux32"; break; + } + dump() << "\n"; + psWriteDump(); + dump() << "\n"; + } if (name) { - dump() << "Caught signal " << signum << " (" << name << ")\n"; + dump() << "Caught signal " << signum << " (" << name << ") in thread " << uint64(thread) << "\n"; } else { - dump() << "Caught signal " << signum << "\n"; + dump() << "Caught signal " << signum << " in thread " << uint64(thread) << "\n"; } - dump() << "Platform: "; - switch (cPlatform()) { - case dbipWindows: dump() << "win"; break; - case dbipMac: dump() << "mac"; break; - case dbipMacOld: dump() << "macold"; break; - case dbipLinux64: dump() << "linux64"; break; - case dbipLinux32: dump() << "linux32"; break; - } - dump() << "\n\nBacktrace:\n"; + + dump() << "\nBacktrace:\n"; psWriteStackTrace(CrashDumpFileNo); + dump() << "\n"; + + LoggingCrashThreadId = 0; } Status start() { @@ -644,6 +689,10 @@ namespace SignalHandlers { if (CrashDumpFile) { CrashDumpFileNo = fileno(CrashDumpFile); + QByteArray launchedDateTime = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8(); + t_assert(launchedDateTime.size() < sizeof(LaunchedDateTimeStr)); + memcpy(LaunchedDateTimeStr, launchedDateTime.constData(), launchedDateTime.size()); + signal(SIGABRT, SignalHandlers::Handler); signal(SIGSEGV, SignalHandlers::Handler); signal(SIGILL, SignalHandlers::Handler); diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index d706ba289c..80282ef4c3 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -93,6 +93,8 @@ namespace SignalHandlers { }; const dump &operator<<(const dump &stream, const char *str); const dump &operator<<(const dump &stream, int num); + const dump &operator<<(const dump &stream, DWORD num); + const dump &operator<<(const dump &stream, DWORD64 num); enum Status { CantOpen, diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index e98700fdac..b70d2faff7 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -37,6 +37,8 @@ int main(int argc, char *argv[]) { return psFixPrevious(); } else if (cLaunchMode() == LaunchModeCleanup) { return psCleanup(); + } else if (cLaunchMode() == LaunchModeShowCrash) { + return psShowCrash(QFileInfo(cStartUrl()).absoluteFilePath()); } Logs::Initializer _logs; diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 3aa0aaef02..61c6043c74 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2368,52 +2368,76 @@ typedef BOOL (FAR STDAPICALLTYPE *t_miniDumpWriteDump)( ); t_miniDumpWriteDump miniDumpWriteDump = 0; -//// SymCleanup() -//typedef BOOL(__stdcall *tSC)(IN HANDLE hProcess); -//tSC pSC; -// -// SymFunctionTableAccess64() -typedef PVOID (FAR STDAPICALLTYPE *t_SymFunctionTableAccess64)(HANDLE hProcess, DWORD64 AddrBase); +// 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; -//// SymGetLineFromAddr64() -//typedef BOOL(__stdcall *tSGLFA)(IN HANDLE hProcess, IN DWORD64 dwAddr, -// OUT PDWORD pdwDisplacement, OUT PIMAGEHLP_LINE64 Line); -//tSGLFA pSGLFA; -// -// SymGetModuleBase64() -typedef DWORD64 (FAR STDAPICALLTYPE *t_SymGetModuleBase64)(IN HANDLE hProcess, IN DWORD64 dwAddr); +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; -//// SymGetModuleInfo64() -//typedef BOOL(__stdcall *tSGMI)(IN HANDLE hProcess, IN DWORD64 dwAddr, OUT IMAGEHLP_MODULE64_V2 *ModuleInfo); -//tSGMI pSGMI; +typedef BOOL (FAR STDAPICALLTYPE *t_SymGetModuleInfo64)( + _In_ HANDLE hProcess, + _In_ DWORD64 qwAddr, + _Out_ PIMAGEHLP_MODULEW64 ModuleInfo +); +t_SymGetModuleInfo64 symGetModuleInfo64 = 0; -// // SymGetModuleInfo64() -// typedef BOOL (__stdcall *tSGMI_V3)( IN HANDLE hProcess, IN DWORD64 dwAddr, OUT IMAGEHLP_MODULE64_V3 *ModuleInfo ); -// tSGMI_V3 pSGMI_V3; +typedef DWORD (FAR STDAPICALLTYPE *t_SymGetOptions)( + VOID +); +t_SymGetOptions symGetOptions = 0; -//// SymGetOptions() -//typedef DWORD(__stdcall *tSGO)(VOID); -//tSGO pSGO; -// -//// SymGetSymFromAddr64() -//typedef BOOL(__stdcall *tSGSFA)(IN HANDLE hProcess, IN DWORD64 dwAddr, -// OUT PDWORD64 pdwDisplacement, OUT PIMAGEHLP_SYMBOL64 Symbol); -//tSGSFA pSGSFA; -// -//// SymInitialize() -//typedef BOOL(__stdcall *tSI)(IN HANDLE hProcess, IN PSTR UserSearchPath, IN BOOL fInvadeProcess); -//tSI pSI; -// -//// SymLoadModule64() -//typedef DWORD64(__stdcall *tSLM)(IN HANDLE hProcess, IN HANDLE hFile, -// IN PSTR ImageName, IN PSTR ModuleName, IN DWORD64 BaseOfDll, IN DWORD SizeOfDll); -//tSLM pSLM; -// -//// SymSetOptions() -//typedef DWORD(__stdcall *tSSO)(IN DWORD SymOptions); -//tSSO pSSO; +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, @@ -2428,13 +2452,20 @@ typedef BOOL (FAR STDAPICALLTYPE *t_StackWalk64)( ); t_StackWalk64 stackWalk64 = 0; -//// UnDecorateSymbolName() -//typedef DWORD(__stdcall WINAPI *tUDSN)(PCSTR DecoratedName, PSTR UnDecoratedName, -// DWORD UndecoratedLength, DWORD Flags); -//tUDSN pUDSN; -// -//typedef BOOL(__stdcall WINAPI *tSGSP)(HANDLE hProcess, PSTR SearchPath, DWORD SearchPathLength); -//tSGSP pSGSP; +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, @@ -2442,11 +2473,11 @@ BOOL __stdcall ReadProcessMemoryRoutine64( _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; - //printf("ReadMemory: hProcess: %p, baseAddr: %p, buffer: %p, size: %d, read: %d, result: %d\n", hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, (DWORD) st, (DWORD) bRet); + return bRet; } @@ -2492,8 +2523,38 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); } -bool LoadDbgHelp() { - if (miniDumpWriteDump) return true; +// **************************************** 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 (miniDumpWriteDump && (!extended || symInitialize)) return true; HMODULE hDll = 0; @@ -2526,52 +2587,158 @@ bool LoadDbgHelp() { miniDumpWriteDump = (t_miniDumpWriteDump)GetProcAddress(hDll, "MiniDumpWriteDump"); - //pSI = (tSI)GetProcAddress(m_hDbhHelp, "SymInitialize"); - //pSC = (tSC)GetProcAddress(m_hDbhHelp, "SymCleanup"); - stackWalk64 = (t_StackWalk64)GetProcAddress(hDll, "StackWalk64"); - //pSGO = (tSGO)GetProcAddress(m_hDbhHelp, "SymGetOptions"); - //pSSO = (tSSO)GetProcAddress(m_hDbhHelp, "SymSetOptions"); - symFunctionTableAccess64 = (t_SymFunctionTableAccess64)GetProcAddress(hDll, "SymFunctionTableAccess64"); - //pSGLFA = (tSGLFA)GetProcAddress(m_hDbhHelp, "SymGetLineFromAddr64"); symGetModuleBase64 = (t_SymGetModuleBase64)GetProcAddress(hDll, "SymGetModuleBase64"); - //pSGMI = (tSGMI)GetProcAddress(m_hDbhHelp, "SymGetModuleInfo64"); - ////pSGMI_V3 = (tSGMI_V3) GetProcAddress(m_hDbhHelp, "SymGetModuleInfo64" ); - //pSGSFA = (tSGSFA)GetProcAddress(m_hDbhHelp, "SymGetSymFromAddr64"); - //pUDSN = (tUDSN)GetProcAddress(m_hDbhHelp, "UnDecorateSymbolName"); - //pSLM = (tSLM)GetProcAddress(m_hDbhHelp, "SymLoadModule64"); - //pSGSP = (tSGSP)GetProcAddress(m_hDbhHelp, "SymGetSearchPath"); if (!miniDumpWriteDump || - !stackWalk64) { + !stackWalk64 || + !symFunctionTableAccess64 || + !symGetModuleBase64) { miniDumpWriteDump = 0; return false; } - //// SymInitialize - //if (szSymPath != NULL) - // m_szSymPath = _strdup(szSymPath); - //if (this->pSI(m_hProcess, m_szSymPath, FALSE) == FALSE) - // this->m_parent->OnDbgHelpErr("SymInitialize", GetLastError(), 0); + if (extended) { + HANDLE hProcess = GetCurrentProcess(); + DWORD dwProcessId = GetCurrentProcessId(); - //DWORD symOptions = this->pSGO(); // SymGetOptions - //symOptions |= SYMOPT_LOAD_LINES; - //symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS; - ////symOptions |= SYMOPT_NO_PROMPTS; - //// SymSetOptions - //symOptions = this->pSSO(symOptions); + 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; + } - //char buf[StackWalker::STACKWALK_MAX_NAMELEN] = { 0 }; - //if (this->pSGSP != NULL) - //{ - // if (this->pSGSP(m_hProcess, buf, StackWalker::STACKWALK_MAX_NAMELEN) == FALSE) - // this->m_parent->OnDbgHelpErr("SymGetSearchPath", GetLastError(), 0); - //} - //char szUserName[1024] = { 0 }; - //DWORD dwSize = 1024; - //GetUserNameA(szUserName, &dwSize); - //this->m_parent->OnSymInit(buf, symOptions, szUserName); + 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); + + //WCHAR buf[StackEntryMaxNameLength] = { 0 }; + //if (symGetSearchPath) { + // if (symGetSearchPath(hProcess, buf, StackEntryMaxNameLength) == FALSE) { + // return false; + // } + //} + + //WCHAR szUserName[1024] = { 0 }; + //DWORD dwSize = 1024; + //GetUserName(szUserName, &dwSize); + + 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; } @@ -2627,8 +2794,6 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_op return 0; } -// stack walking code taken from StackWalker -static const int StackEntryMaxNameLength = 1024; struct StackEntry { DWORD64 offset; // if 0, we have no valid entry CHAR name[StackEntryMaxNameLength]; @@ -2637,12 +2802,12 @@ struct StackEntry { DWORD64 offsetFromSmybol; DWORD offsetFromLine; DWORD lineNumber; - CHAR lineFileName[StackEntryMaxNameLength]; + WCHAR lineFileName[StackEntryMaxNameLength]; DWORD symType; LPCSTR symTypeString; - CHAR moduleName[StackEntryMaxNameLength]; + WCHAR moduleName[StackEntryMaxNameLength]; DWORD64 baseOfImage; - CHAR loadedImageName[StackEntryMaxNameLength]; + WCHAR loadedImageName[StackEntryMaxNameLength]; }; enum StackEntryType { @@ -2651,40 +2816,204 @@ enum StackEntryType { StackEntryLast, }; -struct IMAGEHLP_MODULE64_V2 { - DWORD SizeOfStruct; // set to sizeof(IMAGEHLP_MODULE64) - DWORD64 BaseOfImage; // base load address of module - DWORD ImageSize; // virtual size of the loaded module - DWORD TimeDateStamp; // date/time stamp from pe header - DWORD CheckSum; // checksum from the pe header - DWORD NumSyms; // number of symbols in the symbol table - SYM_TYPE SymType; // type of symbols loaded - CHAR ModuleName[32]; // module name - CHAR ImageName[256]; // image name - CHAR LoadedImageName[256]; // symbol file name -}; +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() { + 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]; +QString _showCrashDump(const QByteArray &crashdump) { + HANDLE hProcess = GetCurrentProcess(); -void psWriteStackTrace(int n) { - if (!LoadDbgHelp()) return; + 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; + } + } + 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()) { + if (QFile(tolaunch).exists()) { + // run it + return QString(); + } else { + result.append(qsl("ERROR: executable '%1' for this crashdump was not found!").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'); + } + } + } + return result; +} + +void psWriteStackTrace(int file) { + 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; - StackEntry csEntry; - IMAGEHLP_SYMBOL64 *pSym = NULL; - IMAGEHLP_MODULE64_V2 Module; - IMAGEHLP_LINE64 Line; int frameNum; - if (!LoadDbgHelp()) { - SignalHandlers::dump() << "ERROR: Could not load dbghelp.dll!\n"; - return; - } - memset(&c, 0, sizeof(CONTEXT)); c.ContextFlags = CONTEXT_FULL; RtlCaptureContext(&c); @@ -2724,18 +3053,7 @@ void psWriteStackTrace(int n) { #error "Platform not supported!" #endif - 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); - - for (frameNum = 0; ; ++frameNum) { + for (frameNum = 0; frameNum < 1000; ++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 @@ -2746,16 +3064,6 @@ void psWriteStackTrace(int n) { return; } - csEntry.offset = s.AddrPC.Offset; - 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 (s.AddrPC.Offset == s.AddrReturn.Offset) { SignalHandlers::dump() << s.AddrPC.Offset << "\n"; SignalHandlers::dump() << "ERROR: StackWalk64() endless callstack!"; @@ -2771,6 +3079,41 @@ void psWriteStackTrace(int n) { } } +int psShowCrash(const QString &crashdump) { + QString text; + + QFile dump(crashdump); + if (dump.open(QIODevice::ReadOnly)) { + text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); + if (!LoadDbgHelp(true)) { + text += qsl("ERROR: could not init dbghelp.dll!"); + } else { + text += _showCrashDump(dump.readAll()); + symCleanup(GetCurrentProcess()); + } + } else { + text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); + } + + WCHAR szTemp[MAX_PATH + 1] = { 0 }; + GetModuleFileName(NULL, szTemp, MAX_PATH); + + QByteArray args[] = { QString::fromWCharArray(szTemp).toUtf8() }; + int a_argc = 1; + char *a_argv[1] = { args[0].data() }; + QApplication app(a_argc, a_argv); + + QTextEdit wnd; + wnd.setReadOnly(true); + wnd.setPlainText(text); + + QRect scr(QApplication::primaryScreen()->availableGeometry()); + wnd.setGeometry(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6), scr.width() / 2, scr.height() / 2); + wnd.show(); + + return app.exec(); +} + class StringReferenceWrapper { public: diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index cbda8dc02d..053945f3b0 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -117,7 +117,9 @@ extern LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter; LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); -void psWriteStackTrace(int n); +void psWriteDump(); +void psWriteStackTrace(int file); +int psShowCrash(const QString &crashdump); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index d025443e97..f539a3a037 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -215,6 +215,9 @@ void settingsParseArgs(int argc, char *argv[]) { gLaunchMode = LaunchModeFixPrevious; } else if (string("-cleanup") == argv[i]) { gLaunchMode = LaunchModeCleanup; + } else if (string("-crash") == argv[i] && i + 1 < argc) { + gLaunchMode = LaunchModeShowCrash; + gStartUrl = fromUtf8Safe(argv[++i]); } else if (string("-noupdate") == argv[i]) { gNoStartUpdate = true; } else if (string("-tosettings") == argv[i]) { diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index ffbb8ea3a4..3272b83364 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -87,6 +87,7 @@ enum LaunchMode { LaunchModeAutoStart, LaunchModeFixPrevious, LaunchModeCleanup, + LaunchModeShowCrash, }; DeclareReadSetting(LaunchMode, LaunchMode); DeclareSetting(QString, WorkingDir); diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 7a1bdd1701..18ffcc395a 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -293,7 +293,7 @@ namespace ThirdParty { av_register_all(); avcodec_register_all(); - av_lockmgr_register(_ffmpegLockManager); +// av_lockmgr_register(_ffmpegLockManager); _sslInited = true; } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 004a88fee0..7c6ad727e7 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1825,3 +1825,62 @@ Window::~Window() { delete main; delete settings; } + +NotStartedWindow::NotStartedWindow() : TWidget(0) +, _label(this) +, _log(this) { + _label.setText(qsl("Could not start Telegram Desktop! Log:")); + _label.show(); + + _log.setReadOnly(true); + _log.setPlainText(Logs::full()); + _log.show(); + + QRect scr(QApplication::primaryScreen()->availableGeometry()); + setGeometry(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6), scr.width() / 2, scr.height() / 2); + show(); +} + +void NotStartedWindow::closeEvent(QCloseEvent *e) { + deleteLater(); +} + +void NotStartedWindow::resizeEvent(QResizeEvent *e) { + int padding = _label.sizeHint().height() / 2; + _label.setGeometry(padding, padding, width() - 2 * padding, _label.sizeHint().height()); + _log.setGeometry(padding, padding * 2 + _label.sizeHint().height(), width() - 2 * padding, height() - 3 * padding - _label.sizeHint().height()); +} + +LastCrashedWindow::LastCrashedWindow() : TWidget(0) +, _label(this) +, _log(this) +, _send(this) { + _label.setText(qsl("Could not start Telegram Desktop! Log:")); + _label.show(); + + _log.setReadOnly(true); + _log.setPlainText(Logs::full()); + _log.show(); + + _send.setText(qsl("Send Crash Report")); + _send.show(); + + QRect scr(QApplication::primaryScreen()->availableGeometry()); + setGeometry(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6), scr.width() / 2, scr.height() / 2); + show(); +} + +void LastCrashedWindow::closeEvent(QCloseEvent *e) { + deleteLater(); + if (SignalHandlers::restart() == SignalHandlers::CantOpen) { + new NotStartedWindow(); + } else { + new AppClass(); + } +} + +void LastCrashedWindow::resizeEvent(QResizeEvent *e) { + int padding = _label.sizeHint().height() / 2; + _label.setGeometry(padding, padding, width() - 2 * padding, _label.sizeHint().height()); + _log.setGeometry(padding, padding * 2 + _label.sizeHint().height(), width() - 2 * padding, height() - 3 * padding - _label.sizeHint().height()); +} diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index 9d514387b0..535ec3f4ed 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -169,7 +169,7 @@ public: QRect clientRect() const; QRect photoRect() const; - + IntroWidget *introWidget(); MainWidget *mainWidget(); SettingsWidget *settingsWidget(); @@ -245,12 +245,12 @@ public slots: void updateIsActive(int timeout = 0); void stateChanged(Qt::WindowState state); - + void checkHistoryActivation(); void updateCounter(); void checkAutoLock(); - + void showSettings(); void hideSettings(bool fast = false); void layerHidden(); @@ -353,4 +353,39 @@ private: MediaView *_mediaView; }; +class NotStartedWindow : public TWidget { +public: + + NotStartedWindow(); + +protected: + + void closeEvent(QCloseEvent *e); + void resizeEvent(QResizeEvent *e); + +private: + + QLabel _label; + QTextEdit _log; + +}; + +class LastCrashedWindow : public TWidget { +public: + + LastCrashedWindow(); + +protected: + + void closeEvent(QCloseEvent *e); + void resizeEvent(QResizeEvent *e); + +private: + + QLabel _label; + QTextEdit _log; + QPushButton _send; + +}; + #endif // MAINWINDOW_H From a677f784f5748bb9e9244f0b6b71bbbfc9e283ad Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 25 Jan 2016 18:18:07 +0300 Subject: [PATCH 027/316] up to 64 realtime combinated interfaces --- Telegram/SourceFiles/layout.cpp | 20 ++-- Telegram/SourceFiles/layout.h | 52 +------- Telegram/SourceFiles/overviewwidget.cpp | 28 ++--- Telegram/SourceFiles/structs.cpp | 33 +++++ Telegram/SourceFiles/structs.h | 153 ++++++++++++++++++++++++ 5 files changed, 216 insertions(+), 70 deletions(-) diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index e987cb60e3..6ae5e52858 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -293,9 +293,9 @@ void LayoutAbstractFileItem::setStatusSize(int32 newSize, int32 fullSize, int32 } } -LayoutOverviewDate::LayoutOverviewDate(const QDate &date, bool month) - : _date(date) - , _text(month ? langMonthFull(date) : langDayOfMonthFull(date)) { +LayoutOverviewDate::LayoutOverviewDate(const QDate &date, bool month) : LayoutItem(OverviewItemInfo::Bit()) +, _date(date) +, _text(month ? langMonthFull(date) : langDayOfMonthFull(date)) { } void LayoutOverviewDate::initDimensions() { @@ -311,7 +311,7 @@ void LayoutOverviewDate::paint(Painter &p, const QRect &clip, uint32 selection, } } -LayoutOverviewPhoto::LayoutOverviewPhoto(PhotoData *photo, HistoryItem *parent) : LayoutMediaItem(parent) +LayoutOverviewPhoto::LayoutOverviewPhoto(PhotoData *photo, HistoryItem *parent) : LayoutMediaItem(0, parent) , _data(photo) , _link(new PhotoLink(photo)) , _goodLoaded(false) { @@ -385,7 +385,7 @@ void LayoutOverviewPhoto::getState(TextLinkPtr &link, HistoryCursorState &cursor } } -LayoutOverviewVideo::LayoutOverviewVideo(VideoData *video, HistoryItem *parent) : LayoutAbstractFileItem(parent) +LayoutOverviewVideo::LayoutOverviewVideo(VideoData *video, HistoryItem *parent) : LayoutAbstractFileItem(0, parent) , _data(video) , _duration(formatDurationText(_data->duration)) , _thumbLoaded(false) { @@ -550,7 +550,7 @@ void LayoutOverviewVideo::updateStatusText() const { } } -LayoutOverviewAudio::LayoutOverviewAudio(AudioData *audio, HistoryItem *parent) : LayoutAbstractFileItem(parent) +LayoutOverviewAudio::LayoutOverviewAudio(AudioData *audio, HistoryItem *parent) : LayoutAbstractFileItem(OverviewItemInfo::Bit(), parent) , _data(audio) , _namel(new AudioOpenLink(_data)) { setLinks(new AudioOpenLink(_data), new AudioOpenLink(_data), new AudioCancelLink(_data)); @@ -738,7 +738,7 @@ bool LayoutOverviewAudio::updateStatusText() const { return showPause; } -LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryItem *parent) : LayoutAbstractFileItem(parent) +LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryItem *parent) : LayoutAbstractFileItem(OverviewItemInfo::Bit(), parent) , _data(document) , _msgl(new MessageLink(parent)) , _namel(new DocumentOpenLink(_data)) @@ -1061,7 +1061,7 @@ namespace { } } -LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent) : LayoutMediaItem(parent) +LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent) : LayoutMediaItem(OverviewItemInfo::Bit(), parent) , _titlew(0) , _page(0) , _pixw(0) @@ -1319,8 +1319,8 @@ LayoutOverviewLink::Link::Link(const QString &url, const QString &text) , lnk(linkFromUrl(url)) { } -LayoutInlineItem::LayoutInlineItem(InlineResult *result, DocumentData *doc, PhotoData *photo) -: _result(result) +LayoutInlineItem::LayoutInlineItem(InlineResult *result, DocumentData *doc, PhotoData *photo) : LayoutItem(0) +, _result(result) , _doc(doc) , _photo(photo) , _position(0) { diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index 0b346456c6..c7303adc95 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -101,11 +101,9 @@ public: }; class LayoutMediaItem; -class OverviewItemInfo; - -class LayoutItem { +class LayoutItem : public Interfaces { public: - LayoutItem() : _maxw(0), _minh(0) { + LayoutItem(uint64 i_mask) : Interfaces(i_mask), _maxw(0), _minh(0) { } int32 maxWidth() const { @@ -163,12 +161,6 @@ public: virtual DocumentData *getDocument() const { return 0; } - virtual OverviewItemInfo *getOverviewItemInfo() { - return 0; - } - virtual const OverviewItemInfo *getOverviewItemInfo() const { - return 0; - } MsgId msgId() const { const HistoryItem *item = getItem(); return item ? item->id : 0; @@ -182,7 +174,7 @@ protected: class LayoutMediaItem : public LayoutItem { public: - LayoutMediaItem(HistoryItem *parent) : _parent(parent) { + LayoutMediaItem(uint64 i_mask, HistoryItem *parent) : LayoutItem(i_mask), _parent(parent) { } virtual LayoutMediaItem *toLayoutMediaItem() { @@ -202,7 +194,7 @@ protected: class LayoutRadialProgressItem : public LayoutMediaItem { public: - LayoutRadialProgressItem(HistoryItem *parent) : LayoutMediaItem(parent) + LayoutRadialProgressItem(uint64 i_mask, HistoryItem *parent) : LayoutMediaItem(i_mask, parent) , _radial(0) , a_iconOver(0, 0) , _a_iconOver(animation(this, &LayoutRadialProgressItem::step_iconOver)) { @@ -248,7 +240,7 @@ private: class LayoutAbstractFileItem : public LayoutRadialProgressItem { public: - LayoutAbstractFileItem(HistoryItem *parent) : LayoutRadialProgressItem(parent) { + LayoutAbstractFileItem(uint64 i_mask, HistoryItem *parent) : LayoutRadialProgressItem(i_mask, parent) { } protected: @@ -276,7 +268,7 @@ public: }; -class OverviewItemInfo { +class OverviewItemInfo : public BasicInterface { public: OverviewItemInfo() : _top(0) { } @@ -299,16 +291,7 @@ public: virtual void initDimensions(); virtual void paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const; - virtual OverviewItemInfo *getOverviewItemInfo() { - return &_info; - } - virtual const OverviewItemInfo *getOverviewItemInfo() const { - return &_info; - } - private: - OverviewItemInfo _info; - QDate _date; QString _text; @@ -374,13 +357,6 @@ public: virtual void paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const; virtual void getState(TextLinkPtr &link, HistoryCursorState &cursor, int32 x, int32 y) const; - virtual OverviewItemInfo *getOverviewItemInfo() { - return &_info; - } - virtual const OverviewItemInfo *getOverviewItemInfo() const { - return &_info; - } - protected: virtual float64 dataProgress() const { return _data->progress(); @@ -396,7 +372,6 @@ protected: } private: - OverviewItemInfo _info; AudioData *_data; TextLinkPtr _namel; @@ -419,12 +394,6 @@ public: virtual DocumentData *getDocument() const { return _data; } - virtual OverviewItemInfo *getOverviewItemInfo() { - return &_info; - } - virtual const OverviewItemInfo *getOverviewItemInfo() const { - return &_info; - } protected: virtual float64 dataProgress() const { @@ -441,7 +410,6 @@ protected: } private: - OverviewItemInfo _info; DocumentData *_data; TextLinkPtr _msgl, _namel; @@ -468,15 +436,7 @@ public: virtual void paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const; virtual void getState(TextLinkPtr &link, HistoryCursorState &cursor, int32 x, int32 y) const; - virtual OverviewItemInfo *getOverviewItemInfo() { - return &_info; - } - virtual const OverviewItemInfo *getOverviewItemInfo() const { - return &_info; - } - private: - OverviewItemInfo _info; TextLinkPtr _photol; QString _title, _letter; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 4f8f6dd03c..4c13164d4a 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -355,7 +355,7 @@ void OverviewInner::repaintItem(MsgId itemId, int32 itemIndex) { int32 row = (_photosToAdd + shownAtIndex) / _photosInRow, col = (_photosToAdd + shownAtIndex) % _photosInRow; update(int32(col * w), _marginTop + int32(row * vsize), qCeil(w), vsize); } else { - int32 top = _items.at(itemIndex)->getOverviewItemInfo()->top(); + int32 top = _items.at(itemIndex)->Get()->top(); if (_reversed) top = _height - top; update(_rowsLeft, _marginTop + top, _rowWidth, _items.at(itemIndex)->height()); } @@ -729,7 +729,7 @@ QPoint OverviewInner::mapMouseToItem(QPoint p, MsgId itemId, int32 itemIndex) { p.setX(p.x() - int32(col * w) - st::overviewPhotoSkip); p.setY(p.y() - _marginTop - row * (_rowWidth + st::overviewPhotoSkip) - st::overviewPhotoSkip); } else { - int32 top = _items.at(itemIndex)->getOverviewItemInfo()->top(); + int32 top = _items.at(itemIndex)->Get()->top(); if (_reversed) top = _height - top; p.setY(p.y() - _marginTop - top); } @@ -765,7 +765,7 @@ int32 OverviewInner::itemTop(const FullMsgId &msgId) const { int32 itemIndex = -1; fixItemIndex(itemIndex, (msgId.channel == _channel) ? msgId.msg : ((_migrated && msgId.channel == _migrated->channelId()) ? -msgId.msg : 0)); if (itemIndex >= 0) { - int32 top = _items.at(itemIndex)->getOverviewItemInfo()->top(); + int32 top = _items.at(itemIndex)->Get()->top(); if (_reversed) top = _height - top; return _marginTop + top; } @@ -879,10 +879,10 @@ void OverviewInner::paintEvent(QPaintEvent *e) { int32 y = 0, w = _rowWidth; for (int32 j = 0, l = _items.size(); j < l; ++j) { int32 i = _reversed ? (l - j - 1) : j, nexti = _reversed ? (i - 1) : (i + 1); - int32 nextItemTop = (j + 1 == l) ? (_reversed ? 0 : _height) : _items.at(nexti)->getOverviewItemInfo()->top(); + int32 nextItemTop = (j + 1 == l) ? (_reversed ? 0 : _height) : _items.at(nexti)->Get()->top(); if (_reversed) nextItemTop = _height - nextItemTop; if (_marginTop + nextItemTop > r.top()) { - OverviewItemInfo *info = _items.at(i)->getOverviewItemInfo(); + OverviewItemInfo *info = _items.at(i)->Get(); int32 curY = info->top(); if (_reversed) curY = _height - curY; if (_marginTop + curY >= r.y() + r.height()) break; @@ -944,10 +944,10 @@ void OverviewInner::onUpdateSelected() { for (int32 j = 0, l = _items.size(); j < l; ++j) { bool lastItem = (j + 1 == l); int32 i = _reversed ? (l - j - 1) : j, nexti = _reversed ? (i - 1) : (i + 1); - int32 nextItemTop = lastItem ? (_reversed ? 0 : _height) : _items.at(nexti)->getOverviewItemInfo()->top(); + int32 nextItemTop = lastItem ? (_reversed ? 0 : _height) : _items.at(nexti)->Get()->top(); if (_reversed) nextItemTop = _height - nextItemTop; if (_marginTop + nextItemTop > m.y() || lastItem) { - int32 top = _items.at(i)->getOverviewItemInfo()->top(); + int32 top = _items.at(i)->Get()->top(); if (_reversed) top = _height - top; if (!_items.at(i)->toLayoutMediaItem()) { // day item int32 h = _items.at(i)->height(); @@ -956,11 +956,11 @@ void OverviewInner::onUpdateSelected() { if (i > 0 && (beforeItem || i == _items.size() - 1)) { --i; if (!_items.at(i)->toLayoutMediaItem()) break; // wtf - top = _items.at(i)->getOverviewItemInfo()->top(); + top = _items.at(i)->Get()->top(); } else if (i < _items.size() - 1 && (!beforeItem || !i)) { ++i; if (!_items.at(i)->toLayoutMediaItem()) break; // wtf - top = _items.at(i)->getOverviewItemInfo()->top(); + top = _items.at(i)->Get()->top(); } else { break; // wtf } @@ -1385,7 +1385,7 @@ int32 OverviewInner::resizeToWidth(int32 nwidth, int32 scrollTop, int32 minHeigh for (int32 i = 0, l = _items.size(); i < l; ++i) { int32 h = _items.at(i)->resizeGetHeight(_rowWidth); if (resize) { - _items.at(i)->getOverviewItemInfo()->setTop(_height + (_reversed ? h : 0)); + _items.at(i)->Get()->setTop(_height + (_reversed ? h : 0)); _height += h; } } @@ -1746,7 +1746,7 @@ void OverviewInner::mediaOverviewUpdated() { if (allGood) { if (_items.size() > index && complexMsgId(_items.at(index)->getItem()) == msgid) { if (withDates) prevDate = _items.at(index)->getItem()->date.date(); - top = _items.at(index)->getOverviewItemInfo()->top(); + top = _items.at(index)->Get()->top(); if (!_reversed) { top += _items.at(index)->height(); } @@ -1756,7 +1756,7 @@ void OverviewInner::mediaOverviewUpdated() { if (_items.size() > index + 1 && !_items.at(index)->toLayoutMediaItem() && complexMsgId(_items.at(index + 1)->getItem()) == msgid) { // day item ++index; if (withDates) prevDate = _items.at(index)->getItem()->date.date(); - top = _items.at(index)->getOverviewItemInfo()->top(); + top = _items.at(index)->Get()->top(); if (!_reversed) { top += _items.at(index)->height(); } @@ -1877,7 +1877,7 @@ void OverviewInner::repaintItem(const HistoryItem *msg) { if (history == _migrated) msgid = -msgid; for (int32 i = 0, l = _items.size(); i != l; ++i) { if (complexMsgId(_items.at(i)->getItem()) == msgid) { - int32 top = _items.at(i)->getOverviewItemInfo()->top(); + int32 top = _items.at(i)->Get()->top(); if (_reversed) top = _height - top; update(_rowsLeft, _marginTop + top, _rowWidth, _items.at(i)->height()); break; @@ -1982,7 +1982,7 @@ int32 OverviewInner::setLayoutItem(int32 index, LayoutItem *item, int32 top) { _items.push_back(item); } int32 h = item->resizeGetHeight(_rowWidth); - if (OverviewItemInfo *info = item->getOverviewItemInfo()) { + if (OverviewItemInfo *info = item->Get()) { info->setTop(top + (_reversed ? h : 0)); } return h; diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 34bd47fba4..1660203d18 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -34,6 +34,39 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "audio.h" #include "localstorage.h" +class InterfacesMetadatasMap : public QMap { +public: + ~InterfacesMetadatasMap() { + for (const_iterator i = cbegin(), e = cend(); i != e; ++i) { + delete i.value(); + } + } +}; + +const InterfacesMetadata *GetInterfacesMetadata(uint64 mask) { + typedef QMap InterfacesMetadatasMap; + static InterfacesMetadatasMap InterfacesMetadatas; + static QMutex InterfacesMetadatasMutex; + + QMutexLocker lock(&InterfacesMetadatasMutex); + InterfacesMetadatasMap::const_iterator i = InterfacesMetadatas.constFind(mask); + if (i == InterfacesMetadatas.cend()) { + InterfacesMetadata *meta = new InterfacesMetadata(mask); + if (!meta) { // terminate if we can't allocate memory + throw "Can't allocate memory!"; + } + + i = InterfacesMetadatas.insert(mask, meta); + } + return i.value(); +} + +InterfaceWrapStruct InterfaceWraps[64] = { + { 0, 0, 0 } +}; + +QAtomicInt InterfaceIndexLast(0); + namespace { int32 peerColorIndex(const PeerId &peer) { int32 myId(MTP::authedId()), peerId(peerToBareInt(peer)); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 8de9bf0c5d..cdb0fe83b3 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -20,6 +20,159 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #pragma once +class Interfaces; +typedef void(*InterfaceConstruct)(void *location, Interfaces *interfaces); +typedef void(*InterfaceDestruct)(void *location); + +struct InterfaceWrapStruct { + int Size; + InterfaceConstruct Construct; + InterfaceDestruct Destruct; +}; + +template +struct CeilDivideMinimumOne { + static const int Result = ((Value / Denominator) + ((!Value || (Value % Denominator)) ? 1 : 0)); +}; + +template +struct InterfaceWrapTemplate { + static const int Size = CeilDivideMinimumOne::Result * sizeof(uint64); + static void Construct(void *location, Interfaces *interfaces) { + (new (location) Type())->interfaces = interfaces; + } + static void Destruct(void *location) { + ((Type*)location)->~Type(); + } +}; + +extern InterfaceWrapStruct InterfaceWraps[64]; +extern QAtomicInt InterfaceIndexLast; + +template +class BasicInterface { +public: + static int Index() { + static QAtomicInt _index(0); + if (int index = _index.loadAcquire()) { + return index - 1; + } + while (true) { + int last = InterfaceIndexLast.loadAcquire(); + if (InterfaceIndexLast.testAndSetOrdered(last, last + 1)) { + t_assert(last < 64); + if (_index.testAndSetOrdered(0, last + 1)) { + InterfaceWraps[last] = { InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct }; + } + break; + } + } + return _index.loadAcquire() - 1; + } + static const uint64 Bit() { + return (1 << Index()); + } + Interfaces *interfaces = 0; +}; + +class InterfacesMetadata { +public: + + InterfacesMetadata(uint64 mask) : _mask(mask), size(0), last(64) { + for (int i = 0; i < 64; ++i) { + uint64 m = (1 << i); + if (_mask & m) { + int s = InterfaceWraps[i].Size; + if (s) { + offsets[i] = size; + size += s; + } else { + offsets[i] = -1; + } + } else if (_mask < m) { + last = i; + for (; i < 64; ++i) { + offsets[i] = -1; + } + } else { + offsets[i] = -1; + } + } + } + + int size, last; + int offsets[64]; + +private: + uint64 _mask; + +}; + +const InterfacesMetadata *GetInterfacesMetadata(uint64 mask); + +class Interfaces { +public: + + Interfaces(uint64 mask = 0) : _meta(GetInterfacesMetadata(mask)), _data(0) { + if (_meta->size) { + _data = malloc(_meta->size); + if (!_data) { // terminate if we can't allocate memory + throw "Can't allocate memory!"; + } + + for (int i = 0; i < _meta->last; ++i) { + int offset = _meta->offsets[i]; + if (offset >= 0) { + try { + InterfaceWraps[i].Construct(_dataptrunsafe(offset), this); + } catch (...) { + while (i > 0) { + --i; + offset = _meta->offsets[--i]; + if (offset >= 0) { + InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); + } + } + throw; + } + } + } + } + } + ~Interfaces() { + if (_data) { + for (int i = 0; i < _meta->last; ++i) { + int offset = _meta->offsets[i]; + if (offset >= 0) { + InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); + } + } + free(_data); + } + } + + template + Type *Get() { + return (Type*)_dataptr(_meta->offsets[Type::Index()]); + } + template + const Type *Get() const { + return (const Type*)_dataptr(_meta->offsets[Type::Index()]); + } + +private: + + void *_dataptrunsafe(int skip) const { + return (char*)_data + skip; + } + void *_dataptr(int skip) const { + return (skip >= 0) ? _dataptrunsafe(skip) : 0; + } + const InterfacesMetadata *_meta; + void *_data; + +}; + typedef int32 ChannelId; static const ChannelId NoChannel = 0; From 07c81db79a3a6fe917007444f0d4fb9559ea40bf Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 26 Jan 2016 13:24:15 +0300 Subject: [PATCH 028/316] removed interfaces pointer by default from BasicInterface --- Telegram/SourceFiles/layout.h | 2 +- Telegram/SourceFiles/structs.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index c7303adc95..f4bead1ec0 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -270,7 +270,7 @@ public: class OverviewItemInfo : public BasicInterface { public: - OverviewItemInfo() : _top(0) { + OverviewItemInfo(Interfaces *) : _top(0) { } int32 top() const { return _top; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index cdb0fe83b3..6bfa3bb701 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -39,7 +39,7 @@ template struct InterfaceWrapTemplate { static const int Size = CeilDivideMinimumOne::Result * sizeof(uint64); static void Construct(void *location, Interfaces *interfaces) { - (new (location) Type())->interfaces = interfaces; + new (location) Type(interfaces); } static void Destruct(void *location) { ((Type*)location)->~Type(); @@ -72,6 +72,14 @@ public: static const uint64 Bit() { return (1 << Index()); } + +}; + +template +class BasicInterfaceWithPointer : public BasicInterface { +public: + BasicInterfaceWithPointer(Interfaces *interfaces) : interfaces(interfaces) { + } Interfaces *interfaces = 0; }; From 62c28cb58b69498a41d20a99f6547dee39eb742d Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 26 Jan 2016 14:01:15 +0300 Subject: [PATCH 029/316] fixed possible crash in History::addOlderSlice --- Telegram/SourceFiles/history.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2168eaccaf..c2c9e79649 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1918,11 +1918,6 @@ void History::addOlderSlice(const QVector &slice, const QVectorconstData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; HistoryItem *oldFirst = 0, *last = 0; - if (!blocks.isEmpty()) { - t_assert(blocks.size() > 1); - oldFirst = blocks.at(1)->items.front(); - } - HistoryBlock *block = new HistoryBlock(this); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (QVector::const_iterator i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -1947,6 +1942,10 @@ void History::addOlderSlice(const QVector &slice, const QVector 1); + oldFirst = blocks.at(1)->items.front(); + } while (oldFirst && last && oldFirst->type() == HistoryItemGroup && last->type() == HistoryItemGroup) { static_cast(last)->uniteWith(static_cast(oldFirst)); oldFirst->destroy(); From 8eef239b457ea15aa5868413ee73a29470757793 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 30 Jan 2016 19:31:10 +0300 Subject: [PATCH 030/316] crash catch + report added for Windows version --- Telegram/SourceFiles/_other/crypt.h | 131 ++ Telegram/SourceFiles/_other/ioapi.h | 208 +++ Telegram/SourceFiles/_other/zip.c | 2007 +++++++++++++++++++++++ Telegram/SourceFiles/_other/zip.h | 362 ++++ Telegram/SourceFiles/app.cpp | 11 +- Telegram/SourceFiles/application.cpp | 28 +- Telegram/SourceFiles/application.h | 4 +- Telegram/SourceFiles/dropdown.cpp | 2 +- Telegram/SourceFiles/facades.cpp | 8 + Telegram/SourceFiles/facades.h | 2 + Telegram/SourceFiles/gui/images.cpp | 8 +- Telegram/SourceFiles/gui/images.h | 34 +- Telegram/SourceFiles/gui/twidget.cpp | 17 +- Telegram/SourceFiles/gui/twidget.h | 4 + Telegram/SourceFiles/logs.cpp | 11 + Telegram/SourceFiles/pspecific_wnd.cpp | 27 +- Telegram/SourceFiles/settings.cpp | 4 + Telegram/SourceFiles/settingswidget.cpp | 12 +- Telegram/SourceFiles/settingswidget.h | 10 +- Telegram/SourceFiles/stdafx.h | 1 + Telegram/SourceFiles/sysbuttons.cpp | 7 +- Telegram/SourceFiles/title.cpp | 11 +- Telegram/SourceFiles/window.cpp | 1054 +++++++++++- Telegram/SourceFiles/window.h | 184 ++- Telegram/Telegram.vcxproj | 8 +- Telegram/Telegram.vcxproj.filters | 12 + 26 files changed, 4057 insertions(+), 110 deletions(-) create mode 100644 Telegram/SourceFiles/_other/crypt.h create mode 100644 Telegram/SourceFiles/_other/ioapi.h create mode 100644 Telegram/SourceFiles/_other/zip.c create mode 100644 Telegram/SourceFiles/_other/zip.h diff --git a/Telegram/SourceFiles/_other/crypt.h b/Telegram/SourceFiles/_other/crypt.h new file mode 100644 index 0000000000..1e9e8200b2 --- /dev/null +++ b/Telegram/SourceFiles/_other/crypt.h @@ -0,0 +1,131 @@ +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab) +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(const char* passwd, /* password string */ + unsigned char* buf, /* where to write header */ + int bufSize, + unsigned long* pkeys, + const z_crc_t* pcrc_32_tab, + unsigned long crcForCrypting) +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/Telegram/SourceFiles/_other/ioapi.h b/Telegram/SourceFiles/_other/ioapi.h new file mode 100644 index 0000000000..8dcbdb06e3 --- /dev/null +++ b/Telegram/SourceFiles/_other/ioapi.h @@ -0,0 +1,208 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + + Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) + Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. + More if/def section may be needed to support other platforms + Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. + (but you should use iowin32.c for windows instead) + +*/ + +#ifndef _ZLIBIOAPI64_H +#define _ZLIBIOAPI64_H + +#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) + + // Linux needs this to support file operation on files larger then 4+GB + // But might need better if/def to select just the platforms that needs them. + + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 + #endif + #ifndef __USE_LARGEFILE64 + #define __USE_LARGEFILE64 + #endif + #ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #ifndef _FILE_OFFSET_BIT + #define _FILE_OFFSET_BIT 64 + #endif + +#endif + +#include +#include +#include "zlib.h" + +#if defined(USE_FILE32API) +#define fopen64 fopen +#define ftello64 ftell +#define fseeko64 fseek +#else +#ifdef __FreeBSD__ +#define fopen64 fopen +#define ftello64 ftello +#define fseeko64 fseeko +#endif +#ifdef _MSC_VER + #define fopen64 fopen + #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) + #define ftello64 _ftelli64 + #define fseeko64 _fseeki64 + #else // old MSC + #define ftello64 ftell + #define fseeko64 fseek + #endif +#endif +#endif + +/* +#ifndef ZPOS64_T + #ifdef _WIN32 + #define ZPOS64_T fpos_t + #else + #include + #define ZPOS64_T uint64_t + #endif +#endif +*/ + +#ifdef HAVE_MINIZIP64_CONF_H +#include "mz64conf.h" +#endif + +/* a type choosen by DEFINE */ +#ifdef HAVE_64BIT_INT_CUSTOM +typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; +#else +#ifdef HAS_STDINT_H +#include "stdint.h" +typedef uint64_t ZPOS64_T; +#else + +/* Maximum unsigned 32-bit value used as placeholder for zip64 */ +#define MAXU32 0xffffffff + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef unsigned __int64 ZPOS64_T; +#else +typedef unsigned long long int ZPOS64_T; +#endif +#endif +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) + #define ZCALLBACK CALLBACK + #else + #define ZCALLBACK + #endif +#endif + + + + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + + +/* here is the "old" 32 bits structure structure */ +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); + +typedef struct zlib_filefunc64_def_s +{ + open64_file_func zopen64_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell64_file_func ztell64_file; + seek64_file_func zseek64_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc64_def; + +void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +/* now internal definition, only for zip.c and unzip.h */ +typedef struct zlib_filefunc64_32_def_s +{ + zlib_filefunc64_def zfile_func64; + open_file_func zopen32_file; + tell_file_func ztell32_file; + seek_file_func zseek32_file; +} zlib_filefunc64_32_def; + + +#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) +#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) + +voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); +long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); +ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); + +#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) +#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) +#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Telegram/SourceFiles/_other/zip.c b/Telegram/SourceFiles/_other/zip.c new file mode 100644 index 0000000000..ea54853e85 --- /dev/null +++ b/Telegram/SourceFiles/_other/zip.c @@ -0,0 +1,2007 @@ +/* zip.c -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + Oct-2009 - Mathias Svensson - Remove old C style function prototypes + Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives + Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions. + Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data + It is used when recreting zip archive with RAW when deleting items from a zip. + ZIP64 data is automaticly added to items that needs it, and existing ZIP64 data need to be removed. + Oct-2009 - Mathias Svensson - Added support for BZIP2 as compression mode (bzip2 lib is required) + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + +*/ + + +#include +#include +#include +#include +#include "zlib.h" +#include "zip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x0) /* platform depedent */ +#endif + +#ifndef Z_BUFSIZE +#define Z_BUFSIZE (64*1024) //(16384) +#endif + +#ifndef Z_MAXFILENAMEINZIP +#define Z_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +/* +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) +*/ + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + + +// NOT sure that this work on ALL platform +#define MAKEULONG64(a, b) ((ZPOS64_T)(((unsigned long)(a)) | ((ZPOS64_T)((unsigned long)(b))) << 32)) + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +const char zip_copyright[] =" zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + + +#define SIZEDATA_INDATABLOCK (4096-(4*4)) + +#define LOCALHEADERMAGIC (0x04034b50) +#define CENTRALHEADERMAGIC (0x02014b50) +#define ENDHEADERMAGIC (0x06054b50) +#define ZIP64ENDHEADERMAGIC (0x6064b50) +#define ZIP64ENDLOCHEADERMAGIC (0x7064b50) + +#define FLAG_LOCALHEADER_OFFSET (0x06) +#define CRC_LOCALHEADER_OFFSET (0x0e) + +#define SIZECENTRALHEADER (0x2e) /* 46 */ + +typedef struct linkedlist_datablock_internal_s +{ + struct linkedlist_datablock_internal_s* next_datablock; + uLong avail_in_this_block; + uLong filled_in_this_block; + uLong unused; /* for future use and alignement */ + unsigned char data[SIZEDATA_INDATABLOCK]; +} linkedlist_datablock_internal; + +typedef struct linkedlist_data_s +{ + linkedlist_datablock_internal* first_block; + linkedlist_datablock_internal* last_block; +} linkedlist_data; + + +typedef struct +{ + z_stream stream; /* zLib stream structure for inflate */ +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + int stream_initialised; /* 1 is stream is initialised */ + uInt pos_in_buffered_data; /* last written byte in buffered_data */ + + ZPOS64_T pos_local_header; /* offset of the local header of the file + currenty writing */ + char* central_header; /* central header data for the current file */ + uLong size_centralExtra; + uLong size_centralheader; /* size of the central header for cur file */ + uLong size_centralExtraFree; /* Extra bytes allocated to the centralheader but that are not used */ + uLong flag; /* flag of the file currently writing */ + + int method; /* compression method of file currenty wr.*/ + int raw; /* 1 for directly writing raw data */ + Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ + uLong dosDate; + uLong crc32; + int encrypt; + int zip64; /* Add ZIP64 extened information in the extra field */ + ZPOS64_T pos_zip64extrainfo; + ZPOS64_T totalCompressedData; + ZPOS64_T totalUncompressedData; +#ifndef NOCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const z_crc_t* pcrc_32_tab; + int crypt_header_size; +#endif +} curfile64_info; + +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + linkedlist_data central_dir;/* datablock with central dir in construction*/ + int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ + curfile64_info ci; /* info on the file curretly writing */ + + ZPOS64_T begin_pos; /* position of the beginning of the zipfile */ + ZPOS64_T add_position_when_writting_offset; + ZPOS64_T number_entry; + +#ifndef NO_ADDFILEINEXISTINGZIP + char *globalcomment; +#endif + +} zip64_internal; + + +#ifndef NOCRYPT +#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED +#include "crypt.h" +#endif + +local linkedlist_datablock_internal* allocate_new_datablock() +{ + linkedlist_datablock_internal* ldi; + ldi = (linkedlist_datablock_internal*) + ALLOC(sizeof(linkedlist_datablock_internal)); + if (ldi!=NULL) + { + ldi->next_datablock = NULL ; + ldi->filled_in_this_block = 0 ; + ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; + } + return ldi; +} + +local void free_datablock(linkedlist_datablock_internal* ldi) +{ + while (ldi!=NULL) + { + linkedlist_datablock_internal* ldinext = ldi->next_datablock; + TRYFREE(ldi); + ldi = ldinext; + } +} + +local void init_linkedlist(linkedlist_data* ll) +{ + ll->first_block = ll->last_block = NULL; +} + +local void free_linkedlist(linkedlist_data* ll) +{ + free_datablock(ll->first_block); + ll->first_block = ll->last_block = NULL; +} + + +local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len) +{ + linkedlist_datablock_internal* ldi; + const unsigned char* from_copy; + + if (ll==NULL) + return ZIP_INTERNALERROR; + + if (ll->last_block == NULL) + { + ll->first_block = ll->last_block = allocate_new_datablock(); + if (ll->first_block == NULL) + return ZIP_INTERNALERROR; + } + + ldi = ll->last_block; + from_copy = (unsigned char*)buf; + + while (len>0) + { + uInt copy_this; + uInt i; + unsigned char* to_copy; + + if (ldi->avail_in_this_block==0) + { + ldi->next_datablock = allocate_new_datablock(); + if (ldi->next_datablock == NULL) + return ZIP_INTERNALERROR; + ldi = ldi->next_datablock ; + ll->last_block = ldi; + } + + if (ldi->avail_in_this_block < len) + copy_this = (uInt)ldi->avail_in_this_block; + else + copy_this = (uInt)len; + + to_copy = &(ldi->data[ldi->filled_in_this_block]); + + for (i=0;ifilled_in_this_block += copy_this; + ldi->avail_in_this_block -= copy_this; + from_copy += copy_this ; + len -= copy_this; + } + return ZIP_OK; +} + + + +/****************************************************************************/ + +#ifndef NO_ADDFILEINEXISTINGZIP +/* =========================================================================== + Inputs a long in LSB order to the given file + nbByte == 1, 2 ,4 or 8 (byte, short or long, ZPOS64_T) +*/ + +local int zip64local_putValue OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte)); +local int zip64local_putValue (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T x, int nbByte) +{ + unsigned char buf[8]; + int n; + for (n = 0; n < nbByte; n++) + { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + + if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + return ZIP_ERRNO; + else + return ZIP_OK; +} + +local void zip64local_putValue_inmemory OF((void* dest, ZPOS64_T x, int nbByte)); +local void zip64local_putValue_inmemory (void* dest, ZPOS64_T x, int nbByte) +{ + unsigned char* buf=(unsigned char*)dest; + int n; + for (n = 0; n < nbByte; n++) { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } +} + +/****************************************************************************/ + + +local uLong zip64local_TmzDateToDosDate(const tm_zip* ptm) +{ + uLong year = (uLong)ptm->tm_year; + if (year>=1980) + year-=1980; + else if (year>=80) + year-=80; + return + (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | + ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); +} + + +/****************************************************************************/ + +local int zip64local_getByte OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)); + +local int zip64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def,voidpf filestream,int* pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return ZIP_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return ZIP_ERRNO; + else + return ZIP_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int zip64local_getShort OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); + +local int zip64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) +{ + uLong x ; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int zip64local_getLong OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong *pX)); + +local int zip64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, uLong* pX) +{ + uLong x ; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int zip64local_getLong64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)); + + +local int zip64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX) +{ + ZPOS64_T x; + int i = 0; + int err; + + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<8; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<16; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<24; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<32; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<40; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<48; + + if (err==ZIP_OK) + err = zip64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((ZPOS64_T)i)<<56; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + + return err; +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T zip64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); + +local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* +Locate the End of Zip64 Central directory locator and from there find the CD of a zipfile (at the end, just before +the global comment) +*/ +local ZPOS64_T zip64local_SearchCentralDir64 OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); + +local ZPOS64_T zip64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + { + // Signature "0x07064b50" Zip64 end of central directory locater + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + } + + if (uPosFound!=0) + break; + } + + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (zip64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=ZIP_OK) + return 0; + + /* total number of disks */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto Zip64 end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (zip64local_getLong(pzlib_filefunc_def,filestream,&uL)!=ZIP_OK) + return 0; + + if (uL != 0x06064b50) // signature of 'Zip64 end of central directory' + return 0; + + return relativeOffset; +} + +int LoadCentralDirectoryRecord(zip64_internal* pziinit) +{ + int err=ZIP_OK; + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory */ + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry; + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + uLong VersionMadeBy; + uLong VersionNeeded; + uLong size_comment; + + int hasZIP64Record = 0; + + // check first if we find a ZIP64 record + central_pos = zip64local_SearchCentralDir64(&pziinit->z_filefunc,pziinit->filestream); + if(central_pos > 0) + { + hasZIP64Record = 1; + } + else if(central_pos == 0) + { + central_pos = zip64local_SearchCentralDir(&pziinit->z_filefunc,pziinit->filestream); + } + +/* disable to allow appending to empty ZIP archive + if (central_pos==0) + err=ZIP_ERRNO; +*/ + + if(hasZIP64Record) + { + ZPOS64_T sizeEndOfCentralDirectory; + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos, ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* size of zip64 end of central directory record */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &sizeEndOfCentralDirectory)!=ZIP_OK) + err=ZIP_ERRNO; + + /* version made by */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionMadeBy)!=ZIP_OK) + err=ZIP_ERRNO; + + /* version needed to extract */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &VersionNeeded)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream, &number_entry)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central directory */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&number_entry_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&size_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (zip64local_getLong64(&pziinit->z_filefunc, pziinit->filestream,&offset_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + // TODO.. + // read the comment from the standard central header. + size_comment = 0; + } + else + { + // Read End of central Directory info + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir on this disk */ + number_entry = 0; + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + number_entry = uL; + + /* total number of entries in the central dir */ + number_entry_CD = 0; + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + number_entry_CD = uL; + + if ((number_entry_CD!=number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + size_central_dir = 0; + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + size_central_dir = uL; + + /* offset of start of central directory with respect to the starting disk number */ + offset_central_dir = 0; + if (zip64local_getLong(&pziinit->z_filefunc, pziinit->filestream, &uL)!=ZIP_OK) + err=ZIP_ERRNO; + else + offset_central_dir = uL; + + + /* zipfile global comment length */ + if (zip64local_getShort(&pziinit->z_filefunc, pziinit->filestream, &size_comment)!=ZIP_OK) + err=ZIP_ERRNO; + } + + if ((central_posz_filefunc, pziinit->filestream); + return ZIP_ERRNO; + } + + if (size_comment>0) + { + pziinit->globalcomment = (char*)ALLOC(size_comment+1); + if (pziinit->globalcomment) + { + size_comment = ZREAD64(pziinit->z_filefunc, pziinit->filestream, pziinit->globalcomment,size_comment); + pziinit->globalcomment[size_comment]=0; + } + } + + byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir); + pziinit->add_position_when_writting_offset = byte_before_the_zipfile; + + { + ZPOS64_T size_central_dir_to_read = size_central_dir; + size_t buf_size = SIZEDATA_INDATABLOCK; + void* buf_read = (void*)ALLOC(buf_size); + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir + byte_before_the_zipfile, ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + while ((size_central_dir_to_read>0) && (err==ZIP_OK)) + { + ZPOS64_T read_this = SIZEDATA_INDATABLOCK; + if (read_this > size_central_dir_to_read) + read_this = size_central_dir_to_read; + + if (ZREAD64(pziinit->z_filefunc, pziinit->filestream,buf_read,(uLong)read_this) != read_this) + err=ZIP_ERRNO; + + if (err==ZIP_OK) + err = add_data_in_datablock(&pziinit->central_dir,buf_read, (uLong)read_this); + + size_central_dir_to_read-=read_this; + } + TRYFREE(buf_read); + } + pziinit->begin_pos = byte_before_the_zipfile; + pziinit->number_entry = number_entry_CD; + + if (ZSEEK64(pziinit->z_filefunc, pziinit->filestream, offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + return err; +} + + +#endif /* !NO_ADDFILEINEXISTINGZIP*/ + + +/************************************************************/ +extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) +{ + zip64_internal ziinit; + zip64_internal* zi; + int err=ZIP_OK; + + ziinit.z_filefunc.zseek32_file = NULL; + ziinit.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); + else + ziinit.z_filefunc = *pzlib_filefunc64_32_def; + + ziinit.filestream = ZOPEN64(ziinit.z_filefunc, + pathname, + (append == APPEND_STATUS_CREATE) ? + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); + + if (ziinit.filestream == NULL) + return NULL; + + if (append == APPEND_STATUS_CREATEAFTER) + ZSEEK64(ziinit.z_filefunc,ziinit.filestream,0,SEEK_END); + + ziinit.begin_pos = ZTELL64(ziinit.z_filefunc,ziinit.filestream); + ziinit.in_opened_file_inzip = 0; + ziinit.ci.stream_initialised = 0; + ziinit.number_entry = 0; + ziinit.add_position_when_writting_offset = 0; + init_linkedlist(&(ziinit.central_dir)); + + + + zi = (zip64_internal*)ALLOC(sizeof(zip64_internal)); + if (zi==NULL) + { + ZCLOSE64(ziinit.z_filefunc,ziinit.filestream); + return NULL; + } + + /* now we add file in a zipfile */ +# ifndef NO_ADDFILEINEXISTINGZIP + ziinit.globalcomment = NULL; + if (append == APPEND_STATUS_ADDINZIP) + { + // Read and Cache Central Directory Records + err = LoadCentralDirectoryRecord(&ziinit); + } + + if (globalcomment) + { + *globalcomment = ziinit.globalcomment; + } +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + + if (err != ZIP_OK) + { +# ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(ziinit.globalcomment); +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + TRYFREE(zi); + return NULL; + } + else + { + *zi = ziinit; + return (zipFile)zi; + } +} + +extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) +{ + if (pzlib_filefunc32_def != NULL) + { + zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; + fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def); + return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill); + } + else + return zipOpen3(pathname, append, globalcomment, NULL); +} + +extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) +{ + if (pzlib_filefunc_def != NULL) + { + zlib_filefunc64_32_def zlib_filefunc64_32_def_fill; + zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def; + zlib_filefunc64_32_def_fill.ztell32_file = NULL; + zlib_filefunc64_32_def_fill.zseek32_file = NULL; + return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill); + } + else + return zipOpen3(pathname, append, globalcomment, NULL); +} + + + +extern zipFile ZEXPORT zipOpen (const char* pathname, int append) +{ + return zipOpen3((const void*)pathname,append,NULL,NULL); +} + +extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append) +{ + return zipOpen3(pathname,append,NULL,NULL); +} + +int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) +{ + /* write the local header */ + int err; + uInt size_filename = (uInt)strlen(filename); + uInt size_extrafield = size_extrafield_local; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC, 4); + + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2);/* version needed to extract */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); + + // CRC / Compressed size / Uncompressed size will be filled in later and rewritten later + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* compressed size, unknown */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ + } + if (err==ZIP_OK) + { + if(zi->ci.zip64) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xFFFFFFFF,4); /* uncompressed size, unknown */ + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); + + if(zi->ci.zip64) + { + size_extrafield += 20; + } + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield,2); + + if ((err==ZIP_OK) && (size_filename > 0)) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) + err = ZIP_ERRNO; + } + + if ((err==ZIP_OK) && (size_extrafield_local > 0)) + { + if (ZWRITE64(zi->z_filefunc, zi->filestream, extrafield_local, size_extrafield_local) != size_extrafield_local) + err = ZIP_ERRNO; + } + + + if ((err==ZIP_OK) && (zi->ci.zip64)) + { + // write the Zip64 extended info + short HeaderID = 1; + short DataSize = 16; + ZPOS64_T CompressedSize = 0; + ZPOS64_T UncompressedSize = 0; + + // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file) + zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream); + + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2); + + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8); + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8); + } + + return err; +} + +/* + NOTE. + When writing RAW the ZIP64 extended information in extrafield_local and extrafield_global needs to be stripped + before calling this function it can be done with zipRemoveExtraInfoBlock + + It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize + unnecessary allocations. + */ +extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase, int zip64) +{ + zip64_internal* zi; + uInt size_filename; + uInt size_comment; + uInt i; + int err = ZIP_OK; + +# ifdef NOCRYPT + (crcForCrypting); + if (password != NULL) + return ZIP_PARAMERROR; +# endif + + if (file == NULL) + return ZIP_PARAMERROR; + +#ifdef HAVE_BZIP2 + if ((method!=0) && (method!=Z_DEFLATED) && (method!=Z_BZIP2ED)) + return ZIP_PARAMERROR; +#else + if ((method!=0) && (method!=Z_DEFLATED)) + return ZIP_PARAMERROR; +#endif + + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + if (err != ZIP_OK) + return err; + } + + if (filename==NULL) + filename="-"; + + if (comment==NULL) + size_comment = 0; + else + size_comment = (uInt)strlen(comment); + + size_filename = (uInt)strlen(filename); + + if (zipfi == NULL) + zi->ci.dosDate = 0; + else + { + if (zipfi->dosDate != 0) + zi->ci.dosDate = zipfi->dosDate; + else + zi->ci.dosDate = zip64local_TmzDateToDosDate(&zipfi->tmz_date); + } + + zi->ci.flag = flagBase; + if ((level==8) || (level==9)) + zi->ci.flag |= 2; + if (level==2) + zi->ci.flag |= 4; + if (level==1) + zi->ci.flag |= 6; + if (password != NULL) + zi->ci.flag |= 1; + + zi->ci.crc32 = 0; + zi->ci.method = method; + zi->ci.encrypt = 0; + zi->ci.stream_initialised = 0; + zi->ci.pos_in_buffered_data = 0; + zi->ci.raw = raw; + zi->ci.pos_local_header = ZTELL64(zi->z_filefunc,zi->filestream); + + zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + size_extrafield_global + size_comment; + zi->ci.size_centralExtraFree = 32; // Extra space we have reserved in case we need to add ZIP64 extra info data + + zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader + zi->ci.size_centralExtraFree); + + zi->ci.size_centralExtra = size_extrafield_global; + zip64local_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); + /* version info */ + zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)versionMadeBy,2); + zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); + zip64local_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); + zip64local_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); + zip64local_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); + zip64local_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ + zip64local_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ + zip64local_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ + zip64local_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); + zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); + zip64local_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); + zip64local_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ + + if (zipfi==NULL) + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); + else + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); + + if (zipfi==NULL) + zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); + else + zip64local_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); + + if(zi->ci.pos_local_header >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4); + else + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4); + + for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = + *(((const char*)extrafield_global)+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ + size_extrafield_global+i) = *(comment+i); + if (zi->ci.central_header == NULL) + return ZIP_INTERNALERROR; + + zi->ci.zip64 = zip64; + zi->ci.totalCompressedData = 0; + zi->ci.totalUncompressedData = 0; + zi->ci.pos_zip64extrainfo = 0; + + err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local); + +#ifdef HAVE_BZIP2 + zi->ci.bstream.avail_in = (uInt)0; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + zi->ci.bstream.total_in_hi32 = 0; + zi->ci.bstream.total_in_lo32 = 0; + zi->ci.bstream.total_out_hi32 = 0; + zi->ci.bstream.total_out_lo32 = 0; +#endif + + zi->ci.stream.avail_in = (uInt)0; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + zi->ci.stream.total_in = 0; + zi->ci.stream.total_out = 0; + zi->ci.stream.data_type = Z_BINARY; + +#ifdef HAVE_BZIP2 + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED || zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) +#else + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) +#endif + { + if(zi->ci.method == Z_DEFLATED) + { + zi->ci.stream.zalloc = (alloc_func)0; + zi->ci.stream.zfree = (free_func)0; + zi->ci.stream.opaque = (voidpf)0; + + if (windowBits>0) + windowBits = -windowBits; + + err = deflateInit2(&zi->ci.stream, level, Z_DEFLATED, windowBits, memLevel, strategy); + + if (err==Z_OK) + zi->ci.stream_initialised = Z_DEFLATED; + } + else if(zi->ci.method == Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + // Init BZip stuff here + zi->ci.bstream.bzalloc = 0; + zi->ci.bstream.bzfree = 0; + zi->ci.bstream.opaque = (voidpf)0; + + err = BZ2_bzCompressInit(&zi->ci.bstream, level, 0,35); + if(err == BZ_OK) + zi->ci.stream_initialised = Z_BZIP2ED; +#endif + } + + } + +# ifndef NOCRYPT + zi->ci.crypt_header_size = 0; + if ((err==Z_OK) && (password != NULL)) + { + unsigned char bufHead[RAND_HEAD_LEN]; + unsigned int sizeHead; + zi->ci.encrypt = 1; + zi->ci.pcrc_32_tab = get_crc_table(); + /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ + + sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); + zi->ci.crypt_header_size = sizeHead; + + if (ZWRITE64(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) + err = ZIP_ERRNO; + } +# endif + + if (err==Z_OK) + zi->in_opened_file_inzip = 1; + return err; +} + +extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, + uLong versionMadeBy, uLong flagBase) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, versionMadeBy, flagBase, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, + int windowBits,int memLevel, int strategy, + const char* password, uLong crcForCrypting, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int zip64) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, zip64); +} + +extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level) +{ + return zipOpenNewFileInZip4_64 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0, VERSIONMADEBY, 0, 0); +} + +local int zip64FlushWriteBuffer(zip64_internal* zi) +{ + int err=ZIP_OK; + + if (zi->ci.encrypt != 0) + { +#ifndef NOCRYPT + uInt i; + int t; + for (i=0;ici.pos_in_buffered_data;i++) + zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, zi->ci.buffered_data[i],t); +#endif + } + + if (ZWRITE64(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) != zi->ci.pos_in_buffered_data) + err = ZIP_ERRNO; + + zi->ci.totalCompressedData += zi->ci.pos_in_buffered_data; + +#ifdef HAVE_BZIP2 + if(zi->ci.method == Z_BZIP2ED) + { + zi->ci.totalUncompressedData += zi->ci.bstream.total_in_lo32; + zi->ci.bstream.total_in_lo32 = 0; + zi->ci.bstream.total_in_hi32 = 0; + } + else +#endif + { + zi->ci.totalUncompressedData += zi->ci.stream.total_in; + zi->ci.stream.total_in = 0; + } + + + zi->ci.pos_in_buffered_data = 0; + + return err; +} + +extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) +{ + zip64_internal* zi; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + + zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len); + +#ifdef HAVE_BZIP2 + if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw)) + { + zi->ci.bstream.next_in = (void*)buf; + zi->ci.bstream.avail_in = len; + err = BZ_RUN_OK; + + while ((err==BZ_RUN_OK) && (zi->ci.bstream.avail_in>0)) + { + if (zi->ci.bstream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + } + + + if(err != BZ_RUN_OK) + break; + + if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore_lo = zi->ci.bstream.total_out_lo32; +// uLong uTotalOutBefore_hi = zi->ci.bstream.total_out_hi32; + err=BZ2_bzCompress(&zi->ci.bstream, BZ_RUN); + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore_lo) ; + } + } + + if(err == BZ_RUN_OK) + err = ZIP_OK; + } + else +#endif + { + zi->ci.stream.next_in = (Bytef*)buf; + zi->ci.stream.avail_in = len; + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) + { + if (zi->ci.stream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + + + if(err != ZIP_OK) + break; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_NO_FLUSH); + if(uTotalOutBefore > zi->ci.stream.total_out) + { + int bBreak = 0; + bBreak++; + } + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + else + { + uInt copy_this,i; + if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) + copy_this = zi->ci.stream.avail_in; + else + copy_this = zi->ci.stream.avail_out; + + for (i = 0; i < copy_this; i++) + *(((char*)zi->ci.stream.next_out)+i) = + *(((const char*)zi->ci.stream.next_in)+i); + { + zi->ci.stream.avail_in -= copy_this; + zi->ci.stream.avail_out-= copy_this; + zi->ci.stream.next_in+= copy_this; + zi->ci.stream.next_out+= copy_this; + zi->ci.stream.total_in+= copy_this; + zi->ci.stream.total_out+= copy_this; + zi->ci.pos_in_buffered_data += copy_this; + } + } + }// while(...) + } + + return err; +} + +extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) +{ + return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32); +} + +extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) +{ + zip64_internal* zi; + ZPOS64_T compressed_size; + uLong invalidValue = 0xffffffff; + short datasize = 0; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + zi->ci.stream.avail_in = 0; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + while (err==ZIP_OK) + { + uLong uTotalOutBefore; + if (zi->ci.stream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_FINISH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + } + else if ((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { +#ifdef HAVE_BZIP2 + err = BZ_FINISH_OK; + while (err==BZ_FINISH_OK) + { + uLong uTotalOutBefore; + if (zi->ci.bstream.avail_out == 0) + { + if (zip64FlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.bstream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.bstream.next_out = (char*)zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.bstream.total_out_lo32; + err=BZ2_bzCompress(&zi->ci.bstream, BZ_FINISH); + if(err == BZ_STREAM_END) + err = Z_STREAM_END; + + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.bstream.total_out_lo32 - uTotalOutBefore); + } + + if(err == BZ_FINISH_OK) + err = ZIP_OK; +#endif + } + + if (err==Z_STREAM_END) + err=ZIP_OK; /* this is normal */ + + if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) + { + if (zip64FlushWriteBuffer(zi)==ZIP_ERRNO) + err = ZIP_ERRNO; + } + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + int tmp_err = deflateEnd(&zi->ci.stream); + if (err == ZIP_OK) + err = tmp_err; + zi->ci.stream_initialised = 0; + } +#ifdef HAVE_BZIP2 + else if((zi->ci.method == Z_BZIP2ED) && (!zi->ci.raw)) + { + int tmperr = BZ2_bzCompressEnd(&zi->ci.bstream); + if (err==ZIP_OK) + err = tmperr; + zi->ci.stream_initialised = 0; + } +#endif + + if (!zi->ci.raw) + { + crc32 = (uLong)zi->ci.crc32; + uncompressed_size = zi->ci.totalUncompressedData; + } + compressed_size = zi->ci.totalCompressedData; + +# ifndef NOCRYPT + compressed_size += zi->ci.crypt_header_size; +# endif + + // update Current Item crc and sizes, + if(compressed_size >= 0xffffffff || uncompressed_size >= 0xffffffff || zi->ci.pos_local_header >= 0xffffffff) + { + /*version Made by*/ + zip64local_putValue_inmemory(zi->ci.central_header+4,(uLong)45,2); + /*version needed*/ + zip64local_putValue_inmemory(zi->ci.central_header+6,(uLong)45,2); + + } + + zip64local_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ + + + if(compressed_size >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+20, invalidValue,4); /*compr size*/ + else + zip64local_putValue_inmemory(zi->ci.central_header+20, compressed_size,4); /*compr size*/ + + /// set internal file attributes field + if (zi->ci.stream.data_type == Z_ASCII) + zip64local_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); + + if(uncompressed_size >= 0xffffffff) + zip64local_putValue_inmemory(zi->ci.central_header+24, invalidValue,4); /*uncompr size*/ + else + zip64local_putValue_inmemory(zi->ci.central_header+24, uncompressed_size,4); /*uncompr size*/ + + // Add ZIP64 extra info field for uncompressed size + if(uncompressed_size >= 0xffffffff) + datasize += 8; + + // Add ZIP64 extra info field for compressed size + if(compressed_size >= 0xffffffff) + datasize += 8; + + // Add ZIP64 extra info field for relative offset to local file header of current file + if(zi->ci.pos_local_header >= 0xffffffff) + datasize += 8; + + if(datasize > 0) + { + char* p = NULL; + + if((uLong)(datasize + 4) > zi->ci.size_centralExtraFree) + { + // we can not write more data to the buffer that we have room for. + return ZIP_BADZIPFILE; + } + + p = zi->ci.central_header + zi->ci.size_centralheader; + + // Add Extra Information Header for 'ZIP64 information' + zip64local_putValue_inmemory(p, 0x0001, 2); // HeaderID + p += 2; + zip64local_putValue_inmemory(p, datasize, 2); // DataSize + p += 2; + + if(uncompressed_size >= 0xffffffff) + { + zip64local_putValue_inmemory(p, uncompressed_size, 8); + p += 8; + } + + if(compressed_size >= 0xffffffff) + { + zip64local_putValue_inmemory(p, compressed_size, 8); + p += 8; + } + + if(zi->ci.pos_local_header >= 0xffffffff) + { + zip64local_putValue_inmemory(p, zi->ci.pos_local_header, 8); + p += 8; + } + + // Update how much extra free space we got in the memory buffer + // and increase the centralheader size so the new ZIP64 fields are included + // ( 4 below is the size of HeaderID and DataSize field ) + zi->ci.size_centralExtraFree -= datasize + 4; + zi->ci.size_centralheader += datasize + 4; + + // Update the extra info size field + zi->ci.size_centralExtra += datasize + 4; + zip64local_putValue_inmemory(zi->ci.central_header+30,(uLong)zi->ci.size_centralExtra,2); + } + + if (err==ZIP_OK) + err = add_data_in_datablock(&zi->central_dir, zi->ci.central_header, (uLong)zi->ci.size_centralheader); + + free(zi->ci.central_header); + + if (err==ZIP_OK) + { + // Update the LocalFileHeader with the new values. + + ZPOS64_T cur_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream); + + if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if(uncompressed_size >= 0xffffffff || compressed_size >= 0xffffffff ) + { + if(zi->ci.pos_zip64extrainfo > 0) + { + // Update the size in the ZIP64 extended field. + if (ZSEEK64(zi->z_filefunc,zi->filestream, zi->ci.pos_zip64extrainfo + 4,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) /* compressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, uncompressed_size, 8); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, compressed_size, 8); + } + else + err = ZIP_BADZIPFILE; // Caller passed zip64 = 0, so no room for zip64 info -> fatal + } + else + { + if (err==ZIP_OK) /* compressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + } + + if (ZSEEK64(zi->z_filefunc,zi->filestream, cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + } + + zi->number_entry ++; + zi->in_opened_file_inzip = 0; + + return err; +} + +extern int ZEXPORT zipCloseFileInZip (zipFile file) +{ + return zipCloseFileInZipRaw (file,0,0); +} + +int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) +{ + int err = ZIP_OK; + ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4); + + /*num disks*/ + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + /*relative offset*/ + if (err==ZIP_OK) /* Relative offset to the Zip64EndOfCentralDirectory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, pos,8); + + /*total disks*/ /* Do not support spawning of disk so always say 1 here*/ + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4); + + return err; +} + +int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +{ + int err = ZIP_OK; + + uLong Zip64DataSize = 44; + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* size of this 'zip64 end of central directory' */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)Zip64DataSize,8); // why ZPOS64_T of this ? + + if (err==ZIP_OK) /* version made by */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2); + + if (err==ZIP_OK) /* version needed */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)45,2); + + if (err==ZIP_OK) /* number of this disk */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); + + if (err==ZIP_OK) /* total number of entries in the central dir */ + err = zip64local_putValue(&zi->z_filefunc, zi->filestream, zi->number_entry, 8); + + if (err==ZIP_OK) /* size of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(ZPOS64_T)size_centraldir,8); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ + { + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8); + } + return err; +} +int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +{ + int err = ZIP_OK; + + /*signature*/ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* number of this disk */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + { + { + if(zi->number_entry >= 0xFFFF) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + } + } + + if (err==ZIP_OK) /* total number of entries in the central dir */ + { + if(zi->number_entry >= 0xFFFF) + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)0xffff,2); // use value in ZIP64 record + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + } + + if (err==ZIP_OK) /* size of the central directory */ + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ + { + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + if(pos >= 0xffffffff) + { + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4); + } + else + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + } + + return err; +} + +int Write_GlobalComment(zip64_internal* zi, const char* global_comment) +{ + int err = ZIP_OK; + uInt size_global_comment = 0; + + if(global_comment != NULL) + size_global_comment = (uInt)strlen(global_comment); + + err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); + + if (err == ZIP_OK && size_global_comment > 0) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream, global_comment, size_global_comment) != size_global_comment) + err = ZIP_ERRNO; + } + return err; +} + +extern int ZEXPORT zipClose (zipFile file, const char* global_comment) +{ + zip64_internal* zi; + int err = 0; + uLong size_centraldir = 0; + ZPOS64_T centraldir_pos_inzip; + ZPOS64_T pos; + + if (file == NULL) + return ZIP_PARAMERROR; + + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + } + +#ifndef NO_ADDFILEINEXISTINGZIP + if (global_comment==NULL) + global_comment = zi->globalcomment; +#endif + + centraldir_pos_inzip = ZTELL64(zi->z_filefunc,zi->filestream); + + if (err==ZIP_OK) + { + linkedlist_datablock_internal* ldi = zi->central_dir.first_block; + while (ldi!=NULL) + { + if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) + { + if (ZWRITE64(zi->z_filefunc,zi->filestream, ldi->data, ldi->filled_in_this_block) != ldi->filled_in_this_block) + err = ZIP_ERRNO; + } + + size_centraldir += ldi->filled_in_this_block; + ldi = ldi->next_datablock; + } + } + free_linkedlist(&(zi->central_dir)); + + pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + if(pos >= 0xffffffff || zi->number_entry > 0xFFFF) + { + ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream); + Write_Zip64EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); + + Write_Zip64EndOfCentralDirectoryLocator(zi, Zip64EOCDpos); + } + + if (err==ZIP_OK) + err = Write_EndOfCentralDirectoryRecord(zi, size_centraldir, centraldir_pos_inzip); + + if(err == ZIP_OK) + err = Write_GlobalComment(zi, global_comment); + + if (ZCLOSE64(zi->z_filefunc,zi->filestream) != 0) + if (err == ZIP_OK) + err = ZIP_ERRNO; + +#ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(zi->globalcomment); +#endif + TRYFREE(zi); + + return err; +} + +extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) +{ + char* p = pData; + int size = 0; + char* pNewHeader; + char* pTmp; + short header; + short dataSize; + + int retVal = ZIP_OK; + + if(pData == NULL || *dataLen < 4) + return ZIP_PARAMERROR; + + pNewHeader = (char*)ALLOC(*dataLen); + pTmp = pNewHeader; + + while(p < (pData + *dataLen)) + { + header = *(short*)p; + dataSize = *(((short*)p)+1); + + if( header == sHeader ) // Header found. + { + p += dataSize + 4; // skip it. do not copy to temp buffer + } + else + { + // Extra Info block should not be removed, So copy it to the temp buffer. + memcpy(pTmp, p, dataSize + 4); + p += dataSize + 4; + size += dataSize + 4; + } + + } + + if(size < *dataLen) + { + // clean old extra info block. + memset(pData,0, *dataLen); + + // copy the new extra info block over the old + if(size > 0) + memcpy(pData, pNewHeader, size); + + // set the new extra info size + *dataLen = size; + + retVal = ZIP_OK; + } + else + retVal = ZIP_ERRNO; + + TRYFREE(pNewHeader); + + return retVal; +} diff --git a/Telegram/SourceFiles/_other/zip.h b/Telegram/SourceFiles/_other/zip.h new file mode 100644 index 0000000000..8aaebb6234 --- /dev/null +++ b/Telegram/SourceFiles/_other/zip.h @@ -0,0 +1,362 @@ +/* zip.h -- IO on .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------- + + Changes + + See header of zip.h + +*/ + +#ifndef _zip12_H +#define _zip12_H + +#ifdef __cplusplus +extern "C" { +#endif + +//#define HAVE_BZIP2 + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc64_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); + +extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int zip64)); + +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) + zip64 is set to 1 if a zip64 extended information block should be added to the local file header. + this MUST be '1' if the uncompressed size is >= 0xffffffff. + +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + + +extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int zip64)); +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting)); + +extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + int zip64 + )); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCrypting : crc of file to compress (needed for crypting) + */ + +extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase + )); + + +extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCrypting, + uLong versionMadeBy, + uLong flagBase, + int zip64 + )); +/* + Same than zipOpenNewFileInZip4, except + versionMadeBy : value for Version made by field + flag : value for flag field (compression level info will be added) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); + +extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, + ZPOS64_T uncompressed_size, + uLong crc32)); + +/* + Close the current file in the zipfile, for file opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + + +extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); +/* + zipRemoveExtraInfoBlock - Added by Mathias Svensson + + Remove extra information block from a extra information data for the local file header or central directory header + + It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. + + 0x0001 is the signature header for the ZIP64 extra information blocks + + usage. + Remove ZIP64 Extra information from a central director extra field data + zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); + + Remove ZIP64 Extra information from a Local File Header extra field data + zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip64_H */ diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index e12b643c21..3a992e7065 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2610,9 +2610,14 @@ namespace App { } QNetworkProxy getHttpProxySettings() { - if (cConnectionType() == dbictHttpProxy) { - const ConnectionProxy &p(cConnectionProxy()); - return QNetworkProxy(QNetworkProxy::HttpProxy, p.host, p.port, p.user, p.password); + const ConnectionProxy *proxy = 0; + if (Sandbox::started()) { + proxy = (cConnectionType() == dbictHttpProxy) ? (&cConnectionProxy()) : 0; + } else { + proxy = Global::PreLaunchProxy().host.isEmpty() ? 0 : (&Global::PreLaunchProxy()); + } + if (proxy) { + return QNetworkProxy(QNetworkProxy::HttpProxy, proxy->host, proxy->port, proxy->user, proxy->password); } return QNetworkProxy(QNetworkProxy::DefaultProxy); } diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 49baf5714c..6149620a9b 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -311,7 +311,7 @@ void Application::readClients() { for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) { QStringRef cmd(&cmds, from, to - from); if (cmd.startsWith(qsl("CMD:"))) { - App::app()->execExternal(cmds.mid(from + 4, to - from - 4)); + Sandboxer::execExternal(cmds.mid(from + 4, to - from - 4)); QByteArray response(qsl("RES:%1;").arg(QCoreApplication::applicationPid()).toLatin1()); i->first->write(response.data(), response.size()); } else if (cmd.startsWith(qsl("SEND:"))) { @@ -485,7 +485,7 @@ void Application::startUpdateCheck(bool forceWait) { if (_updateThread || _updateReply || !cAutoUpdate()) return; int32 constDelay = cBetaVersion() ? 600 : UpdateDelayConstPart, randDelay = cBetaVersion() ? 300 : UpdateDelayRandPart; - int32 updateInSecs = cLastUpdateCheck() + constDelay + int32(MTP::nonce() % randDelay) - unixtime(); + int32 updateInSecs = cLastUpdateCheck() + constDelay + int32(rand() % randDelay) - unixtime(); bool sendRequest = (updateInSecs <= 0 || updateInSecs > (constDelay + randDelay)); if (!sendRequest && !forceWait) { QDir updates(cWorkingDir() + "tupdates"); @@ -564,6 +564,17 @@ namespace Sandboxer { return false; } + void execExternal(const QString &cmd) { + DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd)); + if (cmd == "show") { + if (App::wnd()) { + App::wnd()->activate(); + } else if (PreLaunchWindow::instance()) { + PreLaunchWindow::instance()->activate(); + } + } + } + #ifndef TDESKTOP_DISABLE_AUTOUPDATE void startUpdateCheck() { @@ -643,6 +654,8 @@ AppClass::AppClass() : QObject() , _uploader(0) { AppObject = this; + Fonts::start(); + ThirdParty::start(); Sandbox::start(); Local::start(); @@ -658,10 +671,6 @@ AppClass::AppClass() : QObject() application()->installEventFilter(new EventFilterForKeys(this)); - QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Regular.ttf")); - QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Bold.ttf")); - QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Semibold.ttf")); - float64 dpi = QApplication::primaryScreen()->logicalDotsPerInch(); if (dpi <= 108) { // 0-96-108 cSetScreenScale(dbisOne); @@ -1030,13 +1039,6 @@ void AppClass::checkMapVersion() { } } -void AppClass::execExternal(const QString &cmd) { - DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd)); - if (cmd == "show") { - _window.activate(); - } -} - AppClass::~AppClass() { _window.setParent(0); anim::stopManager(); diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index f1671f2dd0..940f83819b 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -113,6 +113,8 @@ namespace Sandboxer { void setActiveWindow(QWidget *window); bool isSavingSession(); + void execExternal(const QString &cmd); + #ifndef TDESKTOP_DISABLE_AUTOUPDATE void startUpdateCheck(); @@ -174,8 +176,6 @@ public: void checkLocalTime(); void checkMapVersion(); - void execExternal(const QString &cmd); - signals: void peerPhotoDone(PeerId peer); diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 2ee10cd55f..129ec45cc0 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4320,7 +4320,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { if (it->emoji.isEmpty()) { setsToRequest.insert(it->id, it->access); it->flags |= MTPDstickerSet_flag_NOT_LOADED; - } else { + } else if (!(it->flags & MTPDstickerSet::flag_disabled)) { StickersByEmojiMap::const_iterator i = it->emoji.constFind(emojiGetNoColor(_emoji)); if (i != it->emoji.cend()) { srows += *i; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 2c3fd675fb..5023c7ed7a 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -181,6 +181,7 @@ struct GlobalDataStruct { int32 LangSystem = languageDefault; QByteArray LastCrashDump; + ConnectionProxy PreLaunchProxy; }; GlobalDataStruct *GlobalData = 0; @@ -257,6 +258,8 @@ namespace Global { break; } } + + srand((int32)time(NULL)); } void finish() { @@ -281,6 +284,7 @@ Type &Ref##Name() { \ DefineGlobalReadOnly(QString, LangSystemISO); DefineGlobalReadOnly(int32, LangSystem); DefineGlobal(QByteArray, LastCrashDump); + DefineGlobal(ConnectionProxy, PreLaunchProxy); } @@ -291,6 +295,10 @@ SandboxDataStruct *SandboxData = 0; namespace Sandbox { + bool started() { + return SandboxData != 0; + } + void start() { SandboxData = new SandboxDataStruct(); diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index e86c125d92..9797a95f3d 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -112,11 +112,13 @@ namespace Global { DeclareGlobalReadOnly(QString, LangSystemISO); DeclareGlobalReadOnly(int32, LangSystem); DeclareGlobal(QByteArray, LastCrashDump); + DeclareGlobal(ConnectionProxy, PreLaunchProxy); } namespace Sandbox { + bool started(); void start(); void finish(); diff --git a/Telegram/SourceFiles/gui/images.cpp b/Telegram/SourceFiles/gui/images.cpp index 6437abf3f2..7f97ef7d49 100644 --- a/Telegram/SourceFiles/gui/images.cpp +++ b/Telegram/SourceFiles/gui/images.cpp @@ -787,11 +787,11 @@ StorageImage::StorageImage(const StorageImageLocation &location, QByteArray &byt } } -int32 StorageImage::width() const { +int32 StorageImage::countWidth() const { return _location.width(); } -int32 StorageImage::height() const { +int32 StorageImage::countHeight() const { return _location.height(); } @@ -917,11 +917,11 @@ StorageImage *getImage(const StorageImageLocation &location, const QByteArray &b WebImage::WebImage(const QString &url) : _url(url), _size(0), _width(0), _height(0) { } -int32 WebImage::width() const { +int32 WebImage::countWidth() const { return _width; } -int32 WebImage::height() const { +int32 WebImage::countHeight() const { return _height; } diff --git a/Telegram/SourceFiles/gui/images.h b/Telegram/SourceFiles/gui/images.h index 5ef9d93282..a79890f5c6 100644 --- a/Telegram/SourceFiles/gui/images.h +++ b/Telegram/SourceFiles/gui/images.h @@ -154,14 +154,12 @@ public: 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; - virtual int32 width() const { - restore(); - return _data.width(); + int32 width() const { + return qMax(countWidth(), 1); } - virtual int32 height() const { - restore(); - return _data.height(); + int32 height() const { + return qMax(countHeight(), 1); } virtual void load(bool loadFirst = false, bool prior = true) { @@ -203,6 +201,16 @@ protected: } void invalidateSizeCache() const; + virtual int32 countWidth() const { + restore(); + return _data.width(); + } + + virtual int32 countHeight() const { + restore(); + return _data.height(); + } + mutable QByteArray _saved, _format; mutable bool _forgot; mutable QPixmap _data; @@ -283,9 +291,6 @@ public: StorageImage(const StorageImageLocation &location, int32 size = 0); StorageImage(const StorageImageLocation &location, QByteArray &bytes); - int32 width() const; - int32 height() const; - virtual void setInformation(int32 size, int32 width, int32 height); virtual FileLoader *createLoader(LoadFromCloudSetting fromCloud, bool autoLoading); @@ -297,6 +302,9 @@ protected: StorageImageLocation _location; int32 _size; + virtual int32 countWidth() const; + virtual int32 countHeight() const; + }; class DelayedStorageImage : public StorageImage { @@ -341,12 +349,14 @@ public: WebImage(const QString &url); - int32 width() const; - int32 height() const; - virtual void setInformation(int32 size, int32 width, int32 height); virtual FileLoader *createLoader(LoadFromCloudSetting fromCloud, bool autoLoading); +protected: + + virtual int32 countWidth() const; + virtual int32 countHeight() const; + private: QString _url; int32 _size, _width, _height; diff --git a/Telegram/SourceFiles/gui/twidget.cpp b/Telegram/SourceFiles/gui/twidget.cpp index edd21afcd6..8606aece7c 100644 --- a/Telegram/SourceFiles/gui/twidget.cpp +++ b/Telegram/SourceFiles/gui/twidget.cpp @@ -22,6 +22,21 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "application.h" +namespace Fonts { + + bool Started = false; + void start() { + if (!Started) { + Started = true; + + QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Regular.ttf")); + QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Bold.ttf")); + QFontDatabase::addApplicationFont(qsl(":/gui/art/fonts/OpenSans-Semibold.ttf")); + } + } + +} + namespace { void _sendResizeEvents(QWidget *target) { QResizeEvent e(target->size(), QSize()); @@ -44,7 +59,7 @@ void myEnsureResized(QWidget *target) { } QPixmap myGrab(TWidget *target, QRect rect) { - myEnsureResized(target); + myEnsureResized(target); if (rect.isNull()) rect = target->rect(); QPixmap result(rect.size() * cRetinaFactor()); diff --git a/Telegram/SourceFiles/gui/twidget.h b/Telegram/SourceFiles/gui/twidget.h index d01504c2b7..d1eaeb1478 100644 --- a/Telegram/SourceFiles/gui/twidget.h +++ b/Telegram/SourceFiles/gui/twidget.h @@ -24,6 +24,10 @@ namespace App { const QPixmap &sprite(); } +namespace Fonts { + void start(); +} + class Painter : public QPainter { public: explicit Painter(QPaintDevice *device) : QPainter(device) { diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 46c8cc9df0..94a7e5addc 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -552,6 +552,7 @@ namespace SignalHandlers { FILE *CrashDumpFile = 0; int CrashDumpFileNo = 0; char LaunchedDateTimeStr[32] = { 0 }; + char LaunchedBinaryName[256] = { 0 }; void _writeChar(char ch) { fwrite(&ch, 1, 1, CrashDumpFile); @@ -628,6 +629,8 @@ namespace SignalHandlers { if (!LoggingCrashHeaderWritten) { LoggingCrashHeaderWritten = true; + dump() << "Binary: " << LaunchedBinaryName << "\n"; + dump() << "ApiId: " << ApiId << "\n"; if (cBetaVersion()) { dump() << "Version: " << cBetaVersion() << " beta\n"; } else { @@ -685,6 +688,10 @@ namespace SignalHandlers { } Status restart() { + if (CrashDumpFile) { + return Started; + } + CrashDumpFile = fopen(CrashDumpPath.constData(), "wb"); if (CrashDumpFile) { CrashDumpFileNo = fileno(CrashDumpFile); @@ -693,6 +700,10 @@ namespace SignalHandlers { t_assert(launchedDateTime.size() < sizeof(LaunchedDateTimeStr)); memcpy(LaunchedDateTimeStr, launchedDateTime.constData(), launchedDateTime.size()); + QByteArray launchedBinaryName = cExeName().toUtf8(); + t_assert(launchedBinaryName.size() < sizeof(LaunchedBinaryName)); + memcpy(LaunchedBinaryName, launchedBinaryName.constData(), launchedBinaryName.size()); + signal(SIGABRT, SignalHandlers::Handler); signal(SIGSEGV, SignalHandlers::Handler); signal(SIGILL, SignalHandlers::Handler); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 61c6043c74..3407fc421e 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2221,7 +2221,7 @@ namespace { } void RegisterCustomScheme() { - #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME +#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); HKEY rkey; @@ -2238,7 +2238,7 @@ void RegisterCustomScheme() { 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 +#endif } void psNewVersion() { @@ -2840,7 +2840,7 @@ void psWriteDump() { } char ImageHlpSymbol64[sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength]; -QString _showCrashDump(const QByteArray &crashdump) { +QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { HANDLE hProcess = GetCurrentProcess(); QString initial = QString::fromUtf8(crashdump), result; @@ -2862,6 +2862,7 @@ QString _showCrashDump(const QByteArray &crashdump) { version /= 1000; } } + ++i; break; } } @@ -2888,8 +2889,13 @@ QString _showCrashDump(const QByteArray &crashdump) { } if (!tolaunch.isEmpty()) { if (QFile(tolaunch).exists()) { - // run it - return QString(); + QString targs = qsl("-crash \"%1\"").arg(dumpfile.replace('"', qsl("\"\""))); + HINSTANCE r = ShellExecute(0, 0, QDir::toNativeSeparators(tolaunch).toStdWString().c_str(), targs.toStdWString().c_str(), 0, SW_SHOWNORMAL); + if (long(r) < 32) { + result.append(qsl("ERROR: executable '%1' with args '%2' for this crashdump could not be launched! Result: %3").arg(tolaunch).arg(targs).arg(long(r))); + } else { + return QString(); + } } else { result.append(qsl("ERROR: executable '%1' for this crashdump was not found!").arg(tolaunch)); } @@ -3088,7 +3094,7 @@ int psShowCrash(const QString &crashdump) { if (!LoadDbgHelp(true)) { text += qsl("ERROR: could not init dbghelp.dll!"); } else { - text += _showCrashDump(dump.readAll()); + text += _showCrashDump(dump.readAll(), crashdump); symCleanup(GetCurrentProcess()); } } else { @@ -3103,14 +3109,7 @@ int psShowCrash(const QString &crashdump) { char *a_argv[1] = { args[0].data() }; QApplication app(a_argc, a_argv); - QTextEdit wnd; - wnd.setReadOnly(true); - wnd.setPlainText(text); - - QRect scr(QApplication::primaryScreen()->availableGeometry()); - wnd.setGeometry(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6), scr.width() / 2, scr.height() / 2); - wnd.show(); - + ShowCrashReportWindow wnd(text); return app.exec(); } diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index f539a3a037..7d77c05eef 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -200,6 +200,10 @@ void settingsParseArgs(int argc, char *argv[]) { gExeDir = psCurrentExeDirectory(argc, argv); gExeName = psCurrentExeName(argc, argv); + if (argc == 2 && fromUtf8Safe(argv[1]).endsWith(qstr(".telegramcrash")) && QFile(fromUtf8Safe(argv[1])).exists()) { + gLaunchMode = LaunchModeShowCrash; + gStartUrl = fromUtf8Safe(argv[1]); + } for (int32 i = 0; i < argc; ++i) { if (string("-testmode") == argv[i]) { gTestMode = true; diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 7294a6c4ad..ecb5d2468d 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -329,7 +329,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) updateOnlineDisplay(); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE switch (Sandboxer::updatingState()) { case Application::UpdatingDownload: setUpdatingState(UpdatingDownload, true); @@ -338,9 +338,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) case Application::UpdatingReady: setUpdatingState(UpdatingReady, true); break; default: setUpdatingState(UpdatingNone, true); break; } - #else - _updatingState = UpdatingNone; - #endif +#endif updateConnectionType(); @@ -1284,7 +1282,7 @@ void SettingsInner::onCheckNow() { #endif void SettingsInner::onRestartNow() { - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE checkReadyUpdate(); if (_updatingState == UpdatingReady) { cSetRestartingUpdate(true); @@ -1292,10 +1290,10 @@ void SettingsInner::onRestartNow() { cSetRestarting(true); cSetRestartingToSettings(true); } - #else +#else cSetRestarting(true); cSetRestartingToSettings(true); - #endif +#endif App::quit(); } diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index 821ce2a67d..c8a9c841f0 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -233,6 +233,7 @@ private: QString _curVersionText, _newVersionText; int32 _curVersionWidth, _newVersionWidth; +#ifndef TDESKTOP_DISABLE_AUTOUPDATE enum UpdatingState { UpdatingNone, UpdatingCheck, @@ -243,6 +244,7 @@ private: }; UpdatingState _updatingState; QString _newVersionDownload; +#endif // chat options FlatCheckbox _replaceEmojis; @@ -296,12 +298,10 @@ private: void offPasswordDone(const MTPBool &result); bool offPasswordFail(const RPCError &error); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE void setUpdatingState(UpdatingState state, bool force = false); void setDownloadProgress(qint64 ready, qint64 total); - #endif - - +#endif }; class SettingsWidget : public TWidget { @@ -338,7 +338,7 @@ public: public slots: void onParentResize(const QSize &newSize); - + private: void showAll(); diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 8f285ba201..58a1c065b1 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -42,6 +42,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #include #include +#include #ifdef Q_OS_WIN // use Lzma SDK for win #include diff --git a/Telegram/SourceFiles/sysbuttons.cpp b/Telegram/SourceFiles/sysbuttons.cpp index 163ba004e4..8b618dfd75 100644 --- a/Telegram/SourceFiles/sysbuttons.cpp +++ b/Telegram/SourceFiles/sysbuttons.cpp @@ -148,12 +148,13 @@ UpdateBtn::UpdateBtn(QWidget *parent, Window *window, const QString &text) : Sys } void UpdateBtn::onClick() { - #ifndef TDESKTOP_DISABLE_AUTOUPDATE +#ifndef TDESKTOP_DISABLE_AUTOUPDATE checkReadyUpdate(); - #endif if (Sandboxer::updatingState() == Application::UpdatingReady) { cSetRestartingUpdate(true); - } else { + } else +#endif + { cSetRestarting(true); cSetRestartingToSettings(false); } diff --git a/Telegram/SourceFiles/title.cpp b/Telegram/SourceFiles/title.cpp index 83cb690900..86c55de51d 100644 --- a/Telegram/SourceFiles/title.cpp +++ b/Telegram/SourceFiles/title.cpp @@ -73,7 +73,12 @@ TitleWidget::TitleWidget(Window *window) : TWidget(window) _update.hide(); _cancel.hide(); _back.hide(); - if (Sandboxer::updatingState() == Application::UpdatingReady || cHasPasscode()) { + if ( +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + Sandboxer::updatingState() == Application::UpdatingReady || +#endif + cHasPasscode() + ) { showUpdateBtn(); } stateChanged(); @@ -322,7 +327,11 @@ void TitleWidget::showUpdateBtn() { } else { _lock.hide(); } +#ifndef TDESKTOP_DISABLE_AUTOUPDATE bool updateReady = (Sandboxer::updatingState() == Application::UpdatingReady); +#else + bool updateReady = false; +#endif if (updateReady || cEvalScale(cConfigScale()) != cEvalScale(cRealScale())) { _update.setText(lang(updateReady ? lng_menu_update : lng_menu_restart)); _update.show(); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 7c6ad727e7..e54c8e2741 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -36,9 +36,13 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "boxes/contactsbox.h" #include "boxes/addcontactbox.h" +#include "autoupdater.h" + #include "mediaview.h" #include "localstorage.h" +#include "_other/zip.h" + ConnectingWidget::ConnectingWidget(QWidget *parent, const QString &text, const QString &reconnect) : QWidget(parent), _shadow(st::boxShadow), _reconnect(this, QString()) { set(text, reconnect); connect(&_reconnect, SIGNAL(clicked()), this, SLOT(onReconnect())); @@ -451,7 +455,6 @@ void Window::firstShow() { trayIconMenu->deleteOnHide(false); #else trayIconMenu = new QMenu(this); - trayIconMenu->setFont(QFont("Tahoma")); #endif QString notificationItem = lang(cDesktopNotify() ? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray); @@ -1826,61 +1829,1046 @@ Window::~Window() { delete settings; } -NotStartedWindow::NotStartedWindow() : TWidget(0) -, _label(this) -, _log(this) { - _label.setText(qsl("Could not start Telegram Desktop! Log:")); - _label.show(); +PreLaunchWindow *PreLaunchWindowInstance = 0; + +PreLaunchWindow::PreLaunchWindow(QString title) : TWidget(0) { + Fonts::start(); + + QIcon icon(QPixmap::fromImage(QImage(cPlatform() == dbipMac ? qsl(":/gui/art/iconbig256.png") : qsl(":/gui/art/icon256.png")), Qt::ColorOnly)); + if (cPlatform() == dbipLinux32 || cPlatform() == dbipLinux64) { + icon = QIcon::fromTheme("telegram", icon); + } + setWindowIcon(icon); + setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); + + setWindowTitle(title.isEmpty() ? qsl("Telegram") : title); + + QPalette p(palette()); + p.setColor(QPalette::Background, QColor(255, 255, 255)); + setPalette(p); + + QLabel tmp(this); + tmp.setText(qsl("Tmp")); + _size = tmp.sizeHint().height(); + + setStyleSheet(qsl("QPushButton { padding: %1px %2px; background-color: #ffffff; border-radius: %3px; }\nQPushButton#confirm:hover, QPushButton#cancel:hover { background-color: #edf7ff; color: #2f9fea; }\nQPushButton#confirm { color: #2f9fea; }\nQPushButton#cancel { color: #aeaeae; }\nQLineEdit { border: 1px solid #e0e0e0; padding: 5px; }\nQLineEdit:focus { border: 2px solid #62c0f7; padding: 4px; }").arg(qFloor(_size / 2)).arg(qFloor(_size)).arg(qFloor(_size / 5))); + if (!PreLaunchWindowInstance) { + PreLaunchWindowInstance = this; + } +} + +void PreLaunchWindow::activate() { + setWindowState(windowState() & ~Qt::WindowMinimized); + setVisible(true); + psActivateProcess(); + activateWindow(); +} + +PreLaunchWindow *PreLaunchWindow::instance() { + return PreLaunchWindowInstance; +} + +PreLaunchWindow::~PreLaunchWindow() { + if (PreLaunchWindowInstance == this) { + PreLaunchWindowInstance = 0; + } +} + +PreLaunchLabel::PreLaunchLabel(QWidget *parent) : QLabel(parent) { + QFont labelFont(font()); + labelFont.setFamily(qsl("Open Sans Semibold")); + labelFont.setPixelSize(static_cast(parent)->basicSize()); + setFont(labelFont); + + QPalette p(palette()); + p.setColor(QPalette::Foreground, QColor(0, 0, 0)); + setPalette(p); + show(); +}; + +void PreLaunchLabel::setText(const QString &text) { + QLabel::setText(text); + updateGeometry(); + resize(sizeHint()); +} + +PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(parent) { + QFont logFont(font()); + logFont.setFamily(qsl("Open Sans")); + logFont.setPixelSize(static_cast(parent)->basicSize()); + setFont(logFont); + + QPalette p(palette()); + p.setColor(QPalette::Foreground, QColor(0, 0, 0)); + setPalette(p); + + QLineEdit::setTextMargins(0, 0, 0, 0); + setContentsMargins(0, 0, 0, 0); + if (password) { + setEchoMode(QLineEdit::Password); + } + show(); +}; + +PreLaunchLog::PreLaunchLog(QWidget *parent) : QTextEdit(parent) { + QFont logFont(font()); + logFont.setFamily(qsl("Open Sans")); + logFont.setPixelSize(static_cast(parent)->basicSize()); + setFont(logFont); + + QPalette p(palette()); + p.setColor(QPalette::Foreground, QColor(96, 96, 96)); + setPalette(p); + + setReadOnly(true); + setFrameStyle(QFrame::NoFrame | QFrame::Plain); + viewport()->setAutoFillBackground(false); + setContentsMargins(0, 0, 0, 0); + document()->setDocumentMargin(0); + show(); +}; + +PreLaunchButton::PreLaunchButton(QWidget *parent, bool confirm) : QPushButton(parent) { + setFlat(true); + + setObjectName(confirm ? "confirm" : "cancel"); + + QFont closeFont(font()); + closeFont.setFamily(qsl("Open Sans Semibold")); + closeFont.setPixelSize(static_cast(parent)->basicSize()); + setFont(closeFont); + + setCursor(Qt::PointingHandCursor); + show(); +}; + +void PreLaunchButton::setText(const QString &text) { + QPushButton::setText(text); + updateGeometry(); + resize(sizeHint()); +} + +NotStartedWindow::NotStartedWindow() +: _label(this) +, _log(this) +, _close(this) { + _label.setText(qsl("Could not start Telegram Desktop!\nYou can see complete log below:")); - _log.setReadOnly(true); _log.setPlainText(Logs::full()); - _log.show(); + + connect(&_close, SIGNAL(clicked()), this, SLOT(close())); + _close.setText(qsl("CLOSE")); QRect scr(QApplication::primaryScreen()->availableGeometry()); - setGeometry(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6), scr.width() / 2, scr.height() / 2); + move(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6)); + updateControls(); show(); } +void NotStartedWindow::updateControls() { + _label.show(); + _log.show(); + _close.show(); + + QRect scr(QApplication::primaryScreen()->availableGeometry()); + QSize s(scr.width() / 2, scr.height() / 2); + if (s == size()) { + resizeEvent(0); + } else { + resize(s); + } +} + void NotStartedWindow::closeEvent(QCloseEvent *e) { deleteLater(); } void NotStartedWindow::resizeEvent(QResizeEvent *e) { - int padding = _label.sizeHint().height() / 2; + int padding = _size; _label.setGeometry(padding, padding, width() - 2 * padding, _label.sizeHint().height()); - _log.setGeometry(padding, padding * 2 + _label.sizeHint().height(), width() - 2 * padding, height() - 3 * padding - _label.sizeHint().height()); + _log.setGeometry(padding, padding * 2 + _label.sizeHint().height(), width() - 2 * padding, height() - 4 * padding - _label.height() - _close.height()); + _close.setGeometry(width() - padding - _close.width(), height() - padding - _close.height(), _close.width(), _close.height()); } -LastCrashedWindow::LastCrashedWindow() : TWidget(0) +LastCrashedWindow::LastCrashedWindow() +: _port(80) , _label(this) -, _log(this) -, _send(this) { - _label.setText(qsl("Could not start Telegram Desktop! Log:")); +, _pleaseSendReport(this) +, _minidump(this) +, _report(this) +, _send(this) +, _sendSkip(this, false) +, _networkSettings(this) +, _continue(this) +, _showReport(this) +, _saveReport(this) +, _getApp(this) +, _reportText(QString::fromUtf8(Global::LastCrashDump())) +, _reportShown(false) +, _reportSaved(false) +, _sendingState(Global::LastCrashDump().isEmpty() ? SendingNoReport : SendingUpdateCheck) +, _updating(this) +, _sendingProgress(0) +, _sendingTotal(0) +, _checkReply(0) +, _sendReply(0) +#ifndef TDESKTOP_DISABLE_AUTOUPDATE +, _updatingCheck(this) +, _updatingSkip(this, false) +#endif +{ + +#ifdef Q_OS_WIN + if (_sendingState != SendingNoReport) { + QString maxDump, maxDumpFull; + QDateTime maxDumpModified; + qint64 maxDumpSize = 0; + QFileInfoList list = QDir(cWorkingDir() + qsl("tdumps")).entryInfoList(); + for (int32 i = 0, l = list.size(); i < l; ++i) { + if (maxDump.isEmpty() || maxDumpModified < list.at(i).lastModified()) { + maxDump = list.at(i).fileName(); + maxDumpFull = list.at(i).absoluteFilePath(); + maxDumpModified = list.at(i).lastModified(); + maxDumpSize = list.at(i).size(); + } + } + if (!maxDump.isEmpty()) { + if (qAbs(QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified().secsTo(maxDumpModified)) < 10) { + _minidumpName = maxDump; + _minidumpFull = maxDumpFull; + } + } + + _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(maxDumpSize / 1024)); + } +#endif + + _networkSettings.setText(qsl("NETWORK SETTINGS")); + connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings())); + + if (_sendingState == SendingNoReport) { + _label.setText(qsl("Last time Telegram Desktop was not closed properly.")); + } else { + _label.setText(qsl("Last time Telegram Desktop crashed :(")); + } + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + _updatingCheck.setText(qsl("TRY AGAIN")); + connect(&_updatingCheck, SIGNAL(clicked()), this, SLOT(onUpdateRetry())); + _updatingSkip.setText(qsl("SKIP")); + connect(&_updatingSkip, SIGNAL(clicked()), this, SLOT(onUpdateSkip())); + + Sandboxer::connect(SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); + Sandboxer::connect(SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); + Sandboxer::connect(SIGNAL(updateProgress(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); + Sandboxer::connect(SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); + Sandboxer::connect(SIGNAL(updateReady()), this, SLOT(onUpdateReady())); + + switch (Sandboxer::updatingState()) { + case Application::UpdatingDownload: + setUpdatingState(UpdatingDownload, true); + setDownloadProgress(Sandboxer::updatingReady(), Sandboxer::updatingSize()); + break; + case Application::UpdatingReady: setUpdatingState(UpdatingReady, true); break; + default: setUpdatingState(UpdatingCheck, true); break; + } + + cSetLastUpdateCheck(0); + Sandboxer::startUpdateCheck(); +#else + _updating.setText(qsl("Please check if there is a new version available.")); + if (_sendingState != SendingNoReport) { + _sendingState = SendingNone; + } +#endif + + _pleaseSendReport.setText(qsl("Please send us a crash report.")); + + _report.setPlainText(_reportText); + + _showReport.setText(qsl("VIEW REPORT")); + connect(&_showReport, SIGNAL(clicked()), this, SLOT(onViewReport())); + _saveReport.setText(qsl("SAVE TO FILE")); + connect(&_saveReport, SIGNAL(clicked()), this, SLOT(onSaveReport())); + _getApp.setText(qsl("GET THE LATEST OFFICIAL VERSION OF TELEGRAM DESKTOP")); + connect(&_getApp, SIGNAL(clicked()), this, SLOT(onGetApp())); + + _send.setText(qsl("SEND CRASH REPORT")); + connect(&_send, SIGNAL(clicked()), this, SLOT(onSendReport())); + + _sendSkip.setText(qsl("SKIP")); + connect(&_sendSkip, SIGNAL(clicked()), this, SLOT(onContinue())); + _continue.setText(qsl("CONTINUE")); + connect(&_continue, SIGNAL(clicked()), this, SLOT(onContinue())); + + QRect scr(QApplication::primaryScreen()->availableGeometry()); + move(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6)); + updateControls(); + show(); +} + +void LastCrashedWindow::onViewReport() { + _reportShown = !_reportShown; + updateControls(); +} + +void LastCrashedWindow::onSaveReport() { + QString to = QFileDialog::getSaveFileName(0, qsl("Telegram Crash Report"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + qsl("/report"), qsl("Telegram crash report (*.telegramcrash)")); + if (!to.isEmpty()) { + QFile file(to); + if (file.open(QIODevice::WriteOnly)) { + file.write(Global::LastCrashDump()); + _reportSaved = true; + updateControls(); + } + } +} + +void LastCrashedWindow::onGetApp() { + QDesktopServices::openUrl(qsl("https://desktop.telegram.org")); +} + +QString LastCrashedWindow::getReportField(const QLatin1String &name, const QLatin1String &prefix) { + QStringList lines = _reportText.split('\n'); + for (int32 i = 0, l = lines.size(); i < l; ++i) { + if (lines.at(i).trimmed().startsWith(prefix)) { + QString data = lines.at(i).trimmed().mid(prefix.size()).trimmed(); + + if (name == qstr("version")) { + if (data.endsWith(qstr(" beta"))) { + data = QString::number(-data.replace(QRegularExpression(qsl("[^\\d]")), "").mid(0, data.size() - 5).toLongLong()); + } else { + data = QString::number(data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong()); + } + } + + return data; + } + } + return QString(); +} + +void LastCrashedWindow::addReportFieldPart(const QLatin1String &name, const QLatin1String &prefix, QHttpMultiPart *multipart) { + QString data = getReportField(name, prefix); + if (!data.isEmpty()) { + QHttpPart reportPart; + reportPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(qsl("form-data; name=\"%1\"").arg(name))); + reportPart.setBody(data.toUtf8()); + multipart->append(reportPart); + } +} + +void LastCrashedWindow::onSendReport() { + if (_checkReply) { + _checkReply->deleteLater(); + _checkReply = 0; + } + if (_sendReply) { + _sendReply->deleteLater(); + _sendReply = 0; + } + App::setProxySettings(_sendManager); + + QString apiid = getReportField(qstr("apiid"), qstr("ApiId:")), version = getReportField(qstr("version"), qstr("Version:")); + _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2").arg(apiid).arg(version))); + + connect(_checkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); + connect(_checkReply, SIGNAL(finished()), this, SLOT(onCheckingFinished())); + + _pleaseSendReport.setText(qsl("Sending crash report..")); + _sendingState = SendingProgress; + _reportShown = false; + updateControls(); +} + +namespace { + struct zByteArray { + zByteArray() : pos(0), err(0) { + } + uLong pos; + int err; + QByteArray data; + }; + + voidpf zByteArrayOpenFile(voidpf opaque, const char* filename, int mode) { + zByteArray *ba = (zByteArray*)opaque; + if (mode & ZLIB_FILEFUNC_MODE_WRITE) { + if (mode & ZLIB_FILEFUNC_MODE_CREATE) { + ba->data.clear(); + } + ba->pos = ba->data.size(); + ba->data.reserve(2 * 1024 * 1024); + } else if (mode & ZLIB_FILEFUNC_MODE_READ) { + ba->pos = 0; + } + ba->err = 0; + return opaque; + } + + uLong zByteArrayReadFile(voidpf opaque, voidpf stream, void* buf, uLong size) { + zByteArray *ba = (zByteArray*)opaque; + uLong toRead = 0; + if (!ba->err) { + if (ba->data.size() > ba->pos) { + toRead = qMin(size, uLong(ba->data.size() - ba->pos)); + memcpy(buf, ba->data.constData() + ba->pos, toRead); + ba->pos += toRead; + } + if (toRead < size) { + ba->err = -1; + } + } + return toRead; + } + + uLong zByteArrayWriteFile(voidpf opaque, voidpf stream, const void* buf, uLong size) { + zByteArray *ba = (zByteArray*)opaque; + if (ba->data.size() < ba->pos + size) { + ba->data.resize(ba->pos + size); + } + memcpy(ba->data.data() + ba->pos, buf, size); + ba->pos += size; + return size; + } + + int zByteArrayCloseFile(voidpf opaque, voidpf stream) { + zByteArray *ba = (zByteArray*)opaque; + int result = ba->err; + ba->pos = 0; + ba->err = 0; + return result; + } + + int zByteArrayErrorFile(voidpf opaque, voidpf stream) { + zByteArray *ba = (zByteArray*)opaque; + return ba->err; + } + + long zByteArrayTellFile(voidpf opaque, voidpf stream) { + zByteArray *ba = (zByteArray*)opaque; + return ba->pos; + } + + long zByteArraySeekFile(voidpf opaque, voidpf stream, uLong offset, int origin) { + zByteArray *ba = (zByteArray*)opaque; + if (!ba->err) { + switch (origin) { + case ZLIB_FILEFUNC_SEEK_SET: ba->pos = offset; break; + case ZLIB_FILEFUNC_SEEK_CUR: ba->pos += offset; break; + case ZLIB_FILEFUNC_SEEK_END: ba->pos = ba->data.size() + offset; break; + } + if (ba->pos > ba->data.size()) { + ba->err = -1; + } + } + return ba->err; + } + +} + +void LastCrashedWindow::onCheckingFinished() { + if (!_checkReply || _sendReply) return; + + QByteArray result = _checkReply->readAll().trimmed(); + _checkReply->deleteLater(); + _checkReply = 0; + + LOG(("Crash report check for sending done, result: %1").arg(QString::fromUtf8(result))); + + if (result == "Many") { + _pleaseSendReport.setText(qsl("Too many crash reports at this moment :(")); + _sendingState = SendingTooMany; + updateControls(); + return; + } else if (result == "Unofficial") { + _pleaseSendReport.setText(qsl("You use some custom version of Telegram Desktop.")); + _sendingState = SendingUnofficial; + updateControls(); + return; + } else if (result != "Report") { + _pleaseSendReport.setText(qsl("This report is about some old version of Telegram Desktop.")); + _sendingState = SendingTooOld; + updateControls(); + return; + } + + QHttpMultiPart *multipart = new QHttpMultiPart(QHttpMultiPart::FormDataType); + + addReportFieldPart(qstr("platform"), qstr("Platform:"), multipart); + addReportFieldPart(qstr("version"), qstr("Version:"), multipart); + + QHttpPart reportPart; + reportPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream")); + reportPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"report\"; filename=\"report.telegramcrash\"")); + reportPart.setBody(Global::LastCrashDump()); + multipart->append(reportPart); + + QFileInfo dmpFile(_minidumpFull); + if (dmpFile.exists() && dmpFile.size() > 0 && dmpFile.size() < 20 * 1024 * 1024 && + QRegularExpression(qsl("^Telegram\\-[\\d\\.\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { + QFile file(_minidumpFull); + if (file.open(QIODevice::ReadOnly)) { + QByteArray minidump = file.readAll(); + file.close(); + + QString zipName = dmpFile.fileName().replace(qstr(".dmp"), qstr(".zip")); + zByteArray minidumpZip; + + bool failed = false; + zlib_filefunc_def zfuncs; + zfuncs.opaque = &minidumpZip; + zfuncs.zopen_file = zByteArrayOpenFile; + zfuncs.zerror_file = zByteArrayErrorFile; + zfuncs.zread_file = zByteArrayReadFile; + zfuncs.zwrite_file = zByteArrayWriteFile; + zfuncs.zclose_file = zByteArrayCloseFile; + zfuncs.zseek_file = zByteArraySeekFile; + zfuncs.ztell_file = zByteArrayTellFile; + + if (zipFile zf = zipOpen2(0, APPEND_STATUS_CREATE, 0, &zfuncs)) { + zip_fileinfo zfi = { 0 }; + std::wstring fileName = dmpFile.fileName().toStdWString(); + if (zipOpenNewFileInZip(zf, std::string(fileName.begin(), fileName.end()).c_str(), &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION) != S_OK) { + failed = true; + } else if (zipWriteInFileInZip(zf, minidump.constData(), minidump.size()) != 0) { + failed = true; + } else if (zipCloseFileInZip(zf) != 0) { + failed = true; + } + if (zipClose(zf, NULL) != 0) { + failed = true; + } + if (failed) { + minidumpZip.err = -1; + } + } + + if (!minidumpZip.err) { + QHttpPart dumpPart; + dumpPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream")); + dumpPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(qsl("form-data; name=\"dump\"; filename=\"%1\"").arg(zipName))); + dumpPart.setBody(minidumpZip.data); + multipart->append(dumpPart); + + _minidump.setText(qsl("+ %1 (%2 KB)").arg(zipName).arg(minidumpZip.data.size() / 1024)); + } + } + } + + _sendReply = _sendManager.post(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=report")), multipart); + multipart->setParent(_sendReply); + + connect(_sendReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); + connect(_sendReply, SIGNAL(finished()), this, SLOT(onSendingFinished())); + connect(_sendReply, SIGNAL(uploadProgress(qint64,qint64)), this, SLOT(onSendingProgress(qint64,qint64))); + + updateControls(); +} + +void LastCrashedWindow::updateControls() { + int padding = _size, h = padding + _networkSettings.height() + padding; + _label.show(); +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + h += _networkSettings.height() + padding; + if (_updatingState == UpdatingFail && (_sendingState == SendingNoReport || _sendingState == SendingUpdateCheck)) { + _networkSettings.show(); + _updatingCheck.show(); + _updatingSkip.show(); + _send.hide(); + _sendSkip.hide(); + _continue.hide(); + _pleaseSendReport.hide(); + _getApp.hide(); + _showReport.hide(); + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + h += padding + _updatingCheck.height() + padding; + } else { + if (_updatingState == UpdatingCheck || _sendingState == SendingFail || _sendingState == SendingProgress) { + _networkSettings.show(); + } else { + _networkSettings.hide(); + } + if (_updatingState == UpdatingNone || _updatingState == UpdatingLatest || _updatingState == UpdatingFail) { + h += padding + _updatingCheck.height() + padding; + if (_sendingState == SendingNoReport) { + _pleaseSendReport.hide(); + _getApp.hide(); + _showReport.hide(); + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + _send.hide(); + _sendSkip.hide(); + _continue.show(); + } else { + h += _showReport.height() + padding; + _pleaseSendReport.show(); + if (_sendingState == SendingTooOld || _sendingState == SendingUnofficial) { + QString verStr = getReportField(qstr("version"), qstr("Version:")); + qint64 ver = verStr.isEmpty() ? 0 : verStr.toLongLong(); + if (!ver || (ver == AppVersion) || (ver < 0 && (-ver / 1000) == AppVersion)) { + h += _getApp.height() + padding; + _getApp.show(); + } else { + _getApp.hide(); + } + _showReport.hide(); + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + _send.hide(); + _sendSkip.hide(); + _continue.show(); + } else { + _getApp.hide(); + if (_reportShown) { + h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding)); + _report.show(); + if (_minidumpName.isEmpty()) { + _minidump.hide(); + } else { + _minidump.show(); + } + if (_reportSaved || _sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) { + _saveReport.hide(); + } else { + _saveReport.show(); + } + _showReport.hide(); + } else { + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + if (_sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) { + _showReport.hide(); + } else { + _showReport.show(); + } + } + if (_sendingState == SendingTooMany || _sendingState == SendingDone) { + _send.hide(); + _sendSkip.hide(); + _continue.show(); + } else { + if (_sendingState == SendingProgress || _sendingState == SendingUploading) { + _send.hide(); + } else { + _send.show(); + } + _sendSkip.show(); + _continue.hide(); + } + } + } + } else { + _getApp.hide(); + _pleaseSendReport.hide(); + _showReport.hide(); + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + _send.hide(); + _sendSkip.hide(); + _continue.hide(); + } + _updatingCheck.hide(); + if (_updatingState == UpdatingCheck || _updatingState == UpdatingDownload) { + h += padding + _updatingSkip.height() + padding; + _updatingSkip.show(); + } else { + _updatingSkip.hide(); + } + } +#else + h += _networkSettings.height() + padding; + h += padding + _send.height() + padding; + if (_sendingState == SendingNoReport) { + _pleaseSendReport.hide(); + _showReport.hide(); + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + _send.hide(); + _sendSkip.hide(); + _continue.show(); + _networkSettings.hide(); + } else { + h += _showReport.height() + padding; + _pleaseSendReport.show(); + if (_reportShown) { + h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding)); + _report.show(); + if (_minidumpName.isEmpty()) { + _minidump.hide(); + } else { + _minidump.show(); + } + _showReport.hide(); + if (_reportSaved || _sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) { + _saveReport.hide(); + } else { + _saveReport.show(); + } + } else { + _report.hide(); + _minidump.hide(); + _saveReport.hide(); + if (_sendingState == SendingFail || _sendingState == SendingProgress || _sendingState == SendingUploading) { + _showReport.hide(); + } else { + _showReport.show(); + } + } + if (_sendingState == SendingDone) { + _send.hide(); + _sendSkip.hide(); + _continue.show(); + _networkSettings.hide(); + } else { + if (_sendingState == SendingProgress || _sendingState == SendingUploading) { + _send.hide(); + } else { + _send.show(); + } + _sendSkip.show(); + if (_sendingState == SendingFail) { + _networkSettings.show(); + } else { + _networkSettings.hide(); + } + _continue.hide(); + } + } - _log.setReadOnly(true); - _log.setPlainText(Logs::full()); - _log.show(); + _getApp.show(); + h += _networkSettings.height() + padding; +#endif - _send.setText(qsl("Send Crash Report")); - _send.show(); + QRect scr(QApplication::primaryScreen()->availableGeometry()); + QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h); + if (s == size()) { + resizeEvent(0); + } else { + resize(s); + } +} + +void LastCrashedWindow::onNetworkSettings() { + const ConnectionProxy &p(Global::PreLaunchProxy()); + NetworkSettingsWindow *box = new NetworkSettingsWindow(this, p.host, p.port ? p.port : 80, p.user, p.password); + connect(box, SIGNAL(saved(QString, quint32, QString, QString)), this, SLOT(onNetworkSettingsSaved(QString, quint32, QString, QString))); + box->show(); +} + +void LastCrashedWindow::onNetworkSettingsSaved(QString host, quint32 port, QString username, QString password) { + Global::RefPreLaunchProxy().host = host; + Global::RefPreLaunchProxy().port = port ? port : 80; + Global::RefPreLaunchProxy().user = username; + Global::RefPreLaunchProxy().password = password; +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + if ((_updatingState == UpdatingFail && (_sendingState == SendingNoReport || _sendingState == SendingUpdateCheck)) || (_updatingState == UpdatingCheck)) { + Sandboxer::stopUpdate(); + cSetLastUpdateCheck(0); + Sandboxer::startUpdateCheck(); + } else +#endif + if (_sendingState == SendingFail || _sendingState == SendingProgress) { + onSendReport(); + } + activate(); +} + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE +void LastCrashedWindow::setUpdatingState(UpdatingState state, bool force) { + if (_updatingState != state || force) { + _updatingState = state; + switch (state) { + case UpdatingLatest: + _updating.setText(qsl("Latest version is installed.")); + if (_sendingState == SendingNoReport) { + QTimer::singleShot(0, this, SLOT(onContinue())); + } else { + _sendingState = SendingNone; + } + break; + case UpdatingReady: + if (checkReadyUpdate()) { + cSetRestartingUpdate(true); + App::quit(); + return; + } else { + setUpdatingState(UpdatingFail); + return; + } + break; + case UpdatingCheck: + _updating.setText(qsl("Checking for updates..")); + break; + case UpdatingFail: + _updating.setText(qsl("Update check failed :(")); + break; + } + updateControls(); + } +} + +void LastCrashedWindow::setDownloadProgress(qint64 ready, qint64 total) { + qint64 readyTenthMb = (ready * 10 / (1024 * 1024)), totalTenthMb = (total * 10 / (1024 * 1024)); + QString readyStr = QString::number(readyTenthMb / 10) + '.' + QString::number(readyTenthMb % 10); + QString totalStr = QString::number(totalTenthMb / 10) + '.' + QString::number(totalTenthMb % 10); + QString res = qsl("Downloading update {ready} / {total} MB..").replace(qstr("{ready}"), readyStr).replace(qstr("{total}"), totalStr); + if (_newVersionDownload != res) { + _newVersionDownload = res; + _updating.setText(_newVersionDownload); + updateControls(); + } +} + +void LastCrashedWindow::onUpdateRetry() { + cSetLastUpdateCheck(0); + Sandboxer::startUpdateCheck(); +} + +void LastCrashedWindow::onUpdateSkip() { + if (_sendingState == SendingNoReport) { + onContinue(); + } else { + if (_updatingState == UpdatingCheck || _updatingState == UpdatingDownload) { + Sandboxer::stopUpdate(); + setUpdatingState(UpdatingFail); + } + _sendingState = SendingNone; + updateControls(); + } +} + +void LastCrashedWindow::onUpdateChecking() { + setUpdatingState(UpdatingCheck); +} + +void LastCrashedWindow::onUpdateLatest() { + setUpdatingState(UpdatingLatest); +} + +void LastCrashedWindow::onUpdateDownloading(qint64 ready, qint64 total) { + setUpdatingState(UpdatingDownload); + setDownloadProgress(ready, total); +} + +void LastCrashedWindow::onUpdateReady() { + setUpdatingState(UpdatingReady); +} + +void LastCrashedWindow::onUpdateFailed() { + setUpdatingState(UpdatingFail); +} +#endif + +void LastCrashedWindow::onContinue() { + if (SignalHandlers::restart() == SignalHandlers::CantOpen) { + new NotStartedWindow(); + } else { + new AppClass(); + } + close(); +} + +void LastCrashedWindow::onSendingError(QNetworkReply::NetworkError e) { + LOG(("Crash report sending error: %1").arg(e)); + + _pleaseSendReport.setText(qsl("Sending crash report failed :(")); + _sendingState = SendingFail; + if (_checkReply) { + _checkReply->deleteLater(); + _checkReply = 0; + } + if (_sendReply) { + _sendReply->deleteLater(); + _sendReply = 0; + } + updateControls(); +} + +void LastCrashedWindow::onSendingFinished() { + if (_sendReply) { + QByteArray result = _sendReply->readAll(); + LOG(("Crash report sending done, result: %1").arg(QString::fromUtf8(result))); + + _sendReply->deleteLater(); + _sendReply = 0; + _pleaseSendReport.setText(qsl("Thank you for your report!")); + _sendingState = SendingDone; + updateControls(); + + SignalHandlers::restart(); + } +} + +void LastCrashedWindow::onSendingProgress(qint64 uploaded, qint64 total) { + if (_sendingState != SendingProgress && _sendingState != SendingUploading) return; + _sendingState = SendingUploading; + + if (total < 0) { + _pleaseSendReport.setText(qsl("Sending crash report %1 KB..").arg(uploaded / 1024)); + } else { + _pleaseSendReport.setText(qsl("Sending crash report %1 / %2 KB..").arg(uploaded / 1024).arg(total / 1024)); + } + updateControls(); +} + +void LastCrashedWindow::closeEvent(QCloseEvent *e) { + deleteLater(); +} + +void LastCrashedWindow::resizeEvent(QResizeEvent *e) { + int padding = _size; + _label.move(padding, padding + (_networkSettings.height() - _label.height()) / 2); + + _send.move(width() - padding - _send.width(), height() - padding - _send.height()); + if (_sendingState == SendingProgress || _sendingState == SendingUploading) { + _sendSkip.move(width() - padding - _sendSkip.width(), height() - padding - _sendSkip.height()); + } else { + _sendSkip.move(width() - padding - _send.width() - padding - _sendSkip.width(), height() - padding - _sendSkip.height()); + } + + _updating.move(padding, padding * 2 + _networkSettings.height() + (_networkSettings.height() - _updating.height()) / 2); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); + _showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding); + _getApp.move((width() - _getApp.width()) / 2, _showReport.y() + _showReport.height() + padding); + + if (_sendingState == SendingFail || _sendingState == SendingProgress) { + _networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding); + } else { + _networkSettings.move(padding * 2 + _updating.width(), padding * 2 + _networkSettings.height()); + } + + if (_updatingState == UpdatingCheck || _updatingState == UpdatingDownload) { + _updatingCheck.move(width() - padding - _updatingCheck.width(), height() - padding - _updatingCheck.height()); + _updatingSkip.move(width() - padding - _updatingSkip.width(), height() - padding - _updatingSkip.height()); + } else { + _updatingCheck.move(width() - padding - _updatingCheck.width(), height() - padding - _updatingCheck.height()); + _updatingSkip.move(width() - padding - _updatingCheck.width() - padding - _updatingSkip.width(), height() - padding - _updatingSkip.height()); + } +#else + _getApp.move((width() - _getApp.width()) / 2, _updating.y() + _updating.height() + padding); + + _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); + _showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); + + _networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); +#endif + + _report.setGeometry(padding, _showReport.y() + _showReport.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); + _minidump.move(padding, _report.y() + _report.height() + padding); + _saveReport.move(_showReport.x(), _showReport.y()); + + _continue.move(width() - padding - _continue.width(), height() - padding - _continue.height()); +} + +NetworkSettingsWindow::NetworkSettingsWindow(QWidget *parent, QString host, quint32 port, QString username, QString password) +: PreLaunchWindow(qsl("HTTP Proxy Settings")) +, _hostLabel(this) +, _portLabel(this) +, _usernameLabel(this) +, _passwordLabel(this) +, _hostInput(this) +, _portInput(this) +, _usernameInput(this) +, _passwordInput(this, true) +, _save(this) +, _cancel(this, false) +, _parent(parent) { + setWindowModality(Qt::ApplicationModal); + + _hostLabel.setText(qsl("Hostname")); + _portLabel.setText(qsl("Port")); + _usernameLabel.setText(qsl("Username")); + _passwordLabel.setText(qsl("Password")); + + _save.setText(qsl("SAVE")); + connect(&_save, SIGNAL(clicked()), this, SLOT(onSave())); + _cancel.setText(qsl("CANCEL")); + connect(&_cancel, SIGNAL(clicked()), this, SLOT(close())); + + _hostInput.setText(host); + _portInput.setText(QString::number(port)); + _usernameInput.setText(username); + _passwordInput.setText(password); + + QRect scr(QApplication::primaryScreen()->availableGeometry()); + move(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6)); + updateControls(); + show(); + + _hostInput.setFocus(); + _hostInput.setCursorPosition(_hostInput.text().size()); +} + +void NetworkSettingsWindow::resizeEvent(QResizeEvent *e) { + int padding = _size; + _hostLabel.move(padding, padding); + _hostInput.setGeometry(_hostLabel.x(), _hostLabel.y() + _hostLabel.height(), 2 * _hostLabel.width(), _hostInput.height()); + _portLabel.move(padding + _hostInput.width() + padding, padding); + _portInput.setGeometry(_portLabel.x(), _portLabel.y() + _portLabel.height(), width() - padding - _portLabel.x(), _portInput.height()); + _usernameLabel.move(padding, _hostInput.y() + _hostInput.height() + padding); + _usernameInput.setGeometry(_usernameLabel.x(), _usernameLabel.y() + _usernameLabel.height(), (width() - 3 * padding) / 2, _usernameInput.height()); + _passwordLabel.move(padding + _usernameInput.width() + padding, _usernameLabel.y()); + _passwordInput.setGeometry(_passwordLabel.x(), _passwordLabel.y() + _passwordLabel.height(), width() - padding - _passwordLabel.x(), _passwordInput.height()); + + _save.move(width() - padding - _save.width(), height() - padding - _save.height()); + _cancel.move(_save.x() - padding - _cancel.width(), _save.y()); +} + +void NetworkSettingsWindow::onSave() { + QString host = _hostInput.text().trimmed(), port = _portInput.text().trimmed(), username = _usernameInput.text().trimmed(), password = _passwordInput.text().trimmed(); + if (!port.isEmpty() && !port.toUInt()) { + _portInput.setFocus(); + return; + } else if (!host.isEmpty() && port.isEmpty()) { + _portInput.setFocus(); + return; + } + emit saved(host, port.toUInt(), username, password); + close(); +} + +void NetworkSettingsWindow::closeEvent(QCloseEvent *e) { +} + +void NetworkSettingsWindow::updateControls() { + _hostInput.updateGeometry(); + _hostInput.resize(_hostInput.sizeHint()); + _portInput.updateGeometry(); + _portInput.resize(_portInput.sizeHint()); + _usernameInput.updateGeometry(); + _usernameInput.resize(_usernameInput.sizeHint()); + _passwordInput.updateGeometry(); + _passwordInput.resize(_passwordInput.sizeHint()); + + int padding = _size; + int w = 2 * padding + _hostLabel.width() * 2 + padding + _portLabel.width() * 2 + padding; + int h = padding + _hostLabel.height() + _hostInput.height() + padding + _usernameLabel.height() + _usernameInput.height() + padding + _save.height() + padding; + if (w == width() && h == height()) { + resizeEvent(0); + } else { + setGeometry(_parent->x() + (_parent->width() - w) / 2, _parent->y() + (_parent->height() - h) / 2, w, h); + } +} + +ShowCrashReportWindow::ShowCrashReportWindow(const QString &text) +: _log(this) { + _log.setPlainText(text); QRect scr(QApplication::primaryScreen()->availableGeometry()); setGeometry(scr.x() + (scr.width() / 6), scr.y() + (scr.height() / 6), scr.width() / 2, scr.height() / 2); show(); } -void LastCrashedWindow::closeEvent(QCloseEvent *e) { - deleteLater(); - if (SignalHandlers::restart() == SignalHandlers::CantOpen) { - new NotStartedWindow(); - } else { - new AppClass(); - } -} - -void LastCrashedWindow::resizeEvent(QResizeEvent *e) { - int padding = _label.sizeHint().height() / 2; - _label.setGeometry(padding, padding, width() - 2 * padding, _label.sizeHint().height()); - _log.setGeometry(padding, padding * 2 + _label.sizeHint().height(), width() - 2 * padding, height() - 3 * padding - _label.sizeHint().height()); +void ShowCrashReportWindow::resizeEvent(QResizeEvent *e) { + _log.setGeometry(rect().marginsRemoved(QMargins(basicSize(), basicSize(), basicSize(), basicSize()))); } diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index 535ec3f4ed..f7c968ce84 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -18,8 +18,7 @@ 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-2015 John Preston, https://desktop.telegram.org */ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include "title.h" #include "pspecific.h" @@ -353,7 +352,47 @@ private: MediaView *_mediaView; }; -class NotStartedWindow : public TWidget { +class PreLaunchWindow : public TWidget { +public: + + PreLaunchWindow(QString title = QString()); + void activate(); + float64 basicSize() const { + return _size; + } + ~PreLaunchWindow(); + + static PreLaunchWindow *instance(); + +protected: + + float64 _size; + +}; + +class PreLaunchLabel : public QLabel { +public: + PreLaunchLabel(QWidget *parent); + void setText(const QString &text); +}; + +class PreLaunchInput : public QLineEdit { +public: + PreLaunchInput(QWidget *parent, bool password = false); +}; + +class PreLaunchLog : public QTextEdit { +public: + PreLaunchLog(QWidget *parent); +}; + +class PreLaunchButton : public QPushButton { +public: + PreLaunchButton(QWidget *parent, bool confirm = true); + void setText(const QString &text); +}; + +class NotStartedWindow : public PreLaunchWindow { public: NotStartedWindow(); @@ -365,16 +404,48 @@ protected: private: - QLabel _label; - QTextEdit _log; + void updateControls(); + + PreLaunchLabel _label; + PreLaunchLog _log; + PreLaunchButton _close; }; -class LastCrashedWindow : public TWidget { +class LastCrashedWindow : public PreLaunchWindow { + Q_OBJECT + public: LastCrashedWindow(); +public slots: + + void onViewReport(); + void onSaveReport(); + void onSendReport(); + void onGetApp(); + + void onNetworkSettings(); + void onNetworkSettingsSaved(QString host, quint32 port, QString username, QString password); + void onContinue(); + + void onCheckingFinished(); + void onSendingError(QNetworkReply::NetworkError e); + void onSendingFinished(); + void onSendingProgress(qint64 uploaded, qint64 total); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + void onUpdateRetry(); + void onUpdateSkip(); + + void onUpdateChecking(); + void onUpdateLatest(); + void onUpdateDownloading(qint64 ready, qint64 total); + void onUpdateReady(); + void onUpdateFailed(); +#endif + protected: void closeEvent(QCloseEvent *e); @@ -382,10 +453,103 @@ protected: private: - QLabel _label; - QTextEdit _log; - QPushButton _send; + void updateControls(); + + QString _host, _username, _password; + quint32 _port; + + PreLaunchLabel _label, _pleaseSendReport, _minidump; + PreLaunchLog _report; + PreLaunchButton _send, _sendSkip, _networkSettings, _continue, _showReport, _saveReport, _getApp; + + QString _minidumpName, _minidumpFull, _reportText; + bool _reportShown, _reportSaved; + + enum SendingState { + SendingNoReport, + SendingUpdateCheck, + SendingNone, + SendingTooOld, + SendingTooMany, + SendingUnofficial, + SendingProgress, + SendingUploading, + SendingFail, + SendingDone, + }; + SendingState _sendingState; + + PreLaunchLabel _updating; + qint64 _sendingProgress, _sendingTotal; + + QNetworkAccessManager _sendManager; + QNetworkReply *_checkReply, *_sendReply; + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + PreLaunchButton _updatingCheck, _updatingSkip; + enum UpdatingState { + UpdatingNone, + UpdatingCheck, + UpdatingLatest, + UpdatingDownload, + UpdatingFail, + UpdatingReady + }; + UpdatingState _updatingState; + QString _newVersionDownload; + + void setUpdatingState(UpdatingState state, bool force = false); + void setDownloadProgress(qint64 ready, qint64 total); +#endif + + QString getReportField(const QLatin1String &name, const QLatin1String &prefix); + void addReportFieldPart(const QLatin1String &name, const QLatin1String &prefix, QHttpMultiPart *multipart); }; -#endif // MAINWINDOW_H +class NetworkSettingsWindow : public PreLaunchWindow { + Q_OBJECT + +public: + + NetworkSettingsWindow(QWidget *parent, QString host, quint32 port, QString username, QString password); + +signals: + + void saved(QString host, quint32 port, QString username, QString password); + +public slots: + + void onSave(); + +protected: + + void closeEvent(QCloseEvent *e); + void resizeEvent(QResizeEvent *e); + +private: + + void updateControls(); + + PreLaunchLabel _hostLabel, _portLabel, _usernameLabel, _passwordLabel; + PreLaunchInput _hostInput, _portInput, _usernameInput, _passwordInput; + PreLaunchButton _save, _cancel; + + QWidget *_parent; + +}; + +class ShowCrashReportWindow : public PreLaunchWindow { +public: + + ShowCrashReportWindow(const QString &text); + +protected: + + void resizeEvent(QResizeEvent *e); + +private: + + PreLaunchLog _log; + +}; diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 5530f46a48..44ffbe14dd 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -1053,8 +1053,14 @@ + + NotUsing + + + + $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... @@ -1630,7 +1636,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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" "-fstdafx.h" "-f../../SourceFiles/history.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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index a5652079ea..f58dc5f423 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -897,6 +897,9 @@ Generated Files\Release + + Generated Files + @@ -986,6 +989,15 @@ Source Files + + Generated Files + + + Generated Files + + + Generated Files + From 340246367dc6256aafa2220aeed7d8fcee0a6ef6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 30 Jan 2016 21:24:18 +0300 Subject: [PATCH 031/316] crash report and show done for os x --- Telegram/SourceFiles/_other/updater_osx.m | 25 ++-- Telegram/SourceFiles/application.cpp | 11 +- Telegram/SourceFiles/application.h | 1 - Telegram/SourceFiles/autoupdater.cpp | 4 +- Telegram/SourceFiles/boxes/aboutbox.cpp | 2 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 2 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- Telegram/SourceFiles/boxes/usernamebox.cpp | 2 +- Telegram/SourceFiles/historywidget.cpp | 21 ++++ Telegram/SourceFiles/logs.cpp | 31 ++++- Telegram/SourceFiles/logs.h | 5 +- Telegram/SourceFiles/pspecific_mac.cpp | 126 +++++++++++++++++-- Telegram/SourceFiles/pspecific_mac.h | 6 +- Telegram/SourceFiles/pspecific_mac_p.h | 4 +- Telegram/SourceFiles/pspecific_mac_p.mm | 22 ++-- Telegram/SourceFiles/structs.h | 4 +- Telegram/SourceFiles/title.cpp | 7 +- Telegram/SourceFiles/window.cpp | 8 +- 18 files changed, 227 insertions(+), 56 deletions(-) diff --git a/Telegram/SourceFiles/_other/updater_osx.m b/Telegram/SourceFiles/_other/updater_osx.m index 4c3e7c4fbb..ea34527f43 100644 --- a/Telegram/SourceFiles/_other/updater_osx.m +++ b/Telegram/SourceFiles/_other/updater_osx.m @@ -23,6 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org NSString *appName = @"Telegram.app"; NSString *appDir = nil; NSString *workDir = nil; +NSString *crashReportArg = nil; #ifdef _DEBUG BOOL _debug = YES; @@ -101,6 +102,10 @@ int main(int argc, const char * argv[]) { [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; procId = [[formatter numberFromString:[NSString stringWithUTF8String:argv[i]]] intValue]; } + } else if ([@"-crashreport" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { + if (++i < argc) { + crashReportArg = [NSString stringWithUTF8String:argv[i]]; + } } else if ([@"-noupdate" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { update = NO; } else if ([@"-tosettings" isEqualToString:[NSString stringWithUTF8String:argv[i]]]) { @@ -214,15 +219,17 @@ int main(int argc, const char * argv[]) { } NSString *appPath = [[NSArray arrayWithObjects:appDir, appRealName, nil] componentsJoinedByString:@""]; - NSMutableArray *args = [[NSMutableArray alloc] initWithObjects:@"-noupdate", nil]; - if (toSettings) [args addObject:@"-tosettings"]; - if (_debug) [args addObject:@"-debug"]; - if (startInTray) [args addObject:@"-startintray"]; - if (testMode) [args addObject:@"-testmode"]; - if (autoStart) [args addObject:@"-autostart"]; - if (key) { - [args addObject:@"-key"]; - [args addObject:key]; + NSMutableArray *args = [[NSMutableArray alloc] initWithObjects: crashReportArg ? crashReportArg : @"-noupdate", nil]; + if (!crashReportArg) { + if (toSettings) [args addObject:@"-tosettings"]; + if (_debug) [args addObject:@"-debug"]; + if (startInTray) [args addObject:@"-startintray"]; + if (testMode) [args addObject:@"-testmode"]; + if (autoStart) [args addObject:@"-autostart"]; + if (key) { + [args addObject:@"-key"]; + [args addObject:key]; + } } writeLog([[NSArray arrayWithObjects:@"Running application '", appPath, @"' with args '", [args componentsJoinedByString:@"' '"], @"'..", nil] componentsJoinedByString:@""]); NSError *error = nil; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 6149620a9b..6ac2a77b67 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -151,6 +151,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) connect(&_localSocket, SIGNAL(readyRead()), this, SLOT(socketReading())); connect(&_localServer, SIGNAL(newConnection()), this, SLOT(newInstanceConnected())); + connect(this, SIGNAL(aboutToQuit()), this, SLOT(closeApplication())); + #ifndef TDESKTOP_DISABLE_AUTOUPDATE connect(&_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck())); connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); @@ -531,12 +533,6 @@ inline Application *application() { namespace Sandboxer { - void setClipboardText(const QString &text) { - if (Application *a = application()) { - a->clipboard()->setText(text); - } - } - QRect availableGeometry() { if (Application *a = application()) { return a->desktop()->availableGeometry(); @@ -724,8 +720,7 @@ AppClass::AppClass() : QObject() application()->installNativeEventFilter(psNativeEventFilter()); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(closeApplication())); - connect(this, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); + connect(application(), SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause())); diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index 940f83819b..26b443955f 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -107,7 +107,6 @@ private: namespace Sandboxer { - void setClipboardText(const QString &text); QRect availableGeometry(); QRect screenGeometry(const QPoint &p); void setActiveWindow(QWidget *window); diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index 7c4796585c..17528d79f0 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -558,12 +558,12 @@ bool checkReadyUpdate() { QDir().mkpath(QFileInfo(curUpdater).absolutePath()); DEBUG_LOG(("Update Info: moving %1 to %2..").arg(updater.absoluteFilePath()).arg(curUpdater)); if (!objc_moveFile(updater.absoluteFilePath(), curUpdater)) { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } #elif defined Q_OS_LINUX if (!linuxMoveFile(QFile::encodeName(updater.absoluteFilePath()).constData(), QFile::encodeName(curUpdater).constData())) { - UpdateDownloader::clearAll(); + UpdateChecker::clearAll(); return false; } #endif diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index 357410b5ef..79b8c72492 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -82,7 +82,7 @@ void AboutBox::onVersion() { } url = url.arg(qsl("tbeta%1_%2").arg(cRealBetaVersion()).arg(countBetaVersionSignature(cRealBetaVersion()))); - Sandboxer::setClipboardText(url); + Application::clipboard()->setText(url); Ui::showLayer(new InformBox("The link to the current private beta version of Telegram Desktop was copied to the clipboard.")); } else { diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 7db72e9a69..c2d94321a0 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -750,7 +750,7 @@ void SetupChannelBox::mouseMoveEvent(QMouseEvent *e) { void SetupChannelBox::mousePressEvent(QMouseEvent *e) { mouseMoveEvent(e); if (_linkOver) { - Sandboxer::setClipboardText(_channel->invitationUrl); + Application::clipboard()->setText(_channel->invitationUrl); _goodTextLink = lang(lng_create_channel_link_copied); a_goodOpacity = anim::fvalue(1, 0); _a_goodFade.start(); diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index af570091d5..b619af2657 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -212,7 +212,7 @@ void MaxInviteBox::mouseMoveEvent(QMouseEvent *e) { void MaxInviteBox::mousePressEvent(QMouseEvent *e) { mouseMoveEvent(e); if (_linkOver) { - Sandboxer::setClipboardText(_link); + Application::clipboard()->setText(_link); _goodTextLink = lang(lng_create_channel_link_copied); a_goodOpacity = anim::fvalue(1, 0); _a_good.start(); diff --git a/Telegram/SourceFiles/boxes/usernamebox.cpp b/Telegram/SourceFiles/boxes/usernamebox.cpp index fa40dcfe9a..b0f11ba746 100644 --- a/Telegram/SourceFiles/boxes/usernamebox.cpp +++ b/Telegram/SourceFiles/boxes/usernamebox.cpp @@ -191,7 +191,7 @@ void UsernameBox::onChanged() { } void UsernameBox::onLinkClick() { - Sandboxer::setClipboardText(qsl("https://telegram.me/") + getName()); + Application::clipboard()->setText(qsl("https://telegram.me/") + getName()); _copiedTextLink = lang(lng_username_copied); update(); } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e58661c29b..66eb870688 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4804,8 +4804,22 @@ void HistoryWidget::onDocumentSelect() { } } +QString _getCrashReportFile(const QMimeData *m) { + if (!m || m->urls().size() != 1) return QString(); + + QString file(m->urls().at(0).toLocalFile()); + if (file.startsWith(qsl("/.file/id="))) file = psConvertFileUrl(file); + + return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString(); +} void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) { + if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) { + e->setDropAction(Qt::CopyAction); + e->accept(); + return; + } + if (!_history) return; if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; @@ -5127,6 +5141,13 @@ bool HistoryWidget::kbWasHidden() const { } void HistoryWidget::dropEvent(QDropEvent *e) { + if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) { + e->acceptProposedAction(); + psExecTelegram(_getCrashReportFile(e->mimeData())); + App::quit(); + return; + } + _attachDrag = DragStateNone; updateDragAreas(); e->acceptProposedAction(); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 94a7e5addc..24aa698495 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -108,7 +108,7 @@ private: QSharedPointer files[LogDataCount]; QTextStream streams[LogDataCount]; - int32 part = -1, index = 0; + int32 part = -1; bool reopen(LogDataType type, int32 dayIndex, const QString &postfix) { if (streams[type].device()) { @@ -596,14 +596,31 @@ namespace SignalHandlers { return _writeNumber(stream, num); } - const dump &operator<<(const dump &stream, DWORD num) { + const dump &operator<<(const dump &stream, uint32 num) { return _writeNumber(stream, num); } - const dump &operator<<(const dump &stream, DWORD64 num) { + const dump &operator<<(const dump &stream, uint64 num) { return _writeNumber(stream, num); } + const dump &operator<<(const dump &stream, double num) { + if (num < 0) { + _writeChar('-'); + num = -num; + } + _writeNumber(stream, uint64(floor(num))); + _writeChar('.'); + num -= floor(num); + for (int i = 0; i < 4; ++i) { + num *= 10; + int digit = int(floor(num)); + _writeChar('0' + digit); + num -= digit; + } + return stream; + } + Qt::HANDLE LoggingCrashThreadId = 0; bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; @@ -665,6 +682,10 @@ namespace SignalHandlers { dump() << "\n"; LoggingCrashThreadId = 0; + +#ifndef Q_OS_WIN + exit(1); +#endif } Status start() { @@ -697,11 +718,11 @@ namespace SignalHandlers { CrashDumpFileNo = fileno(CrashDumpFile); QByteArray launchedDateTime = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8(); - t_assert(launchedDateTime.size() < sizeof(LaunchedDateTimeStr)); + t_assert(launchedDateTime.size() < int(sizeof(LaunchedDateTimeStr))); memcpy(LaunchedDateTimeStr, launchedDateTime.constData(), launchedDateTime.size()); QByteArray launchedBinaryName = cExeName().toUtf8(); - t_assert(launchedBinaryName.size() < sizeof(LaunchedBinaryName)); + t_assert(launchedBinaryName.size() < int(sizeof(LaunchedBinaryName))); memcpy(LaunchedBinaryName, launchedBinaryName.constData(), launchedBinaryName.size()); signal(SIGABRT, SignalHandlers::Handler); diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 80282ef4c3..422110709e 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -93,8 +93,9 @@ namespace SignalHandlers { }; const dump &operator<<(const dump &stream, const char *str); const dump &operator<<(const dump &stream, int num); - const dump &operator<<(const dump &stream, DWORD num); - const dump &operator<<(const dump &stream, DWORD64 num); + const dump &operator<<(const dump &stream, uint32 num); + const dump &operator<<(const dump &stream, uint64 num); + const dump &operator<<(const dump &stream, double num); enum Status { CantOpen, diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index f27e29dd3b..a07e044257 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -26,6 +26,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "localstorage.h" #include "passcodewidget.h" +#include + namespace { QStringList _initLogs; @@ -38,7 +40,7 @@ namespace { } bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) { - Window *wnd = Application::wnd(); + Window *wnd = AppClass::wnd(); if (!wnd) return false; return wnd->psFilterNativeEvent(message); @@ -213,7 +215,7 @@ void PsMainWindow::psInitSize() { 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) { - QList screens = App::app()->screens(); + QList screens = Application::screens(); for (QList::const_iterator i = screens.cbegin(), e = screens.cend(); i != e; ++i) { QByteArray name = (*i)->name().toUtf8(); if (pos.moncrc == hashCrc32(name.constData(), name.size())) { @@ -266,7 +268,7 @@ void PsMainWindow::psSavePosition(Qt::WindowState state) { int px = curPos.x + curPos.w / 2, py = curPos.y + curPos.h / 2, d = 0; QScreen *chosen = 0; - QList screens = App::app()->screens(); + QList screens = Application::screens(); for (QList::const_iterator i = screens.cbegin(), e = screens.cend(); i != e; ++i) { int dx = (*i)->geometry().x() + (*i)->geometry().width() / 2 - px; if (dx < 0) dx = -dx; int dy = (*i)->geometry().y() + (*i)->geometry().height() / 2 - py; if (dy < 0) dy = -dy; @@ -422,13 +424,13 @@ void PsMainWindow::psMacUpdateMenu() { canSelectAll = !edit->text().isEmpty(); canUndo = edit->isUndoAvailable(); canRedo = edit->isRedoAvailable(); - canPaste = !App::app()->clipboard()->text().isEmpty(); + canPaste = !Application::clipboard()->text().isEmpty(); } else if (FlatTextarea *edit = qobject_cast(focused)) { canCut = canCopy = canDelete = edit->textCursor().hasSelection(); canSelectAll = !edit->getLastText().isEmpty(); canUndo = edit->isUndoAvailable(); canRedo = edit->isRedoAvailable(); - canPaste = !App::app()->clipboard()->text().isEmpty(); + canPaste = !Application::clipboard()->text().isEmpty(); } else if (HistoryInner *list = qobject_cast(focused)) { canCopy = list->canCopySelected(); canDelete = list->canDeleteSelected(); @@ -519,7 +521,115 @@ bool PsMainWindow::eventFilter(QObject *obj, QEvent *evt) { QAbstractNativeEventFilter *psNativeEventFilter() { delete _psEventFilter; _psEventFilter = new _PsEventFilter(); - installNativeEventFilter(_psEventFilter); + return _psEventFilter; +} + +void psWriteDump() { + double v = objc_appkitVersion(); + SignalHandlers::dump() << "OS-Version: " << v; +} + +void psWriteStackTrace(int file) { + void *addresses[1024] = { 0 }; + + size_t size = backtrace(addresses, 1024); + + backtrace_symbols_fd(addresses, size, file); +} + +QString demanglestr(const QString &mangled) { + QByteArray cmd = ("c++filt -n " + mangled).toUtf8(); + FILE *f = popen(cmd.constData(), "r"); + if (!f) return "BAD_SYMBOL_" + mangled; + + QString result; + char buffer[4096] = {0}; + while (!feof(f)) { + if (fgets(buffer, 4096, f) != NULL) { + result += buffer; + } + } + pclose(f); + return result.trimmed(); +} + +QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { + QString initial = QString::fromUtf8(crashdump), result; + QStringList lines = initial.split('\n'); + result.reserve(initial.size()); + int32 i = 0, l = lines.size(); + + 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; + } + } + + for (int32 start = i; i < l; ++i) { + QString line = lines.at(i).trimmed(); + if (line.isEmpty()) break; + + 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; + } + QStringList lst = line.split(' ', QString::SkipEmptyParts); + result.append(lst.at(0)).append(' '); + for (int j = 1, s = lst.size();;) { + if (lst.at(j).startsWith('_')) { + result.append(demanglestr(lst.at(j))); + if (++j < s) { + result.append(' '); + for (;;) { + result.append(lst.at(j)); + if (++j < s) { + result.append(' '); + } else { + break; + } + } + } + break; + } else if (j > 2) { + result.append(lst.at(j)); + } + if (++j < s) { + result.append(' '); + } else { + break; + } + } + result.append('\n'); + } + } + return result; +} + +int psShowCrash(const QString &crashdump) { + QString text; + + QFile dump(crashdump); + if (dump.open(QIODevice::ReadOnly)) { + text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); + text += _showCrashDump(dump.readAll(), crashdump); + } else { + text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); + } + + QByteArray args[] = { "" }; + int a_argc = 1; + char *a_argv[1] = { args[0].data() }; + QApplication app(a_argc, a_argv); + + ShowCrashReportWindow wnd(text); + return app.exec(); } void psDeleteDir(const QString &dir) { @@ -666,8 +776,8 @@ void psExecUpdater() { } } -void psExecTelegram() { - objc_execTelegram(); +void psExecTelegram(const QString &crashreport) { + objc_execTelegram(crashreport); } void psAutoStart(bool start, bool silent) { diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index 19082eedd2..c7b4793e94 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -140,6 +140,10 @@ private: }; +void psWriteDump(); +void psWriteStackTrace(int file); +int psShowCrash(const QString &crashdump); + void psDeleteDir(const QString &dir); void psUserActionDone(); @@ -171,7 +175,7 @@ int psCleanup(); int psFixPrevious(); void psExecUpdater(); -void psExecTelegram(); +void psExecTelegram(const QString &crashreport = QString()); bool psShowOpenWithMenu(int x, int y, const QString &file); diff --git a/Telegram/SourceFiles/pspecific_mac_p.h b/Telegram/SourceFiles/pspecific_mac_p.h index b55366c0ad..9b0d3aaeeb 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.h +++ b/Telegram/SourceFiles/pspecific_mac_p.h @@ -69,7 +69,7 @@ void objc_openFile(const QString &file, bool openwith); void objc_start(); void objc_finish(); bool objc_execUpdater(); -void objc_execTelegram(); +void objc_execTelegram(const QString &crashreport); void objc_registerCustomScheme(); @@ -77,6 +77,8 @@ void objc_activateProgram(WId winId); bool objc_moveFile(const QString &from, const QString &to); void objc_deleteDir(const QString &dir); +double objc_appkitVersion(); + QString objc_appDataPath(); QString objc_downloadPath(); QString objc_currentCountry(); diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index 0de2db7f8e..ca7db5d832 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -211,7 +211,7 @@ public: NSNumber *instObj = [[notification userInfo] objectForKey:@"launch"]; unsigned long long instLong = instObj ? [instObj unsignedLongLongValue] : 0; DEBUG_LOG(("Received notification with instance %1").arg(instLong)); - if (instLong != Global::LaunchId()) { // other app instance notification + if (instLong != Sandbox::LaunchId()) { // other app instance notification return; } if (notification.activationType == NSUserNotificationActivationTypeReplied) { @@ -283,8 +283,8 @@ void PsMacWindowPrivate::showNotify(uint64 peer, int32 msgId, const QPixmap &pix NSUserNotification *notification = [[NSUserNotification alloc] init]; NSImage *img = qt_mac_create_nsimage(pix); - DEBUG_LOG(("Sending notification with userinfo: peer %1, msgId %2 and instance %3").arg(peer).arg(msgId).arg(Global::LaunchId())); - [notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:Global::LaunchId()],@"launch",nil]]; + DEBUG_LOG(("Sending notification with userinfo: peer %1, msgId %2 and instance %3").arg(peer).arg(msgId).arg(Sandbox::LaunchId())); + [notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:Sandbox::LaunchId()],@"launch",nil]]; [notification setTitle:QNSString(title).s()]; [notification setSubtitle:QNSString(subtitle).s()]; @@ -352,7 +352,7 @@ void PsMacWindowPrivate::clearNotifies(unsigned long long peer) { NSArray *notifies = [center deliveredNotifications]; for (id notify in notifies) { NSDictionary *dict = [notify userInfo]; - if ([[dict objectForKey:@"peer"] unsignedLongLongValue] == peer && [[dict objectForKey:@"launch"] unsignedLongLongValue] == Global::LaunchId()) { + if ([[dict objectForKey:@"peer"] unsignedLongLongValue] == peer && [[dict objectForKey:@"launch"] unsignedLongLongValue] == Sandbox::LaunchId()) { [center removeDeliveredNotification:notify]; } } @@ -950,7 +950,7 @@ void objc_registerCustomScheme() { #endif } -BOOL _execUpdater(BOOL update = YES) { +BOOL _execUpdater(BOOL update = YES, const QString &crashreport = QString()) { NSString *path = @"", *args = @""; @try { path = [[NSBundle mainBundle] bundlePath]; @@ -972,6 +972,10 @@ BOOL _execUpdater(BOOL update = YES) { [args addObject:@"-key"]; [args addObject:QNSString(cDataFile()).s()]; } + if (!crashreport.isEmpty()) { + [args addObject:@"-crashreport"]; + [args addObject:QNSString(crashreport).s()]; + } DEBUG_LOG(("Application Info: executing %1 %2").arg(objcString(path)).arg(objcString([args componentsJoinedByString:@" "]))); if (![NSTask launchedTaskWithLaunchPath:path arguments:args]) { @@ -992,8 +996,8 @@ bool objc_execUpdater() { return !!_execUpdater(); } -void objc_execTelegram() { - _execUpdater(NO); +void objc_execTelegram(const QString &crashreport) { + _execUpdater(NO, crashreport); } void objc_activateProgram(WId winId) { @@ -1027,6 +1031,10 @@ void objc_deleteDir(const QString &dir) { [[NSFileManager defaultManager] removeItemAtPath:QNSString(dir).s() error:nil]; } +double objc_appkitVersion() { + return NSAppKitVersionNumber; +} + QString objc_appDataPath() { NSURL *url = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:nil]; if (url) { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 6bfa3bb701..66d2d64735 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -69,7 +69,7 @@ public: } return _index.loadAcquire() - 1; } - static const uint64 Bit() { + static uint64 Bit() { return (1 << Index()); } @@ -86,7 +86,7 @@ public: class InterfacesMetadata { public: - InterfacesMetadata(uint64 mask) : _mask(mask), size(0), last(64) { + InterfacesMetadata(uint64 mask) : size(0), last(64), _mask(mask) { for (int i = 0; i < 64; ++i) { uint64 m = (1 << i); if (_mask & m) { diff --git a/Telegram/SourceFiles/title.cpp b/Telegram/SourceFiles/title.cpp index 86c55de51d..081c05f5ad 100644 --- a/Telegram/SourceFiles/title.cpp +++ b/Telegram/SourceFiles/title.cpp @@ -89,9 +89,10 @@ TitleWidget::TitleWidget(Window *window) : TWidget(window) connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts())); connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout())); connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState))); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - connect(App::app(), SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); - #endif + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + Sandboxer::connect(SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); +#endif if (cPlatform() != dbipWindows) { _minimize.hide(); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index e54c8e2741..e3c2fe3fb2 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2209,7 +2209,7 @@ namespace { zByteArray *ba = (zByteArray*)opaque; uLong toRead = 0; if (!ba->err) { - if (ba->data.size() > ba->pos) { + if (ba->data.size() > int(ba->pos)) { toRead = qMin(size, uLong(ba->data.size() - ba->pos)); memcpy(buf, ba->data.constData() + ba->pos, toRead); ba->pos += toRead; @@ -2223,7 +2223,7 @@ namespace { uLong zByteArrayWriteFile(voidpf opaque, voidpf stream, const void* buf, uLong size) { zByteArray *ba = (zByteArray*)opaque; - if (ba->data.size() < ba->pos + size) { + if (ba->data.size() < int(ba->pos + size)) { ba->data.resize(ba->pos + size); } memcpy(ba->data.data() + ba->pos, buf, size); @@ -2257,7 +2257,7 @@ namespace { case ZLIB_FILEFUNC_SEEK_CUR: ba->pos += offset; break; case ZLIB_FILEFUNC_SEEK_END: ba->pos = ba->data.size() + offset; break; } - if (ba->pos > ba->data.size()) { + if (int(ba->pos) > ba->data.size()) { ba->err = -1; } } @@ -2303,6 +2303,7 @@ void LastCrashedWindow::onCheckingFinished() { reportPart.setBody(Global::LastCrashDump()); multipart->append(reportPart); +#ifdef Q_OS_WIN QFileInfo dmpFile(_minidumpFull); if (dmpFile.exists() && dmpFile.size() > 0 && dmpFile.size() < 20 * 1024 * 1024 && QRegularExpression(qsl("^Telegram\\-[\\d\\.\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { @@ -2354,6 +2355,7 @@ void LastCrashedWindow::onCheckingFinished() { } } } +#endif _sendReply = _sendManager.post(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=report")), multipart); multipart->setParent(_sendReply); From 52c29bac5d67e299b181c34e6a9407a838ae182f Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 30 Jan 2016 21:24:42 +0300 Subject: [PATCH 032/316] started crash reporting for linux --- Telegram/SourceFiles/_other/updater_linux.cpp | 31 +++-- Telegram/SourceFiles/pspecific_linux.cpp | 124 +++++++++++++++++- Telegram/SourceFiles/pspecific_linux.h | 6 +- Telegram/SourceFiles/pspecific_wnd.cpp | 21 +-- Telegram/SourceFiles/pspecific_wnd.h | 2 +- 5 files changed, 154 insertions(+), 30 deletions(-) diff --git a/Telegram/SourceFiles/_other/updater_linux.cpp b/Telegram/SourceFiles/_other/updater_linux.cpp index 35d67072c9..f65ad09448 100644 --- a/Telegram/SourceFiles/_other/updater_linux.cpp +++ b/Telegram/SourceFiles/_other/updater_linux.cpp @@ -324,7 +324,7 @@ bool update() { int main(int argc, char *argv[]) { bool needupdate = true, autostart = false, debug = false, tosettings = false, startintray = false, testmode = false; - char *key = 0; + char *key = 0, *crashreport = 0; for (int i = 1; i < argc; ++i) { if (equal(argv[i], "-noupdate")) { needupdate = false; @@ -342,7 +342,9 @@ int main(int argc, char *argv[]) { key = argv[i]; } else if (equal(argv[i], "-workpath") && ++i < argc) { workDir = argv[i]; - } + } else if (equal(argv[i], "-crashreport") && ++i < argc) { + crashreport = argv[i]; + } } openLog(); @@ -408,17 +410,20 @@ int main(int argc, char *argv[]) { char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_startintray[] = "-startintray", p_testmode[] = "-testmode"; int argIndex = 0; args[argIndex++] = path; - args[argIndex++] = p_noupdate; - if (autostart) args[argIndex++] = p_autostart; - if (debug) args[argIndex++] = p_debug; - if (startintray) args[argIndex++] = p_startintray; - if (testmode) args[argIndex++] = p_testmode; - if (tosettings) args[argIndex++] = p_tosettings; - if (key) { - args[argIndex++] = p_key; - args[argIndex++] = key; - } - + if (crashreport) { + args[argIndex++] = crashreport; + } else { + args[argIndex++] = p_noupdate; + if (autostart) args[argIndex++] = p_autostart; + if (debug) args[argIndex++] = p_debug; + if (startintray) args[argIndex++] = p_startintray; + if (testmode) args[argIndex++] = p_testmode; + if (tosettings) args[argIndex++] = p_tosettings; + if (key) { + args[argIndex++] = p_key; + args[argIndex++] = key; + } + } pid_t pid = fork(); switch (pid) { case -1: writeLog("fork() failed!"); return 1; diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 5696398934..675091fe9b 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -973,6 +973,112 @@ QAbstractNativeEventFilter *psNativeEventFilter() { return _psEventFilter; } +void psWriteDump() { +} + +void psWriteStackTrace(int file) { + void *addresses[1024] = { 0 }; + + size_t size = backtrace(addresses, 1024); + + backtrace_symbols_fd(addresses, size, file); +} + +QString demanglestr(const QString &mangled) { + QByteArray cmd = ("c++filt -n " + mangled).toUtf8(); + FILE *f = popen(cmd.constData(), "r"); + if (!f) return "BAD_SYMBOL_" + mangled; + + QString result; + char buffer[4096] = { 0 }; + while (!feof(f)) { + if (fgets(buffer, 4096, f) != NULL) { + result += buffer; + } + } + pclose(f); + return result.trimmed(); +} + +QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { + QString initial = QString::fromUtf8(crashdump), result; + QStringList lines = initial.split('\n'); + result.reserve(initial.size()); + int32 i = 0, l = lines.size(); + + 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; + } + } + + for (int32 start = i; i < l; ++i) { + QString line = lines.at(i).trimmed(); + if (line.isEmpty()) break; + + 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; + } + QStringList lst = line.split(' ', QString::SkipEmptyParts); + result.append(lst.at(0)).append(' '); + for (int j = 1, s = lst.size();;) { + if (lst.at(j).startsWith('_')) { + result.append(demanglestr(lst.at(j))); + if (++j < s) { + result.append(' '); + for (;;) { + result.append(lst.at(j)); + if (++j < s) { + result.append(' '); + } else { + break; + } + } + } + break; + } else if (j > 2) { + result.append(lst.at(j)); + } + if (++j < s) { + result.append(' '); + } else { + break; + } + } + result.append('\n'); + } + } + return result; +} + +int psShowCrash(const QString &crashdump) { + QString text; + + QFile dump(crashdump); + if (dump.open(QIODevice::ReadOnly)) { + text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); + text += _showCrashDump(dump.readAll(), crashdump); + } else { + text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); + } + + QByteArray args[] = { "" }; + int a_argc = 1; + char *a_argv[1] = { args[0].data() }; + QApplication app(a_argc, a_argv); + + ShowCrashReportWindow wnd(text); + return app.exec(); +} + bool _removeDirectory(const QString &path) { // from http://stackoverflow.com/questions/2256945/removing-a-non-empty-directory-programmatically-in-c-or-c QByteArray pathRaw = QFile::encodeName(path); DIR *d = opendir(pathRaw.constData()); @@ -1243,15 +1349,15 @@ void psNewVersion() { psRegisterCustomScheme(); } -bool _execUpdater(bool update = true) { +bool _execUpdater(bool update = true, const QString &crashreport = QString()) { static const int MaxLen = 65536, MaxArgsCount = 128; char path[MaxLen] = {0}; QByteArray data(QFile::encodeName(cExeDir() + "Updater")); memcpy(path, data.constData(), data.size()); - char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_path[] = "-workpath", p_startintray[] = "-startintray", p_testmode[] = "-testmode"; - char p_datafile[MaxLen] = {0}, p_pathbuf[MaxLen] = {0}; + char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_path[] = "-workpath", p_startintray[] = "-startintray", p_testmode[] = "-testmode", p_crashreport[] = "-crashreport"; + char p_datafile[MaxLen] = {0}, p_pathbuf[MaxLen] = {0}, p_crashreportbuf[MaxLen] = {0}; int argIndex = 0; args[argIndex++] = path; if (!update) { @@ -1276,6 +1382,14 @@ bool _execUpdater(bool update = true) { args[argIndex++] = p_path; args[argIndex++] = p_pathbuf; } + if (!crashreport.isEmpty()) { + QByteArray crashreportf = crashreport.toUtf8(); + if (crashreportf.size() < MaxLen) { + memcpy(p_crashreportbuf, crashreportf.constData(), crashreportf.size()); + args[argIndex++] = p_crashreport; + args[argIndex++] = p_crashreportbuf; + } + } pid_t pid = fork(); switch (pid) { @@ -1291,8 +1405,8 @@ void psExecUpdater() { } } -void psExecTelegram() { - _execUpdater(false); +void psExecTelegram(const QString &crashreport) { + _execUpdater(false, crashreport); } bool psShowOpenWithMenu(int x, int y, const QString &file) { diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index 6fd3356515..6248cc072d 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -113,6 +113,10 @@ private: uint64 _psLastIndicatorUpdate; }; +void psWriteDump(); +void psWriteStackTrace(int file); +int psShowCrash(const QString &crashdump); + void psDeleteDir(const QString &dir); void psUserActionDone(); @@ -144,7 +148,7 @@ int psCleanup(); int psFixPrevious(); void psExecUpdater(); -void psExecTelegram(); +void psExecTelegram(const QString &arg = QString()); bool psShowOpenWithMenu(int x, int y, const QString &file); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 3407fc421e..effea15595 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2267,15 +2267,16 @@ void psExecUpdater() { } } -void psExecTelegram() { - QString targs = qsl("-noupdate"); - 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() + '"'; - +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)); @@ -3059,7 +3060,7 @@ void psWriteStackTrace(int file) { #error "Platform not supported!" #endif - for (frameNum = 0; frameNum < 1000; ++frameNum) { + 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 diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index 053945f3b0..3d46e615f9 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -153,7 +153,7 @@ int psCleanup(); int psFixPrevious(); void psExecUpdater(); -void psExecTelegram(); +void psExecTelegram(const QString &arg = QString()); bool psShowOpenWithMenu(int x, int y, const QString &file); From d28483fad4a197a8b63dfa005882f6ef8e7e4834 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 30 Jan 2016 21:38:33 +0300 Subject: [PATCH 033/316] windows and os x crash reports sent and shown --- Telegram/SourceFiles/boxes/aboutbox.cpp | 26 +++++++++++++++++++++++++ Telegram/SourceFiles/boxes/aboutbox.h | 5 ++++- Telegram/SourceFiles/historywidget.cpp | 22 --------------------- Telegram/SourceFiles/logs.cpp | 8 ++++++-- Telegram/SourceFiles/logs.h | 6 +++--- 5 files changed, 39 insertions(+), 28 deletions(-) diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index 79b8c72492..a9bc2e0adf 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -44,6 +44,8 @@ AboutBox::AboutBox() : AbstractBox(st::aboutWidth) connect(&_done, SIGNAL(clicked()), this, SLOT(onClose())); prepare(); + + setAcceptDrops(true); } void AboutBox::hideAll() { @@ -105,6 +107,30 @@ void AboutBox::paintEvent(QPaintEvent *e) { paintTitle(p, qsl("Telegram Desktop")); } +QString _getCrashReportFile(const QMimeData *m) { + if (!m || m->urls().size() != 1) return QString(); + + QString file(m->urls().at(0).toLocalFile()); + if (file.startsWith(qsl("/.file/id="))) file = psConvertFileUrl(file); + + return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString(); +} + +void AboutBox::dragEnterEvent(QDragEnterEvent *e) { + if (!_getCrashReportFile(e->mimeData()).isEmpty()) { + e->setDropAction(Qt::CopyAction); + e->accept(); + } +} + +void AboutBox::dropEvent(QDropEvent *e) { + if (!_getCrashReportFile(e->mimeData()).isEmpty()) { + e->acceptProposedAction(); + psExecTelegram(_getCrashReportFile(e->mimeData())); + App::quit(); + } +} + QString telegramFaqLink() { QString result = qsl("https://telegram.org/faq"); if (cLang() > languageDefault && cLang() < languageCount) { diff --git a/Telegram/SourceFiles/boxes/aboutbox.h b/Telegram/SourceFiles/boxes/aboutbox.h index 533ab03233..6be8c2ed4c 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.h +++ b/Telegram/SourceFiles/boxes/aboutbox.h @@ -31,7 +31,10 @@ public: void resizeEvent(QResizeEvent *e); void keyPressEvent(QKeyEvent *e); void paintEvent(QPaintEvent *e); - + + void dragEnterEvent(QDragEnterEvent *e); + void dropEvent(QDropEvent *e); + public slots: void onVersion(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 66eb870688..95830b4e86 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4804,22 +4804,7 @@ void HistoryWidget::onDocumentSelect() { } } -QString _getCrashReportFile(const QMimeData *m) { - if (!m || m->urls().size() != 1) return QString(); - - QString file(m->urls().at(0).toLocalFile()); - if (file.startsWith(qsl("/.file/id="))) file = psConvertFileUrl(file); - - return file.endsWith(qstr(".telegramcrash"), Qt::CaseInsensitive) ? file : QString(); -} - void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) { - if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) { - e->setDropAction(Qt::CopyAction); - e->accept(); - return; - } - if (!_history) return; if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; @@ -5141,13 +5126,6 @@ bool HistoryWidget::kbWasHidden() const { } void HistoryWidget::dropEvent(QDropEvent *e) { - if (!_peer && !_getCrashReportFile(e->mimeData()).isEmpty()) { - e->acceptProposedAction(); - psExecTelegram(_getCrashReportFile(e->mimeData())); - App::quit(); - return; - } - _attachDrag = DragStateNone; updateDragAreas(); e->acceptProposedAction(); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 24aa698495..3570e3b254 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -596,11 +596,15 @@ namespace SignalHandlers { return _writeNumber(stream, num); } - const dump &operator<<(const dump &stream, uint32 num) { + const dump &operator<<(const dump &stream, unsigned int num) { return _writeNumber(stream, num); } - const dump &operator<<(const dump &stream, uint64 num) { + const dump &operator<<(const dump &stream, unsigned long num) { + return _writeNumber(stream, num); + } + + const dump &operator<<(const dump &stream, unsigned long long num) { return _writeNumber(stream, num); } diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 422110709e..9deebadb1c 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -93,10 +93,10 @@ namespace SignalHandlers { }; const dump &operator<<(const dump &stream, const char *str); const dump &operator<<(const dump &stream, int num); - const dump &operator<<(const dump &stream, uint32 num); - const dump &operator<<(const dump &stream, uint64 num); + const dump &operator<<(const dump &stream, unsigned int num); + const dump &operator<<(const dump &stream, unsigned long num); + const dump &operator<<(const dump &stream, unsigned long long num); const dump &operator<<(const dump &stream, double num); - enum Status { CantOpen, LastCrashed, From b0681bc582dce03503ace5c1af417844e733418f Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 30 Jan 2016 22:21:18 +0300 Subject: [PATCH 034/316] crash reports done in linux --- Telegram/SourceFiles/pspecific_linux.cpp | 51 +++++++----------------- Telegram/Telegram.pro | 5 ++- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 675091fe9b..195fe98bef 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -516,6 +516,8 @@ namespace { PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(icon256), wndIcon(QIcon::fromTheme("telegram", QIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)))), _psCheckStatusIconLeft(100), _psLastIndicatorUpdate(0) { + _PsInitializer initializer; + connect(&_psCheckStatusIconTimer, SIGNAL(timeout()), this, SLOT(psStatusIconCheck())); _psCheckStatusIconTimer.setSingleShot(false); @@ -683,7 +685,7 @@ void PsMainWindow::psInitSize() { 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) { - QList screens = App::app()->screens(); + QList screens = Application::screens(); for (QList::const_iterator i = screens.cbegin(), e = screens.cend(); i != e; ++i) { QByteArray name = (*i)->name().toUtf8(); if (pos.moncrc == hashCrc32(name.constData(), name.size())) { @@ -736,7 +738,7 @@ void PsMainWindow::psSavePosition(Qt::WindowState state) { int px = curPos.x + curPos.w / 2, py = curPos.y + curPos.h / 2, d = 0; QScreen *chosen = 0; - QList screens = App::app()->screens(); + QList screens = Application::screens(); for (QList::const_iterator i = screens.cbegin(), e = screens.cend(); i != e; ++i) { int dx = (*i)->geometry().x() + (*i)->geometry().width() / 2 - px; if (dx < 0) dx = -dx; int dy = (*i)->geometry().y() + (*i)->geometry().height() / 2 - py; if (dy < 0) dy = -dy; @@ -1020,40 +1022,17 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { QString line = lines.at(i).trimmed(); if (line.isEmpty()) break; - 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; - } - QStringList lst = line.split(' ', QString::SkipEmptyParts); - result.append(lst.at(0)).append(' '); - for (int j = 1, s = lst.size();;) { - if (lst.at(j).startsWith('_')) { - result.append(demanglestr(lst.at(j))); - if (++j < s) { - result.append(' '); - for (;;) { - result.append(lst.at(j)); - if (++j < s) { - result.append(' '); - } else { - break; - } - } - } - break; - } else if (j > 2) { - result.append(lst.at(j)); - } - if (++j < s) { - result.append(' '); - } else { - break; - } - } - result.append('\n'); + result.append(qsl("%1. ").arg(i + 1 - start)); + if (line.startsWith(qstr("ERROR: "))) { + result.append(line).append('\n'); + continue; + } + QRegularExpressionMatch m = QRegularExpression(qsl("^(.+)\\(([^+]+)\\+([^\\)]+)\\)(.+)$")).match(line); + if (!m.hasMatch()) { + result.append(qstr("BAD LINE: ")).append(line).append('\n'); + continue; + } + result.append(demanglestr(m.captured(2))).append(qsl(" + ")).append(m.captured(3)).append(qsl(" (")).append(m.captured(1)).append(qsl(") ")).append(m.captured(4)).append('\n'); } } return result; diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index e99dd40d4c..96ede80718 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -283,7 +283,10 @@ CONFIG(release, debug|release) { QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE += -Ofast -flto -fno-strict-aliasing QMAKE_LFLAGS_RELEASE -= -O1 - QMAKE_LFLAGS_RELEASE += -Ofast -flto + QMAKE_LFLAGS_RELEASE += -Ofast -flto -rdynamic +} +CONFIG(debug, debug|release) { + QMAKE_LFLAGS_DEBUG += -rdynamic } INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\ From 74248b0284e2d4c018e3540fae7e0218f03002c7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 31 Jan 2016 14:32:29 +0300 Subject: [PATCH 035/316] improved os x crash reports, possible linux (and windows) broken --- Telegram/SourceFiles/logs.cpp | 106 ++++++++++++++++-- Telegram/SourceFiles/pspecific_linux.cpp | 8 -- Telegram/SourceFiles/pspecific_linux.h | 1 - Telegram/SourceFiles/pspecific_mac.cpp | 135 +++++++++++++++++++++-- Telegram/SourceFiles/pspecific_mac.h | 1 - Telegram/SourceFiles/pspecific_wnd.cpp | 2 +- Telegram/SourceFiles/pspecific_wnd.h | 2 +- 7 files changed, 224 insertions(+), 31 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 3570e3b254..c660f77b34 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -546,6 +546,21 @@ void _moveOldDataFiles(const QString &wasDir) { } } +#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 +#include +#include +#include + +#ifdef Q_OS_MAC + +#include +#include +#include + +#endif + +#endif + namespace SignalHandlers { QByteArray CrashDumpPath; @@ -629,7 +644,17 @@ namespace SignalHandlers { bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; +// see https://github.com/benbjohnson/bandicoot +#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 + struct sigaction SIG_def[32]; + + void Handler(int signum, siginfo_t *info, void *ucontext) { + sigaction(signum, &SIG_def[signum], 0); + +#else void Handler(int signum) { +#endif + const char* name = 0; switch (signum) { case SIGABRT: name = "SIGABRT"; break; @@ -681,15 +706,69 @@ namespace SignalHandlers { dump() << "Caught signal " << signum << " in thread " << uint64(thread) << "\n"; } +#if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 + ucontext_t *uc = (ucontext_t*)ucontext; + + void *addresses[128] = { 0 }; + void *caller = 0; + +#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) + /* OSX < 10.6 */ +#if defined(__x86_64__) + caller = (void*)uap->uc_mcontext->__ss.__rip; +#elif defined(__i386__) + caller = (void*)uap->uc_mcontext->__ss.__eip; +#else + caller = (void*)uap->uc_mcontext->__ss.__srr0; +#endif +#elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6) + /* OSX >= 10.6 */ +#if defined(_STRUCT_X86_THREAD_STATE64) && !defined(__i386__) + caller = (void*)uc->uc_mcontext->__ss.__rip; +#else + caller = (void*)uap->uc_mcontext->__ss.__eip; +#endif +#elif defined(__linux__) + /* Linux */ +#if defined(__i386__) + caller = (void*)uap->uc_mcontext.gregs[14]; /* Linux 32 */ +#elif defined(__X86_64__) || defined(__x86_64__) + caller = (void*)uap->uc_mcontext.gregs[16]; /* Linux 64 */ +#elif defined(__ia64__) /* Linux IA64 */ + caller = (void*)uap->uc_mcontext.sc_ip; +#endif + +#endif + + size_t size = backtrace(addresses, 128); + + /* overwrite sigaction with caller's address */ + if (caller) addresses[1] = caller; + +#ifdef Q_OS_MAC + dump() << "\nBase image addresses:\n"; + for (size_t i = 0; i < size; ++i) { + Dl_info info; + dump() << i << " "; + if (dladdr(addresses[i], &info)) { + dump() << uint64(info.dli_fbase) << " (" << info.dli_fname << ")\n"; + } else { + dump() << "_unknown_module_\n"; + } + } +#endif + dump() << "\nBacktrace:\n"; - psWriteStackTrace(CrashDumpFileNo); + + backtrace_symbols_fd(addresses, size, CrashDumpFileNo); + +#else + psWriteStackTrace(); +#endif + dump() << "\n"; LoggingCrashThreadId = 0; - -#ifndef Q_OS_WIN - exit(1); -#endif } Status start() { @@ -729,13 +808,24 @@ namespace SignalHandlers { t_assert(launchedBinaryName.size() < int(sizeof(LaunchedBinaryName))); memcpy(LaunchedBinaryName, launchedBinaryName.constData(), launchedBinaryName.size()); +#ifndef Q_OS_WIN + struct sigaction sigact; + + sigact.sa_sigaction = SignalHandlers::Handler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; + + sigaction(SIGABRT, &sigact, &SIG_def[SIGABRT]); + sigaction(SIGSEGV, &sigact, &SIG_def[SIGSEGV]); + sigaction(SIGILL, &sigact, &SIG_def[SIGILL]); + sigaction(SIGFPE, &sigact, &SIG_def[SIGFPE]); + sigaction(SIGBUS, &sigact, &SIG_def[SIGBUS]); + sigaction(SIGSYS, &sigact, &SIG_def[SIGSYS]); +#else signal(SIGABRT, SignalHandlers::Handler); signal(SIGSEGV, SignalHandlers::Handler); signal(SIGILL, SignalHandlers::Handler); signal(SIGFPE, SignalHandlers::Handler); -#ifndef Q_OS_WIN - signal(SIGBUS, SignalHandlers::Handler); - signal(SIGSYS, SignalHandlers::Handler); #endif return Started; } diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 675091fe9b..e70b79d6ee 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -976,14 +976,6 @@ QAbstractNativeEventFilter *psNativeEventFilter() { void psWriteDump() { } -void psWriteStackTrace(int file) { - void *addresses[1024] = { 0 }; - - size_t size = backtrace(addresses, 1024); - - backtrace_symbols_fd(addresses, size, file); -} - QString demanglestr(const QString &mangled) { QByteArray cmd = ("c++filt -n " + mangled).toUtf8(); FILE *f = popen(cmd.constData(), "r"); diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index 6248cc072d..ebc3e12288 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -114,7 +114,6 @@ private: }; void psWriteDump(); -void psWriteStackTrace(int file); int psShowCrash(const QString &crashdump); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index a07e044257..6602167031 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -529,14 +529,6 @@ void psWriteDump() { SignalHandlers::dump() << "OS-Version: " << v; } -void psWriteStackTrace(int file) { - void *addresses[1024] = { 0 }; - - size_t size = backtrace(addresses, 1024); - - backtrace_symbols_fd(addresses, size, file); -} - QString demanglestr(const QString &mangled) { QByteArray cmd = ("c++filt -n " + mangled).toUtf8(); FILE *f = popen(cmd.constData(), "r"); @@ -553,6 +545,69 @@ QString demanglestr(const QString &mangled) { return result.trimmed(); } +QString escapeShell(const QString &str) { + QString result; + const QChar *b = str.constData(), *e = str.constEnd(); + for (const QChar *ch = b; ch != e; ++ch) { + if (*ch == ' ' || *ch == '"' || *ch == '\'' || *ch == '\\') { + if (result.isEmpty()) { + result.reserve(str.size() * 2); + } + if (ch > b) { + result.append(b, ch - b); + } + result.append('\\'); + b = ch; + } + } + if (result.isEmpty()) return str; + + if (e > b) { + result.append(b, e - b); + } + return result; +} + +QStringList atosstr(uint64 *addresses, int count, uint64 base) { + QStringList result; + if (!count) return result; + + result.reserve(count); + QString cmdstr = "atos -o " + escapeShell(cExeDir() + cExeName()) + qsl("/Contents/MacOS/Telegram -l 0x%1").arg(base, 0, 16); + for (int i = 0; i < count; ++i) { + if (addresses[i]) { + cmdstr += qsl(" 0x%1").arg(addresses[i], 0, 16); + } + } + QByteArray cmd = cmdstr.toUtf8(); + FILE *f = popen(cmd.constData(), "r"); + + QStringList atosResult; + if (f) { + char buffer[4096] = {0}; + while (!feof(f)) { + if (fgets(buffer, 4096, f) != NULL) { + atosResult.push_back(QString::fromUtf8(buffer)); + } + } + pclose(f); + } + for (int i = 0, j = 0; i < count; ++i) { + if (addresses[i]) { + if (j < atosResult.size() && !atosResult.at(j).isEmpty() && !atosResult.at(j).startsWith(qstr("0x"))) { + result.push_back(atosResult.at(j).trimmed()); + } else { + result.push_back(QString()); + } + ++j; + } else { + result.push_back(QString()); + } + } + return result; + +} + QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { QString initial = QString::fromUtf8(crashdump), result; QStringList lines = initial.split('\n'); @@ -560,6 +615,38 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { int32 i = 0, l = lines.size(); while (i < l) { + uint64 addresses[1024] = { 0 }; + for (; i < l; ++i) { + result.append(lines.at(i)).append('\n'); + QString line = lines.at(i).trimmed(); + if (line == qstr("Base image addresses:")) { + ++i; + break; + } + } + + uint64 base = 0; + for (int32 start = i; i < l; ++i) { + QString line = lines.at(i).trimmed(); + if (line.isEmpty()) break; + + if (!base) { + QRegularExpressionMatch m = QRegularExpression(qsl("^\\d+ (\\d+) \\((.+)\\)")).match(line); + if (m.hasMatch()) { + if (uint64 address = m.captured(1).toULongLong()) { + if (m.captured(2).endsWith(qstr("Contents/MacOS/Telegram"))) { + base = address; + } + } + } + } + } + if (base) { + result.append(qsl("(base address read: 0x%1)\n").arg(base, 0, 16)); + } else { + result.append(qsl("ERROR: base address not read!\n")); + } + for (; i < l; ++i) { result.append(lines.at(i)).append('\n'); QString line = lines.at(i).trimmed(); @@ -569,7 +656,22 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { } } - for (int32 start = i; i < l; ++i) { + int32 start = i; + for (; i < l; ++i) { + QString line = lines.at(i).trimmed(); + if (line.isEmpty()) break; + + if (QRegularExpression(qsl("^\\d+")).match(line).hasMatch()) { + QStringList lst = line.split(' ', QString::SkipEmptyParts); + if (lst.size() > 2) { + uint64 addr = lst.at(2).startsWith(qstr("0x")) ? lst.at(2).mid(2).toULongLong(0, 16) : lst.at(2).toULongLong(); + addresses[i - start] = addr; + } + } + } + + QStringList atos = atosstr(addresses, i - start, base); + for (i = start; i < l; ++i) { QString line = lines.at(i).trimmed(); if (line.isEmpty()) break; @@ -581,7 +683,18 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { continue; } QStringList lst = line.split(' ', QString::SkipEmptyParts); - result.append(lst.at(0)).append(' '); + result.append('\n').append(lst.at(0)).append(qsl(". ")); + if (lst.size() < 3) { + result.append(qstr("BAD LINE: ")).append(line).append('\n'); + continue; + } + if (i - start < atos.size()) { + if (!atos.at(i - start).isEmpty()) { + result.append(atos.at(i - start)).append('\n'); + continue; + } + } + for (int j = 1, s = lst.size();;) { if (lst.at(j).startsWith('_')) { result.append(demanglestr(lst.at(j))); @@ -606,7 +719,7 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { break; } } - result.append('\n'); + result.append(qsl(" [demangled]")).append('\n'); } } return result; diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index c7b4793e94..a0dc5330d8 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -141,7 +141,6 @@ private: }; void psWriteDump(); -void psWriteStackTrace(int file); int psShowCrash(const QString &crashdump); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index effea15595..aa42c0e91a 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -3008,7 +3008,7 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { return result; } -void psWriteStackTrace(int file) { +void psWriteStackTrace() { if (!LoadDbgHelp()) { SignalHandlers::dump() << "ERROR: Could not load dbghelp.dll!\n"; return; diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index 3d46e615f9..43c79ca32c 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -118,7 +118,7 @@ LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); void psWriteDump(); -void psWriteStackTrace(int file); +void psWriteStackTrace(); int psShowCrash(const QString &crashdump); void psDeleteDir(const QString &dir); From 17a319fdb3120c7891a0f3a85b9e7dabd906a70f Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 31 Jan 2016 19:13:51 +0300 Subject: [PATCH 036/316] improved crash reports for linux --- Telegram/SourceFiles/boxes/aboutbox.cpp | 5 +- Telegram/SourceFiles/logs.cpp | 26 ++++-- Telegram/SourceFiles/pspecific_linux.cpp | 113 ++++++++++++++++++++--- Telegram/SourceFiles/window.cpp | 6 +- Telegram/SourceFiles/window.h | 1 + Telegram/Telegram.pro | 6 +- 6 files changed, 129 insertions(+), 28 deletions(-) diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index a9bc2e0adf..396d515f48 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -126,8 +126,7 @@ void AboutBox::dragEnterEvent(QDragEnterEvent *e) { void AboutBox::dropEvent(QDropEvent *e) { if (!_getCrashReportFile(e->mimeData()).isEmpty()) { e->acceptProposedAction(); - psExecTelegram(_getCrashReportFile(e->mimeData())); - App::quit(); + psShowCrash(_getCrashReportFile(e->mimeData())); } } @@ -142,4 +141,4 @@ QString telegramFaqLink() { } } return result; -} \ No newline at end of file +} diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index c660f77b34..6d117dc61a 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -709,41 +709,47 @@ namespace SignalHandlers { #if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 ucontext_t *uc = (ucontext_t*)ucontext; - void *addresses[128] = { 0 }; void *caller = 0; - #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) /* OSX < 10.6 */ #if defined(__x86_64__) - caller = (void*)uap->uc_mcontext->__ss.__rip; + caller = (void*)uc->uc_mcontext->__ss.__rip; #elif defined(__i386__) - caller = (void*)uap->uc_mcontext->__ss.__eip; + caller = (void*)uc->uc_mcontext->__ss.__eip; #else - caller = (void*)uap->uc_mcontext->__ss.__srr0; + caller = (void*)uc->uc_mcontext->__ss.__srr0; #endif #elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6) /* OSX >= 10.6 */ #if defined(_STRUCT_X86_THREAD_STATE64) && !defined(__i386__) caller = (void*)uc->uc_mcontext->__ss.__rip; #else - caller = (void*)uap->uc_mcontext->__ss.__eip; + caller = (void*)uc->uc_mcontext->__ss.__eip; #endif #elif defined(__linux__) /* Linux */ #if defined(__i386__) - caller = (void*)uap->uc_mcontext.gregs[14]; /* Linux 32 */ + caller = (void*)uc->uc_mcontext.gregs[14]; /* Linux 32 */ #elif defined(__X86_64__) || defined(__x86_64__) - caller = (void*)uap->uc_mcontext.gregs[16]; /* Linux 64 */ + caller = (void*)uc->uc_mcontext.gregs[16]; /* Linux 64 */ #elif defined(__ia64__) /* Linux IA64 */ - caller = (void*)uap->uc_mcontext.sc_ip; + caller = (void*)uc->uc_mcontext.sc_ip; #endif #endif + void *addresses[132] = { 0 }; size_t size = backtrace(addresses, 128); /* overwrite sigaction with caller's address */ - if (caller) addresses[1] = caller; + if (caller) { + for (int i = size; i > 1; --i) { + addresses[i + 3] = addresses[i]; + } + addresses[2] = (void*)0x1; + addresses[3] = caller; + addresses[4] = (void*)0x1; + } #ifdef Q_OS_MAC dump() << "\nBase image addresses:\n"; diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 5134efeaf5..54b0227bf1 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -979,6 +979,8 @@ void psWriteDump() { } QString demanglestr(const QString &mangled) { + if (mangled.isEmpty()) return mangled; + QByteArray cmd = ("c++filt -n " + mangled).toUtf8(); FILE *f = popen(cmd.constData(), "r"); if (!f) return "BAD_SYMBOL_" + mangled; @@ -994,6 +996,51 @@ QString demanglestr(const QString &mangled) { return result.trimmed(); } +QStringList addr2linestr(uint64 *addresses, int count) { + QStringList result; + if (!count) return result; + + result.reserve(count); + QString cmdstr = "addr2line -e " + escapeShell(cExeDir() + cExeName()); + for (int i = 0; i < count; ++i) { + if (addresses[i]) { + cmdstr += qsl(" 0x%1").arg(addresses[i], 0, 16); + } + } + QByteArray cmd = cmdstr.toUtf8(); + FILE *f = popen(cmd.constData(), "r"); + + QStringList addr2lineResult; + if (f) { + char buffer[4096] = {0}; + while (!feof(f)) { + if (fgets(buffer, 4096, f) != NULL) { + addr2lineResult.push_back(QString::fromUtf8(buffer)); + } + } + pclose(f); + } + for (int i = 0, j = 0; i < count; ++i) { + if (addresses[i]) { + if (j < addr2lineResult.size() && !addr2lineResult.at(j).isEmpty() && !addr2lineResult.at(j).startsWith(qstr("0x"))) { + QString res = addr2lineResult.at(j).trimmed(); + if (int index = res.indexOf(qstr("/Telegram/"))) { + if (index > 0) { + res = res.mid(index + qstr("/Telegram/").size()); + } + } + result.push_back(res); + } else { + result.push_back(QString()); + } + ++j; + } else { + result.push_back(QString()); + } + } + return result; +} + QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { QString initial = QString::fromUtf8(crashdump), result; QStringList lines = initial.split('\n'); @@ -1001,6 +1048,7 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { int32 i = 0, l = lines.size(); while (i < l) { + uint64 addresses[1024] = { 0 }; for (; i < l; ++i) { result.append(lines.at(i)).append('\n'); QString line = lines.at(i).trimmed(); @@ -1010,21 +1058,59 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { } } - for (int32 start = i; i < l; ++i) { + int32 start = i; + for (; i < l; ++i) { + QString line = lines.at(i).trimmed(); + if (line.isEmpty()) break; + + QRegularExpressionMatch m1 = QRegularExpression(qsl("^(.+)\\(([^+]+)\\+([^\\)]+)\\)\\[(.+)\\]$")).match(line); + QRegularExpressionMatch m2 = QRegularExpression(qsl("^(.+)\\[(.+)\\]$")).match(line); + QString addrstr = m1.hasMatch() ? m1.captured(4) : (m2.hasMatch() ? m2.captured(2) : QString()); + if (!addrstr.isEmpty()) { + uint64 addr = addrstr.startsWith(qstr("0x")) ? addrstr.mid(2).toULongLong(0, 16) : addrstr.toULongLong(); + if (addr > 1) { + addresses[i - start] = addr; + } + } + } + + QStringList addr2line = addr2linestr(addresses, i - start); + for (i = start; i < l; ++i) { QString line = lines.at(i).trimmed(); if (line.isEmpty()) break; - result.append(qsl("%1. ").arg(i + 1 - start)); + result.append(qsl("\n%1. ").arg(i - start)); if (line.startsWith(qstr("ERROR: "))) { result.append(line).append('\n'); continue; } - QRegularExpressionMatch m = QRegularExpression(qsl("^(.+)\\(([^+]+)\\+([^\\)]+)\\)(.+)$")).match(line); - if (!m.hasMatch()) { + if (line == qstr("[0x1]")) { + result.append(qsl("(0x1 separator)\n")); + continue; + } + + QRegularExpressionMatch m1 = QRegularExpression(qsl("^(.+)\\(([^+]*)\\+([^\\)]+)\\)(.+)$")).match(line); + QRegularExpressionMatch m2 = QRegularExpression(qsl("^(.+)\\[(.+)\\]$")).match(line); + if (!m1.hasMatch() && !m2.hasMatch()) { result.append(qstr("BAD LINE: ")).append(line).append('\n'); continue; } - result.append(demanglestr(m.captured(2))).append(qsl(" + ")).append(m.captured(3)).append(qsl(" (")).append(m.captured(1)).append(qsl(") ")).append(m.captured(4)).append('\n'); + + if (m1.hasMatch()) { + result.append(demanglestr(m1.captured(2))).append(qsl(" + ")).append(m1.captured(3)).append(qsl(" [")).append(m1.captured(1)).append(qsl("] ")); + if (!addr2line.at(i - start).isEmpty() && addr2line.at(i - start) != qsl("??:0")) { + result.append(qsl(" (")).append(addr2line.at(i - start)).append(qsl(")\n")); + } else { + result.append(m1.captured(4)).append(qsl(" (demangled)")).append('\n'); + } + } else { + result.append('[').append(m2.captured(1)).append(']'); + if (!addr2line.at(i - start).isEmpty() && addr2line.at(i - start) != qsl("??:0")) { + result.append(qsl(" (")).append(addr2line.at(i - start)).append(qsl(")\n")); + } else { + result.append(' ').append(m2.captured(2)).append('\n'); + } + } } } return result; @@ -1041,13 +1127,18 @@ int psShowCrash(const QString &crashdump) { text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); } - QByteArray args[] = { "" }; - int a_argc = 1; - char *a_argv[1] = { args[0].data() }; - QApplication app(a_argc, a_argv); + if (Sandbox::started()) { + ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); + return 0; + } - ShowCrashReportWindow wnd(text); - return app.exec(); + QByteArray args[] = { "" }; + int a_argc = 1; + char *a_argv[1] = { args[0].data() }; + QApplication app(a_argc, a_argv); + + ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); + return app.exec(); } bool _removeDirectory(const QString &path) { // from http://stackoverflow.com/questions/2256945/removing-a-non-empty-directory-programmatically-in-c-or-c diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index e3c2fe3fb2..18950d8685 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2113,7 +2113,7 @@ void LastCrashedWindow::onViewReport() { } void LastCrashedWindow::onSaveReport() { - QString to = QFileDialog::getSaveFileName(0, qsl("Telegram Crash Report"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + qsl("/report"), qsl("Telegram crash report (*.telegramcrash)")); + QString to = QFileDialog::getSaveFileName(0, qsl("Telegram Crash Report"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + qsl("/report.telegramcrash"), qsl("Telegram crash report (*.telegramcrash)")); if (!to.isEmpty()) { QFile file(to); if (file.open(QIODevice::WriteOnly)) { @@ -2874,3 +2874,7 @@ ShowCrashReportWindow::ShowCrashReportWindow(const QString &text) void ShowCrashReportWindow::resizeEvent(QResizeEvent *e) { _log.setGeometry(rect().marginsRemoved(QMargins(basicSize(), basicSize(), basicSize(), basicSize()))); } + +void ShowCrashReportWindow::closeEvent(QCloseEvent *e) { + deleteLater(); +} diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index f7c968ce84..fe3d2da2c6 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -547,6 +547,7 @@ public: protected: void resizeEvent(QResizeEvent *e); + void closeEvent(QCloseEvent *e); private: diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 96ede80718..64d4739b0b 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -281,12 +281,12 @@ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-result -Wno-unused-parameter -Wno-unused-v CONFIG(release, debug|release) { QMAKE_CXXFLAGS_RELEASE -= -O2 - QMAKE_CXXFLAGS_RELEASE += -Ofast -flto -fno-strict-aliasing + QMAKE_CXXFLAGS_RELEASE += -Ofast -flto -fno-strict-aliasing -g QMAKE_LFLAGS_RELEASE -= -O1 - QMAKE_LFLAGS_RELEASE += -Ofast -flto -rdynamic + QMAKE_LFLAGS_RELEASE += -Ofast -flto -rdynamic -g } CONFIG(debug, debug|release) { - QMAKE_LFLAGS_DEBUG += -rdynamic + QMAKE_LFLAGS_DEBUG += -rdynamic -g } INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\ From fb4ee55ffa02d731cc7bf78f2745ac2e5d131754 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 31 Jan 2016 21:01:01 +0300 Subject: [PATCH 037/316] removed unused headers in mac --- Telegram/SourceFiles/logs.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index c660f77b34..1d850194d4 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -547,6 +547,7 @@ void _moveOldDataFiles(const QString &wasDir) { } #if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 + #include #include #include @@ -554,8 +555,6 @@ void _moveOldDataFiles(const QString &wasDir) { #ifdef Q_OS_MAC #include -#include -#include #endif From a0d171bb492bfaad4381708e498304de3139fb9d Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 31 Jan 2016 21:01:43 +0300 Subject: [PATCH 038/316] moved minizip to ThirdParty, added google breakpad to ThirdParty for windows (mac, linux broken) --- Telegram/SourceFiles/boxes/aboutbox.cpp | 2 +- Telegram/SourceFiles/logs.cpp | 77 + Telegram/SourceFiles/main.cpp | 7 +- Telegram/SourceFiles/pspecific_linux.cpp | 27 +- Telegram/SourceFiles/pspecific_linux.h | 2 +- Telegram/SourceFiles/pspecific_mac.cpp | 22 +- Telegram/SourceFiles/pspecific_mac.h | 2 +- Telegram/SourceFiles/pspecific_wnd.cpp | 132 +- Telegram/SourceFiles/pspecific_wnd.h | 6 +- Telegram/SourceFiles/window.cpp | 54 +- Telegram/SourceFiles/window.h | 2 + Telegram/Telegram.vcxproj | 168 +- Telegram/Telegram.vcxproj.filters | 124 +- .../client/linux/handler/exception_handler.cc | 765 ++++++ .../client/linux/handler/exception_handler.h | 278 ++ .../client/mac/handler/exception_handler.cc | 855 +++++++ .../client/mac/handler/exception_handler.h | 281 ++ .../client/windows/common/ipc_protocol.h | 181 ++ .../crash_generation_client.cc | 405 +++ .../crash_generation_client.h | 182 ++ .../windows/handler/exception_handler.cc | 1073 ++++++++ .../windows/handler/exception_handler.h | 522 ++++ .../ThirdParty/breakpad/common/scoped_ptr.h | 404 +++ .../breakpad/common/windows/guid_string.cc | 76 + .../breakpad/common/windows/guid_string.h | 58 + .../common/windows/string_utils-inl.h | 142 ++ .../google_breakpad/common/breakpad_types.h | 68 + .../common/minidump_cpu_amd64.h | 235 ++ .../google_breakpad/common/minidump_cpu_arm.h | 151 ++ .../common/minidump_cpu_arm64.h | 140 + .../common/minidump_cpu_mips.h | 160 ++ .../google_breakpad/common/minidump_cpu_ppc.h | 168 ++ .../common/minidump_cpu_ppc64.h | 134 + .../common/minidump_cpu_sparc.h | 163 ++ .../google_breakpad/common/minidump_cpu_x86.h | 174 ++ .../common/minidump_exception_linux.h | 87 + .../common/minidump_exception_mac.h | 205 ++ .../common/minidump_exception_ps3.h | 67 + .../common/minidump_exception_solaris.h | 94 + .../common/minidump_exception_win32.h | 2261 +++++++++++++++++ .../google_breakpad/common/minidump_format.h | 972 +++++++ .../_other => ThirdParty/minizip}/crypt.h | 0 .../_other => ThirdParty/minizip}/ioapi.h | 0 .../_other => ThirdParty/minizip}/zip.c | 0 .../_other => ThirdParty/minizip}/zip.h | 0 45 files changed, 10654 insertions(+), 272 deletions(-) create mode 100644 Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc create mode 100644 Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h create mode 100644 Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h create mode 100644 Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc create mode 100644 Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h create mode 100644 Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc create mode 100644 Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h create mode 100644 Telegram/ThirdParty/breakpad/common/scoped_ptr.h create mode 100644 Telegram/ThirdParty/breakpad/common/windows/guid_string.cc create mode 100644 Telegram/ThirdParty/breakpad/common/windows/guid_string.h create mode 100644 Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h rename Telegram/{SourceFiles/_other => ThirdParty/minizip}/crypt.h (100%) rename Telegram/{SourceFiles/_other => ThirdParty/minizip}/ioapi.h (100%) rename Telegram/{SourceFiles/_other => ThirdParty/minizip}/zip.c (100%) rename Telegram/{SourceFiles/_other => ThirdParty/minizip}/zip.h (100%) diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index 396d515f48..e593541d93 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -126,7 +126,7 @@ void AboutBox::dragEnterEvent(QDragEnterEvent *e) { void AboutBox::dropEvent(QDropEvent *e) { if (!_getCrashReportFile(e->mimeData()).isEmpty()) { e->acceptProposedAction(); - psShowCrash(_getCrashReportFile(e->mimeData())); + showCrashReportWindow(_getCrashReportFile(e->mimeData())); } } diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 6d117dc61a..d4bf9ea751 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -22,6 +22,15 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #include "pspecific.h" +// see https://blog.inventic.eu/2012/08/qt-and-google-breakpad/ +#ifdef Q_OS_WIN +#include "client/windows/handler/exception_handler.h" +#elif defined Q_OS_MAC +#include "client/mac/handler/exception_handler.h" +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 +#include "client/linux/handler/exception_handler.h" +#endif + enum LogDataType { LogDataMain, LogDataDebug, @@ -257,6 +266,11 @@ void _logsWrite(LogDataType type, const QString &msg) { void _moveOldDataFiles(const QString &from); +namespace SignalHandlers { + void StartBreakpad(); + void FinishBreakpad(); +} + namespace Logs { Initializer::Initializer() { @@ -304,6 +318,7 @@ namespace Logs { QDir().mkpath(cWorkingDir() + qstr("tdata")); Global::WorkingDirReady(); + SignalHandlers::StartBreakpad(); if (!LogsData->openMain()) { delete LogsData; @@ -354,6 +369,8 @@ namespace Logs { LogsInMemory = DeletedLogsInMemory; _logsMutex(LogDataMain, true); + + SignalHandlers::FinishBreakpad(); } bool started() { @@ -640,6 +657,60 @@ namespace SignalHandlers { return stream; } + google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0; + +#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 + bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success) +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 + bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) +#endif + { + return success; + } + + void StartBreakpad() { + QString dumpPath = cWorkingDir() + qsl("tdumps"); + QDir().mkpath(dumpPath); + +#ifdef Q_OS_WIN + BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( + dumpPath.toStdWString(), + /*FilterCallback*/ 0, + DumpCallback, + /*context*/ 0, + true + ); +#elif defined Q_OS_MAC + pHandler = new google_breakpad::ExceptionHandler( + dumpPath.toStdString(), + /*FilterCallback*/ 0, + DumpCallback, + /*context*/ 0, + true, + 0 + ); +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 + pHandler = new google_breakpad::ExceptionHandler( + google_breakpad::MinidumpDescriptor(dumpPath.toStdString()), + /*FilterCallback*/ 0, + DumpCallback, + /*context*/ 0, + true, + -1 + ); +#endif + } + + void FinishBreakpad() { + if (BreakpadExceptionHandler) { + google_breakpad::ExceptionHandler *h = BreakpadExceptionHandler; + BreakpadExceptionHandler = 0; + delete h; + } + } + Qt::HANDLE LoggingCrashThreadId = 0; bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; @@ -769,6 +840,8 @@ namespace SignalHandlers { backtrace_symbols_fd(addresses, size, CrashDumpFileNo); #else + dump() << "\nBacktrace:\n"; + psWriteStackTrace(); #endif @@ -842,6 +915,10 @@ namespace SignalHandlers { } void finish() { + if (BreakpadExceptionHandler) { + delete BreakpadExceptionHandler; + BreakpadExceptionHandler = 0; + } if (CrashDumpFile) { fclose(CrashDumpFile); unlink(CrashDumpPath.constData()); diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index b70d2faff7..fc5d802991 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -27,18 +27,13 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org int main(int argc, char *argv[]) { int result = 0; -#ifdef Q_OS_WIN - _oldWndExceptionFilter = SetUnhandledExceptionFilter(_exceptionFilter); -// CAPIHook apiHook("kernel32.dll", "SetUnhandledExceptionFilter", (PROC)RedirectedSetUnhandledExceptionFilter); -#endif - settingsParseArgs(argc, argv); if (cLaunchMode() == LaunchModeFixPrevious) { return psFixPrevious(); } else if (cLaunchMode() == LaunchModeCleanup) { return psCleanup(); } else if (cLaunchMode() == LaunchModeShowCrash) { - return psShowCrash(QFileInfo(cStartUrl()).absoluteFilePath()); + return showCrashReportWindow(QFileInfo(cStartUrl()).absoluteFilePath()); } Logs::Initializer _logs; diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 54b0227bf1..47429e862e 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -1041,7 +1041,7 @@ QStringList addr2linestr(uint64 *addresses, int count) { return result; } -QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile) { QString initial = QString::fromUtf8(crashdump), result; QStringList lines = initial.split('\n'); result.reserve(initial.size()); @@ -1116,31 +1116,6 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { return result; } -int psShowCrash(const QString &crashdump) { - QString text; - - QFile dump(crashdump); - if (dump.open(QIODevice::ReadOnly)) { - text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); - text += _showCrashDump(dump.readAll(), crashdump); - } else { - text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); - } - - if (Sandbox::started()) { - ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); - return 0; - } - - QByteArray args[] = { "" }; - int a_argc = 1; - char *a_argv[1] = { args[0].data() }; - QApplication app(a_argc, a_argv); - - ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); - return app.exec(); -} - bool _removeDirectory(const QString &path) { // from http://stackoverflow.com/questions/2256945/removing-a-non-empty-directory-programmatically-in-c-or-c QByteArray pathRaw = QFile::encodeName(path); DIR *d = opendir(pathRaw.constData()); diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index ebc3e12288..b4380165b5 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -114,7 +114,7 @@ private: }; void psWriteDump(); -int psShowCrash(const QString &crashdump); +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 6602167031..e86334561f 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -608,7 +608,7 @@ QStringList atosstr(uint64 *addresses, int count, uint64 base) { } -QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile) { QString initial = QString::fromUtf8(crashdump), result; QStringList lines = initial.split('\n'); result.reserve(initial.size()); @@ -725,26 +725,6 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { return result; } -int psShowCrash(const QString &crashdump) { - QString text; - - QFile dump(crashdump); - if (dump.open(QIODevice::ReadOnly)) { - text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); - text += _showCrashDump(dump.readAll(), crashdump); - } else { - text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); - } - - QByteArray args[] = { "" }; - int a_argc = 1; - char *a_argv[1] = { args[0].data() }; - QApplication app(a_argc, a_argv); - - ShowCrashReportWindow wnd(text); - return app.exec(); -} - void psDeleteDir(const QString &dir) { objc_deleteDir(dir); } diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index a0dc5330d8..154fee8f68 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -141,7 +141,7 @@ private: }; void psWriteDump(); -int psShowCrash(const QString &crashdump); +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index aa42c0e91a..d871085c59 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2356,19 +2356,6 @@ 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"; -LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter = 0; - -typedef BOOL (FAR STDAPICALLTYPE *t_miniDumpWriteDump)( - _In_ HANDLE hProcess, - _In_ DWORD ProcessId, - _In_ HANDLE hFile, - _In_ MINIDUMP_TYPE DumpType, - _In_opt_ PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, - _In_opt_ PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, - _In_opt_ PMINIDUMP_CALLBACK_INFORMATION CallbackParam -); -t_miniDumpWriteDump miniDumpWriteDump = 0; - // Stack walk code is inspired by http://www.codeproject.com/Articles/11132/Walking-the-callstack static const int StackEntryMaxNameLength = MAX_SYM_NAME + 1; @@ -2555,7 +2542,7 @@ typedef BOOL (FAR STDAPICALLTYPE *t_Module32Next)(HANDLE hSnapshot, LPMODULEENTR t_Module32Next module32Next = 0; bool LoadDbgHelp(bool extended = false) { - if (miniDumpWriteDump && (!extended || symInitialize)) return true; + if (stackWalk64 && (!extended || symInitialize)) return true; HMODULE hDll = 0; @@ -2586,17 +2573,14 @@ bool LoadDbgHelp(bool extended = false) { if (!hDll) return false; - miniDumpWriteDump = (t_miniDumpWriteDump)GetProcAddress(hDll, "MiniDumpWriteDump"); - stackWalk64 = (t_StackWalk64)GetProcAddress(hDll, "StackWalk64"); symFunctionTableAccess64 = (t_SymFunctionTableAccess64)GetProcAddress(hDll, "SymFunctionTableAccess64"); symGetModuleBase64 = (t_SymGetModuleBase64)GetProcAddress(hDll, "SymGetModuleBase64"); - if (!miniDumpWriteDump || - !stackWalk64 || + if (!stackWalk64 || !symFunctionTableAccess64 || !symGetModuleBase64) { - miniDumpWriteDump = 0; + stackWalk64 = 0; return false; } @@ -2686,17 +2670,6 @@ bool LoadDbgHelp(bool extended = false) { symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS; symOptions = symSetOptions(symOptions); - //WCHAR buf[StackEntryMaxNameLength] = { 0 }; - //if (symGetSearchPath) { - // if (symGetSearchPath(hProcess, buf, StackEntryMaxNameLength) == FALSE) { - // return false; - // } - //} - - //WCHAR szUserName[1024] = { 0 }; - //DWORD dwSize = 1024; - //GetUserName(szUserName, &dwSize); - const WCHAR *dllname[] = { L"kernel32.dll", L"tlhelp32.dll" }; HINSTANCE hToolhelp = NULL; @@ -2744,57 +2717,6 @@ bool LoadDbgHelp(bool extended = false) { return true; } -void _generateDump(EXCEPTION_POINTERS* pExceptionPointers) { - static const int maxFileLen = MAX_PATH * 10; - - if (!LoadDbgHelp()) return; - - HANDLE hDumpFile = 0; - - WCHAR szPath[maxFileLen]; - DWORD len = GetModuleFileName(GetModuleHandle(0), szPath, maxFileLen); - if (!len) return; - - WCHAR *pathEnd = szPath + len; - - if (!_wcsicmp(pathEnd - wcslen(_exeName), _exeName)) { - wsprintf(pathEnd - wcslen(_exeName), L""); - hDumpFile = _generateDumpFileAtPath(szPath); - } - if (!hDumpFile || hDumpFile == INVALID_HANDLE_VALUE) { - WCHAR wstrPath[maxFileLen]; - DWORD wstrPathLen; - if (wstrPathLen = GetEnvironmentVariable(L"APPDATA", wstrPath, maxFileLen)) { - wsprintf(wstrPath + wstrPathLen, L"\\%s\\", _programName); - hDumpFile = _generateDumpFileAtPath(wstrPath); - } - } - - if (!hDumpFile || hDumpFile == INVALID_HANDLE_VALUE) { - return; - } - - MINIDUMP_EXCEPTION_INFORMATION ExpParam = {0}; - ExpParam.ThreadId = GetCurrentThreadId(); - ExpParam.ExceptionPointers = pExceptionPointers; - ExpParam.ClientPointers = TRUE; - - miniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpWithDataSegs, &ExpParam, NULL, NULL); -} - -LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) { - _generateDump(pExceptionPointers); - return _oldWndExceptionFilter ? (*_oldWndExceptionFilter)(pExceptionPointers) : EXCEPTION_CONTINUE_SEARCH; -} - -// see http://www.codeproject.com/Articles/154686/SetUnhandledExceptionFilter-and-the-C-C-Runtime-Li -LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) { - // When the CRT calls SetUnhandledExceptionFilter with NULL parameter - // our handler will not get removed. - _oldWndExceptionFilter = lpTopLevelExceptionFilter; - return 0; -} - struct StackEntry { DWORD64 offset; // if 0, we have no valid entry CHAR name[StackEntryMaxNameLength]; @@ -2841,7 +2763,11 @@ void psWriteDump() { } char ImageHlpSymbol64[sizeof(IMAGEHLP_SYMBOL64) + StackEntryMaxNameLength]; -QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { +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; @@ -2889,17 +2815,7 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { } } if (!tolaunch.isEmpty()) { - if (QFile(tolaunch).exists()) { - QString targs = qsl("-crash \"%1\"").arg(dumpfile.replace('"', qsl("\"\""))); - HINSTANCE r = ShellExecute(0, 0, QDir::toNativeSeparators(tolaunch).toStdWString().c_str(), targs.toStdWString().c_str(), 0, SW_SHOWNORMAL); - if (long(r) < 32) { - result.append(qsl("ERROR: executable '%1' with args '%2' for this crashdump could not be launched! Result: %3").arg(tolaunch).arg(targs).arg(long(r))); - } else { - return QString(); - } - } else { - result.append(qsl("ERROR: executable '%1' for this crashdump was not found!").arg(tolaunch)); - } + result.append(qsl("ERROR: for this crashdump executable '%1' should be used!").arg(tolaunch)); } while (i < l) { @@ -3005,6 +2921,8 @@ QString _showCrashDump(const QByteArray &crashdump, QString dumpfile) { } } } + + symCleanup(hProcess); return result; } @@ -3086,34 +3004,6 @@ void psWriteStackTrace() { } } -int psShowCrash(const QString &crashdump) { - QString text; - - QFile dump(crashdump); - if (dump.open(QIODevice::ReadOnly)) { - text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); - if (!LoadDbgHelp(true)) { - text += qsl("ERROR: could not init dbghelp.dll!"); - } else { - text += _showCrashDump(dump.readAll(), crashdump); - symCleanup(GetCurrentProcess()); - } - } else { - text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); - } - - WCHAR szTemp[MAX_PATH + 1] = { 0 }; - GetModuleFileName(NULL, szTemp, MAX_PATH); - - QByteArray args[] = { QString::fromWCharArray(szTemp).toUtf8() }; - int a_argc = 1; - char *a_argv[1] = { args[0].data() }; - QApplication app(a_argc, a_argv); - - ShowCrashReportWindow wnd(text); - return app.exec(); -} - class StringReferenceWrapper { public: diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index 43c79ca32c..2f6d14af03 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -113,13 +113,9 @@ private: void psDestroyIcons(); }; -extern LPTOP_LEVEL_EXCEPTION_FILTER _oldWndExceptionFilter; -LONG CALLBACK _exceptionFilter(EXCEPTION_POINTERS* pExceptionPointers); -LPTOP_LEVEL_EXCEPTION_FILTER WINAPI RedirectedSetUnhandledExceptionFilter(_In_opt_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter); - void psWriteDump(); void psWriteStackTrace(); -int psShowCrash(const QString &crashdump); +QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile); void psDeleteDir(const QString &dir); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 18950d8685..77158620e4 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -41,7 +41,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "mediaview.h" #include "localstorage.h" -#include "_other/zip.h" +#include "zip.h" ConnectingWidget::ConnectingWidget(QWidget *parent, const QString &text, const QString &reconnect) : QWidget(parent), _shadow(st::boxShadow), _reconnect(this, QString()) { set(text, reconnect); @@ -63,6 +63,7 @@ void ConnectingWidget::set(const QString &text, const QString &reconnect) { resize(st::connectingPadding.left() + _textWidth + _reconnectWidth + st::connectingPadding.right() + st::boxShadow.pxWidth(), st::boxShadow.pxHeight() + st::connectingPadding.top() + st::linkFont->height + st::connectingPadding.bottom()); update(); } + void ConnectingWidget::paintEvent(QPaintEvent *e) { QPainter p(this); @@ -2021,22 +2022,24 @@ LastCrashedWindow::LastCrashedWindow() #ifdef Q_OS_WIN if (_sendingState != SendingNoReport) { QString maxDump, maxDumpFull; - QDateTime maxDumpModified; + QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); qint64 maxDumpSize = 0; QFileInfoList list = QDir(cWorkingDir() + qsl("tdumps")).entryInfoList(); for (int32 i = 0, l = list.size(); i < l; ++i) { - if (maxDump.isEmpty() || maxDumpModified < list.at(i).lastModified()) { - maxDump = list.at(i).fileName(); - maxDumpFull = list.at(i).absoluteFilePath(); - maxDumpModified = list.at(i).lastModified(); - maxDumpSize = list.at(i).size(); + QString name = list.at(i).fileName(); + if (name.endsWith(qstr(".dmp"))) { + QDateTime modified = list.at(i).lastModified(); + if (maxDump.isEmpty() || qAbs(workingModified.secsTo(modified)) < qAbs(workingModified.secsTo(maxDumpModified))) { + maxDump = name; + maxDumpModified = modified; + maxDumpFull = list.at(i).absoluteFilePath(); + maxDumpSize = list.at(i).size(); + } } } - if (!maxDump.isEmpty()) { - if (qAbs(QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified().secsTo(maxDumpModified)) < 10) { - _minidumpName = maxDump; - _minidumpFull = maxDumpFull; - } + if (!maxDump.isEmpty() && qAbs(workingModified.secsTo(maxDumpModified)) < 10) { + _minidumpName = maxDump; + _minidumpFull = maxDumpFull; } _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(maxDumpSize / 1024)); @@ -2306,7 +2309,7 @@ void LastCrashedWindow::onCheckingFinished() { #ifdef Q_OS_WIN QFileInfo dmpFile(_minidumpFull); if (dmpFile.exists() && dmpFile.size() > 0 && dmpFile.size() < 20 * 1024 * 1024 && - QRegularExpression(qsl("^Telegram\\-[\\d\\.\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { + QRegularExpression(qsl("^[a-z0-9\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { QFile file(_minidumpFull); if (file.open(QIODevice::ReadOnly)) { QByteArray minidump = file.readAll(); @@ -2878,3 +2881,28 @@ void ShowCrashReportWindow::resizeEvent(QResizeEvent *e) { void ShowCrashReportWindow::closeEvent(QCloseEvent *e) { deleteLater(); } + +int showCrashReportWindow(const QString &crashdump) { + QString text; + + QFile dump(crashdump); + if (dump.open(QIODevice::ReadOnly)) { + text = qsl("Crash dump file '%1':\n\n").arg(QFileInfo(crashdump).absoluteFilePath()); + text += psPrepareCrashDump(dump.readAll(), crashdump); + } else { + text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); + } + + if (Sandbox::started()) { + ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); + return 0; + } + + QByteArray args[] = { QDir::toNativeSeparators(cExeDir() + cExeName()).toUtf8() }; + int a_argc = 1; + char *a_argv[1] = { args[0].data() }; + QApplication app(a_argc, a_argv); + + ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); + return app.exec(); +} diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index fe3d2da2c6..ef715b2375 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -554,3 +554,5 @@ private: PreLaunchLog _log; }; + +int showCrashReportWindow(const QString &crashdump); diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 44ffbe14dd..21af719fa8 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -69,7 +69,7 @@ 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;.\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) + .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl_debug\Debug\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\ThirdParty\breakpad;.\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 Use @@ -1053,14 +1053,44 @@ - + + NotUsing + + + NotUsing + + + NotUsing + + NotUsing - - - + + + + + + + + + + + + + + + + + + + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... @@ -1069,7 +1099,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1078,7 +1108,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1110,7 +1140,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1133,7 +1163,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1143,7 +1173,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1157,7 +1187,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1171,7 +1201,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1185,7 +1215,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1199,7 +1229,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1213,7 +1243,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1227,7 +1257,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1241,7 +1271,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1255,7 +1285,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1274,7 +1304,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1288,7 +1318,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1302,7 +1332,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1316,7 +1346,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1330,7 +1360,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1344,7 +1374,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1358,7 +1388,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1372,7 +1402,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1386,7 +1416,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1400,7 +1430,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1410,7 +1440,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1424,7 +1454,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1438,7 +1468,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1452,7 +1482,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1466,7 +1496,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1481,7 +1511,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1495,7 +1525,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1509,7 +1539,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1523,7 +1553,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1537,7 +1567,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1558,7 +1588,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1568,7 +1598,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1603,7 +1633,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1617,7 +1647,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1636,7 +1666,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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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" @@ -1647,7 +1677,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1661,7 +1691,7 @@ Moc%27ing intro.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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.h" Moc%27ing intro.h... Moc%27ing intro.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1675,7 +1705,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1689,7 +1719,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1703,7 +1733,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1722,7 +1752,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1732,7 +1762,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1746,7 +1776,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1767,7 +1797,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1797,7 +1827,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1811,7 +1841,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1825,7 +1855,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1844,7 +1874,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1854,7 +1884,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1870,7 +1900,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1886,7 +1916,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1900,7 +1930,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1914,7 +1944,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1928,7 +1958,7 @@ Moc%27ing pspecific_wnd.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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1948,7 +1978,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1962,7 +1992,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1976,7 +2006,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -1992,7 +2022,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -2009,7 +2039,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -2048,7 +2078,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 @@ -2062,7 +2092,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.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 f58dc5f423..394abb94be 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -46,6 +46,42 @@ {9d7bbb7d-817b-4f19-a719-74e674bdc84b} + + {cda95767-f353-4a6b-a124-73632e61028a} + + + {1abe710c-3c36-484c-b2a5-881c29a051c2} + + + {7bd3aaf0-4c45-4177-841d-e09b420f969b} + + + {7e91af88-3ca1-43f3-b213-ae3a6e9adbe3} + + + {729af6c6-f616-40f3-86d8-7a177a4ca581} + + + {6ebf64cf-1373-4c85-bc7c-a334da36957d} + + + {342ef107-8d0a-4518-a4ef-186706a51186} + + + {ea350daa-d09f-4e6a-a31d-46c971c7e117} + + + {22eae21d-0b6e-4c24-b12a-cad8538b25cf} + + + {6a602fc1-ef90-4276-ad51-e68e520a750d} + + + {8c8b7809-73e8-4074-986d-39cfda2961a0} + + + {1a35c875-fa31-4146-9555-1443abb58026} + @@ -897,8 +933,17 @@ Generated Files\Release - - Generated Files + + ThirdParty\minizip + + + ThirdParty\breakpad\client\windows\handler + + + ThirdParty\breakpad\client\windows\crash_generation + + + ThirdParty\breakpad\common\windows @@ -989,14 +1034,77 @@ Source Files - - Generated Files + + ThirdParty\minizip - - Generated Files + + ThirdParty\minizip - - Generated Files + + ThirdParty\minizip + + + ThirdParty\breakpad\client\windows\handler + + + ThirdParty\breakpad\client\windows\common + + + ThirdParty\breakpad\client\windows\crash_generation + + + ThirdParty\breakpad\common\windows + + + ThirdParty\breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\common\windows + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common + + + ThirdParty\breakpad\google_breakpad\common diff --git a/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc b/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc new file mode 100644 index 0000000000..148d61f9f3 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc @@ -0,0 +1,765 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// The ExceptionHandler object installs signal handlers for a number of +// signals. We rely on the signal handler running on the thread which crashed +// in order to identify it. This is true of the synchronous signals (SEGV etc), +// but not true of ABRT. Thus, if you send ABRT to yourself in a program which +// uses ExceptionHandler, you need to use tgkill to direct it to the current +// thread. +// +// The signal flow looks like this: +// +// SignalHandler (uses a global stack of ExceptionHandler objects to find +// | one to handle the signal. If the first rejects it, try +// | the second etc...) +// V +// HandleSignal ----------------------------| (clones a new process which +// | | shares an address space with +// (wait for cloned | the crashed process. This +// process) | allows us to ptrace the crashed +// | | process) +// V V +// (set signal handler to ThreadEntry (static function to bounce +// SIG_DFL and rethrow, | back into the object) +// killing the crashed | +// process) V +// DoDump (writes minidump) +// | +// V +// sys_exit +// + +// This code is a little fragmented. Different functions of the ExceptionHandler +// class run in a number of different contexts. Some of them run in a normal +// context and are easy to code, others run in a compromised context and the +// restrictions at the top of minidump_writer.cc apply: no libc and use the +// alternative malloc. Each function should have comment above it detailing the +// context which it runs in. + +#include "client/linux/handler/exception_handler.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "common/basictypes.h" +#include "common/linux/linux_libc_support.h" +#include "common/memory.h" +#include "client/linux/log/log.h" +#include "client/linux/microdump_writer/microdump_writer.h" +#include "client/linux/minidump_writer/linux_dumper.h" +#include "client/linux/minidump_writer/minidump_writer.h" +#include "common/linux/eintr_wrapper.h" +#include "third_party/lss/linux_syscall_support.h" + +#if defined(__ANDROID__) +#include "linux/sched.h" +#endif + +#ifndef PR_SET_PTRACER +#define PR_SET_PTRACER 0x59616d61 +#endif + +// A wrapper for the tgkill syscall: send a signal to a specific thread. +static int tgkill(pid_t tgid, pid_t tid, int sig) { + return syscall(__NR_tgkill, tgid, tid, sig); + return 0; +} + +namespace google_breakpad { + +namespace { +// The list of signals which we consider to be crashes. The default action for +// all these signals must be Core (see man 7 signal) because we rethrow the +// signal after handling it and expect that it'll be fatal. +const int kExceptionSignals[] = { + SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS +}; +const int kNumHandledSignals = + sizeof(kExceptionSignals) / sizeof(kExceptionSignals[0]); +struct sigaction old_handlers[kNumHandledSignals]; +bool handlers_installed = false; + +// InstallAlternateStackLocked will store the newly installed stack in new_stack +// and (if it exists) the previously installed stack in old_stack. +stack_t old_stack; +stack_t new_stack; +bool stack_installed = false; + +// Create an alternative stack to run the signal handlers on. This is done since +// the signal might have been caused by a stack overflow. +// Runs before crashing: normal context. +void InstallAlternateStackLocked() { + if (stack_installed) + return; + + memset(&old_stack, 0, sizeof(old_stack)); + memset(&new_stack, 0, sizeof(new_stack)); + + // SIGSTKSZ may be too small to prevent the signal handlers from overrunning + // the alternative stack. Ensure that the size of the alternative stack is + // large enough. + static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); + + // Only set an alternative stack if there isn't already one, or if the current + // one is too small. + if (sys_sigaltstack(NULL, &old_stack) == -1 || !old_stack.ss_sp || + old_stack.ss_size < kSigStackSize) { + new_stack.ss_sp = calloc(1, kSigStackSize); + new_stack.ss_size = kSigStackSize; + + if (sys_sigaltstack(&new_stack, NULL) == -1) { + free(new_stack.ss_sp); + return; + } + stack_installed = true; + } +} + +// Runs before crashing: normal context. +void RestoreAlternateStackLocked() { + if (!stack_installed) + return; + + stack_t current_stack; + if (sys_sigaltstack(NULL, ¤t_stack) == -1) + return; + + // Only restore the old_stack if the current alternative stack is the one + // installed by the call to InstallAlternateStackLocked. + if (current_stack.ss_sp == new_stack.ss_sp) { + if (old_stack.ss_sp) { + if (sys_sigaltstack(&old_stack, NULL) == -1) + return; + } else { + stack_t disable_stack; + disable_stack.ss_flags = SS_DISABLE; + if (sys_sigaltstack(&disable_stack, NULL) == -1) + return; + } + } + + free(new_stack.ss_sp); + stack_installed = false; +} + +void InstallDefaultHandler(int sig) { +#if defined(__ANDROID__) + // Android L+ expose signal and sigaction symbols that override the system + // ones. There is a bug in these functions where a request to set the handler + // to SIG_DFL is ignored. In that case, an infinite loop is entered as the + // signal is repeatedly sent to breakpad's signal handler. + // To work around this, directly call the system's sigaction. + struct kernel_sigaction sa; + memset(&sa, 0, sizeof(sa)); + sys_sigemptyset(&sa.sa_mask); + sa.sa_handler_ = SIG_DFL; + sa.sa_flags = SA_RESTART; + sys_rt_sigaction(sig, &sa, NULL, sizeof(kernel_sigset_t)); +#else + signal(sig, SIG_DFL); +#endif +} + +// The global exception handler stack. This is needed because there may exist +// multiple ExceptionHandler instances in a process. Each will have itself +// registered in this stack. +std::vector* g_handler_stack_ = NULL; +pthread_mutex_t g_handler_stack_mutex_ = PTHREAD_MUTEX_INITIALIZER; + +// sizeof(CrashContext) can be too big w.r.t the size of alternatate stack +// for SignalHandler(). Keep the crash context as a .bss field. Exception +// handlers are serialized by the |g_handler_stack_mutex_| and at most one at a +// time can use |g_crash_context_|. +ExceptionHandler::CrashContext g_crash_context_; + +} // namespace + +// Runs before crashing: normal context. +ExceptionHandler::ExceptionHandler(const MinidumpDescriptor& descriptor, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + bool install_handler, + const int server_fd) + : filter_(filter), + callback_(callback), + callback_context_(callback_context), + minidump_descriptor_(descriptor), + crash_handler_(NULL) { + if (server_fd >= 0) + crash_generation_client_.reset(CrashGenerationClient::TryCreate(server_fd)); + + if (!IsOutOfProcess() && !minidump_descriptor_.IsFD() && + !minidump_descriptor_.IsMicrodumpOnConsole()) + minidump_descriptor_.UpdatePath(); + +#if defined(__ANDROID__) + if (minidump_descriptor_.IsMicrodumpOnConsole()) + logger::initializeCrashLogWriter(); +#endif + + pthread_mutex_lock(&g_handler_stack_mutex_); + + // Pre-fault the crash context struct. This is to avoid failing due to OOM + // if handling an exception when the process ran out of virtual memory. + memset(&g_crash_context_, 0, sizeof(g_crash_context_)); + + if (!g_handler_stack_) + g_handler_stack_ = new std::vector; + if (install_handler) { + InstallAlternateStackLocked(); + InstallHandlersLocked(); + } + g_handler_stack_->push_back(this); + pthread_mutex_unlock(&g_handler_stack_mutex_); +} + +// Runs before crashing: normal context. +ExceptionHandler::~ExceptionHandler() { + pthread_mutex_lock(&g_handler_stack_mutex_); + std::vector::iterator handler = + std::find(g_handler_stack_->begin(), g_handler_stack_->end(), this); + g_handler_stack_->erase(handler); + if (g_handler_stack_->empty()) { + delete g_handler_stack_; + g_handler_stack_ = NULL; + RestoreAlternateStackLocked(); + RestoreHandlersLocked(); + } + pthread_mutex_unlock(&g_handler_stack_mutex_); +} + +// Runs before crashing: normal context. +// static +bool ExceptionHandler::InstallHandlersLocked() { + if (handlers_installed) + return false; + + // Fail if unable to store all the old handlers. + for (int i = 0; i < kNumHandledSignals; ++i) { + if (sigaction(kExceptionSignals[i], NULL, &old_handlers[i]) == -1) + return false; + } + + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sigemptyset(&sa.sa_mask); + + // Mask all exception signals when we're handling one of them. + for (int i = 0; i < kNumHandledSignals; ++i) + sigaddset(&sa.sa_mask, kExceptionSignals[i]); + + sa.sa_sigaction = SignalHandler; + sa.sa_flags = SA_ONSTACK | SA_SIGINFO; + + for (int i = 0; i < kNumHandledSignals; ++i) { + if (sigaction(kExceptionSignals[i], &sa, NULL) == -1) { + // At this point it is impractical to back out changes, and so failure to + // install a signal is intentionally ignored. + } + } + handlers_installed = true; + return true; +} + +// This function runs in a compromised context: see the top of the file. +// Runs on the crashing thread. +// static +void ExceptionHandler::RestoreHandlersLocked() { + if (!handlers_installed) + return; + + for (int i = 0; i < kNumHandledSignals; ++i) { + if (sigaction(kExceptionSignals[i], &old_handlers[i], NULL) == -1) { + InstallDefaultHandler(kExceptionSignals[i]); + } + } + handlers_installed = false; +} + +// void ExceptionHandler::set_crash_handler(HandlerCallback callback) { +// crash_handler_ = callback; +// } + +// This function runs in a compromised context: see the top of the file. +// Runs on the crashing thread. +// static +void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { + // All the exception signals are blocked at this point. + pthread_mutex_lock(&g_handler_stack_mutex_); + + // Sometimes, Breakpad runs inside a process where some other buggy code + // saves and restores signal handlers temporarily with 'signal' + // instead of 'sigaction'. This loses the SA_SIGINFO flag associated + // with this function. As a consequence, the values of 'info' and 'uc' + // become totally bogus, generally inducing a crash. + // + // The following code tries to detect this case. When it does, it + // resets the signal handlers with sigaction + SA_SIGINFO and returns. + // This forces the signal to be thrown again, but this time the kernel + // will call the function with the right arguments. + struct sigaction cur_handler; + if (sigaction(sig, NULL, &cur_handler) == 0 && + (cur_handler.sa_flags & SA_SIGINFO) == 0) { + // Reset signal handler with the right flags. + sigemptyset(&cur_handler.sa_mask); + sigaddset(&cur_handler.sa_mask, sig); + + cur_handler.sa_sigaction = SignalHandler; + cur_handler.sa_flags = SA_ONSTACK | SA_SIGINFO; + + if (sigaction(sig, &cur_handler, NULL) == -1) { + // When resetting the handler fails, try to reset the + // default one to avoid an infinite loop here. + InstallDefaultHandler(sig); + } + pthread_mutex_unlock(&g_handler_stack_mutex_); + return; + } + + bool handled = false; + for (int i = g_handler_stack_->size() - 1; !handled && i >= 0; --i) { + handled = (*g_handler_stack_)[i]->HandleSignal(sig, info, uc); + } + + // Upon returning from this signal handler, sig will become unmasked and then + // it will be retriggered. If one of the ExceptionHandlers handled it + // successfully, restore the default handler. Otherwise, restore the + // previously installed handler. Then, when the signal is retriggered, it will + // be delivered to the appropriate handler. + if (handled) { + InstallDefaultHandler(sig); + } else { + RestoreHandlersLocked(); + } + + pthread_mutex_unlock(&g_handler_stack_mutex_); + + // info->si_code <= 0 iff SI_FROMUSER (SI_FROMKERNEL otherwise). + if (info->si_code <= 0 || sig == SIGABRT) { + // This signal was triggered by somebody sending us the signal with kill(). + // In order to retrigger it, we have to queue a new signal by calling + // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is + // due to the kernel sending a SIGABRT from a user request via SysRQ. + if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { + // If we failed to kill ourselves (e.g. because a sandbox disallows us + // to do so), we instead resort to terminating our process. This will + // result in an incorrect exit code. + _exit(1); + } + } else { + // This was a synchronous signal triggered by a hard fault (e.g. SIGSEGV). + // No need to reissue the signal. It will automatically trigger again, + // when we return from the signal handler. + } +} + +struct ThreadArgument { + pid_t pid; // the crashing process + const MinidumpDescriptor* minidump_descriptor; + ExceptionHandler* handler; + const void* context; // a CrashContext structure + size_t context_size; +}; + +// This is the entry function for the cloned process. We are in a compromised +// context here: see the top of the file. +// static +int ExceptionHandler::ThreadEntry(void *arg) { + const ThreadArgument *thread_arg = reinterpret_cast(arg); + + // Block here until the crashing process unblocks us when + // we're allowed to use ptrace + thread_arg->handler->WaitForContinueSignal(); + + return thread_arg->handler->DoDump(thread_arg->pid, thread_arg->context, + thread_arg->context_size) == false; +} + +// This function runs in a compromised context: see the top of the file. +// Runs on the crashing thread. +bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { + if (filter_ && !filter_(callback_context_)) + return false; + + // Allow ourselves to be dumped if the signal is trusted. + bool signal_trusted = info->si_code > 0; + bool signal_pid_trusted = info->si_code == SI_USER || + info->si_code == SI_TKILL; + if (signal_trusted || (signal_pid_trusted && info->si_pid == getpid())) { + sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); + } + + // Fill in all the holes in the struct to make Valgrind happy. + memset(&g_crash_context_, 0, sizeof(g_crash_context_)); + memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t)); + memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext)); +#if defined(__aarch64__) + struct ucontext* uc_ptr = (struct ucontext*)uc; + struct fpsimd_context* fp_ptr = + (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; + if (fp_ptr->head.magic == FPSIMD_MAGIC) { + memcpy(&g_crash_context_.float_state, fp_ptr, + sizeof(g_crash_context_.float_state)); + } +#elif !defined(__ARM_EABI__) && !defined(__mips__) + // FP state is not part of user ABI on ARM Linux. + // In case of MIPS Linux FP state is already part of struct ucontext + // and 'float_state' is not a member of CrashContext. + struct ucontext* uc_ptr = (struct ucontext*)uc; + if (uc_ptr->uc_mcontext.fpregs) { + memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, + sizeof(g_crash_context_.float_state)); + } +#endif + g_crash_context_.tid = syscall(__NR_gettid); + if (crash_handler_ != NULL) { + if (crash_handler_(&g_crash_context_, sizeof(g_crash_context_), + callback_context_)) { + return true; + } + } + return GenerateDump(&g_crash_context_); +} + +// This is a public interface to HandleSignal that allows the client to +// generate a crash dump. This function may run in a compromised context. +bool ExceptionHandler::SimulateSignalDelivery(int sig) { + siginfo_t siginfo = {}; + // Mimic a trusted signal to allow tracing the process (see + // ExceptionHandler::HandleSignal(). + siginfo.si_code = SI_USER; + siginfo.si_pid = getpid(); + struct ucontext context; + getcontext(&context); + return HandleSignal(sig, &siginfo, &context); +} + +// This function may run in a compromised context: see the top of the file. +bool ExceptionHandler::GenerateDump(CrashContext *context) { + if (IsOutOfProcess()) + return crash_generation_client_->RequestDump(context, sizeof(*context)); + + // Allocating too much stack isn't a problem, and better to err on the side + // of caution than smash it into random locations. + static const unsigned kChildStackSize = 16000; + PageAllocator allocator; + uint8_t* stack = reinterpret_cast(allocator.Alloc(kChildStackSize)); + if (!stack) + return false; + // clone() needs the top-most address. (scrub just to be safe) + stack += kChildStackSize; + my_memset(stack - 16, 0, 16); + + ThreadArgument thread_arg; + thread_arg.handler = this; + thread_arg.minidump_descriptor = &minidump_descriptor_; + thread_arg.pid = getpid(); + thread_arg.context = context; + thread_arg.context_size = sizeof(*context); + + // We need to explicitly enable ptrace of parent processes on some + // kernels, but we need to know the PID of the cloned process before we + // can do this. Create a pipe here which we can use to block the + // cloned process after creating it, until we have explicitly enabled ptrace + if (sys_pipe(fdes) == -1) { + // Creating the pipe failed. We'll log an error but carry on anyway, + // as we'll probably still get a useful crash report. All that will happen + // is the write() and read() calls will fail with EBADF + static const char no_pipe_msg[] = "ExceptionHandler::GenerateDump " + "sys_pipe failed:"; + logger::write(no_pipe_msg, sizeof(no_pipe_msg) - 1); + logger::write(strerror(errno), strlen(strerror(errno))); + logger::write("\n", 1); + + // Ensure fdes[0] and fdes[1] are invalid file descriptors. + fdes[0] = fdes[1] = -1; + } + + const pid_t child = sys_clone( + ThreadEntry, stack, CLONE_FILES | CLONE_FS | CLONE_UNTRACED, + &thread_arg, NULL, NULL, NULL); + if (child == -1) { + sys_close(fdes[0]); + sys_close(fdes[1]); + return false; + } + + // Allow the child to ptrace us + sys_prctl(PR_SET_PTRACER, child, 0, 0, 0); + SendContinueSignalToChild(); + int status; + const int r = HANDLE_EINTR(sys_waitpid(child, &status, __WALL)); + + sys_close(fdes[0]); + sys_close(fdes[1]); + + if (r == -1) { + static const char msg[] = "ExceptionHandler::GenerateDump waitpid failed:"; + logger::write(msg, sizeof(msg) - 1); + logger::write(strerror(errno), strlen(strerror(errno))); + logger::write("\n", 1); + } + + bool success = r != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0; + if (callback_) + success = callback_(minidump_descriptor_, callback_context_, success); + return success; +} + +// This function runs in a compromised context: see the top of the file. +void ExceptionHandler::SendContinueSignalToChild() { + static const char okToContinueMessage = 'a'; + int r; + r = HANDLE_EINTR(sys_write(fdes[1], &okToContinueMessage, sizeof(char))); + if (r == -1) { + static const char msg[] = "ExceptionHandler::SendContinueSignalToChild " + "sys_write failed:"; + logger::write(msg, sizeof(msg) - 1); + logger::write(strerror(errno), strlen(strerror(errno))); + logger::write("\n", 1); + } +} + +// This function runs in a compromised context: see the top of the file. +// Runs on the cloned process. +void ExceptionHandler::WaitForContinueSignal() { + int r; + char receivedMessage; + r = HANDLE_EINTR(sys_read(fdes[0], &receivedMessage, sizeof(char))); + if (r == -1) { + static const char msg[] = "ExceptionHandler::WaitForContinueSignal " + "sys_read failed:"; + logger::write(msg, sizeof(msg) - 1); + logger::write(strerror(errno), strlen(strerror(errno))); + logger::write("\n", 1); + } +} + +// This function runs in a compromised context: see the top of the file. +// Runs on the cloned process. +bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context, + size_t context_size) { + if (minidump_descriptor_.IsMicrodumpOnConsole()) { + return google_breakpad::WriteMicrodump( + crashing_process, + context, + context_size, + mapping_list_, + *minidump_descriptor_.microdump_extra_info()); + } + if (minidump_descriptor_.IsFD()) { + return google_breakpad::WriteMinidump(minidump_descriptor_.fd(), + minidump_descriptor_.size_limit(), + crashing_process, + context, + context_size, + mapping_list_, + app_memory_list_); + } + return google_breakpad::WriteMinidump(minidump_descriptor_.path(), + minidump_descriptor_.size_limit(), + crashing_process, + context, + context_size, + mapping_list_, + app_memory_list_); +} + +// static +bool ExceptionHandler::WriteMinidump(const string& dump_path, + MinidumpCallback callback, + void* callback_context) { + MinidumpDescriptor descriptor(dump_path); + ExceptionHandler eh(descriptor, NULL, callback, callback_context, false, -1); + return eh.WriteMinidump(); +} + +// In order to making using EBP to calculate the desired value for ESP +// a valid operation, ensure that this function is compiled with a +// frame pointer using the following attribute. This attribute +// is supported on GCC but not on clang. +#if defined(__i386__) && defined(__GNUC__) && !defined(__clang__) +__attribute__((optimize("no-omit-frame-pointer"))) +#endif +bool ExceptionHandler::WriteMinidump() { + if (!IsOutOfProcess() && !minidump_descriptor_.IsFD() && + !minidump_descriptor_.IsMicrodumpOnConsole()) { + // Update the path of the minidump so that this can be called multiple times + // and new files are created for each minidump. This is done before the + // generation happens, as clients may want to access the MinidumpDescriptor + // after this call to find the exact path to the minidump file. + minidump_descriptor_.UpdatePath(); + } else if (minidump_descriptor_.IsFD()) { + // Reposition the FD to its beginning and resize it to get rid of the + // previous minidump info. + lseek(minidump_descriptor_.fd(), 0, SEEK_SET); + ignore_result(ftruncate(minidump_descriptor_.fd(), 0)); + } + + // Allow this process to be dumped. + sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); + + CrashContext context; + int getcontext_result = getcontext(&context.context); + if (getcontext_result) + return false; + +#if defined(__i386__) + // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved + // from REG_UESP instead of from REG_ESP. REG_UESP is the user stack pointer + // and it only makes sense when running in kernel mode with a different stack + // pointer. When WriteMiniDump is called during normal processing REG_UESP is + // zero which leads to bad minidump files. + if (!context.context.uc_mcontext.gregs[REG_UESP]) { + // If REG_UESP is set to REG_ESP then that includes the stack space for the + // CrashContext object in this function, which is about 128 KB. Since the + // Linux dumper only records 32 KB of stack this would mean that nothing + // useful would be recorded. A better option is to set REG_UESP to REG_EBP, + // perhaps with a small negative offset in case there is any code that + // objects to them being equal. + context.context.uc_mcontext.gregs[REG_UESP] = + context.context.uc_mcontext.gregs[REG_EBP] - 16; + // The stack saving is based off of REG_ESP so it must be set to match the + // new REG_UESP. + context.context.uc_mcontext.gregs[REG_ESP] = + context.context.uc_mcontext.gregs[REG_UESP]; + } +#endif + +#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) + // FPU state is not part of ARM EABI ucontext_t. + memcpy(&context.float_state, context.context.uc_mcontext.fpregs, + sizeof(context.float_state)); +#endif + context.tid = sys_gettid(); + + // Add an exception stream to the minidump for better reporting. + memset(&context.siginfo, 0, sizeof(context.siginfo)); + context.siginfo.si_signo = MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED; +#if defined(__i386__) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.gregs[REG_EIP]); +#elif defined(__x86_64__) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.gregs[REG_RIP]); +#elif defined(__arm__) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.arm_pc); +#elif defined(__aarch64__) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.pc); +#elif defined(__mips__) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.pc); +#else +#error "This code has not been ported to your platform yet." +#endif + + return GenerateDump(&context); +} + +void ExceptionHandler::AddMappingInfo(const string& name, + const uint8_t identifier[sizeof(MDGUID)], + uintptr_t start_address, + size_t mapping_size, + size_t file_offset) { + MappingInfo info; + info.start_addr = start_address; + info.size = mapping_size; + info.offset = file_offset; + strncpy(info.name, name.c_str(), sizeof(info.name) - 1); + info.name[sizeof(info.name) - 1] = '\0'; + + MappingEntry mapping; + mapping.first = info; + memcpy(mapping.second, identifier, sizeof(MDGUID)); + mapping_list_.push_back(mapping); +} + +void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) { + AppMemoryList::iterator iter = + std::find(app_memory_list_.begin(), app_memory_list_.end(), ptr); + if (iter != app_memory_list_.end()) { + // Don't allow registering the same pointer twice. + return; + } + + AppMemory app_memory; + app_memory.ptr = ptr; + app_memory.length = length; + app_memory_list_.push_back(app_memory); +} + +void ExceptionHandler::UnregisterAppMemory(void* ptr) { + AppMemoryList::iterator iter = + std::find(app_memory_list_.begin(), app_memory_list_.end(), ptr); + if (iter != app_memory_list_.end()) { + app_memory_list_.erase(iter); + } +} + +// static +bool ExceptionHandler::WriteMinidumpForChild(pid_t child, + pid_t child_blamed_thread, + const string& dump_path, + MinidumpCallback callback, + void* callback_context) { + // This function is not run in a compromised context. + MinidumpDescriptor descriptor(dump_path); + descriptor.UpdatePath(); + if (!google_breakpad::WriteMinidump(descriptor.path(), + child, + child_blamed_thread)) + return false; + + return callback ? callback(descriptor, callback_context, true) : true; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h b/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h new file mode 100644 index 0000000000..591c310855 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h @@ -0,0 +1,278 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ +#define CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ + +#include +#include +#include +#include + +#include + +#include "client/linux/crash_generation/crash_generation_client.h" +#include "client/linux/handler/minidump_descriptor.h" +#include "client/linux/minidump_writer/minidump_writer.h" +#include "common/scoped_ptr.h" +#include "common/using_std_string.h" +#include "google_breakpad/common/minidump_format.h" + +namespace google_breakpad { + +// ExceptionHandler +// +// ExceptionHandler can write a minidump file when an exception occurs, +// or when WriteMinidump() is called explicitly by your program. +// +// To have the exception handler write minidumps when an uncaught exception +// (crash) occurs, you should create an instance early in the execution +// of your program, and keep it around for the entire time you want to +// have crash handling active (typically, until shutdown). +// (NOTE): There should be only be one this kind of exception handler +// object per process. +// +// If you want to write minidumps without installing the exception handler, +// you can create an ExceptionHandler with install_handler set to false, +// then call WriteMinidump. You can also use this technique if you want to +// use different minidump callbacks for different call sites. +// +// In either case, a callback function is called when a minidump is written, +// which receives the full path or file descriptor of the minidump. The +// caller can collect and write additional application state to that minidump, +// and launch an external crash-reporting application. +// +// Caller should try to make the callbacks as crash-friendly as possible, +// it should avoid use heap memory allocation as much as possible. + +class ExceptionHandler { + public: + // A callback function to run before Breakpad performs any substantial + // processing of an exception. A FilterCallback is called before writing + // a minidump. |context| is the parameter supplied by the user as + // callback_context when the handler was created. + // + // If a FilterCallback returns true, Breakpad will continue processing, + // attempting to write a minidump. If a FilterCallback returns false, + // Breakpad will immediately report the exception as unhandled without + // writing a minidump, allowing another handler the opportunity to handle it. + typedef bool (*FilterCallback)(void *context); + + // A callback function to run after the minidump has been written. + // |descriptor| contains the file descriptor or file path containing the + // minidump. |context| is the parameter supplied by the user as + // callback_context when the handler was created. |succeeded| indicates + // whether a minidump file was successfully written. + // + // If an exception occurred and the callback returns true, Breakpad will + // treat the exception as fully-handled, suppressing any other handlers from + // being notified of the exception. If the callback returns false, Breakpad + // will treat the exception as unhandled, and allow another handler to handle + // it. If there are no other handlers, Breakpad will report the exception to + // the system as unhandled, allowing a debugger or native crash dialog the + // opportunity to handle the exception. Most callback implementations + // should normally return the value of |succeeded|, or when they wish to + // not report an exception of handled, false. Callbacks will rarely want to + // return true directly (unless |succeeded| is true). + typedef bool (*MinidumpCallback)(const MinidumpDescriptor& descriptor, + void* context, + bool succeeded); + + // In certain cases, a user may wish to handle the generation of the minidump + // themselves. In this case, they can install a handler callback which is + // called when a crash has occurred. If this function returns true, no other + // processing of occurs and the process will shortly be crashed. If this + // returns false, the normal processing continues. + typedef bool (*HandlerCallback)(const void* crash_context, + size_t crash_context_size, + void* context); + + // Creates a new ExceptionHandler instance to handle writing minidumps. + // Before writing a minidump, the optional |filter| callback will be called. + // Its return value determines whether or not Breakpad should write a + // minidump. The minidump content will be written to the file path or file + // descriptor from |descriptor|, and the optional |callback| is called after + // writing the dump file, as described above. + // If install_handler is true, then a minidump will be written whenever + // an unhandled exception occurs. If it is false, minidumps will only + // be written when WriteMinidump is called. + // If |server_fd| is valid, the minidump is generated out-of-process. If it + // is -1, in-process generation will always be used. + ExceptionHandler(const MinidumpDescriptor& descriptor, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + bool install_handler, + const int server_fd); + ~ExceptionHandler(); + + const MinidumpDescriptor& minidump_descriptor() const { + return minidump_descriptor_; + } + + void set_minidump_descriptor(const MinidumpDescriptor& descriptor) { + minidump_descriptor_ = descriptor; + } + + void set_crash_handler(HandlerCallback callback) { + crash_handler_ = callback; + } + + void set_crash_generation_client(CrashGenerationClient* client) { + crash_generation_client_.reset(client); + } + + // Writes a minidump immediately. This can be used to capture the execution + // state independently of a crash. + // Returns true on success. + // If the ExceptionHandler has been created with a path, a new file is + // generated for each minidump. The file path can be retrieved in the + // MinidumpDescriptor passed to the MinidumpCallback or by accessing the + // MinidumpDescriptor directly from the ExceptionHandler (with + // minidump_descriptor()). + // If the ExceptionHandler has been created with a file descriptor, the file + // descriptor is repositioned to its beginning and the previous generated + // minidump is overwritten. + // Note that this method is not supposed to be called from a compromised + // context as it uses the heap. + bool WriteMinidump(); + + // Convenience form of WriteMinidump which does not require an + // ExceptionHandler instance. + static bool WriteMinidump(const string& dump_path, + MinidumpCallback callback, + void* callback_context); + + // Write a minidump of |child| immediately. This can be used to + // capture the execution state of |child| independently of a crash. + // Pass a meaningful |child_blamed_thread| to make that thread in + // the child process the one from which a crash signature is + // extracted. + // + // WARNING: the return of this function *must* happen before + // the code that will eventually reap |child| executes. + // Otherwise there's a pernicious race condition in which |child| + // exits, is reaped, another process created with its pid, then that + // new process dumped. + static bool WriteMinidumpForChild(pid_t child, + pid_t child_blamed_thread, + const string& dump_path, + MinidumpCallback callback, + void* callback_context); + + // This structure is passed to minidump_writer.h:WriteMinidump via an opaque + // blob. It shouldn't be needed in any user code. + struct CrashContext { + siginfo_t siginfo; + pid_t tid; // the crashing thread. + struct ucontext context; +#if !defined(__ARM_EABI__) && !defined(__mips__) + // #ifdef this out because FP state is not part of user ABI for Linux ARM. + // In case of MIPS Linux FP state is already part of struct + // ucontext so 'float_state' is not required. + fpstate_t float_state; +#endif + }; + + // Returns whether out-of-process dump generation is used or not. + bool IsOutOfProcess() const { + return crash_generation_client_.get() != NULL; + } + + // Add information about a memory mapping. This can be used if + // a custom library loader is used that maps things in a way + // that the linux dumper can't handle by reading the maps file. + void AddMappingInfo(const string& name, + const uint8_t identifier[sizeof(MDGUID)], + uintptr_t start_address, + size_t mapping_size, + size_t file_offset); + + // Register a block of memory of length bytes starting at address ptr + // to be copied to the minidump when a crash happens. + void RegisterAppMemory(void* ptr, size_t length); + + // Unregister a block of memory that was registered with RegisterAppMemory. + void UnregisterAppMemory(void* ptr); + + // Force signal handling for the specified signal. + bool SimulateSignalDelivery(int sig); + + // Report a crash signal from an SA_SIGINFO signal handler. + bool HandleSignal(int sig, siginfo_t* info, void* uc); + + private: + // Save the old signal handlers and install new ones. + static bool InstallHandlersLocked(); + // Restore the old signal handlers. + static void RestoreHandlersLocked(); + + void PreresolveSymbols(); + bool GenerateDump(CrashContext *context); + void SendContinueSignalToChild(); + void WaitForContinueSignal(); + + static void SignalHandler(int sig, siginfo_t* info, void* uc); + static int ThreadEntry(void* arg); + bool DoDump(pid_t crashing_process, const void* context, + size_t context_size); + + const FilterCallback filter_; + const MinidumpCallback callback_; + void* const callback_context_; + + scoped_ptr crash_generation_client_; + + MinidumpDescriptor minidump_descriptor_; + + // Must be volatile. The compiler is unaware of the code which runs in + // the signal handler which reads this variable. Without volatile the + // compiler is free to optimise away writes to this variable which it + // believes are never read. + volatile HandlerCallback crash_handler_; + + // We need to explicitly enable ptrace of parent processes on some + // kernels, but we need to know the PID of the cloned process before we + // can do this. We create a pipe which we can use to block the + // cloned process after creating it, until we have explicitly enabled + // ptrace. This is used to store the file descriptors for the pipe + int fdes[2]; + + // Callers can add extra info about mappings for cases where the + // dumper code cannot extract enough information from /proc//maps. + MappingList mapping_list_; + + // Callers can request additional memory regions to be included in + // the dump. + AppMemoryList app_memory_list_; +}; + +} // namespace google_breakpad + +#endif // CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc new file mode 100644 index 0000000000..6928e98472 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc @@ -0,0 +1,855 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include + +#include + +#include "client/mac/handler/exception_handler.h" +#include "client/mac/handler/minidump_generator.h" +#include "common/mac/macho_utilities.h" +#include "common/mac/scoped_task_suspend-inl.h" +#include "google_breakpad/common/minidump_exception_mac.h" + +#ifndef __EXCEPTIONS +// This file uses C++ try/catch (but shouldn't). Duplicate the macros from +// allowing this file to work properly with +// exceptions disabled even when other C++ libraries are used. #undef the try +// and catch macros first in case libstdc++ is in use and has already provided +// its own definitions. +#undef try +#define try if (true) +#undef catch +#define catch(X) if (false) +#endif // __EXCEPTIONS + +#ifndef USE_PROTECTED_ALLOCATIONS +#if TARGET_OS_IPHONE +#define USE_PROTECTED_ALLOCATIONS 1 +#else +#define USE_PROTECTED_ALLOCATIONS 0 +#endif +#endif + +// If USE_PROTECTED_ALLOCATIONS is activated then the +// gBreakpadAllocator needs to be setup in other code +// ahead of time. Please see ProtectedMemoryAllocator.h +// for more details. +#if USE_PROTECTED_ALLOCATIONS + #include "protected_memory_allocator.h" + extern ProtectedMemoryAllocator *gBreakpadAllocator; +#endif + +namespace google_breakpad { + +static union { +#if USE_PROTECTED_ALLOCATIONS +#if defined PAGE_MAX_SIZE + char protected_buffer[PAGE_MAX_SIZE] __attribute__((aligned(PAGE_MAX_SIZE))); +#else + char protected_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); +#endif // defined PAGE_MAX_SIZE +#endif // USE_PROTECTED_ALLOCATIONS + google_breakpad::ExceptionHandler *handler; +} gProtectedData; + +using std::map; + +// These structures and techniques are illustrated in +// Mac OS X Internals, Amit Singh, ch 9.7 +struct ExceptionMessage { + mach_msg_header_t header; + mach_msg_body_t body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + NDR_record_t ndr; + exception_type_t exception; + mach_msg_type_number_t code_count; + integer_t code[EXCEPTION_CODE_MAX]; + char padding[512]; +}; + +struct ExceptionParameters { + ExceptionParameters() : count(0) {} + mach_msg_type_number_t count; + exception_mask_t masks[EXC_TYPES_COUNT]; + mach_port_t ports[EXC_TYPES_COUNT]; + exception_behavior_t behaviors[EXC_TYPES_COUNT]; + thread_state_flavor_t flavors[EXC_TYPES_COUNT]; +}; + +struct ExceptionReplyMessage { + mach_msg_header_t header; + NDR_record_t ndr; + kern_return_t return_code; +}; + +// Only catch these three exceptions. The other ones are nebulously defined +// and may result in treating a non-fatal exception as fatal. +exception_mask_t s_exception_mask = EXC_MASK_BAD_ACCESS | +EXC_MASK_BAD_INSTRUCTION | EXC_MASK_ARITHMETIC | EXC_MASK_BREAKPOINT; + +#if !TARGET_OS_IPHONE +extern "C" { + // Forward declarations for functions that need "C" style compilation + boolean_t exc_server(mach_msg_header_t* request, + mach_msg_header_t* reply); + + // This symbol must be visible to dlsym() - see + // http://code.google.com/p/google-breakpad/issues/detail?id=345 for details. + kern_return_t catch_exception_raise(mach_port_t target_port, + mach_port_t failed_thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count) + __attribute__((visibility("default"))); +} +#endif + +kern_return_t ForwardException(mach_port_t task, + mach_port_t failed_thread, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count); + +#if TARGET_OS_IPHONE +// Implementation is based on the implementation generated by mig. +boolean_t breakpad_exc_server(mach_msg_header_t* InHeadP, + mach_msg_header_t* OutHeadP) { + OutHeadP->msgh_bits = + MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(InHeadP->msgh_bits), 0); + OutHeadP->msgh_remote_port = InHeadP->msgh_remote_port; + /* Minimal size: routine() will update it if different */ + OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); + OutHeadP->msgh_local_port = MACH_PORT_NULL; + OutHeadP->msgh_id = InHeadP->msgh_id + 100; + + if (InHeadP->msgh_id != 2401) { + ((mig_reply_error_t*)OutHeadP)->NDR = NDR_record; + ((mig_reply_error_t*)OutHeadP)->RetCode = MIG_BAD_ID; + return FALSE; + } + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + mach_msg_trailer_t trailer; + } Request; + + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } Reply; +#ifdef __MigPackStructs +#pragma pack() +#endif + + Request* In0P = (Request*)InHeadP; + Reply* OutP = (Reply*)OutHeadP; + + if (In0P->task.name != mach_task_self()) { + return FALSE; + } + OutP->RetCode = ForwardException(In0P->task.name, + In0P->thread.name, + In0P->exception, + In0P->code, + In0P->codeCnt); + OutP->NDR = NDR_record; + return TRUE; +} +#else +boolean_t breakpad_exc_server(mach_msg_header_t* request, + mach_msg_header_t* reply) { + return exc_server(request, reply); +} + +// Callback from exc_server() +kern_return_t catch_exception_raise(mach_port_t port, mach_port_t failed_thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count) { + if (task != mach_task_self()) { + return KERN_FAILURE; + } + return ForwardException(task, failed_thread, exception, code, code_count); +} +#endif + +ExceptionHandler::ExceptionHandler(const string &dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + bool install_handler, + const char* port_name) + : dump_path_(), + filter_(filter), + callback_(callback), + callback_context_(callback_context), + directCallback_(NULL), + handler_thread_(NULL), + handler_port_(MACH_PORT_NULL), + previous_(NULL), + installed_exception_handler_(false), + is_in_teardown_(false), + last_minidump_write_result_(false), + use_minidump_write_mutex_(false) { + // This will update to the ID and C-string pointers + set_dump_path(dump_path); + MinidumpGenerator::GatherSystemInformation(); +#if !TARGET_OS_IPHONE + if (port_name) + crash_generation_client_.reset(new CrashGenerationClient(port_name)); +#endif + Setup(install_handler); +} + +// special constructor if we want to bypass minidump writing and +// simply get a callback with the exception information +ExceptionHandler::ExceptionHandler(DirectCallback callback, + void* callback_context, + bool install_handler) + : dump_path_(), + filter_(NULL), + callback_(NULL), + callback_context_(callback_context), + directCallback_(callback), + handler_thread_(NULL), + handler_port_(MACH_PORT_NULL), + previous_(NULL), + installed_exception_handler_(false), + is_in_teardown_(false), + last_minidump_write_result_(false), + use_minidump_write_mutex_(false) { + MinidumpGenerator::GatherSystemInformation(); + Setup(install_handler); +} + +ExceptionHandler::~ExceptionHandler() { + Teardown(); +} + +bool ExceptionHandler::WriteMinidump(bool write_exception_stream) { + // If we're currently writing, just return + if (use_minidump_write_mutex_) + return false; + + use_minidump_write_mutex_ = true; + last_minidump_write_result_ = false; + + // Lock the mutex. Since we just created it, this will return immediately. + if (pthread_mutex_lock(&minidump_write_mutex_) == 0) { + // Send an empty message to the handle port so that a minidump will + // be written + bool result = SendMessageToHandlerThread(write_exception_stream ? + kWriteDumpWithExceptionMessage : + kWriteDumpMessage); + if (!result) { + pthread_mutex_unlock(&minidump_write_mutex_); + return false; + } + + // Wait for the minidump writer to complete its writing. It will unlock + // the mutex when completed + pthread_mutex_lock(&minidump_write_mutex_); + } + + use_minidump_write_mutex_ = false; + UpdateNextID(); + return last_minidump_write_result_; +} + +// static +bool ExceptionHandler::WriteMinidump(const string &dump_path, + bool write_exception_stream, + MinidumpCallback callback, + void* callback_context) { + ExceptionHandler handler(dump_path, NULL, callback, callback_context, false, + NULL); + return handler.WriteMinidump(write_exception_stream); +} + +// static +bool ExceptionHandler::WriteMinidumpForChild(mach_port_t child, + mach_port_t child_blamed_thread, + const string &dump_path, + MinidumpCallback callback, + void* callback_context) { + ScopedTaskSuspend suspend(child); + + MinidumpGenerator generator(child, MACH_PORT_NULL); + string dump_id; + string dump_filename = generator.UniqueNameInDirectory(dump_path, &dump_id); + + generator.SetExceptionInformation(EXC_BREAKPOINT, +#if defined(__i386__) || defined(__x86_64__) + EXC_I386_BPT, +#elif defined(__ppc__) || defined(__ppc64__) + EXC_PPC_BREAKPOINT, +#elif defined(__arm__) || defined(__aarch64__) + EXC_ARM_BREAKPOINT, +#else +#error architecture not supported +#endif + 0, + child_blamed_thread); + bool result = generator.Write(dump_filename.c_str()); + + if (callback) { + return callback(dump_path.c_str(), dump_id.c_str(), + callback_context, result); + } + return result; +} + +bool ExceptionHandler::WriteMinidumpWithException( + int exception_type, + int exception_code, + int exception_subcode, + breakpad_ucontext_t* task_context, + mach_port_t thread_name, + bool exit_after_write, + bool report_current_thread) { + bool result = false; + + if (directCallback_) { + if (directCallback_(callback_context_, + exception_type, + exception_code, + exception_subcode, + thread_name) ) { + if (exit_after_write) + _exit(exception_type); + } +#if !TARGET_OS_IPHONE + } else if (IsOutOfProcess()) { + if (exception_type && exception_code) { + // If this is a real exception, give the filter (if any) a chance to + // decide if this should be sent. + if (filter_ && !filter_(callback_context_)) + return false; + result = crash_generation_client_->RequestDumpForException( + exception_type, + exception_code, + exception_subcode, + thread_name); + if (result && exit_after_write) { + _exit(exception_type); + } + } +#endif + } else { + string minidump_id; + + // Putting the MinidumpGenerator in its own context will ensure that the + // destructor is executed, closing the newly created minidump file. + if (!dump_path_.empty()) { + MinidumpGenerator md(mach_task_self(), + report_current_thread ? MACH_PORT_NULL : + mach_thread_self()); + md.SetTaskContext(task_context); + if (exception_type && exception_code) { + // If this is a real exception, give the filter (if any) a chance to + // decide if this should be sent. + if (filter_ && !filter_(callback_context_)) + return false; + + md.SetExceptionInformation(exception_type, exception_code, + exception_subcode, thread_name); + } + + result = md.Write(next_minidump_path_c_); + } + + // Call user specified callback (if any) + if (callback_) { + // If the user callback returned true and we're handling an exception + // (rather than just writing out the file), then we should exit without + // forwarding the exception to the next handler. + if (callback_(dump_path_c_, next_minidump_id_c_, callback_context_, + result)) { + if (exit_after_write) + _exit(exception_type); + } + } + } + + return result; +} + +kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t code_count) { + // At this time, we should have called Uninstall() on the exception handler + // so that the current exception ports are the ones that we should be + // forwarding to. + ExceptionParameters current; + + current.count = EXC_TYPES_COUNT; + mach_port_t current_task = mach_task_self(); + task_get_exception_ports(current_task, + s_exception_mask, + current.masks, + ¤t.count, + current.ports, + current.behaviors, + current.flavors); + + // Find the first exception handler that matches the exception + unsigned int found; + for (found = 0; found < current.count; ++found) { + if (current.masks[found] & (1 << exception)) { + break; + } + } + + // Nothing to forward + if (found == current.count) { + fprintf(stderr, "** No previous ports for forwarding!! \n"); + exit(KERN_FAILURE); + } + + mach_port_t target_port = current.ports[found]; + exception_behavior_t target_behavior = current.behaviors[found]; + + kern_return_t result; + // TODO: Handle the case where |target_behavior| has MACH_EXCEPTION_CODES + // set. https://code.google.com/p/google-breakpad/issues/detail?id=551 + switch (target_behavior) { + case EXCEPTION_DEFAULT: + result = exception_raise(target_port, failed_thread, task, exception, + code, code_count); + break; + default: + fprintf(stderr, "** Unknown exception behavior: %d\n", target_behavior); + result = KERN_FAILURE; + break; + } + + return result; +} + +// static +void* ExceptionHandler::WaitForMessage(void* exception_handler_class) { + ExceptionHandler* self = + reinterpret_cast(exception_handler_class); + ExceptionMessage receive; + + // Wait for the exception info + while (1) { + receive.header.msgh_local_port = self->handler_port_; + receive.header.msgh_size = static_cast(sizeof(receive)); + kern_return_t result = mach_msg(&(receive.header), + MACH_RCV_MSG | MACH_RCV_LARGE, 0, + receive.header.msgh_size, + self->handler_port_, + MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + + + if (result == KERN_SUCCESS) { + // Uninstall our handler so that we don't get in a loop if the process of + // writing out a minidump causes an exception. However, if the exception + // was caused by a fork'd process, don't uninstall things + + // If the actual exception code is zero, then we're calling this handler + // in a way that indicates that we want to either exit this thread or + // generate a minidump + // + // While reporting, all threads (except this one) must be suspended + // to avoid misleading stacks. If appropriate they will be resumed + // afterwards. + if (!receive.exception) { + // Don't touch self, since this message could have been sent + // from its destructor. + if (receive.header.msgh_id == kShutdownMessage) + return NULL; + + self->SuspendThreads(); + +#if USE_PROTECTED_ALLOCATIONS + if (gBreakpadAllocator) + gBreakpadAllocator->Unprotect(); +#endif + + mach_port_t thread = MACH_PORT_NULL; + int exception_type = 0; + int exception_code = 0; + if (receive.header.msgh_id == kWriteDumpWithExceptionMessage) { + thread = receive.thread.name; + exception_type = EXC_BREAKPOINT; +#if defined(__i386__) || defined(__x86_64__) + exception_code = EXC_I386_BPT; +#elif defined(__ppc__) || defined(__ppc64__) + exception_code = EXC_PPC_BREAKPOINT; +#elif defined(__arm__) || defined(__aarch64__) + exception_code = EXC_ARM_BREAKPOINT; +#else +#error architecture not supported +#endif + } + + // Write out the dump and save the result for later retrieval + self->last_minidump_write_result_ = + self->WriteMinidumpWithException(exception_type, exception_code, + 0, NULL, thread, + false, false); + +#if USE_PROTECTED_ALLOCATIONS + if (gBreakpadAllocator) + gBreakpadAllocator->Protect(); +#endif + + self->ResumeThreads(); + + if (self->use_minidump_write_mutex_) + pthread_mutex_unlock(&self->minidump_write_mutex_); + } else { + // When forking a child process with the exception handler installed, + // if the child crashes, it will send the exception back to the parent + // process. The check for task == self_task() ensures that only + // exceptions that occur in the parent process are caught and + // processed. If the exception was not caused by this task, we + // still need to call into the exception server and have it return + // KERN_FAILURE (see catch_exception_raise) in order for the kernel + // to move onto the host exception handler for the child task + if (receive.task.name == mach_task_self()) { + self->SuspendThreads(); + +#if USE_PROTECTED_ALLOCATIONS + if (gBreakpadAllocator) + gBreakpadAllocator->Unprotect(); +#endif + + int subcode = 0; + if (receive.exception == EXC_BAD_ACCESS && receive.code_count > 1) + subcode = receive.code[1]; + + // Generate the minidump with the exception data. + self->WriteMinidumpWithException(receive.exception, receive.code[0], + subcode, NULL, receive.thread.name, + true, false); + +#if USE_PROTECTED_ALLOCATIONS + // This may have become protected again within + // WriteMinidumpWithException, but it needs to be unprotected for + // UninstallHandler. + if (gBreakpadAllocator) + gBreakpadAllocator->Unprotect(); +#endif + + self->UninstallHandler(true); + +#if USE_PROTECTED_ALLOCATIONS + if (gBreakpadAllocator) + gBreakpadAllocator->Protect(); +#endif + } + // Pass along the exception to the server, which will setup the + // message and call catch_exception_raise() and put the return + // code into the reply. + ExceptionReplyMessage reply; + if (!breakpad_exc_server(&receive.header, &reply.header)) + exit(1); + + // Send a reply and exit + mach_msg(&(reply.header), MACH_SEND_MSG, + reply.header.msgh_size, 0, MACH_PORT_NULL, + MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + } + } + } + + return NULL; +} + +// static +void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { +#if USE_PROTECTED_ALLOCATIONS + if (gBreakpadAllocator) + gBreakpadAllocator->Unprotect(); +#endif + gProtectedData.handler->WriteMinidumpWithException( + EXC_SOFTWARE, + MD_EXCEPTION_CODE_MAC_ABORT, + 0, + static_cast(uc), + mach_thread_self(), + true, + true); +#if USE_PROTECTED_ALLOCATIONS + if (gBreakpadAllocator) + gBreakpadAllocator->Protect(); +#endif +} + +bool ExceptionHandler::InstallHandler() { + // If a handler is already installed, something is really wrong. + if (gProtectedData.handler != NULL) { + return false; + } + if (!IsOutOfProcess()) { + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGABRT); + sa.sa_sigaction = ExceptionHandler::SignalHandler; + sa.sa_flags = SA_SIGINFO; + + scoped_ptr old(new struct sigaction); + if (sigaction(SIGABRT, &sa, old.get()) == -1) { + return false; + } + old_handler_.swap(old); + gProtectedData.handler = this; +#if USE_PROTECTED_ALLOCATIONS + assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0); + mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ); +#endif + } + + try { +#if USE_PROTECTED_ALLOCATIONS + previous_ = new (gBreakpadAllocator->Allocate(sizeof(ExceptionParameters)) ) + ExceptionParameters(); +#else + previous_ = new ExceptionParameters(); +#endif + } + catch (std::bad_alloc) { + return false; + } + + // Save the current exception ports so that we can forward to them + previous_->count = EXC_TYPES_COUNT; + mach_port_t current_task = mach_task_self(); + kern_return_t result = task_get_exception_ports(current_task, + s_exception_mask, + previous_->masks, + &previous_->count, + previous_->ports, + previous_->behaviors, + previous_->flavors); + + // Setup the exception ports on this task + if (result == KERN_SUCCESS) + result = task_set_exception_ports(current_task, s_exception_mask, + handler_port_, EXCEPTION_DEFAULT, + THREAD_STATE_NONE); + + installed_exception_handler_ = (result == KERN_SUCCESS); + + return installed_exception_handler_; +} + +bool ExceptionHandler::UninstallHandler(bool in_exception) { + kern_return_t result = KERN_SUCCESS; + + if (old_handler_.get()) { + sigaction(SIGABRT, old_handler_.get(), NULL); +#if USE_PROTECTED_ALLOCATIONS + mprotect(gProtectedData.protected_buffer, PAGE_SIZE, + PROT_READ | PROT_WRITE); +#endif + old_handler_.reset(); + gProtectedData.handler = NULL; + } + + if (installed_exception_handler_) { + mach_port_t current_task = mach_task_self(); + + // Restore the previous ports + for (unsigned int i = 0; i < previous_->count; ++i) { + result = task_set_exception_ports(current_task, previous_->masks[i], + previous_->ports[i], + previous_->behaviors[i], + previous_->flavors[i]); + if (result != KERN_SUCCESS) + return false; + } + + // this delete should NOT happen if an exception just occurred! + if (!in_exception) { +#if USE_PROTECTED_ALLOCATIONS + previous_->~ExceptionParameters(); +#else + delete previous_; +#endif + } + + previous_ = NULL; + installed_exception_handler_ = false; + } + + return result == KERN_SUCCESS; +} + +bool ExceptionHandler::Setup(bool install_handler) { + if (pthread_mutex_init(&minidump_write_mutex_, NULL)) + return false; + + // Create a receive right + mach_port_t current_task = mach_task_self(); + kern_return_t result = mach_port_allocate(current_task, + MACH_PORT_RIGHT_RECEIVE, + &handler_port_); + // Add send right + if (result == KERN_SUCCESS) + result = mach_port_insert_right(current_task, handler_port_, handler_port_, + MACH_MSG_TYPE_MAKE_SEND); + + if (install_handler && result == KERN_SUCCESS) + if (!InstallHandler()) + return false; + + if (result == KERN_SUCCESS) { + // Install the handler in its own thread, detached as we won't be joining. + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + int thread_create_result = pthread_create(&handler_thread_, &attr, + &WaitForMessage, this); + pthread_attr_destroy(&attr); + result = thread_create_result ? KERN_FAILURE : KERN_SUCCESS; + } + + return result == KERN_SUCCESS; +} + +bool ExceptionHandler::Teardown() { + kern_return_t result = KERN_SUCCESS; + is_in_teardown_ = true; + + if (!UninstallHandler(false)) + return false; + + // Send an empty message so that the handler_thread exits + if (SendMessageToHandlerThread(kShutdownMessage)) { + mach_port_t current_task = mach_task_self(); + result = mach_port_deallocate(current_task, handler_port_); + if (result != KERN_SUCCESS) + return false; + } else { + return false; + } + + handler_thread_ = NULL; + handler_port_ = MACH_PORT_NULL; + pthread_mutex_destroy(&minidump_write_mutex_); + + return result == KERN_SUCCESS; +} + +bool ExceptionHandler::SendMessageToHandlerThread( + HandlerThreadMessage message_id) { + ExceptionMessage msg; + memset(&msg, 0, sizeof(msg)); + msg.header.msgh_id = message_id; + if (message_id == kWriteDumpMessage || + message_id == kWriteDumpWithExceptionMessage) { + // Include this thread's port. + msg.thread.name = mach_thread_self(); + msg.thread.disposition = MACH_MSG_TYPE_PORT_SEND; + msg.thread.type = MACH_MSG_PORT_DESCRIPTOR; + } + msg.header.msgh_size = sizeof(msg) - sizeof(msg.padding); + msg.header.msgh_remote_port = handler_port_; + msg.header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, + MACH_MSG_TYPE_MAKE_SEND_ONCE); + kern_return_t result = mach_msg(&(msg.header), + MACH_SEND_MSG | MACH_SEND_TIMEOUT, + msg.header.msgh_size, 0, 0, + MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + + return result == KERN_SUCCESS; +} + +void ExceptionHandler::UpdateNextID() { + next_minidump_path_ = + (MinidumpGenerator::UniqueNameInDirectory(dump_path_, &next_minidump_id_)); + + next_minidump_path_c_ = next_minidump_path_.c_str(); + next_minidump_id_c_ = next_minidump_id_.c_str(); +} + +bool ExceptionHandler::SuspendThreads() { + thread_act_port_array_t threads_for_task; + mach_msg_type_number_t thread_count; + + if (task_threads(mach_task_self(), &threads_for_task, &thread_count)) + return false; + + // suspend all of the threads except for this one + for (unsigned int i = 0; i < thread_count; ++i) { + if (threads_for_task[i] != mach_thread_self()) { + if (thread_suspend(threads_for_task[i])) + return false; + } + } + + return true; +} + +bool ExceptionHandler::ResumeThreads() { + thread_act_port_array_t threads_for_task; + mach_msg_type_number_t thread_count; + + if (task_threads(mach_task_self(), &threads_for_task, &thread_count)) + return false; + + // resume all of the threads except for this one + for (unsigned int i = 0; i < thread_count; ++i) { + if (threads_for_task[i] != mach_thread_self()) { + if (thread_resume(threads_for_task[i])) + return false; + } + } + + return true; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h b/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h new file mode 100644 index 0000000000..f1d9ae92de --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h @@ -0,0 +1,281 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// exception_handler.h: MacOS exception handler +// This class can install a Mach exception port handler to trap most common +// programming errors. If an exception occurs, a minidump file will be +// generated which contains detailed information about the process and the +// exception. + +#ifndef CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__ +#define CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__ + +#include +#include + +#include + +#include "client/mac/handler/ucontext_compat.h" +#include "common/scoped_ptr.h" + +#if !TARGET_OS_IPHONE +#include "client/mac/crash_generation/crash_generation_client.h" +#endif + +namespace google_breakpad { + +using std::string; + +struct ExceptionParameters; + +enum HandlerThreadMessage { + // Message ID telling the handler thread to write a dump. + kWriteDumpMessage = 0, + // Message ID telling the handler thread to write a dump and include + // an exception stream. + kWriteDumpWithExceptionMessage = 1, + // Message ID telling the handler thread to quit. + kShutdownMessage = 2 +}; + +class ExceptionHandler { + public: + // A callback function to run before Breakpad performs any substantial + // processing of an exception. A FilterCallback is called before writing + // a minidump. context is the parameter supplied by the user as + // callback_context when the handler was created. + // + // If a FilterCallback returns true, Breakpad will continue processing, + // attempting to write a minidump. If a FilterCallback returns false, Breakpad + // will immediately report the exception as unhandled without writing a + // minidump, allowing another handler the opportunity to handle it. + typedef bool (*FilterCallback)(void *context); + + // A callback function to run after the minidump has been written. + // |minidump_id| is a unique id for the dump, so the minidump + // file is /.dmp. + // |context| is the value passed into the constructor. + // |succeeded| indicates whether a minidump file was successfully written. + // Return true if the exception was fully handled and breakpad should exit. + // Return false to allow any other exception handlers to process the + // exception. + typedef bool (*MinidumpCallback)(const char *dump_dir, + const char *minidump_id, + void *context, bool succeeded); + + // A callback function which will be called directly if an exception occurs. + // This bypasses the minidump file writing and simply gives the client + // the exception information. + typedef bool (*DirectCallback)( void *context, + int exception_type, + int exception_code, + int exception_subcode, + mach_port_t thread_name); + + // Creates a new ExceptionHandler instance to handle writing minidumps. + // Minidump files will be written to dump_path, and the optional callback + // is called after writing the dump file, as described above. + // If install_handler is true, then a minidump will be written whenever + // an unhandled exception occurs. If it is false, minidumps will only + // be written when WriteMinidump is called. + // If port_name is non-NULL, attempt to perform out-of-process dump generation + // If port_name is NULL, in-process dump generation will be used. + ExceptionHandler(const string &dump_path, + FilterCallback filter, MinidumpCallback callback, + void *callback_context, bool install_handler, + const char *port_name); + + // A special constructor if we want to bypass minidump writing and + // simply get a callback with the exception information. + ExceptionHandler(DirectCallback callback, + void *callback_context, + bool install_handler); + + ~ExceptionHandler(); + + // Get and set the minidump path. + string dump_path() const { return dump_path_; } + void set_dump_path(const string &dump_path) { + dump_path_ = dump_path; + dump_path_c_ = dump_path_.c_str(); + UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_. + } + + // Writes a minidump immediately. This can be used to capture the + // execution state independently of a crash. Returns true on success. + bool WriteMinidump() { + return WriteMinidump(false); + } + + bool WriteMinidump(bool write_exception_stream); + + // Convenience form of WriteMinidump which does not require an + // ExceptionHandler instance. + static bool WriteMinidump(const string &dump_path, MinidumpCallback callback, + void *callback_context) { + return WriteMinidump(dump_path, false, callback, callback_context); + } + + static bool WriteMinidump(const string &dump_path, + bool write_exception_stream, + MinidumpCallback callback, + void *callback_context); + + // Write a minidump of child immediately. This can be used to capture + // the execution state of a child process independently of a crash. + static bool WriteMinidumpForChild(mach_port_t child, + mach_port_t child_blamed_thread, + const std::string &dump_path, + MinidumpCallback callback, + void *callback_context); + + // Returns whether out-of-process dump generation is used or not. + bool IsOutOfProcess() const { +#if TARGET_OS_IPHONE + return false; +#else + return crash_generation_client_.get() != NULL; +#endif + } + + private: + // Install the mach exception handler + bool InstallHandler(); + + // Uninstall the mach exception handler (if any) + bool UninstallHandler(bool in_exception); + + // Setup the handler thread, and if |install_handler| is true, install the + // mach exception port handler + bool Setup(bool install_handler); + + // Uninstall the mach exception handler (if any) and terminate the helper + // thread + bool Teardown(); + + // Send a mach message to the exception handler. Return true on + // success, false otherwise. + bool SendMessageToHandlerThread(HandlerThreadMessage message_id); + + // All minidump writing goes through this one routine. + // |task_context| can be NULL. If not, it will be used to retrieve the + // context of the current thread, instead of using |thread_get_state|. + bool WriteMinidumpWithException(int exception_type, + int exception_code, + int exception_subcode, + breakpad_ucontext_t *task_context, + mach_port_t thread_name, + bool exit_after_write, + bool report_current_thread); + + // When installed, this static function will be call from a newly created + // pthread with |this| as the argument + static void *WaitForMessage(void *exception_handler_class); + + // Signal handler for SIGABRT. + static void SignalHandler(int sig, siginfo_t* info, void* uc); + + // disallow copy ctor and operator= + explicit ExceptionHandler(const ExceptionHandler &); + void operator=(const ExceptionHandler &); + + // Generates a new ID and stores it in next_minidump_id_, and stores the + // path of the next minidump to be written in next_minidump_path_. + void UpdateNextID(); + + // These functions will suspend/resume all threads except for the + // reporting thread + bool SuspendThreads(); + bool ResumeThreads(); + + // The destination directory for the minidump + string dump_path_; + + // The basename of the next minidump w/o extension + string next_minidump_id_; + + // The full path to the next minidump to be written, including extension + string next_minidump_path_; + + // Pointers to the UTF-8 versions of above + const char *dump_path_c_; + const char *next_minidump_id_c_; + const char *next_minidump_path_c_; + + // The callback function and pointer to be passed back after the minidump + // has been written + FilterCallback filter_; + MinidumpCallback callback_; + void *callback_context_; + + // The callback function to be passed back when we don't want a minidump + // file to be written + DirectCallback directCallback_; + + // The thread that is created for the handler + pthread_t handler_thread_; + + // The port that is waiting on an exception message to be sent, if the + // handler is installed + mach_port_t handler_port_; + + // These variables save the previous exception handler's data so that it + // can be re-installed when this handler is uninstalled + ExceptionParameters *previous_; + + // True, if we've installed the exception handler + bool installed_exception_handler_; + + // True, if we're in the process of uninstalling the exception handler and + // the thread. + bool is_in_teardown_; + + // Save the last result of the last minidump + bool last_minidump_write_result_; + + // A mutex for use when writing out a minidump that was requested on a + // thread other than the exception handler. + pthread_mutex_t minidump_write_mutex_; + + // True, if we're using the mutext to indicate when mindump writing occurs + bool use_minidump_write_mutex_; + + // Old signal handler for SIGABRT. Used to be able to restore it when + // uninstalling. + scoped_ptr old_handler_; + +#if !TARGET_OS_IPHONE + // Client for out-of-process dump generation. + scoped_ptr crash_generation_client_; +#endif +}; + +} // namespace google_breakpad + +#endif // CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__ diff --git a/Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h b/Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h new file mode 100644 index 0000000000..c74868198c --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h @@ -0,0 +1,181 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__ +#define CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__ + +#include +#include +#include +#include +#include "common/windows/string_utils-inl.h" +#include "google_breakpad/common/minidump_format.h" + +namespace google_breakpad { + +// Name/value pair for custom client information. +struct CustomInfoEntry { + // Maximum length for name and value for client custom info. + static const int kNameMaxLength = 64; + static const int kValueMaxLength = 64; + + CustomInfoEntry() { + // Putting name and value in initializer list makes VC++ show warning 4351. + set_name(NULL); + set_value(NULL); + } + + CustomInfoEntry(const wchar_t* name_arg, const wchar_t* value_arg) { + set_name(name_arg); + set_value(value_arg); + } + + void set_name(const wchar_t* name_arg) { + if (!name_arg) { + name[0] = L'\0'; + return; + } + WindowsStringUtils::safe_wcscpy(name, kNameMaxLength, name_arg); + } + + void set_value(const wchar_t* value_arg) { + if (!value_arg) { + value[0] = L'\0'; + return; + } + + WindowsStringUtils::safe_wcscpy(value, kValueMaxLength, value_arg); + } + + void set(const wchar_t* name_arg, const wchar_t* value_arg) { + set_name(name_arg); + set_value(value_arg); + } + + wchar_t name[kNameMaxLength]; + wchar_t value[kValueMaxLength]; +}; + +// Constants for the protocol between client and the server. + +// Tags sent with each message indicating the purpose of +// the message. +enum MessageTag { + MESSAGE_TAG_NONE = 0, + MESSAGE_TAG_REGISTRATION_REQUEST = 1, + MESSAGE_TAG_REGISTRATION_RESPONSE = 2, + MESSAGE_TAG_REGISTRATION_ACK = 3, + MESSAGE_TAG_UPLOAD_REQUEST = 4 +}; + +struct CustomClientInfo { + const CustomInfoEntry* entries; + size_t count; +}; + +// Message structure for IPC between crash client and crash server. +struct ProtocolMessage { + ProtocolMessage() + : tag(MESSAGE_TAG_NONE), + id(0), + dump_type(MiniDumpNormal), + thread_id(0), + exception_pointers(NULL), + assert_info(NULL), + custom_client_info(), + dump_request_handle(NULL), + dump_generated_handle(NULL), + server_alive_handle(NULL) { + } + + // Creates an instance with the given parameters. + ProtocolMessage(MessageTag arg_tag, + DWORD arg_id, + MINIDUMP_TYPE arg_dump_type, + DWORD* arg_thread_id, + EXCEPTION_POINTERS** arg_exception_pointers, + MDRawAssertionInfo* arg_assert_info, + const CustomClientInfo& custom_info, + HANDLE arg_dump_request_handle, + HANDLE arg_dump_generated_handle, + HANDLE arg_server_alive) + : tag(arg_tag), + id(arg_id), + dump_type(arg_dump_type), + thread_id(arg_thread_id), + exception_pointers(arg_exception_pointers), + assert_info(arg_assert_info), + custom_client_info(custom_info), + dump_request_handle(arg_dump_request_handle), + dump_generated_handle(arg_dump_generated_handle), + server_alive_handle(arg_server_alive) { + } + + // Tag in the message. + MessageTag tag; + + // The id for this message. This may be either a process id or a crash id + // depending on the type of message. + DWORD id; + + // Dump type requested. + MINIDUMP_TYPE dump_type; + + // Client thread id pointer. + DWORD* thread_id; + + // Exception information. + EXCEPTION_POINTERS** exception_pointers; + + // Assert information in case of an invalid parameter or + // pure call failure. + MDRawAssertionInfo* assert_info; + + // Custom client information. + CustomClientInfo custom_client_info; + + // Handle to signal the crash event. + HANDLE dump_request_handle; + + // Handle to check if server is done generating crash. + HANDLE dump_generated_handle; + + // Handle to a mutex that becomes signaled (WAIT_ABANDONED) + // if server process goes down. + HANDLE server_alive_handle; + + private: + // Disable copy ctor and operator=. + ProtocolMessage(const ProtocolMessage& msg); + ProtocolMessage& operator=(const ProtocolMessage& msg); +}; + +} // namespace google_breakpad + +#endif // CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__ diff --git a/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc b/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc new file mode 100644 index 0000000000..3ba5d4e4fb --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc @@ -0,0 +1,405 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "client/windows/crash_generation/crash_generation_client.h" +#include +#include +#include "client/windows/common/ipc_protocol.h" + +namespace google_breakpad { + +const int kPipeBusyWaitTimeoutMs = 2000; + +#ifdef _DEBUG +const DWORD kWaitForServerTimeoutMs = INFINITE; +#else +const DWORD kWaitForServerTimeoutMs = 15000; +#endif + +const int kPipeConnectMaxAttempts = 2; + +const DWORD kPipeDesiredAccess = FILE_READ_DATA | + FILE_WRITE_DATA | + FILE_WRITE_ATTRIBUTES; + +const DWORD kPipeFlagsAndAttributes = SECURITY_IDENTIFICATION | + SECURITY_SQOS_PRESENT; + +const DWORD kPipeMode = PIPE_READMODE_MESSAGE; + +const size_t kWaitEventCount = 2; + +// This function is orphan for production code. It can be used +// for debugging to help repro some scenarios like the client +// is slow in writing to the pipe after connecting, the client +// is slow in reading from the pipe after writing, etc. The parameter +// overlapped below is not used and it is present to match the signature +// of this function to TransactNamedPipe Win32 API. Uncomment if needed +// for debugging. +/** +static bool TransactNamedPipeDebugHelper(HANDLE pipe, + const void* in_buffer, + DWORD in_size, + void* out_buffer, + DWORD out_size, + DWORD* bytes_count, + LPOVERLAPPED) { + // Uncomment the next sleep to create a gap before writing + // to pipe. + // Sleep(5000); + + if (!WriteFile(pipe, + in_buffer, + in_size, + bytes_count, + NULL)) { + return false; + } + + // Uncomment the next sleep to create a gap between write + // and read. + // Sleep(5000); + + return ReadFile(pipe, out_buffer, out_size, bytes_count, NULL) != FALSE; +} +**/ + +CrashGenerationClient::CrashGenerationClient( + const wchar_t* pipe_name, + MINIDUMP_TYPE dump_type, + const CustomClientInfo* custom_info) + : pipe_name_(pipe_name), + pipe_handle_(NULL), + custom_info_(), + dump_type_(dump_type), + crash_event_(NULL), + crash_generated_(NULL), + server_alive_(NULL), + server_process_id_(0), + thread_id_(0), + exception_pointers_(NULL) { + memset(&assert_info_, 0, sizeof(assert_info_)); + if (custom_info) { + custom_info_ = *custom_info; + } +} + +CrashGenerationClient::CrashGenerationClient( + HANDLE pipe_handle, + MINIDUMP_TYPE dump_type, + const CustomClientInfo* custom_info) + : pipe_name_(), + pipe_handle_(pipe_handle), + custom_info_(), + dump_type_(dump_type), + crash_event_(NULL), + crash_generated_(NULL), + server_alive_(NULL), + server_process_id_(0), + thread_id_(0), + exception_pointers_(NULL) { + memset(&assert_info_, 0, sizeof(assert_info_)); + if (custom_info) { + custom_info_ = *custom_info; + } +} + +CrashGenerationClient::~CrashGenerationClient() { + if (crash_event_) { + CloseHandle(crash_event_); + } + + if (crash_generated_) { + CloseHandle(crash_generated_); + } + + if (server_alive_) { + CloseHandle(server_alive_); + } +} + +// Performs the registration step with the server process. +// The registration step involves communicating with the server +// via a named pipe. The client sends the following pieces of +// data to the server: +// +// * Message tag indicating the client is requesting registration. +// * Process id of the client process. +// * Address of a DWORD variable in the client address space +// that will contain the thread id of the client thread that +// caused the crash. +// * Address of a EXCEPTION_POINTERS* variable in the client +// address space that will point to an instance of EXCEPTION_POINTERS +// when the crash happens. +// * Address of an instance of MDRawAssertionInfo that will contain +// relevant information in case of non-exception crashes like assertion +// failures and pure calls. +// +// In return the client expects the following information from the server: +// +// * Message tag indicating successful registration. +// * Server process id. +// * Handle to an object that client can signal to request dump +// generation from the server. +// * Handle to an object that client can wait on after requesting +// dump generation for the server to finish dump generation. +// * Handle to a mutex object that client can wait on to make sure +// server is still alive. +// +// If any step of the expected behavior mentioned above fails, the +// registration step is not considered successful and hence out-of-process +// dump generation service is not available. +// +// Returns true if the registration is successful; false otherwise. +bool CrashGenerationClient::Register() { + if (IsRegistered()) { + return true; + } + + HANDLE pipe = ConnectToServer(); + if (!pipe) { + return false; + } + + bool success = RegisterClient(pipe); + CloseHandle(pipe); + return success; +} + +bool CrashGenerationClient::RequestUpload(DWORD crash_id) { + HANDLE pipe = ConnectToServer(); + if (!pipe) { + return false; + } + + CustomClientInfo custom_info = {NULL, 0}; + ProtocolMessage msg(MESSAGE_TAG_UPLOAD_REQUEST, crash_id, + static_cast(NULL), NULL, NULL, NULL, + custom_info, NULL, NULL, NULL); + DWORD bytes_count = 0; + bool success = WriteFile(pipe, &msg, sizeof(msg), &bytes_count, NULL) != 0; + + CloseHandle(pipe); + return success; +} + +HANDLE CrashGenerationClient::ConnectToServer() { + HANDLE pipe = ConnectToPipe(pipe_name_.c_str(), + kPipeDesiredAccess, + kPipeFlagsAndAttributes); + if (!pipe) { + return NULL; + } + + DWORD mode = kPipeMode; + if (!SetNamedPipeHandleState(pipe, &mode, NULL, NULL)) { + CloseHandle(pipe); + pipe = NULL; + } + + return pipe; +} + +bool CrashGenerationClient::RegisterClient(HANDLE pipe) { + ProtocolMessage msg(MESSAGE_TAG_REGISTRATION_REQUEST, + GetCurrentProcessId(), + dump_type_, + &thread_id_, + &exception_pointers_, + &assert_info_, + custom_info_, + NULL, + NULL, + NULL); + ProtocolMessage reply; + DWORD bytes_count = 0; + // The call to TransactNamedPipe below can be changed to a call + // to TransactNamedPipeDebugHelper to help repro some scenarios. + // For details see comments for TransactNamedPipeDebugHelper. + if (!TransactNamedPipe(pipe, + &msg, + sizeof(msg), + &reply, + sizeof(ProtocolMessage), + &bytes_count, + NULL)) { + return false; + } + + if (!ValidateResponse(reply)) { + return false; + } + + ProtocolMessage ack_msg; + ack_msg.tag = MESSAGE_TAG_REGISTRATION_ACK; + + if (!WriteFile(pipe, &ack_msg, sizeof(ack_msg), &bytes_count, NULL)) { + return false; + } + crash_event_ = reply.dump_request_handle; + crash_generated_ = reply.dump_generated_handle; + server_alive_ = reply.server_alive_handle; + server_process_id_ = reply.id; + + return true; +} + +HANDLE CrashGenerationClient::ConnectToPipe(const wchar_t* pipe_name, + DWORD pipe_access, + DWORD flags_attrs) { + if (pipe_handle_) { + HANDLE t = pipe_handle_; + pipe_handle_ = NULL; + return t; + } + + for (int i = 0; i < kPipeConnectMaxAttempts; ++i) { + HANDLE pipe = CreateFile(pipe_name, + pipe_access, + 0, + NULL, + OPEN_EXISTING, + flags_attrs, + NULL); + if (pipe != INVALID_HANDLE_VALUE) { + return pipe; + } + + // Cannot continue retrying if error is something other than + // ERROR_PIPE_BUSY. + if (GetLastError() != ERROR_PIPE_BUSY) { + break; + } + + // Cannot continue retrying if wait on pipe fails. + if (!WaitNamedPipe(pipe_name, kPipeBusyWaitTimeoutMs)) { + break; + } + } + + return NULL; +} + +bool CrashGenerationClient::ValidateResponse( + const ProtocolMessage& msg) const { + return (msg.tag == MESSAGE_TAG_REGISTRATION_RESPONSE) && + (msg.id != 0) && + (msg.dump_request_handle != NULL) && + (msg.dump_generated_handle != NULL) && + (msg.server_alive_handle != NULL); +} + +bool CrashGenerationClient::IsRegistered() const { + return crash_event_ != NULL; +} + +bool CrashGenerationClient::RequestDump(EXCEPTION_POINTERS* ex_info, + MDRawAssertionInfo* assert_info) { + if (!IsRegistered()) { + return false; + } + + exception_pointers_ = ex_info; + thread_id_ = GetCurrentThreadId(); + + if (assert_info) { + memcpy(&assert_info_, assert_info, sizeof(assert_info_)); + } else { + memset(&assert_info_, 0, sizeof(assert_info_)); + } + + return SignalCrashEventAndWait(); +} + +bool CrashGenerationClient::RequestDump(EXCEPTION_POINTERS* ex_info) { + return RequestDump(ex_info, NULL); +} + +bool CrashGenerationClient::RequestDump(MDRawAssertionInfo* assert_info) { + return RequestDump(NULL, assert_info); +} + +bool CrashGenerationClient::SignalCrashEventAndWait() { + assert(crash_event_); + assert(crash_generated_); + assert(server_alive_); + + // Reset the dump generated event before signaling the crash + // event so that the server can set the dump generated event + // once it is done generating the event. + if (!ResetEvent(crash_generated_)) { + return false; + } + + if (!SetEvent(crash_event_)) { + return false; + } + + HANDLE wait_handles[kWaitEventCount] = {crash_generated_, server_alive_}; + + DWORD result = WaitForMultipleObjects(kWaitEventCount, + wait_handles, + FALSE, + kWaitForServerTimeoutMs); + + // Crash dump was successfully generated only if the server + // signaled the crash generated event. + return result == WAIT_OBJECT_0; +} + +HANDLE CrashGenerationClient::DuplicatePipeToClientProcess(const wchar_t* pipe_name, + HANDLE hProcess) { + for (int i = 0; i < kPipeConnectMaxAttempts; ++i) { + HANDLE local_pipe = CreateFile(pipe_name, kPipeDesiredAccess, + 0, NULL, OPEN_EXISTING, + kPipeFlagsAndAttributes, NULL); + if (local_pipe != INVALID_HANDLE_VALUE) { + HANDLE remotePipe = INVALID_HANDLE_VALUE; + if (DuplicateHandle(GetCurrentProcess(), local_pipe, + hProcess, &remotePipe, 0, FALSE, + DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { + return remotePipe; + } else { + return INVALID_HANDLE_VALUE; + } + } + + // Cannot continue retrying if the error wasn't a busy pipe. + if (GetLastError() != ERROR_PIPE_BUSY) { + return INVALID_HANDLE_VALUE; + } + + if (!WaitNamedPipe(pipe_name, kPipeBusyWaitTimeoutMs)) { + return INVALID_HANDLE_VALUE; + } + } + return INVALID_HANDLE_VALUE; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h b/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h new file mode 100644 index 0000000000..457f731957 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h @@ -0,0 +1,182 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ +#define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ + +#include +#include +#include +#include +#include "client/windows/common/ipc_protocol.h" +#include "common/scoped_ptr.h" + +namespace google_breakpad { + +struct CustomClientInfo; + +// Abstraction of client-side implementation of out of process +// crash generation. +// +// The process that desires to have out-of-process crash dump +// generation service can use this class in the following way: +// +// * Create an instance. +// * Call Register method so that the client tries to register +// with the server process and check the return value. If +// registration is not successful, out-of-process crash dump +// generation will not be available +// * Request dump generation by calling either of the two +// overloaded RequestDump methods - one in case of exceptions +// and the other in case of assertion failures +// +// Note that it is the responsibility of the client code of +// this class to set the unhandled exception filter with the +// system by calling the SetUnhandledExceptionFilter function +// and the client code should explicitly request dump generation. +class CrashGenerationClient { + public: + CrashGenerationClient(const wchar_t* pipe_name, + MINIDUMP_TYPE dump_type, + const CustomClientInfo* custom_info); + + CrashGenerationClient(HANDLE pipe_handle, + MINIDUMP_TYPE dump_type, + const CustomClientInfo* custom_info); + + ~CrashGenerationClient(); + + // Registers the client process with the crash server. + // + // Returns true if the registration is successful; false otherwise. + bool Register(); + + // Requests the crash server to upload a previous dump with the + // given crash id. + bool RequestUpload(DWORD crash_id); + + bool RequestDump(EXCEPTION_POINTERS* ex_info, + MDRawAssertionInfo* assert_info); + + // Requests the crash server to generate a dump with the given + // exception information. + // + // Returns true if the dump was successful; false otherwise. Note that + // if the registration step was not performed or it was not successful, + // false will be returned. + bool RequestDump(EXCEPTION_POINTERS* ex_info); + + // Requests the crash server to generate a dump with the given + // assertion information. + // + // Returns true if the dump was successful; false otherwise. Note that + // if the registration step was not performed or it was not successful, + // false will be returned. + bool RequestDump(MDRawAssertionInfo* assert_info); + + // If the crash generation client is running in a sandbox that prevents it + // from opening the named pipe directly, the server process may open the + // handle and duplicate it into the client process with this helper method. + // Returns INVALID_HANDLE_VALUE on failure. The process must have been opened + // with the PROCESS_DUP_HANDLE access right. + static HANDLE DuplicatePipeToClientProcess(const wchar_t* pipe_name, + HANDLE hProcess); + + private: + // Connects to the appropriate pipe and sets the pipe handle state. + // + // Returns the pipe handle if everything goes well; otherwise Returns NULL. + HANDLE ConnectToServer(); + + // Performs a handshake with the server over the given pipe which should be + // already connected to the server. + // + // Returns true if handshake with the server was successful; false otherwise. + bool RegisterClient(HANDLE pipe); + + // Validates the given server response. + bool ValidateResponse(const ProtocolMessage& msg) const; + + // Returns true if the registration step succeeded; false otherwise. + bool IsRegistered() const; + + // Connects to the given named pipe with given parameters. + // + // Returns true if the connection is successful; false otherwise. + HANDLE ConnectToPipe(const wchar_t* pipe_name, + DWORD pipe_access, + DWORD flags_attrs); + + // Signals the crash event and wait for the server to generate crash. + bool SignalCrashEventAndWait(); + + // Pipe name to use to talk to server. + std::wstring pipe_name_; + + // Pipe handle duplicated from server process. Only valid before + // Register is called. + HANDLE pipe_handle_; + + // Custom client information + CustomClientInfo custom_info_; + + // Type of dump to generate. + MINIDUMP_TYPE dump_type_; + + // Event to signal in case of a crash. + HANDLE crash_event_; + + // Handle to wait on after signaling a crash for the server + // to finish generating crash dump. + HANDLE crash_generated_; + + // Handle to a mutex that will become signaled with WAIT_ABANDONED + // if the server process goes down. + HANDLE server_alive_; + + // Server process id. + DWORD server_process_id_; + + // Id of the thread that caused the crash. + DWORD thread_id_; + + // Exception pointers for an exception crash. + EXCEPTION_POINTERS* exception_pointers_; + + // Assertion info for an invalid parameter or pure call crash. + MDRawAssertionInfo assert_info_; + + // Disable copy ctor and operator=. + CrashGenerationClient(const CrashGenerationClient& crash_client); + CrashGenerationClient& operator=(const CrashGenerationClient& crash_client); +}; + +} // namespace google_breakpad + +#endif // CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc b/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc new file mode 100644 index 0000000000..b78075dec5 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc @@ -0,0 +1,1073 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include +#include +#include + +#include "common/windows/string_utils-inl.h" + +#include "client/windows/common/ipc_protocol.h" +#include "client/windows/handler/exception_handler.h" +#include "common/windows/guid_string.h" + +namespace google_breakpad { + +static const int kWaitForHandlerThreadMs = 60000; +static const int kExceptionHandlerThreadInitialStackSize = 64 * 1024; + +// As documented on MSDN, on failure SuspendThread returns (DWORD) -1 +static const DWORD kFailedToSuspendThread = static_cast(-1); + +// This is passed as the context to the MinidumpWriteDump callback. +typedef struct { + AppMemoryList::const_iterator iter; + AppMemoryList::const_iterator end; +} MinidumpCallbackContext; + +vector* ExceptionHandler::handler_stack_ = NULL; +LONG ExceptionHandler::handler_stack_index_ = 0; +CRITICAL_SECTION ExceptionHandler::handler_stack_critical_section_; +volatile LONG ExceptionHandler::instance_count_ = 0; + +ExceptionHandler::ExceptionHandler(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + MINIDUMP_TYPE dump_type, + const wchar_t* pipe_name, + const CustomClientInfo* custom_info) { + Initialize(dump_path, + filter, + callback, + callback_context, + handler_types, + dump_type, + pipe_name, + NULL, // pipe_handle + NULL, // crash_generation_client + custom_info); +} + +ExceptionHandler::ExceptionHandler(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + MINIDUMP_TYPE dump_type, + HANDLE pipe_handle, + const CustomClientInfo* custom_info) { + Initialize(dump_path, + filter, + callback, + callback_context, + handler_types, + dump_type, + NULL, // pipe_name + pipe_handle, + NULL, // crash_generation_client + custom_info); +} + +ExceptionHandler::ExceptionHandler( + const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + CrashGenerationClient* crash_generation_client) { + // The dump_type, pipe_name and custom_info that are passed in to Initialize() + // are not used. The ones set in crash_generation_client are used instead. + Initialize(dump_path, + filter, + callback, + callback_context, + handler_types, + MiniDumpNormal, // dump_type - not used + NULL, // pipe_name - not used + NULL, // pipe_handle + crash_generation_client, + NULL); // custom_info - not used +} + +ExceptionHandler::ExceptionHandler(const wstring &dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types) { + Initialize(dump_path, + filter, + callback, + callback_context, + handler_types, + MiniDumpNormal, + NULL, // pipe_name + NULL, // pipe_handle + NULL, // crash_generation_client + NULL); // custom_info +} + +void ExceptionHandler::Initialize( + const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + MINIDUMP_TYPE dump_type, + const wchar_t* pipe_name, + HANDLE pipe_handle, + CrashGenerationClient* crash_generation_client, + const CustomClientInfo* custom_info) { + LONG instance_count = InterlockedIncrement(&instance_count_); + filter_ = filter; + callback_ = callback; + callback_context_ = callback_context; + dump_path_c_ = NULL; + next_minidump_id_c_ = NULL; + next_minidump_path_c_ = NULL; + dbghelp_module_ = NULL; + minidump_write_dump_ = NULL; + dump_type_ = dump_type; + rpcrt4_module_ = NULL; + uuid_create_ = NULL; + handler_types_ = handler_types; + previous_filter_ = NULL; +#if _MSC_VER >= 1400 // MSVC 2005/8 + previous_iph_ = NULL; +#endif // _MSC_VER >= 1400 + previous_pch_ = NULL; + handler_thread_ = NULL; + is_shutdown_ = false; + handler_start_semaphore_ = NULL; + handler_finish_semaphore_ = NULL; + requesting_thread_id_ = 0; + exception_info_ = NULL; + assertion_ = NULL; + handler_return_value_ = false; + handle_debug_exceptions_ = false; + consume_invalid_handle_exceptions_ = false; + + // Attempt to use out-of-process if user has specified a pipe or a + // crash generation client. + scoped_ptr client; + if (crash_generation_client) { + client.reset(crash_generation_client); + } else if (pipe_name) { + client.reset( + new CrashGenerationClient(pipe_name, dump_type_, custom_info)); + } else if (pipe_handle) { + client.reset( + new CrashGenerationClient(pipe_handle, dump_type_, custom_info)); + } + + if (client.get() != NULL) { + // If successful in registering with the monitoring process, + // there is no need to setup in-process crash generation. + if (client->Register()) { + crash_generation_client_.reset(client.release()); + } + } + + if (!IsOutOfProcess()) { + // Either client did not ask for out-of-process crash generation + // or registration with the server process failed. In either case, + // setup to do in-process crash generation. + + // Set synchronization primitives and the handler thread. Each + // ExceptionHandler object gets its own handler thread because that's the + // only way to reliably guarantee sufficient stack space in an exception, + // and it allows an easy way to get a snapshot of the requesting thread's + // context outside of an exception. + InitializeCriticalSection(&handler_critical_section_); + handler_start_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL); + assert(handler_start_semaphore_ != NULL); + + handler_finish_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL); + assert(handler_finish_semaphore_ != NULL); + + // Don't attempt to create the thread if we could not create the semaphores. + if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) { + DWORD thread_id; + handler_thread_ = CreateThread(NULL, // lpThreadAttributes + kExceptionHandlerThreadInitialStackSize, + ExceptionHandlerThreadMain, + this, // lpParameter + 0, // dwCreationFlags + &thread_id); + assert(handler_thread_ != NULL); + } + + dbghelp_module_ = LoadLibrary(L"dbghelp.dll"); + if (dbghelp_module_) { + minidump_write_dump_ = reinterpret_cast( + GetProcAddress(dbghelp_module_, "MiniDumpWriteDump")); + } + + // Load this library dynamically to not affect existing projects. Most + // projects don't link against this directly, it's usually dynamically + // loaded by dependent code. + rpcrt4_module_ = LoadLibrary(L"rpcrt4.dll"); + if (rpcrt4_module_) { + uuid_create_ = reinterpret_cast( + GetProcAddress(rpcrt4_module_, "UuidCreate")); + } + + // set_dump_path calls UpdateNextID. This sets up all of the path and id + // strings, and their equivalent c_str pointers. + set_dump_path(dump_path); + } + + // Reserve one element for the instruction memory + AppMemory instruction_memory; + instruction_memory.ptr = NULL; + instruction_memory.length = 0; + app_memory_info_.push_back(instruction_memory); + + // There is a race condition here. If the first instance has not yet + // initialized the critical section, the second (and later) instances may + // try to use uninitialized critical section object. The feature of multiple + // instances in one module is not used much, so leave it as is for now. + // One way to solve this in the current design (that is, keeping the static + // handler stack) is to use spin locks with volatile bools to synchronize + // the handler stack. This works only if the compiler guarantees to generate + // cache coherent code for volatile. + // TODO(munjal): Fix this in a better way by changing the design if possible. + + // Lazy initialization of the handler_stack_critical_section_ + if (instance_count == 1) { + InitializeCriticalSection(&handler_stack_critical_section_); + } + + if (handler_types != HANDLER_NONE) { + EnterCriticalSection(&handler_stack_critical_section_); + + // The first time an ExceptionHandler that installs a handler is + // created, set up the handler stack. + if (!handler_stack_) { + handler_stack_ = new vector(); + } + handler_stack_->push_back(this); + + if (handler_types & HANDLER_EXCEPTION) + previous_filter_ = SetUnhandledExceptionFilter(HandleException); + +#if _MSC_VER >= 1400 // MSVC 2005/8 + if (handler_types & HANDLER_INVALID_PARAMETER) + previous_iph_ = _set_invalid_parameter_handler(HandleInvalidParameter); +#endif // _MSC_VER >= 1400 + + if (handler_types & HANDLER_PURECALL) + previous_pch_ = _set_purecall_handler(HandlePureVirtualCall); + + LeaveCriticalSection(&handler_stack_critical_section_); + } +} + +ExceptionHandler::~ExceptionHandler() { + if (dbghelp_module_) { + FreeLibrary(dbghelp_module_); + } + + if (rpcrt4_module_) { + FreeLibrary(rpcrt4_module_); + } + + if (handler_types_ != HANDLER_NONE) { + EnterCriticalSection(&handler_stack_critical_section_); + + if (handler_types_ & HANDLER_EXCEPTION) + SetUnhandledExceptionFilter(previous_filter_); + +#if _MSC_VER >= 1400 // MSVC 2005/8 + if (handler_types_ & HANDLER_INVALID_PARAMETER) + _set_invalid_parameter_handler(previous_iph_); +#endif // _MSC_VER >= 1400 + + if (handler_types_ & HANDLER_PURECALL) + _set_purecall_handler(previous_pch_); + + if (handler_stack_->back() == this) { + handler_stack_->pop_back(); + } else { + // TODO(mmentovai): use advapi32!ReportEvent to log the warning to the + // system's application event log. + fprintf(stderr, "warning: removing Breakpad handler out of order\n"); + vector::iterator iterator = handler_stack_->begin(); + while (iterator != handler_stack_->end()) { + if (*iterator == this) { + iterator = handler_stack_->erase(iterator); + } else { + ++iterator; + } + } + } + + if (handler_stack_->empty()) { + // When destroying the last ExceptionHandler that installed a handler, + // clean up the handler stack. + delete handler_stack_; + handler_stack_ = NULL; + } + + LeaveCriticalSection(&handler_stack_critical_section_); + } + + // Some of the objects were only initialized if out of process + // registration was not done. + if (!IsOutOfProcess()) { +#ifdef BREAKPAD_NO_TERMINATE_THREAD + // Clean up the handler thread and synchronization primitives. The handler + // thread is either waiting on the semaphore to handle a crash or it is + // handling a crash. Coming out of the wait is fast but wait more in the + // eventuality a crash is handled. This compilation option results in a + // deadlock if the exception handler is destroyed while executing code + // inside DllMain. + is_shutdown_ = true; + ReleaseSemaphore(handler_start_semaphore_, 1, NULL); + WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs); +#else + TerminateThread(handler_thread_, 1); +#endif // BREAKPAD_NO_TERMINATE_THREAD + + CloseHandle(handler_thread_); + handler_thread_ = NULL; + DeleteCriticalSection(&handler_critical_section_); + CloseHandle(handler_start_semaphore_); + CloseHandle(handler_finish_semaphore_); + } + + // There is a race condition in the code below: if this instance is + // deleting the static critical section and a new instance of the class + // is created, then there is a possibility that the critical section be + // initialized while the same critical section is being deleted. Given the + // usage pattern for the code, this race condition is unlikely to hit, but it + // is a race condition nonetheless. + if (InterlockedDecrement(&instance_count_) == 0) { + DeleteCriticalSection(&handler_stack_critical_section_); + } +} + +bool ExceptionHandler::RequestUpload(DWORD crash_id) { + return crash_generation_client_->RequestUpload(crash_id); +} + +// static +DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) { + ExceptionHandler* self = reinterpret_cast(lpParameter); + assert(self); + assert(self->handler_start_semaphore_ != NULL); + assert(self->handler_finish_semaphore_ != NULL); + + while (true) { + if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) == + WAIT_OBJECT_0) { + // Perform the requested action. + if (self->is_shutdown_) { + // The instance of the exception handler is being destroyed. + break; + } else { + self->handler_return_value_ = + self->WriteMinidumpWithException(self->requesting_thread_id_, + self->exception_info_, + self->assertion_); + } + + // Allow the requesting thread to proceed. + ReleaseSemaphore(self->handler_finish_semaphore_, 1, NULL); + } + } + + // This statement is not reached when the thread is unconditionally + // terminated by the ExceptionHandler destructor. + return 0; +} + +// HandleException and HandleInvalidParameter must create an +// AutoExceptionHandler object to maintain static state and to determine which +// ExceptionHandler instance to use. The constructor locates the correct +// instance, and makes it available through get_handler(). The destructor +// restores the state in effect prior to allocating the AutoExceptionHandler. +class AutoExceptionHandler { + public: + AutoExceptionHandler() { + // Increment handler_stack_index_ so that if another Breakpad handler is + // registered using this same HandleException function, and it needs to be + // called while this handler is running (either because this handler + // declines to handle the exception, or an exception occurs during + // handling), HandleException will find the appropriate ExceptionHandler + // object in handler_stack_ to deliver the exception to. + // + // Because handler_stack_ is addressed in reverse (as |size - index|), + // preincrementing handler_stack_index_ avoids needing to subtract 1 from + // the argument to |at|. + // + // The index is maintained instead of popping elements off of the handler + // stack and pushing them at the end of this method. This avoids ruining + // the order of elements in the stack in the event that some other thread + // decides to manipulate the handler stack (such as creating a new + // ExceptionHandler object) while an exception is being handled. + EnterCriticalSection(&ExceptionHandler::handler_stack_critical_section_); + handler_ = ExceptionHandler::handler_stack_->at( + ExceptionHandler::handler_stack_->size() - + ++ExceptionHandler::handler_stack_index_); + + // In case another exception occurs while this handler is doing its thing, + // it should be delivered to the previous filter. + SetUnhandledExceptionFilter(handler_->previous_filter_); +#if _MSC_VER >= 1400 // MSVC 2005/8 + _set_invalid_parameter_handler(handler_->previous_iph_); +#endif // _MSC_VER >= 1400 + _set_purecall_handler(handler_->previous_pch_); + } + + ~AutoExceptionHandler() { + // Put things back the way they were before entering this handler. + SetUnhandledExceptionFilter(ExceptionHandler::HandleException); +#if _MSC_VER >= 1400 // MSVC 2005/8 + _set_invalid_parameter_handler(ExceptionHandler::HandleInvalidParameter); +#endif // _MSC_VER >= 1400 + _set_purecall_handler(ExceptionHandler::HandlePureVirtualCall); + + --ExceptionHandler::handler_stack_index_; + LeaveCriticalSection(&ExceptionHandler::handler_stack_critical_section_); + } + + ExceptionHandler* get_handler() const { return handler_; } + + private: + ExceptionHandler* handler_; +}; + +// static +LONG ExceptionHandler::HandleException(EXCEPTION_POINTERS* exinfo) { + AutoExceptionHandler auto_exception_handler; + ExceptionHandler* current_handler = auto_exception_handler.get_handler(); + + // Ignore EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP exceptions. This + // logic will short-circuit before calling WriteMinidumpOnHandlerThread, + // allowing something else to handle the breakpoint without incurring the + // overhead transitioning to and from the handler thread. This behavior + // can be overridden by calling ExceptionHandler::set_handle_debug_exceptions. + DWORD code = exinfo->ExceptionRecord->ExceptionCode; + LONG action; + bool is_debug_exception = (code == EXCEPTION_BREAKPOINT) || + (code == EXCEPTION_SINGLE_STEP); + + if (code == EXCEPTION_INVALID_HANDLE && + current_handler->consume_invalid_handle_exceptions_) { + return EXCEPTION_CONTINUE_EXECUTION; + } + + bool success = false; + + if (!is_debug_exception || + current_handler->get_handle_debug_exceptions()) { + // If out-of-proc crash handler client is available, we have to use that + // to generate dump and we cannot fall back on in-proc dump generation + // because we never prepared for an in-proc dump generation + + // In case of out-of-process dump generation, directly call + // WriteMinidumpWithException since there is no separate thread running. + if (current_handler->IsOutOfProcess()) { + success = current_handler->WriteMinidumpWithException( + GetCurrentThreadId(), + exinfo, + NULL); + } else { + success = current_handler->WriteMinidumpOnHandlerThread(exinfo, NULL); + } + } + + // The handler fully handled the exception. Returning + // EXCEPTION_EXECUTE_HANDLER indicates this to the system, and usually + // results in the application being terminated. + // + // Note: If the application was launched from within the Cygwin + // environment, returning EXCEPTION_EXECUTE_HANDLER seems to cause the + // application to be restarted. + if (success) { + action = EXCEPTION_EXECUTE_HANDLER; + } else { + // There was an exception, it was a breakpoint or something else ignored + // above, or it was passed to the handler, which decided not to handle it. + // This could be because the filter callback didn't want it, because + // minidump writing failed for some reason, or because the post-minidump + // callback function indicated failure. Give the previous handler a + // chance to do something with the exception. If there is no previous + // handler, return EXCEPTION_CONTINUE_SEARCH, which will allow a debugger + // or native "crashed" dialog to handle the exception. + if (current_handler->previous_filter_) { + action = current_handler->previous_filter_(exinfo); + } else { + action = EXCEPTION_CONTINUE_SEARCH; + } + } + + return action; +} + +#if _MSC_VER >= 1400 // MSVC 2005/8 +// static +void ExceptionHandler::HandleInvalidParameter(const wchar_t* expression, + const wchar_t* function, + const wchar_t* file, + unsigned int line, + uintptr_t reserved) { + // This is an invalid parameter, not an exception. It's safe to play with + // sprintf here. + AutoExceptionHandler auto_exception_handler; + ExceptionHandler* current_handler = auto_exception_handler.get_handler(); + + MDRawAssertionInfo assertion; + memset(&assertion, 0, sizeof(assertion)); + _snwprintf_s(reinterpret_cast(assertion.expression), + sizeof(assertion.expression) / sizeof(assertion.expression[0]), + _TRUNCATE, L"%s", expression); + _snwprintf_s(reinterpret_cast(assertion.function), + sizeof(assertion.function) / sizeof(assertion.function[0]), + _TRUNCATE, L"%s", function); + _snwprintf_s(reinterpret_cast(assertion.file), + sizeof(assertion.file) / sizeof(assertion.file[0]), + _TRUNCATE, L"%s", file); + assertion.line = line; + assertion.type = MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER; + + // Make up an exception record for the current thread and CPU context + // to make it possible for the crash processor to classify these + // as do regular crashes, and to make it humane for developers to + // analyze them. + EXCEPTION_RECORD exception_record = {}; + CONTEXT exception_context = {}; + EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context }; + + ::RtlCaptureContext(&exception_context); + + exception_record.ExceptionCode = STATUS_INVALID_PARAMETER; + + // We store pointers to the the expression and function strings, + // and the line as exception parameters to make them easy to + // access by the developer on the far side. + exception_record.NumberParameters = 3; + exception_record.ExceptionInformation[0] = + reinterpret_cast(&assertion.expression); + exception_record.ExceptionInformation[1] = + reinterpret_cast(&assertion.file); + exception_record.ExceptionInformation[2] = assertion.line; + + bool success = false; + // In case of out-of-process dump generation, directly call + // WriteMinidumpWithException since there is no separate thread running. + if (current_handler->IsOutOfProcess()) { + success = current_handler->WriteMinidumpWithException( + GetCurrentThreadId(), + &exception_ptrs, + &assertion); + } else { + success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs, + &assertion); + } + + if (!success) { + if (current_handler->previous_iph_) { + // The handler didn't fully handle the exception. Give it to the + // previous invalid parameter handler. + current_handler->previous_iph_(expression, + function, + file, + line, + reserved); + } else { + // If there's no previous handler, pass the exception back in to the + // invalid parameter handler's core. That's the routine that called this + // function, but now, since this function is no longer registered (and in + // fact, no function at all is registered), this will result in the + // default code path being taken: _CRT_DEBUGGER_HOOK and _invoke_watson. + // Use _invalid_parameter where it exists (in _DEBUG builds) as it passes + // more information through. In non-debug builds, it is not available, + // so fall back to using _invalid_parameter_noinfo. See invarg.c in the + // CRT source. +#ifdef _DEBUG + _invalid_parameter(expression, function, file, line, reserved); +#else // _DEBUG + _invalid_parameter_noinfo(); +#endif // _DEBUG + } + } + + // The handler either took care of the invalid parameter problem itself, + // or passed it on to another handler. "Swallow" it by exiting, paralleling + // the behavior of "swallowing" exceptions. + exit(0); +} +#endif // _MSC_VER >= 1400 + +// static +void ExceptionHandler::HandlePureVirtualCall() { + // This is an pure virtual function call, not an exception. It's safe to + // play with sprintf here. + AutoExceptionHandler auto_exception_handler; + ExceptionHandler* current_handler = auto_exception_handler.get_handler(); + + MDRawAssertionInfo assertion; + memset(&assertion, 0, sizeof(assertion)); + assertion.type = MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL; + + // Make up an exception record for the current thread and CPU context + // to make it possible for the crash processor to classify these + // as do regular crashes, and to make it humane for developers to + // analyze them. + EXCEPTION_RECORD exception_record = {}; + CONTEXT exception_context = {}; + EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context }; + + ::RtlCaptureContext(&exception_context); + + exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION; + + // We store pointers to the the expression and function strings, + // and the line as exception parameters to make them easy to + // access by the developer on the far side. + exception_record.NumberParameters = 3; + exception_record.ExceptionInformation[0] = + reinterpret_cast(&assertion.expression); + exception_record.ExceptionInformation[1] = + reinterpret_cast(&assertion.file); + exception_record.ExceptionInformation[2] = assertion.line; + + bool success = false; + // In case of out-of-process dump generation, directly call + // WriteMinidumpWithException since there is no separate thread running. + + if (current_handler->IsOutOfProcess()) { + success = current_handler->WriteMinidumpWithException( + GetCurrentThreadId(), + &exception_ptrs, + &assertion); + } else { + success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs, + &assertion); + } + + if (!success) { + if (current_handler->previous_pch_) { + // The handler didn't fully handle the exception. Give it to the + // previous purecall handler. + current_handler->previous_pch_(); + } else { + // If there's no previous handler, return and let _purecall handle it. + // This will just put up an assertion dialog. + return; + } + } + + // The handler either took care of the invalid parameter problem itself, + // or passed it on to another handler. "Swallow" it by exiting, paralleling + // the behavior of "swallowing" exceptions. + exit(0); +} + +bool ExceptionHandler::WriteMinidumpOnHandlerThread( + EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion) { + EnterCriticalSection(&handler_critical_section_); + + // There isn't much we can do if the handler thread + // was not successfully created. + if (handler_thread_ == NULL) { + LeaveCriticalSection(&handler_critical_section_); + return false; + } + + // The handler thread should only be created when the semaphores are valid. + assert(handler_start_semaphore_ != NULL); + assert(handler_finish_semaphore_ != NULL); + + // Set up data to be passed in to the handler thread. + requesting_thread_id_ = GetCurrentThreadId(); + exception_info_ = exinfo; + assertion_ = assertion; + + // This causes the handler thread to call WriteMinidumpWithException. + ReleaseSemaphore(handler_start_semaphore_, 1, NULL); + + // Wait until WriteMinidumpWithException is done and collect its return value. + WaitForSingleObject(handler_finish_semaphore_, INFINITE); + bool status = handler_return_value_; + + // Clean up. + requesting_thread_id_ = 0; + exception_info_ = NULL; + assertion_ = NULL; + + LeaveCriticalSection(&handler_critical_section_); + + return status; +} + +bool ExceptionHandler::WriteMinidump() { + // Make up an exception record for the current thread and CPU context + // to make it possible for the crash processor to classify these + // as do regular crashes, and to make it humane for developers to + // analyze them. + EXCEPTION_RECORD exception_record = {}; + CONTEXT exception_context = {}; + EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context }; + + ::RtlCaptureContext(&exception_context); + exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION; + + return WriteMinidumpForException(&exception_ptrs); +} + +bool ExceptionHandler::WriteMinidumpForException(EXCEPTION_POINTERS* exinfo) { + // In case of out-of-process dump generation, directly call + // WriteMinidumpWithException since there is no separate thread running. + if (IsOutOfProcess()) { + return WriteMinidumpWithException(GetCurrentThreadId(), + exinfo, + NULL); + } + + bool success = WriteMinidumpOnHandlerThread(exinfo, NULL); + UpdateNextID(); + return success; +} + +// static +bool ExceptionHandler::WriteMinidump(const wstring &dump_path, + MinidumpCallback callback, + void* callback_context) { + ExceptionHandler handler(dump_path, NULL, callback, callback_context, + HANDLER_NONE); + return handler.WriteMinidump(); +} + +// static +bool ExceptionHandler::WriteMinidumpForChild(HANDLE child, + DWORD child_blamed_thread, + const wstring& dump_path, + MinidumpCallback callback, + void* callback_context) { + EXCEPTION_RECORD ex; + CONTEXT ctx; + EXCEPTION_POINTERS exinfo = { NULL, NULL }; + DWORD last_suspend_count = kFailedToSuspendThread; + HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT | + THREAD_QUERY_INFORMATION | + THREAD_SUSPEND_RESUME, + FALSE, + child_blamed_thread); + // This thread may have died already, so not opening the handle is a + // non-fatal error. + if (child_thread_handle != NULL) { + last_suspend_count = SuspendThread(child_thread_handle); + if (last_suspend_count != kFailedToSuspendThread) { + ctx.ContextFlags = CONTEXT_ALL; + if (GetThreadContext(child_thread_handle, &ctx)) { + memset(&ex, 0, sizeof(ex)); + ex.ExceptionCode = EXCEPTION_BREAKPOINT; +#if defined(_M_IX86) + ex.ExceptionAddress = reinterpret_cast(ctx.Eip); +#elif defined(_M_X64) + ex.ExceptionAddress = reinterpret_cast(ctx.Rip); +#endif + exinfo.ExceptionRecord = &ex; + exinfo.ContextRecord = &ctx; + } + } + } + + ExceptionHandler handler(dump_path, NULL, callback, callback_context, + HANDLER_NONE); + bool success = handler.WriteMinidumpWithExceptionForProcess( + child_blamed_thread, + exinfo.ExceptionRecord ? &exinfo : NULL, + NULL, child, false); + + if (last_suspend_count != kFailedToSuspendThread) { + ResumeThread(child_thread_handle); + } + + CloseHandle(child_thread_handle); + + if (callback) { + success = callback(handler.dump_path_c_, handler.next_minidump_id_c_, + callback_context, NULL, NULL, success); + } + + return success; +} + +bool ExceptionHandler::WriteMinidumpWithException( + DWORD requesting_thread_id, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion) { + // Give user code a chance to approve or prevent writing a minidump. If the + // filter returns false, don't handle the exception at all. If this method + // was called as a result of an exception, returning false will cause + // HandleException to call any previous handler or return + // EXCEPTION_CONTINUE_SEARCH on the exception thread, allowing it to appear + // as though this handler were not present at all. + if (filter_ && !filter_(callback_context_, exinfo, assertion)) { + return false; + } + + bool success = false; + if (IsOutOfProcess()) { + success = crash_generation_client_->RequestDump(exinfo, assertion); + } else { + success = WriteMinidumpWithExceptionForProcess(requesting_thread_id, + exinfo, + assertion, + GetCurrentProcess(), + true); + } + + if (callback_) { + // TODO(munjal): In case of out-of-process dump generation, both + // dump_path_c_ and next_minidump_id_ will be NULL. For out-of-process + // scenario, the server process ends up creating the dump path and dump + // id so they are not known to the client. + success = callback_(dump_path_c_, next_minidump_id_c_, callback_context_, + exinfo, assertion, success); + } + + return success; +} + +// static +BOOL CALLBACK ExceptionHandler::MinidumpWriteDumpCallback( + PVOID context, + const PMINIDUMP_CALLBACK_INPUT callback_input, + PMINIDUMP_CALLBACK_OUTPUT callback_output) { + switch (callback_input->CallbackType) { + case MemoryCallback: { + MinidumpCallbackContext* callback_context = + reinterpret_cast(context); + if (callback_context->iter == callback_context->end) + return FALSE; + + // Include the specified memory region. + callback_output->MemoryBase = callback_context->iter->ptr; + callback_output->MemorySize = callback_context->iter->length; + callback_context->iter++; + return TRUE; + } + + // Include all modules. + case IncludeModuleCallback: + case ModuleCallback: + return TRUE; + + // Include all threads. + case IncludeThreadCallback: + case ThreadCallback: + return TRUE; + + // Stop receiving cancel callbacks. + case CancelCallback: + callback_output->CheckCancel = FALSE; + callback_output->Cancel = FALSE; + return TRUE; + } + // Ignore other callback types. + return FALSE; +} + +bool ExceptionHandler::WriteMinidumpWithExceptionForProcess( + DWORD requesting_thread_id, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + HANDLE process, + bool write_requester_stream) { + bool success = false; + if (minidump_write_dump_) { + HANDLE dump_file = CreateFile(next_minidump_path_c_, + GENERIC_WRITE, + 0, // no sharing + NULL, + CREATE_NEW, // fail if exists + FILE_ATTRIBUTE_NORMAL, + NULL); + if (dump_file != INVALID_HANDLE_VALUE) { + MINIDUMP_EXCEPTION_INFORMATION except_info; + except_info.ThreadId = requesting_thread_id; + except_info.ExceptionPointers = exinfo; + except_info.ClientPointers = FALSE; + + // Leave room in user_stream_array for possible breakpad and + // assertion info streams. + MINIDUMP_USER_STREAM user_stream_array[2]; + MINIDUMP_USER_STREAM_INFORMATION user_streams; + user_streams.UserStreamCount = 0; + user_streams.UserStreamArray = user_stream_array; + + if (write_requester_stream) { + // Add an MDRawBreakpadInfo stream to the minidump, to provide + // additional information about the exception handler to the Breakpad + // processor. The information will help the processor determine which + // threads are relevant. The Breakpad processor does not require this + // information but can function better with Breakpad-generated dumps + // when it is present. The native debugger is not harmed by the + // presence of this information. + MDRawBreakpadInfo breakpad_info; + breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID | + MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID; + breakpad_info.dump_thread_id = GetCurrentThreadId(); + breakpad_info.requesting_thread_id = requesting_thread_id; + + int index = user_streams.UserStreamCount; + user_stream_array[index].Type = MD_BREAKPAD_INFO_STREAM; + user_stream_array[index].BufferSize = sizeof(breakpad_info); + user_stream_array[index].Buffer = &breakpad_info; + ++user_streams.UserStreamCount; + } + + if (assertion) { + int index = user_streams.UserStreamCount; + user_stream_array[index].Type = MD_ASSERTION_INFO_STREAM; + user_stream_array[index].BufferSize = sizeof(MDRawAssertionInfo); + user_stream_array[index].Buffer = assertion; + ++user_streams.UserStreamCount; + } + + // Older versions of DbgHelp.dll don't correctly put the memory around + // the faulting instruction pointer into the minidump. This + // callback will ensure that it gets included. + if (exinfo) { + // Find a memory region of 256 bytes centered on the + // faulting instruction pointer. + const ULONG64 instruction_pointer = +#if defined(_M_IX86) + exinfo->ContextRecord->Eip; +#elif defined(_M_AMD64) + exinfo->ContextRecord->Rip; +#else +#error Unsupported platform +#endif + + MEMORY_BASIC_INFORMATION info; + if (VirtualQueryEx(process, + reinterpret_cast(instruction_pointer), + &info, + sizeof(MEMORY_BASIC_INFORMATION)) != 0 && + info.State == MEM_COMMIT) { + // Attempt to get 128 bytes before and after the instruction + // pointer, but settle for whatever's available up to the + // boundaries of the memory region. + const ULONG64 kIPMemorySize = 256; + ULONG64 base = + (std::max)(reinterpret_cast(info.BaseAddress), + instruction_pointer - (kIPMemorySize / 2)); + ULONG64 end_of_range = + (std::min)(instruction_pointer + (kIPMemorySize / 2), + reinterpret_cast(info.BaseAddress) + + info.RegionSize); + ULONG size = static_cast(end_of_range - base); + + AppMemory& elt = app_memory_info_.front(); + elt.ptr = base; + elt.length = size; + } + } + + MinidumpCallbackContext context; + context.iter = app_memory_info_.begin(); + context.end = app_memory_info_.end(); + + // Skip the reserved element if there was no instruction memory + if (context.iter->ptr == 0) { + context.iter++; + } + + MINIDUMP_CALLBACK_INFORMATION callback; + callback.CallbackRoutine = MinidumpWriteDumpCallback; + callback.CallbackParam = reinterpret_cast(&context); + + // The explicit comparison to TRUE avoids a warning (C4800). + success = (minidump_write_dump_(process, + GetProcessId(process), + dump_file, + dump_type_, + exinfo ? &except_info : NULL, + &user_streams, + &callback) == TRUE); + + CloseHandle(dump_file); + } + } + + return success; +} + +void ExceptionHandler::UpdateNextID() { + assert(uuid_create_); + UUID id = {0}; + if (uuid_create_) { + uuid_create_(&id); + } + next_minidump_id_ = GUIDString::GUIDToWString(&id); + next_minidump_id_c_ = next_minidump_id_.c_str(); + + wchar_t minidump_path[MAX_PATH]; + swprintf(minidump_path, MAX_PATH, L"%s\\%s.dmp", + dump_path_c_, next_minidump_id_c_); + + // remove when VC++7.1 is no longer supported + minidump_path[MAX_PATH - 1] = L'\0'; + + next_minidump_path_ = minidump_path; + next_minidump_path_c_ = next_minidump_path_.c_str(); +} + +void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) { + AppMemoryList::iterator iter = + std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr); + if (iter != app_memory_info_.end()) { + // Don't allow registering the same pointer twice. + return; + } + + AppMemory app_memory; + app_memory.ptr = reinterpret_cast(ptr); + app_memory.length = static_cast(length); + app_memory_info_.push_back(app_memory); +} + +void ExceptionHandler::UnregisterAppMemory(void* ptr) { + AppMemoryList::iterator iter = + std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr); + if (iter != app_memory_info_.end()) { + app_memory_info_.erase(iter); + } +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h b/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h new file mode 100644 index 0000000000..e3cd8146b3 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h @@ -0,0 +1,522 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// ExceptionHandler can write a minidump file when an exception occurs, +// or when WriteMinidump() is called explicitly by your program. +// +// To have the exception handler write minidumps when an uncaught exception +// (crash) occurs, you should create an instance early in the execution +// of your program, and keep it around for the entire time you want to +// have crash handling active (typically, until shutdown). +// +// If you want to write minidumps without installing the exception handler, +// you can create an ExceptionHandler with install_handler set to false, +// then call WriteMinidump. You can also use this technique if you want to +// use different minidump callbacks for different call sites. +// +// In either case, a callback function is called when a minidump is written, +// which receives the unqiue id of the minidump. The caller can use this +// id to collect and write additional application state, and to launch an +// external crash-reporting application. +// +// It is important that creation and destruction of ExceptionHandler objects +// be nested cleanly, when using install_handler = true. +// Avoid the following pattern: +// ExceptionHandler *e = new ExceptionHandler(...); +// ExceptionHandler *f = new ExceptionHandler(...); +// delete e; +// This will put the exception filter stack into an inconsistent state. + +#ifndef CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__ +#define CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__ + +#include +#include +#include +#include + +#pragma warning(push) +// Disable exception handler warnings. +#pragma warning(disable:4530) + +#include +#include +#include + +#include "client/windows/common/ipc_protocol.h" +#include "client/windows/crash_generation/crash_generation_client.h" +#include "common/scoped_ptr.h" +#include "google_breakpad/common/minidump_format.h" + +namespace google_breakpad { + +using std::vector; +using std::wstring; + +// These entries store a list of memory regions that the client wants included +// in the minidump. +struct AppMemory { + ULONG64 ptr; + ULONG length; + + bool operator==(const struct AppMemory& other) const { + return ptr == other.ptr; + } + + bool operator==(const void* other) const { + return ptr == reinterpret_cast(other); + } +}; +typedef std::list AppMemoryList; + +class ExceptionHandler { + public: + // A callback function to run before Breakpad performs any substantial + // processing of an exception. A FilterCallback is called before writing + // a minidump. context is the parameter supplied by the user as + // callback_context when the handler was created. exinfo points to the + // exception record, if any; assertion points to assertion information, + // if any. + // + // If a FilterCallback returns true, Breakpad will continue processing, + // attempting to write a minidump. If a FilterCallback returns false, + // Breakpad will immediately report the exception as unhandled without + // writing a minidump, allowing another handler the opportunity to handle it. + typedef bool (*FilterCallback)(void* context, EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion); + + // A callback function to run after the minidump has been written. + // minidump_id is a unique id for the dump, so the minidump + // file is \.dmp. context is the parameter supplied + // by the user as callback_context when the handler was created. exinfo + // points to the exception record, or NULL if no exception occurred. + // succeeded indicates whether a minidump file was successfully written. + // assertion points to information about an assertion if the handler was + // invoked by an assertion. + // + // If an exception occurred and the callback returns true, Breakpad will treat + // the exception as fully-handled, suppressing any other handlers from being + // notified of the exception. If the callback returns false, Breakpad will + // treat the exception as unhandled, and allow another handler to handle it. + // If there are no other handlers, Breakpad will report the exception to the + // system as unhandled, allowing a debugger or native crash dialog the + // opportunity to handle the exception. Most callback implementations + // should normally return the value of |succeeded|, or when they wish to + // not report an exception of handled, false. Callbacks will rarely want to + // return true directly (unless |succeeded| is true). + // + // For out-of-process dump generation, dump path and minidump ID will always + // be NULL. In case of out-of-process dump generation, the dump path and + // minidump id are controlled by the server process and are not communicated + // back to the crashing process. + typedef bool (*MinidumpCallback)(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded); + + // HandlerType specifies which types of handlers should be installed, if + // any. Use HANDLER_NONE for an ExceptionHandler that remains idle, + // without catching any failures on its own. This type of handler may + // still be triggered by calling WriteMinidump. Otherwise, use a + // combination of the other HANDLER_ values, or HANDLER_ALL to install + // all handlers. + enum HandlerType { + HANDLER_NONE = 0, + HANDLER_EXCEPTION = 1 << 0, // SetUnhandledExceptionFilter + HANDLER_INVALID_PARAMETER = 1 << 1, // _set_invalid_parameter_handler + HANDLER_PURECALL = 1 << 2, // _set_purecall_handler + HANDLER_ALL = HANDLER_EXCEPTION | + HANDLER_INVALID_PARAMETER | + HANDLER_PURECALL + }; + + // Creates a new ExceptionHandler instance to handle writing minidumps. + // Before writing a minidump, the optional filter callback will be called. + // Its return value determines whether or not Breakpad should write a + // minidump. Minidump files will be written to dump_path, and the optional + // callback is called after writing the dump file, as described above. + // handler_types specifies the types of handlers that should be installed. + ExceptionHandler(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types); + + // Creates a new ExceptionHandler instance that can attempt to perform + // out-of-process dump generation if pipe_name is not NULL. If pipe_name is + // NULL, or if out-of-process dump generation registration step fails, + // in-process dump generation will be used. This also allows specifying + // the dump type to generate. + ExceptionHandler(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + MINIDUMP_TYPE dump_type, + const wchar_t* pipe_name, + const CustomClientInfo* custom_info); + + // As above, creates a new ExceptionHandler instance to perform + // out-of-process dump generation if the given pipe_handle is not NULL. + ExceptionHandler(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + MINIDUMP_TYPE dump_type, + HANDLE pipe_handle, + const CustomClientInfo* custom_info); + + // ExceptionHandler that ENSURES out-of-process dump generation. Expects a + // crash generation client that is already registered with a crash generation + // server. Takes ownership of the passed-in crash_generation_client. + // + // Usage example: + // crash_generation_client = new CrashGenerationClient(..); + // if (crash_generation_client->Register()) { + // // Registration with the crash generation server succeeded. + // // Out-of-process dump generation is guaranteed. + // g_handler = new ExceptionHandler(.., crash_generation_client, ..); + // return true; + // } + ExceptionHandler(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + CrashGenerationClient* crash_generation_client); + + ~ExceptionHandler(); + + // Get and set the minidump path. + wstring dump_path() const { return dump_path_; } + void set_dump_path(const wstring &dump_path) { + dump_path_ = dump_path; + dump_path_c_ = dump_path_.c_str(); + UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_. + } + + // Requests that a previously reported crash be uploaded. + bool RequestUpload(DWORD crash_id); + + // Writes a minidump immediately. This can be used to capture the + // execution state independently of a crash. Returns true on success. + bool WriteMinidump(); + + // Writes a minidump immediately, with the user-supplied exception + // information. + bool WriteMinidumpForException(EXCEPTION_POINTERS* exinfo); + + // Convenience form of WriteMinidump which does not require an + // ExceptionHandler instance. + static bool WriteMinidump(const wstring &dump_path, + MinidumpCallback callback, void* callback_context); + + // Write a minidump of |child| immediately. This can be used to + // capture the execution state of |child| independently of a crash. + // Pass a meaningful |child_blamed_thread| to make that thread in + // the child process the one from which a crash signature is + // extracted. + static bool WriteMinidumpForChild(HANDLE child, + DWORD child_blamed_thread, + const wstring& dump_path, + MinidumpCallback callback, + void* callback_context); + + // Get the thread ID of the thread requesting the dump (either the exception + // thread or any other thread that called WriteMinidump directly). This + // may be useful if you want to include additional thread state in your + // dumps. + DWORD get_requesting_thread_id() const { return requesting_thread_id_; } + + // Controls behavior of EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP. + bool get_handle_debug_exceptions() const { return handle_debug_exceptions_; } + void set_handle_debug_exceptions(bool handle_debug_exceptions) { + handle_debug_exceptions_ = handle_debug_exceptions; + } + + // Controls behavior of EXCEPTION_INVALID_HANDLE. + bool get_consume_invalid_handle_exceptions() const { + return consume_invalid_handle_exceptions_; + } + void set_consume_invalid_handle_exceptions( + bool consume_invalid_handle_exceptions) { + consume_invalid_handle_exceptions_ = consume_invalid_handle_exceptions; + } + + // Returns whether out-of-process dump generation is used or not. + bool IsOutOfProcess() const { return crash_generation_client_.get() != NULL; } + + // Calling RegisterAppMemory(p, len) causes len bytes starting + // at address p to be copied to the minidump when a crash happens. + void RegisterAppMemory(void* ptr, size_t length); + void UnregisterAppMemory(void* ptr); + + private: + friend class AutoExceptionHandler; + + // Initializes the instance with given values. + void Initialize(const wstring& dump_path, + FilterCallback filter, + MinidumpCallback callback, + void* callback_context, + int handler_types, + MINIDUMP_TYPE dump_type, + const wchar_t* pipe_name, + HANDLE pipe_handle, + CrashGenerationClient* crash_generation_client, + const CustomClientInfo* custom_info); + + // Function pointer type for MiniDumpWriteDump, which is looked up + // dynamically. + typedef BOOL (WINAPI *MiniDumpWriteDump_type)( + HANDLE hProcess, + DWORD dwPid, + HANDLE hFile, + MINIDUMP_TYPE DumpType, + CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, + CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, + CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam); + + // Function pointer type for UuidCreate, which is looked up dynamically. + typedef RPC_STATUS (RPC_ENTRY *UuidCreate_type)(UUID* Uuid); + + // Runs the main loop for the exception handler thread. + static DWORD WINAPI ExceptionHandlerThreadMain(void* lpParameter); + + // Called on the exception thread when an unhandled exception occurs. + // Signals the exception handler thread to handle the exception. + static LONG WINAPI HandleException(EXCEPTION_POINTERS* exinfo); + +#if _MSC_VER >= 1400 // MSVC 2005/8 + // This function will be called by some CRT functions when they detect + // that they were passed an invalid parameter. Note that in _DEBUG builds, + // the CRT may display an assertion dialog before calling this function, + // and the function will not be called unless the assertion dialog is + // dismissed by clicking "Ignore." + static void HandleInvalidParameter(const wchar_t* expression, + const wchar_t* function, + const wchar_t* file, + unsigned int line, + uintptr_t reserved); +#endif // _MSC_VER >= 1400 + + // This function will be called by the CRT when a pure virtual + // function is called. + static void HandlePureVirtualCall(); + + // This is called on the exception thread or on another thread that + // the user wishes to produce a dump from. It calls + // WriteMinidumpWithException on the handler thread, avoiding stack + // overflows and inconsistent dumps due to writing the dump from + // the exception thread. If the dump is requested as a result of an + // exception, exinfo contains exception information, otherwise, it + // is NULL. If the dump is requested as a result of an assertion + // (such as an invalid parameter being passed to a CRT function), + // assertion contains data about the assertion, otherwise, it is NULL. + bool WriteMinidumpOnHandlerThread(EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion); + + // This function is called on the handler thread. It calls into + // WriteMinidumpWithExceptionForProcess() with a handle to the + // current process. requesting_thread_id is the ID of the thread + // that requested the dump. If the dump is requested as a result of + // an exception, exinfo contains exception information, otherwise, + // it is NULL. + bool WriteMinidumpWithException(DWORD requesting_thread_id, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion); + + // This function is used as a callback when calling MinidumpWriteDump, + // in order to add additional memory regions to the dump. + static BOOL CALLBACK MinidumpWriteDumpCallback( + PVOID context, + const PMINIDUMP_CALLBACK_INPUT callback_input, + PMINIDUMP_CALLBACK_OUTPUT callback_output); + + // This function does the actual writing of a minidump. It is + // called on the handler thread. requesting_thread_id is the ID of + // the thread that requested the dump, if that information is + // meaningful. If the dump is requested as a result of an + // exception, exinfo contains exception information, otherwise, it + // is NULL. process is the one that will be dumped. If + // requesting_thread_id is meaningful and should be added to the + // minidump, write_requester_stream is |true|. + bool WriteMinidumpWithExceptionForProcess(DWORD requesting_thread_id, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + HANDLE process, + bool write_requester_stream); + + // Generates a new ID and stores it in next_minidump_id_, and stores the + // path of the next minidump to be written in next_minidump_path_. + void UpdateNextID(); + + FilterCallback filter_; + MinidumpCallback callback_; + void* callback_context_; + + scoped_ptr crash_generation_client_; + + // The directory in which a minidump will be written, set by the dump_path + // argument to the constructor, or set_dump_path. + wstring dump_path_; + + // The basename of the next minidump to be written, without the extension. + wstring next_minidump_id_; + + // The full pathname of the next minidump to be written, including the file + // extension. + wstring next_minidump_path_; + + // Pointers to C-string representations of the above. These are set when + // the above wstring versions are set in order to avoid calling c_str during + // an exception, as c_str may attempt to allocate heap memory. These + // pointers are not owned by the ExceptionHandler object, but their lifetimes + // should be equivalent to the lifetimes of the associated wstring, provided + // that the wstrings are not altered. + const wchar_t* dump_path_c_; + const wchar_t* next_minidump_id_c_; + const wchar_t* next_minidump_path_c_; + + HMODULE dbghelp_module_; + MiniDumpWriteDump_type minidump_write_dump_; + MINIDUMP_TYPE dump_type_; + + HMODULE rpcrt4_module_; + UuidCreate_type uuid_create_; + + // Tracks the handler types that were installed according to the + // handler_types constructor argument. + int handler_types_; + + // When installed_handler_ is true, previous_filter_ is the unhandled + // exception filter that was set prior to installing ExceptionHandler as + // the unhandled exception filter and pointing it to |this|. NULL indicates + // that there is no previous unhandled exception filter. + LPTOP_LEVEL_EXCEPTION_FILTER previous_filter_; + +#if _MSC_VER >= 1400 // MSVC 2005/8 + // Beginning in VC 8, the CRT provides an invalid parameter handler that will + // be called when some CRT functions are passed invalid parameters. In + // earlier CRTs, the same conditions would cause unexpected behavior or + // crashes. + _invalid_parameter_handler previous_iph_; +#endif // _MSC_VER >= 1400 + + // The CRT allows you to override the default handler for pure + // virtual function calls. + _purecall_handler previous_pch_; + + // The exception handler thread. + HANDLE handler_thread_; + + // True if the exception handler is being destroyed. + // Starting with MSVC 2005, Visual C has stronger guarantees on volatile vars. + // It has release semantics on write and acquire semantics on reads. + // See the msdn documentation. + volatile bool is_shutdown_; + + // The critical section enforcing the requirement that only one exception be + // handled by a handler at a time. + CRITICAL_SECTION handler_critical_section_; + + // Semaphores used to move exception handling between the exception thread + // and the handler thread. handler_start_semaphore_ is signalled by the + // exception thread to wake up the handler thread when an exception occurs. + // handler_finish_semaphore_ is signalled by the handler thread to wake up + // the exception thread when handling is complete. + HANDLE handler_start_semaphore_; + HANDLE handler_finish_semaphore_; + + // The next 2 fields contain data passed from the requesting thread to + // the handler thread. + + // The thread ID of the thread requesting the dump (either the exception + // thread or any other thread that called WriteMinidump directly). + DWORD requesting_thread_id_; + + // The exception info passed to the exception handler on the exception + // thread, if an exception occurred. NULL for user-requested dumps. + EXCEPTION_POINTERS* exception_info_; + + // If the handler is invoked due to an assertion, this will contain a + // pointer to the assertion information. It is NULL at other times. + MDRawAssertionInfo* assertion_; + + // The return value of the handler, passed from the handler thread back to + // the requesting thread. + bool handler_return_value_; + + // If true, the handler will intercept EXCEPTION_BREAKPOINT and + // EXCEPTION_SINGLE_STEP exceptions. Leave this false (the default) + // to not interfere with debuggers. + bool handle_debug_exceptions_; + + // If true, the handler will consume any EXCEPTION_INVALID_HANDLE exceptions. + // Leave this false (the default) to handle these exceptions as normal. + bool consume_invalid_handle_exceptions_; + + // Callers can request additional memory regions to be included in + // the dump. + AppMemoryList app_memory_info_; + + // A stack of ExceptionHandler objects that have installed unhandled + // exception filters. This vector is used by HandleException to determine + // which ExceptionHandler object to route an exception to. When an + // ExceptionHandler is created with install_handler true, it will append + // itself to this list. + static vector* handler_stack_; + + // The index of the ExceptionHandler in handler_stack_ that will handle the + // next exception. Note that 0 means the last entry in handler_stack_, 1 + // means the next-to-last entry, and so on. This is used by HandleException + // to support multiple stacked Breakpad handlers. + static LONG handler_stack_index_; + + // handler_stack_critical_section_ guards operations on handler_stack_ and + // handler_stack_index_. The critical section is initialized by the + // first instance of the class and destroyed by the last instance of it. + static CRITICAL_SECTION handler_stack_critical_section_; + + // The number of instances of this class. + static volatile LONG instance_count_; + + // disallow copy ctor and operator= + explicit ExceptionHandler(const ExceptionHandler &); + void operator=(const ExceptionHandler &); +}; + +} // namespace google_breakpad + +#pragma warning(pop) + +#endif // CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__ diff --git a/Telegram/ThirdParty/breakpad/common/scoped_ptr.h b/Telegram/ThirdParty/breakpad/common/scoped_ptr.h new file mode 100644 index 0000000000..d137c18681 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/scoped_ptr.h @@ -0,0 +1,404 @@ +// Copyright 2013 Google Inc. All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Scopers help you manage ownership of a pointer, helping you easily manage the +// a pointer within a scope, and automatically destroying the pointer at the +// end of a scope. There are two main classes you will use, which correspond +// to the operators new/delete and new[]/delete[]. +// +// Example usage (scoped_ptr): +// { +// scoped_ptr foo(new Foo("wee")); +// } // foo goes out of scope, releasing the pointer with it. +// +// { +// scoped_ptr foo; // No pointer managed. +// foo.reset(new Foo("wee")); // Now a pointer is managed. +// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed. +// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed. +// foo->Method(); // Foo::Method() called. +// foo.get()->Method(); // Foo::Method() called. +// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer +// // manages a pointer. +// foo.reset(new Foo("wee4")); // foo manages a pointer again. +// foo.reset(); // Foo("wee4") destroyed, foo no longer +// // manages a pointer. +// } // foo wasn't managing a pointer, so nothing was destroyed. +// +// Example usage (scoped_array): +// { +// scoped_array foo(new Foo[100]); +// foo.get()->Method(); // Foo::Method on the 0th element. +// foo[10].Method(); // Foo::Method on the 10th element. +// } + +#ifndef COMMON_SCOPED_PTR_H_ +#define COMMON_SCOPED_PTR_H_ + +// This is an implementation designed to match the anticipated future TR2 +// implementation of the scoped_ptr class, and its closely-related brethren, +// scoped_array, scoped_ptr_malloc. + +#include +#include +#include + +namespace google_breakpad { + +// A scoped_ptr is like a T*, except that the destructor of scoped_ptr +// automatically deletes the pointer it holds (if any). +// That is, scoped_ptr owns the T object that it points to. +// Like a T*, a scoped_ptr may hold either NULL or a pointer to a T object. +// Also like T*, scoped_ptr is thread-compatible, and once you +// dereference it, you get the threadsafety guarantees of T. +// +// The size of a scoped_ptr is small: +// sizeof(scoped_ptr) == sizeof(C*) +template +class scoped_ptr { + public: + + // The element type + typedef C element_type; + + // Constructor. Defaults to initializing with NULL. + // There is no way to create an uninitialized scoped_ptr. + // The input parameter must be allocated with new. + explicit scoped_ptr(C* p = NULL) : ptr_(p) { } + + // Destructor. If there is a C object, delete it. + // We don't need to test ptr_ == NULL because C++ does that for us. + ~scoped_ptr() { + enum { type_must_be_complete = sizeof(C) }; + delete ptr_; + } + + // Reset. Deletes the current owned object, if any. + // Then takes ownership of a new object, if given. + // this->reset(this->get()) works. + void reset(C* p = NULL) { + if (p != ptr_) { + enum { type_must_be_complete = sizeof(C) }; + delete ptr_; + ptr_ = p; + } + } + + // Accessors to get the owned object. + // operator* and operator-> will assert() if there is no current object. + C& operator*() const { + assert(ptr_ != NULL); + return *ptr_; + } + C* operator->() const { + assert(ptr_ != NULL); + return ptr_; + } + C* get() const { return ptr_; } + + // Comparison operators. + // These return whether two scoped_ptr refer to the same object, not just to + // two different but equal objects. + bool operator==(C* p) const { return ptr_ == p; } + bool operator!=(C* p) const { return ptr_ != p; } + + // Swap two scoped pointers. + void swap(scoped_ptr& p2) { + C* tmp = ptr_; + ptr_ = p2.ptr_; + p2.ptr_ = tmp; + } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + C* release() { + C* retVal = ptr_; + ptr_ = NULL; + return retVal; + } + + private: + C* ptr_; + + // Forbid comparison of scoped_ptr types. If C2 != C, it totally doesn't + // make sense, and if C2 == C, it still doesn't make sense because you should + // never have the same object owned by two different scoped_ptrs. + template bool operator==(scoped_ptr const& p2) const; + template bool operator!=(scoped_ptr const& p2) const; + + // Disallow evil constructors + scoped_ptr(const scoped_ptr&); + void operator=(const scoped_ptr&); +}; + +// Free functions +template +void swap(scoped_ptr& p1, scoped_ptr& p2) { + p1.swap(p2); +} + +template +bool operator==(C* p1, const scoped_ptr& p2) { + return p1 == p2.get(); +} + +template +bool operator!=(C* p1, const scoped_ptr& p2) { + return p1 != p2.get(); +} + +// scoped_array is like scoped_ptr, except that the caller must allocate +// with new [] and the destructor deletes objects with delete []. +// +// As with scoped_ptr, a scoped_array either points to an object +// or is NULL. A scoped_array owns the object that it points to. +// scoped_array is thread-compatible, and once you index into it, +// the returned objects have only the threadsafety guarantees of T. +// +// Size: sizeof(scoped_array) == sizeof(C*) +template +class scoped_array { + public: + + // The element type + typedef C element_type; + + // Constructor. Defaults to intializing with NULL. + // There is no way to create an uninitialized scoped_array. + // The input parameter must be allocated with new []. + explicit scoped_array(C* p = NULL) : array_(p) { } + + // Destructor. If there is a C object, delete it. + // We don't need to test ptr_ == NULL because C++ does that for us. + ~scoped_array() { + enum { type_must_be_complete = sizeof(C) }; + delete[] array_; + } + + // Reset. Deletes the current owned object, if any. + // Then takes ownership of a new object, if given. + // this->reset(this->get()) works. + void reset(C* p = NULL) { + if (p != array_) { + enum { type_must_be_complete = sizeof(C) }; + delete[] array_; + array_ = p; + } + } + + // Get one element of the current object. + // Will assert() if there is no current object, or index i is negative. + C& operator[](ptrdiff_t i) const { + assert(i >= 0); + assert(array_ != NULL); + return array_[i]; + } + + // Get a pointer to the zeroth element of the current object. + // If there is no current object, return NULL. + C* get() const { + return array_; + } + + // Comparison operators. + // These return whether two scoped_array refer to the same object, not just to + // two different but equal objects. + bool operator==(C* p) const { return array_ == p; } + bool operator!=(C* p) const { return array_ != p; } + + // Swap two scoped arrays. + void swap(scoped_array& p2) { + C* tmp = array_; + array_ = p2.array_; + p2.array_ = tmp; + } + + // Release an array. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + C* release() { + C* retVal = array_; + array_ = NULL; + return retVal; + } + + private: + C* array_; + + // Forbid comparison of different scoped_array types. + template bool operator==(scoped_array const& p2) const; + template bool operator!=(scoped_array const& p2) const; + + // Disallow evil constructors + scoped_array(const scoped_array&); + void operator=(const scoped_array&); +}; + +// Free functions +template +void swap(scoped_array& p1, scoped_array& p2) { + p1.swap(p2); +} + +template +bool operator==(C* p1, const scoped_array& p2) { + return p1 == p2.get(); +} + +template +bool operator!=(C* p1, const scoped_array& p2) { + return p1 != p2.get(); +} + +// This class wraps the c library function free() in a class that can be +// passed as a template argument to scoped_ptr_malloc below. +class ScopedPtrMallocFree { + public: + inline void operator()(void* x) const { + free(x); + } +}; + +// scoped_ptr_malloc<> is similar to scoped_ptr<>, but it accepts a +// second template argument, the functor used to free the object. + +template +class scoped_ptr_malloc { + public: + + // The element type + typedef C element_type; + + // Constructor. Defaults to initializing with NULL. + // There is no way to create an uninitialized scoped_ptr. + // The input parameter must be allocated with an allocator that matches the + // Free functor. For the default Free functor, this is malloc, calloc, or + // realloc. + explicit scoped_ptr_malloc(C* p = NULL): ptr_(p) {} + + // Destructor. If there is a C object, call the Free functor. + ~scoped_ptr_malloc() { + reset(); + } + + // Reset. Calls the Free functor on the current owned object, if any. + // Then takes ownership of a new object, if given. + // this->reset(this->get()) works. + void reset(C* p = NULL) { + if (ptr_ != p) { + FreeProc free_proc; + free_proc(ptr_); + ptr_ = p; + } + } + + // Get the current object. + // operator* and operator-> will cause an assert() failure if there is + // no current object. + C& operator*() const { + assert(ptr_ != NULL); + return *ptr_; + } + + C* operator->() const { + assert(ptr_ != NULL); + return ptr_; + } + + C* get() const { + return ptr_; + } + + // Comparison operators. + // These return whether a scoped_ptr_malloc and a plain pointer refer + // to the same object, not just to two different but equal objects. + // For compatibility with the boost-derived implementation, these + // take non-const arguments. + bool operator==(C* p) const { + return ptr_ == p; + } + + bool operator!=(C* p) const { + return ptr_ != p; + } + + // Swap two scoped pointers. + void swap(scoped_ptr_malloc & b) { + C* tmp = b.ptr_; + b.ptr_ = ptr_; + ptr_ = tmp; + } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + C* release() { + C* tmp = ptr_; + ptr_ = NULL; + return tmp; + } + + private: + C* ptr_; + + // no reason to use these: each scoped_ptr_malloc should have its own object + template + bool operator==(scoped_ptr_malloc const& p) const; + template + bool operator!=(scoped_ptr_malloc const& p) const; + + // Disallow evil constructors + scoped_ptr_malloc(const scoped_ptr_malloc&); + void operator=(const scoped_ptr_malloc&); +}; + +template inline +void swap(scoped_ptr_malloc& a, scoped_ptr_malloc& b) { + a.swap(b); +} + +template inline +bool operator==(C* p, const scoped_ptr_malloc& b) { + return p == b.get(); +} + +template inline +bool operator!=(C* p, const scoped_ptr_malloc& b) { + return p != b.get(); +} + +} // namespace google_breakpad + +#endif // COMMON_SCOPED_PTR_H_ diff --git a/Telegram/ThirdParty/breakpad/common/windows/guid_string.cc b/Telegram/ThirdParty/breakpad/common/windows/guid_string.cc new file mode 100644 index 0000000000..b7f877e66e --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/windows/guid_string.cc @@ -0,0 +1,76 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// guid_string.cc: Convert GUIDs to strings. +// +// See guid_string.h for documentation. + +#include + +#include "common/windows/string_utils-inl.h" + +#include "common/windows/guid_string.h" + +namespace google_breakpad { + +// static +wstring GUIDString::GUIDToWString(GUID *guid) { + wchar_t guid_string[37]; + swprintf( + guid_string, sizeof(guid_string) / sizeof(guid_string[0]), + L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + guid->Data1, guid->Data2, guid->Data3, + guid->Data4[0], guid->Data4[1], guid->Data4[2], + guid->Data4[3], guid->Data4[4], guid->Data4[5], + guid->Data4[6], guid->Data4[7]); + + // remove when VC++7.1 is no longer supported + guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0'; + + return wstring(guid_string); +} + +// static +wstring GUIDString::GUIDToSymbolServerWString(GUID *guid) { + wchar_t guid_string[33]; + swprintf( + guid_string, sizeof(guid_string) / sizeof(guid_string[0]), + L"%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X", + guid->Data1, guid->Data2, guid->Data3, + guid->Data4[0], guid->Data4[1], guid->Data4[2], + guid->Data4[3], guid->Data4[4], guid->Data4[5], + guid->Data4[6], guid->Data4[7]); + + // remove when VC++7.1 is no longer supported + guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0'; + + return wstring(guid_string); +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/windows/guid_string.h b/Telegram/ThirdParty/breakpad/common/windows/guid_string.h new file mode 100644 index 0000000000..48a5c1d370 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/windows/guid_string.h @@ -0,0 +1,58 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// guid_string.cc: Convert GUIDs to strings. + +#ifndef COMMON_WINDOWS_GUID_STRING_H_ +#define COMMON_WINDOWS_GUID_STRING_H_ + +#include + +#include + +namespace google_breakpad { + +using std::wstring; + +class GUIDString { + public: + // Converts guid to a string in the format recommended by RFC 4122 and + // returns the string. + static wstring GUIDToWString(GUID *guid); + + // Converts guid to a string formatted as uppercase hexadecimal, with + // no separators, and returns the string. This is the format used for + // symbol server identifiers, although identifiers have an age tacked + // on to the string. + static wstring GUIDToSymbolServerWString(GUID *guid); +}; + +} // namespace google_breakpad + +#endif // COMMON_WINDOWS_GUID_STRING_H_ diff --git a/Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h b/Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h new file mode 100644 index 0000000000..9b63607268 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h @@ -0,0 +1,142 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// string_utils-inl.h: Safer string manipulation on Windows, supporting +// pre-MSVC8 environments. + +#ifndef COMMON_WINDOWS_STRING_UTILS_INL_H_ +#define COMMON_WINDOWS_STRING_UTILS_INL_H_ + +#include +#include + +#include + +// The "ll" printf format size specifier corresponding to |long long| was +// intrudced in MSVC8. Earlier versions did not provide this size specifier, +// but "I64" can be used to print 64-bit types. Don't use "I64" where "ll" +// is available, in the event of oddball systems where |long long| is not +// 64 bits wide. +#if _MSC_VER >= 1400 // MSVC 2005/8 +#define WIN_STRING_FORMAT_LL "ll" +#else // MSC_VER >= 1400 +#define WIN_STRING_FORMAT_LL "I64" +#endif // MSC_VER >= 1400 + +// A nonconforming version of swprintf, without the length argument, was +// included with the CRT prior to MSVC8. Although a conforming version was +// also available via an overload, it is not reliably chosen. _snwprintf +// behaves as a standards-confirming swprintf should, so force the use of +// _snwprintf when using older CRTs. +#if _MSC_VER < 1400 // MSVC 2005/8 +#define swprintf _snwprintf +#else +// For MSVC8 and newer, swprintf_s is the recommended method. Conveniently, +// it takes the same argument list as swprintf. +#define swprintf swprintf_s +#endif // MSC_VER < 1400 + +namespace google_breakpad { + +using std::string; +using std::wstring; + +class WindowsStringUtils { + public: + // Roughly equivalent to MSVC8's wcscpy_s, except pre-MSVC8, this does + // not fail if source is longer than destination_size. The destination + // buffer is always 0-terminated. + static void safe_wcscpy(wchar_t *destination, size_t destination_size, + const wchar_t *source); + + // Roughly equivalent to MSVC8's wcsncpy_s, except that _TRUNCATE cannot + // be passed directly, and pre-MSVC8, this will not fail if source or count + // are longer than destination_size. The destination buffer is always + // 0-terminated. + static void safe_wcsncpy(wchar_t *destination, size_t destination_size, + const wchar_t *source, size_t count); + + // Performs multi-byte to wide character conversion on C++ strings, using + // mbstowcs_s (MSVC8) or mbstowcs (pre-MSVC8). Returns false on failure, + // without setting wcs. + static bool safe_mbstowcs(const string &mbs, wstring *wcs); + + // The inverse of safe_mbstowcs. + static bool safe_wcstombs(const wstring &wcs, string *mbs); + + // Returns the base name of a file, e.g. strips off the path. + static wstring GetBaseName(const wstring &filename); + + private: + // Disallow instantiation and other object-based operations. + WindowsStringUtils(); + WindowsStringUtils(const WindowsStringUtils&); + ~WindowsStringUtils(); + void operator=(const WindowsStringUtils&); +}; + +// static +inline void WindowsStringUtils::safe_wcscpy(wchar_t *destination, + size_t destination_size, + const wchar_t *source) { +#if _MSC_VER >= 1400 // MSVC 2005/8 + wcscpy_s(destination, destination_size, source); +#else // _MSC_VER >= 1400 + // Pre-MSVC 2005/8 doesn't have wcscpy_s. Simulate it with wcsncpy. + // wcsncpy doesn't 0-terminate the destination buffer if the source string + // is longer than size. Ensure that the destination is 0-terminated. + wcsncpy(destination, source, destination_size); + if (destination && destination_size) + destination[destination_size - 1] = 0; +#endif // _MSC_VER >= 1400 +} + +// static +inline void WindowsStringUtils::safe_wcsncpy(wchar_t *destination, + size_t destination_size, + const wchar_t *source, + size_t count) { +#if _MSC_VER >= 1400 // MSVC 2005/8 + wcsncpy_s(destination, destination_size, source, count); +#else // _MSC_VER >= 1400 + // Pre-MSVC 2005/8 doesn't have wcsncpy_s. Simulate it with wcsncpy. + // wcsncpy doesn't 0-terminate the destination buffer if the source string + // is longer than size. Ensure that the destination is 0-terminated. + if (destination_size < count) + count = destination_size; + + wcsncpy(destination, source, count); + if (destination && count) + destination[count - 1] = 0; +#endif // _MSC_VER >= 1400 +} + +} // namespace google_breakpad + +#endif // COMMON_WINDOWS_STRING_UTILS_INL_H_ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h new file mode 100644 index 0000000000..d8828043ff --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* breakpad_types.h: Precise-width types + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file ensures that types uintN_t are defined for N = 8, 16, 32, and + * 64. Types of precise widths are crucial to the task of writing data + * structures on one platform and reading them on another. + * + * Author: Mark Mentovai */ + +#ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ +#define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ + +#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && \ + !defined(__STDC_FORMAT_MACROS) +#error "inttypes.h has already been included before this header file, but " +#error "without __STDC_FORMAT_MACROS defined." +#endif + +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif /* __STDC_FORMAT_MACROS */ +#include + +typedef struct { + uint64_t high; + uint64_t low; +} uint128_struct; + +typedef uint64_t breakpad_time_t; + +/* Try to get PRIx64 from inttypes.h, but if it's not defined, fall back to + * llx, which is the format string for "long long" - this is a 64-bit + * integral type on many systems. */ +#ifndef PRIx64 +#define PRIx64 "llx" +#endif /* !PRIx64 */ + +#endif /* GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h new file mode 100644 index 0000000000..4256706d77 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h @@ -0,0 +1,235 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on amd64. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by ensuring + * ensuring that all members are aligned on their natural boundaries. In + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * These definitions may be extended to support handling minidump files + * for other CPUs and other operating systems. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably in terms of interoperability with minidumps + * produced by DbgHelp on Windows, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. DbgHelp + * on Windows is assumed to be the reference implementation; this file + * seeks to provide a cross-platform compatible implementation. To avoid + * collisions with the types and values defined and used by DbgHelp in the + * event that this implementation is used on Windows, each type and value + * defined here is given a new name, beginning with "MD". Names of the + * equivalent types and values in the Windows Platform SDK are given in + * comments. + * + * Author: Mark Mentovai + * Change to split into its own file: Neal Sidhwaney */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ + + +/* + * AMD64 support, see WINNT.H + */ + +typedef struct { + uint16_t control_word; + uint16_t status_word; + uint8_t tag_word; + uint8_t reserved1; + uint16_t error_opcode; + uint32_t error_offset; + uint16_t error_selector; + uint16_t reserved2; + uint32_t data_offset; + uint16_t data_selector; + uint16_t reserved3; + uint32_t mx_csr; + uint32_t mx_csr_mask; + uint128_struct float_registers[8]; + uint128_struct xmm_registers[16]; + uint8_t reserved4[96]; +} MDXmmSaveArea32AMD64; /* XMM_SAVE_AREA32 */ + +#define MD_CONTEXT_AMD64_VR_COUNT 26 + +typedef struct { + /* + * Register parameter home addresses. + */ + uint64_t p1_home; + uint64_t p2_home; + uint64_t p3_home; + uint64_t p4_home; + uint64_t p5_home; + uint64_t p6_home; + + /* The next field determines the layout of the structure, and which parts + * of it are populated */ + uint32_t context_flags; + uint32_t mx_csr; + + /* The next register is included with MD_CONTEXT_AMD64_CONTROL */ + uint16_t cs; + + /* The next 4 registers are included with MD_CONTEXT_AMD64_SEGMENTS */ + uint16_t ds; + uint16_t es; + uint16_t fs; + uint16_t gs; + + /* The next 2 registers are included with MD_CONTEXT_AMD64_CONTROL */ + uint16_t ss; + uint32_t eflags; + + /* The next 6 registers are included with MD_CONTEXT_AMD64_DEBUG_REGISTERS */ + uint64_t dr0; + uint64_t dr1; + uint64_t dr2; + uint64_t dr3; + uint64_t dr6; + uint64_t dr7; + + /* The next 4 registers are included with MD_CONTEXT_AMD64_INTEGER */ + uint64_t rax; + uint64_t rcx; + uint64_t rdx; + uint64_t rbx; + + /* The next register is included with MD_CONTEXT_AMD64_CONTROL */ + uint64_t rsp; + + /* The next 11 registers are included with MD_CONTEXT_AMD64_INTEGER */ + uint64_t rbp; + uint64_t rsi; + uint64_t rdi; + uint64_t r8; + uint64_t r9; + uint64_t r10; + uint64_t r11; + uint64_t r12; + uint64_t r13; + uint64_t r14; + uint64_t r15; + + /* The next register is included with MD_CONTEXT_AMD64_CONTROL */ + uint64_t rip; + + /* The next set of registers are included with + * MD_CONTEXT_AMD64_FLOATING_POINT + */ + union { + MDXmmSaveArea32AMD64 flt_save; + struct { + uint128_struct header[2]; + uint128_struct legacy[8]; + uint128_struct xmm0; + uint128_struct xmm1; + uint128_struct xmm2; + uint128_struct xmm3; + uint128_struct xmm4; + uint128_struct xmm5; + uint128_struct xmm6; + uint128_struct xmm7; + uint128_struct xmm8; + uint128_struct xmm9; + uint128_struct xmm10; + uint128_struct xmm11; + uint128_struct xmm12; + uint128_struct xmm13; + uint128_struct xmm14; + uint128_struct xmm15; + } sse_registers; + }; + + uint128_struct vector_register[MD_CONTEXT_AMD64_VR_COUNT]; + uint64_t vector_control; + + /* The next 5 registers are included with MD_CONTEXT_AMD64_DEBUG_REGISTERS */ + uint64_t debug_control; + uint64_t last_branch_to_rip; + uint64_t last_branch_from_rip; + uint64_t last_exception_to_rip; + uint64_t last_exception_from_rip; + +} MDRawContextAMD64; /* CONTEXT */ + +/* For (MDRawContextAMD64).context_flags. These values indicate the type of + * context stored in the structure. The high 24 bits identify the CPU, the + * low 8 bits identify the type of context saved. */ +#define MD_CONTEXT_AMD64 0x00100000 /* CONTEXT_AMD64 */ +#define MD_CONTEXT_AMD64_CONTROL (MD_CONTEXT_AMD64 | 0x00000001) + /* CONTEXT_CONTROL */ +#define MD_CONTEXT_AMD64_INTEGER (MD_CONTEXT_AMD64 | 0x00000002) + /* CONTEXT_INTEGER */ +#define MD_CONTEXT_AMD64_SEGMENTS (MD_CONTEXT_AMD64 | 0x00000004) + /* CONTEXT_SEGMENTS */ +#define MD_CONTEXT_AMD64_FLOATING_POINT (MD_CONTEXT_AMD64 | 0x00000008) + /* CONTEXT_FLOATING_POINT */ +#define MD_CONTEXT_AMD64_DEBUG_REGISTERS (MD_CONTEXT_AMD64 | 0x00000010) + /* CONTEXT_DEBUG_REGISTERS */ +#define MD_CONTEXT_AMD64_XSTATE (MD_CONTEXT_AMD64 | 0x00000040) + /* CONTEXT_XSTATE */ + +/* WinNT.h refers to CONTEXT_MMX_REGISTERS but doesn't appear to define it + * I think it really means CONTEXT_FLOATING_POINT. + */ + +#define MD_CONTEXT_AMD64_FULL (MD_CONTEXT_AMD64_CONTROL | \ + MD_CONTEXT_AMD64_INTEGER | \ + MD_CONTEXT_AMD64_FLOATING_POINT) + /* CONTEXT_FULL */ + +#define MD_CONTEXT_AMD64_ALL (MD_CONTEXT_AMD64_FULL | \ + MD_CONTEXT_AMD64_SEGMENTS | \ + MD_CONTEXT_X86_DEBUG_REGISTERS) + /* CONTEXT_ALL */ + + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h new file mode 100644 index 0000000000..6a71138337 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h @@ -0,0 +1,151 @@ +/* Copyright (c) 2009, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on ARM. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by + * ensuring that all members are aligned on their natural boundaries. + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. + * + * Author: Julian Seward + */ + +/* + * ARM support + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ + +#define MD_FLOATINGSAVEAREA_ARM_FPR_COUNT 32 +#define MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT 8 + +/* + * Note that these structures *do not* map directly to the CONTEXT + * structure defined in WinNT.h in the Windows Mobile SDK. That structure + * does not accomodate VFPv3, and I'm unsure if it was ever used in the + * wild anyway, as Windows CE only seems to produce "cedumps" which + * are not exactly minidumps. + */ +typedef struct { + uint64_t fpscr; /* FPU status register */ + + /* 32 64-bit floating point registers, d0 .. d31. */ + uint64_t regs[MD_FLOATINGSAVEAREA_ARM_FPR_COUNT]; + + /* Miscellaneous control words */ + uint32_t extra[MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT]; +} MDFloatingSaveAreaARM; + +#define MD_CONTEXT_ARM_GPR_COUNT 16 + +typedef struct { + /* The next field determines the layout of the structure, and which parts + * of it are populated + */ + uint32_t context_flags; + + /* 16 32-bit integer registers, r0 .. r15 + * Note the following fixed uses: + * r13 is the stack pointer + * r14 is the link register + * r15 is the program counter + */ + uint32_t iregs[MD_CONTEXT_ARM_GPR_COUNT]; + + /* CPSR (flags, basically): 32 bits: + bit 31 - N (negative) + bit 30 - Z (zero) + bit 29 - C (carry) + bit 28 - V (overflow) + bit 27 - Q (saturation flag, sticky) + All other fields -- ignore */ + uint32_t cpsr; + + /* The next field is included with MD_CONTEXT_ARM_FLOATING_POINT */ + MDFloatingSaveAreaARM float_save; + +} MDRawContextARM; + +/* Indices into iregs for registers with a dedicated or conventional + * purpose. + */ +enum MDARMRegisterNumbers { + MD_CONTEXT_ARM_REG_IOS_FP = 7, + MD_CONTEXT_ARM_REG_FP = 11, + MD_CONTEXT_ARM_REG_SP = 13, + MD_CONTEXT_ARM_REG_LR = 14, + MD_CONTEXT_ARM_REG_PC = 15 +}; + +/* For (MDRawContextARM).context_flags. These values indicate the type of + * context stored in the structure. */ +/* CONTEXT_ARM from the Windows CE 5.0 SDK. This value isn't correct + * because this bit can be used for flags. Presumably this value was + * never actually used in minidumps, but only in "CEDumps" which + * are a whole parallel minidump file format for Windows CE. + * Therefore, Breakpad defines its own value for ARM CPUs. + */ +#define MD_CONTEXT_ARM_OLD 0x00000040 +/* This value was chosen to avoid likely conflicts with MD_CONTEXT_* + * for other CPUs. */ +#define MD_CONTEXT_ARM 0x40000000 +#define MD_CONTEXT_ARM_INTEGER (MD_CONTEXT_ARM | 0x00000002) +#define MD_CONTEXT_ARM_FLOATING_POINT (MD_CONTEXT_ARM | 0x00000004) + +#define MD_CONTEXT_ARM_FULL (MD_CONTEXT_ARM_INTEGER | \ + MD_CONTEXT_ARM_FLOATING_POINT) + +#define MD_CONTEXT_ARM_ALL (MD_CONTEXT_ARM_INTEGER | \ + MD_CONTEXT_ARM_FLOATING_POINT) + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h new file mode 100644 index 0000000000..5ace0d9de4 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h @@ -0,0 +1,140 @@ +/* Copyright 2013 Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on ARM. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by + * ensuring that all members are aligned on their natural boundaries. + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. + * + * Author: Colin Blundell + */ + +/* + * ARM64 support + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ + +#define MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT 32 + +typedef struct { + uint32_t fpsr; /* FPU status register */ + uint32_t fpcr; /* FPU control register */ + + /* 32 128-bit floating point registers, d0 .. d31. */ + uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT]; +} MDFloatingSaveAreaARM64; + +#define MD_CONTEXT_ARM64_GPR_COUNT 33 + +/* Use the same 32-bit alignment when accessing this structure from 64-bit code + * as is used natively in 32-bit code. */ +#pragma pack(push, 4) + +typedef struct { + /* The next field determines the layout of the structure, and which parts + * of it are populated + */ + uint64_t context_flags; + + /* 33 64-bit integer registers, x0 .. x31 + the PC + * Note the following fixed uses: + * x29 is the frame pointer + * x30 is the link register + * x31 is the stack pointer + * The PC is effectively x32. + */ + uint64_t iregs[MD_CONTEXT_ARM64_GPR_COUNT]; + + /* CPSR (flags, basically): 32 bits: + bit 31 - N (negative) + bit 30 - Z (zero) + bit 29 - C (carry) + bit 28 - V (overflow) + bit 27 - Q (saturation flag, sticky) + All other fields -- ignore */ + uint32_t cpsr; + + /* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */ + MDFloatingSaveAreaARM64 float_save; + +} MDRawContextARM64; + +#pragma pack(pop) + +/* Indices into iregs for registers with a dedicated or conventional + * purpose. + */ +enum MDARM64RegisterNumbers { + MD_CONTEXT_ARM64_REG_FP = 29, + MD_CONTEXT_ARM64_REG_LR = 30, + MD_CONTEXT_ARM64_REG_SP = 31, + MD_CONTEXT_ARM64_REG_PC = 32 +}; + +/* For (MDRawContextARM64).context_flags. These values indicate the type of + * context stored in the structure. MD_CONTEXT_ARM64 is Breakpad-defined. + * This value was chosen to avoid likely conflicts with MD_CONTEXT_* + * for other CPUs. */ +#define MD_CONTEXT_ARM64 0x80000000 +#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002) +#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004) + +#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_INTEGER | \ + MD_CONTEXT_ARM64_FLOATING_POINT) + +#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_INTEGER | \ + MD_CONTEXT_ARM64_FLOATING_POINT) + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h new file mode 100644 index 0000000000..6cbe3023f9 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h @@ -0,0 +1,160 @@ +/* Copyright (c) 2013, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on MIPS. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by + * ensuring that all members are aligned on their natural boundaries. + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. + * + * Author: Chris Dearman + */ + +/* + * MIPS support + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__ + +#define MD_CONTEXT_MIPS_GPR_COUNT 32 +#define MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT 32 +#define MD_CONTEXT_MIPS_DSP_COUNT 3 + +/* + * Note that these structures *do not* map directly to the CONTEXT + * structure defined in WinNT.h in the Windows Mobile SDK. That structure + * does not accomodate VFPv3, and I'm unsure if it was ever used in the + * wild anyway, as Windows CE only seems to produce "cedumps" which + * are not exactly minidumps. + */ +typedef struct { + /* 32 64-bit floating point registers, f0..f31 */ + uint64_t regs[MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT]; + + uint32_t fpcsr; /* FPU status register. */ + uint32_t fir; /* FPU implementation register. */ +} MDFloatingSaveAreaMIPS; + +typedef struct { + /* The next field determines the layout of the structure, and which parts + * of it are populated. + */ + uint32_t context_flags; + uint32_t _pad0; + + /* 32 64-bit integer registers, r0..r31. + * Note the following fixed uses: + * r29 is the stack pointer. + * r31 is the return address. + */ + uint64_t iregs[MD_CONTEXT_MIPS_GPR_COUNT]; + + /* multiply/divide result. */ + uint64_t mdhi, mdlo; + + /* DSP accumulators. */ + uint32_t hi[MD_CONTEXT_MIPS_DSP_COUNT]; + uint32_t lo[MD_CONTEXT_MIPS_DSP_COUNT]; + uint32_t dsp_control; + uint32_t _pad1; + + uint64_t epc; + uint64_t badvaddr; + uint32_t status; + uint32_t cause; + + /* The next field is included with MD_CONTEXT_MIPS_FLOATING_POINT. */ + MDFloatingSaveAreaMIPS float_save; + +} MDRawContextMIPS; + +/* Indices into iregs for registers with a dedicated or conventional + * purpose. + */ +enum MDMIPSRegisterNumbers { + MD_CONTEXT_MIPS_REG_S0 = 16, + MD_CONTEXT_MIPS_REG_S1 = 17, + MD_CONTEXT_MIPS_REG_S2 = 18, + MD_CONTEXT_MIPS_REG_S3 = 19, + MD_CONTEXT_MIPS_REG_S4 = 20, + MD_CONTEXT_MIPS_REG_S5 = 21, + MD_CONTEXT_MIPS_REG_S6 = 22, + MD_CONTEXT_MIPS_REG_S7 = 23, + MD_CONTEXT_MIPS_REG_GP = 28, + MD_CONTEXT_MIPS_REG_SP = 29, + MD_CONTEXT_MIPS_REG_FP = 30, + MD_CONTEXT_MIPS_REG_RA = 31, +}; + +/* For (MDRawContextMIPS).context_flags. These values indicate the type of + * context stored in the structure. */ +/* CONTEXT_MIPS from the Windows CE 5.0 SDK. This value isn't correct + * because this bit can be used for flags. Presumably this value was + * never actually used in minidumps, but only in "CEDumps" which + * are a whole parallel minidump file format for Windows CE. + * Therefore, Breakpad defines its own value for MIPS CPUs. + */ +#define MD_CONTEXT_MIPS 0x00040000 +#define MD_CONTEXT_MIPS_INTEGER (MD_CONTEXT_MIPS | 0x00000002) +#define MD_CONTEXT_MIPS_FLOATING_POINT (MD_CONTEXT_MIPS | 0x00000004) +#define MD_CONTEXT_MIPS_DSP (MD_CONTEXT_MIPS | 0x00000008) + +#define MD_CONTEXT_MIPS_FULL (MD_CONTEXT_MIPS_INTEGER | \ + MD_CONTEXT_MIPS_FLOATING_POINT | \ + MD_CONTEXT_MIPS_DSP) + +#define MD_CONTEXT_MIPS_ALL (MD_CONTEXT_MIPS_INTEGER | \ + MD_CONTEXT_MIPS_FLOATING_POINT \ + MD_CONTEXT_MIPS_DSP) + +#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h new file mode 100644 index 0000000000..b24cc42438 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h @@ -0,0 +1,168 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on ppc. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by ensuring + * ensuring that all members are aligned on their natural boundaries. In + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * These definitions may be extended to support handling minidump files + * for other CPUs and other operating systems. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably in terms of interoperability with minidumps + * produced by DbgHelp on Windows, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. DbgHelp + * on Windows is assumed to be the reference implementation; this file + * seeks to provide a cross-platform compatible implementation. To avoid + * collisions with the types and values defined and used by DbgHelp in the + * event that this implementation is used on Windows, each type and value + * defined here is given a new name, beginning with "MD". Names of the + * equivalent types and values in the Windows Platform SDK are given in + * comments. + * + * Author: Mark Mentovai + * Change to split into its own file: Neal Sidhwaney */ + +/* + * Breakpad minidump extension for PowerPC support. Based on Darwin/Mac OS X' + * mach/ppc/_types.h + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ + +#define MD_FLOATINGSAVEAREA_PPC_FPR_COUNT 32 + +typedef struct { + /* fpregs is a double[32] in mach/ppc/_types.h, but a uint64_t is used + * here for precise sizing. */ + uint64_t fpregs[MD_FLOATINGSAVEAREA_PPC_FPR_COUNT]; + uint32_t fpscr_pad; + uint32_t fpscr; /* Status/control */ +} MDFloatingSaveAreaPPC; /* Based on ppc_float_state */ + + +#define MD_VECTORSAVEAREA_PPC_VR_COUNT 32 + +typedef struct { + /* Vector registers (including vscr) are 128 bits, but mach/ppc/_types.h + * exposes them as four 32-bit quantities. */ + uint128_struct save_vr[MD_VECTORSAVEAREA_PPC_VR_COUNT]; + uint128_struct save_vscr; /* Status/control */ + uint32_t save_pad5[4]; + uint32_t save_vrvalid; /* Indicates which vector registers are saved */ + uint32_t save_pad6[7]; +} MDVectorSaveAreaPPC; /* ppc_vector_state */ + + +#define MD_CONTEXT_PPC_GPR_COUNT 32 + +/* Use the same 32-bit alignment when accessing this structure from 64-bit code + * as is used natively in 32-bit code. #pragma pack is a MSVC extension + * supported by gcc. */ +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#pragma pack(4) +#else +#pragma pack(push, 4) +#endif + +typedef struct { + /* context_flags is not present in ppc_thread_state, but it aids + * identification of MDRawContextPPC among other raw context types, + * and it guarantees alignment when we get to float_save. */ + uint32_t context_flags; + + uint32_t srr0; /* Machine status save/restore: stores pc + * (instruction) */ + uint32_t srr1; /* Machine status save/restore: stores msr + * (ps, program/machine state) */ + /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is + * used for brevity. */ + uint32_t gpr[MD_CONTEXT_PPC_GPR_COUNT]; + uint32_t cr; /* Condition */ + uint32_t xer; /* Integer (fiXed-point) exception */ + uint32_t lr; /* Link */ + uint32_t ctr; /* Count */ + uint32_t mq; /* Multiply/Quotient (PPC 601, POWER only) */ + uint32_t vrsave; /* Vector save */ + + /* float_save and vector_save aren't present in ppc_thread_state, but + * are represented in separate structures that still define a thread's + * context. */ + MDFloatingSaveAreaPPC float_save; + MDVectorSaveAreaPPC vector_save; +} MDRawContextPPC; /* Based on ppc_thread_state */ + +/* Indices into gpr for registers with a dedicated or conventional purpose. */ +enum MDPPCRegisterNumbers { + MD_CONTEXT_PPC_REG_SP = 1 +}; + +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#pragma pack(0) +#else +#pragma pack(pop) +#endif + +/* For (MDRawContextPPC).context_flags. These values indicate the type of + * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its + * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other + * CPUs. */ +#define MD_CONTEXT_PPC 0x20000000 +#define MD_CONTEXT_PPC_BASE (MD_CONTEXT_PPC | 0x00000001) +#define MD_CONTEXT_PPC_FLOATING_POINT (MD_CONTEXT_PPC | 0x00000008) +#define MD_CONTEXT_PPC_VECTOR (MD_CONTEXT_PPC | 0x00000020) + +#define MD_CONTEXT_PPC_FULL MD_CONTEXT_PPC_BASE +#define MD_CONTEXT_PPC_ALL (MD_CONTEXT_PPC_FULL | \ + MD_CONTEXT_PPC_FLOATING_POINT | \ + MD_CONTEXT_PPC_VECTOR) + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h new file mode 100644 index 0000000000..61f4193865 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h @@ -0,0 +1,134 @@ +/* Copyright (c) 2008, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on ppc64. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by ensuring + * ensuring that all members are aligned on their natural boundaries. In + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * These definitions may be extended to support handling minidump files + * for other CPUs and other operating systems. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably in terms of interoperability with minidumps + * produced by DbgHelp on Windows, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. DbgHelp + * on Windows is assumed to be the reference implementation; this file + * seeks to provide a cross-platform compatible implementation. To avoid + * collisions with the types and values defined and used by DbgHelp in the + * event that this implementation is used on Windows, each type and value + * defined here is given a new name, beginning with "MD". Names of the + * equivalent types and values in the Windows Platform SDK are given in + * comments. + * + * Author: Neal Sidhwaney */ + + +/* + * Breakpad minidump extension for PPC64 support. Based on Darwin/Mac OS X' + * mach/ppc/_types.h + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ + +#include "minidump_cpu_ppc.h" + +// these types are the same in ppc64 & ppc +typedef MDFloatingSaveAreaPPC MDFloatingSaveAreaPPC64; +typedef MDVectorSaveAreaPPC MDVectorSaveAreaPPC64; + +#define MD_CONTEXT_PPC64_GPR_COUNT MD_CONTEXT_PPC_GPR_COUNT + +typedef struct { + /* context_flags is not present in ppc_thread_state, but it aids + * identification of MDRawContextPPC among other raw context types, + * and it guarantees alignment when we get to float_save. */ + uint64_t context_flags; + + uint64_t srr0; /* Machine status save/restore: stores pc + * (instruction) */ + uint64_t srr1; /* Machine status save/restore: stores msr + * (ps, program/machine state) */ + /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is + * used for brevity. */ + uint64_t gpr[MD_CONTEXT_PPC64_GPR_COUNT]; + uint64_t cr; /* Condition */ + uint64_t xer; /* Integer (fiXed-point) exception */ + uint64_t lr; /* Link */ + uint64_t ctr; /* Count */ + uint64_t vrsave; /* Vector save */ + + /* float_save and vector_save aren't present in ppc_thread_state, but + * are represented in separate structures that still define a thread's + * context. */ + MDFloatingSaveAreaPPC float_save; + MDVectorSaveAreaPPC vector_save; +} MDRawContextPPC64; /* Based on ppc_thread_state */ + +/* Indices into gpr for registers with a dedicated or conventional purpose. */ +enum MDPPC64RegisterNumbers { + MD_CONTEXT_PPC64_REG_SP = 1 +}; + +/* For (MDRawContextPPC).context_flags. These values indicate the type of + * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its + * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other + * CPUs. */ +#define MD_CONTEXT_PPC64 0x01000000 +#define MD_CONTEXT_PPC64_BASE (MD_CONTEXT_PPC64 | 0x00000001) +#define MD_CONTEXT_PPC64_FLOATING_POINT (MD_CONTEXT_PPC64 | 0x00000008) +#define MD_CONTEXT_PPC64_VECTOR (MD_CONTEXT_PPC64 | 0x00000020) + +#define MD_CONTEXT_PPC64_FULL MD_CONTEXT_PPC64_BASE +#define MD_CONTEXT_PPC64_ALL (MD_CONTEXT_PPC64_FULL | \ + MD_CONTEXT_PPC64_FLOATING_POINT | \ + MD_CONTEXT_PPC64_VECTOR) + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h new file mode 100644 index 0000000000..95c08b1743 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h @@ -0,0 +1,163 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on sparc. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by ensuring + * ensuring that all members are aligned on their natural boundaries. In + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * These definitions may be extended to support handling minidump files + * for other CPUs and other operating systems. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably in terms of interoperability with minidumps + * produced by DbgHelp on Windows, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. DbgHelp + * on Windows is assumed to be the reference implementation; this file + * seeks to provide a cross-platform compatible implementation. To avoid + * collisions with the types and values defined and used by DbgHelp in the + * event that this implementation is used on Windows, each type and value + * defined here is given a new name, beginning with "MD". Names of the + * equivalent types and values in the Windows Platform SDK are given in + * comments. + * + * Author: Mark Mentovai + * Change to split into its own file: Neal Sidhwaney */ + +/* + * SPARC support, see (solaris)sys/procfs_isa.h also + */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ + +#define MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT 32 + +typedef struct { + + /* FPU floating point regs */ + uint64_t regs[MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT]; + + uint64_t filler; + uint64_t fsr; /* FPU status register */ +} MDFloatingSaveAreaSPARC; /* FLOATING_SAVE_AREA */ + +#define MD_CONTEXT_SPARC_GPR_COUNT 32 + +typedef struct { + /* The next field determines the layout of the structure, and which parts + * of it are populated + */ + uint32_t context_flags; + uint32_t flag_pad; + /* + * General register access (SPARC). + * Don't confuse definitions here with definitions in . + * Registers are 32 bits for ILP32, 64 bits for LP64. + * SPARC V7/V8 is for 32bit, SPARC V9 is for 64bit + */ + + /* 32 Integer working registers */ + + /* g_r[0-7] global registers(g0-g7) + * g_r[8-15] out registers(o0-o7) + * g_r[16-23] local registers(l0-l7) + * g_r[24-31] in registers(i0-i7) + */ + uint64_t g_r[MD_CONTEXT_SPARC_GPR_COUNT]; + + /* several control registers */ + + /* Processor State register(PSR) for SPARC V7/V8 + * Condition Code register (CCR) for SPARC V9 + */ + uint64_t ccr; + + uint64_t pc; /* Program Counter register (PC) */ + uint64_t npc; /* Next Program Counter register (nPC) */ + uint64_t y; /* Y register (Y) */ + + /* Address Space Identifier register (ASI) for SPARC V9 + * WIM for SPARC V7/V8 + */ + uint64_t asi; + + /* Floating-Point Registers State register (FPRS) for SPARC V9 + * TBR for for SPARC V7/V8 + */ + uint64_t fprs; + + /* The next field is included with MD_CONTEXT_SPARC_FLOATING_POINT */ + MDFloatingSaveAreaSPARC float_save; + +} MDRawContextSPARC; /* CONTEXT_SPARC */ + +/* Indices into g_r for registers with a dedicated or conventional purpose. */ +enum MDSPARCRegisterNumbers { + MD_CONTEXT_SPARC_REG_SP = 14 +}; + +/* For (MDRawContextSPARC).context_flags. These values indicate the type of + * context stored in the structure. MD_CONTEXT_SPARC is Breakpad-defined. Its + * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other + * CPUs. */ +#define MD_CONTEXT_SPARC 0x10000000 +#define MD_CONTEXT_SPARC_CONTROL (MD_CONTEXT_SPARC | 0x00000001) +#define MD_CONTEXT_SPARC_INTEGER (MD_CONTEXT_SPARC | 0x00000002) +#define MD_CONTEXT_SAPARC_FLOATING_POINT (MD_CONTEXT_SPARC | 0x00000004) +#define MD_CONTEXT_SAPARC_EXTRA (MD_CONTEXT_SPARC | 0x00000008) + +#define MD_CONTEXT_SPARC_FULL (MD_CONTEXT_SPARC_CONTROL | \ + MD_CONTEXT_SPARC_INTEGER) + +#define MD_CONTEXT_SPARC_ALL (MD_CONTEXT_SPARC_FULL | \ + MD_CONTEXT_SAPARC_FLOATING_POINT | \ + MD_CONTEXT_SAPARC_EXTRA) + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h new file mode 100644 index 0000000000..e09cb7cb52 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h @@ -0,0 +1,174 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * This file contains the necessary definitions to read minidump files + * produced on x86. These files may be read on any platform provided + * that the alignments of these structures on the processing system are + * identical to the alignments of these structures on the producing system. + * For this reason, precise-sized types are used. The structures defined + * by this file have been laid out to minimize alignment problems by ensuring + * ensuring that all members are aligned on their natural boundaries. In + * In some cases, tail-padding may be significant when different ABIs specify + * different tail-padding behaviors. To avoid problems when reading or + * writing affected structures, MD_*_SIZE macros are provided where needed, + * containing the useful size of the structures without padding. + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * These definitions may be extended to support handling minidump files + * for other CPUs and other operating systems. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably in terms of interoperability with minidumps + * produced by DbgHelp on Windows, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. DbgHelp + * on Windows is assumed to be the reference implementation; this file + * seeks to provide a cross-platform compatible implementation. To avoid + * collisions with the types and values defined and used by DbgHelp in the + * event that this implementation is used on Windows, each type and value + * defined here is given a new name, beginning with "MD". Names of the + * equivalent types and values in the Windows Platform SDK are given in + * comments. + * + * Author: Mark Mentovai */ + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ + +#define MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE 80 + /* SIZE_OF_80387_REGISTERS */ + +typedef struct { + uint32_t control_word; + uint32_t status_word; + uint32_t tag_word; + uint32_t error_offset; + uint32_t error_selector; + uint32_t data_offset; + uint32_t data_selector; + + /* register_area contains eight 80-bit (x87 "long double") quantities for + * floating-point registers %st0 (%mm0) through %st7 (%mm7). */ + uint8_t register_area[MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE]; + uint32_t cr0_npx_state; +} MDFloatingSaveAreaX86; /* FLOATING_SAVE_AREA */ + + +#define MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE 512 + /* MAXIMUM_SUPPORTED_EXTENSION */ + +typedef struct { + /* The next field determines the layout of the structure, and which parts + * of it are populated */ + uint32_t context_flags; + + /* The next 6 registers are included with MD_CONTEXT_X86_DEBUG_REGISTERS */ + uint32_t dr0; + uint32_t dr1; + uint32_t dr2; + uint32_t dr3; + uint32_t dr6; + uint32_t dr7; + + /* The next field is included with MD_CONTEXT_X86_FLOATING_POINT */ + MDFloatingSaveAreaX86 float_save; + + /* The next 4 registers are included with MD_CONTEXT_X86_SEGMENTS */ + uint32_t gs; + uint32_t fs; + uint32_t es; + uint32_t ds; + /* The next 6 registers are included with MD_CONTEXT_X86_INTEGER */ + uint32_t edi; + uint32_t esi; + uint32_t ebx; + uint32_t edx; + uint32_t ecx; + uint32_t eax; + + /* The next 6 registers are included with MD_CONTEXT_X86_CONTROL */ + uint32_t ebp; + uint32_t eip; + uint32_t cs; /* WinNT.h says "must be sanitized" */ + uint32_t eflags; /* WinNT.h says "must be sanitized" */ + uint32_t esp; + uint32_t ss; + + /* The next field is included with MD_CONTEXT_X86_EXTENDED_REGISTERS. + * It contains vector (MMX/SSE) registers. It it laid out in the + * format used by the fxsave and fsrstor instructions, so it includes + * a copy of the x87 floating-point registers as well. See FXSAVE in + * "Intel Architecture Software Developer's Manual, Volume 2." */ + uint8_t extended_registers[ + MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE]; +} MDRawContextX86; /* CONTEXT */ + +/* For (MDRawContextX86).context_flags. These values indicate the type of + * context stored in the structure. The high 24 bits identify the CPU, the + * low 8 bits identify the type of context saved. */ +#define MD_CONTEXT_X86 0x00010000 + /* CONTEXT_i386, CONTEXT_i486: identifies CPU */ +#define MD_CONTEXT_X86_CONTROL (MD_CONTEXT_X86 | 0x00000001) + /* CONTEXT_CONTROL */ +#define MD_CONTEXT_X86_INTEGER (MD_CONTEXT_X86 | 0x00000002) + /* CONTEXT_INTEGER */ +#define MD_CONTEXT_X86_SEGMENTS (MD_CONTEXT_X86 | 0x00000004) + /* CONTEXT_SEGMENTS */ +#define MD_CONTEXT_X86_FLOATING_POINT (MD_CONTEXT_X86 | 0x00000008) + /* CONTEXT_FLOATING_POINT */ +#define MD_CONTEXT_X86_DEBUG_REGISTERS (MD_CONTEXT_X86 | 0x00000010) + /* CONTEXT_DEBUG_REGISTERS */ +#define MD_CONTEXT_X86_EXTENDED_REGISTERS (MD_CONTEXT_X86 | 0x00000020) + /* CONTEXT_EXTENDED_REGISTERS */ +#define MD_CONTEXT_X86_XSTATE (MD_CONTEXT_X86 | 0x00000040) + /* CONTEXT_XSTATE */ + +#define MD_CONTEXT_X86_FULL (MD_CONTEXT_X86_CONTROL | \ + MD_CONTEXT_X86_INTEGER | \ + MD_CONTEXT_X86_SEGMENTS) + /* CONTEXT_FULL */ + +#define MD_CONTEXT_X86_ALL (MD_CONTEXT_X86_FULL | \ + MD_CONTEXT_X86_FLOATING_POINT | \ + MD_CONTEXT_X86_DEBUG_REGISTERS | \ + MD_CONTEXT_X86_EXTENDED_REGISTERS) + /* CONTEXT_ALL */ + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h new file mode 100644 index 0000000000..9e7e4f1e12 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h @@ -0,0 +1,87 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_exception_linux.h: A definition of exception codes for + * Linux + * + * (This is C99 source, please don't corrupt it with C++.) + * + * Author: Mark Mentovai + * Split into its own file: Neal Sidhwaney */ + + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ + +#include + +#include "google_breakpad/common/breakpad_types.h" + + +/* For (MDException).exception_code. These values come from bits/signum.h. + */ +typedef enum { + MD_EXCEPTION_CODE_LIN_SIGHUP = 1, /* Hangup (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGINT = 2, /* Interrupt (ANSI) */ + MD_EXCEPTION_CODE_LIN_SIGQUIT = 3, /* Quit (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGILL = 4, /* Illegal instruction (ANSI) */ + MD_EXCEPTION_CODE_LIN_SIGTRAP = 5, /* Trace trap (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGABRT = 6, /* Abort (ANSI) */ + MD_EXCEPTION_CODE_LIN_SIGBUS = 7, /* BUS error (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGFPE = 8, /* Floating-point exception (ANSI) */ + MD_EXCEPTION_CODE_LIN_SIGKILL = 9, /* Kill, unblockable (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGUSR1 = 10, /* User-defined signal 1 (POSIX). */ + MD_EXCEPTION_CODE_LIN_SIGSEGV = 11, /* Segmentation violation (ANSI) */ + MD_EXCEPTION_CODE_LIN_SIGUSR2 = 12, /* User-defined signal 2 (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGPIPE = 13, /* Broken pipe (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGALRM = 14, /* Alarm clock (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGTERM = 15, /* Termination (ANSI) */ + MD_EXCEPTION_CODE_LIN_SIGSTKFLT = 16, /* Stack faultd */ + MD_EXCEPTION_CODE_LIN_SIGCHLD = 17, /* Child status has changed (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGCONT = 18, /* Continue (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGSTOP = 19, /* Stop, unblockable (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGTSTP = 20, /* Keyboard stop (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGTTIN = 21, /* Background read from tty (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGTTOU = 22, /* Background write to tty (POSIX) */ + MD_EXCEPTION_CODE_LIN_SIGURG = 23, + /* Urgent condition on socket (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGXCPU = 24, /* CPU limit exceeded (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGXFSZ = 25, + /* File size limit exceeded (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGVTALRM = 26, /* Virtual alarm clock (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGPROF = 27, /* Profiling alarm clock (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGWINCH = 28, /* Window size change (4.3 BSD, Sun) */ + MD_EXCEPTION_CODE_LIN_SIGIO = 29, /* I/O now possible (4.2 BSD) */ + MD_EXCEPTION_CODE_LIN_SIGPWR = 30, /* Power failure restart (System V) */ + MD_EXCEPTION_CODE_LIN_SIGSYS = 31, /* Bad system call */ + MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception, + dump requested. */ +} MDExceptionCodeLinux; + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h new file mode 100644 index 0000000000..91c1c09746 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h @@ -0,0 +1,205 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_exception_mac.h: A definition of exception codes for Mac + * OS X + * + * (This is C99 source, please don't corrupt it with C++.) + * + * Author: Mark Mentovai + * Split into its own file: Neal Sidhwaney */ + + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__ + +#include + +#include "google_breakpad/common/breakpad_types.h" + +/* For (MDException).exception_code. Breakpad minidump extension for Mac OS X + * support. Based on Darwin/Mac OS X' mach/exception_types.h. This is + * what Mac OS X calls an "exception", not a "code". */ +typedef enum { + /* Exception code. The high 16 bits of exception_code contains one of + * these values. */ + MD_EXCEPTION_MAC_BAD_ACCESS = 1, /* code can be a kern_return_t */ + /* EXC_BAD_ACCESS */ + MD_EXCEPTION_MAC_BAD_INSTRUCTION = 2, /* code is CPU-specific */ + /* EXC_BAD_INSTRUCTION */ + MD_EXCEPTION_MAC_ARITHMETIC = 3, /* code is CPU-specific */ + /* EXC_ARITHMETIC */ + MD_EXCEPTION_MAC_EMULATION = 4, /* code is CPU-specific */ + /* EXC_EMULATION */ + MD_EXCEPTION_MAC_SOFTWARE = 5, + /* EXC_SOFTWARE */ + MD_EXCEPTION_MAC_BREAKPOINT = 6, /* code is CPU-specific */ + /* EXC_BREAKPOINT */ + MD_EXCEPTION_MAC_SYSCALL = 7, + /* EXC_SYSCALL */ + MD_EXCEPTION_MAC_MACH_SYSCALL = 8, + /* EXC_MACH_SYSCALL */ + MD_EXCEPTION_MAC_RPC_ALERT = 9 + /* EXC_RPC_ALERT */ +} MDExceptionMac; + +/* For (MDException).exception_flags. Breakpad minidump extension for Mac OS X + * support. Based on Darwin/Mac OS X' mach/ppc/exception.h and + * mach/i386/exception.h. This is what Mac OS X calls a "code". */ +typedef enum { + /* With MD_EXCEPTION_BAD_ACCESS. These are relevant kern_return_t values + * from mach/kern_return.h. */ + MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS = 1, + /* KERN_INVALID_ADDRESS */ + MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE = 2, + /* KERN_PROTECTION_FAILURE */ + MD_EXCEPTION_CODE_MAC_NO_ACCESS = 8, + /* KERN_NO_ACCESS */ + MD_EXCEPTION_CODE_MAC_MEMORY_FAILURE = 9, + /* KERN_MEMORY_FAILURE */ + MD_EXCEPTION_CODE_MAC_MEMORY_ERROR = 10, + /* KERN_MEMORY_ERROR */ + + /* With MD_EXCEPTION_SOFTWARE */ + MD_EXCEPTION_CODE_MAC_BAD_SYSCALL = 0x00010000, /* Mach SIGSYS */ + MD_EXCEPTION_CODE_MAC_BAD_PIPE = 0x00010001, /* Mach SIGPIPE */ + MD_EXCEPTION_CODE_MAC_ABORT = 0x00010002, /* Mach SIGABRT */ + /* Custom values */ + MD_EXCEPTION_CODE_MAC_NS_EXCEPTION = 0xDEADC0DE, /* uncaught NSException */ + + /* With MD_EXCEPTION_MAC_BAD_ACCESS on arm */ + MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN = 0x0101, /* EXC_ARM_DA_ALIGN */ + MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG = 0x0102, /* EXC_ARM_DA_DEBUG */ + + /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on arm */ + MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED = 1, /* EXC_ARM_UNDEFINED */ + + /* With MD_EXCEPTION_MAC_BREAKPOINT on arm */ + MD_EXCEPTION_CODE_MAC_ARM_BREAKPOINT = 1, /* EXC_ARM_BREAKPOINT */ + + /* With MD_EXCEPTION_MAC_BAD_ACCESS on ppc */ + MD_EXCEPTION_CODE_MAC_PPC_VM_PROT_READ = 0x0101, + /* EXC_PPC_VM_PROT_READ */ + MD_EXCEPTION_CODE_MAC_PPC_BADSPACE = 0x0102, + /* EXC_PPC_BADSPACE */ + MD_EXCEPTION_CODE_MAC_PPC_UNALIGNED = 0x0103, + /* EXC_PPC_UNALIGNED */ + + /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on ppc */ + MD_EXCEPTION_CODE_MAC_PPC_INVALID_SYSCALL = 1, + /* EXC_PPC_INVALID_SYSCALL */ + MD_EXCEPTION_CODE_MAC_PPC_UNIMPLEMENTED_INSTRUCTION = 2, + /* EXC_PPC_UNIPL_INST */ + MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_INSTRUCTION = 3, + /* EXC_PPC_PRIVINST */ + MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_REGISTER = 4, + /* EXC_PPC_PRIVREG */ + MD_EXCEPTION_CODE_MAC_PPC_TRACE = 5, + /* EXC_PPC_TRACE */ + MD_EXCEPTION_CODE_MAC_PPC_PERFORMANCE_MONITOR = 6, + /* EXC_PPC_PERFMON */ + + /* With MD_EXCEPTION_MAC_ARITHMETIC on ppc */ + MD_EXCEPTION_CODE_MAC_PPC_OVERFLOW = 1, + /* EXC_PPC_OVERFLOW */ + MD_EXCEPTION_CODE_MAC_PPC_ZERO_DIVIDE = 2, + /* EXC_PPC_ZERO_DIVIDE */ + MD_EXCEPTION_CODE_MAC_PPC_FLOAT_INEXACT = 3, + /* EXC_FLT_INEXACT */ + MD_EXCEPTION_CODE_MAC_PPC_FLOAT_ZERO_DIVIDE = 4, + /* EXC_PPC_FLT_ZERO_DIVIDE */ + MD_EXCEPTION_CODE_MAC_PPC_FLOAT_UNDERFLOW = 5, + /* EXC_PPC_FLT_UNDERFLOW */ + MD_EXCEPTION_CODE_MAC_PPC_FLOAT_OVERFLOW = 6, + /* EXC_PPC_FLT_OVERFLOW */ + MD_EXCEPTION_CODE_MAC_PPC_FLOAT_NOT_A_NUMBER = 7, + /* EXC_PPC_FLT_NOT_A_NUMBER */ + + /* With MD_EXCEPTION_MAC_EMULATION on ppc */ + MD_EXCEPTION_CODE_MAC_PPC_NO_EMULATION = 8, + /* EXC_PPC_NOEMULATION */ + MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST = 9, + /* EXC_PPC_ALTIVECASSIST */ + + /* With MD_EXCEPTION_MAC_SOFTWARE on ppc */ + MD_EXCEPTION_CODE_MAC_PPC_TRAP = 0x00000001, /* EXC_PPC_TRAP */ + MD_EXCEPTION_CODE_MAC_PPC_MIGRATE = 0x00010100, /* EXC_PPC_MIGRATE */ + + /* With MD_EXCEPTION_MAC_BREAKPOINT on ppc */ + MD_EXCEPTION_CODE_MAC_PPC_BREAKPOINT = 1, /* EXC_PPC_BREAKPOINT */ + + /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86, see also x86 interrupt + * values below. */ + MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION = 1, /* EXC_I386_INVOP */ + + /* With MD_EXCEPTION_MAC_ARITHMETIC on x86 */ + MD_EXCEPTION_CODE_MAC_X86_DIV = 1, /* EXC_I386_DIV */ + MD_EXCEPTION_CODE_MAC_X86_INTO = 2, /* EXC_I386_INTO */ + MD_EXCEPTION_CODE_MAC_X86_NOEXT = 3, /* EXC_I386_NOEXT */ + MD_EXCEPTION_CODE_MAC_X86_EXTOVR = 4, /* EXC_I386_EXTOVR */ + MD_EXCEPTION_CODE_MAC_X86_EXTERR = 5, /* EXC_I386_EXTERR */ + MD_EXCEPTION_CODE_MAC_X86_EMERR = 6, /* EXC_I386_EMERR */ + MD_EXCEPTION_CODE_MAC_X86_BOUND = 7, /* EXC_I386_BOUND */ + MD_EXCEPTION_CODE_MAC_X86_SSEEXTERR = 8, /* EXC_I386_SSEEXTERR */ + + /* With MD_EXCEPTION_MAC_BREAKPOINT on x86 */ + MD_EXCEPTION_CODE_MAC_X86_SGL = 1, /* EXC_I386_SGL */ + MD_EXCEPTION_CODE_MAC_X86_BPT = 2, /* EXC_I386_BPT */ + + /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86. These are the raw + * x86 interrupt codes. Most of these are mapped to other Mach + * exceptions and codes, are handled, or should not occur in user space. + * A few of these will do occur with MD_EXCEPTION_MAC_BAD_INSTRUCTION. */ + /* EXC_I386_DIVERR = 0: mapped to EXC_ARITHMETIC/EXC_I386_DIV */ + /* EXC_I386_SGLSTP = 1: mapped to EXC_BREAKPOINT/EXC_I386_SGL */ + /* EXC_I386_NMIFLT = 2: should not occur in user space */ + /* EXC_I386_BPTFLT = 3: mapped to EXC_BREAKPOINT/EXC_I386_BPT */ + /* EXC_I386_INTOFLT = 4: mapped to EXC_ARITHMETIC/EXC_I386_INTO */ + /* EXC_I386_BOUNDFLT = 5: mapped to EXC_ARITHMETIC/EXC_I386_BOUND */ + /* EXC_I386_INVOPFLT = 6: mapped to EXC_BAD_INSTRUCTION/EXC_I386_INVOP */ + /* EXC_I386_NOEXTFLT = 7: should be handled by the kernel */ + /* EXC_I386_DBLFLT = 8: should be handled (if possible) by the kernel */ + /* EXC_I386_EXTOVRFLT = 9: mapped to EXC_BAD_ACCESS/(PROT_READ|PROT_EXEC) */ + MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT = 10, + /* EXC_INVTSSFLT */ + MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT = 11, + /* EXC_SEGNPFLT */ + MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT = 12, + /* EXC_STKFLT */ + MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT = 13, + /* EXC_GPFLT */ + /* EXC_I386_PGFLT = 14: should not occur in user space */ + /* EXC_I386_EXTERRFLT = 16: mapped to EXC_ARITHMETIC/EXC_I386_EXTERR */ + MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT = 17 + /* EXC_ALIGNFLT (for vector operations) */ + /* EXC_I386_ENOEXTFLT = 32: should be handled by the kernel */ + /* EXC_I386_ENDPERR = 33: should not occur */ +} MDExceptionCodeMac; + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_OSX_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h new file mode 100644 index 0000000000..adff5a6bbc --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h @@ -0,0 +1,67 @@ +/* Copyright (c) 2013, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_exception_ps3.h: A definition of exception codes for + * PS3 */ + + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ + +#include + +#include "google_breakpad/common/breakpad_types.h" + +typedef enum { + MD_EXCEPTION_CODE_PS3_UNKNOWN = 0, + MD_EXCEPTION_CODE_PS3_TRAP_EXCEP = 1, + MD_EXCEPTION_CODE_PS3_PRIV_INSTR = 2, + MD_EXCEPTION_CODE_PS3_ILLEGAL_INSTR = 3, + MD_EXCEPTION_CODE_PS3_INSTR_STORAGE = 4, + MD_EXCEPTION_CODE_PS3_INSTR_SEGMENT = 5, + MD_EXCEPTION_CODE_PS3_DATA_STORAGE = 6, + MD_EXCEPTION_CODE_PS3_DATA_SEGMENT = 7, + MD_EXCEPTION_CODE_PS3_FLOAT_POINT = 8, + MD_EXCEPTION_CODE_PS3_DABR_MATCH = 9, + MD_EXCEPTION_CODE_PS3_ALIGN_EXCEP = 10, + MD_EXCEPTION_CODE_PS3_MEMORY_ACCESS = 11, + MD_EXCEPTION_CODE_PS3_COPRO_ALIGN = 12, + MD_EXCEPTION_CODE_PS3_COPRO_INVALID_COM = 13, + MD_EXCEPTION_CODE_PS3_COPRO_ERR = 14, + MD_EXCEPTION_CODE_PS3_COPRO_FIR = 15, + MD_EXCEPTION_CODE_PS3_COPRO_DATA_SEGMENT = 16, + MD_EXCEPTION_CODE_PS3_COPRO_DATA_STORAGE = 17, + MD_EXCEPTION_CODE_PS3_COPRO_STOP_INSTR = 18, + MD_EXCEPTION_CODE_PS3_COPRO_HALT_INSTR = 19, + MD_EXCEPTION_CODE_PS3_COPRO_HALTINST_UNKNOWN = 20, + MD_EXCEPTION_CODE_PS3_COPRO_MEMORY_ACCESS = 21, + MD_EXCEPTION_CODE_PS3_GRAPHIC = 22 +} MDExceptionCodePS3; + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h new file mode 100644 index 0000000000..f18ddf4247 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h @@ -0,0 +1,94 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_exception_solaris.h: A definition of exception codes for + * Solaris + * + * (This is C99 source, please don't corrupt it with C++.) + * + * Author: Mark Mentovai + * Split into its own file: Neal Sidhwaney */ + + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ + +#include + +#include "google_breakpad/common/breakpad_types.h" + +/* For (MDException).exception_code. These values come from sys/iso/signal_iso.h + */ +typedef enum { + MD_EXCEPTION_CODE_SOL_SIGHUP = 1, /* Hangup */ + MD_EXCEPTION_CODE_SOL_SIGINT = 2, /* interrupt (rubout) */ + MD_EXCEPTION_CODE_SOL_SIGQUIT = 3, /* quit (ASCII FS) */ + MD_EXCEPTION_CODE_SOL_SIGILL = 4, /* illegal instruction (not reset when caught) */ + MD_EXCEPTION_CODE_SOL_SIGTRAP = 5, /* trace trap (not reset when caught) */ + MD_EXCEPTION_CODE_SOL_SIGIOT = 6, /* IOT instruction */ + MD_EXCEPTION_CODE_SOL_SIGABRT = 6, /* used by abort, replace SIGIOT in the future */ + MD_EXCEPTION_CODE_SOL_SIGEMT = 7, /* EMT instruction */ + MD_EXCEPTION_CODE_SOL_SIGFPE = 8, /* floating point exception */ + MD_EXCEPTION_CODE_SOL_SIGKILL = 9, /* kill (cannot be caught or ignored) */ + MD_EXCEPTION_CODE_SOL_SIGBUS = 10, /* bus error */ + MD_EXCEPTION_CODE_SOL_SIGSEGV = 11, /* segmentation violation */ + MD_EXCEPTION_CODE_SOL_SIGSYS = 12, /* bad argument to system call */ + MD_EXCEPTION_CODE_SOL_SIGPIPE = 13, /* write on a pipe with no one to read it */ + MD_EXCEPTION_CODE_SOL_SIGALRM = 14, /* alarm clock */ + MD_EXCEPTION_CODE_SOL_SIGTERM = 15, /* software termination signal from kill */ + MD_EXCEPTION_CODE_SOL_SIGUSR1 = 16, /* user defined signal 1 */ + MD_EXCEPTION_CODE_SOL_SIGUSR2 = 17, /* user defined signal 2 */ + MD_EXCEPTION_CODE_SOL_SIGCLD = 18, /* child status change */ + MD_EXCEPTION_CODE_SOL_SIGCHLD = 18, /* child status change alias (POSIX) */ + MD_EXCEPTION_CODE_SOL_SIGPWR = 19, /* power-fail restart */ + MD_EXCEPTION_CODE_SOL_SIGWINCH = 20, /* window size change */ + MD_EXCEPTION_CODE_SOL_SIGURG = 21, /* urgent socket condition */ + MD_EXCEPTION_CODE_SOL_SIGPOLL = 22, /* pollable event occurred */ + MD_EXCEPTION_CODE_SOL_SIGIO = 22, /* socket I/O possible (SIGPOLL alias) */ + MD_EXCEPTION_CODE_SOL_SIGSTOP = 23, /* stop (cannot be caught or ignored) */ + MD_EXCEPTION_CODE_SOL_SIGTSTP = 24, /* user stop requested from tty */ + MD_EXCEPTION_CODE_SOL_SIGCONT = 25, /* stopped process has been continued */ + MD_EXCEPTION_CODE_SOL_SIGTTIN = 26, /* background tty read attempted */ + MD_EXCEPTION_CODE_SOL_SIGTTOU = 27, /* background tty write attempted */ + MD_EXCEPTION_CODE_SOL_SIGVTALRM = 28, /* virtual timer expired */ + MD_EXCEPTION_CODE_SOL_SIGPROF = 29, /* profiling timer expired */ + MD_EXCEPTION_CODE_SOL_SIGXCPU = 30, /* exceeded cpu limit */ + MD_EXCEPTION_CODE_SOL_SIGXFSZ = 31, /* exceeded file size limit */ + MD_EXCEPTION_CODE_SOL_SIGWAITING = 32, /* reserved signal no longer used by threading code */ + MD_EXCEPTION_CODE_SOL_SIGLWP = 33, /* reserved signal no longer used by threading code */ + MD_EXCEPTION_CODE_SOL_SIGFREEZE = 34, /* special signal used by CPR */ + MD_EXCEPTION_CODE_SOL_SIGTHAW = 35, /* special signal used by CPR */ + MD_EXCEPTION_CODE_SOL_SIGCANCEL = 36, /* reserved signal for thread cancellation */ + MD_EXCEPTION_CODE_SOL_SIGLOST = 37, /* resource lost (eg, record-lock lost) */ + MD_EXCEPTION_CODE_SOL_SIGXRES = 38, /* resource control exceeded */ + MD_EXCEPTION_CODE_SOL_SIGJVM1 = 39, /* reserved signal for Java Virtual Machine */ + MD_EXCEPTION_CODE_SOL_SIGJVM2 = 40 /* reserved signal for Java Virtual Machine */ +} MDExceptionCodeSolaris; + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h new file mode 100644 index 0000000000..e4cd59edd5 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h @@ -0,0 +1,2261 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_exception_win32.h: Definitions of exception codes for + * Win32 platform + * + * (This is C99 source, please don't corrupt it with C++.) + * + * Author: Mark Mentovai + * Split into its own file: Neal Sidhwaney */ + + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ + +#include + +#include "google_breakpad/common/breakpad_types.h" + + +/* For (MDException).exception_code. These values come from WinBase.h + * and WinNT.h (names beginning with EXCEPTION_ are in WinBase.h, + * they are STATUS_ in WinNT.h). */ +typedef enum { + MD_EXCEPTION_CODE_WIN_CONTROL_C = 0x40010005, + /* DBG_CONTROL_C */ + MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION = 0x80000001, + /* EXCEPTION_GUARD_PAGE */ + MD_EXCEPTION_CODE_WIN_DATATYPE_MISALIGNMENT = 0x80000002, + /* EXCEPTION_DATATYPE_MISALIGNMENT */ + MD_EXCEPTION_CODE_WIN_BREAKPOINT = 0x80000003, + /* EXCEPTION_BREAKPOINT */ + MD_EXCEPTION_CODE_WIN_SINGLE_STEP = 0x80000004, + /* EXCEPTION_SINGLE_STEP */ + MD_EXCEPTION_CODE_WIN_ACCESS_VIOLATION = 0xc0000005, + /* EXCEPTION_ACCESS_VIOLATION */ + MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR = 0xc0000006, + /* EXCEPTION_IN_PAGE_ERROR */ + MD_EXCEPTION_CODE_WIN_INVALID_HANDLE = 0xc0000008, + /* EXCEPTION_INVALID_HANDLE */ + MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION = 0xc000001d, + /* EXCEPTION_ILLEGAL_INSTRUCTION */ + MD_EXCEPTION_CODE_WIN_NONCONTINUABLE_EXCEPTION = 0xc0000025, + /* EXCEPTION_NONCONTINUABLE_EXCEPTION */ + MD_EXCEPTION_CODE_WIN_INVALID_DISPOSITION = 0xc0000026, + /* EXCEPTION_INVALID_DISPOSITION */ + MD_EXCEPTION_CODE_WIN_ARRAY_BOUNDS_EXCEEDED = 0xc000008c, + /* EXCEPTION_BOUNDS_EXCEEDED */ + MD_EXCEPTION_CODE_WIN_FLOAT_DENORMAL_OPERAND = 0xc000008d, + /* EXCEPTION_FLT_DENORMAL_OPERAND */ + MD_EXCEPTION_CODE_WIN_FLOAT_DIVIDE_BY_ZERO = 0xc000008e, + /* EXCEPTION_FLT_DIVIDE_BY_ZERO */ + MD_EXCEPTION_CODE_WIN_FLOAT_INEXACT_RESULT = 0xc000008f, + /* EXCEPTION_FLT_INEXACT_RESULT */ + MD_EXCEPTION_CODE_WIN_FLOAT_INVALID_OPERATION = 0xc0000090, + /* EXCEPTION_FLT_INVALID_OPERATION */ + MD_EXCEPTION_CODE_WIN_FLOAT_OVERFLOW = 0xc0000091, + /* EXCEPTION_FLT_OVERFLOW */ + MD_EXCEPTION_CODE_WIN_FLOAT_STACK_CHECK = 0xc0000092, + /* EXCEPTION_FLT_STACK_CHECK */ + MD_EXCEPTION_CODE_WIN_FLOAT_UNDERFLOW = 0xc0000093, + /* EXCEPTION_FLT_UNDERFLOW */ + MD_EXCEPTION_CODE_WIN_INTEGER_DIVIDE_BY_ZERO = 0xc0000094, + /* EXCEPTION_INT_DIVIDE_BY_ZERO */ + MD_EXCEPTION_CODE_WIN_INTEGER_OVERFLOW = 0xc0000095, + /* EXCEPTION_INT_OVERFLOW */ + MD_EXCEPTION_CODE_WIN_PRIVILEGED_INSTRUCTION = 0xc0000096, + /* EXCEPTION_PRIV_INSTRUCTION */ + MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW = 0xc00000fd, + /* EXCEPTION_STACK_OVERFLOW */ + MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK = 0xc0000194, + /* EXCEPTION_POSSIBLE_DEADLOCK */ + MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN = 0xc0000409, + /* STATUS_STACK_BUFFER_OVERRUN */ + MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION = 0xc0000374, + /* STATUS_HEAP_CORRUPTION */ + MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION = 0xe06d7363 + /* Per http://support.microsoft.com/kb/185294, + generated by Visual C++ compiler */ +} MDExceptionCodeWin; + + +/* For (MDException).exception_information[2], when (MDException).exception_code + * is MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR. This describes the underlying reason + * for the error. These values come from ntstatus.h. + * + * The content of this enum was created from ntstatus.h in the 8.1 SDK with + * + * egrep '#define [A-Z_0-9]+\s+\(\(NTSTATUS\)0xC[0-9A-F]+L\)' ntstatus.h + * | tr -d '\r' + * | sed -r 's@#define ([A-Z_0-9]+)\s+\(\(NTSTATUS\)(0xC[0-9A-F]+)L\).*@\2 \1@' + * | sort + * | sed -r 's@(0xC[0-9A-F]+) ([A-Z_0-9]+)@ MD_NTSTATUS_WIN_\2 = \1,@' + * + * With easy copy to clipboard with + * | xclip -selection c # on linux + * | clip # on windows + * | pbcopy # on mac + * + * and then the last comma manually removed. */ +typedef enum { + MD_NTSTATUS_WIN_STATUS_UNSUCCESSFUL = 0xC0000001, + MD_NTSTATUS_WIN_STATUS_NOT_IMPLEMENTED = 0xC0000002, + MD_NTSTATUS_WIN_STATUS_INVALID_INFO_CLASS = 0xC0000003, + MD_NTSTATUS_WIN_STATUS_INFO_LENGTH_MISMATCH = 0xC0000004, + MD_NTSTATUS_WIN_STATUS_ACCESS_VIOLATION = 0xC0000005, + MD_NTSTATUS_WIN_STATUS_IN_PAGE_ERROR = 0xC0000006, + MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA = 0xC0000007, + MD_NTSTATUS_WIN_STATUS_INVALID_HANDLE = 0xC0000008, + MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_STACK = 0xC0000009, + MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_PC = 0xC000000A, + MD_NTSTATUS_WIN_STATUS_INVALID_CID = 0xC000000B, + MD_NTSTATUS_WIN_STATUS_TIMER_NOT_CANCELED = 0xC000000C, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER = 0xC000000D, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_DEVICE = 0xC000000E, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_FILE = 0xC000000F, + MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_REQUEST = 0xC0000010, + MD_NTSTATUS_WIN_STATUS_END_OF_FILE = 0xC0000011, + MD_NTSTATUS_WIN_STATUS_WRONG_VOLUME = 0xC0000012, + MD_NTSTATUS_WIN_STATUS_NO_MEDIA_IN_DEVICE = 0xC0000013, + MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_MEDIA = 0xC0000014, + MD_NTSTATUS_WIN_STATUS_NONEXISTENT_SECTOR = 0xC0000015, + MD_NTSTATUS_WIN_STATUS_MORE_PROCESSING_REQUIRED = 0xC0000016, + MD_NTSTATUS_WIN_STATUS_NO_MEMORY = 0xC0000017, + MD_NTSTATUS_WIN_STATUS_CONFLICTING_ADDRESSES = 0xC0000018, + MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_VIEW = 0xC0000019, + MD_NTSTATUS_WIN_STATUS_UNABLE_TO_FREE_VM = 0xC000001A, + MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DELETE_SECTION = 0xC000001B, + MD_NTSTATUS_WIN_STATUS_INVALID_SYSTEM_SERVICE = 0xC000001C, + MD_NTSTATUS_WIN_STATUS_ILLEGAL_INSTRUCTION = 0xC000001D, + MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_SEQUENCE = 0xC000001E, + MD_NTSTATUS_WIN_STATUS_INVALID_VIEW_SIZE = 0xC000001F, + MD_NTSTATUS_WIN_STATUS_INVALID_FILE_FOR_SECTION = 0xC0000020, + MD_NTSTATUS_WIN_STATUS_ALREADY_COMMITTED = 0xC0000021, + MD_NTSTATUS_WIN_STATUS_ACCESS_DENIED = 0xC0000022, + MD_NTSTATUS_WIN_STATUS_BUFFER_TOO_SMALL = 0xC0000023, + MD_NTSTATUS_WIN_STATUS_OBJECT_TYPE_MISMATCH = 0xC0000024, + MD_NTSTATUS_WIN_STATUS_NONCONTINUABLE_EXCEPTION = 0xC0000025, + MD_NTSTATUS_WIN_STATUS_INVALID_DISPOSITION = 0xC0000026, + MD_NTSTATUS_WIN_STATUS_UNWIND = 0xC0000027, + MD_NTSTATUS_WIN_STATUS_BAD_STACK = 0xC0000028, + MD_NTSTATUS_WIN_STATUS_INVALID_UNWIND_TARGET = 0xC0000029, + MD_NTSTATUS_WIN_STATUS_NOT_LOCKED = 0xC000002A, + MD_NTSTATUS_WIN_STATUS_PARITY_ERROR = 0xC000002B, + MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DECOMMIT_VM = 0xC000002C, + MD_NTSTATUS_WIN_STATUS_NOT_COMMITTED = 0xC000002D, + MD_NTSTATUS_WIN_STATUS_INVALID_PORT_ATTRIBUTES = 0xC000002E, + MD_NTSTATUS_WIN_STATUS_PORT_MESSAGE_TOO_LONG = 0xC000002F, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_MIX = 0xC0000030, + MD_NTSTATUS_WIN_STATUS_INVALID_QUOTA_LOWER = 0xC0000031, + MD_NTSTATUS_WIN_STATUS_DISK_CORRUPT_ERROR = 0xC0000032, + MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_INVALID = 0xC0000033, + MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_NOT_FOUND = 0xC0000034, + MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_COLLISION = 0xC0000035, + MD_NTSTATUS_WIN_STATUS_PORT_DISCONNECTED = 0xC0000037, + MD_NTSTATUS_WIN_STATUS_DEVICE_ALREADY_ATTACHED = 0xC0000038, + MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_INVALID = 0xC0000039, + MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_NOT_FOUND = 0xC000003A, + MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_SYNTAX_BAD = 0xC000003B, + MD_NTSTATUS_WIN_STATUS_DATA_OVERRUN = 0xC000003C, + MD_NTSTATUS_WIN_STATUS_DATA_LATE_ERROR = 0xC000003D, + MD_NTSTATUS_WIN_STATUS_DATA_ERROR = 0xC000003E, + MD_NTSTATUS_WIN_STATUS_CRC_ERROR = 0xC000003F, + MD_NTSTATUS_WIN_STATUS_SECTION_TOO_BIG = 0xC0000040, + MD_NTSTATUS_WIN_STATUS_PORT_CONNECTION_REFUSED = 0xC0000041, + MD_NTSTATUS_WIN_STATUS_INVALID_PORT_HANDLE = 0xC0000042, + MD_NTSTATUS_WIN_STATUS_SHARING_VIOLATION = 0xC0000043, + MD_NTSTATUS_WIN_STATUS_QUOTA_EXCEEDED = 0xC0000044, + MD_NTSTATUS_WIN_STATUS_INVALID_PAGE_PROTECTION = 0xC0000045, + MD_NTSTATUS_WIN_STATUS_MUTANT_NOT_OWNED = 0xC0000046, + MD_NTSTATUS_WIN_STATUS_SEMAPHORE_LIMIT_EXCEEDED = 0xC0000047, + MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_SET = 0xC0000048, + MD_NTSTATUS_WIN_STATUS_SECTION_NOT_IMAGE = 0xC0000049, + MD_NTSTATUS_WIN_STATUS_SUSPEND_COUNT_EXCEEDED = 0xC000004A, + MD_NTSTATUS_WIN_STATUS_THREAD_IS_TERMINATING = 0xC000004B, + MD_NTSTATUS_WIN_STATUS_BAD_WORKING_SET_LIMIT = 0xC000004C, + MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_FILE_MAP = 0xC000004D, + MD_NTSTATUS_WIN_STATUS_SECTION_PROTECTION = 0xC000004E, + MD_NTSTATUS_WIN_STATUS_EAS_NOT_SUPPORTED = 0xC000004F, + MD_NTSTATUS_WIN_STATUS_EA_TOO_LARGE = 0xC0000050, + MD_NTSTATUS_WIN_STATUS_NONEXISTENT_EA_ENTRY = 0xC0000051, + MD_NTSTATUS_WIN_STATUS_NO_EAS_ON_FILE = 0xC0000052, + MD_NTSTATUS_WIN_STATUS_EA_CORRUPT_ERROR = 0xC0000053, + MD_NTSTATUS_WIN_STATUS_FILE_LOCK_CONFLICT = 0xC0000054, + MD_NTSTATUS_WIN_STATUS_LOCK_NOT_GRANTED = 0xC0000055, + MD_NTSTATUS_WIN_STATUS_DELETE_PENDING = 0xC0000056, + MD_NTSTATUS_WIN_STATUS_CTL_FILE_NOT_SUPPORTED = 0xC0000057, + MD_NTSTATUS_WIN_STATUS_UNKNOWN_REVISION = 0xC0000058, + MD_NTSTATUS_WIN_STATUS_REVISION_MISMATCH = 0xC0000059, + MD_NTSTATUS_WIN_STATUS_INVALID_OWNER = 0xC000005A, + MD_NTSTATUS_WIN_STATUS_INVALID_PRIMARY_GROUP = 0xC000005B, + MD_NTSTATUS_WIN_STATUS_NO_IMPERSONATION_TOKEN = 0xC000005C, + MD_NTSTATUS_WIN_STATUS_CANT_DISABLE_MANDATORY = 0xC000005D, + MD_NTSTATUS_WIN_STATUS_NO_LOGON_SERVERS = 0xC000005E, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_LOGON_SESSION = 0xC000005F, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_PRIVILEGE = 0xC0000060, + MD_NTSTATUS_WIN_STATUS_PRIVILEGE_NOT_HELD = 0xC0000061, + MD_NTSTATUS_WIN_STATUS_INVALID_ACCOUNT_NAME = 0xC0000062, + MD_NTSTATUS_WIN_STATUS_USER_EXISTS = 0xC0000063, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_USER = 0xC0000064, + MD_NTSTATUS_WIN_STATUS_GROUP_EXISTS = 0xC0000065, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_GROUP = 0xC0000066, + MD_NTSTATUS_WIN_STATUS_MEMBER_IN_GROUP = 0xC0000067, + MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_GROUP = 0xC0000068, + MD_NTSTATUS_WIN_STATUS_LAST_ADMIN = 0xC0000069, + MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD = 0xC000006A, + MD_NTSTATUS_WIN_STATUS_ILL_FORMED_PASSWORD = 0xC000006B, + MD_NTSTATUS_WIN_STATUS_PASSWORD_RESTRICTION = 0xC000006C, + MD_NTSTATUS_WIN_STATUS_LOGON_FAILURE = 0xC000006D, + MD_NTSTATUS_WIN_STATUS_ACCOUNT_RESTRICTION = 0xC000006E, + MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_HOURS = 0xC000006F, + MD_NTSTATUS_WIN_STATUS_INVALID_WORKSTATION = 0xC0000070, + MD_NTSTATUS_WIN_STATUS_PASSWORD_EXPIRED = 0xC0000071, + MD_NTSTATUS_WIN_STATUS_ACCOUNT_DISABLED = 0xC0000072, + MD_NTSTATUS_WIN_STATUS_NONE_MAPPED = 0xC0000073, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_LUIDS_REQUESTED = 0xC0000074, + MD_NTSTATUS_WIN_STATUS_LUIDS_EXHAUSTED = 0xC0000075, + MD_NTSTATUS_WIN_STATUS_INVALID_SUB_AUTHORITY = 0xC0000076, + MD_NTSTATUS_WIN_STATUS_INVALID_ACL = 0xC0000077, + MD_NTSTATUS_WIN_STATUS_INVALID_SID = 0xC0000078, + MD_NTSTATUS_WIN_STATUS_INVALID_SECURITY_DESCR = 0xC0000079, + MD_NTSTATUS_WIN_STATUS_PROCEDURE_NOT_FOUND = 0xC000007A, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_FORMAT = 0xC000007B, + MD_NTSTATUS_WIN_STATUS_NO_TOKEN = 0xC000007C, + MD_NTSTATUS_WIN_STATUS_BAD_INHERITANCE_ACL = 0xC000007D, + MD_NTSTATUS_WIN_STATUS_RANGE_NOT_LOCKED = 0xC000007E, + MD_NTSTATUS_WIN_STATUS_DISK_FULL = 0xC000007F, + MD_NTSTATUS_WIN_STATUS_SERVER_DISABLED = 0xC0000080, + MD_NTSTATUS_WIN_STATUS_SERVER_NOT_DISABLED = 0xC0000081, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_GUIDS_REQUESTED = 0xC0000082, + MD_NTSTATUS_WIN_STATUS_GUIDS_EXHAUSTED = 0xC0000083, + MD_NTSTATUS_WIN_STATUS_INVALID_ID_AUTHORITY = 0xC0000084, + MD_NTSTATUS_WIN_STATUS_AGENTS_EXHAUSTED = 0xC0000085, + MD_NTSTATUS_WIN_STATUS_INVALID_VOLUME_LABEL = 0xC0000086, + MD_NTSTATUS_WIN_STATUS_SECTION_NOT_EXTENDED = 0xC0000087, + MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_DATA = 0xC0000088, + MD_NTSTATUS_WIN_STATUS_RESOURCE_DATA_NOT_FOUND = 0xC0000089, + MD_NTSTATUS_WIN_STATUS_RESOURCE_TYPE_NOT_FOUND = 0xC000008A, + MD_NTSTATUS_WIN_STATUS_RESOURCE_NAME_NOT_FOUND = 0xC000008B, + MD_NTSTATUS_WIN_STATUS_ARRAY_BOUNDS_EXCEEDED = 0xC000008C, + MD_NTSTATUS_WIN_STATUS_FLOAT_DENORMAL_OPERAND = 0xC000008D, + MD_NTSTATUS_WIN_STATUS_FLOAT_DIVIDE_BY_ZERO = 0xC000008E, + MD_NTSTATUS_WIN_STATUS_FLOAT_INEXACT_RESULT = 0xC000008F, + MD_NTSTATUS_WIN_STATUS_FLOAT_INVALID_OPERATION = 0xC0000090, + MD_NTSTATUS_WIN_STATUS_FLOAT_OVERFLOW = 0xC0000091, + MD_NTSTATUS_WIN_STATUS_FLOAT_STACK_CHECK = 0xC0000092, + MD_NTSTATUS_WIN_STATUS_FLOAT_UNDERFLOW = 0xC0000093, + MD_NTSTATUS_WIN_STATUS_INTEGER_DIVIDE_BY_ZERO = 0xC0000094, + MD_NTSTATUS_WIN_STATUS_INTEGER_OVERFLOW = 0xC0000095, + MD_NTSTATUS_WIN_STATUS_PRIVILEGED_INSTRUCTION = 0xC0000096, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_PAGING_FILES = 0xC0000097, + MD_NTSTATUS_WIN_STATUS_FILE_INVALID = 0xC0000098, + MD_NTSTATUS_WIN_STATUS_ALLOTTED_SPACE_EXCEEDED = 0xC0000099, + MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCES = 0xC000009A, + MD_NTSTATUS_WIN_STATUS_DFS_EXIT_PATH_FOUND = 0xC000009B, + MD_NTSTATUS_WIN_STATUS_DEVICE_DATA_ERROR = 0xC000009C, + MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_CONNECTED = 0xC000009D, + MD_NTSTATUS_WIN_STATUS_DEVICE_POWER_FAILURE = 0xC000009E, + MD_NTSTATUS_WIN_STATUS_FREE_VM_NOT_AT_BASE = 0xC000009F, + MD_NTSTATUS_WIN_STATUS_MEMORY_NOT_ALLOCATED = 0xC00000A0, + MD_NTSTATUS_WIN_STATUS_WORKING_SET_QUOTA = 0xC00000A1, + MD_NTSTATUS_WIN_STATUS_MEDIA_WRITE_PROTECTED = 0xC00000A2, + MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_READY = 0xC00000A3, + MD_NTSTATUS_WIN_STATUS_INVALID_GROUP_ATTRIBUTES = 0xC00000A4, + MD_NTSTATUS_WIN_STATUS_BAD_IMPERSONATION_LEVEL = 0xC00000A5, + MD_NTSTATUS_WIN_STATUS_CANT_OPEN_ANONYMOUS = 0xC00000A6, + MD_NTSTATUS_WIN_STATUS_BAD_VALIDATION_CLASS = 0xC00000A7, + MD_NTSTATUS_WIN_STATUS_BAD_TOKEN_TYPE = 0xC00000A8, + MD_NTSTATUS_WIN_STATUS_BAD_MASTER_BOOT_RECORD = 0xC00000A9, + MD_NTSTATUS_WIN_STATUS_INSTRUCTION_MISALIGNMENT = 0xC00000AA, + MD_NTSTATUS_WIN_STATUS_INSTANCE_NOT_AVAILABLE = 0xC00000AB, + MD_NTSTATUS_WIN_STATUS_PIPE_NOT_AVAILABLE = 0xC00000AC, + MD_NTSTATUS_WIN_STATUS_INVALID_PIPE_STATE = 0xC00000AD, + MD_NTSTATUS_WIN_STATUS_PIPE_BUSY = 0xC00000AE, + MD_NTSTATUS_WIN_STATUS_ILLEGAL_FUNCTION = 0xC00000AF, + MD_NTSTATUS_WIN_STATUS_PIPE_DISCONNECTED = 0xC00000B0, + MD_NTSTATUS_WIN_STATUS_PIPE_CLOSING = 0xC00000B1, + MD_NTSTATUS_WIN_STATUS_PIPE_CONNECTED = 0xC00000B2, + MD_NTSTATUS_WIN_STATUS_PIPE_LISTENING = 0xC00000B3, + MD_NTSTATUS_WIN_STATUS_INVALID_READ_MODE = 0xC00000B4, + MD_NTSTATUS_WIN_STATUS_IO_TIMEOUT = 0xC00000B5, + MD_NTSTATUS_WIN_STATUS_FILE_FORCED_CLOSED = 0xC00000B6, + MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STARTED = 0xC00000B7, + MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STOPPED = 0xC00000B8, + MD_NTSTATUS_WIN_STATUS_COULD_NOT_INTERPRET = 0xC00000B9, + MD_NTSTATUS_WIN_STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA, + MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED = 0xC00000BB, + MD_NTSTATUS_WIN_STATUS_REMOTE_NOT_LISTENING = 0xC00000BC, + MD_NTSTATUS_WIN_STATUS_DUPLICATE_NAME = 0xC00000BD, + MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_PATH = 0xC00000BE, + MD_NTSTATUS_WIN_STATUS_NETWORK_BUSY = 0xC00000BF, + MD_NTSTATUS_WIN_STATUS_DEVICE_DOES_NOT_EXIST = 0xC00000C0, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_COMMANDS = 0xC00000C1, + MD_NTSTATUS_WIN_STATUS_ADAPTER_HARDWARE_ERROR = 0xC00000C2, + MD_NTSTATUS_WIN_STATUS_INVALID_NETWORK_RESPONSE = 0xC00000C3, + MD_NTSTATUS_WIN_STATUS_UNEXPECTED_NETWORK_ERROR = 0xC00000C4, + MD_NTSTATUS_WIN_STATUS_BAD_REMOTE_ADAPTER = 0xC00000C5, + MD_NTSTATUS_WIN_STATUS_PRINT_QUEUE_FULL = 0xC00000C6, + MD_NTSTATUS_WIN_STATUS_NO_SPOOL_SPACE = 0xC00000C7, + MD_NTSTATUS_WIN_STATUS_PRINT_CANCELLED = 0xC00000C8, + MD_NTSTATUS_WIN_STATUS_NETWORK_NAME_DELETED = 0xC00000C9, + MD_NTSTATUS_WIN_STATUS_NETWORK_ACCESS_DENIED = 0xC00000CA, + MD_NTSTATUS_WIN_STATUS_BAD_DEVICE_TYPE = 0xC00000CB, + MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_NAME = 0xC00000CC, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_NAMES = 0xC00000CD, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_SESSIONS = 0xC00000CE, + MD_NTSTATUS_WIN_STATUS_SHARING_PAUSED = 0xC00000CF, + MD_NTSTATUS_WIN_STATUS_REQUEST_NOT_ACCEPTED = 0xC00000D0, + MD_NTSTATUS_WIN_STATUS_REDIRECTOR_PAUSED = 0xC00000D1, + MD_NTSTATUS_WIN_STATUS_NET_WRITE_FAULT = 0xC00000D2, + MD_NTSTATUS_WIN_STATUS_PROFILING_AT_LIMIT = 0xC00000D3, + MD_NTSTATUS_WIN_STATUS_NOT_SAME_DEVICE = 0xC00000D4, + MD_NTSTATUS_WIN_STATUS_FILE_RENAMED = 0xC00000D5, + MD_NTSTATUS_WIN_STATUS_VIRTUAL_CIRCUIT_CLOSED = 0xC00000D6, + MD_NTSTATUS_WIN_STATUS_NO_SECURITY_ON_OBJECT = 0xC00000D7, + MD_NTSTATUS_WIN_STATUS_CANT_WAIT = 0xC00000D8, + MD_NTSTATUS_WIN_STATUS_PIPE_EMPTY = 0xC00000D9, + MD_NTSTATUS_WIN_STATUS_CANT_ACCESS_DOMAIN_INFO = 0xC00000DA, + MD_NTSTATUS_WIN_STATUS_CANT_TERMINATE_SELF = 0xC00000DB, + MD_NTSTATUS_WIN_STATUS_INVALID_SERVER_STATE = 0xC00000DC, + MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_STATE = 0xC00000DD, + MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_ROLE = 0xC00000DE, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_DOMAIN = 0xC00000DF, + MD_NTSTATUS_WIN_STATUS_DOMAIN_EXISTS = 0xC00000E0, + MD_NTSTATUS_WIN_STATUS_DOMAIN_LIMIT_EXCEEDED = 0xC00000E1, + MD_NTSTATUS_WIN_STATUS_OPLOCK_NOT_GRANTED = 0xC00000E2, + MD_NTSTATUS_WIN_STATUS_INVALID_OPLOCK_PROTOCOL = 0xC00000E3, + MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_CORRUPTION = 0xC00000E4, + MD_NTSTATUS_WIN_STATUS_INTERNAL_ERROR = 0xC00000E5, + MD_NTSTATUS_WIN_STATUS_GENERIC_NOT_MAPPED = 0xC00000E6, + MD_NTSTATUS_WIN_STATUS_BAD_DESCRIPTOR_FORMAT = 0xC00000E7, + MD_NTSTATUS_WIN_STATUS_INVALID_USER_BUFFER = 0xC00000E8, + MD_NTSTATUS_WIN_STATUS_UNEXPECTED_IO_ERROR = 0xC00000E9, + MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_CREATE_ERR = 0xC00000EA, + MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_MAP_ERROR = 0xC00000EB, + MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_EXTEND_ERR = 0xC00000EC, + MD_NTSTATUS_WIN_STATUS_NOT_LOGON_PROCESS = 0xC00000ED, + MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_EXISTS = 0xC00000EE, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_1 = 0xC00000EF, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_2 = 0xC00000F0, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_3 = 0xC00000F1, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_4 = 0xC00000F2, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_5 = 0xC00000F3, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_6 = 0xC00000F4, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_7 = 0xC00000F5, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_8 = 0xC00000F6, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_9 = 0xC00000F7, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_10 = 0xC00000F8, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_11 = 0xC00000F9, + MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_12 = 0xC00000FA, + MD_NTSTATUS_WIN_STATUS_REDIRECTOR_NOT_STARTED = 0xC00000FB, + MD_NTSTATUS_WIN_STATUS_REDIRECTOR_STARTED = 0xC00000FC, + MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW = 0xC00000FD, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_PACKAGE = 0xC00000FE, + MD_NTSTATUS_WIN_STATUS_BAD_FUNCTION_TABLE = 0xC00000FF, + MD_NTSTATUS_WIN_STATUS_VARIABLE_NOT_FOUND = 0xC0000100, + MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_EMPTY = 0xC0000101, + MD_NTSTATUS_WIN_STATUS_FILE_CORRUPT_ERROR = 0xC0000102, + MD_NTSTATUS_WIN_STATUS_NOT_A_DIRECTORY = 0xC0000103, + MD_NTSTATUS_WIN_STATUS_BAD_LOGON_SESSION_STATE = 0xC0000104, + MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_COLLISION = 0xC0000105, + MD_NTSTATUS_WIN_STATUS_NAME_TOO_LONG = 0xC0000106, + MD_NTSTATUS_WIN_STATUS_FILES_OPEN = 0xC0000107, + MD_NTSTATUS_WIN_STATUS_CONNECTION_IN_USE = 0xC0000108, + MD_NTSTATUS_WIN_STATUS_MESSAGE_NOT_FOUND = 0xC0000109, + MD_NTSTATUS_WIN_STATUS_PROCESS_IS_TERMINATING = 0xC000010A, + MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_TYPE = 0xC000010B, + MD_NTSTATUS_WIN_STATUS_NO_GUID_TRANSLATION = 0xC000010C, + MD_NTSTATUS_WIN_STATUS_CANNOT_IMPERSONATE = 0xC000010D, + MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED = 0xC000010E, + MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_PRESENT = 0xC000010F, + MD_NTSTATUS_WIN_STATUS_ABIOS_LID_NOT_EXIST = 0xC0000110, + MD_NTSTATUS_WIN_STATUS_ABIOS_LID_ALREADY_OWNED = 0xC0000111, + MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_LID_OWNER = 0xC0000112, + MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_COMMAND = 0xC0000113, + MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_LID = 0xC0000114, + MD_NTSTATUS_WIN_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE = 0xC0000115, + MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_SELECTOR = 0xC0000116, + MD_NTSTATUS_WIN_STATUS_NO_LDT = 0xC0000117, + MD_NTSTATUS_WIN_STATUS_INVALID_LDT_SIZE = 0xC0000118, + MD_NTSTATUS_WIN_STATUS_INVALID_LDT_OFFSET = 0xC0000119, + MD_NTSTATUS_WIN_STATUS_INVALID_LDT_DESCRIPTOR = 0xC000011A, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NE_FORMAT = 0xC000011B, + MD_NTSTATUS_WIN_STATUS_RXACT_INVALID_STATE = 0xC000011C, + MD_NTSTATUS_WIN_STATUS_RXACT_COMMIT_FAILURE = 0xC000011D, + MD_NTSTATUS_WIN_STATUS_MAPPED_FILE_SIZE_ZERO = 0xC000011E, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_OPENED_FILES = 0xC000011F, + MD_NTSTATUS_WIN_STATUS_CANCELLED = 0xC0000120, + MD_NTSTATUS_WIN_STATUS_CANNOT_DELETE = 0xC0000121, + MD_NTSTATUS_WIN_STATUS_INVALID_COMPUTER_NAME = 0xC0000122, + MD_NTSTATUS_WIN_STATUS_FILE_DELETED = 0xC0000123, + MD_NTSTATUS_WIN_STATUS_SPECIAL_ACCOUNT = 0xC0000124, + MD_NTSTATUS_WIN_STATUS_SPECIAL_GROUP = 0xC0000125, + MD_NTSTATUS_WIN_STATUS_SPECIAL_USER = 0xC0000126, + MD_NTSTATUS_WIN_STATUS_MEMBERS_PRIMARY_GROUP = 0xC0000127, + MD_NTSTATUS_WIN_STATUS_FILE_CLOSED = 0xC0000128, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_THREADS = 0xC0000129, + MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_PROCESS = 0xC000012A, + MD_NTSTATUS_WIN_STATUS_TOKEN_ALREADY_IN_USE = 0xC000012B, + MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA_EXCEEDED = 0xC000012C, + MD_NTSTATUS_WIN_STATUS_COMMITMENT_LIMIT = 0xC000012D, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_LE_FORMAT = 0xC000012E, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NOT_MZ = 0xC000012F, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_PROTECT = 0xC0000130, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_16 = 0xC0000131, + MD_NTSTATUS_WIN_STATUS_LOGON_SERVER_CONFLICT = 0xC0000132, + MD_NTSTATUS_WIN_STATUS_TIME_DIFFERENCE_AT_DC = 0xC0000133, + MD_NTSTATUS_WIN_STATUS_SYNCHRONIZATION_REQUIRED = 0xC0000134, + MD_NTSTATUS_WIN_STATUS_DLL_NOT_FOUND = 0xC0000135, + MD_NTSTATUS_WIN_STATUS_OPEN_FAILED = 0xC0000136, + MD_NTSTATUS_WIN_STATUS_IO_PRIVILEGE_FAILED = 0xC0000137, + MD_NTSTATUS_WIN_STATUS_ORDINAL_NOT_FOUND = 0xC0000138, + MD_NTSTATUS_WIN_STATUS_ENTRYPOINT_NOT_FOUND = 0xC0000139, + MD_NTSTATUS_WIN_STATUS_CONTROL_C_EXIT = 0xC000013A, + MD_NTSTATUS_WIN_STATUS_LOCAL_DISCONNECT = 0xC000013B, + MD_NTSTATUS_WIN_STATUS_REMOTE_DISCONNECT = 0xC000013C, + MD_NTSTATUS_WIN_STATUS_REMOTE_RESOURCES = 0xC000013D, + MD_NTSTATUS_WIN_STATUS_LINK_FAILED = 0xC000013E, + MD_NTSTATUS_WIN_STATUS_LINK_TIMEOUT = 0xC000013F, + MD_NTSTATUS_WIN_STATUS_INVALID_CONNECTION = 0xC0000140, + MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS = 0xC0000141, + MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED = 0xC0000142, + MD_NTSTATUS_WIN_STATUS_MISSING_SYSTEMFILE = 0xC0000143, + MD_NTSTATUS_WIN_STATUS_UNHANDLED_EXCEPTION = 0xC0000144, + MD_NTSTATUS_WIN_STATUS_APP_INIT_FAILURE = 0xC0000145, + MD_NTSTATUS_WIN_STATUS_PAGEFILE_CREATE_FAILED = 0xC0000146, + MD_NTSTATUS_WIN_STATUS_NO_PAGEFILE = 0xC0000147, + MD_NTSTATUS_WIN_STATUS_INVALID_LEVEL = 0xC0000148, + MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD_CORE = 0xC0000149, + MD_NTSTATUS_WIN_STATUS_ILLEGAL_FLOAT_CONTEXT = 0xC000014A, + MD_NTSTATUS_WIN_STATUS_PIPE_BROKEN = 0xC000014B, + MD_NTSTATUS_WIN_STATUS_REGISTRY_CORRUPT = 0xC000014C, + MD_NTSTATUS_WIN_STATUS_REGISTRY_IO_FAILED = 0xC000014D, + MD_NTSTATUS_WIN_STATUS_NO_EVENT_PAIR = 0xC000014E, + MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_VOLUME = 0xC000014F, + MD_NTSTATUS_WIN_STATUS_SERIAL_NO_DEVICE_INITED = 0xC0000150, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_ALIAS = 0xC0000151, + MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_ALIAS = 0xC0000152, + MD_NTSTATUS_WIN_STATUS_MEMBER_IN_ALIAS = 0xC0000153, + MD_NTSTATUS_WIN_STATUS_ALIAS_EXISTS = 0xC0000154, + MD_NTSTATUS_WIN_STATUS_LOGON_NOT_GRANTED = 0xC0000155, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_SECRETS = 0xC0000156, + MD_NTSTATUS_WIN_STATUS_SECRET_TOO_LONG = 0xC0000157, + MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_ERROR = 0xC0000158, + MD_NTSTATUS_WIN_STATUS_FULLSCREEN_MODE = 0xC0000159, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_CONTEXT_IDS = 0xC000015A, + MD_NTSTATUS_WIN_STATUS_LOGON_TYPE_NOT_GRANTED = 0xC000015B, + MD_NTSTATUS_WIN_STATUS_NOT_REGISTRY_FILE = 0xC000015C, + MD_NTSTATUS_WIN_STATUS_NT_CROSS_ENCRYPTION_REQUIRED = 0xC000015D, + MD_NTSTATUS_WIN_STATUS_DOMAIN_CTRLR_CONFIG_ERROR = 0xC000015E, + MD_NTSTATUS_WIN_STATUS_FT_MISSING_MEMBER = 0xC000015F, + MD_NTSTATUS_WIN_STATUS_ILL_FORMED_SERVICE_ENTRY = 0xC0000160, + MD_NTSTATUS_WIN_STATUS_ILLEGAL_CHARACTER = 0xC0000161, + MD_NTSTATUS_WIN_STATUS_UNMAPPABLE_CHARACTER = 0xC0000162, + MD_NTSTATUS_WIN_STATUS_UNDEFINED_CHARACTER = 0xC0000163, + MD_NTSTATUS_WIN_STATUS_FLOPPY_VOLUME = 0xC0000164, + MD_NTSTATUS_WIN_STATUS_FLOPPY_ID_MARK_NOT_FOUND = 0xC0000165, + MD_NTSTATUS_WIN_STATUS_FLOPPY_WRONG_CYLINDER = 0xC0000166, + MD_NTSTATUS_WIN_STATUS_FLOPPY_UNKNOWN_ERROR = 0xC0000167, + MD_NTSTATUS_WIN_STATUS_FLOPPY_BAD_REGISTERS = 0xC0000168, + MD_NTSTATUS_WIN_STATUS_DISK_RECALIBRATE_FAILED = 0xC0000169, + MD_NTSTATUS_WIN_STATUS_DISK_OPERATION_FAILED = 0xC000016A, + MD_NTSTATUS_WIN_STATUS_DISK_RESET_FAILED = 0xC000016B, + MD_NTSTATUS_WIN_STATUS_SHARED_IRQ_BUSY = 0xC000016C, + MD_NTSTATUS_WIN_STATUS_FT_ORPHANING = 0xC000016D, + MD_NTSTATUS_WIN_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT = 0xC000016E, + MD_NTSTATUS_WIN_STATUS_PARTITION_FAILURE = 0xC0000172, + MD_NTSTATUS_WIN_STATUS_INVALID_BLOCK_LENGTH = 0xC0000173, + MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_PARTITIONED = 0xC0000174, + MD_NTSTATUS_WIN_STATUS_UNABLE_TO_LOCK_MEDIA = 0xC0000175, + MD_NTSTATUS_WIN_STATUS_UNABLE_TO_UNLOAD_MEDIA = 0xC0000176, + MD_NTSTATUS_WIN_STATUS_EOM_OVERFLOW = 0xC0000177, + MD_NTSTATUS_WIN_STATUS_NO_MEDIA = 0xC0000178, + MD_NTSTATUS_WIN_STATUS_NO_SUCH_MEMBER = 0xC000017A, + MD_NTSTATUS_WIN_STATUS_INVALID_MEMBER = 0xC000017B, + MD_NTSTATUS_WIN_STATUS_KEY_DELETED = 0xC000017C, + MD_NTSTATUS_WIN_STATUS_NO_LOG_SPACE = 0xC000017D, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_SIDS = 0xC000017E, + MD_NTSTATUS_WIN_STATUS_LM_CROSS_ENCRYPTION_REQUIRED = 0xC000017F, + MD_NTSTATUS_WIN_STATUS_KEY_HAS_CHILDREN = 0xC0000180, + MD_NTSTATUS_WIN_STATUS_CHILD_MUST_BE_VOLATILE = 0xC0000181, + MD_NTSTATUS_WIN_STATUS_DEVICE_CONFIGURATION_ERROR = 0xC0000182, + MD_NTSTATUS_WIN_STATUS_DRIVER_INTERNAL_ERROR = 0xC0000183, + MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_STATE = 0xC0000184, + MD_NTSTATUS_WIN_STATUS_IO_DEVICE_ERROR = 0xC0000185, + MD_NTSTATUS_WIN_STATUS_DEVICE_PROTOCOL_ERROR = 0xC0000186, + MD_NTSTATUS_WIN_STATUS_BACKUP_CONTROLLER = 0xC0000187, + MD_NTSTATUS_WIN_STATUS_LOG_FILE_FULL = 0xC0000188, + MD_NTSTATUS_WIN_STATUS_TOO_LATE = 0xC0000189, + MD_NTSTATUS_WIN_STATUS_NO_TRUST_LSA_SECRET = 0xC000018A, + MD_NTSTATUS_WIN_STATUS_NO_TRUST_SAM_ACCOUNT = 0xC000018B, + MD_NTSTATUS_WIN_STATUS_TRUSTED_DOMAIN_FAILURE = 0xC000018C, + MD_NTSTATUS_WIN_STATUS_TRUSTED_RELATIONSHIP_FAILURE = 0xC000018D, + MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CORRUPT = 0xC000018E, + MD_NTSTATUS_WIN_STATUS_EVENTLOG_CANT_START = 0xC000018F, + MD_NTSTATUS_WIN_STATUS_TRUST_FAILURE = 0xC0000190, + MD_NTSTATUS_WIN_STATUS_MUTANT_LIMIT_EXCEEDED = 0xC0000191, + MD_NTSTATUS_WIN_STATUS_NETLOGON_NOT_STARTED = 0xC0000192, + MD_NTSTATUS_WIN_STATUS_ACCOUNT_EXPIRED = 0xC0000193, + MD_NTSTATUS_WIN_STATUS_POSSIBLE_DEADLOCK = 0xC0000194, + MD_NTSTATUS_WIN_STATUS_NETWORK_CREDENTIAL_CONFLICT = 0xC0000195, + MD_NTSTATUS_WIN_STATUS_REMOTE_SESSION_LIMIT = 0xC0000196, + MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CHANGED = 0xC0000197, + MD_NTSTATUS_WIN_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 0xC0000198, + MD_NTSTATUS_WIN_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 0xC0000199, + MD_NTSTATUS_WIN_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT = 0xC000019A, + MD_NTSTATUS_WIN_STATUS_DOMAIN_TRUST_INCONSISTENT = 0xC000019B, + MD_NTSTATUS_WIN_STATUS_FS_DRIVER_REQUIRED = 0xC000019C, + MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED_AS_DLL = 0xC000019D, + MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 0xC000019E, + MD_NTSTATUS_WIN_STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 0xC000019F, + MD_NTSTATUS_WIN_STATUS_SECURITY_STREAM_IS_INCONSISTENT = 0xC00001A0, + MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_RANGE = 0xC00001A1, + MD_NTSTATUS_WIN_STATUS_INVALID_ACE_CONDITION = 0xC00001A2, + MD_NTSTATUS_WIN_STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT = 0xC00001A3, + MD_NTSTATUS_WIN_STATUS_NOTIFICATION_GUID_ALREADY_DEFINED = 0xC00001A4, + MD_NTSTATUS_WIN_STATUS_INVALID_EXCEPTION_HANDLER = 0xC00001A5, + MD_NTSTATUS_WIN_STATUS_DUPLICATE_PRIVILEGES = 0xC00001A6, + MD_NTSTATUS_WIN_STATUS_NOT_ALLOWED_ON_SYSTEM_FILE = 0xC00001A7, + MD_NTSTATUS_WIN_STATUS_REPAIR_NEEDED = 0xC00001A8, + MD_NTSTATUS_WIN_STATUS_QUOTA_NOT_ENABLED = 0xC00001A9, + MD_NTSTATUS_WIN_STATUS_NO_APPLICATION_PACKAGE = 0xC00001AA, + MD_NTSTATUS_WIN_STATUS_NETWORK_OPEN_RESTRICTION = 0xC0000201, + MD_NTSTATUS_WIN_STATUS_NO_USER_SESSION_KEY = 0xC0000202, + MD_NTSTATUS_WIN_STATUS_USER_SESSION_DELETED = 0xC0000203, + MD_NTSTATUS_WIN_STATUS_RESOURCE_LANG_NOT_FOUND = 0xC0000204, + MD_NTSTATUS_WIN_STATUS_INSUFF_SERVER_RESOURCES = 0xC0000205, + MD_NTSTATUS_WIN_STATUS_INVALID_BUFFER_SIZE = 0xC0000206, + MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_COMPONENT = 0xC0000207, + MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_WILDCARD = 0xC0000208, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_ADDRESSES = 0xC0000209, + MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_EXISTS = 0xC000020A, + MD_NTSTATUS_WIN_STATUS_ADDRESS_CLOSED = 0xC000020B, + MD_NTSTATUS_WIN_STATUS_CONNECTION_DISCONNECTED = 0xC000020C, + MD_NTSTATUS_WIN_STATUS_CONNECTION_RESET = 0xC000020D, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_NODES = 0xC000020E, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_ABORTED = 0xC000020F, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_TIMED_OUT = 0xC0000210, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_RELEASE = 0xC0000211, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_MATCH = 0xC0000212, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONDED = 0xC0000213, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_ID = 0xC0000214, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_TYPE = 0xC0000215, + MD_NTSTATUS_WIN_STATUS_NOT_SERVER_SESSION = 0xC0000216, + MD_NTSTATUS_WIN_STATUS_NOT_CLIENT_SESSION = 0xC0000217, + MD_NTSTATUS_WIN_STATUS_CANNOT_LOAD_REGISTRY_FILE = 0xC0000218, + MD_NTSTATUS_WIN_STATUS_DEBUG_ATTACH_FAILED = 0xC0000219, + MD_NTSTATUS_WIN_STATUS_SYSTEM_PROCESS_TERMINATED = 0xC000021A, + MD_NTSTATUS_WIN_STATUS_DATA_NOT_ACCEPTED = 0xC000021B, + MD_NTSTATUS_WIN_STATUS_NO_BROWSER_SERVERS_FOUND = 0xC000021C, + MD_NTSTATUS_WIN_STATUS_VDM_HARD_ERROR = 0xC000021D, + MD_NTSTATUS_WIN_STATUS_DRIVER_CANCEL_TIMEOUT = 0xC000021E, + MD_NTSTATUS_WIN_STATUS_REPLY_MESSAGE_MISMATCH = 0xC000021F, + MD_NTSTATUS_WIN_STATUS_MAPPED_ALIGNMENT = 0xC0000220, + MD_NTSTATUS_WIN_STATUS_IMAGE_CHECKSUM_MISMATCH = 0xC0000221, + MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA = 0xC0000222, + MD_NTSTATUS_WIN_STATUS_CLIENT_SERVER_PARAMETERS_INVALID = 0xC0000223, + MD_NTSTATUS_WIN_STATUS_PASSWORD_MUST_CHANGE = 0xC0000224, + MD_NTSTATUS_WIN_STATUS_NOT_FOUND = 0xC0000225, + MD_NTSTATUS_WIN_STATUS_NOT_TINY_STREAM = 0xC0000226, + MD_NTSTATUS_WIN_STATUS_RECOVERY_FAILURE = 0xC0000227, + MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW_READ = 0xC0000228, + MD_NTSTATUS_WIN_STATUS_FAIL_CHECK = 0xC0000229, + MD_NTSTATUS_WIN_STATUS_DUPLICATE_OBJECTID = 0xC000022A, + MD_NTSTATUS_WIN_STATUS_OBJECTID_EXISTS = 0xC000022B, + MD_NTSTATUS_WIN_STATUS_CONVERT_TO_LARGE = 0xC000022C, + MD_NTSTATUS_WIN_STATUS_RETRY = 0xC000022D, + MD_NTSTATUS_WIN_STATUS_FOUND_OUT_OF_SCOPE = 0xC000022E, + MD_NTSTATUS_WIN_STATUS_ALLOCATE_BUCKET = 0xC000022F, + MD_NTSTATUS_WIN_STATUS_PROPSET_NOT_FOUND = 0xC0000230, + MD_NTSTATUS_WIN_STATUS_MARSHALL_OVERFLOW = 0xC0000231, + MD_NTSTATUS_WIN_STATUS_INVALID_VARIANT = 0xC0000232, + MD_NTSTATUS_WIN_STATUS_DOMAIN_CONTROLLER_NOT_FOUND = 0xC0000233, + MD_NTSTATUS_WIN_STATUS_ACCOUNT_LOCKED_OUT = 0xC0000234, + MD_NTSTATUS_WIN_STATUS_HANDLE_NOT_CLOSABLE = 0xC0000235, + MD_NTSTATUS_WIN_STATUS_CONNECTION_REFUSED = 0xC0000236, + MD_NTSTATUS_WIN_STATUS_GRACEFUL_DISCONNECT = 0xC0000237, + MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_ASSOCIATED = 0xC0000238, + MD_NTSTATUS_WIN_STATUS_ADDRESS_NOT_ASSOCIATED = 0xC0000239, + MD_NTSTATUS_WIN_STATUS_CONNECTION_INVALID = 0xC000023A, + MD_NTSTATUS_WIN_STATUS_CONNECTION_ACTIVE = 0xC000023B, + MD_NTSTATUS_WIN_STATUS_NETWORK_UNREACHABLE = 0xC000023C, + MD_NTSTATUS_WIN_STATUS_HOST_UNREACHABLE = 0xC000023D, + MD_NTSTATUS_WIN_STATUS_PROTOCOL_UNREACHABLE = 0xC000023E, + MD_NTSTATUS_WIN_STATUS_PORT_UNREACHABLE = 0xC000023F, + MD_NTSTATUS_WIN_STATUS_REQUEST_ABORTED = 0xC0000240, + MD_NTSTATUS_WIN_STATUS_CONNECTION_ABORTED = 0xC0000241, + MD_NTSTATUS_WIN_STATUS_BAD_COMPRESSION_BUFFER = 0xC0000242, + MD_NTSTATUS_WIN_STATUS_USER_MAPPED_FILE = 0xC0000243, + MD_NTSTATUS_WIN_STATUS_AUDIT_FAILED = 0xC0000244, + MD_NTSTATUS_WIN_STATUS_TIMER_RESOLUTION_NOT_SET = 0xC0000245, + MD_NTSTATUS_WIN_STATUS_CONNECTION_COUNT_LIMIT = 0xC0000246, + MD_NTSTATUS_WIN_STATUS_LOGIN_TIME_RESTRICTION = 0xC0000247, + MD_NTSTATUS_WIN_STATUS_LOGIN_WKSTA_RESTRICTION = 0xC0000248, + MD_NTSTATUS_WIN_STATUS_IMAGE_MP_UP_MISMATCH = 0xC0000249, + MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_LOGON_INFO = 0xC0000250, + MD_NTSTATUS_WIN_STATUS_BAD_DLL_ENTRYPOINT = 0xC0000251, + MD_NTSTATUS_WIN_STATUS_BAD_SERVICE_ENTRYPOINT = 0xC0000252, + MD_NTSTATUS_WIN_STATUS_LPC_REPLY_LOST = 0xC0000253, + MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT1 = 0xC0000254, + MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT2 = 0xC0000255, + MD_NTSTATUS_WIN_STATUS_REGISTRY_QUOTA_LIMIT = 0xC0000256, + MD_NTSTATUS_WIN_STATUS_PATH_NOT_COVERED = 0xC0000257, + MD_NTSTATUS_WIN_STATUS_NO_CALLBACK_ACTIVE = 0xC0000258, + MD_NTSTATUS_WIN_STATUS_LICENSE_QUOTA_EXCEEDED = 0xC0000259, + MD_NTSTATUS_WIN_STATUS_PWD_TOO_SHORT = 0xC000025A, + MD_NTSTATUS_WIN_STATUS_PWD_TOO_RECENT = 0xC000025B, + MD_NTSTATUS_WIN_STATUS_PWD_HISTORY_CONFLICT = 0xC000025C, + MD_NTSTATUS_WIN_STATUS_PLUGPLAY_NO_DEVICE = 0xC000025E, + MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_COMPRESSION = 0xC000025F, + MD_NTSTATUS_WIN_STATUS_INVALID_HW_PROFILE = 0xC0000260, + MD_NTSTATUS_WIN_STATUS_INVALID_PLUGPLAY_DEVICE_PATH = 0xC0000261, + MD_NTSTATUS_WIN_STATUS_DRIVER_ORDINAL_NOT_FOUND = 0xC0000262, + MD_NTSTATUS_WIN_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND = 0xC0000263, + MD_NTSTATUS_WIN_STATUS_RESOURCE_NOT_OWNED = 0xC0000264, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_LINKS = 0xC0000265, + MD_NTSTATUS_WIN_STATUS_QUOTA_LIST_INCONSISTENT = 0xC0000266, + MD_NTSTATUS_WIN_STATUS_FILE_IS_OFFLINE = 0xC0000267, + MD_NTSTATUS_WIN_STATUS_EVALUATION_EXPIRATION = 0xC0000268, + MD_NTSTATUS_WIN_STATUS_ILLEGAL_DLL_RELOCATION = 0xC0000269, + MD_NTSTATUS_WIN_STATUS_LICENSE_VIOLATION = 0xC000026A, + MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED_LOGOFF = 0xC000026B, + MD_NTSTATUS_WIN_STATUS_DRIVER_UNABLE_TO_LOAD = 0xC000026C, + MD_NTSTATUS_WIN_STATUS_DFS_UNAVAILABLE = 0xC000026D, + MD_NTSTATUS_WIN_STATUS_VOLUME_DISMOUNTED = 0xC000026E, + MD_NTSTATUS_WIN_STATUS_WX86_INTERNAL_ERROR = 0xC000026F, + MD_NTSTATUS_WIN_STATUS_WX86_FLOAT_STACK_CHECK = 0xC0000270, + MD_NTSTATUS_WIN_STATUS_VALIDATE_CONTINUE = 0xC0000271, + MD_NTSTATUS_WIN_STATUS_NO_MATCH = 0xC0000272, + MD_NTSTATUS_WIN_STATUS_NO_MORE_MATCHES = 0xC0000273, + MD_NTSTATUS_WIN_STATUS_NOT_A_REPARSE_POINT = 0xC0000275, + MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_INVALID = 0xC0000276, + MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_MISMATCH = 0xC0000277, + MD_NTSTATUS_WIN_STATUS_IO_REPARSE_DATA_INVALID = 0xC0000278, + MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_NOT_HANDLED = 0xC0000279, + MD_NTSTATUS_WIN_STATUS_PWD_TOO_LONG = 0xC000027A, + MD_NTSTATUS_WIN_STATUS_STOWED_EXCEPTION = 0xC000027B, + MD_NTSTATUS_WIN_STATUS_REPARSE_POINT_NOT_RESOLVED = 0xC0000280, + MD_NTSTATUS_WIN_STATUS_DIRECTORY_IS_A_REPARSE_POINT = 0xC0000281, + MD_NTSTATUS_WIN_STATUS_RANGE_LIST_CONFLICT = 0xC0000282, + MD_NTSTATUS_WIN_STATUS_SOURCE_ELEMENT_EMPTY = 0xC0000283, + MD_NTSTATUS_WIN_STATUS_DESTINATION_ELEMENT_FULL = 0xC0000284, + MD_NTSTATUS_WIN_STATUS_ILLEGAL_ELEMENT_ADDRESS = 0xC0000285, + MD_NTSTATUS_WIN_STATUS_MAGAZINE_NOT_PRESENT = 0xC0000286, + MD_NTSTATUS_WIN_STATUS_REINITIALIZATION_NEEDED = 0xC0000287, + MD_NTSTATUS_WIN_STATUS_ENCRYPTION_FAILED = 0xC000028A, + MD_NTSTATUS_WIN_STATUS_DECRYPTION_FAILED = 0xC000028B, + MD_NTSTATUS_WIN_STATUS_RANGE_NOT_FOUND = 0xC000028C, + MD_NTSTATUS_WIN_STATUS_NO_RECOVERY_POLICY = 0xC000028D, + MD_NTSTATUS_WIN_STATUS_NO_EFS = 0xC000028E, + MD_NTSTATUS_WIN_STATUS_WRONG_EFS = 0xC000028F, + MD_NTSTATUS_WIN_STATUS_NO_USER_KEYS = 0xC0000290, + MD_NTSTATUS_WIN_STATUS_FILE_NOT_ENCRYPTED = 0xC0000291, + MD_NTSTATUS_WIN_STATUS_NOT_EXPORT_FORMAT = 0xC0000292, + MD_NTSTATUS_WIN_STATUS_FILE_ENCRYPTED = 0xC0000293, + MD_NTSTATUS_WIN_STATUS_WMI_GUID_NOT_FOUND = 0xC0000295, + MD_NTSTATUS_WIN_STATUS_WMI_INSTANCE_NOT_FOUND = 0xC0000296, + MD_NTSTATUS_WIN_STATUS_WMI_ITEMID_NOT_FOUND = 0xC0000297, + MD_NTSTATUS_WIN_STATUS_WMI_TRY_AGAIN = 0xC0000298, + MD_NTSTATUS_WIN_STATUS_SHARED_POLICY = 0xC0000299, + MD_NTSTATUS_WIN_STATUS_POLICY_OBJECT_NOT_FOUND = 0xC000029A, + MD_NTSTATUS_WIN_STATUS_POLICY_ONLY_IN_DS = 0xC000029B, + MD_NTSTATUS_WIN_STATUS_VOLUME_NOT_UPGRADED = 0xC000029C, + MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_NOT_ACTIVE = 0xC000029D, + MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_MEDIA_ERROR = 0xC000029E, + MD_NTSTATUS_WIN_STATUS_NO_TRACKING_SERVICE = 0xC000029F, + MD_NTSTATUS_WIN_STATUS_SERVER_SID_MISMATCH = 0xC00002A0, + MD_NTSTATUS_WIN_STATUS_DS_NO_ATTRIBUTE_OR_VALUE = 0xC00002A1, + MD_NTSTATUS_WIN_STATUS_DS_INVALID_ATTRIBUTE_SYNTAX = 0xC00002A2, + MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED = 0xC00002A3, + MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS = 0xC00002A4, + MD_NTSTATUS_WIN_STATUS_DS_BUSY = 0xC00002A5, + MD_NTSTATUS_WIN_STATUS_DS_UNAVAILABLE = 0xC00002A6, + MD_NTSTATUS_WIN_STATUS_DS_NO_RIDS_ALLOCATED = 0xC00002A7, + MD_NTSTATUS_WIN_STATUS_DS_NO_MORE_RIDS = 0xC00002A8, + MD_NTSTATUS_WIN_STATUS_DS_INCORRECT_ROLE_OWNER = 0xC00002A9, + MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_INIT_ERROR = 0xC00002AA, + MD_NTSTATUS_WIN_STATUS_DS_OBJ_CLASS_VIOLATION = 0xC00002AB, + MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_NON_LEAF = 0xC00002AC, + MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_RDN = 0xC00002AD, + MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_OBJ_CLASS = 0xC00002AE, + MD_NTSTATUS_WIN_STATUS_DS_CROSS_DOM_MOVE_FAILED = 0xC00002AF, + MD_NTSTATUS_WIN_STATUS_DS_GC_NOT_AVAILABLE = 0xC00002B0, + MD_NTSTATUS_WIN_STATUS_DIRECTORY_SERVICE_REQUIRED = 0xC00002B1, + MD_NTSTATUS_WIN_STATUS_REPARSE_ATTRIBUTE_CONFLICT = 0xC00002B2, + MD_NTSTATUS_WIN_STATUS_CANT_ENABLE_DENY_ONLY = 0xC00002B3, + MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_FAULTS = 0xC00002B4, + MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_TRAPS = 0xC00002B5, + MD_NTSTATUS_WIN_STATUS_DEVICE_REMOVED = 0xC00002B6, + MD_NTSTATUS_WIN_STATUS_JOURNAL_DELETE_IN_PROGRESS = 0xC00002B7, + MD_NTSTATUS_WIN_STATUS_JOURNAL_NOT_ACTIVE = 0xC00002B8, + MD_NTSTATUS_WIN_STATUS_NOINTERFACE = 0xC00002B9, + MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_DISABLED = 0xC00002BA, + MD_NTSTATUS_WIN_STATUS_DS_ADMIN_LIMIT_EXCEEDED = 0xC00002C1, + MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_SLEEP = 0xC00002C2, + MD_NTSTATUS_WIN_STATUS_MUTUAL_AUTHENTICATION_FAILED = 0xC00002C3, + MD_NTSTATUS_WIN_STATUS_CORRUPT_SYSTEM_FILE = 0xC00002C4, + MD_NTSTATUS_WIN_STATUS_DATATYPE_MISALIGNMENT_ERROR = 0xC00002C5, + MD_NTSTATUS_WIN_STATUS_WMI_READ_ONLY = 0xC00002C6, + MD_NTSTATUS_WIN_STATUS_WMI_SET_FAILURE = 0xC00002C7, + MD_NTSTATUS_WIN_STATUS_COMMITMENT_MINIMUM = 0xC00002C8, + MD_NTSTATUS_WIN_STATUS_REG_NAT_CONSUMPTION = 0xC00002C9, + MD_NTSTATUS_WIN_STATUS_TRANSPORT_FULL = 0xC00002CA, + MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE = 0xC00002CB, + MD_NTSTATUS_WIN_STATUS_ONLY_IF_CONNECTED = 0xC00002CC, + MD_NTSTATUS_WIN_STATUS_DS_SENSITIVE_GROUP_VIOLATION = 0xC00002CD, + MD_NTSTATUS_WIN_STATUS_PNP_RESTART_ENUMERATION = 0xC00002CE, + MD_NTSTATUS_WIN_STATUS_JOURNAL_ENTRY_DELETED = 0xC00002CF, + MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_PRIMARYGROUPID = 0xC00002D0, + MD_NTSTATUS_WIN_STATUS_SYSTEM_IMAGE_BAD_SIGNATURE = 0xC00002D1, + MD_NTSTATUS_WIN_STATUS_PNP_REBOOT_REQUIRED = 0xC00002D2, + MD_NTSTATUS_WIN_STATUS_POWER_STATE_INVALID = 0xC00002D3, + MD_NTSTATUS_WIN_STATUS_DS_INVALID_GROUP_TYPE = 0xC00002D4, + MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = 0xC00002D5, + MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = 0xC00002D6, + MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = 0xC00002D7, + MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER = 0xC00002D8, + MD_NTSTATUS_WIN_STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = 0xC00002D9, + MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = 0xC00002DA, + MD_NTSTATUS_WIN_STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = 0xC00002DB, + MD_NTSTATUS_WIN_STATUS_DS_HAVE_PRIMARY_MEMBERS = 0xC00002DC, + MD_NTSTATUS_WIN_STATUS_WMI_NOT_SUPPORTED = 0xC00002DD, + MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_POWER = 0xC00002DE, + MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_PASSWORD = 0xC00002DF, + MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_FLOPPY = 0xC00002E0, + MD_NTSTATUS_WIN_STATUS_DS_CANT_START = 0xC00002E1, + MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE = 0xC00002E2, + MD_NTSTATUS_WIN_STATUS_SAM_INIT_FAILURE = 0xC00002E3, + MD_NTSTATUS_WIN_STATUS_DS_GC_REQUIRED = 0xC00002E4, + MD_NTSTATUS_WIN_STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = 0xC00002E5, + MD_NTSTATUS_WIN_STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS = 0xC00002E6, + MD_NTSTATUS_WIN_STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = 0xC00002E7, + MD_NTSTATUS_WIN_STATUS_MULTIPLE_FAULT_VIOLATION = 0xC00002E8, + MD_NTSTATUS_WIN_STATUS_CURRENT_DOMAIN_NOT_ALLOWED = 0xC00002E9, + MD_NTSTATUS_WIN_STATUS_CANNOT_MAKE = 0xC00002EA, + MD_NTSTATUS_WIN_STATUS_SYSTEM_SHUTDOWN = 0xC00002EB, + MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE_CONSOLE = 0xC00002EC, + MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE_CONSOLE = 0xC00002ED, + MD_NTSTATUS_WIN_STATUS_UNFINISHED_CONTEXT_DELETED = 0xC00002EE, + MD_NTSTATUS_WIN_STATUS_NO_TGT_REPLY = 0xC00002EF, + MD_NTSTATUS_WIN_STATUS_OBJECTID_NOT_FOUND = 0xC00002F0, + MD_NTSTATUS_WIN_STATUS_NO_IP_ADDRESSES = 0xC00002F1, + MD_NTSTATUS_WIN_STATUS_WRONG_CREDENTIAL_HANDLE = 0xC00002F2, + MD_NTSTATUS_WIN_STATUS_CRYPTO_SYSTEM_INVALID = 0xC00002F3, + MD_NTSTATUS_WIN_STATUS_MAX_REFERRALS_EXCEEDED = 0xC00002F4, + MD_NTSTATUS_WIN_STATUS_MUST_BE_KDC = 0xC00002F5, + MD_NTSTATUS_WIN_STATUS_STRONG_CRYPTO_NOT_SUPPORTED = 0xC00002F6, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_PRINCIPALS = 0xC00002F7, + MD_NTSTATUS_WIN_STATUS_NO_PA_DATA = 0xC00002F8, + MD_NTSTATUS_WIN_STATUS_PKINIT_NAME_MISMATCH = 0xC00002F9, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_LOGON_REQUIRED = 0xC00002FA, + MD_NTSTATUS_WIN_STATUS_KDC_INVALID_REQUEST = 0xC00002FB, + MD_NTSTATUS_WIN_STATUS_KDC_UNABLE_TO_REFER = 0xC00002FC, + MD_NTSTATUS_WIN_STATUS_KDC_UNKNOWN_ETYPE = 0xC00002FD, + MD_NTSTATUS_WIN_STATUS_SHUTDOWN_IN_PROGRESS = 0xC00002FE, + MD_NTSTATUS_WIN_STATUS_SERVER_SHUTDOWN_IN_PROGRESS = 0xC00002FF, + MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_ON_SBS = 0xC0000300, + MD_NTSTATUS_WIN_STATUS_WMI_GUID_DISCONNECTED = 0xC0000301, + MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_DISABLED = 0xC0000302, + MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_ENABLED = 0xC0000303, + MD_NTSTATUS_WIN_STATUS_MFT_TOO_FRAGMENTED = 0xC0000304, + MD_NTSTATUS_WIN_STATUS_COPY_PROTECTION_FAILURE = 0xC0000305, + MD_NTSTATUS_WIN_STATUS_CSS_AUTHENTICATION_FAILURE = 0xC0000306, + MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_PRESENT = 0xC0000307, + MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_ESTABLISHED = 0xC0000308, + MD_NTSTATUS_WIN_STATUS_CSS_SCRAMBLED_SECTOR = 0xC0000309, + MD_NTSTATUS_WIN_STATUS_CSS_REGION_MISMATCH = 0xC000030A, + MD_NTSTATUS_WIN_STATUS_CSS_RESETS_EXHAUSTED = 0xC000030B, + MD_NTSTATUS_WIN_STATUS_PASSWORD_CHANGE_REQUIRED = 0xC000030C, + MD_NTSTATUS_WIN_STATUS_PKINIT_FAILURE = 0xC0000320, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_SUBSYSTEM_FAILURE = 0xC0000321, + MD_NTSTATUS_WIN_STATUS_NO_KERB_KEY = 0xC0000322, + MD_NTSTATUS_WIN_STATUS_HOST_DOWN = 0xC0000350, + MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_PREAUTH = 0xC0000351, + MD_NTSTATUS_WIN_STATUS_EFS_ALG_BLOB_TOO_BIG = 0xC0000352, + MD_NTSTATUS_WIN_STATUS_PORT_NOT_SET = 0xC0000353, + MD_NTSTATUS_WIN_STATUS_DEBUGGER_INACTIVE = 0xC0000354, + MD_NTSTATUS_WIN_STATUS_DS_VERSION_CHECK_FAILURE = 0xC0000355, + MD_NTSTATUS_WIN_STATUS_AUDITING_DISABLED = 0xC0000356, + MD_NTSTATUS_WIN_STATUS_PRENT4_MACHINE_ACCOUNT = 0xC0000357, + MD_NTSTATUS_WIN_STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER = 0xC0000358, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_32 = 0xC0000359, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_64 = 0xC000035A, + MD_NTSTATUS_WIN_STATUS_BAD_BINDINGS = 0xC000035B, + MD_NTSTATUS_WIN_STATUS_NETWORK_SESSION_EXPIRED = 0xC000035C, + MD_NTSTATUS_WIN_STATUS_APPHELP_BLOCK = 0xC000035D, + MD_NTSTATUS_WIN_STATUS_ALL_SIDS_FILTERED = 0xC000035E, + MD_NTSTATUS_WIN_STATUS_NOT_SAFE_MODE_DRIVER = 0xC000035F, + MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT = 0xC0000361, + MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PATH = 0xC0000362, + MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER = 0xC0000363, + MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_OTHER = 0xC0000364, + MD_NTSTATUS_WIN_STATUS_FAILED_DRIVER_ENTRY = 0xC0000365, + MD_NTSTATUS_WIN_STATUS_DEVICE_ENUMERATION_ERROR = 0xC0000366, + MD_NTSTATUS_WIN_STATUS_MOUNT_POINT_NOT_RESOLVED = 0xC0000368, + MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_OBJECT_PARAMETER = 0xC0000369, + MD_NTSTATUS_WIN_STATUS_MCA_OCCURED = 0xC000036A, + MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED_CRITICAL = 0xC000036B, + MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED = 0xC000036C, + MD_NTSTATUS_WIN_STATUS_DRIVER_DATABASE_ERROR = 0xC000036D, + MD_NTSTATUS_WIN_STATUS_SYSTEM_HIVE_TOO_LARGE = 0xC000036E, + MD_NTSTATUS_WIN_STATUS_INVALID_IMPORT_OF_NON_DLL = 0xC000036F, + MD_NTSTATUS_WIN_STATUS_NO_SECRETS = 0xC0000371, + MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY = 0xC0000372, + MD_NTSTATUS_WIN_STATUS_FAILED_STACK_SWITCH = 0xC0000373, + MD_NTSTATUS_WIN_STATUS_HEAP_CORRUPTION = 0xC0000374, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_WRONG_PIN = 0xC0000380, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_BLOCKED = 0xC0000381, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED = 0xC0000382, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CARD = 0xC0000383, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEY_CONTAINER = 0xC0000384, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CERTIFICATE = 0xC0000385, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEYSET = 0xC0000386, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_IO_ERROR = 0xC0000387, + MD_NTSTATUS_WIN_STATUS_DOWNGRADE_DETECTED = 0xC0000388, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_REVOKED = 0xC0000389, + MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED = 0xC000038A, + MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_C = 0xC000038B, + MD_NTSTATUS_WIN_STATUS_PKINIT_CLIENT_FAILURE = 0xC000038C, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_EXPIRED = 0xC000038D, + MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_PRIOR_UNLOAD = 0xC000038E, + MD_NTSTATUS_WIN_STATUS_SMARTCARD_SILENT_CONTEXT = 0xC000038F, + MD_NTSTATUS_WIN_STATUS_PER_USER_TRUST_QUOTA_EXCEEDED = 0xC0000401, + MD_NTSTATUS_WIN_STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED = 0xC0000402, + MD_NTSTATUS_WIN_STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED = 0xC0000403, + MD_NTSTATUS_WIN_STATUS_DS_NAME_NOT_UNIQUE = 0xC0000404, + MD_NTSTATUS_WIN_STATUS_DS_DUPLICATE_ID_FOUND = 0xC0000405, + MD_NTSTATUS_WIN_STATUS_DS_GROUP_CONVERSION_ERROR = 0xC0000406, + MD_NTSTATUS_WIN_STATUS_VOLSNAP_PREPARE_HIBERNATE = 0xC0000407, + MD_NTSTATUS_WIN_STATUS_USER2USER_REQUIRED = 0xC0000408, + MD_NTSTATUS_WIN_STATUS_STACK_BUFFER_OVERRUN = 0xC0000409, + MD_NTSTATUS_WIN_STATUS_NO_S4U_PROT_SUPPORT = 0xC000040A, + MD_NTSTATUS_WIN_STATUS_CROSSREALM_DELEGATION_FAILURE = 0xC000040B, + MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_KDC = 0xC000040C, + MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED_KDC = 0xC000040D, + MD_NTSTATUS_WIN_STATUS_KDC_CERT_EXPIRED = 0xC000040E, + MD_NTSTATUS_WIN_STATUS_KDC_CERT_REVOKED = 0xC000040F, + MD_NTSTATUS_WIN_STATUS_PARAMETER_QUOTA_EXCEEDED = 0xC0000410, + MD_NTSTATUS_WIN_STATUS_HIBERNATION_FAILURE = 0xC0000411, + MD_NTSTATUS_WIN_STATUS_DELAY_LOAD_FAILED = 0xC0000412, + MD_NTSTATUS_WIN_STATUS_AUTHENTICATION_FIREWALL_FAILED = 0xC0000413, + MD_NTSTATUS_WIN_STATUS_VDM_DISALLOWED = 0xC0000414, + MD_NTSTATUS_WIN_STATUS_HUNG_DISPLAY_DRIVER_THREAD = 0xC0000415, + MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE = 0xC0000416, + MD_NTSTATUS_WIN_STATUS_INVALID_CRUNTIME_PARAMETER = 0xC0000417, + MD_NTSTATUS_WIN_STATUS_NTLM_BLOCKED = 0xC0000418, + MD_NTSTATUS_WIN_STATUS_DS_SRC_SID_EXISTS_IN_FOREST = 0xC0000419, + MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST = 0xC000041A, + MD_NTSTATUS_WIN_STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST = 0xC000041B, + MD_NTSTATUS_WIN_STATUS_INVALID_USER_PRINCIPAL_NAME = 0xC000041C, + MD_NTSTATUS_WIN_STATUS_FATAL_USER_CALLBACK_EXCEPTION = 0xC000041D, + MD_NTSTATUS_WIN_STATUS_ASSERTION_FAILURE = 0xC0000420, + MD_NTSTATUS_WIN_STATUS_VERIFIER_STOP = 0xC0000421, + MD_NTSTATUS_WIN_STATUS_CALLBACK_POP_STACK = 0xC0000423, + MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_DRIVER_BLOCKED = 0xC0000424, + MD_NTSTATUS_WIN_STATUS_HIVE_UNLOADED = 0xC0000425, + MD_NTSTATUS_WIN_STATUS_COMPRESSION_DISABLED = 0xC0000426, + MD_NTSTATUS_WIN_STATUS_FILE_SYSTEM_LIMITATION = 0xC0000427, + MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_HASH = 0xC0000428, + MD_NTSTATUS_WIN_STATUS_NOT_CAPABLE = 0xC0000429, + MD_NTSTATUS_WIN_STATUS_REQUEST_OUT_OF_SEQUENCE = 0xC000042A, + MD_NTSTATUS_WIN_STATUS_IMPLEMENTATION_LIMIT = 0xC000042B, + MD_NTSTATUS_WIN_STATUS_ELEVATION_REQUIRED = 0xC000042C, + MD_NTSTATUS_WIN_STATUS_NO_SECURITY_CONTEXT = 0xC000042D, + MD_NTSTATUS_WIN_STATUS_PKU2U_CERT_FAILURE = 0xC000042F, + MD_NTSTATUS_WIN_STATUS_BEYOND_VDL = 0xC0000432, + MD_NTSTATUS_WIN_STATUS_ENCOUNTERED_WRITE_IN_PROGRESS = 0xC0000433, + MD_NTSTATUS_WIN_STATUS_PTE_CHANGED = 0xC0000434, + MD_NTSTATUS_WIN_STATUS_PURGE_FAILED = 0xC0000435, + MD_NTSTATUS_WIN_STATUS_CRED_REQUIRES_CONFIRMATION = 0xC0000440, + MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE = 0xC0000441, + MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER = 0xC0000442, + MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE = 0xC0000443, + MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE = 0xC0000444, + MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_FILE_NOT_CSE = 0xC0000445, + MD_NTSTATUS_WIN_STATUS_INVALID_LABEL = 0xC0000446, + MD_NTSTATUS_WIN_STATUS_DRIVER_PROCESS_TERMINATED = 0xC0000450, + MD_NTSTATUS_WIN_STATUS_AMBIGUOUS_SYSTEM_DEVICE = 0xC0000451, + MD_NTSTATUS_WIN_STATUS_SYSTEM_DEVICE_NOT_FOUND = 0xC0000452, + MD_NTSTATUS_WIN_STATUS_RESTART_BOOT_APPLICATION = 0xC0000453, + MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_NVRAM_RESOURCES = 0xC0000454, + MD_NTSTATUS_WIN_STATUS_INVALID_SESSION = 0xC0000455, + MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_SESSION = 0xC0000456, + MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_SESSION = 0xC0000457, + MD_NTSTATUS_WIN_STATUS_INVALID_WEIGHT = 0xC0000458, + MD_NTSTATUS_WIN_STATUS_REQUEST_PAUSED = 0xC0000459, + MD_NTSTATUS_WIN_STATUS_NO_RANGES_PROCESSED = 0xC0000460, + MD_NTSTATUS_WIN_STATUS_DISK_RESOURCES_EXHAUSTED = 0xC0000461, + MD_NTSTATUS_WIN_STATUS_NEEDS_REMEDIATION = 0xC0000462, + MD_NTSTATUS_WIN_STATUS_DEVICE_FEATURE_NOT_SUPPORTED = 0xC0000463, + MD_NTSTATUS_WIN_STATUS_DEVICE_UNREACHABLE = 0xC0000464, + MD_NTSTATUS_WIN_STATUS_INVALID_TOKEN = 0xC0000465, + MD_NTSTATUS_WIN_STATUS_SERVER_UNAVAILABLE = 0xC0000466, + MD_NTSTATUS_WIN_STATUS_FILE_NOT_AVAILABLE = 0xC0000467, + MD_NTSTATUS_WIN_STATUS_DEVICE_INSUFFICIENT_RESOURCES = 0xC0000468, + MD_NTSTATUS_WIN_STATUS_PACKAGE_UPDATING = 0xC0000469, + MD_NTSTATUS_WIN_STATUS_NOT_READ_FROM_COPY = 0xC000046A, + MD_NTSTATUS_WIN_STATUS_FT_WRITE_FAILURE = 0xC000046B, + MD_NTSTATUS_WIN_STATUS_FT_DI_SCAN_REQUIRED = 0xC000046C, + MD_NTSTATUS_WIN_STATUS_OBJECT_NOT_EXTERNALLY_BACKED = 0xC000046D, + MD_NTSTATUS_WIN_STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN = 0xC000046E, + MD_NTSTATUS_WIN_STATUS_DATA_CHECKSUM_ERROR = 0xC0000470, + MD_NTSTATUS_WIN_STATUS_INTERMIXED_KERNEL_EA_OPERATION = 0xC0000471, + MD_NTSTATUS_WIN_STATUS_TRIM_READ_ZERO_NOT_SUPPORTED = 0xC0000472, + MD_NTSTATUS_WIN_STATUS_TOO_MANY_SEGMENT_DESCRIPTORS = 0xC0000473, + MD_NTSTATUS_WIN_STATUS_INVALID_OFFSET_ALIGNMENT = 0xC0000474, + MD_NTSTATUS_WIN_STATUS_INVALID_FIELD_IN_PARAMETER_LIST = 0xC0000475, + MD_NTSTATUS_WIN_STATUS_OPERATION_IN_PROGRESS = 0xC0000476, + MD_NTSTATUS_WIN_STATUS_INVALID_INITIATOR_TARGET_PATH = 0xC0000477, + MD_NTSTATUS_WIN_STATUS_SCRUB_DATA_DISABLED = 0xC0000478, + MD_NTSTATUS_WIN_STATUS_NOT_REDUNDANT_STORAGE = 0xC0000479, + MD_NTSTATUS_WIN_STATUS_RESIDENT_FILE_NOT_SUPPORTED = 0xC000047A, + MD_NTSTATUS_WIN_STATUS_COMPRESSED_FILE_NOT_SUPPORTED = 0xC000047B, + MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_SUPPORTED = 0xC000047C, + MD_NTSTATUS_WIN_STATUS_IO_OPERATION_TIMEOUT = 0xC000047D, + MD_NTSTATUS_WIN_STATUS_SYSTEM_NEEDS_REMEDIATION = 0xC000047E, + MD_NTSTATUS_WIN_STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN = 0xC000047F, + MD_NTSTATUS_WIN_STATUS_SHARE_UNAVAILABLE = 0xC0000480, + MD_NTSTATUS_WIN_STATUS_APISET_NOT_HOSTED = 0xC0000481, + MD_NTSTATUS_WIN_STATUS_APISET_NOT_PRESENT = 0xC0000482, + MD_NTSTATUS_WIN_STATUS_DEVICE_HARDWARE_ERROR = 0xC0000483, + MD_NTSTATUS_WIN_STATUS_INVALID_TASK_NAME = 0xC0000500, + MD_NTSTATUS_WIN_STATUS_INVALID_TASK_INDEX = 0xC0000501, + MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_TASK = 0xC0000502, + MD_NTSTATUS_WIN_STATUS_CALLBACK_BYPASS = 0xC0000503, + MD_NTSTATUS_WIN_STATUS_UNDEFINED_SCOPE = 0xC0000504, + MD_NTSTATUS_WIN_STATUS_INVALID_CAP = 0xC0000505, + MD_NTSTATUS_WIN_STATUS_NOT_GUI_PROCESS = 0xC0000506, + MD_NTSTATUS_WIN_STATUS_FAIL_FAST_EXCEPTION = 0xC0000602, + MD_NTSTATUS_WIN_STATUS_IMAGE_CERT_REVOKED = 0xC0000603, + MD_NTSTATUS_WIN_STATUS_DYNAMIC_CODE_BLOCKED = 0xC0000604, + MD_NTSTATUS_WIN_STATUS_PORT_CLOSED = 0xC0000700, + MD_NTSTATUS_WIN_STATUS_MESSAGE_LOST = 0xC0000701, + MD_NTSTATUS_WIN_STATUS_INVALID_MESSAGE = 0xC0000702, + MD_NTSTATUS_WIN_STATUS_REQUEST_CANCELED = 0xC0000703, + MD_NTSTATUS_WIN_STATUS_RECURSIVE_DISPATCH = 0xC0000704, + MD_NTSTATUS_WIN_STATUS_LPC_RECEIVE_BUFFER_EXPECTED = 0xC0000705, + MD_NTSTATUS_WIN_STATUS_LPC_INVALID_CONNECTION_USAGE = 0xC0000706, + MD_NTSTATUS_WIN_STATUS_LPC_REQUESTS_NOT_ALLOWED = 0xC0000707, + MD_NTSTATUS_WIN_STATUS_RESOURCE_IN_USE = 0xC0000708, + MD_NTSTATUS_WIN_STATUS_HARDWARE_MEMORY_ERROR = 0xC0000709, + MD_NTSTATUS_WIN_STATUS_THREADPOOL_HANDLE_EXCEPTION = 0xC000070A, + MD_NTSTATUS_WIN_STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED = 0xC000070B, + MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED = 0xC000070C, + MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED = 0xC000070D, + MD_NTSTATUS_WIN_STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED = 0xC000070E, + MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASED_DURING_OPERATION = 0xC000070F, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING = 0xC0000710, + MD_NTSTATUS_WIN_STATUS_APC_RETURNED_WHILE_IMPERSONATING = 0xC0000711, + MD_NTSTATUS_WIN_STATUS_PROCESS_IS_PROTECTED = 0xC0000712, + MD_NTSTATUS_WIN_STATUS_MCA_EXCEPTION = 0xC0000713, + MD_NTSTATUS_WIN_STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE = 0xC0000714, + MD_NTSTATUS_WIN_STATUS_SYMLINK_CLASS_DISABLED = 0xC0000715, + MD_NTSTATUS_WIN_STATUS_INVALID_IDN_NORMALIZATION = 0xC0000716, + MD_NTSTATUS_WIN_STATUS_NO_UNICODE_TRANSLATION = 0xC0000717, + MD_NTSTATUS_WIN_STATUS_ALREADY_REGISTERED = 0xC0000718, + MD_NTSTATUS_WIN_STATUS_CONTEXT_MISMATCH = 0xC0000719, + MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_HAS_COMPLETION_LIST = 0xC000071A, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_PRIORITY = 0xC000071B, + MD_NTSTATUS_WIN_STATUS_INVALID_THREAD = 0xC000071C, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_TRANSACTION = 0xC000071D, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LDR_LOCK = 0xC000071E, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LANG = 0xC000071F, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_PRI_BACK = 0xC0000720, + MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_AFFINITY = 0xC0000721, + MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_DISABLED = 0xC0000800, + MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_RENAME_IN_PROGRESS = 0xC0000801, + MD_NTSTATUS_WIN_STATUS_DISK_QUOTA_EXCEEDED = 0xC0000802, + MD_NTSTATUS_WIN_STATUS_CONTENT_BLOCKED = 0xC0000804, + MD_NTSTATUS_WIN_STATUS_BAD_CLUSTERS = 0xC0000805, + MD_NTSTATUS_WIN_STATUS_VOLUME_DIRTY = 0xC0000806, + MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_UNSUCCESSFUL = 0xC0000808, + MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_OVERFULL = 0xC0000809, + MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CORRUPTED = 0xC000080A, + MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UNAVAILABLE = 0xC000080B, + MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_DELETED_FULL = 0xC000080C, + MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CLEARED = 0xC000080D, + MD_NTSTATUS_WIN_STATUS_ORPHAN_NAME_EXHAUSTED = 0xC000080E, + MD_NTSTATUS_WIN_STATUS_PROACTIVE_SCAN_IN_PROGRESS = 0xC000080F, + MD_NTSTATUS_WIN_STATUS_ENCRYPTED_IO_NOT_POSSIBLE = 0xC0000810, + MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UPLEVEL_RECORDS = 0xC0000811, + MD_NTSTATUS_WIN_STATUS_FILE_CHECKED_OUT = 0xC0000901, + MD_NTSTATUS_WIN_STATUS_CHECKOUT_REQUIRED = 0xC0000902, + MD_NTSTATUS_WIN_STATUS_BAD_FILE_TYPE = 0xC0000903, + MD_NTSTATUS_WIN_STATUS_FILE_TOO_LARGE = 0xC0000904, + MD_NTSTATUS_WIN_STATUS_FORMS_AUTH_REQUIRED = 0xC0000905, + MD_NTSTATUS_WIN_STATUS_VIRUS_INFECTED = 0xC0000906, + MD_NTSTATUS_WIN_STATUS_VIRUS_DELETED = 0xC0000907, + MD_NTSTATUS_WIN_STATUS_BAD_MCFG_TABLE = 0xC0000908, + MD_NTSTATUS_WIN_STATUS_CANNOT_BREAK_OPLOCK = 0xC0000909, + MD_NTSTATUS_WIN_STATUS_BAD_KEY = 0xC000090A, + MD_NTSTATUS_WIN_STATUS_BAD_DATA = 0xC000090B, + MD_NTSTATUS_WIN_STATUS_NO_KEY = 0xC000090C, + MD_NTSTATUS_WIN_STATUS_FILE_HANDLE_REVOKED = 0xC0000910, + MD_NTSTATUS_WIN_STATUS_WOW_ASSERTION = 0xC0009898, + MD_NTSTATUS_WIN_STATUS_INVALID_SIGNATURE = 0xC000A000, + MD_NTSTATUS_WIN_STATUS_HMAC_NOT_SUPPORTED = 0xC000A001, + MD_NTSTATUS_WIN_STATUS_AUTH_TAG_MISMATCH = 0xC000A002, + MD_NTSTATUS_WIN_STATUS_INVALID_STATE_TRANSITION = 0xC000A003, + MD_NTSTATUS_WIN_STATUS_INVALID_KERNEL_INFO_VERSION = 0xC000A004, + MD_NTSTATUS_WIN_STATUS_INVALID_PEP_INFO_VERSION = 0xC000A005, + MD_NTSTATUS_WIN_STATUS_IPSEC_QUEUE_OVERFLOW = 0xC000A010, + MD_NTSTATUS_WIN_STATUS_ND_QUEUE_OVERFLOW = 0xC000A011, + MD_NTSTATUS_WIN_STATUS_HOPLIMIT_EXCEEDED = 0xC000A012, + MD_NTSTATUS_WIN_STATUS_PROTOCOL_NOT_SUPPORTED = 0xC000A013, + MD_NTSTATUS_WIN_STATUS_FASTPATH_REJECTED = 0xC000A014, + MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED = 0xC000A080, + MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR = 0xC000A081, + MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR = 0xC000A082, + MD_NTSTATUS_WIN_STATUS_XML_PARSE_ERROR = 0xC000A083, + MD_NTSTATUS_WIN_STATUS_XMLDSIG_ERROR = 0xC000A084, + MD_NTSTATUS_WIN_STATUS_WRONG_COMPARTMENT = 0xC000A085, + MD_NTSTATUS_WIN_STATUS_AUTHIP_FAILURE = 0xC000A086, + MD_NTSTATUS_WIN_STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS = 0xC000A087, + MD_NTSTATUS_WIN_STATUS_DS_OID_NOT_FOUND = 0xC000A088, + MD_NTSTATUS_WIN_STATUS_INCORRECT_ACCOUNT_TYPE = 0xC000A089, + MD_NTSTATUS_WIN_STATUS_HASH_NOT_SUPPORTED = 0xC000A100, + MD_NTSTATUS_WIN_STATUS_HASH_NOT_PRESENT = 0xC000A101, + MD_NTSTATUS_WIN_STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED = 0xC000A121, + MD_NTSTATUS_WIN_STATUS_GPIO_CLIENT_INFORMATION_INVALID = 0xC000A122, + MD_NTSTATUS_WIN_STATUS_GPIO_VERSION_NOT_SUPPORTED = 0xC000A123, + MD_NTSTATUS_WIN_STATUS_GPIO_INVALID_REGISTRATION_PACKET = 0xC000A124, + MD_NTSTATUS_WIN_STATUS_GPIO_OPERATION_DENIED = 0xC000A125, + MD_NTSTATUS_WIN_STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE = 0xC000A126, + MD_NTSTATUS_WIN_STATUS_CANNOT_SWITCH_RUNLEVEL = 0xC000A141, + MD_NTSTATUS_WIN_STATUS_INVALID_RUNLEVEL_SETTING = 0xC000A142, + MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_TIMEOUT = 0xC000A143, + MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT = 0xC000A145, + MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_IN_PROGRESS = 0xC000A146, + MD_NTSTATUS_WIN_STATUS_NOT_APPCONTAINER = 0xC000A200, + MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_IN_APPCONTAINER = 0xC000A201, + MD_NTSTATUS_WIN_STATUS_INVALID_PACKAGE_SID_LENGTH = 0xC000A202, + MD_NTSTATUS_WIN_STATUS_APP_DATA_NOT_FOUND = 0xC000A281, + MD_NTSTATUS_WIN_STATUS_APP_DATA_EXPIRED = 0xC000A282, + MD_NTSTATUS_WIN_STATUS_APP_DATA_CORRUPT = 0xC000A283, + MD_NTSTATUS_WIN_STATUS_APP_DATA_LIMIT_EXCEEDED = 0xC000A284, + MD_NTSTATUS_WIN_STATUS_APP_DATA_REBOOT_REQUIRED = 0xC000A285, + MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED = 0xC000A2A1, + MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED = 0xC000A2A2, + MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED = 0xC000A2A3, + MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED = 0xC000A2A4, + MD_NTSTATUS_WIN_DBG_NO_STATE_CHANGE = 0xC0010001, + MD_NTSTATUS_WIN_DBG_APP_NOT_IDLE = 0xC0010002, + MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_BINDING = 0xC0020001, + MD_NTSTATUS_WIN_RPC_NT_WRONG_KIND_OF_BINDING = 0xC0020002, + MD_NTSTATUS_WIN_RPC_NT_INVALID_BINDING = 0xC0020003, + MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_SUPPORTED = 0xC0020004, + MD_NTSTATUS_WIN_RPC_NT_INVALID_RPC_PROTSEQ = 0xC0020005, + MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_UUID = 0xC0020006, + MD_NTSTATUS_WIN_RPC_NT_INVALID_ENDPOINT_FORMAT = 0xC0020007, + MD_NTSTATUS_WIN_RPC_NT_INVALID_NET_ADDR = 0xC0020008, + MD_NTSTATUS_WIN_RPC_NT_NO_ENDPOINT_FOUND = 0xC0020009, + MD_NTSTATUS_WIN_RPC_NT_INVALID_TIMEOUT = 0xC002000A, + MD_NTSTATUS_WIN_RPC_NT_OBJECT_NOT_FOUND = 0xC002000B, + MD_NTSTATUS_WIN_RPC_NT_ALREADY_REGISTERED = 0xC002000C, + MD_NTSTATUS_WIN_RPC_NT_TYPE_ALREADY_REGISTERED = 0xC002000D, + MD_NTSTATUS_WIN_RPC_NT_ALREADY_LISTENING = 0xC002000E, + MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS_REGISTERED = 0xC002000F, + MD_NTSTATUS_WIN_RPC_NT_NOT_LISTENING = 0xC0020010, + MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_MGR_TYPE = 0xC0020011, + MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_IF = 0xC0020012, + MD_NTSTATUS_WIN_RPC_NT_NO_BINDINGS = 0xC0020013, + MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS = 0xC0020014, + MD_NTSTATUS_WIN_RPC_NT_CANT_CREATE_ENDPOINT = 0xC0020015, + MD_NTSTATUS_WIN_RPC_NT_OUT_OF_RESOURCES = 0xC0020016, + MD_NTSTATUS_WIN_RPC_NT_SERVER_UNAVAILABLE = 0xC0020017, + MD_NTSTATUS_WIN_RPC_NT_SERVER_TOO_BUSY = 0xC0020018, + MD_NTSTATUS_WIN_RPC_NT_INVALID_NETWORK_OPTIONS = 0xC0020019, + MD_NTSTATUS_WIN_RPC_NT_NO_CALL_ACTIVE = 0xC002001A, + MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED = 0xC002001B, + MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED_DNE = 0xC002001C, + MD_NTSTATUS_WIN_RPC_NT_PROTOCOL_ERROR = 0xC002001D, + MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TRANS_SYN = 0xC002001F, + MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TYPE = 0xC0020021, + MD_NTSTATUS_WIN_RPC_NT_INVALID_TAG = 0xC0020022, + MD_NTSTATUS_WIN_RPC_NT_INVALID_BOUND = 0xC0020023, + MD_NTSTATUS_WIN_RPC_NT_NO_ENTRY_NAME = 0xC0020024, + MD_NTSTATUS_WIN_RPC_NT_INVALID_NAME_SYNTAX = 0xC0020025, + MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_NAME_SYNTAX = 0xC0020026, + MD_NTSTATUS_WIN_RPC_NT_UUID_NO_ADDRESS = 0xC0020028, + MD_NTSTATUS_WIN_RPC_NT_DUPLICATE_ENDPOINT = 0xC0020029, + MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_TYPE = 0xC002002A, + MD_NTSTATUS_WIN_RPC_NT_MAX_CALLS_TOO_SMALL = 0xC002002B, + MD_NTSTATUS_WIN_RPC_NT_STRING_TOO_LONG = 0xC002002C, + MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_FOUND = 0xC002002D, + MD_NTSTATUS_WIN_RPC_NT_PROCNUM_OUT_OF_RANGE = 0xC002002E, + MD_NTSTATUS_WIN_RPC_NT_BINDING_HAS_NO_AUTH = 0xC002002F, + MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_SERVICE = 0xC0020030, + MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_LEVEL = 0xC0020031, + MD_NTSTATUS_WIN_RPC_NT_INVALID_AUTH_IDENTITY = 0xC0020032, + MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHZ_SERVICE = 0xC0020033, + MD_NTSTATUS_WIN_EPT_NT_INVALID_ENTRY = 0xC0020034, + MD_NTSTATUS_WIN_EPT_NT_CANT_PERFORM_OP = 0xC0020035, + MD_NTSTATUS_WIN_EPT_NT_NOT_REGISTERED = 0xC0020036, + MD_NTSTATUS_WIN_RPC_NT_NOTHING_TO_EXPORT = 0xC0020037, + MD_NTSTATUS_WIN_RPC_NT_INCOMPLETE_NAME = 0xC0020038, + MD_NTSTATUS_WIN_RPC_NT_INVALID_VERS_OPTION = 0xC0020039, + MD_NTSTATUS_WIN_RPC_NT_NO_MORE_MEMBERS = 0xC002003A, + MD_NTSTATUS_WIN_RPC_NT_NOT_ALL_OBJS_UNEXPORTED = 0xC002003B, + MD_NTSTATUS_WIN_RPC_NT_INTERFACE_NOT_FOUND = 0xC002003C, + MD_NTSTATUS_WIN_RPC_NT_ENTRY_ALREADY_EXISTS = 0xC002003D, + MD_NTSTATUS_WIN_RPC_NT_ENTRY_NOT_FOUND = 0xC002003E, + MD_NTSTATUS_WIN_RPC_NT_NAME_SERVICE_UNAVAILABLE = 0xC002003F, + MD_NTSTATUS_WIN_RPC_NT_INVALID_NAF_ID = 0xC0020040, + MD_NTSTATUS_WIN_RPC_NT_CANNOT_SUPPORT = 0xC0020041, + MD_NTSTATUS_WIN_RPC_NT_NO_CONTEXT_AVAILABLE = 0xC0020042, + MD_NTSTATUS_WIN_RPC_NT_INTERNAL_ERROR = 0xC0020043, + MD_NTSTATUS_WIN_RPC_NT_ZERO_DIVIDE = 0xC0020044, + MD_NTSTATUS_WIN_RPC_NT_ADDRESS_ERROR = 0xC0020045, + MD_NTSTATUS_WIN_RPC_NT_FP_DIV_ZERO = 0xC0020046, + MD_NTSTATUS_WIN_RPC_NT_FP_UNDERFLOW = 0xC0020047, + MD_NTSTATUS_WIN_RPC_NT_FP_OVERFLOW = 0xC0020048, + MD_NTSTATUS_WIN_RPC_NT_CALL_IN_PROGRESS = 0xC0020049, + MD_NTSTATUS_WIN_RPC_NT_NO_MORE_BINDINGS = 0xC002004A, + MD_NTSTATUS_WIN_RPC_NT_GROUP_MEMBER_NOT_FOUND = 0xC002004B, + MD_NTSTATUS_WIN_EPT_NT_CANT_CREATE = 0xC002004C, + MD_NTSTATUS_WIN_RPC_NT_INVALID_OBJECT = 0xC002004D, + MD_NTSTATUS_WIN_RPC_NT_NO_INTERFACES = 0xC002004F, + MD_NTSTATUS_WIN_RPC_NT_CALL_CANCELLED = 0xC0020050, + MD_NTSTATUS_WIN_RPC_NT_BINDING_INCOMPLETE = 0xC0020051, + MD_NTSTATUS_WIN_RPC_NT_COMM_FAILURE = 0xC0020052, + MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_AUTHN_LEVEL = 0xC0020053, + MD_NTSTATUS_WIN_RPC_NT_NO_PRINC_NAME = 0xC0020054, + MD_NTSTATUS_WIN_RPC_NT_NOT_RPC_ERROR = 0xC0020055, + MD_NTSTATUS_WIN_RPC_NT_SEC_PKG_ERROR = 0xC0020057, + MD_NTSTATUS_WIN_RPC_NT_NOT_CANCELLED = 0xC0020058, + MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_HANDLE = 0xC0020062, + MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_CALL = 0xC0020063, + MD_NTSTATUS_WIN_RPC_NT_PROXY_ACCESS_DENIED = 0xC0020064, + MD_NTSTATUS_WIN_RPC_NT_COOKIE_AUTH_FAILED = 0xC0020065, + MD_NTSTATUS_WIN_RPC_NT_NO_MORE_ENTRIES = 0xC0030001, + MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_OPEN_FAIL = 0xC0030002, + MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_SHORT_FILE = 0xC0030003, + MD_NTSTATUS_WIN_RPC_NT_SS_IN_NULL_CONTEXT = 0xC0030004, + MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_MISMATCH = 0xC0030005, + MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_DAMAGED = 0xC0030006, + MD_NTSTATUS_WIN_RPC_NT_SS_HANDLES_MISMATCH = 0xC0030007, + MD_NTSTATUS_WIN_RPC_NT_SS_CANNOT_GET_CALL_HANDLE = 0xC0030008, + MD_NTSTATUS_WIN_RPC_NT_NULL_REF_POINTER = 0xC0030009, + MD_NTSTATUS_WIN_RPC_NT_ENUM_VALUE_OUT_OF_RANGE = 0xC003000A, + MD_NTSTATUS_WIN_RPC_NT_BYTE_COUNT_TOO_SMALL = 0xC003000B, + MD_NTSTATUS_WIN_RPC_NT_BAD_STUB_DATA = 0xC003000C, + MD_NTSTATUS_WIN_RPC_NT_INVALID_ES_ACTION = 0xC0030059, + MD_NTSTATUS_WIN_RPC_NT_WRONG_ES_VERSION = 0xC003005A, + MD_NTSTATUS_WIN_RPC_NT_WRONG_STUB_VERSION = 0xC003005B, + MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OBJECT = 0xC003005C, + MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OPERATION = 0xC003005D, + MD_NTSTATUS_WIN_RPC_NT_WRONG_PIPE_VERSION = 0xC003005E, + MD_NTSTATUS_WIN_RPC_NT_PIPE_CLOSED = 0xC003005F, + MD_NTSTATUS_WIN_RPC_NT_PIPE_DISCIPLINE_ERROR = 0xC0030060, + MD_NTSTATUS_WIN_RPC_NT_PIPE_EMPTY = 0xC0030061, + MD_NTSTATUS_WIN_STATUS_PNP_BAD_MPS_TABLE = 0xC0040035, + MD_NTSTATUS_WIN_STATUS_PNP_TRANSLATION_FAILED = 0xC0040036, + MD_NTSTATUS_WIN_STATUS_PNP_IRQ_TRANSLATION_FAILED = 0xC0040037, + MD_NTSTATUS_WIN_STATUS_PNP_INVALID_ID = 0xC0040038, + MD_NTSTATUS_WIN_STATUS_IO_REISSUE_AS_CACHED = 0xC0040039, + MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_INVALID = 0xC00A0001, + MD_NTSTATUS_WIN_STATUS_CTX_INVALID_PD = 0xC00A0002, + MD_NTSTATUS_WIN_STATUS_CTX_PD_NOT_FOUND = 0xC00A0003, + MD_NTSTATUS_WIN_STATUS_CTX_CLOSE_PENDING = 0xC00A0006, + MD_NTSTATUS_WIN_STATUS_CTX_NO_OUTBUF = 0xC00A0007, + MD_NTSTATUS_WIN_STATUS_CTX_MODEM_INF_NOT_FOUND = 0xC00A0008, + MD_NTSTATUS_WIN_STATUS_CTX_INVALID_MODEMNAME = 0xC00A0009, + MD_NTSTATUS_WIN_STATUS_CTX_RESPONSE_ERROR = 0xC00A000A, + MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_TIMEOUT = 0xC00A000B, + MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_CARRIER = 0xC00A000C, + MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE = 0xC00A000D, + MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_BUSY = 0xC00A000E, + MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_VOICE = 0xC00A000F, + MD_NTSTATUS_WIN_STATUS_CTX_TD_ERROR = 0xC00A0010, + MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_CLIENT_INVALID = 0xC00A0012, + MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_NOT_AVAILABLE = 0xC00A0013, + MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_EXPIRED = 0xC00A0014, + MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NOT_FOUND = 0xC00A0015, + MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_COLLISION = 0xC00A0016, + MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_BUSY = 0xC00A0017, + MD_NTSTATUS_WIN_STATUS_CTX_BAD_VIDEO_MODE = 0xC00A0018, + MD_NTSTATUS_WIN_STATUS_CTX_GRAPHICS_INVALID = 0xC00A0022, + MD_NTSTATUS_WIN_STATUS_CTX_NOT_CONSOLE = 0xC00A0024, + MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_QUERY_TIMEOUT = 0xC00A0026, + MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_DISCONNECT = 0xC00A0027, + MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_CONNECT = 0xC00A0028, + MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DENIED = 0xC00A002A, + MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_ACCESS_DENIED = 0xC00A002B, + MD_NTSTATUS_WIN_STATUS_CTX_INVALID_WD = 0xC00A002E, + MD_NTSTATUS_WIN_STATUS_CTX_WD_NOT_FOUND = 0xC00A002F, + MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_INVALID = 0xC00A0030, + MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DISABLED = 0xC00A0031, + MD_NTSTATUS_WIN_STATUS_RDP_PROTOCOL_ERROR = 0xC00A0032, + MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_NOT_SET = 0xC00A0033, + MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_IN_USE = 0xC00A0034, + MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE = 0xC00A0035, + MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_NOT_RUNNING = 0xC00A0036, + MD_NTSTATUS_WIN_STATUS_CTX_LOGON_DISABLED = 0xC00A0037, + MD_NTSTATUS_WIN_STATUS_CTX_SECURITY_LAYER_ERROR = 0xC00A0038, + MD_NTSTATUS_WIN_STATUS_TS_INCOMPATIBLE_SESSIONS = 0xC00A0039, + MD_NTSTATUS_WIN_STATUS_TS_VIDEO_SUBSYSTEM_ERROR = 0xC00A003A, + MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_FOUND = 0xC00B0001, + MD_NTSTATUS_WIN_STATUS_MUI_INVALID_FILE = 0xC00B0002, + MD_NTSTATUS_WIN_STATUS_MUI_INVALID_RC_CONFIG = 0xC00B0003, + MD_NTSTATUS_WIN_STATUS_MUI_INVALID_LOCALE_NAME = 0xC00B0004, + MD_NTSTATUS_WIN_STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME = 0xC00B0005, + MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_LOADED = 0xC00B0006, + MD_NTSTATUS_WIN_STATUS_RESOURCE_ENUM_USER_STOP = 0xC00B0007, + MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NODE = 0xC0130001, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_EXISTS = 0xC0130002, + MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_IN_PROGRESS = 0xC0130003, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_FOUND = 0xC0130004, + MD_NTSTATUS_WIN_STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND = 0xC0130005, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_EXISTS = 0xC0130006, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_FOUND = 0xC0130007, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_EXISTS = 0xC0130008, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_NOT_FOUND = 0xC0130009, + MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_REQUEST = 0xC013000A, + MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK_PROVIDER = 0xC013000B, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_DOWN = 0xC013000C, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UNREACHABLE = 0xC013000D, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_MEMBER = 0xC013000E, + MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS = 0xC013000F, + MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK = 0xC0130010, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_NET_ADAPTERS = 0xC0130011, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UP = 0xC0130012, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_PAUSED = 0xC0130013, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_PAUSED = 0xC0130014, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_SECURITY_CONTEXT = 0xC0130015, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_INTERNAL = 0xC0130016, + MD_NTSTATUS_WIN_STATUS_CLUSTER_POISONED = 0xC0130017, + MD_NTSTATUS_WIN_STATUS_CLUSTER_NON_CSV_PATH = 0xC0130018, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL = 0xC0130019, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS = 0xC0130020, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR = 0xC0130021, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_REDIRECTED = 0xC0130022, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_NOT_REDIRECTED = 0xC0130023, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING = 0xC0130024, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS = 0xC0130025, + MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL = 0xC0130026, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OPCODE = 0xC0140001, + MD_NTSTATUS_WIN_STATUS_ACPI_STACK_OVERFLOW = 0xC0140002, + MD_NTSTATUS_WIN_STATUS_ACPI_ASSERT_FAILED = 0xC0140003, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_INDEX = 0xC0140004, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGUMENT = 0xC0140005, + MD_NTSTATUS_WIN_STATUS_ACPI_FATAL = 0xC0140006, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_SUPERNAME = 0xC0140007, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGTYPE = 0xC0140008, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OBJTYPE = 0xC0140009, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TARGETTYPE = 0xC014000A, + MD_NTSTATUS_WIN_STATUS_ACPI_INCORRECT_ARGUMENT_COUNT = 0xC014000B, + MD_NTSTATUS_WIN_STATUS_ACPI_ADDRESS_NOT_MAPPED = 0xC014000C, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_EVENTTYPE = 0xC014000D, + MD_NTSTATUS_WIN_STATUS_ACPI_HANDLER_COLLISION = 0xC014000E, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_DATA = 0xC014000F, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_REGION = 0xC0140010, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ACCESS_SIZE = 0xC0140011, + MD_NTSTATUS_WIN_STATUS_ACPI_ACQUIRE_GLOBAL_LOCK = 0xC0140012, + MD_NTSTATUS_WIN_STATUS_ACPI_ALREADY_INITIALIZED = 0xC0140013, + MD_NTSTATUS_WIN_STATUS_ACPI_NOT_INITIALIZED = 0xC0140014, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_MUTEX_LEVEL = 0xC0140015, + MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNED = 0xC0140016, + MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNER = 0xC0140017, + MD_NTSTATUS_WIN_STATUS_ACPI_RS_ACCESS = 0xC0140018, + MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TABLE = 0xC0140019, + MD_NTSTATUS_WIN_STATUS_ACPI_REG_HANDLER_FAILED = 0xC0140020, + MD_NTSTATUS_WIN_STATUS_ACPI_POWER_REQUEST_FAILED = 0xC0140021, + MD_NTSTATUS_WIN_STATUS_SXS_SECTION_NOT_FOUND = 0xC0150001, + MD_NTSTATUS_WIN_STATUS_SXS_CANT_GEN_ACTCTX = 0xC0150002, + MD_NTSTATUS_WIN_STATUS_SXS_INVALID_ACTCTXDATA_FORMAT = 0xC0150003, + MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_NOT_FOUND = 0xC0150004, + MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_FORMAT_ERROR = 0xC0150005, + MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_PARSE_ERROR = 0xC0150006, + MD_NTSTATUS_WIN_STATUS_SXS_ACTIVATION_CONTEXT_DISABLED = 0xC0150007, + MD_NTSTATUS_WIN_STATUS_SXS_KEY_NOT_FOUND = 0xC0150008, + MD_NTSTATUS_WIN_STATUS_SXS_VERSION_CONFLICT = 0xC0150009, + MD_NTSTATUS_WIN_STATUS_SXS_WRONG_SECTION_TYPE = 0xC015000A, + MD_NTSTATUS_WIN_STATUS_SXS_THREAD_QUERIES_DISABLED = 0xC015000B, + MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_MISSING = 0xC015000C, + MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET = 0xC015000E, + MD_NTSTATUS_WIN_STATUS_SXS_EARLY_DEACTIVATION = 0xC015000F, + MD_NTSTATUS_WIN_STATUS_SXS_INVALID_DEACTIVATION = 0xC0150010, + MD_NTSTATUS_WIN_STATUS_SXS_MULTIPLE_DEACTIVATION = 0xC0150011, + MD_NTSTATUS_WIN_STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY = 0xC0150012, + MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_TERMINATION_REQUESTED = 0xC0150013, + MD_NTSTATUS_WIN_STATUS_SXS_CORRUPT_ACTIVATION_STACK = 0xC0150014, + MD_NTSTATUS_WIN_STATUS_SXS_CORRUPTION = 0xC0150015, + MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE = 0xC0150016, + MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME = 0xC0150017, + MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE = 0xC0150018, + MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_PARSE_ERROR = 0xC0150019, + MD_NTSTATUS_WIN_STATUS_SXS_COMPONENT_STORE_CORRUPT = 0xC015001A, + MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISMATCH = 0xC015001B, + MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT = 0xC015001C, + MD_NTSTATUS_WIN_STATUS_SXS_IDENTITIES_DIFFERENT = 0xC015001D, + MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT = 0xC015001E, + MD_NTSTATUS_WIN_STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY = 0xC015001F, + MD_NTSTATUS_WIN_STATUS_ADVANCED_INSTALLER_FAILED = 0xC0150020, + MD_NTSTATUS_WIN_STATUS_XML_ENCODING_MISMATCH = 0xC0150021, + MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_TOO_BIG = 0xC0150022, + MD_NTSTATUS_WIN_STATUS_SXS_SETTING_NOT_REGISTERED = 0xC0150023, + MD_NTSTATUS_WIN_STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE = 0xC0150024, + MD_NTSTATUS_WIN_STATUS_SMI_PRIMITIVE_INSTALLER_FAILED = 0xC0150025, + MD_NTSTATUS_WIN_STATUS_GENERIC_COMMAND_FAILED = 0xC0150026, + MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISSING = 0xC0150027, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_CONFLICT = 0xC0190001, + MD_NTSTATUS_WIN_STATUS_INVALID_TRANSACTION = 0xC0190002, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ACTIVE = 0xC0190003, + MD_NTSTATUS_WIN_STATUS_TM_INITIALIZATION_FAILED = 0xC0190004, + MD_NTSTATUS_WIN_STATUS_RM_NOT_ACTIVE = 0xC0190005, + MD_NTSTATUS_WIN_STATUS_RM_METADATA_CORRUPT = 0xC0190006, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_JOINED = 0xC0190007, + MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_RM = 0xC0190008, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE = 0xC019000A, + MD_NTSTATUS_WIN_STATUS_LOG_RESIZE_INVALID_SIZE = 0xC019000B, + MD_NTSTATUS_WIN_STATUS_REMOTE_FILE_VERSION_MISMATCH = 0xC019000C, + MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_ALREADY_EXISTS = 0xC019000F, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_PROPAGATION_FAILED = 0xC0190010, + MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_NOT_FOUND = 0xC0190011, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_SUPERIOR_EXISTS = 0xC0190012, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUEST_NOT_VALID = 0xC0190013, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_REQUESTED = 0xC0190014, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_ABORTED = 0xC0190015, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_COMMITTED = 0xC0190016, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER = 0xC0190017, + MD_NTSTATUS_WIN_STATUS_CURRENT_TRANSACTION_NOT_VALID = 0xC0190018, + MD_NTSTATUS_WIN_STATUS_LOG_GROWTH_FAILED = 0xC0190019, + MD_NTSTATUS_WIN_STATUS_OBJECT_NO_LONGER_EXISTS = 0xC0190021, + MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_FOUND = 0xC0190022, + MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_VALID = 0xC0190023, + MD_NTSTATUS_WIN_STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION = 0xC0190024, + MD_NTSTATUS_WIN_STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT = 0xC0190025, + MD_NTSTATUS_WIN_STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS = 0xC0190026, + MD_NTSTATUS_WIN_STATUS_HANDLE_NO_LONGER_VALID = 0xC0190028, + MD_NTSTATUS_WIN_STATUS_LOG_CORRUPTION_DETECTED = 0xC0190030, + MD_NTSTATUS_WIN_STATUS_RM_DISCONNECTED = 0xC0190032, + MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_SUPERIOR = 0xC0190033, + MD_NTSTATUS_WIN_STATUS_FILE_IDENTITY_NOT_PERSISTENT = 0xC0190036, + MD_NTSTATUS_WIN_STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY = 0xC0190037, + MD_NTSTATUS_WIN_STATUS_CANT_CROSS_RM_BOUNDARY = 0xC0190038, + MD_NTSTATUS_WIN_STATUS_TXF_DIR_NOT_EMPTY = 0xC0190039, + MD_NTSTATUS_WIN_STATUS_INDOUBT_TRANSACTIONS_EXIST = 0xC019003A, + MD_NTSTATUS_WIN_STATUS_TM_VOLATILE = 0xC019003B, + MD_NTSTATUS_WIN_STATUS_ROLLBACK_TIMER_EXPIRED = 0xC019003C, + MD_NTSTATUS_WIN_STATUS_TXF_ATTRIBUTE_CORRUPT = 0xC019003D, + MD_NTSTATUS_WIN_STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION = 0xC019003E, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED = 0xC019003F, + MD_NTSTATUS_WIN_STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE = 0xC0190040, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUIRED_PROMOTION = 0xC0190043, + MD_NTSTATUS_WIN_STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION = 0xC0190044, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_NOT_FROZEN = 0xC0190045, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_FREEZE_IN_PROGRESS = 0xC0190046, + MD_NTSTATUS_WIN_STATUS_NOT_SNAPSHOT_VOLUME = 0xC0190047, + MD_NTSTATUS_WIN_STATUS_NO_SAVEPOINT_WITH_OPEN_FILES = 0xC0190048, + MD_NTSTATUS_WIN_STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION = 0xC0190049, + MD_NTSTATUS_WIN_STATUS_TM_IDENTITY_MISMATCH = 0xC019004A, + MD_NTSTATUS_WIN_STATUS_FLOATED_SECTION = 0xC019004B, + MD_NTSTATUS_WIN_STATUS_CANNOT_ACCEPT_TRANSACTED_WORK = 0xC019004C, + MD_NTSTATUS_WIN_STATUS_CANNOT_ABORT_TRANSACTIONS = 0xC019004D, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_FOUND = 0xC019004E, + MD_NTSTATUS_WIN_STATUS_RESOURCEMANAGER_NOT_FOUND = 0xC019004F, + MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_FOUND = 0xC0190050, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_FOUND = 0xC0190051, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_ONLINE = 0xC0190052, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION = 0xC0190053, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ROOT = 0xC0190054, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_OBJECT_EXPIRED = 0xC0190055, + MD_NTSTATUS_WIN_STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION = 0xC0190056, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED = 0xC0190057, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_RECORD_TOO_LONG = 0xC0190058, + MD_NTSTATUS_WIN_STATUS_NO_LINK_TRACKING_IN_TRANSACTION = 0xC0190059, + MD_NTSTATUS_WIN_STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION = 0xC019005A, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_INTEGRITY_VIOLATED = 0xC019005B, + MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH = 0xC019005C, + MD_NTSTATUS_WIN_STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT = 0xC019005D, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_MUST_WRITETHROUGH = 0xC019005E, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_SUPERIOR = 0xC019005F, + MD_NTSTATUS_WIN_STATUS_EXPIRED_HANDLE = 0xC0190060, + MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ENLISTED = 0xC0190061, + MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_INVALID = 0xC01A0001, + MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_PARITY_INVALID = 0xC01A0002, + MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_REMAPPED = 0xC01A0003, + MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INCOMPLETE = 0xC01A0004, + MD_NTSTATUS_WIN_STATUS_LOG_INVALID_RANGE = 0xC01A0005, + MD_NTSTATUS_WIN_STATUS_LOG_BLOCKS_EXHAUSTED = 0xC01A0006, + MD_NTSTATUS_WIN_STATUS_LOG_READ_CONTEXT_INVALID = 0xC01A0007, + MD_NTSTATUS_WIN_STATUS_LOG_RESTART_INVALID = 0xC01A0008, + MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_VERSION = 0xC01A0009, + MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INVALID = 0xC01A000A, + MD_NTSTATUS_WIN_STATUS_LOG_READ_MODE_INVALID = 0xC01A000B, + MD_NTSTATUS_WIN_STATUS_LOG_METADATA_CORRUPT = 0xC01A000D, + MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INVALID = 0xC01A000E, + MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INCONSISTENT = 0xC01A000F, + MD_NTSTATUS_WIN_STATUS_LOG_RESERVATION_INVALID = 0xC01A0010, + MD_NTSTATUS_WIN_STATUS_LOG_CANT_DELETE = 0xC01A0011, + MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_LIMIT_EXCEEDED = 0xC01A0012, + MD_NTSTATUS_WIN_STATUS_LOG_START_OF_LOG = 0xC01A0013, + MD_NTSTATUS_WIN_STATUS_LOG_POLICY_ALREADY_INSTALLED = 0xC01A0014, + MD_NTSTATUS_WIN_STATUS_LOG_POLICY_NOT_INSTALLED = 0xC01A0015, + MD_NTSTATUS_WIN_STATUS_LOG_POLICY_INVALID = 0xC01A0016, + MD_NTSTATUS_WIN_STATUS_LOG_POLICY_CONFLICT = 0xC01A0017, + MD_NTSTATUS_WIN_STATUS_LOG_PINNED_ARCHIVE_TAIL = 0xC01A0018, + MD_NTSTATUS_WIN_STATUS_LOG_RECORD_NONEXISTENT = 0xC01A0019, + MD_NTSTATUS_WIN_STATUS_LOG_RECORDS_RESERVED_INVALID = 0xC01A001A, + MD_NTSTATUS_WIN_STATUS_LOG_SPACE_RESERVED_INVALID = 0xC01A001B, + MD_NTSTATUS_WIN_STATUS_LOG_TAIL_INVALID = 0xC01A001C, + MD_NTSTATUS_WIN_STATUS_LOG_FULL = 0xC01A001D, + MD_NTSTATUS_WIN_STATUS_LOG_MULTIPLEXED = 0xC01A001E, + MD_NTSTATUS_WIN_STATUS_LOG_DEDICATED = 0xC01A001F, + MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS = 0xC01A0020, + MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_IN_PROGRESS = 0xC01A0021, + MD_NTSTATUS_WIN_STATUS_LOG_EPHEMERAL = 0xC01A0022, + MD_NTSTATUS_WIN_STATUS_LOG_NOT_ENOUGH_CONTAINERS = 0xC01A0023, + MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_ALREADY_REGISTERED = 0xC01A0024, + MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_NOT_REGISTERED = 0xC01A0025, + MD_NTSTATUS_WIN_STATUS_LOG_FULL_HANDLER_IN_PROGRESS = 0xC01A0026, + MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_READ_FAILED = 0xC01A0027, + MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_WRITE_FAILED = 0xC01A0028, + MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_OPEN_FAILED = 0xC01A0029, + MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_STATE_INVALID = 0xC01A002A, + MD_NTSTATUS_WIN_STATUS_LOG_STATE_INVALID = 0xC01A002B, + MD_NTSTATUS_WIN_STATUS_LOG_PINNED = 0xC01A002C, + MD_NTSTATUS_WIN_STATUS_LOG_METADATA_FLUSH_FAILED = 0xC01A002D, + MD_NTSTATUS_WIN_STATUS_LOG_INCONSISTENT_SECURITY = 0xC01A002E, + MD_NTSTATUS_WIN_STATUS_LOG_APPENDED_FLUSH_FAILED = 0xC01A002F, + MD_NTSTATUS_WIN_STATUS_LOG_PINNED_RESERVATION = 0xC01A0030, + MD_NTSTATUS_WIN_STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD = 0xC01B00EA, + MD_NTSTATUS_WIN_STATUS_FLT_NO_HANDLER_DEFINED = 0xC01C0001, + MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_DEFINED = 0xC01C0002, + MD_NTSTATUS_WIN_STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST = 0xC01C0003, + MD_NTSTATUS_WIN_STATUS_FLT_DISALLOW_FAST_IO = 0xC01C0004, + MD_NTSTATUS_WIN_STATUS_FLT_INVALID_NAME_REQUEST = 0xC01C0005, + MD_NTSTATUS_WIN_STATUS_FLT_NOT_SAFE_TO_POST_OPERATION = 0xC01C0006, + MD_NTSTATUS_WIN_STATUS_FLT_NOT_INITIALIZED = 0xC01C0007, + MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_READY = 0xC01C0008, + MD_NTSTATUS_WIN_STATUS_FLT_POST_OPERATION_CLEANUP = 0xC01C0009, + MD_NTSTATUS_WIN_STATUS_FLT_INTERNAL_ERROR = 0xC01C000A, + MD_NTSTATUS_WIN_STATUS_FLT_DELETING_OBJECT = 0xC01C000B, + MD_NTSTATUS_WIN_STATUS_FLT_MUST_BE_NONPAGED_POOL = 0xC01C000C, + MD_NTSTATUS_WIN_STATUS_FLT_DUPLICATE_ENTRY = 0xC01C000D, + MD_NTSTATUS_WIN_STATUS_FLT_CBDQ_DISABLED = 0xC01C000E, + MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_ATTACH = 0xC01C000F, + MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_DETACH = 0xC01C0010, + MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_ALTITUDE_COLLISION = 0xC01C0011, + MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NAME_COLLISION = 0xC01C0012, + MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_FOUND = 0xC01C0013, + MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_NOT_FOUND = 0xC01C0014, + MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NOT_FOUND = 0xC01C0015, + MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND = 0xC01C0016, + MD_NTSTATUS_WIN_STATUS_FLT_INVALID_CONTEXT_REGISTRATION = 0xC01C0017, + MD_NTSTATUS_WIN_STATUS_FLT_NAME_CACHE_MISS = 0xC01C0018, + MD_NTSTATUS_WIN_STATUS_FLT_NO_DEVICE_OBJECT = 0xC01C0019, + MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_ALREADY_MOUNTED = 0xC01C001A, + MD_NTSTATUS_WIN_STATUS_FLT_ALREADY_ENLISTED = 0xC01C001B, + MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_LINKED = 0xC01C001C, + MD_NTSTATUS_WIN_STATUS_FLT_NO_WAITER_FOR_REPLY = 0xC01C0020, + MD_NTSTATUS_WIN_STATUS_FLT_REGISTRATION_BUSY = 0xC01C0023, + MD_NTSTATUS_WIN_STATUS_MONITOR_NO_DESCRIPTOR = 0xC01D0001, + MD_NTSTATUS_WIN_STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT = 0xC01D0002, + MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM = 0xC01D0003, + MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK = 0xC01D0004, + MD_NTSTATUS_WIN_STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED = 0xC01D0005, + MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK = 0xC01D0006, + MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK = 0xC01D0007, + MD_NTSTATUS_WIN_STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA = 0xC01D0008, + MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK = 0xC01D0009, + MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_MANUFACTURE_DATE = 0xC01D000A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER = 0xC01E0000, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER = 0xC01E0001, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER = 0xC01E0002, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_WAS_RESET = 0xC01E0003, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DRIVER_MODEL = 0xC01E0004, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_MODE_CHANGED = 0xC01E0005, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_OCCLUDED = 0xC01E0006, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_DENIED = 0xC01E0007, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANNOTCOLORCONVERT = 0xC01E0008, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DRIVER_MISMATCH = 0xC01E0009, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED = 0xC01E000B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_UNOCCLUDED = 0xC01E000C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE = 0xC01E000D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED = 0xC01E000E, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDEO_MEMORY = 0xC01E0100, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_LOCK_MEMORY = 0xC01E0101, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_BUSY = 0xC01E0102, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOO_MANY_REFERENCES = 0xC01E0103, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_LATER = 0xC01E0104, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_NOW = 0xC01E0105, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_INVALID = 0xC01E0106, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE = 0xC01E0107, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED = 0xC01E0108, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION = 0xC01E0109, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE = 0xC01E0110, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION = 0xC01E0111, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CLOSED = 0xC01E0112, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE = 0xC01E0113, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE = 0xC01E0114, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE = 0xC01E0115, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST = 0xC01E0116, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE = 0xC01E0200, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY = 0xC01E0300, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED = 0xC01E0301, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED = 0xC01E0302, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN = 0xC01E0303, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE = 0xC01E0304, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET = 0xC01E0305, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED = 0xC01E0306, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET = 0xC01E0308, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET = 0xC01E0309, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_FREQUENCY = 0xC01E030A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ACTIVE_REGION = 0xC01E030B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_TOTAL_REGION = 0xC01E030C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE = 0xC01E0310, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE = 0xC01E0311, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET = 0xC01E0312, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY = 0xC01E0313, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET = 0xC01E0314, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET = 0xC01E0315, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET = 0xC01E0316, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET = 0xC01E0317, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ALREADY_IN_SET = 0xC01E0318, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH = 0xC01E0319, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY = 0xC01E031A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET = 0xC01E031B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE = 0xC01E031C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET = 0xC01E031D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET = 0xC01E031F, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_MODESET = 0xC01E0320, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET = 0xC01E0321, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE = 0xC01E0322, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN = 0xC01E0323, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE = 0xC01E0324, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION = 0xC01E0325, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES = 0xC01E0326, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY = 0xC01E0327, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE = 0xC01E0328, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET = 0xC01E0329, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET = 0xC01E032A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR = 0xC01E032B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET = 0xC01E032C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET = 0xC01E032D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE = 0xC01E032E, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE = 0xC01E032F, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_RESOURCES_NOT_RELATED = 0xC01E0330, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE = 0xC01E0331, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE = 0xC01E0332, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET = 0xC01E0333, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER = 0xC01E0334, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDPNMGR = 0xC01E0335, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_ACTIVE_VIDPN = 0xC01E0336, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY = 0xC01E0337, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NOT_CONNECTED = 0xC01E0338, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY = 0xC01E0339, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE = 0xC01E033A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE = 0xC01E033B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_STRIDE = 0xC01E033C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELFORMAT = 0xC01E033D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COLORBASIS = 0xC01E033E, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE = 0xC01E033F, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY = 0xC01E0340, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT = 0xC01E0341, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE = 0xC01E0342, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN = 0xC01E0343, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL = 0xC01E0344, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION = 0xC01E0345, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED = 0xC01E0346, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_GAMMA_RAMP = 0xC01E0347, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED = 0xC01E0348, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED = 0xC01E0349, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_NOT_IN_MODESET = 0xC01E034A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON = 0xC01E034D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE = 0xC01E034E, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE = 0xC01E034F, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS = 0xC01E0350, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING = 0xC01E0352, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED = 0xC01E0353, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS = 0xC01E0354, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT = 0xC01E0355, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM = 0xC01E0356, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN = 0xC01E0357, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT = 0xC01E0358, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED = 0xC01E0359, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION = 0xC01E035A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_CLIENT_TYPE = 0xC01E035B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET = 0xC01E035C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED = 0xC01E0400, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED = 0xC01E0401, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER = 0xC01E0430, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED = 0xC01E0431, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED = 0xC01E0432, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY = 0xC01E0433, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED = 0xC01E0434, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON = 0xC01E0435, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE = 0xC01E0436, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER = 0xC01E0438, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED = 0xC01E043B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NOT_SUPPORTED = 0xC01E0500, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_COPP_NOT_SUPPORTED = 0xC01E0501, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_UAB_NOT_SUPPORTED = 0xC01E0502, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS = 0xC01E0503, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST = 0xC01E0505, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INTERNAL_ERROR = 0xC01E050B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_HANDLE = 0xC01E050C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH = 0xC01E050E, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED = 0xC01E050F, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED = 0xC01E0510, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_HFS_FAILED = 0xC01E0511, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_SRM = 0xC01E0512, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP = 0xC01E0513, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP = 0xC01E0514, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA = 0xC01E0515, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET = 0xC01E0516, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH = 0xC01E0517, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE = 0xC01E0518, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS = 0xC01E051A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS = 0xC01E051C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST = 0xC01E051D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR = 0xC01E051E, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS = 0xC01E051F, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED = 0xC01E0520, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST = 0xC01E0521, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_NOT_SUPPORTED = 0xC01E0580, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST = 0xC01E0581, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA = 0xC01E0582, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA = 0xC01E0583, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED = 0xC01E0584, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_DATA = 0xC01E0585, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE = 0xC01E0586, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING = 0xC01E0587, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MCA_INTERNAL_ERROR = 0xC01E0588, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND = 0xC01E0589, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH = 0xC01E058A, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM = 0xC01E058B, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE = 0xC01E058C, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS = 0xC01E058D, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED = 0xC01E05E0, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME = 0xC01E05E1, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP = 0xC01E05E2, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED = 0xC01E05E3, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_POINTER = 0xC01E05E4, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE = 0xC01E05E5, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL = 0xC01E05E6, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_INTERNAL_ERROR = 0xC01E05E7, + MD_NTSTATUS_WIN_STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS = 0xC01E05E8, + MD_NTSTATUS_WIN_STATUS_FVE_LOCKED_VOLUME = 0xC0210000, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_ENCRYPTED = 0xC0210001, + MD_NTSTATUS_WIN_STATUS_FVE_BAD_INFORMATION = 0xC0210002, + MD_NTSTATUS_WIN_STATUS_FVE_TOO_SMALL = 0xC0210003, + MD_NTSTATUS_WIN_STATUS_FVE_FAILED_WRONG_FS = 0xC0210004, + MD_NTSTATUS_WIN_STATUS_FVE_BAD_PARTITION_SIZE = 0xC0210005, + MD_NTSTATUS_WIN_STATUS_FVE_FS_NOT_EXTENDED = 0xC0210006, + MD_NTSTATUS_WIN_STATUS_FVE_FS_MOUNTED = 0xC0210007, + MD_NTSTATUS_WIN_STATUS_FVE_NO_LICENSE = 0xC0210008, + MD_NTSTATUS_WIN_STATUS_FVE_ACTION_NOT_ALLOWED = 0xC0210009, + MD_NTSTATUS_WIN_STATUS_FVE_BAD_DATA = 0xC021000A, + MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_NOT_BOUND = 0xC021000B, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_DATA_VOLUME = 0xC021000C, + MD_NTSTATUS_WIN_STATUS_FVE_CONV_READ_ERROR = 0xC021000D, + MD_NTSTATUS_WIN_STATUS_FVE_CONV_WRITE_ERROR = 0xC021000E, + MD_NTSTATUS_WIN_STATUS_FVE_OVERLAPPED_UPDATE = 0xC021000F, + MD_NTSTATUS_WIN_STATUS_FVE_FAILED_SECTOR_SIZE = 0xC0210010, + MD_NTSTATUS_WIN_STATUS_FVE_FAILED_AUTHENTICATION = 0xC0210011, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_OS_VOLUME = 0xC0210012, + MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NOT_FOUND = 0xC0210013, + MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_INVALID = 0xC0210014, + MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NO_VMK = 0xC0210015, + MD_NTSTATUS_WIN_STATUS_FVE_TPM_DISABLED = 0xC0210016, + MD_NTSTATUS_WIN_STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO = 0xC0210017, + MD_NTSTATUS_WIN_STATUS_FVE_TPM_INVALID_PCR = 0xC0210018, + MD_NTSTATUS_WIN_STATUS_FVE_TPM_NO_VMK = 0xC0210019, + MD_NTSTATUS_WIN_STATUS_FVE_PIN_INVALID = 0xC021001A, + MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_APPLICATION = 0xC021001B, + MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_CONFIG = 0xC021001C, + MD_NTSTATUS_WIN_STATUS_FVE_DEBUGGER_ENABLED = 0xC021001D, + MD_NTSTATUS_WIN_STATUS_FVE_DRY_RUN_FAILED = 0xC021001E, + MD_NTSTATUS_WIN_STATUS_FVE_BAD_METADATA_POINTER = 0xC021001F, + MD_NTSTATUS_WIN_STATUS_FVE_OLD_METADATA_COPY = 0xC0210020, + MD_NTSTATUS_WIN_STATUS_FVE_REBOOT_REQUIRED = 0xC0210021, + MD_NTSTATUS_WIN_STATUS_FVE_RAW_ACCESS = 0xC0210022, + MD_NTSTATUS_WIN_STATUS_FVE_RAW_BLOCKED = 0xC0210023, + MD_NTSTATUS_WIN_STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY = 0xC0210024, + MD_NTSTATUS_WIN_STATUS_FVE_MOR_FAILED = 0xC0210025, + MD_NTSTATUS_WIN_STATUS_FVE_NO_FEATURE_LICENSE = 0xC0210026, + MD_NTSTATUS_WIN_STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED = 0xC0210027, + MD_NTSTATUS_WIN_STATUS_FVE_CONV_RECOVERY_FAILED = 0xC0210028, + MD_NTSTATUS_WIN_STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG = 0xC0210029, + MD_NTSTATUS_WIN_STATUS_FVE_INVALID_DATUM_TYPE = 0xC021002A, + MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_TOO_SMALL = 0xC0210030, + MD_NTSTATUS_WIN_STATUS_FVE_ENH_PIN_INVALID = 0xC0210031, + MD_NTSTATUS_WIN_STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE = 0xC0210032, + MD_NTSTATUS_WIN_STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE = 0xC0210033, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK = 0xC0210034, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CLUSTER = 0xC0210035, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING = 0xC0210036, + MD_NTSTATUS_WIN_STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE = 0xC0210037, + MD_NTSTATUS_WIN_STATUS_FVE_EDRIVE_DRY_RUN_FAILED = 0xC0210038, + MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_DISABLED = 0xC0210039, + MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_CONFIG_CHANGE = 0xC021003A, + MD_NTSTATUS_WIN_STATUS_FVE_DEVICE_LOCKEDOUT = 0xC021003B, + MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT = 0xC021003C, + MD_NTSTATUS_WIN_STATUS_FVE_NOT_DE_VOLUME = 0xC021003D, + MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_DISABLED = 0xC021003E, + MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED = 0xC021003F, + MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOT_FOUND = 0xC0220001, + MD_NTSTATUS_WIN_STATUS_FWP_CONDITION_NOT_FOUND = 0xC0220002, + MD_NTSTATUS_WIN_STATUS_FWP_FILTER_NOT_FOUND = 0xC0220003, + MD_NTSTATUS_WIN_STATUS_FWP_LAYER_NOT_FOUND = 0xC0220004, + MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_NOT_FOUND = 0xC0220005, + MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND = 0xC0220006, + MD_NTSTATUS_WIN_STATUS_FWP_SUBLAYER_NOT_FOUND = 0xC0220007, + MD_NTSTATUS_WIN_STATUS_FWP_NOT_FOUND = 0xC0220008, + MD_NTSTATUS_WIN_STATUS_FWP_ALREADY_EXISTS = 0xC0220009, + MD_NTSTATUS_WIN_STATUS_FWP_IN_USE = 0xC022000A, + MD_NTSTATUS_WIN_STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS = 0xC022000B, + MD_NTSTATUS_WIN_STATUS_FWP_WRONG_SESSION = 0xC022000C, + MD_NTSTATUS_WIN_STATUS_FWP_NO_TXN_IN_PROGRESS = 0xC022000D, + MD_NTSTATUS_WIN_STATUS_FWP_TXN_IN_PROGRESS = 0xC022000E, + MD_NTSTATUS_WIN_STATUS_FWP_TXN_ABORTED = 0xC022000F, + MD_NTSTATUS_WIN_STATUS_FWP_SESSION_ABORTED = 0xC0220010, + MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_TXN = 0xC0220011, + MD_NTSTATUS_WIN_STATUS_FWP_TIMEOUT = 0xC0220012, + MD_NTSTATUS_WIN_STATUS_FWP_NET_EVENTS_DISABLED = 0xC0220013, + MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_LAYER = 0xC0220014, + MD_NTSTATUS_WIN_STATUS_FWP_KM_CLIENTS_ONLY = 0xC0220015, + MD_NTSTATUS_WIN_STATUS_FWP_LIFETIME_MISMATCH = 0xC0220016, + MD_NTSTATUS_WIN_STATUS_FWP_BUILTIN_OBJECT = 0xC0220017, + MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_CALLOUTS = 0xC0220018, + MD_NTSTATUS_WIN_STATUS_FWP_NOTIFICATION_DROPPED = 0xC0220019, + MD_NTSTATUS_WIN_STATUS_FWP_TRAFFIC_MISMATCH = 0xC022001A, + MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_SA_STATE = 0xC022001B, + MD_NTSTATUS_WIN_STATUS_FWP_NULL_POINTER = 0xC022001C, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ENUMERATOR = 0xC022001D, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_FLAGS = 0xC022001E, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_NET_MASK = 0xC022001F, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_RANGE = 0xC0220020, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_INTERVAL = 0xC0220021, + MD_NTSTATUS_WIN_STATUS_FWP_ZERO_LENGTH_ARRAY = 0xC0220022, + MD_NTSTATUS_WIN_STATUS_FWP_NULL_DISPLAY_NAME = 0xC0220023, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ACTION_TYPE = 0xC0220024, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_WEIGHT = 0xC0220025, + MD_NTSTATUS_WIN_STATUS_FWP_MATCH_TYPE_MISMATCH = 0xC0220026, + MD_NTSTATUS_WIN_STATUS_FWP_TYPE_MISMATCH = 0xC0220027, + MD_NTSTATUS_WIN_STATUS_FWP_OUT_OF_BOUNDS = 0xC0220028, + MD_NTSTATUS_WIN_STATUS_FWP_RESERVED = 0xC0220029, + MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_CONDITION = 0xC022002A, + MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_KEYMOD = 0xC022002B, + MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER = 0xC022002C, + MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER = 0xC022002D, + MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER = 0xC022002E, + MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT = 0xC022002F, + MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_AUTH_METHOD = 0xC0220030, + MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_DH_GROUP = 0xC0220031, + MD_NTSTATUS_WIN_STATUS_FWP_EM_NOT_SUPPORTED = 0xC0220032, + MD_NTSTATUS_WIN_STATUS_FWP_NEVER_MATCH = 0xC0220033, + MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_MISMATCH = 0xC0220034, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_PARAMETER = 0xC0220035, + MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_SUBLAYERS = 0xC0220036, + MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOTIFICATION_FAILED = 0xC0220037, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_AUTH_TRANSFORM = 0xC0220038, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_CIPHER_TRANSFORM = 0xC0220039, + MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM = 0xC022003A, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TRANSFORM_COMBINATION = 0xC022003B, + MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_AUTH_METHOD = 0xC022003C, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TUNNEL_ENDPOINT = 0xC022003D, + MD_NTSTATUS_WIN_STATUS_FWP_L2_DRIVER_NOT_READY = 0xC022003E, + MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED = 0xC022003F, + MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL = 0xC0220040, + MD_NTSTATUS_WIN_STATUS_FWP_CONNECTIONS_DISABLED = 0xC0220041, + MD_NTSTATUS_WIN_STATUS_FWP_INVALID_DNS_NAME = 0xC0220042, + MD_NTSTATUS_WIN_STATUS_FWP_STILL_ON = 0xC0220043, + MD_NTSTATUS_WIN_STATUS_FWP_IKEEXT_NOT_RUNNING = 0xC0220044, + MD_NTSTATUS_WIN_STATUS_FWP_TCPIP_NOT_READY = 0xC0220100, + MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_CLOSING = 0xC0220101, + MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_STALE = 0xC0220102, + MD_NTSTATUS_WIN_STATUS_FWP_CANNOT_PEND = 0xC0220103, + MD_NTSTATUS_WIN_STATUS_FWP_DROP_NOICMP = 0xC0220104, + MD_NTSTATUS_WIN_STATUS_NDIS_CLOSING = 0xC0230002, + MD_NTSTATUS_WIN_STATUS_NDIS_BAD_VERSION = 0xC0230004, + MD_NTSTATUS_WIN_STATUS_NDIS_BAD_CHARACTERISTICS = 0xC0230005, + MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_FOUND = 0xC0230006, + MD_NTSTATUS_WIN_STATUS_NDIS_OPEN_FAILED = 0xC0230007, + MD_NTSTATUS_WIN_STATUS_NDIS_DEVICE_FAILED = 0xC0230008, + MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_FULL = 0xC0230009, + MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_EXISTS = 0xC023000A, + MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_NOT_FOUND = 0xC023000B, + MD_NTSTATUS_WIN_STATUS_NDIS_REQUEST_ABORTED = 0xC023000C, + MD_NTSTATUS_WIN_STATUS_NDIS_RESET_IN_PROGRESS = 0xC023000D, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PACKET = 0xC023000F, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DEVICE_REQUEST = 0xC0230010, + MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_READY = 0xC0230011, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_LENGTH = 0xC0230014, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DATA = 0xC0230015, + MD_NTSTATUS_WIN_STATUS_NDIS_BUFFER_TOO_SHORT = 0xC0230016, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_OID = 0xC0230017, + MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_REMOVED = 0xC0230018, + MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_MEDIA = 0xC0230019, + MD_NTSTATUS_WIN_STATUS_NDIS_GROUP_ADDRESS_IN_USE = 0xC023001A, + MD_NTSTATUS_WIN_STATUS_NDIS_FILE_NOT_FOUND = 0xC023001B, + MD_NTSTATUS_WIN_STATUS_NDIS_ERROR_READING_FILE = 0xC023001C, + MD_NTSTATUS_WIN_STATUS_NDIS_ALREADY_MAPPED = 0xC023001D, + MD_NTSTATUS_WIN_STATUS_NDIS_RESOURCE_CONFLICT = 0xC023001E, + MD_NTSTATUS_WIN_STATUS_NDIS_MEDIA_DISCONNECTED = 0xC023001F, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_ADDRESS = 0xC0230022, + MD_NTSTATUS_WIN_STATUS_NDIS_PAUSED = 0xC023002A, + MD_NTSTATUS_WIN_STATUS_NDIS_INTERFACE_NOT_FOUND = 0xC023002B, + MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_REVISION = 0xC023002C, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT = 0xC023002D, + MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT_STATE = 0xC023002E, + MD_NTSTATUS_WIN_STATUS_NDIS_LOW_POWER_STATE = 0xC023002F, + MD_NTSTATUS_WIN_STATUS_NDIS_REINIT_REQUIRED = 0xC0230030, + MD_NTSTATUS_WIN_STATUS_NDIS_NOT_SUPPORTED = 0xC02300BB, + MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_POLICY = 0xC023100F, + MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED = 0xC0231012, + MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_PATH_REJECTED = 0xC0231013, + MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED = 0xC0232000, + MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_MEDIA_IN_USE = 0xC0232001, + MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_POWER_STATE_INVALID = 0xC0232002, + MD_NTSTATUS_WIN_STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL = 0xC0232003, + MD_NTSTATUS_WIN_STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL = 0xC0232004, + MD_NTSTATUS_WIN_STATUS_TPM_ERROR_MASK = 0xC0290000, + MD_NTSTATUS_WIN_STATUS_TPM_AUTHFAIL = 0xC0290001, + MD_NTSTATUS_WIN_STATUS_TPM_BADINDEX = 0xC0290002, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAMETER = 0xC0290003, + MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAILURE = 0xC0290004, + MD_NTSTATUS_WIN_STATUS_TPM_CLEAR_DISABLED = 0xC0290005, + MD_NTSTATUS_WIN_STATUS_TPM_DEACTIVATED = 0xC0290006, + MD_NTSTATUS_WIN_STATUS_TPM_DISABLED = 0xC0290007, + MD_NTSTATUS_WIN_STATUS_TPM_DISABLED_CMD = 0xC0290008, + MD_NTSTATUS_WIN_STATUS_TPM_FAIL = 0xC0290009, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_ORDINAL = 0xC029000A, + MD_NTSTATUS_WIN_STATUS_TPM_INSTALL_DISABLED = 0xC029000B, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYHANDLE = 0xC029000C, + MD_NTSTATUS_WIN_STATUS_TPM_KEYNOTFOUND = 0xC029000D, + MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_ENC = 0xC029000E, + MD_NTSTATUS_WIN_STATUS_TPM_MIGRATEFAIL = 0xC029000F, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_PCR_INFO = 0xC0290010, + MD_NTSTATUS_WIN_STATUS_TPM_NOSPACE = 0xC0290011, + MD_NTSTATUS_WIN_STATUS_TPM_NOSRK = 0xC0290012, + MD_NTSTATUS_WIN_STATUS_TPM_NOTSEALED_BLOB = 0xC0290013, + MD_NTSTATUS_WIN_STATUS_TPM_OWNER_SET = 0xC0290014, + MD_NTSTATUS_WIN_STATUS_TPM_RESOURCES = 0xC0290015, + MD_NTSTATUS_WIN_STATUS_TPM_SHORTRANDOM = 0xC0290016, + MD_NTSTATUS_WIN_STATUS_TPM_SIZE = 0xC0290017, + MD_NTSTATUS_WIN_STATUS_TPM_WRONGPCRVAL = 0xC0290018, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAM_SIZE = 0xC0290019, + MD_NTSTATUS_WIN_STATUS_TPM_SHA_THREAD = 0xC029001A, + MD_NTSTATUS_WIN_STATUS_TPM_SHA_ERROR = 0xC029001B, + MD_NTSTATUS_WIN_STATUS_TPM_FAILEDSELFTEST = 0xC029001C, + MD_NTSTATUS_WIN_STATUS_TPM_AUTH2FAIL = 0xC029001D, + MD_NTSTATUS_WIN_STATUS_TPM_BADTAG = 0xC029001E, + MD_NTSTATUS_WIN_STATUS_TPM_IOERROR = 0xC029001F, + MD_NTSTATUS_WIN_STATUS_TPM_ENCRYPT_ERROR = 0xC0290020, + MD_NTSTATUS_WIN_STATUS_TPM_DECRYPT_ERROR = 0xC0290021, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_AUTHHANDLE = 0xC0290022, + MD_NTSTATUS_WIN_STATUS_TPM_NO_ENDORSEMENT = 0xC0290023, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYUSAGE = 0xC0290024, + MD_NTSTATUS_WIN_STATUS_TPM_WRONG_ENTITYTYPE = 0xC0290025, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_POSTINIT = 0xC0290026, + MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_SIG = 0xC0290027, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_KEY_PROPERTY = 0xC0290028, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_MIGRATION = 0xC0290029, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_SCHEME = 0xC029002A, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_DATASIZE = 0xC029002B, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_MODE = 0xC029002C, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_PRESENCE = 0xC029002D, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_VERSION = 0xC029002E, + MD_NTSTATUS_WIN_STATUS_TPM_NO_WRAP_TRANSPORT = 0xC029002F, + MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_UNSUCCESSFUL = 0xC0290030, + MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_SUCCESSFUL = 0xC0290031, + MD_NTSTATUS_WIN_STATUS_TPM_NOTRESETABLE = 0xC0290032, + MD_NTSTATUS_WIN_STATUS_TPM_NOTLOCAL = 0xC0290033, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_TYPE = 0xC0290034, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_RESOURCE = 0xC0290035, + MD_NTSTATUS_WIN_STATUS_TPM_NOTFIPS = 0xC0290036, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_FAMILY = 0xC0290037, + MD_NTSTATUS_WIN_STATUS_TPM_NO_NV_PERMISSION = 0xC0290038, + MD_NTSTATUS_WIN_STATUS_TPM_REQUIRES_SIGN = 0xC0290039, + MD_NTSTATUS_WIN_STATUS_TPM_KEY_NOTSUPPORTED = 0xC029003A, + MD_NTSTATUS_WIN_STATUS_TPM_AUTH_CONFLICT = 0xC029003B, + MD_NTSTATUS_WIN_STATUS_TPM_AREA_LOCKED = 0xC029003C, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_LOCALITY = 0xC029003D, + MD_NTSTATUS_WIN_STATUS_TPM_READ_ONLY = 0xC029003E, + MD_NTSTATUS_WIN_STATUS_TPM_PER_NOWRITE = 0xC029003F, + MD_NTSTATUS_WIN_STATUS_TPM_FAMILYCOUNT = 0xC0290040, + MD_NTSTATUS_WIN_STATUS_TPM_WRITE_LOCKED = 0xC0290041, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_ATTRIBUTES = 0xC0290042, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_STRUCTURE = 0xC0290043, + MD_NTSTATUS_WIN_STATUS_TPM_KEY_OWNER_CONTROL = 0xC0290044, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_COUNTER = 0xC0290045, + MD_NTSTATUS_WIN_STATUS_TPM_NOT_FULLWRITE = 0xC0290046, + MD_NTSTATUS_WIN_STATUS_TPM_CONTEXT_GAP = 0xC0290047, + MD_NTSTATUS_WIN_STATUS_TPM_MAXNVWRITES = 0xC0290048, + MD_NTSTATUS_WIN_STATUS_TPM_NOOPERATOR = 0xC0290049, + MD_NTSTATUS_WIN_STATUS_TPM_RESOURCEMISSING = 0xC029004A, + MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_LOCK = 0xC029004B, + MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_FAMILY = 0xC029004C, + MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_ADMIN = 0xC029004D, + MD_NTSTATUS_WIN_STATUS_TPM_TRANSPORT_NOTEXCLUSIVE = 0xC029004E, + MD_NTSTATUS_WIN_STATUS_TPM_OWNER_CONTROL = 0xC029004F, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_RESOURCES = 0xC0290050, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA0 = 0xC0290051, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA1 = 0xC0290052, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_SETTINGS = 0xC0290053, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_TPM_SETTINGS = 0xC0290054, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_STAGE = 0xC0290055, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_VALIDITY = 0xC0290056, + MD_NTSTATUS_WIN_STATUS_TPM_DAA_WRONG_W = 0xC0290057, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_HANDLE = 0xC0290058, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_DELEGATE = 0xC0290059, + MD_NTSTATUS_WIN_STATUS_TPM_BADCONTEXT = 0xC029005A, + MD_NTSTATUS_WIN_STATUS_TPM_TOOMANYCONTEXTS = 0xC029005B, + MD_NTSTATUS_WIN_STATUS_TPM_MA_TICKET_SIGNATURE = 0xC029005C, + MD_NTSTATUS_WIN_STATUS_TPM_MA_DESTINATION = 0xC029005D, + MD_NTSTATUS_WIN_STATUS_TPM_MA_SOURCE = 0xC029005E, + MD_NTSTATUS_WIN_STATUS_TPM_MA_AUTHORITY = 0xC029005F, + MD_NTSTATUS_WIN_STATUS_TPM_PERMANENTEK = 0xC0290061, + MD_NTSTATUS_WIN_STATUS_TPM_BAD_SIGNATURE = 0xC0290062, + MD_NTSTATUS_WIN_STATUS_TPM_NOCONTEXTSPACE = 0xC0290063, + MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_BLOCKED = 0xC0290400, + MD_NTSTATUS_WIN_STATUS_TPM_INVALID_HANDLE = 0xC0290401, + MD_NTSTATUS_WIN_STATUS_TPM_DUPLICATE_VHANDLE = 0xC0290402, + MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_BLOCKED = 0xC0290403, + MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED = 0xC0290404, + MD_NTSTATUS_WIN_STATUS_TPM_RETRY = 0xC0290800, + MD_NTSTATUS_WIN_STATUS_TPM_NEEDS_SELFTEST = 0xC0290801, + MD_NTSTATUS_WIN_STATUS_TPM_DOING_SELFTEST = 0xC0290802, + MD_NTSTATUS_WIN_STATUS_TPM_DEFEND_LOCK_RUNNING = 0xC0290803, + MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_CANCELED = 0xC0291001, + MD_NTSTATUS_WIN_STATUS_TPM_TOO_MANY_CONTEXTS = 0xC0291002, + MD_NTSTATUS_WIN_STATUS_TPM_NOT_FOUND = 0xC0291003, + MD_NTSTATUS_WIN_STATUS_TPM_ACCESS_DENIED = 0xC0291004, + MD_NTSTATUS_WIN_STATUS_TPM_INSUFFICIENT_BUFFER = 0xC0291005, + MD_NTSTATUS_WIN_STATUS_TPM_PPI_FUNCTION_UNSUPPORTED = 0xC0291006, + MD_NTSTATUS_WIN_STATUS_PCP_ERROR_MASK = 0xC0292000, + MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_READY = 0xC0292001, + MD_NTSTATUS_WIN_STATUS_PCP_INVALID_HANDLE = 0xC0292002, + MD_NTSTATUS_WIN_STATUS_PCP_INVALID_PARAMETER = 0xC0292003, + MD_NTSTATUS_WIN_STATUS_PCP_FLAG_NOT_SUPPORTED = 0xC0292004, + MD_NTSTATUS_WIN_STATUS_PCP_NOT_SUPPORTED = 0xC0292005, + MD_NTSTATUS_WIN_STATUS_PCP_BUFFER_TOO_SMALL = 0xC0292006, + MD_NTSTATUS_WIN_STATUS_PCP_INTERNAL_ERROR = 0xC0292007, + MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_FAILED = 0xC0292008, + MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_IGNORED = 0xC0292009, + MD_NTSTATUS_WIN_STATUS_PCP_POLICY_NOT_FOUND = 0xC029200A, + MD_NTSTATUS_WIN_STATUS_PCP_PROFILE_NOT_FOUND = 0xC029200B, + MD_NTSTATUS_WIN_STATUS_PCP_VALIDATION_FAILED = 0xC029200C, + MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_FOUND = 0xC029200D, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_CODE = 0xC0350002, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_INPUT = 0xC0350003, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_ALIGNMENT = 0xC0350004, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARAMETER = 0xC0350005, + MD_NTSTATUS_WIN_STATUS_HV_ACCESS_DENIED = 0xC0350006, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_STATE = 0xC0350007, + MD_NTSTATUS_WIN_STATUS_HV_OPERATION_DENIED = 0xC0350008, + MD_NTSTATUS_WIN_STATUS_HV_UNKNOWN_PROPERTY = 0xC0350009, + MD_NTSTATUS_WIN_STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE = 0xC035000A, + MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_MEMORY = 0xC035000B, + MD_NTSTATUS_WIN_STATUS_HV_PARTITION_TOO_DEEP = 0xC035000C, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_ID = 0xC035000D, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_VP_INDEX = 0xC035000E, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_PORT_ID = 0xC0350011, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_CONNECTION_ID = 0xC0350012, + MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFERS = 0xC0350013, + MD_NTSTATUS_WIN_STATUS_HV_NOT_ACKNOWLEDGED = 0xC0350014, + MD_NTSTATUS_WIN_STATUS_HV_ACKNOWLEDGED = 0xC0350016, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_SAVE_RESTORE_STATE = 0xC0350017, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_SYNIC_STATE = 0xC0350018, + MD_NTSTATUS_WIN_STATUS_HV_OBJECT_IN_USE = 0xC0350019, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO = 0xC035001A, + MD_NTSTATUS_WIN_STATUS_HV_NO_DATA = 0xC035001B, + MD_NTSTATUS_WIN_STATUS_HV_INACTIVE = 0xC035001C, + MD_NTSTATUS_WIN_STATUS_HV_NO_RESOURCES = 0xC035001D, + MD_NTSTATUS_WIN_STATUS_HV_FEATURE_UNAVAILABLE = 0xC035001E, + MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFER = 0xC0350033, + MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS = 0xC0350038, + MD_NTSTATUS_WIN_STATUS_HV_INVALID_LP_INDEX = 0xC0350041, + MD_NTSTATUS_WIN_STATUS_HV_NOT_PRESENT = 0xC0351000, + MD_NTSTATUS_WIN_STATUS_IPSEC_BAD_SPI = 0xC0360001, + MD_NTSTATUS_WIN_STATUS_IPSEC_SA_LIFETIME_EXPIRED = 0xC0360002, + MD_NTSTATUS_WIN_STATUS_IPSEC_WRONG_SA = 0xC0360003, + MD_NTSTATUS_WIN_STATUS_IPSEC_REPLAY_CHECK_FAILED = 0xC0360004, + MD_NTSTATUS_WIN_STATUS_IPSEC_INVALID_PACKET = 0xC0360005, + MD_NTSTATUS_WIN_STATUS_IPSEC_INTEGRITY_CHECK_FAILED = 0xC0360006, + MD_NTSTATUS_WIN_STATUS_IPSEC_CLEAR_TEXT_DROP = 0xC0360007, + MD_NTSTATUS_WIN_STATUS_IPSEC_AUTH_FIREWALL_DROP = 0xC0360008, + MD_NTSTATUS_WIN_STATUS_IPSEC_THROTTLE_DROP = 0xC0360009, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_BLOCK = 0xC0368000, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_RECEIVED_MULTICAST = 0xC0368001, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_INVALID_PACKET = 0xC0368002, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED = 0xC0368003, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_ENTRIES = 0xC0368004, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED = 0xC0368005, + MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES = 0xC0368006, + MD_NTSTATUS_WIN_STATUS_VID_DUPLICATE_HANDLER = 0xC0370001, + MD_NTSTATUS_WIN_STATUS_VID_TOO_MANY_HANDLERS = 0xC0370002, + MD_NTSTATUS_WIN_STATUS_VID_QUEUE_FULL = 0xC0370003, + MD_NTSTATUS_WIN_STATUS_VID_HANDLER_NOT_PRESENT = 0xC0370004, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_OBJECT_NAME = 0xC0370005, + MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_TOO_LONG = 0xC0370006, + MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG = 0xC0370007, + MD_NTSTATUS_WIN_STATUS_VID_PARTITION_ALREADY_EXISTS = 0xC0370008, + MD_NTSTATUS_WIN_STATUS_VID_PARTITION_DOES_NOT_EXIST = 0xC0370009, + MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_NOT_FOUND = 0xC037000A, + MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS = 0xC037000B, + MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT = 0xC037000C, + MD_NTSTATUS_WIN_STATUS_VID_MB_STILL_REFERENCED = 0xC037000D, + MD_NTSTATUS_WIN_STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED = 0xC037000E, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_SETTINGS = 0xC037000F, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_NODE_INDEX = 0xC0370010, + MD_NTSTATUS_WIN_STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED = 0xC0370011, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE = 0xC0370012, + MD_NTSTATUS_WIN_STATUS_VID_PAGE_RANGE_OVERFLOW = 0xC0370013, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE = 0xC0370014, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_GPA_RANGE_HANDLE = 0xC0370015, + MD_NTSTATUS_WIN_STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE = 0xC0370016, + MD_NTSTATUS_WIN_STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED = 0xC0370017, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_PPM_HANDLE = 0xC0370018, + MD_NTSTATUS_WIN_STATUS_VID_MBPS_ARE_LOCKED = 0xC0370019, + MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_CLOSED = 0xC037001A, + MD_NTSTATUS_WIN_STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED = 0xC037001B, + MD_NTSTATUS_WIN_STATUS_VID_STOP_PENDING = 0xC037001C, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_PROCESSOR_STATE = 0xC037001D, + MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT = 0xC037001E, + MD_NTSTATUS_WIN_STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED = 0xC037001F, + MD_NTSTATUS_WIN_STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET = 0xC0370020, + MD_NTSTATUS_WIN_STATUS_VID_MMIO_RANGE_DESTROYED = 0xC0370021, + MD_NTSTATUS_WIN_STATUS_VID_INVALID_CHILD_GPA_PAGE_SET = 0xC0370022, + MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED = 0xC0370023, + MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL = 0xC0370024, + MD_NTSTATUS_WIN_STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE = 0xC0370025, + MD_NTSTATUS_WIN_STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT = 0xC0370026, + MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_CORRUPT = 0xC0370027, + MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM = 0xC0370028, + MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_INCOMPATIBLE = 0xC0370029, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DATABASE_FULL = 0xC0380001, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED = 0xC0380002, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC = 0xC0380003, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED = 0xC0380004, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME = 0xC0380005, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DUPLICATE = 0xC0380006, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DYNAMIC = 0xC0380007, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_ID_INVALID = 0xC0380008, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_INVALID = 0xC0380009, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAST_VOTER = 0xC038000A, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_INVALID = 0xC038000B, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS = 0xC038000C, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED = 0xC038000D, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL = 0xC038000E, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS = 0xC038000F, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS = 0xC0380010, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_MISSING = 0xC0380011, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_EMPTY = 0xC0380012, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE = 0xC0380013, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_REVECTORING_FAILED = 0xC0380014, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID = 0xC0380015, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SET_NOT_CONTAINED = 0xC0380016, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS = 0xC0380017, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES = 0xC0380018, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED = 0xC0380019, + MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_ALREADY_USED = 0xC038001A, + MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS = 0xC038001B, + MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION = 0xC038001C, + MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED = 0xC038001D, + MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION = 0xC038001E, + MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH = 0xC038001F, + MD_NTSTATUS_WIN_STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED = 0xC0380020, + MD_NTSTATUS_WIN_STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID = 0xC0380021, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS = 0xC0380022, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_IN_SYNC = 0xC0380023, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE = 0xC0380024, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_INVALID = 0xC0380025, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_MISSING = 0xC0380026, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_NOT_DETACHED = 0xC0380027, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_REGENERATING = 0xC0380028, + MD_NTSTATUS_WIN_STATUS_VOLMGR_ALL_DISKS_FAILED = 0xC0380029, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_REGISTERED_USERS = 0xC038002A, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_SUCH_USER = 0xC038002B, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NOTIFICATION_RESET = 0xC038002C, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID = 0xC038002D, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID = 0xC038002E, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_DUPLICATE = 0xC038002F, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_ID_INVALID = 0xC0380030, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_INVALID = 0xC0380031, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_NAME_INVALID = 0xC0380032, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_OFFLINE = 0xC0380033, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_HAS_QUORUM = 0xC0380034, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_WITHOUT_QUORUM = 0xC0380035, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_STYLE_INVALID = 0xC0380036, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_UPDATE_FAILED = 0xC0380037, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_IN_SYNC = 0xC0380038, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_DUPLICATE = 0xC0380039, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_INVALID = 0xC038003A, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_LAST_ACTIVE = 0xC038003B, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_MISSING = 0xC038003C, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_REGENERATING = 0xC038003D, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_TYPE_INVALID = 0xC038003E, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_RAID5 = 0xC038003F, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE = 0xC0380040, + MD_NTSTATUS_WIN_STATUS_VOLMGR_STRUCTURE_SIZE_INVALID = 0xC0380041, + MD_NTSTATUS_WIN_STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS = 0xC0380042, + MD_NTSTATUS_WIN_STATUS_VOLMGR_TRANSACTION_IN_PROGRESS = 0xC0380043, + MD_NTSTATUS_WIN_STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE = 0xC0380044, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK = 0xC0380045, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_ID_INVALID = 0xC0380046, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_INVALID = 0xC0380047, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE = 0xC0380048, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_MIRRORED = 0xC0380049, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_RETAINED = 0xC038004A, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_OFFLINE = 0xC038004B, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_RETAINED = 0xC038004C, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID = 0xC038004D, + MD_NTSTATUS_WIN_STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE = 0xC038004E, + MD_NTSTATUS_WIN_STATUS_VOLMGR_BAD_BOOT_DISK = 0xC038004F, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_OFFLINE = 0xC0380050, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_ONLINE = 0xC0380051, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NOT_PRIMARY_PACK = 0xC0380052, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED = 0xC0380053, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID = 0xC0380054, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID = 0xC0380055, + MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_MIRRORED = 0xC0380056, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED = 0xC0380057, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_VALID_LOG_COPIES = 0xC0380058, + MD_NTSTATUS_WIN_STATUS_VOLMGR_PRIMARY_PACK_PRESENT = 0xC0380059, + MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID = 0xC038005A, + MD_NTSTATUS_WIN_STATUS_VOLMGR_MIRROR_NOT_SUPPORTED = 0xC038005B, + MD_NTSTATUS_WIN_STATUS_VOLMGR_RAID5_NOT_SUPPORTED = 0xC038005C, + MD_NTSTATUS_WIN_STATUS_BCD_TOO_MANY_ELEMENTS = 0xC0390002, + MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_MISSING = 0xC03A0001, + MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH = 0xC03A0002, + MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CORRUPT = 0xC03A0003, + MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNKNOWN = 0xC03A0004, + MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNSUPPORTED_VERSION = 0xC03A0005, + MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH = 0xC03A0006, + MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION = 0xC03A0007, + MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CORRUPT = 0xC03A0008, + MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_FAILURE = 0xC03A0009, + MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT = 0xC03A000A, + MD_NTSTATUS_WIN_STATUS_VHD_INVALID_BLOCK_SIZE = 0xC03A000B, + MD_NTSTATUS_WIN_STATUS_VHD_BITMAP_MISMATCH = 0xC03A000C, + MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_NOT_FOUND = 0xC03A000D, + MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_ID_MISMATCH = 0xC03A000E, + MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH = 0xC03A000F, + MD_NTSTATUS_WIN_STATUS_VHD_METADATA_READ_FAILURE = 0xC03A0010, + MD_NTSTATUS_WIN_STATUS_VHD_METADATA_WRITE_FAILURE = 0xC03A0011, + MD_NTSTATUS_WIN_STATUS_VHD_INVALID_SIZE = 0xC03A0012, + MD_NTSTATUS_WIN_STATUS_VHD_INVALID_FILE_SIZE = 0xC03A0013, + MD_NTSTATUS_WIN_STATUS_VIRTDISK_PROVIDER_NOT_FOUND = 0xC03A0014, + MD_NTSTATUS_WIN_STATUS_VIRTDISK_NOT_VIRTUAL_DISK = 0xC03A0015, + MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_ACCESS_DENIED = 0xC03A0016, + MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH = 0xC03A0017, + MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED = 0xC03A0018, + MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT = 0xC03A0019, + MD_NTSTATUS_WIN_STATUS_VIRTUAL_DISK_LIMITATION = 0xC03A001A, + MD_NTSTATUS_WIN_STATUS_VHD_INVALID_TYPE = 0xC03A001B, + MD_NTSTATUS_WIN_STATUS_VHD_INVALID_STATE = 0xC03A001C, + MD_NTSTATUS_WIN_STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE = 0xC03A001D, + MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ALREADY_OWNED = 0xC03A001E, + MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE = 0xC03A001F, + MD_NTSTATUS_WIN_STATUS_CTLOG_TRACKING_NOT_INITIALIZED = 0xC03A0020, + MD_NTSTATUS_WIN_STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE = 0xC03A0021, + MD_NTSTATUS_WIN_STATUS_CTLOG_VHD_CHANGED_OFFLINE = 0xC03A0022, + MD_NTSTATUS_WIN_STATUS_CTLOG_INVALID_TRACKING_STATE = 0xC03A0023, + MD_NTSTATUS_WIN_STATUS_CTLOG_INCONSISTENT_TRACKING_FILE = 0xC03A0024, + MD_NTSTATUS_WIN_STATUS_VHD_METADATA_FULL = 0xC03A0028, + MD_NTSTATUS_WIN_STATUS_RKF_KEY_NOT_FOUND = 0xC0400001, + MD_NTSTATUS_WIN_STATUS_RKF_DUPLICATE_KEY = 0xC0400002, + MD_NTSTATUS_WIN_STATUS_RKF_BLOB_FULL = 0xC0400003, + MD_NTSTATUS_WIN_STATUS_RKF_STORE_FULL = 0xC0400004, + MD_NTSTATUS_WIN_STATUS_RKF_FILE_BLOCKED = 0xC0400005, + MD_NTSTATUS_WIN_STATUS_RKF_ACTIVE_KEY = 0xC0400006, + MD_NTSTATUS_WIN_STATUS_RDBSS_RESTART_OPERATION = 0xC0410001, + MD_NTSTATUS_WIN_STATUS_RDBSS_CONTINUE_OPERATION = 0xC0410002, + MD_NTSTATUS_WIN_STATUS_RDBSS_POST_OPERATION = 0xC0410003, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_HANDLE = 0xC0420001, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_READ_NOT_PERMITTED = 0xC0420002, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_WRITE_NOT_PERMITTED = 0xC0420003, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_PDU = 0xC0420004, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION = 0xC0420005, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED = 0xC0420006, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_OFFSET = 0xC0420007, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION = 0xC0420008, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_PREPARE_QUEUE_FULL = 0xC0420009, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND = 0xC042000A, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG = 0xC042000B, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0xC042000C, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH = 0xC042000D, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNLIKELY = 0xC042000E, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION = 0xC042000F, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE = 0xC0420010, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_RESOURCES = 0xC0420011, + MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNKNOWN_ERROR = 0xC0421000, + MD_NTSTATUS_WIN_STATUS_SECUREBOOT_ROLLBACK_DETECTED = 0xC0430001, + MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_VIOLATION = 0xC0430002, + MD_NTSTATUS_WIN_STATUS_SECUREBOOT_INVALID_POLICY = 0xC0430003, + MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND = 0xC0430004, + MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_NOT_SIGNED = 0xC0430005, + MD_NTSTATUS_WIN_STATUS_SECUREBOOT_FILE_REPLACED = 0xC0430007, + MD_NTSTATUS_WIN_STATUS_AUDIO_ENGINE_NODE_NOT_FOUND = 0xC0440001, + MD_NTSTATUS_WIN_STATUS_HDAUDIO_EMPTY_CONNECTION_LIST = 0xC0440002, + MD_NTSTATUS_WIN_STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED = 0xC0440003, + MD_NTSTATUS_WIN_STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED = 0xC0440004, + MD_NTSTATUS_WIN_STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY = 0xC0440005, + MD_NTSTATUS_WIN_STATUS_VOLSNAP_BOOTFILE_NOT_VALID = 0xC0500003, + MD_NTSTATUS_WIN_STATUS_IO_PREEMPTED = 0xC0510001, + MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_STORED = 0xC05C0000, + MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_NOT_AVAILABLE = 0xC05CFF00, + MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE = 0xC05CFF01, + MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED = 0xC05CFF02, + MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED = 0xC05CFF03, + MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED = 0xC05CFF04, + MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED = 0xC05CFF05, + MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED = 0xC05CFF06, + MD_NTSTATUS_WIN_STATUS_SVHDX_RESERVATION_CONFLICT = 0xC05CFF07, + MD_NTSTATUS_WIN_STATUS_SVHDX_WRONG_FILE_TYPE = 0xC05CFF08, + MD_NTSTATUS_WIN_STATUS_SVHDX_VERSION_MISMATCH = 0xC05CFF09, + MD_NTSTATUS_WIN_STATUS_VHD_SHARED = 0xC05CFF0A, + MD_NTSTATUS_WIN_STATUS_SPACES_RESILIENCY_TYPE_INVALID = 0xC0E70003, + MD_NTSTATUS_WIN_STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID = 0xC0E70004, + MD_NTSTATUS_WIN_STATUS_SPACES_INTERLEAVE_LENGTH_INVALID = 0xC0E70009, + MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID = 0xC0E7000A, + MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES = 0xC0E7000B +} MDNTStatusCodeWin; + +// These constants are defined in the MSDN documentation of +// the EXCEPTION_RECORD structure. +typedef enum { + MD_ACCESS_VIOLATION_WIN_READ = 0, + MD_ACCESS_VIOLATION_WIN_WRITE = 1, + MD_ACCESS_VIOLATION_WIN_EXEC = 8 +} MDAccessViolationTypeWin; + +// These constants are defined in the MSDN documentation of +// the EXCEPTION_RECORD structure. +typedef enum { + MD_IN_PAGE_ERROR_WIN_READ = 0, + MD_IN_PAGE_ERROR_WIN_WRITE = 1, + MD_IN_PAGE_ERROR_WIN_EXEC = 8 +} MDInPageErrorTypeWin; + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h new file mode 100644 index 0000000000..17a5abba33 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h @@ -0,0 +1,972 @@ +/* Copyright (c) 2006, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/* minidump_format.h: A cross-platform reimplementation of minidump-related + * portions of DbgHelp.h from the Windows Platform SDK. + * + * (This is C99 source, please don't corrupt it with C++.) + * + * Structures that are defined by Microsoft to contain a zero-length array + * are instead defined here to contain an array with one element, as + * zero-length arrays are forbidden by standard C and C++. In these cases, + * *_minsize constants are provided to be used in place of sizeof. For a + * cleaner interface to these sizes when using C++, see minidump_size.h. + * + * These structures are also sufficient to populate minidump files. + * + * These definitions may be extended to support handling minidump files + * for other CPUs and other operating systems. + * + * Because precise data type sizes are crucial for this implementation to + * function properly and portably in terms of interoperability with minidumps + * produced by DbgHelp on Windows, a set of primitive types with known sizes + * are used as the basis of each structure defined by this file. DbgHelp + * on Windows is assumed to be the reference implementation; this file + * seeks to provide a cross-platform compatible implementation. To avoid + * collisions with the types and values defined and used by DbgHelp in the + * event that this implementation is used on Windows, each type and value + * defined here is given a new name, beginning with "MD". Names of the + * equivalent types and values in the Windows Platform SDK are given in + * comments. + * + * Author: Mark Mentovai */ + + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ + +#include + +#include "google_breakpad/common/breakpad_types.h" + + +#if defined(_MSC_VER) +/* Disable "zero-sized array in struct/union" warnings when compiling in + * MSVC. DbgHelp.h does this too. */ +#pragma warning(push) +#pragma warning(disable:4200) +#endif /* _MSC_VER */ + + +/* + * guiddef.h + */ + +typedef struct { + uint32_t data1; + uint16_t data2; + uint16_t data3; + uint8_t data4[8]; +} MDGUID; /* GUID */ + + +/* + * WinNT.h + */ + +/* Non-x86 CPU identifiers found in the high 24 bits of + * (MDRawContext*).context_flags. These aren't used by Breakpad, but are + * defined here for reference, to avoid assigning values that conflict + * (although some values already conflict). */ +#define MD_CONTEXT_IA64 0x00080000 /* CONTEXT_IA64 */ +/* Additional values from winnt.h in the Windows CE 5.0 SDK: */ +#define MD_CONTEXT_SHX 0x000000c0 /* CONTEXT_SH4 (Super-H, includes SH3) */ +#define MD_CONTEXT_ALPHA 0x00020000 /* CONTEXT_ALPHA */ + +/* As of Windows 7 SP1, the number of flag bits has increased to + * include 0x40 (CONTEXT_XSTATE): + * http://msdn.microsoft.com/en-us/library/hh134238%28v=vs.85%29.aspx */ +#define MD_CONTEXT_CPU_MASK 0xffffff00 + + +/* This is a base type for MDRawContextX86 and MDRawContextPPC. This + * structure should never be allocated directly. The actual structure type + * can be determined by examining the context_flags field. */ +typedef struct { + uint32_t context_flags; +} MDRawContextBase; + +#include "minidump_cpu_amd64.h" +#include "minidump_cpu_arm.h" +#include "minidump_cpu_arm64.h" +#include "minidump_cpu_mips.h" +#include "minidump_cpu_ppc.h" +#include "minidump_cpu_ppc64.h" +#include "minidump_cpu_sparc.h" +#include "minidump_cpu_x86.h" + +/* + * WinVer.h + */ + + +typedef struct { + uint32_t signature; + uint32_t struct_version; + uint32_t file_version_hi; + uint32_t file_version_lo; + uint32_t product_version_hi; + uint32_t product_version_lo; + uint32_t file_flags_mask; /* Identifies valid bits in fileFlags */ + uint32_t file_flags; + uint32_t file_os; + uint32_t file_type; + uint32_t file_subtype; + uint32_t file_date_hi; + uint32_t file_date_lo; +} MDVSFixedFileInfo; /* VS_FIXEDFILEINFO */ + +/* For (MDVSFixedFileInfo).signature */ +#define MD_VSFIXEDFILEINFO_SIGNATURE 0xfeef04bd + /* VS_FFI_SIGNATURE */ + +/* For (MDVSFixedFileInfo).version */ +#define MD_VSFIXEDFILEINFO_VERSION 0x00010000 + /* VS_FFI_STRUCVERSION */ + +/* For (MDVSFixedFileInfo).file_flags_mask and + * (MDVSFixedFileInfo).file_flags */ +#define MD_VSFIXEDFILEINFO_FILE_FLAGS_DEBUG 0x00000001 + /* VS_FF_DEBUG */ +#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PRERELEASE 0x00000002 + /* VS_FF_PRERELEASE */ +#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PATCHED 0x00000004 + /* VS_FF_PATCHED */ +#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PRIVATEBUILD 0x00000008 + /* VS_FF_PRIVATEBUILD */ +#define MD_VSFIXEDFILEINFO_FILE_FLAGS_INFOINFERRED 0x00000010 + /* VS_FF_INFOINFERRED */ +#define MD_VSFIXEDFILEINFO_FILE_FLAGS_SPECIALBUILD 0x00000020 + /* VS_FF_SPECIALBUILD */ + +/* For (MDVSFixedFileInfo).file_os: high 16 bits */ +#define MD_VSFIXEDFILEINFO_FILE_OS_UNKNOWN 0 /* VOS_UNKNOWN */ +#define MD_VSFIXEDFILEINFO_FILE_OS_DOS (1 << 16) /* VOS_DOS */ +#define MD_VSFIXEDFILEINFO_FILE_OS_OS216 (2 << 16) /* VOS_OS216 */ +#define MD_VSFIXEDFILEINFO_FILE_OS_OS232 (3 << 16) /* VOS_OS232 */ +#define MD_VSFIXEDFILEINFO_FILE_OS_NT (4 << 16) /* VOS_NT */ +#define MD_VSFIXEDFILEINFO_FILE_OS_WINCE (5 << 16) /* VOS_WINCE */ +/* Low 16 bits */ +#define MD_VSFIXEDFILEINFO_FILE_OS__BASE 0 /* VOS__BASE */ +#define MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS16 1 /* VOS__WINDOWS16 */ +#define MD_VSFIXEDFILEINFO_FILE_OS__PM16 2 /* VOS__PM16 */ +#define MD_VSFIXEDFILEINFO_FILE_OS__PM32 3 /* VOS__PM32 */ +#define MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS32 4 /* VOS__WINDOWS32 */ + +/* For (MDVSFixedFileInfo).file_type */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_UNKNOWN 0 /* VFT_UNKNOWN */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_APP 1 /* VFT_APP */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_DLL 2 /* VFT_DLL */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_DRV 3 /* VFT_DLL */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_FONT 4 /* VFT_FONT */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_VXD 5 /* VFT_VXD */ +#define MD_VSFIXEDFILEINFO_FILE_TYPE_STATIC_LIB 7 /* VFT_STATIC_LIB */ + +/* For (MDVSFixedFileInfo).file_subtype */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_UNKNOWN 0 + /* VFT2_UNKNOWN */ +/* with file_type = MD_VSFIXEDFILEINFO_FILETYPE_DRV */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_PRINTER 1 + /* VFT2_DRV_PRINTER */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_KEYBOARD 2 + /* VFT2_DRV_KEYBOARD */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_LANGUAGE 3 + /* VFT2_DRV_LANGUAGE */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_DISPLAY 4 + /* VFT2_DRV_DISPLAY */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_MOUSE 5 + /* VFT2_DRV_MOUSE */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_NETWORK 6 + /* VFT2_DRV_NETWORK */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_SYSTEM 7 + /* VFT2_DRV_SYSTEM */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_INSTALLABLE 8 + /* VFT2_DRV_INSTALLABLE */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_SOUND 9 + /* VFT2_DRV_SOUND */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_COMM 10 + /* VFT2_DRV_COMM */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_INPUTMETHOD 11 + /* VFT2_DRV_INPUTMETHOD */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_VERSIONED_PRINTER 12 + /* VFT2_DRV_VERSIONED_PRINTER */ +/* with file_type = MD_VSFIXEDFILEINFO_FILETYPE_FONT */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_RASTER 1 + /* VFT2_FONT_RASTER */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_VECTOR 2 + /* VFT2_FONT_VECTOR */ +#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_TRUETYPE 3 + /* VFT2_FONT_TRUETYPE */ + + +/* + * DbgHelp.h + */ + + +/* An MDRVA is an offset into the minidump file. The beginning of the + * MDRawHeader is at offset 0. */ +typedef uint32_t MDRVA; /* RVA */ + +typedef struct { + uint32_t data_size; + MDRVA rva; +} MDLocationDescriptor; /* MINIDUMP_LOCATION_DESCRIPTOR */ + + +typedef struct { + /* The base address of the memory range on the host that produced the + * minidump. */ + uint64_t start_of_memory_range; + + MDLocationDescriptor memory; +} MDMemoryDescriptor; /* MINIDUMP_MEMORY_DESCRIPTOR */ + + +typedef struct { + uint32_t signature; + uint32_t version; + uint32_t stream_count; + MDRVA stream_directory_rva; /* A |stream_count|-sized array of + * MDRawDirectory structures. */ + uint32_t checksum; /* Can be 0. In fact, that's all that's + * been found in minidump files. */ + uint32_t time_date_stamp; /* time_t */ + uint64_t flags; +} MDRawHeader; /* MINIDUMP_HEADER */ + +/* For (MDRawHeader).signature and (MDRawHeader).version. Note that only the + * low 16 bits of (MDRawHeader).version are MD_HEADER_VERSION. Per the + * documentation, the high 16 bits are implementation-specific. */ +#define MD_HEADER_SIGNATURE 0x504d444d /* 'PMDM' */ + /* MINIDUMP_SIGNATURE */ +#define MD_HEADER_VERSION 0x0000a793 /* 42899 */ + /* MINIDUMP_VERSION */ + +/* For (MDRawHeader).flags: */ +typedef enum { + /* MD_NORMAL is the standard type of minidump. It includes full + * streams for the thread list, module list, exception, system info, + * and miscellaneous info. A memory list stream is also present, + * pointing to the same stack memory contained in the thread list, + * as well as a 256-byte region around the instruction address that + * was executing when the exception occurred. Stack memory is from + * 4 bytes below a thread's stack pointer up to the top of the + * memory region encompassing the stack. */ + MD_NORMAL = 0x00000000, + MD_WITH_DATA_SEGS = 0x00000001, + MD_WITH_FULL_MEMORY = 0x00000002, + MD_WITH_HANDLE_DATA = 0x00000004, + MD_FILTER_MEMORY = 0x00000008, + MD_SCAN_MEMORY = 0x00000010, + MD_WITH_UNLOADED_MODULES = 0x00000020, + MD_WITH_INDIRECTLY_REFERENCED_MEMORY = 0x00000040, + MD_FILTER_MODULE_PATHS = 0x00000080, + MD_WITH_PROCESS_THREAD_DATA = 0x00000100, + MD_WITH_PRIVATE_READ_WRITE_MEMORY = 0x00000200, + MD_WITHOUT_OPTIONAL_DATA = 0x00000400, + MD_WITH_FULL_MEMORY_INFO = 0x00000800, + MD_WITH_THREAD_INFO = 0x00001000, + MD_WITH_CODE_SEGS = 0x00002000, + MD_WITHOUT_AUXILLIARY_SEGS = 0x00004000, + MD_WITH_FULL_AUXILLIARY_STATE = 0x00008000, + MD_WITH_PRIVATE_WRITE_COPY_MEMORY = 0x00010000, + MD_IGNORE_INACCESSIBLE_MEMORY = 0x00020000, + MD_WITH_TOKEN_INFORMATION = 0x00040000 +} MDType; /* MINIDUMP_TYPE */ + + +typedef struct { + uint32_t stream_type; + MDLocationDescriptor location; +} MDRawDirectory; /* MINIDUMP_DIRECTORY */ + +/* For (MDRawDirectory).stream_type */ +typedef enum { + MD_UNUSED_STREAM = 0, + MD_RESERVED_STREAM_0 = 1, + MD_RESERVED_STREAM_1 = 2, + MD_THREAD_LIST_STREAM = 3, /* MDRawThreadList */ + MD_MODULE_LIST_STREAM = 4, /* MDRawModuleList */ + MD_MEMORY_LIST_STREAM = 5, /* MDRawMemoryList */ + MD_EXCEPTION_STREAM = 6, /* MDRawExceptionStream */ + MD_SYSTEM_INFO_STREAM = 7, /* MDRawSystemInfo */ + MD_THREAD_EX_LIST_STREAM = 8, + MD_MEMORY_64_LIST_STREAM = 9, + MD_COMMENT_STREAM_A = 10, + MD_COMMENT_STREAM_W = 11, + MD_HANDLE_DATA_STREAM = 12, + MD_FUNCTION_TABLE_STREAM = 13, + MD_UNLOADED_MODULE_LIST_STREAM = 14, + MD_MISC_INFO_STREAM = 15, /* MDRawMiscInfo */ + MD_MEMORY_INFO_LIST_STREAM = 16, /* MDRawMemoryInfoList */ + MD_THREAD_INFO_LIST_STREAM = 17, + MD_HANDLE_OPERATION_LIST_STREAM = 18, + MD_LAST_RESERVED_STREAM = 0x0000ffff, + + /* Breakpad extension types. 0x4767 = "Gg" */ + MD_BREAKPAD_INFO_STREAM = 0x47670001, /* MDRawBreakpadInfo */ + MD_ASSERTION_INFO_STREAM = 0x47670002, /* MDRawAssertionInfo */ + /* These are additional minidump stream values which are specific to + * the linux breakpad implementation. */ + MD_LINUX_CPU_INFO = 0x47670003, /* /proc/cpuinfo */ + MD_LINUX_PROC_STATUS = 0x47670004, /* /proc/$x/status */ + MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */ + MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */ + MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */ + MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */ + MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */ + MD_LINUX_DSO_DEBUG = 0x4767000A /* MDRawDebug{32,64} */ +} MDStreamType; /* MINIDUMP_STREAM_TYPE */ + + +typedef struct { + uint32_t length; /* Length of buffer in bytes (not characters), + * excluding 0-terminator */ + uint16_t buffer[1]; /* UTF-16-encoded, 0-terminated */ +} MDString; /* MINIDUMP_STRING */ + +static const size_t MDString_minsize = offsetof(MDString, buffer[0]); + + +typedef struct { + uint32_t thread_id; + uint32_t suspend_count; + uint32_t priority_class; + uint32_t priority; + uint64_t teb; /* Thread environment block */ + MDMemoryDescriptor stack; + MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ +} MDRawThread; /* MINIDUMP_THREAD */ + + +typedef struct { + uint32_t number_of_threads; + MDRawThread threads[1]; +} MDRawThreadList; /* MINIDUMP_THREAD_LIST */ + +static const size_t MDRawThreadList_minsize = offsetof(MDRawThreadList, + threads[0]); + + +typedef struct { + uint64_t base_of_image; + uint32_t size_of_image; + uint32_t checksum; /* 0 if unknown */ + uint32_t time_date_stamp; /* time_t */ + MDRVA module_name_rva; /* MDString, pathname or filename */ + MDVSFixedFileInfo version_info; + + /* The next field stores a CodeView record and is populated when a module's + * debug information resides in a PDB file. It identifies the PDB file. */ + MDLocationDescriptor cv_record; + + /* The next field is populated when a module's debug information resides + * in a DBG file. It identifies the DBG file. This field is effectively + * obsolete with modules built by recent toolchains. */ + MDLocationDescriptor misc_record; + + /* Alignment problem: reserved0 and reserved1 are defined by the platform + * SDK as 64-bit quantities. However, that results in a structure whose + * alignment is unpredictable on different CPUs and ABIs. If the ABI + * specifies full alignment of 64-bit quantities in structures (as ppc + * does), there will be padding between miscRecord and reserved0. If + * 64-bit quantities can be aligned on 32-bit boundaries (as on x86), + * this padding will not exist. (Note that the structure up to this point + * contains 1 64-bit member followed by 21 32-bit members.) + * As a workaround, reserved0 and reserved1 are instead defined here as + * four 32-bit quantities. This should be harmless, as there are + * currently no known uses for these fields. */ + uint32_t reserved0[2]; + uint32_t reserved1[2]; +} MDRawModule; /* MINIDUMP_MODULE */ + +/* The inclusion of a 64-bit type in MINIDUMP_MODULE forces the struct to + * be tail-padded out to a multiple of 64 bits under some ABIs (such as PPC). + * This doesn't occur on systems that don't tail-pad in this manner. Define + * this macro to be the usable size of the MDRawModule struct, and use it in + * place of sizeof(MDRawModule). */ +#define MD_MODULE_SIZE 108 + + +/* (MDRawModule).cv_record can reference MDCVInfoPDB20 or MDCVInfoPDB70. + * Ref.: http://www.debuginfo.com/articles/debuginfomatch.html + * MDCVInfoPDB70 is the expected structure type with recent toolchains. */ + +typedef struct { + uint32_t signature; + uint32_t offset; /* Offset to debug data (expect 0 in minidump) */ +} MDCVHeader; + +typedef struct { + MDCVHeader cv_header; + uint32_t signature; /* time_t debug information created */ + uint32_t age; /* revision of PDB file */ + uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file */ +} MDCVInfoPDB20; + +static const size_t MDCVInfoPDB20_minsize = offsetof(MDCVInfoPDB20, + pdb_file_name[0]); + +#define MD_CVINFOPDB20_SIGNATURE 0x3031424e /* cvHeader.signature = '01BN' */ + +typedef struct { + uint32_t cv_signature; + MDGUID signature; /* GUID, identifies PDB file */ + uint32_t age; /* Identifies incremental changes to PDB file */ + uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file, + * 0-terminated 8-bit character data (UTF-8?) */ +} MDCVInfoPDB70; + +static const size_t MDCVInfoPDB70_minsize = offsetof(MDCVInfoPDB70, + pdb_file_name[0]); + +#define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */ + +typedef struct { + uint32_t data1[2]; + uint32_t data2; + uint32_t data3; + uint32_t data4; + uint32_t data5[3]; + uint8_t extra[2]; +} MDCVInfoELF; + +/* In addition to the two CodeView record formats above, used for linking + * to external pdb files, it is possible for debugging data to be carried + * directly in the CodeView record itself. These signature values will + * be found in the first 4 bytes of the CodeView record. Additional values + * not commonly experienced in the wild are given by "Microsoft Symbol and + * Type Information", http://www.x86.org/ftp/manuals/tools/sym.pdf, section + * 7.2. An in-depth description of the CodeView 4.1 format is given by + * "Undocumented Windows 2000 Secrets", Windows 2000 Debugging Support/ + * Microsoft Symbol File Internals/CodeView Subsections, + * http://www.rawol.com/features/undocumented/sbs-w2k-1-windows-2000-debugging-support.pdf + */ +#define MD_CVINFOCV41_SIGNATURE 0x3930424e /* '90BN', CodeView 4.10. */ +#define MD_CVINFOCV50_SIGNATURE 0x3131424e /* '11BN', CodeView 5.0, + * MS C7-format (/Z7). */ + +#define MD_CVINFOUNKNOWN_SIGNATURE 0xffffffff /* An unlikely value. */ + +/* (MDRawModule).miscRecord can reference MDImageDebugMisc. The Windows + * structure is actually defined in WinNT.h. This structure is effectively + * obsolete with modules built by recent toolchains. */ + +typedef struct { + uint32_t data_type; /* IMAGE_DEBUG_TYPE_*, not defined here because + * this debug record type is mostly obsolete. */ + uint32_t length; /* Length of entire MDImageDebugMisc structure */ + uint8_t unicode; /* True if data is multibyte */ + uint8_t reserved[3]; + uint8_t data[1]; +} MDImageDebugMisc; /* IMAGE_DEBUG_MISC */ + +static const size_t MDImageDebugMisc_minsize = offsetof(MDImageDebugMisc, + data[0]); + + +typedef struct { + uint32_t number_of_modules; + MDRawModule modules[1]; +} MDRawModuleList; /* MINIDUMP_MODULE_LIST */ + +static const size_t MDRawModuleList_minsize = offsetof(MDRawModuleList, + modules[0]); + + +typedef struct { + uint32_t number_of_memory_ranges; + MDMemoryDescriptor memory_ranges[1]; +} MDRawMemoryList; /* MINIDUMP_MEMORY_LIST */ + +static const size_t MDRawMemoryList_minsize = offsetof(MDRawMemoryList, + memory_ranges[0]); + + +#define MD_EXCEPTION_MAXIMUM_PARAMETERS 15 + +typedef struct { + uint32_t exception_code; /* Windows: MDExceptionCodeWin, + * Mac OS X: MDExceptionMac, + * Linux: MDExceptionCodeLinux. */ + uint32_t exception_flags; /* Windows: 1 if noncontinuable, + Mac OS X: MDExceptionCodeMac. */ + uint64_t exception_record; /* Address (in the minidump-producing host's + * memory) of another MDException, for + * nested exceptions. */ + uint64_t exception_address; /* The address that caused the exception. + * Mac OS X: exception subcode (which is + * typically the address). */ + uint32_t number_parameters; /* Number of valid elements in + * exception_information. */ + uint32_t __align; + uint64_t exception_information[MD_EXCEPTION_MAXIMUM_PARAMETERS]; +} MDException; /* MINIDUMP_EXCEPTION */ + +#include "minidump_exception_linux.h" +#include "minidump_exception_mac.h" +#include "minidump_exception_ps3.h" +#include "minidump_exception_solaris.h" +#include "minidump_exception_win32.h" + +typedef struct { + uint32_t thread_id; /* Thread in which the exception + * occurred. Corresponds to + * (MDRawThread).thread_id. */ + uint32_t __align; + MDException exception_record; + MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ +} MDRawExceptionStream; /* MINIDUMP_EXCEPTION_STREAM */ + + +typedef union { + struct { + uint32_t vendor_id[3]; /* cpuid 0: ebx, edx, ecx */ + uint32_t version_information; /* cpuid 1: eax */ + uint32_t feature_information; /* cpuid 1: edx */ + uint32_t amd_extended_cpu_features; /* cpuid 0x80000001, ebx */ + } x86_cpu_info; + struct { + uint32_t cpuid; + uint32_t elf_hwcaps; /* linux specific, 0 otherwise */ + } arm_cpu_info; + struct { + uint64_t processor_features[2]; + } other_cpu_info; +} MDCPUInformation; /* CPU_INFORMATION */ + +/* For (MDCPUInformation).arm_cpu_info.elf_hwcaps. + * This matches the Linux kernel definitions from */ +typedef enum { + MD_CPU_ARM_ELF_HWCAP_SWP = (1 << 0), + MD_CPU_ARM_ELF_HWCAP_HALF = (1 << 1), + MD_CPU_ARM_ELF_HWCAP_THUMB = (1 << 2), + MD_CPU_ARM_ELF_HWCAP_26BIT = (1 << 3), + MD_CPU_ARM_ELF_HWCAP_FAST_MULT = (1 << 4), + MD_CPU_ARM_ELF_HWCAP_FPA = (1 << 5), + MD_CPU_ARM_ELF_HWCAP_VFP = (1 << 6), + MD_CPU_ARM_ELF_HWCAP_EDSP = (1 << 7), + MD_CPU_ARM_ELF_HWCAP_JAVA = (1 << 8), + MD_CPU_ARM_ELF_HWCAP_IWMMXT = (1 << 9), + MD_CPU_ARM_ELF_HWCAP_CRUNCH = (1 << 10), + MD_CPU_ARM_ELF_HWCAP_THUMBEE = (1 << 11), + MD_CPU_ARM_ELF_HWCAP_NEON = (1 << 12), + MD_CPU_ARM_ELF_HWCAP_VFPv3 = (1 << 13), + MD_CPU_ARM_ELF_HWCAP_VFPv3D16 = (1 << 14), + MD_CPU_ARM_ELF_HWCAP_TLS = (1 << 15), + MD_CPU_ARM_ELF_HWCAP_VFPv4 = (1 << 16), + MD_CPU_ARM_ELF_HWCAP_IDIVA = (1 << 17), + MD_CPU_ARM_ELF_HWCAP_IDIVT = (1 << 18), +} MDCPUInformationARMElfHwCaps; + +typedef struct { + /* The next 3 fields and numberOfProcessors are from the SYSTEM_INFO + * structure as returned by GetSystemInfo */ + uint16_t processor_architecture; + uint16_t processor_level; /* x86: 5 = 586, 6 = 686, ... */ + /* ARM: 6 = ARMv6, 7 = ARMv7 ... */ + uint16_t processor_revision; /* x86: 0xMMSS, where MM=model, + * SS=stepping */ + /* ARM: 0 */ + + uint8_t number_of_processors; + uint8_t product_type; /* Windows: VER_NT_* from WinNT.h */ + + /* The next 5 fields are from the OSVERSIONINFO structure as returned + * by GetVersionEx */ + uint32_t major_version; + uint32_t minor_version; + uint32_t build_number; + uint32_t platform_id; + MDRVA csd_version_rva; /* MDString further identifying the + * host OS. + * Windows: name of the installed OS + * service pack. + * Mac OS X: the Apple OS build number + * (sw_vers -buildVersion). + * Linux: uname -srvmo */ + + uint16_t suite_mask; /* Windows: VER_SUITE_* from WinNT.h */ + uint16_t reserved2; + + MDCPUInformation cpu; +} MDRawSystemInfo; /* MINIDUMP_SYSTEM_INFO */ + +/* For (MDRawSystemInfo).processor_architecture: */ +typedef enum { + MD_CPU_ARCHITECTURE_X86 = 0, /* PROCESSOR_ARCHITECTURE_INTEL */ + MD_CPU_ARCHITECTURE_MIPS = 1, /* PROCESSOR_ARCHITECTURE_MIPS */ + MD_CPU_ARCHITECTURE_ALPHA = 2, /* PROCESSOR_ARCHITECTURE_ALPHA */ + MD_CPU_ARCHITECTURE_PPC = 3, /* PROCESSOR_ARCHITECTURE_PPC */ + MD_CPU_ARCHITECTURE_SHX = 4, /* PROCESSOR_ARCHITECTURE_SHX + * (Super-H) */ + MD_CPU_ARCHITECTURE_ARM = 5, /* PROCESSOR_ARCHITECTURE_ARM */ + MD_CPU_ARCHITECTURE_IA64 = 6, /* PROCESSOR_ARCHITECTURE_IA64 */ + MD_CPU_ARCHITECTURE_ALPHA64 = 7, /* PROCESSOR_ARCHITECTURE_ALPHA64 */ + MD_CPU_ARCHITECTURE_MSIL = 8, /* PROCESSOR_ARCHITECTURE_MSIL + * (Microsoft Intermediate Language) */ + MD_CPU_ARCHITECTURE_AMD64 = 9, /* PROCESSOR_ARCHITECTURE_AMD64 */ + MD_CPU_ARCHITECTURE_X86_WIN64 = 10, + /* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */ + MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */ + MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */ + MD_CPU_ARCHITECTURE_ARM64 = 0x8003, /* Breakpad-defined value for ARM64 */ + MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */ +} MDCPUArchitecture; + +/* For (MDRawSystemInfo).platform_id: */ +typedef enum { + MD_OS_WIN32S = 0, /* VER_PLATFORM_WIN32s (Windows 3.1) */ + MD_OS_WIN32_WINDOWS = 1, /* VER_PLATFORM_WIN32_WINDOWS (Windows 95-98-Me) */ + MD_OS_WIN32_NT = 2, /* VER_PLATFORM_WIN32_NT (Windows NT, 2000+) */ + MD_OS_WIN32_CE = 3, /* VER_PLATFORM_WIN32_CE, VER_PLATFORM_WIN32_HH + * (Windows CE, Windows Mobile, "Handheld") */ + + /* The following values are Breakpad-defined. */ + MD_OS_UNIX = 0x8000, /* Generic Unix-ish */ + MD_OS_MAC_OS_X = 0x8101, /* Mac OS X/Darwin */ + MD_OS_IOS = 0x8102, /* iOS */ + MD_OS_LINUX = 0x8201, /* Linux */ + MD_OS_SOLARIS = 0x8202, /* Solaris */ + MD_OS_ANDROID = 0x8203, /* Android */ + MD_OS_PS3 = 0x8204, /* PS3 */ + MD_OS_NACL = 0x8205 /* Native Client (NaCl) */ +} MDOSPlatform; + +typedef struct { + uint16_t year; + uint16_t month; + uint16_t day_of_week; + uint16_t day; + uint16_t hour; + uint16_t minute; + uint16_t second; + uint16_t milliseconds; +} MDSystemTime; /* SYSTEMTIME */ + +typedef struct { + /* Required field. The bias is the difference, in minutes, between + * Coordinated Universal Time (UTC) and local time. + * Formula: UTC = local time + bias */ + int32_t bias; + /* A description for standard time. For example, "EST" could indicate Eastern + * Standard Time. In practice this contains the full time zone names. This + * string can be empty. */ + uint16_t standard_name[32]; /* UTF-16-encoded, 0-terminated */ + /* A MDSystemTime structure that contains a date and local time when the + * transition from daylight saving time to standard time occurs on this + * operating system. If the time zone does not support daylight saving time, + * the month member in the MDSystemTime structure is zero. */ + MDSystemTime standard_date; + /* The bias value to be used during local time translations that occur during + * standard time. */ + int32_t standard_bias; + /* A description for daylight saving time. For example, "PDT" could indicate + * Pacific Daylight Time. In practice this contains the full time zone names. + * This string can be empty. */ + uint16_t daylight_name[32]; /* UTF-16-encoded, 0-terminated */ + /* A MDSystemTime structure that contains a date and local time when the + * transition from standard time to daylight saving time occurs on this + * operating system. If the time zone does not support daylight saving time, + * the month member in the MDSystemTime structure is zero.*/ + MDSystemTime daylight_date; + /* The bias value to be used during local time translations that occur during + * daylight saving time. */ + int32_t daylight_bias; +} MDTimeZoneInformation; /* TIME_ZONE_INFORMATION */ + +/* MAX_PATH from windef.h */ +#define MD_MAX_PATH 260 + +/* The miscellaneous information stream contains a variety + * of small pieces of information. A member is valid if + * it's within the available size and its corresponding + * bit is set. */ +typedef struct { + uint32_t size_of_info; /* Length of entire MDRawMiscInfo structure. */ + uint32_t flags1; + + /* The next field is only valid if flags1 contains + * MD_MISCINFO_FLAGS1_PROCESS_ID. */ + uint32_t process_id; + + /* The next 3 fields are only valid if flags1 contains + * MD_MISCINFO_FLAGS1_PROCESS_TIMES. */ + uint32_t process_create_time; /* time_t process started */ + uint32_t process_user_time; /* seconds of user CPU time */ + uint32_t process_kernel_time; /* seconds of kernel CPU time */ + + /* The following fields are not present in MINIDUMP_MISC_INFO but are + * in MINIDUMP_MISC_INFO_2. When this struct is populated, these values + * may not be set. Use flags1 and size_of_info to determine whether these + * values are present. These are only valid when flags1 contains + * MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO. */ + uint32_t processor_max_mhz; + uint32_t processor_current_mhz; + uint32_t processor_mhz_limit; + uint32_t processor_max_idle_state; + uint32_t processor_current_idle_state; + + /* The following fields are not present in MINIDUMP_MISC_INFO_2 but are + * in MINIDUMP_MISC_INFO_3. When this struct is populated, these values + * may not be set. Use flags1 and size_of_info to determine whether these + * values are present. */ + + /* The following field is only valid if flags1 contains + * MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY. */ + uint32_t process_integrity_level; + + /* The following field is only valid if flags1 contains + * MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS. */ + uint32_t process_execute_flags; + + /* The following field is only valid if flags1 contains + * MD_MISCINFO_FLAGS1_PROTECTED_PROCESS. */ + uint32_t protected_process; + + /* The following 2 fields are only valid if flags1 contains + * MD_MISCINFO_FLAGS1_TIMEZONE. */ + uint32_t time_zone_id; + MDTimeZoneInformation time_zone; + + /* The following fields are not present in MINIDUMP_MISC_INFO_3 but are + * in MINIDUMP_MISC_INFO_4. When this struct is populated, these values + * may not be set. Use flags1 and size_of_info to determine whether these + * values are present. */ + + /* The following 2 fields are only valid if flags1 contains + * MD_MISCINFO_FLAGS1_BUILDSTRING. */ + uint16_t build_string[MD_MAX_PATH]; /* UTF-16-encoded, 0-terminated */ + uint16_t dbg_bld_str[40]; /* UTF-16-encoded, 0-terminated */ +} MDRawMiscInfo; /* MINIDUMP_MISC_INFO, MINIDUMP_MISC_INFO_2, + * MINIDUMP_MISC_INFO_3, MINIDUMP_MISC_INFO_4, + * MINIDUMP_MISC_INFO_N */ + +static const size_t MD_MISCINFO_SIZE = + offsetof(MDRawMiscInfo, processor_max_mhz); +static const size_t MD_MISCINFO2_SIZE = + offsetof(MDRawMiscInfo, process_integrity_level); +static const size_t MD_MISCINFO3_SIZE = + offsetof(MDRawMiscInfo, build_string[0]); +static const size_t MD_MISCINFO4_SIZE = sizeof(MDRawMiscInfo); + +/* For (MDRawMiscInfo).flags1. These values indicate which fields in the + * MDRawMiscInfoStructure are valid. */ +typedef enum { + MD_MISCINFO_FLAGS1_PROCESS_ID = 0x00000001, + /* MINIDUMP_MISC1_PROCESS_ID */ + MD_MISCINFO_FLAGS1_PROCESS_TIMES = 0x00000002, + /* MINIDUMP_MISC1_PROCESS_TIMES */ + MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO = 0x00000004, + /* MINIDUMP_MISC1_PROCESSOR_POWER_INFO */ + MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY = 0x00000010, + /* MINIDUMP_MISC3_PROCESS_INTEGRITY */ + MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS = 0x00000020, + /* MINIDUMP_MISC3_PROCESS_EXECUTE_FLAGS */ + MD_MISCINFO_FLAGS1_TIMEZONE = 0x00000040, + /* MINIDUMP_MISC3_TIMEZONE */ + MD_MISCINFO_FLAGS1_PROTECTED_PROCESS = 0x00000080, + /* MINIDUMP_MISC3_PROTECTED_PROCESS */ + MD_MISCINFO_FLAGS1_BUILDSTRING = 0x00000100, + /* MINIDUMP_MISC4_BUILDSTRING */ +} MDMiscInfoFlags1; + +/* + * Around DbgHelp version 6.0, the style of new LIST structures changed + * from including an array of length 1 at the end of the struct to + * represent the variable-length data to including explicit + * "size of header", "size of entry" and "number of entries" fields + * in the header, presumably to allow backwards-compatibly-extending + * the structures in the future. The actual list entries follow the + * header data directly in this case. + */ + +typedef struct { + uint32_t size_of_header; /* sizeof(MDRawMemoryInfoList) */ + uint32_t size_of_entry; /* sizeof(MDRawMemoryInfo) */ + uint64_t number_of_entries; +} MDRawMemoryInfoList; /* MINIDUMP_MEMORY_INFO_LIST */ + +typedef struct { + uint64_t base_address; /* Base address of a region of pages */ + uint64_t allocation_base; /* Base address of a range of pages + * within this region. */ + uint32_t allocation_protection; /* Memory protection when this region + * was originally allocated: + * MDMemoryProtection */ + uint32_t __alignment1; + uint64_t region_size; + uint32_t state; /* MDMemoryState */ + uint32_t protection; /* MDMemoryProtection */ + uint32_t type; /* MDMemoryType */ + uint32_t __alignment2; +} MDRawMemoryInfo; /* MINIDUMP_MEMORY_INFO */ + +/* For (MDRawMemoryInfo).state */ +typedef enum { + MD_MEMORY_STATE_COMMIT = 0x1000, /* physical storage has been allocated */ + MD_MEMORY_STATE_RESERVE = 0x2000, /* reserved, but no physical storage */ + MD_MEMORY_STATE_FREE = 0x10000 /* available to be allocated */ +} MDMemoryState; + +/* For (MDRawMemoryInfo).allocation_protection and .protection */ +typedef enum { + MD_MEMORY_PROTECT_NOACCESS = 0x01, /* PAGE_NOACCESS */ + MD_MEMORY_PROTECT_READONLY = 0x02, /* PAGE_READONLY */ + MD_MEMORY_PROTECT_READWRITE = 0x04, /* PAGE_READWRITE */ + MD_MEMORY_PROTECT_WRITECOPY = 0x08, /* PAGE_WRITECOPY */ + MD_MEMORY_PROTECT_EXECUTE = 0x10, /* PAGE_EXECUTE */ + MD_MEMORY_PROTECT_EXECUTE_READ = 0x20, /* PAGE_EXECUTE_READ */ + MD_MEMORY_PROTECT_EXECUTE_READWRITE = 0x40, /* PAGE_EXECUTE_READWRITE */ + MD_MEMORY_PROTECT_EXECUTE_WRITECOPY = 0x80, /* PAGE_EXECUTE_WRITECOPY */ + /* These options can be combined with the previous flags. */ + MD_MEMORY_PROTECT_GUARD = 0x100, /* PAGE_GUARD */ + MD_MEMORY_PROTECT_NOCACHE = 0x200, /* PAGE_NOCACHE */ + MD_MEMORY_PROTECT_WRITECOMBINE = 0x400, /* PAGE_WRITECOMBINE */ +} MDMemoryProtection; + +/* Used to mask the mutually exclusive options from the combinable flags. */ +const uint32_t MD_MEMORY_PROTECTION_ACCESS_MASK = 0xFF; + +/* For (MDRawMemoryInfo).type */ +typedef enum { + MD_MEMORY_TYPE_PRIVATE = 0x20000, /* not shared by other processes */ + MD_MEMORY_TYPE_MAPPED = 0x40000, /* mapped into the view of a section */ + MD_MEMORY_TYPE_IMAGE = 0x1000000 /* mapped into the view of an image */ +} MDMemoryType; + +/* + * Breakpad extension types + */ + + +typedef struct { + /* validity is a bitmask with values from MDBreakpadInfoValidity, indicating + * which of the other fields in the structure are valid. */ + uint32_t validity; + + /* Thread ID of the handler thread. dump_thread_id should correspond to + * the thread_id of an MDRawThread in the minidump's MDRawThreadList if + * a dedicated thread in that list was used to produce the minidump. If + * the MDRawThreadList does not contain a dedicated thread used to produce + * the minidump, this field should be set to 0 and the validity field + * must not contain MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID. */ + uint32_t dump_thread_id; + + /* Thread ID of the thread that requested the minidump be produced. As + * with dump_thread_id, requesting_thread_id should correspond to the + * thread_id of an MDRawThread in the minidump's MDRawThreadList. For + * minidumps produced as a result of an exception, requesting_thread_id + * will be the same as the MDRawExceptionStream's thread_id field. For + * minidumps produced "manually" at the program's request, + * requesting_thread_id will indicate which thread caused the dump to be + * written. If the minidump was produced at the request of something + * other than a thread in the MDRawThreadList, this field should be set + * to 0 and the validity field must not contain + * MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID. */ + uint32_t requesting_thread_id; +} MDRawBreakpadInfo; + +/* For (MDRawBreakpadInfo).validity: */ +typedef enum { + /* When set, the dump_thread_id field is valid. */ + MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID = 1 << 0, + + /* When set, the requesting_thread_id field is valid. */ + MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID = 1 << 1 +} MDBreakpadInfoValidity; + +typedef struct { + /* expression, function, and file are 0-terminated UTF-16 strings. They + * may be truncated if necessary, but should always be 0-terminated when + * written to a file. + * Fixed-length strings are used because MiniDumpWriteDump doesn't offer + * a way for user streams to point to arbitrary RVAs for strings. */ + uint16_t expression[128]; /* Assertion that failed... */ + uint16_t function[128]; /* ...within this function... */ + uint16_t file[128]; /* ...in this file... */ + uint32_t line; /* ...at this line. */ + uint32_t type; +} MDRawAssertionInfo; + +/* For (MDRawAssertionInfo).type: */ +typedef enum { + MD_ASSERTION_INFO_TYPE_UNKNOWN = 0, + + /* Used for assertions that would be raised by the MSVC CRT but are + * directed to an invalid parameter handler instead. */ + MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER, + + /* Used for assertions that would be raised by the MSVC CRT but are + * directed to a pure virtual call handler instead. */ + MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL +} MDAssertionInfoData; + +/* These structs are used to store the DSO debug data in Linux minidumps, + * which is necessary for converting minidumps to usable coredumps. + * Because of a historical accident, several fields are variably encoded + * according to client word size, so tools potentially need to support both. */ + +typedef struct { + uint32_t addr; + MDRVA name; + uint32_t ld; +} MDRawLinkMap32; + +typedef struct { + uint32_t version; + MDRVA map; /* array of MDRawLinkMap32 */ + uint32_t dso_count; + uint32_t brk; + uint32_t ldbase; + uint32_t dynamic; +} MDRawDebug32; + +typedef struct { + uint64_t addr; + MDRVA name; + uint64_t ld; +} MDRawLinkMap64; + +typedef struct { + uint32_t version; + MDRVA map; /* array of MDRawLinkMap64 */ + uint32_t dso_count; + uint64_t brk; + uint64_t ldbase; + uint64_t dynamic; +} MDRawDebug64; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + + +#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ */ diff --git a/Telegram/SourceFiles/_other/crypt.h b/Telegram/ThirdParty/minizip/crypt.h similarity index 100% rename from Telegram/SourceFiles/_other/crypt.h rename to Telegram/ThirdParty/minizip/crypt.h diff --git a/Telegram/SourceFiles/_other/ioapi.h b/Telegram/ThirdParty/minizip/ioapi.h similarity index 100% rename from Telegram/SourceFiles/_other/ioapi.h rename to Telegram/ThirdParty/minizip/ioapi.h diff --git a/Telegram/SourceFiles/_other/zip.c b/Telegram/ThirdParty/minizip/zip.c similarity index 100% rename from Telegram/SourceFiles/_other/zip.c rename to Telegram/ThirdParty/minizip/zip.c diff --git a/Telegram/SourceFiles/_other/zip.h b/Telegram/ThirdParty/minizip/zip.h similarity index 100% rename from Telegram/SourceFiles/_other/zip.h rename to Telegram/ThirdParty/minizip/zip.h From daa0adfff9fed6e497890eb5a26e50b076455ff8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Feb 2016 13:12:37 +0300 Subject: [PATCH 039/316] added breakpad support for os x --- Telegram/SourceFiles/logs.cpp | 119 +- Telegram/SourceFiles/stdafx.h | 12 +- Telegram/SourceFiles/window.cpp | 12 +- Telegram/Telegram.xcodeproj/project.pbxproj | 289 ++- .../client/mac/crash_generation/client_info.h | 47 + .../crash_generation_client.cc | 72 + .../crash_generation_client.h | 65 + .../crash_generation_server.cc | 166 ++ .../crash_generation_server.h | 150 ++ .../client/mac/handler/breakpad_nlist_64.cc | 402 +++++ .../client/mac/handler/breakpad_nlist_64.h | 47 + .../client/mac/handler/dynamic_images.cc | 573 ++++++ .../client/mac/handler/dynamic_images.h | 319 ++++ .../client/mac/handler/mach_vm_compat.h | 48 + .../client/mac/handler/minidump_generator.cc | 1591 +++++++++++++++++ .../client/mac/handler/minidump_generator.h | 236 +++ .../client/mac/handler/ucontext_compat.h | 47 + .../client/minidump_file_writer-inl.h | 97 + .../breakpad/client/minidump_file_writer.cc | 350 ++++ .../breakpad/client/minidump_file_writer.h | 272 +++ .../ThirdParty/breakpad/common/convert_UTF.c | 554 ++++++ .../ThirdParty/breakpad/common/convert_UTF.h | 164 ++ .../common/linux/linux_libc_support.h | 96 + .../ThirdParty/breakpad/common/mac/MachIPC.h | 301 ++++ .../ThirdParty/breakpad/common/mac/MachIPC.mm | 306 ++++ .../breakpad/common/mac/bootstrap_compat.cc | 42 + .../breakpad/common/mac/bootstrap_compat.h | 54 + .../ThirdParty/breakpad/common/mac/byteswap.h | 73 + .../ThirdParty/breakpad/common/mac/file_id.cc | 106 ++ .../ThirdParty/breakpad/common/mac/file_id.h | 81 + .../breakpad/common/mac/macho_id.cc | 369 ++++ .../ThirdParty/breakpad/common/mac/macho_id.h | 131 ++ .../breakpad/common/mac/macho_utilities.cc | 155 ++ .../breakpad/common/mac/macho_utilities.h | 95 + .../breakpad/common/mac/macho_walker.cc | 268 +++ .../breakpad/common/mac/macho_walker.h | 119 ++ .../common/mac/scoped_task_suspend-inl.h | 56 + .../breakpad/common/mac/string_utilities.cc | 84 + .../breakpad/common/mac/string_utilities.h | 52 + Telegram/ThirdParty/breakpad/common/md5.cc | 251 +++ Telegram/ThirdParty/breakpad/common/md5.h | 27 + Telegram/ThirdParty/breakpad/common/memory.h | 212 +++ .../breakpad/common/string_conversion.cc | 155 ++ .../breakpad/common/string_conversion.h | 68 + .../breakpad/common/using_std_string.h | 65 + .../google_breakpad/common/minidump_size.h | 107 ++ Telegram/ThirdParty/minizip/ioapi.c | 247 +++ Telegram/ThirdParty/minizip/zip.c | 2 +- 48 files changed, 9082 insertions(+), 72 deletions(-) create mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc create mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc create mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h create mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h create mode 100644 Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h create mode 100644 Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc create mode 100644 Telegram/ThirdParty/breakpad/client/minidump_file_writer.h create mode 100644 Telegram/ThirdParty/breakpad/common/convert_UTF.c create mode 100644 Telegram/ThirdParty/breakpad/common/convert_UTF.h create mode 100644 Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/MachIPC.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm create mode 100644 Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc create mode 100644 Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/byteswap.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/file_id.cc create mode 100644 Telegram/ThirdParty/breakpad/common/mac/file_id.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_id.cc create mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_id.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc create mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc create mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_walker.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h create mode 100644 Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc create mode 100644 Telegram/ThirdParty/breakpad/common/mac/string_utilities.h create mode 100644 Telegram/ThirdParty/breakpad/common/md5.cc create mode 100644 Telegram/ThirdParty/breakpad/common/md5.h create mode 100644 Telegram/ThirdParty/breakpad/common/memory.h create mode 100644 Telegram/ThirdParty/breakpad/common/string_conversion.cc create mode 100644 Telegram/ThirdParty/breakpad/common/string_conversion.h create mode 100644 Telegram/ThirdParty/breakpad/common/using_std_string.h create mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h create mode 100644 Telegram/ThirdParty/minizip/ioapi.c diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 121dc35a64..086c7b4612 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -656,60 +656,6 @@ namespace SignalHandlers { return stream; } - google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0; - -#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 - bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success) -#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 - bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) -#endif - { - return success; - } - - void StartBreakpad() { - QString dumpPath = cWorkingDir() + qsl("tdumps"); - QDir().mkpath(dumpPath); - -#ifdef Q_OS_WIN - BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( - dumpPath.toStdWString(), - /*FilterCallback*/ 0, - DumpCallback, - /*context*/ 0, - true - ); -#elif defined Q_OS_MAC - pHandler = new google_breakpad::ExceptionHandler( - dumpPath.toStdString(), - /*FilterCallback*/ 0, - DumpCallback, - /*context*/ 0, - true, - 0 - ); -#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 - pHandler = new google_breakpad::ExceptionHandler( - google_breakpad::MinidumpDescriptor(dumpPath.toStdString()), - /*FilterCallback*/ 0, - DumpCallback, - /*context*/ 0, - true, - -1 - ); -#endif - } - - void FinishBreakpad() { - if (BreakpadExceptionHandler) { - google_breakpad::ExceptionHandler *h = BreakpadExceptionHandler; - BreakpadExceptionHandler = 0; - delete h; - } - } - Qt::HANDLE LoggingCrashThreadId = 0; bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; @@ -719,7 +665,9 @@ namespace SignalHandlers { struct sigaction SIG_def[32]; void Handler(int signum, siginfo_t *info, void *ucontext) { - sigaction(signum, &SIG_def[signum], 0); + if (signum > 0) { + sigaction(signum, &SIG_def[signum], 0); + } #else void Handler(int signum) { @@ -780,6 +728,7 @@ namespace SignalHandlers { ucontext_t *uc = (ucontext_t*)ucontext; void *caller = 0; + if (uc) { #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) /* OSX < 10.6 */ #if defined(__x86_64__) @@ -807,6 +756,7 @@ namespace SignalHandlers { #endif #endif + } void *addresses[132] = { 0 }; size_t size = backtrace(addresses, 128); @@ -849,6 +799,63 @@ namespace SignalHandlers { LoggingCrashThreadId = 0; } + google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0; + +#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 + bool DumpCallback(const char* _dump_dir, const char* _minidump_id, void *context, bool success) +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 + bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) +#endif + { +#ifdef Q_OS_MAC + Handler(-1, 0, 0); +#endif + return success; + } + + void StartBreakpad() { + QString dumpPath = cWorkingDir() + qsl("tdumps"); + QDir().mkpath(dumpPath); + +#ifdef Q_OS_WIN + BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( + dumpPath.toStdWString(), + /*FilterCallback*/ 0, + DumpCallback, + /*context*/ 0, + true + ); +#elif defined Q_OS_MAC + BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( + dumpPath.toStdString(), + /*FilterCallback*/ 0, + DumpCallback, + /*context*/ 0, + true, + 0 + ); +#elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 + BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( + google_breakpad::MinidumpDescriptor(dumpPath.toStdString()), + /*FilterCallback*/ 0, + DumpCallback, + /*context*/ 0, + true, + -1 + ); +#endif + } + + void FinishBreakpad() { + if (BreakpadExceptionHandler) { + google_breakpad::ExceptionHandler *h = BreakpadExceptionHandler; + BreakpadExceptionHandler = 0; + delete h; + } + } + Status start() { CrashDumpPath = (cWorkingDir() + qsl("tdata/working")).toUtf8(); if (FILE *f = fopen(CrashDumpPath.constData(), "rb")) { @@ -893,7 +900,9 @@ namespace SignalHandlers { sigemptyset(&sigact.sa_mask); sigact.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; +#ifndef Q_OS_MAC // let breakpad handle this sigaction(SIGABRT, &sigact, &SIG_def[SIGABRT]); +#endif sigaction(SIGSEGV, &sigact, &SIG_def[SIGSEGV]); sigaction(SIGILL, &sigact, &SIG_def[SIGILL]); sigaction(SIGFPE, &sigact, &SIG_def[SIGFPE]); diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 58a1c065b1..8a97b226ec 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -22,7 +22,9 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #define PSAPI_VERSION 1 // fix WinXP //#define Q_NO_TEMPLATE_FRIENDS // fix some compiler difference issues -#include +#define __STDC_FORMAT_MACROS // fix breakpad for mac + +#ifdef __cplusplus #include #include @@ -52,12 +54,18 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org extern "C" { +#endif + +#include "zip.h" + #include #include #include #include #include +#ifdef __cplusplus + } #include "types.h" @@ -79,3 +87,5 @@ extern "C" { #include "gui/flatlabel.h" #include "app.h" + +#endif diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 77158620e4..d4ae8fc398 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -41,8 +41,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "mediaview.h" #include "localstorage.h" -#include "zip.h" - ConnectingWidget::ConnectingWidget(QWidget *parent, const QString &text, const QString &reconnect) : QWidget(parent), _shadow(st::boxShadow), _reconnect(this, QString()) { set(text, reconnect); connect(&_reconnect, SIGNAL(clicked()), this, SLOT(onReconnect())); @@ -2019,7 +2017,6 @@ LastCrashedWindow::LastCrashedWindow() #endif { -#ifdef Q_OS_WIN if (_sendingState != SendingNoReport) { QString maxDump, maxDumpFull; QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); @@ -2044,7 +2041,6 @@ LastCrashedWindow::LastCrashedWindow() _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(maxDumpSize / 1024)); } -#endif _networkSettings.setText(qsl("NETWORK SETTINGS")); connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings())); @@ -2306,10 +2302,9 @@ void LastCrashedWindow::onCheckingFinished() { reportPart.setBody(Global::LastCrashDump()); multipart->append(reportPart); -#ifdef Q_OS_WIN QFileInfo dmpFile(_minidumpFull); if (dmpFile.exists() && dmpFile.size() > 0 && dmpFile.size() < 20 * 1024 * 1024 && - QRegularExpression(qsl("^[a-z0-9\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { + QRegularExpression(qsl("^[a-zA-Z0-9\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { QFile file(_minidumpFull); if (file.open(QIODevice::ReadOnly)) { QByteArray minidump = file.readAll(); @@ -2330,9 +2325,9 @@ void LastCrashedWindow::onCheckingFinished() { zfuncs.ztell_file = zByteArrayTellFile; if (zipFile zf = zipOpen2(0, APPEND_STATUS_CREATE, 0, &zfuncs)) { - zip_fileinfo zfi = { 0 }; + zip_fileinfo zfi = { { 0, 0, 0, 0, 0, 0 }, 0, 0, 0 }; std::wstring fileName = dmpFile.fileName().toStdWString(); - if (zipOpenNewFileInZip(zf, std::string(fileName.begin(), fileName.end()).c_str(), &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION) != S_OK) { + if (zipOpenNewFileInZip(zf, std::string(fileName.begin(), fileName.end()).c_str(), &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION) != ZIP_OK) { failed = true; } else if (zipWriteInFileInZip(zf, minidump.constData(), minidump.size()) != 0) { failed = true; @@ -2358,7 +2353,6 @@ void LastCrashedWindow::onCheckingFinished() { } } } -#endif _sendReply = _sendManager.post(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=report")), multipart); multipart->setParent(_sendReply); diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 4f7b757471..ea1644d6de 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -44,6 +44,26 @@ 0710CA051B0B9404001B4272 /* moc_stickersetbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0710CA041B0B9404001B4272 /* moc_stickersetbox.cpp */; }; 07129D6A1C16D230002DC495 /* mtpAuthKey.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D691C16D230002DC495 /* mtpAuthKey.cpp */; }; 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D6C1C16D245002DC495 /* facades.cpp */; }; + 071AD8D21C5E8E6D008C9E90 /* zip.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D11C5E8E6D008C9E90 /* zip.c */; }; + 071AD8D71C5E8F35008C9E90 /* breakpad_nlist_64.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D31C5E8F35008C9E90 /* breakpad_nlist_64.cc */; }; + 071AD8D81C5E8F35008C9E90 /* dynamic_images.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D41C5E8F35008C9E90 /* dynamic_images.cc */; }; + 071AD8D91C5E8F35008C9E90 /* exception_handler.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D51C5E8F35008C9E90 /* exception_handler.cc */; }; + 071AD8DA1C5E8F35008C9E90 /* minidump_generator.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D61C5E8F35008C9E90 /* minidump_generator.cc */; }; + 071AD8DE1C5E912C008C9E90 /* crash_generation_client.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8DC1C5E912C008C9E90 /* crash_generation_client.cc */; }; + 071AD8DF1C5E912C008C9E90 /* crash_generation_server.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8DD1C5E912C008C9E90 /* crash_generation_server.cc */; }; + 071AD8E21C5E9143008C9E90 /* minidump_file_writer.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E11C5E9143008C9E90 /* minidump_file_writer.cc */; }; + 071AD8E61C5E9196008C9E90 /* convert_UTF.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E31C5E9196008C9E90 /* convert_UTF.c */; }; + 071AD8E71C5E9196008C9E90 /* md5.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E41C5E9196008C9E90 /* md5.cc */; }; + 071AD8E81C5E9196008C9E90 /* string_conversion.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E51C5E9196008C9E90 /* string_conversion.cc */; }; + 071AD8F01C5E91E3008C9E90 /* bootstrap_compat.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E91C5E91E3008C9E90 /* bootstrap_compat.cc */; }; + 071AD8F11C5E91E3008C9E90 /* file_id.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EA1C5E91E3008C9E90 /* file_id.cc */; }; + 071AD8F21C5E91E3008C9E90 /* MachIPC.mm in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EB1C5E91E3008C9E90 /* MachIPC.mm */; }; + 071AD8F31C5E91E3008C9E90 /* macho_id.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EC1C5E91E3008C9E90 /* macho_id.cc */; }; + 071AD8F41C5E91E3008C9E90 /* macho_utilities.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8ED1C5E91E3008C9E90 /* macho_utilities.cc */; }; + 071AD8F51C5E91E3008C9E90 /* macho_walker.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EE1C5E91E3008C9E90 /* macho_walker.cc */; }; + 071AD8F61C5E91E3008C9E90 /* string_utilities.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EF1C5E91E3008C9E90 /* string_utilities.cc */; }; + 071AD8F81C5E99D6008C9E90 /* ioapi.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8F71C5E99D6008C9E90 /* ioapi.c */; }; + 071AD90A1C5EA2A5008C9E90 /* Breakpad.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */; }; 0732E4A9199E262300D50FE7 /* overviewwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0732E4A7199E262300D50FE7 /* overviewwidget.cpp */; }; 0732E4AC199E268A00D50FE7 /* moc_overviewwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0732E4AB199E268A00D50FE7 /* moc_overviewwidget.cpp */; }; 074756191A1372C600CA07F7 /* moc_types.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 074756181A1372C600CA07F7 /* moc_types.cpp */; }; @@ -276,6 +296,73 @@ 07129D691C16D230002DC495 /* mtpAuthKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mtpAuthKey.cpp; path = SourceFiles/mtproto/mtpAuthKey.cpp; sourceTree = SOURCE_ROOT; }; 07129D6C1C16D245002DC495 /* facades.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = facades.cpp; path = SourceFiles/facades.cpp; sourceTree = SOURCE_ROOT; }; 07129D6D1C16D245002DC495 /* facades.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = facades.h; path = SourceFiles/facades.h; sourceTree = SOURCE_ROOT; }; + 071AD86B1C5E8536008C9E90 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = ThirdParty/minizip/crypt.h; sourceTree = SOURCE_ROOT; }; + 071AD86C1C5E8536008C9E90 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = ThirdParty/minizip/ioapi.h; sourceTree = SOURCE_ROOT; }; + 071AD86E1C5E8536008C9E90 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = ThirdParty/minizip/zip.h; sourceTree = SOURCE_ROOT; }; + 071AD8751C5E85A0008C9E90 /* exception_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = exception_handler.h; path = ThirdParty/breakpad/client/mac/handler/exception_handler.h; sourceTree = SOURCE_ROOT; }; + 071AD8791C5E8672008C9E90 /* crash_generation_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crash_generation_client.h; sourceTree = ""; }; + 071AD87B1C5E8688008C9E90 /* ucontext_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ucontext_compat.h; path = ThirdParty/breakpad/client/mac/handler/ucontext_compat.h; sourceTree = SOURCE_ROOT; }; + 071AD87F1C5E87AA008C9E90 /* scoped_ptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scoped_ptr.h; path = ThirdParty/breakpad/common/scoped_ptr.h; sourceTree = SOURCE_ROOT; }; + 071AD8811C5E87C2008C9E90 /* MachIPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MachIPC.h; path = ThirdParty/breakpad/common/mac/MachIPC.h; sourceTree = SOURCE_ROOT; }; + 071AD8851C5E8853008C9E90 /* bootstrap_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bootstrap_compat.h; path = ThirdParty/breakpad/common/mac/bootstrap_compat.h; sourceTree = SOURCE_ROOT; }; + 071AD8881C5E8886008C9E90 /* minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_generator.h; path = ThirdParty/breakpad/client/mac/handler/minidump_generator.h; sourceTree = SOURCE_ROOT; }; + 071AD88B1C5E88AA008C9E90 /* crash_generation_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crash_generation_server.h; sourceTree = ""; }; + 071AD88D1C5E88CD008C9E90 /* minidump_file_writer-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "minidump_file_writer-inl.h"; path = "ThirdParty/breakpad/client/minidump_file_writer-inl.h"; sourceTree = SOURCE_ROOT; }; + 071AD88F1C5E88CD008C9E90 /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_file_writer.h; path = ThirdParty/breakpad/client/minidump_file_writer.h; sourceTree = SOURCE_ROOT; }; + 071AD8911C5E88EA008C9E90 /* client_info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = client_info.h; sourceTree = ""; }; + 071AD8921C5E8994008C9E90 /* memory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = memory.h; path = ThirdParty/breakpad/common/memory.h; sourceTree = SOURCE_ROOT; }; + 071AD8951C5E89D1008C9E90 /* breakpad_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = breakpad_types.h; path = ThirdParty/breakpad/google_breakpad/common/breakpad_types.h; sourceTree = SOURCE_ROOT; }; + 071AD8961C5E89D1008C9E90 /* minidump_cpu_amd64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_amd64.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h; sourceTree = SOURCE_ROOT; }; + 071AD8971C5E89D1008C9E90 /* minidump_cpu_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_arm.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h; sourceTree = SOURCE_ROOT; }; + 071AD8981C5E89D1008C9E90 /* minidump_cpu_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_arm64.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h; sourceTree = SOURCE_ROOT; }; + 071AD8991C5E89D1008C9E90 /* minidump_cpu_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_mips.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h; sourceTree = SOURCE_ROOT; }; + 071AD89A1C5E89D1008C9E90 /* minidump_cpu_ppc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_ppc.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h; sourceTree = SOURCE_ROOT; }; + 071AD89B1C5E89D1008C9E90 /* minidump_cpu_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_ppc64.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h; sourceTree = SOURCE_ROOT; }; + 071AD89C1C5E89D1008C9E90 /* minidump_cpu_sparc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_sparc.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h; sourceTree = SOURCE_ROOT; }; + 071AD89D1C5E89D1008C9E90 /* minidump_cpu_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_x86.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h; sourceTree = SOURCE_ROOT; }; + 071AD89E1C5E89D1008C9E90 /* minidump_exception_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_linux.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h; sourceTree = SOURCE_ROOT; }; + 071AD89F1C5E89D1008C9E90 /* minidump_exception_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_mac.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h; sourceTree = SOURCE_ROOT; }; + 071AD8A01C5E89D1008C9E90 /* minidump_exception_ps3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_ps3.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h; sourceTree = SOURCE_ROOT; }; + 071AD8A11C5E89D1008C9E90 /* minidump_exception_solaris.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_solaris.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h; sourceTree = SOURCE_ROOT; }; + 071AD8A21C5E89D1008C9E90 /* minidump_exception_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_win32.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h; sourceTree = SOURCE_ROOT; }; + 071AD8A31C5E89D1008C9E90 /* minidump_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_format.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_format.h; sourceTree = SOURCE_ROOT; }; + 071AD8A41C5E89D1008C9E90 /* minidump_size.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_size.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_size.h; sourceTree = SOURCE_ROOT; }; + 071AD8A61C5E8A30008C9E90 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ThirdParty/breakpad/common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; }; + 071AD8A91C5E8A7B008C9E90 /* dynamic_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_images.h; path = ThirdParty/breakpad/client/mac/handler/dynamic_images.h; sourceTree = SOURCE_ROOT; }; + 071AD8AB1C5E8A99008C9E90 /* mach_vm_compat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mach_vm_compat.h; path = ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h; sourceTree = SOURCE_ROOT; }; + 071AD8AD1C5E8B07008C9E90 /* breakpad_nlist_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = breakpad_nlist_64.h; path = ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h; sourceTree = SOURCE_ROOT; }; + 071AD8AF1C5E8B16008C9E90 /* byteswap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = byteswap.h; path = ThirdParty/breakpad/common/mac/byteswap.h; sourceTree = SOURCE_ROOT; }; + 071AD8B11C5E8B23008C9E90 /* linux_libc_support.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = linux_libc_support.h; path = ThirdParty/breakpad/common/linux/linux_libc_support.h; sourceTree = SOURCE_ROOT; }; + 071AD8B31C5E8B43008C9E90 /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ThirdParty/breakpad/common/string_conversion.h; sourceTree = SOURCE_ROOT; }; + 071AD8B61C5E8B5C008C9E90 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ThirdParty/breakpad/common/mac/file_id.h; sourceTree = SOURCE_ROOT; }; + 071AD8B81C5E8B81008C9E90 /* scoped_task_suspend-inl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "scoped_task_suspend-inl.h"; path = "ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h"; sourceTree = SOURCE_ROOT; }; + 071AD8BA1C5E8B9B008C9E90 /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ThirdParty/breakpad/common/mac/macho_id.h; sourceTree = SOURCE_ROOT; }; + 071AD8BD1C5E8BB0008C9E90 /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ThirdParty/breakpad/common/convert_UTF.h; sourceTree = SOURCE_ROOT; }; + 071AD8BF1C5E8BC8008C9E90 /* using_std_string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = using_std_string.h; path = ThirdParty/breakpad/common/using_std_string.h; sourceTree = SOURCE_ROOT; }; + 071AD8C11C5E8BE5008C9E90 /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ThirdParty/breakpad/common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; }; + 071AD8C41C5E8BFD008C9E90 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = md5.h; path = ThirdParty/breakpad/common/md5.h; sourceTree = SOURCE_ROOT; }; + 071AD8C71C5E8C14008C9E90 /* string_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_utilities.h; path = ThirdParty/breakpad/common/mac/string_utilities.h; sourceTree = SOURCE_ROOT; }; + 071AD8D11C5E8E6D008C9E90 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = ThirdParty/minizip/zip.c; sourceTree = SOURCE_ROOT; }; + 071AD8D31C5E8F35008C9E90 /* breakpad_nlist_64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = breakpad_nlist_64.cc; path = ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc; sourceTree = SOURCE_ROOT; }; + 071AD8D41C5E8F35008C9E90 /* dynamic_images.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dynamic_images.cc; path = ThirdParty/breakpad/client/mac/handler/dynamic_images.cc; sourceTree = SOURCE_ROOT; }; + 071AD8D51C5E8F35008C9E90 /* exception_handler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler.cc; path = ThirdParty/breakpad/client/mac/handler/exception_handler.cc; sourceTree = SOURCE_ROOT; }; + 071AD8D61C5E8F35008C9E90 /* minidump_generator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_generator.cc; path = ThirdParty/breakpad/client/mac/handler/minidump_generator.cc; sourceTree = SOURCE_ROOT; }; + 071AD8DC1C5E912C008C9E90 /* crash_generation_client.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crash_generation_client.cc; sourceTree = ""; }; + 071AD8DD1C5E912C008C9E90 /* crash_generation_server.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crash_generation_server.cc; sourceTree = ""; }; + 071AD8E11C5E9143008C9E90 /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer.cc; path = ThirdParty/breakpad/client/minidump_file_writer.cc; sourceTree = SOURCE_ROOT; }; + 071AD8E31C5E9196008C9E90 /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ThirdParty/breakpad/common/convert_UTF.c; sourceTree = SOURCE_ROOT; }; + 071AD8E41C5E9196008C9E90 /* md5.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = md5.cc; path = ThirdParty/breakpad/common/md5.cc; sourceTree = SOURCE_ROOT; }; + 071AD8E51C5E9196008C9E90 /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ThirdParty/breakpad/common/string_conversion.cc; sourceTree = SOURCE_ROOT; }; + 071AD8E91C5E91E3008C9E90 /* bootstrap_compat.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bootstrap_compat.cc; path = ThirdParty/breakpad/common/mac/bootstrap_compat.cc; sourceTree = SOURCE_ROOT; }; + 071AD8EA1C5E91E3008C9E90 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ThirdParty/breakpad/common/mac/file_id.cc; sourceTree = SOURCE_ROOT; }; + 071AD8EB1C5E91E3008C9E90 /* MachIPC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MachIPC.mm; path = ThirdParty/breakpad/common/mac/MachIPC.mm; sourceTree = SOURCE_ROOT; }; + 071AD8EC1C5E91E3008C9E90 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ThirdParty/breakpad/common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; }; + 071AD8ED1C5E91E3008C9E90 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ThirdParty/breakpad/common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; }; + 071AD8EE1C5E91E3008C9E90 /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ThirdParty/breakpad/common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; }; + 071AD8EF1C5E91E3008C9E90 /* string_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_utilities.cc; path = ThirdParty/breakpad/common/mac/string_utilities.cc; sourceTree = SOURCE_ROOT; }; + 071AD8F71C5E99D6008C9E90 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = ThirdParty/minizip/ioapi.c; sourceTree = SOURCE_ROOT; }; + 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Breakpad.framework; path = Users/antanubis/TBuild/Libraries/breakpad/Breakpad.framework; sourceTree = ""; }; + 071AD90B1C5EA37D008C9E90 /* Breakpad.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Breakpad.framework; path = "Users/antanubis/Library/Developer/Xcode/DerivedData/Breakpad-ffxagkgqghkohhawycvgjexmnjhs/Build/Products/Debug/Breakpad.framework"; sourceTree = ""; }; 072E117A1A56EB9400A87ACC /* lang_pt_BR.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = lang_pt_BR.strings; path = SourceFiles/langs/lang_pt_BR.strings; sourceTree = SOURCE_ROOT; }; 0732E4A7199E262300D50FE7 /* overviewwidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = overviewwidget.cpp; path = SourceFiles/overviewwidget.cpp; sourceTree = SOURCE_ROOT; }; 0732E4A8199E262300D50FE7 /* overviewwidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = overviewwidget.h; path = SourceFiles/overviewwidget.h; sourceTree = SOURCE_ROOT; }; @@ -700,6 +787,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 071AD90A1C5EA2A5008C9E90 /* Breakpad.framework in Link Binary With Libraries */, 0752F8751C2C89F40026D0BC /* VideoToolbox.framework in Link Binary With Libraries */, 0752F8731C2C89220026D0BC /* VideoDecodeAcceleration.framework in Link Binary With Libraries */, 07CAACD81AEA64F00058E508 /* AudioUnit.framework in Link Binary With Libraries */, @@ -755,6 +843,167 @@ name = Products; sourceTree = ""; }; + 071AD8691C5E8504008C9E90 /* ThirdParty */ = { + isa = PBXGroup; + children = ( + 071AD8701C5E8546008C9E90 /* breakpad */, + 071AD86A1C5E8522008C9E90 /* minizip */, + ); + name = ThirdParty; + sourceTree = ""; + }; + 071AD86A1C5E8522008C9E90 /* minizip */ = { + isa = PBXGroup; + children = ( + 071AD86B1C5E8536008C9E90 /* crypt.h */, + 071AD86C1C5E8536008C9E90 /* ioapi.h */, + 071AD8F71C5E99D6008C9E90 /* ioapi.c */, + 071AD86E1C5E8536008C9E90 /* zip.h */, + 071AD8D11C5E8E6D008C9E90 /* zip.c */, + ); + name = minizip; + sourceTree = ""; + }; + 071AD8701C5E8546008C9E90 /* breakpad */ = { + isa = PBXGroup; + children = ( + 071AD8931C5E89BE008C9E90 /* google_breakpad */, + 071AD87E1C5E8792008C9E90 /* common */, + 071AD8711C5E8569008C9E90 /* client */, + ); + name = breakpad; + sourceTree = ""; + }; + 071AD8711C5E8569008C9E90 /* client */ = { + isa = PBXGroup; + children = ( + 071AD88D1C5E88CD008C9E90 /* minidump_file_writer-inl.h */, + 071AD88F1C5E88CD008C9E90 /* minidump_file_writer.h */, + 071AD8E11C5E9143008C9E90 /* minidump_file_writer.cc */, + 071AD8721C5E8575008C9E90 /* mac */, + ); + name = client; + sourceTree = ""; + }; + 071AD8721C5E8575008C9E90 /* mac */ = { + isa = PBXGroup; + children = ( + 071AD8771C5E8672008C9E90 /* crash_generation */, + 071AD8731C5E8579008C9E90 /* handler */, + ); + name = mac; + sourceTree = ""; + }; + 071AD8731C5E8579008C9E90 /* handler */ = { + isa = PBXGroup; + children = ( + 071AD8D31C5E8F35008C9E90 /* breakpad_nlist_64.cc */, + 071AD8AD1C5E8B07008C9E90 /* breakpad_nlist_64.h */, + 071AD8D41C5E8F35008C9E90 /* dynamic_images.cc */, + 071AD8A91C5E8A7B008C9E90 /* dynamic_images.h */, + 071AD8751C5E85A0008C9E90 /* exception_handler.h */, + 071AD8D51C5E8F35008C9E90 /* exception_handler.cc */, + 071AD8AB1C5E8A99008C9E90 /* mach_vm_compat.h */, + 071AD8881C5E8886008C9E90 /* minidump_generator.h */, + 071AD8D61C5E8F35008C9E90 /* minidump_generator.cc */, + 071AD87B1C5E8688008C9E90 /* ucontext_compat.h */, + ); + name = handler; + sourceTree = ""; + }; + 071AD8771C5E8672008C9E90 /* crash_generation */ = { + isa = PBXGroup; + children = ( + 071AD8911C5E88EA008C9E90 /* client_info.h */, + 071AD8791C5E8672008C9E90 /* crash_generation_client.h */, + 071AD8DC1C5E912C008C9E90 /* crash_generation_client.cc */, + 071AD88B1C5E88AA008C9E90 /* crash_generation_server.h */, + 071AD8DD1C5E912C008C9E90 /* crash_generation_server.cc */, + ); + name = crash_generation; + path = ThirdParty/breakpad/client/mac/crash_generation; + sourceTree = SOURCE_ROOT; + }; + 071AD87E1C5E8792008C9E90 /* common */ = { + isa = PBXGroup; + children = ( + 071AD8B01C5E8B1B008C9E90 /* linux */, + 071AD8801C5E87B5008C9E90 /* mac */, + 071AD8BD1C5E8BB0008C9E90 /* convert_UTF.h */, + 071AD8E31C5E9196008C9E90 /* convert_UTF.c */, + 071AD8C41C5E8BFD008C9E90 /* md5.h */, + 071AD8E41C5E9196008C9E90 /* md5.cc */, + 071AD8921C5E8994008C9E90 /* memory.h */, + 071AD87F1C5E87AA008C9E90 /* scoped_ptr.h */, + 071AD8B31C5E8B43008C9E90 /* string_conversion.h */, + 071AD8E51C5E9196008C9E90 /* string_conversion.cc */, + 071AD8BF1C5E8BC8008C9E90 /* using_std_string.h */, + ); + name = common; + sourceTree = ""; + }; + 071AD8801C5E87B5008C9E90 /* mac */ = { + isa = PBXGroup; + children = ( + 071AD8851C5E8853008C9E90 /* bootstrap_compat.h */, + 071AD8E91C5E91E3008C9E90 /* bootstrap_compat.cc */, + 071AD8AF1C5E8B16008C9E90 /* byteswap.h */, + 071AD8B61C5E8B5C008C9E90 /* file_id.h */, + 071AD8EA1C5E91E3008C9E90 /* file_id.cc */, + 071AD8811C5E87C2008C9E90 /* MachIPC.h */, + 071AD8EB1C5E91E3008C9E90 /* MachIPC.mm */, + 071AD8BA1C5E8B9B008C9E90 /* macho_id.h */, + 071AD8EC1C5E91E3008C9E90 /* macho_id.cc */, + 071AD8A61C5E8A30008C9E90 /* macho_utilities.h */, + 071AD8ED1C5E91E3008C9E90 /* macho_utilities.cc */, + 071AD8C11C5E8BE5008C9E90 /* macho_walker.h */, + 071AD8EE1C5E91E3008C9E90 /* macho_walker.cc */, + 071AD8B81C5E8B81008C9E90 /* scoped_task_suspend-inl.h */, + 071AD8C71C5E8C14008C9E90 /* string_utilities.h */, + 071AD8EF1C5E91E3008C9E90 /* string_utilities.cc */, + ); + name = mac; + sourceTree = ""; + }; + 071AD8931C5E89BE008C9E90 /* google_breakpad */ = { + isa = PBXGroup; + children = ( + 071AD8941C5E89C4008C9E90 /* common */, + ); + name = google_breakpad; + sourceTree = ""; + }; + 071AD8941C5E89C4008C9E90 /* common */ = { + isa = PBXGroup; + children = ( + 071AD8951C5E89D1008C9E90 /* breakpad_types.h */, + 071AD8961C5E89D1008C9E90 /* minidump_cpu_amd64.h */, + 071AD8971C5E89D1008C9E90 /* minidump_cpu_arm.h */, + 071AD8981C5E89D1008C9E90 /* minidump_cpu_arm64.h */, + 071AD8991C5E89D1008C9E90 /* minidump_cpu_mips.h */, + 071AD89A1C5E89D1008C9E90 /* minidump_cpu_ppc.h */, + 071AD89B1C5E89D1008C9E90 /* minidump_cpu_ppc64.h */, + 071AD89C1C5E89D1008C9E90 /* minidump_cpu_sparc.h */, + 071AD89D1C5E89D1008C9E90 /* minidump_cpu_x86.h */, + 071AD89E1C5E89D1008C9E90 /* minidump_exception_linux.h */, + 071AD89F1C5E89D1008C9E90 /* minidump_exception_mac.h */, + 071AD8A01C5E89D1008C9E90 /* minidump_exception_ps3.h */, + 071AD8A11C5E89D1008C9E90 /* minidump_exception_solaris.h */, + 071AD8A21C5E89D1008C9E90 /* minidump_exception_win32.h */, + 071AD8A31C5E89D1008C9E90 /* minidump_format.h */, + 071AD8A41C5E89D1008C9E90 /* minidump_size.h */, + ); + name = common; + sourceTree = ""; + }; + 071AD8B01C5E8B1B008C9E90 /* linux */ = { + isa = PBXGroup; + children = ( + 071AD8B11C5E8B23008C9E90 /* linux_libc_support.h */, + ); + name = linux; + sourceTree = ""; + }; 074968CB1A44D0B800394F46 /* langs */ = { isa = PBXGroup; children = ( @@ -1222,6 +1471,8 @@ AF39DD055C3EF8226FBE929D /* Frameworks */ = { isa = PBXGroup; children = ( + 071AD90B1C5EA37D008C9E90 /* Breakpad.framework */, + 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */, 0752F8741C2C89F40026D0BC /* VideoToolbox.framework */, 0752F8721C2C89220026D0BC /* VideoDecodeAcceleration.framework */, 07CAACD71AEA64F00058E508 /* AudioUnit.framework */, @@ -1291,6 +1542,7 @@ 07084684195445A600B5AE3A /* Updater.xcodeproj */, 2EB56BE3C2D93CDAB0C52E67 /* Sources */, 25B08E2869634E9BCBA333A2 /* Generated Sources */, + 071AD8691C5E8504008C9E90 /* ThirdParty */, 74B182DB50CB5611B5C1C297 /* Supporting Files */, AF39DD055C3EF8226FBE929D /* Frameworks */, FE0A091FDBFB3E9C31B7A1BD /* Products */, @@ -1522,6 +1774,7 @@ 0732E4A9199E262300D50FE7 /* overviewwidget.cpp in Compile Sources */, 1DF53374E3B6A31661548D08 /* historywidget.cpp in Compile Sources */, 078A2FCD1A811CA600CCC7A0 /* backgroundbox.cpp in Compile Sources */, + 071AD8D81C5E8F35008C9E90 /* dynamic_images.cc in Compile Sources */, 37A3C6C782A0E4BC7B09536B /* langloaderplain.cpp in Compile Sources */, 19A66ECD6EE2F8356F27D32D /* layerwidget.cpp in Compile Sources */, 89ADB41E48A3B5E24ABB626C /* profilewidget.cpp in Compile Sources */, @@ -1535,23 +1788,28 @@ 4078D5D614EB3ECF7F1848C7 /* types.cpp in Compile Sources */, 68FFEB7CA30BF0149161B809 /* window.cpp in Compile Sources */, 0CB7DE9A54CC9BF86FB7B5CA /* mtp.cpp in Compile Sources */, + 071AD8E71C5E9196008C9E90 /* md5.cc in Compile Sources */, DF259E9677CC63AF8754032B /* mtpConnection.cpp in Compile Sources */, 074FCB9119D36E60004C6EB2 /* moc_popupmenu.cpp in Compile Sources */, B6346B66B0A2228A91D8A5D9 /* mtpDC.cpp in Compile Sources */, 0755AEDF1AD12A80004D738A /* moc_sessionsbox.cpp in Compile Sources */, 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */, B8CA3E1E11A7E0E7DF9E1CDE /* mtpFileLoader.cpp in Compile Sources */, + 071AD8DF1C5E912C008C9E90 /* crash_generation_server.cc in Compile Sources */, 0755AEDD1AD12A80004D738A /* moc_abstractbox.cpp in Compile Sources */, 99F0A9B2AFE5ABDCBFC04510 /* mtpRPC.cpp in Compile Sources */, A297B1E3CE33CC501DFEDB6E /* mtpSession.cpp in Compile Sources */, D1FC601FC2F9F3E33F3A14E9 /* animation.cpp in Compile Sources */, 8F65F0D95B1F0CEB859F2FB3 /* boxshadow.cpp in Compile Sources */, + 071AD8F41C5E91E3008C9E90 /* macho_utilities.cc in Compile Sources */, D7EF8F129FCCE9AB3F3F081F /* button.cpp in Compile Sources */, 07DC42A01B5EA15300B6B888 /* numbers.cpp in Compile Sources */, C03447C9A7D9FF73463B8BB5 /* countryinput.cpp in Compile Sources */, 07BE850F1A2093C9008ACB9F /* localstorage.cpp in Compile Sources */, CDB0266A8B7CB20A95266BCD /* emoji_config.cpp in Compile Sources */, + 071AD8DA1C5E8F35008C9E90 /* minidump_generator.cc in Compile Sources */, 0732E4AC199E268A00D50FE7 /* moc_overviewwidget.cpp in Compile Sources */, + 071AD8F01C5E91E3008C9E90 /* bootstrap_compat.cc in Compile Sources */, 7C2B2DEE467A4C4679F1C3C9 /* filedialog.cpp in Compile Sources */, 832C50BFD7D09AF042A51D4F /* flatbutton.cpp in Compile Sources */, B91D13BCC3963CB9C12D24A4 /* flatcheckbox.cpp in Compile Sources */, @@ -1560,11 +1818,13 @@ 03270F718426CFE84729079E /* flattextarea.cpp in Compile Sources */, E3D7A5CA24541D5DB69D6606 /* images.cpp in Compile Sources */, ADE99904299B99EB6135E8D9 /* scrollarea.cpp in Compile Sources */, + 071AD8F11C5E91E3008C9E90 /* file_id.cc in Compile Sources */, 07129D6A1C16D230002DC495 /* mtpAuthKey.cpp in Compile Sources */, 90085DF442550A0845D5AF37 /* style_core.cpp in Compile Sources */, 074FCB8E19D36851004C6EB2 /* popupmenu.cpp in Compile Sources */, 3AA6E7264581F82856FB37F7 /* text.cpp in Compile Sources */, FCE6518C548DF7BC82228A4A /* twidget.cpp in Compile Sources */, + 071AD8D21C5E8E6D008C9E90 /* zip.c in Compile Sources */, E9F1CE7F9B18C7C85A50E62D /* style_auto.cpp in Compile Sources */, EBE29731916DB43BF49FE7A4 /* aboutbox.cpp in Compile Sources */, 4426AF526AAD86D6F73CE36F /* addcontactbox.cpp in Compile Sources */, @@ -1578,6 +1838,7 @@ 07DB67511AD07CB800A51329 /* intropwdcheck.cpp in Compile Sources */, 3ABE4F9B2264F770D944106D /* emojibox.cpp in Compile Sources */, 07D703BB19B88FB900C4EED2 /* moc_audio.cpp in Compile Sources */, + 071AD8E81C5E9196008C9E90 /* string_conversion.cc in Compile Sources */, 77B998AC22A13EF3DDEE07AC /* photocropbox.cpp in Compile Sources */, F278C423357CA99797EA30AB /* photosendbox.cpp in Compile Sources */, E8D95529CED88F18818C9A8B /* intro.cpp in Compile Sources */, @@ -1595,25 +1856,33 @@ 352349751855EF76DECA4D60 /* moc_historywidget.cpp in Compile Sources */, 4B0036C794BEA27AF9419768 /* moc_layerwidget.cpp in Compile Sources */, C14E6C902F6435B3149ECD64 /* moc_profilewidget.cpp in Compile Sources */, + 071AD8F81C5E99D6008C9E90 /* ioapi.c in Compile Sources */, 074756191A1372C600CA07F7 /* moc_types.cpp in Compile Sources */, 98E4F55DB5D8E64AB9F08C83 /* moc_localimageloader.cpp in Compile Sources */, A24E4B5B683764E07683ECEC /* moc_mainwidget.cpp in Compile Sources */, 0710CA051B0B9404001B4272 /* moc_stickersetbox.cpp in Compile Sources */, 07DE92A71AA4925B00A18F6F /* autolockbox.cpp in Compile Sources */, + 071AD8F51C5E91E3008C9E90 /* macho_walker.cc in Compile Sources */, 07D8509919F8320900623D75 /* usernamebox.cpp in Compile Sources */, + 071AD8F21C5E91E3008C9E90 /* MachIPC.mm in Compile Sources */, + 071AD8DE1C5E912C008C9E90 /* crash_generation_client.cc in Compile Sources */, A469EC9C4C367E0B773A9BB7 /* moc_settingswidget.cpp in Compile Sources */, FD2FE0C564A7389A2E609EC7 /* moc_sysbuttons.cpp in Compile Sources */, E97B3CFAB59B49BACFFC5F7C /* moc_title.cpp in Compile Sources */, 07D8510819F8340A00623D75 /* moc_usernamebox.cpp in Compile Sources */, 9A0D5DDC7816FC2538EB6A96 /* moc_window.cpp in Compile Sources */, + 071AD8D91C5E8F35008C9E90 /* exception_handler.cc in Compile Sources */, 06EABCC49D2EEE4076322BE7 /* moc_mtp.cpp in Compile Sources */, 0755AEDE1AD12A80004D738A /* moc_intropwdcheck.cpp in Compile Sources */, 07DE92AA1AA4928200A18F6F /* moc_autolockbox.cpp in Compile Sources */, 07B604351B46A20900CA29FE /* moc_playerwidget.cpp in Compile Sources */, 8F6F5D7F82036331E8C6DAE6 /* moc_mtpConnection.cpp in Compile Sources */, B780F9E21269259B90A1F32A /* moc_mtpDC.cpp in Compile Sources */, + 071AD8F31C5E91E3008C9E90 /* macho_id.cc in Compile Sources */, 07080BCF1A43588C00741A51 /* lang_auto.cpp in Compile Sources */, 07539B1D1A1416AF00083EFC /* moc_history.cpp in Compile Sources */, + 071AD8E61C5E9196008C9E90 /* convert_UTF.c in Compile Sources */, + 071AD8F61C5E91E3008C9E90 /* string_utilities.cc in Compile Sources */, 2A500B102B7CE80F3EB6E13E /* moc_mtpFileLoader.cpp in Compile Sources */, 07A6933519927B160099CB9F /* moc_mediaview.cpp in Compile Sources */, 07A69332199277BA0099CB9F /* mediaview.cpp in Compile Sources */, @@ -1625,6 +1894,7 @@ 07DE92A01AA4923300A18F6F /* passcodewidget.cpp in Compile Sources */, B0B88EFE444C0DE673389418 /* moc_flatbutton.cpp in Compile Sources */, 1BD711B4C358EA7D727BF358 /* moc_flatcheckbox.cpp in Compile Sources */, + 071AD8D71C5E8F35008C9E90 /* breakpad_nlist_64.cc in Compile Sources */, 565F748438E6CE0148C54AFE /* moc_flatinput.cpp in Compile Sources */, 8B71D1C7BB9DCEE6511219C2 /* moc_flatlabel.cpp in Compile Sources */, 0710C9FE1B0B9376001B4272 /* stickersetbox.cpp in Compile Sources */, @@ -1638,6 +1908,7 @@ 7062978F12EEA525893A5E6F /* moc_aboutbox.cpp in Compile Sources */, E8B28580819B882A5964561A /* moc_addcontactbox.cpp in Compile Sources */, 07B604321B46A0EC00CA29FE /* playerwidget.cpp in Compile Sources */, + 071AD8E21C5E9143008C9E90 /* minidump_file_writer.cc in Compile Sources */, D6874C00733283846ACA9AB2 /* moc_confirmbox.cpp in Compile Sources */, ED2557A57C6782721DC494AF /* moc_connectionbox.cpp in Compile Sources */, 5FC914F652D1B16FDA8F0634 /* moc_contactsbox.cpp in Compile Sources */, @@ -1752,7 +2023,7 @@ DYLIB_COMPATIBILITY_VERSION = 0.9; DYLIB_CURRENT_VERSION = 0.9.19; ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_SEARCH_PATHS = ""; + FRAMEWORK_SEARCH_PATHS = ./../../Libraries/breakpad; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1785,6 +2056,8 @@ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers, "/usr/local/Qt-5.5.1/mkspecs/macx-clang", + ./ThirdParty/breakpad, + ./ThirdParty/minizip, ); INFOPLIST_FILE = Telegram.plist; INSTALL_DIR = ./../Mac/Release/; @@ -1815,8 +2088,8 @@ "-Wno-unused-function", "-Wno-switch", "-Wno-comment", - "-I./../../Libraries/openssl-xcode/include", "-DCUSTOM_API_ID", + "-I./../../Libraries/openssl-xcode/include", ); OTHER_CPLUSPLUSFLAGS = ( "-pipe", @@ -1835,8 +2108,8 @@ "-Wno-unused-function", "-Wno-switch", "-Wno-comment", - "-I./../../Libraries/openssl-xcode/include", "-DCUSTOM_API_ID", + "-I./../../Libraries/openssl-xcode/include", ); OTHER_LDFLAGS = ( "-headerpad_max_install_names", @@ -1846,7 +2119,7 @@ "-L/usr/local/Qt-5.5.1/plugins/platforms", "-lcups", "-L/usr/local/Qt-5.5.1/plugins/imageformats", - "-lz", + /usr/local/lib/libz.a, "-lm", /usr/local/lib/libopenal.a, /usr/local/lib/libopus.a, @@ -1859,6 +2132,7 @@ /usr/local/lib/libavutil.a, /usr/local/lib/libiconv.a, "../../Libraries/openssl-xcode/libcrypto.a", + "-g", ); PRODUCT_NAME = Telegram; QT_LIBRARY_SUFFIX = ""; @@ -1886,7 +2160,7 @@ DYLIB_CURRENT_VERSION = 0.9.19; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ""; + FRAMEWORK_SEARCH_PATHS = ./../../Libraries/breakpad; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1919,6 +2193,8 @@ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers, "/usr/local/Qt-5.5.1/mkspecs/macx-clang", + ./ThirdParty/breakpad, + ./ThirdParty/minizip, ); INFOPLIST_FILE = Telegram.plist; INSTALL_DIR = ./../Mac/Debug/; @@ -1981,7 +2257,7 @@ "-L/usr/local/Qt-5.5.1/plugins/platforms", "-lcups", "-L/usr/local/Qt-5.5.1/plugins/imageformats", - "-lz", + /usr/local/lib/libz.a, "-lm", /usr/local/lib/libopenal.a, /usr/local/lib/libopus.a, @@ -1994,6 +2270,7 @@ /usr/local/lib/libavutil.a, /usr/local/lib/libiconv.a, "../../Libraries/openssl-xcode/libcrypto.a", + "-g", ); PRODUCT_NAME = Telegram; QT_LIBRARY_SUFFIX = _debug; diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h new file mode 100644 index 0000000000..a3a95dcace --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h @@ -0,0 +1,47 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ +#define CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ + +namespace google_breakpad { + +class ClientInfo { + public: + explicit ClientInfo(pid_t pid) : pid_(pid) {} + + pid_t pid() const { return pid_; } + + private: + pid_t pid_; +}; + +} // namespace google_breakpad + +#endif // CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc new file mode 100644 index 0000000000..ceeb3b32af --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc @@ -0,0 +1,72 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "client/mac/crash_generation/crash_generation_client.h" + +#include "client/mac/crash_generation/crash_generation_server.h" +#include "common/mac/MachIPC.h" + +namespace google_breakpad { + +bool CrashGenerationClient::RequestDumpForException( + int exception_type, + int exception_code, + int exception_subcode, + mach_port_t crashing_thread) { + // The server will send a message to this port indicating that it + // has finished its work. + ReceivePort acknowledge_port; + + MachSendMessage message(kDumpRequestMessage); + message.AddDescriptor(mach_task_self()); // this task + message.AddDescriptor(crashing_thread); // crashing thread + message.AddDescriptor(mach_thread_self()); // handler thread + message.AddDescriptor(acknowledge_port.GetPort()); // message receive port + + ExceptionInfo info; + info.exception_type = exception_type; + info.exception_code = exception_code; + info.exception_subcode = exception_subcode; + message.SetData(&info, sizeof(info)); + + const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; + kern_return_t result = sender_.SendMessage(message, kSendTimeoutMs); + if (result != KERN_SUCCESS) + return false; + + // Give the server slightly longer to reply since it has to + // inspect this task and write the minidump. + const mach_msg_timeout_t kReceiveTimeoutMs = 5 * 1000; + MachReceiveMessage acknowledge_message; + result = acknowledge_port.WaitForMessage(&acknowledge_message, + kReceiveTimeoutMs); + return result == KERN_SUCCESS; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h new file mode 100644 index 0000000000..527f577a51 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h @@ -0,0 +1,65 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ +#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ + +#include "common/mac/MachIPC.h" + +namespace google_breakpad { + +class CrashGenerationClient { + public: + explicit CrashGenerationClient(const char* mach_port_name) + : sender_(mach_port_name) { + } + + // Request the crash server to generate a dump. + // + // Return true if the dump was successful; false otherwise. + bool RequestDumpForException(int exception_type, + int exception_code, + int exception_subcode, + mach_port_t crashing_thread); + + bool RequestDump() { + return RequestDumpForException(0, 0, 0, MACH_PORT_NULL); + } + + private: + MachPortSender sender_; + + // Prevent copy construction and assignment. + CrashGenerationClient(const CrashGenerationClient&); + CrashGenerationClient& operator=(const CrashGenerationClient&); +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc new file mode 100644 index 0000000000..451e8d9c2a --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc @@ -0,0 +1,166 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "client/mac/crash_generation/crash_generation_server.h" + +#include + +#include "client/mac/crash_generation/client_info.h" +#include "client/mac/handler/minidump_generator.h" +#include "common/mac/scoped_task_suspend-inl.h" + +namespace google_breakpad { + +CrashGenerationServer::CrashGenerationServer( + const char *mach_port_name, + FilterCallback filter, + void *filter_context, + OnClientDumpRequestCallback dump_callback, + void *dump_context, + OnClientExitingCallback exit_callback, + void *exit_context, + bool generate_dumps, + const std::string &dump_path) + : filter_(filter), + filter_context_(filter_context), + dump_callback_(dump_callback), + dump_context_(dump_context), + exit_callback_(exit_callback), + exit_context_(exit_context), + generate_dumps_(generate_dumps), + dump_dir_(dump_path.empty() ? "/tmp" : dump_path), + started_(false), + receive_port_(mach_port_name), + mach_port_name_(mach_port_name) { +} + +CrashGenerationServer::~CrashGenerationServer() { + if (started_) + Stop(); +} + +bool CrashGenerationServer::Start() { + int thread_create_result = pthread_create(&server_thread_, NULL, + &WaitForMessages, this); + started_ = thread_create_result == 0; + return started_; +} + +bool CrashGenerationServer::Stop() { + if (!started_) + return false; + + // Send a quit message to the background thread, and then join it. + MachPortSender sender(mach_port_name_.c_str()); + MachSendMessage quit_message(kQuitMessage); + const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; + kern_return_t result = sender.SendMessage(quit_message, kSendTimeoutMs); + if (result == KERN_SUCCESS) { + int thread_join_result = pthread_join(server_thread_, NULL); + started_ = thread_join_result != 0; + } + + return !started_; +} + +// static +void *CrashGenerationServer::WaitForMessages(void *server) { + CrashGenerationServer *self = + reinterpret_cast(server); + while (self->WaitForOneMessage()) {} + return NULL; +} + +bool CrashGenerationServer::WaitForOneMessage() { + MachReceiveMessage message; + kern_return_t result = receive_port_.WaitForMessage(&message, + MACH_MSG_TIMEOUT_NONE); + if (result == KERN_SUCCESS) { + switch (message.GetMessageID()) { + case kDumpRequestMessage: { + ExceptionInfo &info = (ExceptionInfo &)*message.GetData(); + + mach_port_t remote_task = message.GetTranslatedPort(0); + mach_port_t crashing_thread = message.GetTranslatedPort(1); + mach_port_t handler_thread = message.GetTranslatedPort(2); + mach_port_t ack_port = message.GetTranslatedPort(3); + pid_t remote_pid = -1; + pid_for_task(remote_task, &remote_pid); + ClientInfo client(remote_pid); + + bool result; + std::string dump_path; + if (generate_dumps_ && (!filter_ || filter_(filter_context_))) { + ScopedTaskSuspend suspend(remote_task); + + MinidumpGenerator generator(remote_task, handler_thread); + dump_path = generator.UniqueNameInDirectory(dump_dir_, NULL); + + if (info.exception_type && info.exception_code) { + generator.SetExceptionInformation(info.exception_type, + info.exception_code, + info.exception_subcode, + crashing_thread); + } + result = generator.Write(dump_path.c_str()); + } else { + result = true; + } + + if (result && dump_callback_) { + dump_callback_(dump_context_, client, dump_path); + } + + // TODO(ted): support a way for the client to send additional data, + // perhaps with a callback so users of the server can read the data + // themselves? + + if (ack_port != MACH_PORT_DEAD && ack_port != MACH_PORT_NULL) { + MachPortSender sender(ack_port); + MachSendMessage ack_message(kAcknowledgementMessage); + const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; + + sender.SendMessage(ack_message, kSendTimeoutMs); + } + + if (exit_callback_) { + exit_callback_(exit_context_, client); + } + break; + } + case kQuitMessage: + return false; + } + } else { // result != KERN_SUCCESS + return false; + } + return true; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h new file mode 100644 index 0000000000..85bd5b5e33 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h @@ -0,0 +1,150 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ +#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ + +#include + +#include + +#include "common/mac/MachIPC.h" + +namespace google_breakpad { + +class ClientInfo; + +// Messages the server can read via its mach port +enum { + kDumpRequestMessage = 1, + kAcknowledgementMessage = 2, + kQuitMessage = 3 +}; + +// Exception details sent by the client when requesting a dump. +struct ExceptionInfo { + int32_t exception_type; + int32_t exception_code; + int32_t exception_subcode; +}; + +class CrashGenerationServer { + public: + // WARNING: callbacks may be invoked on a different thread + // than that which creates the CrashGenerationServer. They must + // be thread safe. + typedef void (*OnClientDumpRequestCallback)(void *context, + const ClientInfo &client_info, + const std::string &file_path); + + typedef void (*OnClientExitingCallback)(void *context, + const ClientInfo &client_info); + // If a FilterCallback returns false, the dump will not be written. + typedef bool (*FilterCallback)(void *context); + + // Create an instance with the given parameters. + // + // mach_port_name: Named server port to listen on. + // filter: Callback for a client to cancel writing a dump. + // filter_context: Context for the filter callback. + // dump_callback: Callback for a client crash dump request. + // dump_context: Context for client crash dump request callback. + // exit_callback: Callback for client process exit. + // exit_context: Context for client exit callback. + // generate_dumps: Whether to automatically generate dumps. + // Client code of this class might want to generate dumps explicitly + // in the crash dump request callback. In that case, false can be + // passed for this parameter. + // dump_path: Path for generating dumps; required only if true is + // passed for generateDumps parameter; NULL can be passed otherwise. + CrashGenerationServer(const char *mach_port_name, + FilterCallback filter, + void *filter_context, + OnClientDumpRequestCallback dump_callback, + void *dump_context, + OnClientExitingCallback exit_callback, + void *exit_context, + bool generate_dumps, + const std::string &dump_path); + + ~CrashGenerationServer(); + + // Perform initialization steps needed to start listening to clients. + // + // Return true if initialization is successful; false otherwise. + bool Start(); + + // Stop the server. + bool Stop(); + + private: + // Return a unique filename at which a minidump can be written. + bool MakeMinidumpFilename(std::string &outFilename); + + // Loop reading client messages and responding to them until + // a quit message is received. + static void *WaitForMessages(void *server); + + // Wait for a single client message and respond to it. Returns false + // if a quit message was received or if an error occurred. + bool WaitForOneMessage(); + + FilterCallback filter_; + void *filter_context_; + + OnClientDumpRequestCallback dump_callback_; + void *dump_context_; + + OnClientExitingCallback exit_callback_; + void *exit_context_; + + bool generate_dumps_; + + std::string dump_dir_; + + bool started_; + + // The mach port that receives requests to dump from child processes. + ReceivePort receive_port_; + + // The name of the mach port. Stored so the Stop method can message + // the background thread to shut it down. + std::string mach_port_name_; + + // The thread that waits on the receive port. + pthread_t server_thread_; + + // Disable copy constructor and operator=. + CrashGenerationServer(const CrashGenerationServer&); + CrashGenerationServer& operator=(const CrashGenerationServer&); +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc new file mode 100644 index 0000000000..3492b823da --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc @@ -0,0 +1,402 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +/* + * This file was copied from libc/gen/nlist.c from Darwin's source code + * The version of nlist used as a base is from 10.5.2, libc-498 + * http://www.opensource.apple.com/darwinsource/10.5.2/Libc-498/gen/nlist.c + * + * The full tarball is at: + * http://www.opensource.apple.com/darwinsource/tarballs/apsl/Libc-498.tar.gz + * + * I've modified it to be compatible with 64-bit images. +*/ + +#include "breakpad_nlist_64.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Stuff lifted from and since they are gone */ +/* + * Header prepended to each a.out file. + */ +struct exec { + unsigned short a_machtype; /* machine type */ + unsigned short a_magic; /* magic number */ + unsigned long a_text; /* size of text segment */ + unsigned long a_data; /* size of initialized data */ + unsigned long a_bss; /* size of uninitialized data */ + unsigned long a_syms; /* size of symbol table */ + unsigned long a_entry; /* entry point */ + unsigned long a_trsize; /* size of text relocation */ + unsigned long a_drsize; /* size of data relocation */ +}; + +#define OMAGIC 0407 /* old impure format */ +#define NMAGIC 0410 /* read-only text */ +#define ZMAGIC 0413 /* demand load format */ + +#define N_BADMAG(x) \ + (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) +#define N_TXTOFF(x) \ + ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec)) +#define N_SYMOFF(x) \ + (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) + +// Traits structs for specializing function templates to handle +// 32-bit/64-bit Mach-O files. +template +struct MachBits {}; + +typedef struct nlist nlist32; +typedef struct nlist_64 nlist64; + +template<> +struct MachBits { + typedef mach_header mach_header_type; + typedef uint32_t word_type; + static const uint32_t magic = MH_MAGIC; +}; + +template<> +struct MachBits { + typedef mach_header_64 mach_header_type; + typedef uint64_t word_type; + static const uint32_t magic = MH_MAGIC_64; +}; + +template +int +__breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames, + cpu_type_t cpu_type); + +/* + * nlist - retreive attributes from name list (string table version) + */ + +template +int breakpad_nlist_common(const char *name, + nlist_type *list, + const char **symbolNames, + cpu_type_t cpu_type) { + int fd = open(name, O_RDONLY, 0); + if (fd < 0) + return -1; + int n = __breakpad_fdnlist(fd, list, symbolNames, cpu_type); + close(fd); + return n; +} + +int breakpad_nlist(const char *name, + struct nlist *list, + const char **symbolNames, + cpu_type_t cpu_type) { + return breakpad_nlist_common(name, list, symbolNames, cpu_type); +} + +int breakpad_nlist(const char *name, + struct nlist_64 *list, + const char **symbolNames, + cpu_type_t cpu_type) { + return breakpad_nlist_common(name, list, symbolNames, cpu_type); +} + +/* Note: __fdnlist() is called from kvm_nlist in libkvm's kvm.c */ + +template +int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames, + cpu_type_t cpu_type) { + typedef typename MachBits::mach_header_type mach_header_type; + typedef typename MachBits::word_type word_type; + + const uint32_t magic = MachBits::magic; + + int maxlen = 500; + int nreq = 0; + for (nlist_type* q = list; + symbolNames[q-list] && symbolNames[q-list][0]; + q++, nreq++) { + + q->n_type = 0; + q->n_value = 0; + q->n_desc = 0; + q->n_sect = 0; + q->n_un.n_strx = 0; + } + + struct exec buf; + if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) || + (N_BADMAG(buf) && *((uint32_t *)&buf) != magic && + CFSwapInt32BigToHost(*((uint32_t *)&buf)) != FAT_MAGIC && + /* The following is the big-endian ppc64 check */ + (*((uint32_t*)&buf)) != FAT_MAGIC)) { + return -1; + } + + /* Deal with fat file if necessary */ + unsigned arch_offset = 0; + if (CFSwapInt32BigToHost(*((uint32_t *)&buf)) == FAT_MAGIC || + /* The following is the big-endian ppc64 check */ + *((unsigned int *)&buf) == FAT_MAGIC) { + /* Read in the fat header */ + struct fat_header fh; + if (lseek(fd, 0, SEEK_SET) == -1) { + return -1; + } + if (read(fd, (char *)&fh, sizeof(fh)) != sizeof(fh)) { + return -1; + } + + /* Convert fat_narchs to host byte order */ + fh.nfat_arch = CFSwapInt32BigToHost(fh.nfat_arch); + + /* Read in the fat archs */ + struct fat_arch *fat_archs = + (struct fat_arch *)malloc(fh.nfat_arch * sizeof(struct fat_arch)); + if (fat_archs == NULL) { + return -1; + } + if (read(fd, (char *)fat_archs, + sizeof(struct fat_arch) * fh.nfat_arch) != + (ssize_t)(sizeof(struct fat_arch) * fh.nfat_arch)) { + free(fat_archs); + return -1; + } + + /* + * Convert archs to host byte ordering (a constraint of + * cpusubtype_getbestarch() + */ + for (unsigned i = 0; i < fh.nfat_arch; i++) { + fat_archs[i].cputype = + CFSwapInt32BigToHost(fat_archs[i].cputype); + fat_archs[i].cpusubtype = + CFSwapInt32BigToHost(fat_archs[i].cpusubtype); + fat_archs[i].offset = + CFSwapInt32BigToHost(fat_archs[i].offset); + fat_archs[i].size = + CFSwapInt32BigToHost(fat_archs[i].size); + fat_archs[i].align = + CFSwapInt32BigToHost(fat_archs[i].align); + } + + struct fat_arch *fap = NULL; + for (unsigned i = 0; i < fh.nfat_arch; i++) { + if (fat_archs[i].cputype == cpu_type) { + fap = &fat_archs[i]; + break; + } + } + + if (!fap) { + free(fat_archs); + return -1; + } + arch_offset = fap->offset; + free(fat_archs); + + /* Read in the beginning of the architecture-specific file */ + if (lseek(fd, arch_offset, SEEK_SET) == -1) { + return -1; + } + if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf)) { + return -1; + } + } + + off_t sa; /* symbol address */ + off_t ss; /* start of strings */ + register_t n; + if (*((unsigned int *)&buf) == magic) { + if (lseek(fd, arch_offset, SEEK_SET) == -1) { + return -1; + } + mach_header_type mh; + if (read(fd, (char *)&mh, sizeof(mh)) != sizeof(mh)) { + return -1; + } + + struct load_command *load_commands = + (struct load_command *)malloc(mh.sizeofcmds); + if (load_commands == NULL) { + return -1; + } + if (read(fd, (char *)load_commands, mh.sizeofcmds) != + (ssize_t)mh.sizeofcmds) { + free(load_commands); + return -1; + } + struct symtab_command *stp = NULL; + struct load_command *lcp = load_commands; + // iterate through all load commands, looking for + // LC_SYMTAB load command + for (uint32_t i = 0; i < mh.ncmds; i++) { + if (lcp->cmdsize % sizeof(word_type) != 0 || + lcp->cmdsize <= 0 || + (char *)lcp + lcp->cmdsize > + (char *)load_commands + mh.sizeofcmds) { + free(load_commands); + return -1; + } + if (lcp->cmd == LC_SYMTAB) { + if (lcp->cmdsize != + sizeof(struct symtab_command)) { + free(load_commands); + return -1; + } + stp = (struct symtab_command *)lcp; + break; + } + lcp = (struct load_command *) + ((char *)lcp + lcp->cmdsize); + } + if (stp == NULL) { + free(load_commands); + return -1; + } + // sa points to the beginning of the symbol table + sa = stp->symoff + arch_offset; + // ss points to the beginning of the string table + ss = stp->stroff + arch_offset; + // n is the number of bytes in the symbol table + // each symbol table entry is an nlist structure + n = stp->nsyms * sizeof(nlist_type); + free(load_commands); + } else { + sa = N_SYMOFF(buf) + arch_offset; + ss = sa + buf.a_syms + arch_offset; + n = buf.a_syms; + } + + if (lseek(fd, sa, SEEK_SET) == -1) { + return -1; + } + + // the algorithm here is to read the nlist entries in m-sized + // chunks into q. q is then iterated over. for each entry in q, + // use the string table index(q->n_un.n_strx) to read the symbol + // name, then scan the nlist entries passed in by the user(via p), + // and look for a match + while (n) { + nlist_type space[BUFSIZ/sizeof (nlist_type)]; + register_t m = sizeof (space); + + if (n < m) + m = n; + if (read(fd, (char *)space, m) != m) + break; + n -= m; + off_t savpos = lseek(fd, 0, SEEK_CUR); + if (savpos == -1) { + return -1; + } + for (nlist_type* q = space; (m -= sizeof(nlist_type)) >= 0; q++) { + char nambuf[BUFSIZ]; + + if (q->n_un.n_strx == 0 || q->n_type & N_STAB) + continue; + + // seek to the location in the binary where the symbol + // name is stored & read it into memory + if (lseek(fd, ss+q->n_un.n_strx, SEEK_SET) == -1) { + return -1; + } + if (read(fd, nambuf, maxlen+1) == -1) { + return -1; + } + const char *s2 = nambuf; + for (nlist_type *p = list; + symbolNames[p-list] && symbolNames[p-list][0]; + p++) { + // get the symbol name the user has passed in that + // corresponds to the nlist entry that we're looking at + const char *s1 = symbolNames[p - list]; + while (*s1) { + if (*s1++ != *s2++) + goto cont; + } + if (*s2) + goto cont; + + p->n_value = q->n_value; + p->n_type = q->n_type; + p->n_desc = q->n_desc; + p->n_sect = q->n_sect; + p->n_un.n_strx = q->n_un.n_strx; + if (--nreq == 0) + return nreq; + + break; + cont: ; + } + } + if (lseek(fd, savpos, SEEK_SET) == -1) { + return -1; + } + } + return nreq; +} diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h b/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h new file mode 100644 index 0000000000..1d2c639134 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h @@ -0,0 +1,47 @@ +// Copyright (c) 2008, Google Inc. +// All rights reserved +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// breakpad_nlist.h +// +// This file is meant to provide a header for clients of the modified +// nlist function implemented to work on 64-bit. + +#ifndef CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__ + +#include + +int breakpad_nlist(const char *name, + struct nlist *list, + const char **symbolNames, + cpu_type_t cpu_type); +int breakpad_nlist(const char *name, + struct nlist_64 *list, + const char **symbolNames, + cpu_type_t cpu_type); + +#endif /* CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__ */ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc new file mode 100644 index 0000000000..cdba6df4ac --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc @@ -0,0 +1,573 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "client/mac/handler/dynamic_images.h" + +extern "C" { // needed to compile on Leopard + #include + #include + #include +} + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "breakpad_nlist_64.h" + +#if !TARGET_OS_IPHONE +#include + +#ifndef MAC_OS_X_VERSION_10_6 +#define MAC_OS_X_VERSION_10_6 1060 +#endif + +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 + +// Fallback declarations for TASK_DYLD_INFO and friends, introduced in +// in the Mac OS X 10.6 SDK. +#define TASK_DYLD_INFO 17 +struct task_dyld_info { + mach_vm_address_t all_image_info_addr; + mach_vm_size_t all_image_info_size; +}; +typedef struct task_dyld_info task_dyld_info_data_t; +typedef struct task_dyld_info *task_dyld_info_t; +#define TASK_DYLD_INFO_COUNT (sizeof(task_dyld_info_data_t) / sizeof(natural_t)) + +#endif + +#endif // !TARGET_OS_IPHONE + +namespace google_breakpad { + +using std::string; +using std::vector; + +//============================================================================== +// Returns the size of the memory region containing |address| and the +// number of bytes from |address| to the end of the region. +// We potentially, will extend the size of the original +// region by the size of the following region if it's contiguous with the +// first in order to handle cases when we're reading strings and they +// straddle two vm regions. +// +static mach_vm_size_t GetMemoryRegionSize(task_port_t target_task, + const uint64_t address, + mach_vm_size_t *size_to_end) { + mach_vm_address_t region_base = (mach_vm_address_t)address; + mach_vm_size_t region_size; + natural_t nesting_level = 0; + vm_region_submap_info_64 submap_info; + mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64; + + // Get information about the vm region containing |address| + vm_region_recurse_info_t region_info; + region_info = reinterpret_cast(&submap_info); + + kern_return_t result = + mach_vm_region_recurse(target_task, + ®ion_base, + ®ion_size, + &nesting_level, + region_info, + &info_count); + + if (result == KERN_SUCCESS) { + // Get distance from |address| to the end of this region + *size_to_end = region_base + region_size -(mach_vm_address_t)address; + + // If we want to handle strings as long as 4096 characters we may need + // to check if there's a vm region immediately following the first one. + // If so, we need to extend |*size_to_end| to go all the way to the end + // of the second region. + if (*size_to_end < 4096) { + // Second region starts where the first one ends + mach_vm_address_t region_base2 = + (mach_vm_address_t)(region_base + region_size); + mach_vm_size_t region_size2; + + // Get information about the following vm region + result = + mach_vm_region_recurse(target_task, + ®ion_base2, + ®ion_size2, + &nesting_level, + region_info, + &info_count); + + // Extend region_size to go all the way to the end of the 2nd region + if (result == KERN_SUCCESS + && region_base2 == region_base + region_size) { + region_size += region_size2; + } + } + + *size_to_end = region_base + region_size -(mach_vm_address_t)address; + } else { + region_size = 0; + *size_to_end = 0; + } + + return region_size; +} + +#define kMaxStringLength 8192 +//============================================================================== +// Reads a NULL-terminated string from another task. +// +// Warning! This will not read any strings longer than kMaxStringLength-1 +// +static string ReadTaskString(task_port_t target_task, + const uint64_t address) { + // The problem is we don't know how much to read until we know how long + // the string is. And we don't know how long the string is, until we've read + // the memory! So, we'll try to read kMaxStringLength bytes + // (or as many bytes as we can until we reach the end of the vm region). + mach_vm_size_t size_to_end; + GetMemoryRegionSize(target_task, address, &size_to_end); + + if (size_to_end > 0) { + mach_vm_size_t size_to_read = + size_to_end > kMaxStringLength ? kMaxStringLength : size_to_end; + + vector bytes; + if (ReadTaskMemory(target_task, address, (size_t)size_to_read, bytes) != + KERN_SUCCESS) + return string(); + + return string(reinterpret_cast(&bytes[0])); + } + + return string(); +} + +//============================================================================== +// Reads an address range from another task. The bytes read will be returned +// in bytes, which will be resized as necessary. +kern_return_t ReadTaskMemory(task_port_t target_task, + const uint64_t address, + size_t length, + vector &bytes) { + int systemPageSize = getpagesize(); + + // use the negative of the page size for the mask to find the page address + mach_vm_address_t page_address = address & (-systemPageSize); + + mach_vm_address_t last_page_address = + (address + length + (systemPageSize - 1)) & (-systemPageSize); + + mach_vm_size_t page_size = last_page_address - page_address; + uint8_t* local_start; + uint32_t local_length; + + kern_return_t r = mach_vm_read(target_task, + page_address, + page_size, + reinterpret_cast(&local_start), + &local_length); + + if (r != KERN_SUCCESS) + return r; + + bytes.resize(length); + memcpy(&bytes[0], + &local_start[(mach_vm_address_t)address - page_address], + length); + mach_vm_deallocate(mach_task_self(), (uintptr_t)local_start, local_length); + return KERN_SUCCESS; +} + +#pragma mark - + +//============================================================================== +// Traits structs for specializing function templates to handle +// 32-bit/64-bit Mach-O files. +struct MachO32 { + typedef mach_header mach_header_type; + typedef segment_command mach_segment_command_type; + typedef dyld_image_info32 dyld_image_info; + typedef dyld_all_image_infos32 dyld_all_image_infos; + typedef struct nlist nlist_type; + static const uint32_t magic = MH_MAGIC; + static const uint32_t segment_load_command = LC_SEGMENT; +}; + +struct MachO64 { + typedef mach_header_64 mach_header_type; + typedef segment_command_64 mach_segment_command_type; + typedef dyld_image_info64 dyld_image_info; + typedef dyld_all_image_infos64 dyld_all_image_infos; + typedef struct nlist_64 nlist_type; + static const uint32_t magic = MH_MAGIC_64; + static const uint32_t segment_load_command = LC_SEGMENT_64; +}; + +template +bool FindTextSection(DynamicImage& image) { + typedef typename MachBits::mach_header_type mach_header_type; + typedef typename MachBits::mach_segment_command_type + mach_segment_command_type; + + const mach_header_type* header = + reinterpret_cast(&image.header_[0]); + + if(header->magic != MachBits::magic) { + return false; + } + + const struct load_command *cmd = + reinterpret_cast(header + 1); + + bool found_text_section = false; + bool found_dylib_id_command = false; + for (unsigned int i = 0; cmd && (i < header->ncmds); ++i) { + if (!found_text_section) { + if (cmd->cmd == MachBits::segment_load_command) { + const mach_segment_command_type *seg = + reinterpret_cast(cmd); + + if (!strcmp(seg->segname, "__TEXT")) { + image.vmaddr_ = static_cast(seg->vmaddr); + image.vmsize_ = static_cast(seg->vmsize); + image.slide_ = 0; + + if (seg->fileoff == 0 && seg->filesize != 0) { + image.slide_ = + (uintptr_t)image.GetLoadAddress() - (uintptr_t)seg->vmaddr; + } + found_text_section = true; + } + } + } + + if (!found_dylib_id_command) { + if (cmd->cmd == LC_ID_DYLIB) { + const struct dylib_command *dc = + reinterpret_cast(cmd); + + image.version_ = dc->dylib.current_version; + found_dylib_id_command = true; + } + } + + if (found_dylib_id_command && found_text_section) { + return true; + } + + cmd = reinterpret_cast + (reinterpret_cast(cmd) + cmd->cmdsize); + } + + return false; +} + +//============================================================================== +// Initializes vmaddr_, vmsize_, and slide_ +void DynamicImage::CalculateMemoryAndVersionInfo() { + // unless we can process the header, ensure that calls to + // IsValid() will return false + vmaddr_ = 0; + vmsize_ = 0; + slide_ = 0; + version_ = 0; + + // The function template above does all the real work. + if (Is64Bit()) + FindTextSection(*this); + else + FindTextSection(*this); +} + +//============================================================================== +// The helper function template abstracts the 32/64-bit differences. +template +uint32_t GetFileTypeFromHeader(DynamicImage& image) { + typedef typename MachBits::mach_header_type mach_header_type; + + const mach_header_type* header = + reinterpret_cast(&image.header_[0]); + return header->filetype; +} + +uint32_t DynamicImage::GetFileType() { + if (Is64Bit()) + return GetFileTypeFromHeader(*this); + + return GetFileTypeFromHeader(*this); +} + +#pragma mark - + +//============================================================================== +// Loads information about dynamically loaded code in the given task. +DynamicImages::DynamicImages(mach_port_t task) + : task_(task), + cpu_type_(DetermineTaskCPUType(task)), + image_list_() { + ReadImageInfoForTask(); +} + +template +static uint64_t LookupSymbol(const char* symbol_name, + const char* filename, + cpu_type_t cpu_type) { + typedef typename MachBits::nlist_type nlist_type; + + nlist_type symbol_info[8] = {}; + const char *symbolNames[2] = { symbol_name, "\0" }; + nlist_type &list = symbol_info[0]; + int invalidEntriesCount = breakpad_nlist(filename, + &list, + symbolNames, + cpu_type); + + if(invalidEntriesCount != 0) { + return 0; + } + + assert(list.n_value); + return list.n_value; +} + +#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 +static bool HasTaskDyldInfo() { + return true; +} +#else +static SInt32 GetOSVersionInternal() { + SInt32 os_version = 0; + Gestalt(gestaltSystemVersion, &os_version); + return os_version; +} + +static SInt32 GetOSVersion() { + static SInt32 os_version = GetOSVersionInternal(); + return os_version; +} + +static bool HasTaskDyldInfo() { + return GetOSVersion() >= 0x1060; +} +#endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 10_6 + +uint64_t DynamicImages::GetDyldAllImageInfosPointer() { + if (HasTaskDyldInfo()) { + task_dyld_info_data_t task_dyld_info; + mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; + if (task_info(task_, TASK_DYLD_INFO, (task_info_t)&task_dyld_info, + &count) != KERN_SUCCESS) { + return 0; + } + + return (uint64_t)task_dyld_info.all_image_info_addr; + } else { + const char *imageSymbolName = "_dyld_all_image_infos"; + const char *dyldPath = "/usr/lib/dyld"; + + if (Is64Bit()) + return LookupSymbol(imageSymbolName, dyldPath, cpu_type_); + return LookupSymbol(imageSymbolName, dyldPath, cpu_type_); + } +} + +//============================================================================== +// This code was written using dyld_debug.c (from Darwin) as a guide. + +template +void ReadImageInfo(DynamicImages& images, + uint64_t image_list_address) { + typedef typename MachBits::dyld_image_info dyld_image_info; + typedef typename MachBits::dyld_all_image_infos dyld_all_image_infos; + typedef typename MachBits::mach_header_type mach_header_type; + + // Read the structure inside of dyld that contains information about + // loaded images. We're reading from the desired task's address space. + + // Here we make the assumption that dyld loaded at the same address in + // the crashed process vs. this one. This is an assumption made in + // "dyld_debug.c" and is said to be nearly always valid. + vector dyld_all_info_bytes; + if (ReadTaskMemory(images.task_, + image_list_address, + sizeof(dyld_all_image_infos), + dyld_all_info_bytes) != KERN_SUCCESS) + return; + + dyld_all_image_infos *dyldInfo = + reinterpret_cast(&dyld_all_info_bytes[0]); + + // number of loaded images + int count = dyldInfo->infoArrayCount; + + // Read an array of dyld_image_info structures each containing + // information about a loaded image. + vector dyld_info_array_bytes; + if (ReadTaskMemory(images.task_, + dyldInfo->infoArray, + count * sizeof(dyld_image_info), + dyld_info_array_bytes) != KERN_SUCCESS) + return; + + dyld_image_info *infoArray = + reinterpret_cast(&dyld_info_array_bytes[0]); + images.image_list_.reserve(count); + + for (int i = 0; i < count; ++i) { + dyld_image_info &info = infoArray[i]; + + // First read just the mach_header from the image in the task. + vector mach_header_bytes; + if (ReadTaskMemory(images.task_, + info.load_address_, + sizeof(mach_header_type), + mach_header_bytes) != KERN_SUCCESS) + continue; // bail on this dynamic image + + mach_header_type *header = + reinterpret_cast(&mach_header_bytes[0]); + + // Now determine the total amount necessary to read the header + // plus all of the load commands. + size_t header_size = + sizeof(mach_header_type) + header->sizeofcmds; + + if (ReadTaskMemory(images.task_, + info.load_address_, + header_size, + mach_header_bytes) != KERN_SUCCESS) + continue; + + // Read the file name from the task's memory space. + string file_path; + if (info.file_path_) { + // Although we're reading kMaxStringLength bytes, it's copied in the + // the DynamicImage constructor below with the correct string length, + // so it's not really wasting memory. + file_path = ReadTaskString(images.task_, info.file_path_); + } + + // Create an object representing this image and add it to our list. + DynamicImage *new_image; + new_image = new DynamicImage(&mach_header_bytes[0], + header_size, + info.load_address_, + file_path, + static_cast(info.file_mod_date_), + images.task_, + images.cpu_type_); + + if (new_image->IsValid()) { + images.image_list_.push_back(DynamicImageRef(new_image)); + } else { + delete new_image; + } + } + + // sorts based on loading address + sort(images.image_list_.begin(), images.image_list_.end()); + // remove duplicates - this happens in certain strange cases + // You can see it in DashboardClient when Google Gadgets plugin + // is installed. Apple's crash reporter log and gdb "info shared" + // both show the same library multiple times at the same address + + vector::iterator it = unique(images.image_list_.begin(), + images.image_list_.end()); + images.image_list_.erase(it, images.image_list_.end()); +} + +void DynamicImages::ReadImageInfoForTask() { + uint64_t imageList = GetDyldAllImageInfosPointer(); + + if (imageList) { + if (Is64Bit()) + ReadImageInfo(*this, imageList); + else + ReadImageInfo(*this, imageList); + } +} + +//============================================================================== +DynamicImage *DynamicImages::GetExecutableImage() { + int executable_index = GetExecutableImageIndex(); + + if (executable_index >= 0) { + return GetImage(executable_index); + } + + return NULL; +} + +//============================================================================== +// returns -1 if failure to find executable +int DynamicImages::GetExecutableImageIndex() { + int image_count = GetImageCount(); + + for (int i = 0; i < image_count; ++i) { + DynamicImage *image = GetImage(i); + if (image->GetFileType() == MH_EXECUTE) { + return i; + } + } + + return -1; +} + +//============================================================================== +// static +cpu_type_t DynamicImages::DetermineTaskCPUType(task_t task) { + if (task == mach_task_self()) + return GetNativeCPUType(); + + int mib[CTL_MAXNAME]; + size_t mibLen = CTL_MAXNAME; + int err = sysctlnametomib("sysctl.proc_cputype", mib, &mibLen); + if (err == 0) { + assert(mibLen < CTL_MAXNAME); + pid_for_task(task, &mib[mibLen]); + mibLen += 1; + + cpu_type_t cpu_type; + size_t cpuTypeSize = sizeof(cpu_type); + sysctl(mib, static_cast(mibLen), &cpu_type, &cpuTypeSize, 0, 0); + return cpu_type; + } + + return GetNativeCPUType(); +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h b/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h new file mode 100644 index 0000000000..65147900b8 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h @@ -0,0 +1,319 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// dynamic_images.h +// +// Implements most of the function of the dyld API, but allowing an +// arbitrary task to be introspected, unlike the dyld API which +// only allows operation on the current task. The current implementation +// is limited to use by 32-bit tasks. + +#ifndef CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__ +#define CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__ + +#include +#include +#include +#include + +#include +#include + +#include "mach_vm_compat.h" + +namespace google_breakpad { + +using std::string; +using std::vector; + +//============================================================================== +// The memory layout of this struct matches the dyld_image_info struct +// defined in "dyld_gdb.h" in the darwin source. +typedef struct dyld_image_info32 { + uint32_t load_address_; // struct mach_header* + uint32_t file_path_; // char* + uint32_t file_mod_date_; +} dyld_image_info32; + +typedef struct dyld_image_info64 { + uint64_t load_address_; // struct mach_header* + uint64_t file_path_; // char* + uint64_t file_mod_date_; +} dyld_image_info64; + +//============================================================================== +// This is as defined in "dyld_gdb.h" in the darwin source. +// _dyld_all_image_infos (in dyld) is a structure of this type +// which will be used to determine which dynamic code has been loaded. +typedef struct dyld_all_image_infos32 { + uint32_t version; // == 1 in Mac OS X 10.4 + uint32_t infoArrayCount; + uint32_t infoArray; // const struct dyld_image_info* + uint32_t notification; + bool processDetachedFromSharedRegion; +} dyld_all_image_infos32; + +typedef struct dyld_all_image_infos64 { + uint32_t version; // == 1 in Mac OS X 10.4 + uint32_t infoArrayCount; + uint64_t infoArray; // const struct dyld_image_info* + uint64_t notification; + bool processDetachedFromSharedRegion; +} dyld_all_image_infos64; + +// some typedefs to isolate 64/32 bit differences +#ifdef __LP64__ +typedef mach_header_64 breakpad_mach_header; +typedef segment_command_64 breakpad_mach_segment_command; +#else +typedef mach_header breakpad_mach_header; +typedef segment_command breakpad_mach_segment_command; +#endif + +// Helper functions to deal with 32-bit/64-bit Mach-O differences. +class DynamicImage; +template +bool FindTextSection(DynamicImage& image); + +template +uint32_t GetFileTypeFromHeader(DynamicImage& image); + +//============================================================================== +// Represents a single dynamically loaded mach-o image +class DynamicImage { + public: + DynamicImage(uint8_t *header, // data is copied + size_t header_size, // includes load commands + uint64_t load_address, + string file_path, + uintptr_t image_mod_date, + mach_port_t task, + cpu_type_t cpu_type) + : header_(header, header + header_size), + header_size_(header_size), + load_address_(load_address), + vmaddr_(0), + vmsize_(0), + slide_(0), + version_(0), + file_path_(file_path), + file_mod_date_(image_mod_date), + task_(task), + cpu_type_(cpu_type) { + CalculateMemoryAndVersionInfo(); + } + + // Size of mach_header plus load commands + size_t GetHeaderSize() const {return header_.size();} + + // Full path to mach-o binary + string GetFilePath() {return file_path_;} + + uint64_t GetModDate() const {return file_mod_date_;} + + // Actual address where the image was loaded + uint64_t GetLoadAddress() const {return load_address_;} + + // Address where the image should be loaded + mach_vm_address_t GetVMAddr() const {return vmaddr_;} + + // Difference between GetLoadAddress() and GetVMAddr() + ptrdiff_t GetVMAddrSlide() const {return slide_;} + + // Size of the image + mach_vm_size_t GetVMSize() const {return vmsize_;} + + // Task owning this loaded image + mach_port_t GetTask() {return task_;} + + // CPU type of the task + cpu_type_t GetCPUType() {return cpu_type_;} + + // filetype from the Mach-O header. + uint32_t GetFileType(); + + // Return true if the task is a 64-bit architecture. + bool Is64Bit() { return (GetCPUType() & CPU_ARCH_ABI64) == CPU_ARCH_ABI64; } + + uint32_t GetVersion() {return version_;} + // For sorting + bool operator<(const DynamicImage &inInfo) { + return GetLoadAddress() < inInfo.GetLoadAddress(); + } + + // Sanity checking + bool IsValid() {return GetVMSize() != 0;} + + private: + DynamicImage(const DynamicImage &); + DynamicImage &operator=(const DynamicImage &); + + friend class DynamicImages; + template + friend bool FindTextSection(DynamicImage& image); + template + friend uint32_t GetFileTypeFromHeader(DynamicImage& image); + + // Initializes vmaddr_, vmsize_, and slide_ + void CalculateMemoryAndVersionInfo(); + + const vector header_; // our local copy of the header + size_t header_size_; // mach_header plus load commands + uint64_t load_address_; // base address image is mapped into + mach_vm_address_t vmaddr_; + mach_vm_size_t vmsize_; + ptrdiff_t slide_; + uint32_t version_; // Dylib version + string file_path_; // path dyld used to load the image + uintptr_t file_mod_date_; // time_t of image file + + mach_port_t task_; + cpu_type_t cpu_type_; // CPU type of task_ +}; + +//============================================================================== +// DynamicImageRef is just a simple wrapper for a pointer to +// DynamicImage. The reason we use it instead of a simple typedef is so +// that we can use stl::sort() on a vector of DynamicImageRefs +// and simple class pointers can't implement operator<(). +// +class DynamicImageRef { + public: + explicit DynamicImageRef(DynamicImage *inP) : p(inP) {} + // The copy constructor is required by STL + DynamicImageRef(const DynamicImageRef &inRef) : p(inRef.p) {} + + bool operator<(const DynamicImageRef &inRef) const { + return (*const_cast(this)->p) + < (*const_cast(inRef).p); + } + + bool operator==(const DynamicImageRef &inInfo) const { + return (*const_cast(this)->p).GetLoadAddress() == + (*const_cast(inInfo)).GetLoadAddress(); + } + + // Be just like DynamicImage* + DynamicImage *operator->() {return p;} + operator DynamicImage*() {return p;} + + private: + DynamicImage *p; +}; + +// Helper function to deal with 32-bit/64-bit Mach-O differences. +class DynamicImages; +template +void ReadImageInfo(DynamicImages& images, uint64_t image_list_address); + +//============================================================================== +// An object of type DynamicImages may be created to allow introspection of +// an arbitrary task's dynamically loaded mach-o binaries. This makes the +// assumption that the current task has send rights to the target task. +class DynamicImages { + public: + explicit DynamicImages(mach_port_t task); + + ~DynamicImages() { + for (int i = 0; i < GetImageCount(); ++i) { + delete image_list_[i]; + } + } + + // Returns the number of dynamically loaded mach-o images. + int GetImageCount() const {return static_cast(image_list_.size());} + + // Returns an individual image. + DynamicImage *GetImage(int i) { + if (i < (int)image_list_.size()) { + return image_list_[i]; + } + return NULL; + } + + // Returns the image corresponding to the main executable. + DynamicImage *GetExecutableImage(); + int GetExecutableImageIndex(); + + // Returns the task which we're looking at. + mach_port_t GetTask() const {return task_;} + + // CPU type of the task + cpu_type_t GetCPUType() {return cpu_type_;} + + // Return true if the task is a 64-bit architecture. + bool Is64Bit() { return (GetCPUType() & CPU_ARCH_ABI64) == CPU_ARCH_ABI64; } + + // Determine the CPU type of the task being dumped. + static cpu_type_t DetermineTaskCPUType(task_t task); + + // Get the native CPU type of this task. + static cpu_type_t GetNativeCPUType() { +#if defined(__i386__) + return CPU_TYPE_I386; +#elif defined(__x86_64__) + return CPU_TYPE_X86_64; +#elif defined(__ppc__) + return CPU_TYPE_POWERPC; +#elif defined(__ppc64__) + return CPU_TYPE_POWERPC64; +#elif defined(__arm__) + return CPU_TYPE_ARM; +#elif defined(__aarch64__) + return CPU_TYPE_ARM64; +#else +#error "GetNativeCPUType not implemented for this architecture" +#endif + } + + private: + template + friend void ReadImageInfo(DynamicImages& images, uint64_t image_list_address); + + bool IsOurTask() {return task_ == mach_task_self();} + + // Initialization + void ReadImageInfoForTask(); + uint64_t GetDyldAllImageInfosPointer(); + + mach_port_t task_; + cpu_type_t cpu_type_; // CPU type of task_ + vector image_list_; +}; + +// Fill bytes with the contents of memory at a particular +// location in another task. +kern_return_t ReadTaskMemory(task_port_t target_task, + const uint64_t address, + size_t length, + vector &bytes); + +} // namespace google_breakpad + +#endif // CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h b/Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h new file mode 100644 index 0000000000..9e9028b928 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h @@ -0,0 +1,48 @@ +// Copyright (c) 2011, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_ +#define CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_ + +#include + +// On iOS 5 and higher, mach/mach_vm.h is not supported. Use the corresponding +// vm_map functions instead. +#if TARGET_OS_IPHONE +#include +#define mach_vm_address_t vm_address_t +#define mach_vm_deallocate vm_deallocate +#define mach_vm_read vm_read +#define mach_vm_region_recurse vm_region_recurse_64 +#define mach_vm_size_t vm_size_t +#else +#include +#endif // TARGET_OS_IPHONE + +#endif // CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc new file mode 100644 index 0000000000..7d6e81dbb8 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc @@ -0,0 +1,1591 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "client/mac/handler/minidump_generator.h" + +#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT) +#include +#endif +#ifdef HAS_PPC_SUPPORT +#include +#endif +#ifdef HAS_X86_SUPPORT +#include +#endif + +#include "client/minidump_file_writer-inl.h" +#include "common/mac/file_id.h" +#include "common/mac/macho_id.h" +#include "common/mac/string_utilities.h" + +using MacStringUtils::ConvertToString; +using MacStringUtils::IntegerValueAtIndex; + +namespace google_breakpad { + +#if defined(__LP64__) && __LP64__ +#define LC_SEGMENT_ARCH LC_SEGMENT_64 +#else +#define LC_SEGMENT_ARCH LC_SEGMENT +#endif + +// constructor when generating from within the crashed process +MinidumpGenerator::MinidumpGenerator() + : writer_(), + exception_type_(0), + exception_code_(0), + exception_subcode_(0), + exception_thread_(0), + crashing_task_(mach_task_self()), + handler_thread_(mach_thread_self()), + cpu_type_(DynamicImages::GetNativeCPUType()), + task_context_(NULL), + dynamic_images_(NULL), + memory_blocks_(&allocator_) { + GatherSystemInformation(); +} + +// constructor when generating from a different process than the +// crashed process +MinidumpGenerator::MinidumpGenerator(mach_port_t crashing_task, + mach_port_t handler_thread) + : writer_(), + exception_type_(0), + exception_code_(0), + exception_subcode_(0), + exception_thread_(0), + crashing_task_(crashing_task), + handler_thread_(handler_thread), + cpu_type_(DynamicImages::GetNativeCPUType()), + task_context_(NULL), + dynamic_images_(NULL), + memory_blocks_(&allocator_) { + if (crashing_task != mach_task_self()) { + dynamic_images_ = new DynamicImages(crashing_task_); + cpu_type_ = dynamic_images_->GetCPUType(); + } else { + dynamic_images_ = NULL; + cpu_type_ = DynamicImages::GetNativeCPUType(); + } + + GatherSystemInformation(); +} + +MinidumpGenerator::~MinidumpGenerator() { + delete dynamic_images_; +} + +char MinidumpGenerator::build_string_[16]; +int MinidumpGenerator::os_major_version_ = 0; +int MinidumpGenerator::os_minor_version_ = 0; +int MinidumpGenerator::os_build_number_ = 0; + +// static +void MinidumpGenerator::GatherSystemInformation() { + // If this is non-zero, then we've already gathered the information + if (os_major_version_) + return; + + // This code extracts the version and build information from the OS + CFStringRef vers_path = + CFSTR("/System/Library/CoreServices/SystemVersion.plist"); + CFURLRef sys_vers = + CFURLCreateWithFileSystemPath(NULL, + vers_path, + kCFURLPOSIXPathStyle, + false); + CFReadStreamRef read_stream = CFReadStreamCreateWithFile(NULL, sys_vers); + CFRelease(sys_vers); + if (!read_stream) { + return; + } + if (!CFReadStreamOpen(read_stream)) { + CFRelease(read_stream); + return; + } + CFDataRef data = NULL; + CFIndex num_bytes_read = 0; + const UInt8 *data_bytes = + CFReadStreamGetBuffer(read_stream, 0, &num_bytes_read); + if (data_bytes) { + data = CFDataCreate(NULL, data_bytes, num_bytes_read); + } + CFReadStreamClose(read_stream); + CFRelease(read_stream); + if (!data) { + return; + } + CFDictionaryRef list = static_cast + (CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable, + NULL)); + CFRelease(data); + if (!list) { + return; + } + CFStringRef build_version = static_cast + (CFDictionaryGetValue(list, CFSTR("ProductBuildVersion"))); + CFStringRef product_version = static_cast + (CFDictionaryGetValue(list, CFSTR("ProductVersion"))); + string build_str = ConvertToString(build_version); + string product_str = ConvertToString(product_version); + + CFRelease(list); + + strlcpy(build_string_, build_str.c_str(), sizeof(build_string_)); + + // Parse the string that looks like "10.4.8" + os_major_version_ = IntegerValueAtIndex(product_str, 0); + os_minor_version_ = IntegerValueAtIndex(product_str, 1); + os_build_number_ = IntegerValueAtIndex(product_str, 2); +} + +void MinidumpGenerator::SetTaskContext(breakpad_ucontext_t *task_context) { + task_context_ = task_context; +} + +string MinidumpGenerator::UniqueNameInDirectory(const string &dir, + string *unique_name) { + CFUUIDRef uuid = CFUUIDCreate(NULL); + CFStringRef uuid_cfstr = CFUUIDCreateString(NULL, uuid); + CFRelease(uuid); + string file_name(ConvertToString(uuid_cfstr)); + CFRelease(uuid_cfstr); + string path(dir); + + // Ensure that the directory (if non-empty) has a trailing slash so that + // we can append the file name and have a valid pathname. + if (!dir.empty()) { + if (dir.at(dir.size() - 1) != '/') + path.append(1, '/'); + } + + path.append(file_name); + path.append(".dmp"); + + if (unique_name) + *unique_name = file_name; + + return path; +} + +bool MinidumpGenerator::Write(const char *path) { + WriteStreamFN writers[] = { + &MinidumpGenerator::WriteThreadListStream, + &MinidumpGenerator::WriteMemoryListStream, + &MinidumpGenerator::WriteSystemInfoStream, + &MinidumpGenerator::WriteModuleListStream, + &MinidumpGenerator::WriteMiscInfoStream, + &MinidumpGenerator::WriteBreakpadInfoStream, + // Exception stream needs to be the last entry in this array as it may + // be omitted in the case where the minidump is written without an + // exception. + &MinidumpGenerator::WriteExceptionStream, + }; + bool result = false; + + // If opening was successful, create the header, directory, and call each + // writer. The destructor for the TypedMDRVAs will cause the data to be + // flushed. The destructor for the MinidumpFileWriter will close the file. + if (writer_.Open(path)) { + TypedMDRVA header(&writer_); + TypedMDRVA dir(&writer_); + + if (!header.Allocate()) + return false; + + int writer_count = static_cast(sizeof(writers) / sizeof(writers[0])); + + // If we don't have exception information, don't write out the + // exception stream + if (!exception_thread_ && !exception_type_) + --writer_count; + + // Add space for all writers + if (!dir.AllocateArray(writer_count)) + return false; + + MDRawHeader *header_ptr = header.get(); + header_ptr->signature = MD_HEADER_SIGNATURE; + header_ptr->version = MD_HEADER_VERSION; + time(reinterpret_cast(&(header_ptr->time_date_stamp))); + header_ptr->stream_count = writer_count; + header_ptr->stream_directory_rva = dir.position(); + + MDRawDirectory local_dir; + result = true; + for (int i = 0; (result) && (i < writer_count); ++i) { + result = (this->*writers[i])(&local_dir); + + if (result) + dir.CopyIndex(i, &local_dir); + } + } + return result; +} + +size_t MinidumpGenerator::CalculateStackSize(mach_vm_address_t start_addr) { + mach_vm_address_t stack_region_base = start_addr; + mach_vm_size_t stack_region_size; + natural_t nesting_level = 0; + vm_region_submap_info_64 submap_info; + mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64; + + vm_region_recurse_info_t region_info; + region_info = reinterpret_cast(&submap_info); + + if (start_addr == 0) { + return 0; + } + + kern_return_t result = + mach_vm_region_recurse(crashing_task_, &stack_region_base, + &stack_region_size, &nesting_level, + region_info, &info_count); + + if (result != KERN_SUCCESS || start_addr < stack_region_base) { + // Failure or stack corruption, since mach_vm_region had to go + // higher in the process address space to find a valid region. + return 0; + } + + unsigned int tag = submap_info.user_tag; + + // If the user tag is VM_MEMORY_STACK, look for more readable regions with + // the same tag placed immediately above the computed stack region. Under + // some circumstances, the stack for thread 0 winds up broken up into + // multiple distinct abutting regions. This can happen for several reasons, + // including user code that calls setrlimit(RLIMIT_STACK, ...) or changes + // the access on stack pages by calling mprotect. + if (tag == VM_MEMORY_STACK) { + while (true) { + mach_vm_address_t next_region_base = stack_region_base + + stack_region_size; + mach_vm_address_t proposed_next_region_base = next_region_base; + mach_vm_size_t next_region_size; + nesting_level = 0; + info_count = VM_REGION_SUBMAP_INFO_COUNT_64; + result = mach_vm_region_recurse(crashing_task_, &next_region_base, + &next_region_size, &nesting_level, + region_info, &info_count); + if (result != KERN_SUCCESS || + next_region_base != proposed_next_region_base || + submap_info.user_tag != tag || + (submap_info.protection & VM_PROT_READ) == 0) { + break; + } + + stack_region_size += next_region_size; + } + } + + return stack_region_base + stack_region_size - start_addr; +} + +bool MinidumpGenerator::WriteStackFromStartAddress( + mach_vm_address_t start_addr, + MDMemoryDescriptor *stack_location) { + UntypedMDRVA memory(&writer_); + + bool result = false; + size_t size = CalculateStackSize(start_addr); + + if (size == 0) { + // In some situations the stack address for the thread can come back 0. + // In these cases we skip over the threads in question and stuff the + // stack with a clearly borked value. + start_addr = 0xDEADBEEF; + size = 16; + if (!memory.Allocate(size)) + return false; + + unsigned long long dummy_stack[2]; // Fill dummy stack with 16 bytes of + // junk. + dummy_stack[0] = 0xDEADBEEF; + dummy_stack[1] = 0xDEADBEEF; + + result = memory.Copy(dummy_stack, size); + } else { + + if (!memory.Allocate(size)) + return false; + + if (dynamic_images_) { + vector stack_memory; + if (ReadTaskMemory(crashing_task_, + start_addr, + size, + stack_memory) != KERN_SUCCESS) { + return false; + } + + result = memory.Copy(&stack_memory[0], size); + } else { + result = memory.Copy(reinterpret_cast(start_addr), size); + } + } + + stack_location->start_of_memory_range = start_addr; + stack_location->memory = memory.location(); + + return result; +} + +bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + switch (cpu_type_) { +#ifdef HAS_ARM_SUPPORT + case CPU_TYPE_ARM: + return WriteStackARM(state, stack_location); +#endif +#ifdef HAS_ARM64_SUPPORT + case CPU_TYPE_ARM64: + return WriteStackARM64(state, stack_location); +#endif +#ifdef HAS_PPC_SUPPORT + case CPU_TYPE_POWERPC: + return WriteStackPPC(state, stack_location); + case CPU_TYPE_POWERPC64: + return WriteStackPPC64(state, stack_location); +#endif +#ifdef HAS_X86_SUPPORT + case CPU_TYPE_I386: + return WriteStackX86(state, stack_location); + case CPU_TYPE_X86_64: + return WriteStackX86_64(state, stack_location); +#endif + default: + return false; + } +} + +bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) { + switch (cpu_type_) { +#ifdef HAS_ARM_SUPPORT + case CPU_TYPE_ARM: + return WriteContextARM(state, register_location); +#endif +#ifdef HAS_ARM64_SUPPORT + case CPU_TYPE_ARM64: + return WriteContextARM64(state, register_location); +#endif +#ifdef HAS_PPC_SUPPORT + case CPU_TYPE_POWERPC: + return WriteContextPPC(state, register_location); + case CPU_TYPE_POWERPC64: + return WriteContextPPC64(state, register_location); +#endif +#ifdef HAS_X86_SUPPORT + case CPU_TYPE_I386: + return WriteContextX86(state, register_location); + case CPU_TYPE_X86_64: + return WriteContextX86_64(state, register_location); +#endif + default: + return false; + } +} + +uint64_t MinidumpGenerator::CurrentPCForStack( + breakpad_thread_state_data_t state) { + switch (cpu_type_) { +#ifdef HAS_ARM_SUPPORT + case CPU_TYPE_ARM: + return CurrentPCForStackARM(state); +#endif +#ifdef HAS_ARM64_SUPPORT + case CPU_TYPE_ARM64: + return CurrentPCForStackARM64(state); +#endif +#ifdef HAS_PPC_SUPPORT + case CPU_TYPE_POWERPC: + return CurrentPCForStackPPC(state); + case CPU_TYPE_POWERPC64: + return CurrentPCForStackPPC64(state); +#endif +#ifdef HAS_X86_SUPPORT + case CPU_TYPE_I386: + return CurrentPCForStackX86(state); + case CPU_TYPE_X86_64: + return CurrentPCForStackX86_64(state); +#endif + default: + assert(0 && "Unknown CPU type!"); + return 0; + } +} + +#ifdef HAS_ARM_SUPPORT +bool MinidumpGenerator::WriteStackARM(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + arm_thread_state_t *machine_state = + reinterpret_cast(state); + mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp); + return WriteStackFromStartAddress(start_addr, stack_location); +} + +uint64_t +MinidumpGenerator::CurrentPCForStackARM(breakpad_thread_state_data_t state) { + arm_thread_state_t *machine_state = + reinterpret_cast(state); + + return REGISTER_FROM_THREADSTATE(machine_state, pc); +} + +bool MinidumpGenerator::WriteContextARM(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) +{ + TypedMDRVA context(&writer_); + arm_thread_state_t *machine_state = + reinterpret_cast(state); + + if (!context.Allocate()) + return false; + + *register_location = context.location(); + MDRawContextARM *context_ptr = context.get(); + context_ptr->context_flags = MD_CONTEXT_ARM_FULL; + +#define AddGPR(a) context_ptr->iregs[a] = REGISTER_FROM_THREADSTATE(machine_state, r[a]) + + context_ptr->iregs[13] = REGISTER_FROM_THREADSTATE(machine_state, sp); + context_ptr->iregs[14] = REGISTER_FROM_THREADSTATE(machine_state, lr); + context_ptr->iregs[15] = REGISTER_FROM_THREADSTATE(machine_state, pc); + context_ptr->cpsr = REGISTER_FROM_THREADSTATE(machine_state, cpsr); + + AddGPR(0); + AddGPR(1); + AddGPR(2); + AddGPR(3); + AddGPR(4); + AddGPR(5); + AddGPR(6); + AddGPR(7); + AddGPR(8); + AddGPR(9); + AddGPR(10); + AddGPR(11); + AddGPR(12); +#undef AddGPR + + return true; +} +#endif + +#ifdef HAS_ARM64_SUPPORT +bool MinidumpGenerator::WriteStackARM64(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + arm_thread_state64_t *machine_state = + reinterpret_cast(state); + mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp); + return WriteStackFromStartAddress(start_addr, stack_location); +} + +uint64_t +MinidumpGenerator::CurrentPCForStackARM64(breakpad_thread_state_data_t state) { + arm_thread_state64_t *machine_state = + reinterpret_cast(state); + + return REGISTER_FROM_THREADSTATE(machine_state, pc); +} + +bool +MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) +{ + TypedMDRVA context(&writer_); + arm_thread_state64_t *machine_state = + reinterpret_cast(state); + + if (!context.Allocate()) + return false; + + *register_location = context.location(); + MDRawContextARM64 *context_ptr = context.get(); + context_ptr->context_flags = MD_CONTEXT_ARM64_FULL; + +#define AddGPR(a) context_ptr->iregs[a] = \ + REGISTER_FROM_THREADSTATE(machine_state, x[a]) + + context_ptr->iregs[29] = REGISTER_FROM_THREADSTATE(machine_state, fp); + context_ptr->iregs[30] = REGISTER_FROM_THREADSTATE(machine_state, lr); + context_ptr->iregs[31] = REGISTER_FROM_THREADSTATE(machine_state, sp); + context_ptr->iregs[32] = REGISTER_FROM_THREADSTATE(machine_state, pc); + context_ptr->cpsr = REGISTER_FROM_THREADSTATE(machine_state, cpsr); + + AddGPR(0); + AddGPR(1); + AddGPR(2); + AddGPR(3); + AddGPR(4); + AddGPR(5); + AddGPR(6); + AddGPR(7); + AddGPR(8); + AddGPR(9); + AddGPR(10); + AddGPR(11); + AddGPR(12); + AddGPR(13); + AddGPR(14); + AddGPR(15); + AddGPR(16); + AddGPR(17); + AddGPR(18); + AddGPR(19); + AddGPR(20); + AddGPR(21); + AddGPR(22); + AddGPR(23); + AddGPR(24); + AddGPR(25); + AddGPR(26); + AddGPR(27); + AddGPR(28); +#undef AddGPR + + return true; +} +#endif + +#ifdef HAS_PCC_SUPPORT +bool MinidumpGenerator::WriteStackPPC(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + ppc_thread_state_t *machine_state = + reinterpret_cast(state); + mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1); + return WriteStackFromStartAddress(start_addr, stack_location); +} + +bool MinidumpGenerator::WriteStackPPC64(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + ppc_thread_state64_t *machine_state = + reinterpret_cast(state); + mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1); + return WriteStackFromStartAddress(start_addr, stack_location); +} + +uint64_t +MinidumpGenerator::CurrentPCForStackPPC(breakpad_thread_state_data_t state) { + ppc_thread_state_t *machine_state = + reinterpret_cast(state); + + return REGISTER_FROM_THREADSTATE(machine_state, srr0); +} + +uint64_t +MinidumpGenerator::CurrentPCForStackPPC64(breakpad_thread_state_data_t state) { + ppc_thread_state64_t *machine_state = + reinterpret_cast(state); + + return REGISTER_FROM_THREADSTATE(machine_state, srr0); +} + +bool MinidumpGenerator::WriteContextPPC(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) +{ + TypedMDRVA context(&writer_); + ppc_thread_state_t *machine_state = + reinterpret_cast(state); + + if (!context.Allocate()) + return false; + + *register_location = context.location(); + MDRawContextPPC *context_ptr = context.get(); + context_ptr->context_flags = MD_CONTEXT_PPC_BASE; + +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) +#define AddGPR(a) context_ptr->gpr[a] = \ + static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, r ## a) + + AddReg(srr0); + AddReg(cr); + AddReg(xer); + AddReg(ctr); + AddReg(lr); + AddReg(vrsave); + + AddGPR(0); + AddGPR(1); + AddGPR(2); + AddGPR(3); + AddGPR(4); + AddGPR(5); + AddGPR(6); + AddGPR(7); + AddGPR(8); + AddGPR(9); + AddGPR(10); + AddGPR(11); + AddGPR(12); + AddGPR(13); + AddGPR(14); + AddGPR(15); + AddGPR(16); + AddGPR(17); + AddGPR(18); + AddGPR(19); + AddGPR(20); + AddGPR(21); + AddGPR(22); + AddGPR(23); + AddGPR(24); + AddGPR(25); + AddGPR(26); + AddGPR(27); + AddGPR(28); + AddGPR(29); + AddGPR(30); + AddGPR(31); + AddReg(mq); +#undef AddReg +#undef AddGPR + + return true; +} + +bool MinidumpGenerator::WriteContextPPC64( + breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) { + TypedMDRVA context(&writer_); + ppc_thread_state64_t *machine_state = + reinterpret_cast(state); + + if (!context.Allocate()) + return false; + + *register_location = context.location(); + MDRawContextPPC64 *context_ptr = context.get(); + context_ptr->context_flags = MD_CONTEXT_PPC_BASE; + +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) +#define AddGPR(a) context_ptr->gpr[a] = \ + static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, r ## a) + + AddReg(srr0); + AddReg(cr); + AddReg(xer); + AddReg(ctr); + AddReg(lr); + AddReg(vrsave); + + AddGPR(0); + AddGPR(1); + AddGPR(2); + AddGPR(3); + AddGPR(4); + AddGPR(5); + AddGPR(6); + AddGPR(7); + AddGPR(8); + AddGPR(9); + AddGPR(10); + AddGPR(11); + AddGPR(12); + AddGPR(13); + AddGPR(14); + AddGPR(15); + AddGPR(16); + AddGPR(17); + AddGPR(18); + AddGPR(19); + AddGPR(20); + AddGPR(21); + AddGPR(22); + AddGPR(23); + AddGPR(24); + AddGPR(25); + AddGPR(26); + AddGPR(27); + AddGPR(28); + AddGPR(29); + AddGPR(30); + AddGPR(31); +#undef AddReg +#undef AddGPR + + return true; +} + +#endif + +#ifdef HAS_X86_SUPPORT +bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + i386_thread_state_t *machine_state = + reinterpret_cast(state); + + mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, esp); + return WriteStackFromStartAddress(start_addr, stack_location); +} + +bool MinidumpGenerator::WriteStackX86_64(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location) { + x86_thread_state64_t *machine_state = + reinterpret_cast(state); + + mach_vm_address_t start_addr = static_cast( + REGISTER_FROM_THREADSTATE(machine_state, rsp)); + return WriteStackFromStartAddress(start_addr, stack_location); +} + +uint64_t +MinidumpGenerator::CurrentPCForStackX86(breakpad_thread_state_data_t state) { + i386_thread_state_t *machine_state = + reinterpret_cast(state); + + return REGISTER_FROM_THREADSTATE(machine_state, eip); +} + +uint64_t +MinidumpGenerator::CurrentPCForStackX86_64(breakpad_thread_state_data_t state) { + x86_thread_state64_t *machine_state = + reinterpret_cast(state); + + return REGISTER_FROM_THREADSTATE(machine_state, rip); +} + +bool MinidumpGenerator::WriteContextX86(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) +{ + TypedMDRVA context(&writer_); + i386_thread_state_t *machine_state = + reinterpret_cast(state); + + if (!context.Allocate()) + return false; + + *register_location = context.location(); + MDRawContextX86 *context_ptr = context.get(); + +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) + + context_ptr->context_flags = MD_CONTEXT_X86; + AddReg(eax); + AddReg(ebx); + AddReg(ecx); + AddReg(edx); + AddReg(esi); + AddReg(edi); + AddReg(ebp); + AddReg(esp); + + AddReg(cs); + AddReg(ds); + AddReg(ss); + AddReg(es); + AddReg(fs); + AddReg(gs); + AddReg(eflags); + + AddReg(eip); +#undef AddReg + + return true; +} + +bool MinidumpGenerator::WriteContextX86_64( + breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location) { + TypedMDRVA context(&writer_); + x86_thread_state64_t *machine_state = + reinterpret_cast(state); + + if (!context.Allocate()) + return false; + + *register_location = context.location(); + MDRawContextAMD64 *context_ptr = context.get(); + +#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ + REGISTER_FROM_THREADSTATE(machine_state, a)) + + context_ptr->context_flags = MD_CONTEXT_AMD64; + AddReg(rax); + AddReg(rbx); + AddReg(rcx); + AddReg(rdx); + AddReg(rdi); + AddReg(rsi); + AddReg(rbp); + AddReg(rsp); + AddReg(r8); + AddReg(r9); + AddReg(r10); + AddReg(r11); + AddReg(r12); + AddReg(r13); + AddReg(r14); + AddReg(r15); + AddReg(rip); + // according to AMD's software developer guide, bits above 18 are + // not used in the flags register. Since the minidump format + // specifies 32 bits for the flags register, we can truncate safely + // with no loss. + context_ptr->eflags = static_cast(REGISTER_FROM_THREADSTATE(machine_state, rflags)); + AddReg(cs); + AddReg(fs); + AddReg(gs); +#undef AddReg + + return true; +} +#endif + +bool MinidumpGenerator::GetThreadState(thread_act_t target_thread, + thread_state_t state, + mach_msg_type_number_t *count) { + if (task_context_ && target_thread == mach_thread_self()) { + switch (cpu_type_) { +#ifdef HAS_ARM_SUPPORT + case CPU_TYPE_ARM: + size_t final_size = + std::min(static_cast(*count), sizeof(arm_thread_state_t)); + memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size); + *count = static_cast(final_size); + return true; +#endif +#ifdef HAS_ARM64_SUPPORT + case CPU_TYPE_ARM64: { + size_t final_size = + std::min(static_cast(*count), sizeof(arm_thread_state64_t)); + memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size); + *count = static_cast(final_size); + return true; + } +#endif +#ifdef HAS_X86_SUPPORT + case CPU_TYPE_I386: + case CPU_TYPE_X86_64: { + size_t state_size = cpu_type_ == CPU_TYPE_I386 ? + sizeof(i386_thread_state_t) : sizeof(x86_thread_state64_t); + size_t final_size = + std::min(static_cast(*count), state_size); + memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size); + *count = static_cast(final_size); + return true; + } +#endif + } + } + + thread_state_flavor_t flavor; + switch (cpu_type_) { +#ifdef HAS_ARM_SUPPORT + case CPU_TYPE_ARM: + flavor = ARM_THREAD_STATE; + break; +#endif +#ifdef HAS_ARM64_SUPPORT + case CPU_TYPE_ARM64: + flavor = ARM_THREAD_STATE64; + break; +#endif +#ifdef HAS_PPC_SUPPORT + case CPU_TYPE_POWERPC: + flavor = PPC_THREAD_STATE; + break; + case CPU_TYPE_POWERPC64: + flavor = PPC_THREAD_STATE64; + break; +#endif +#ifdef HAS_X86_SUPPORT + case CPU_TYPE_I386: + flavor = i386_THREAD_STATE; + break; + case CPU_TYPE_X86_64: + flavor = x86_THREAD_STATE64; + break; +#endif + default: + return false; + } + return thread_get_state(target_thread, flavor, + state, count) == KERN_SUCCESS; +} + +bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id, + MDRawThread *thread) { + breakpad_thread_state_data_t state; + mach_msg_type_number_t state_count + = static_cast(sizeof(state)); + + if (GetThreadState(thread_id, state, &state_count)) { + if (!WriteStack(state, &thread->stack)) + return false; + + memory_blocks_.push_back(thread->stack); + + if (!WriteContext(state, &thread->thread_context)) + return false; + + thread->thread_id = thread_id; + } else { + return false; + } + + return true; +} + +bool MinidumpGenerator::WriteThreadListStream( + MDRawDirectory *thread_list_stream) { + TypedMDRVA list(&writer_); + thread_act_port_array_t threads_for_task; + mach_msg_type_number_t thread_count; + int non_generator_thread_count; + + if (task_threads(crashing_task_, &threads_for_task, &thread_count)) + return false; + + // Don't include the generator thread + if (handler_thread_ != MACH_PORT_NULL) + non_generator_thread_count = thread_count - 1; + else + non_generator_thread_count = thread_count; + if (!list.AllocateObjectAndArray(non_generator_thread_count, + sizeof(MDRawThread))) + return false; + + thread_list_stream->stream_type = MD_THREAD_LIST_STREAM; + thread_list_stream->location = list.location(); + + list.get()->number_of_threads = non_generator_thread_count; + + MDRawThread thread; + int thread_idx = 0; + + for (unsigned int i = 0; i < thread_count; ++i) { + memset(&thread, 0, sizeof(MDRawThread)); + + if (threads_for_task[i] != handler_thread_) { + if (!WriteThreadStream(threads_for_task[i], &thread)) + return false; + + list.CopyIndexAfterObject(thread_idx++, &thread, sizeof(MDRawThread)); + } + } + + return true; +} + +bool MinidumpGenerator::WriteMemoryListStream( + MDRawDirectory *memory_list_stream) { + TypedMDRVA list(&writer_); + + // If the dump has an exception, include some memory around the + // instruction pointer. + const size_t kIPMemorySize = 256; // bytes + bool have_ip_memory = false; + MDMemoryDescriptor ip_memory_d; + if (exception_thread_ && exception_type_) { + breakpad_thread_state_data_t state; + mach_msg_type_number_t stateCount + = static_cast(sizeof(state)); + + if (GetThreadState(exception_thread_, state, &stateCount)) { + uint64_t ip = CurrentPCForStack(state); + // Bound it to the upper and lower bounds of the region + // it's contained within. If it's not in a known memory region, + // don't bother trying to write it. + mach_vm_address_t addr = static_cast(ip); + mach_vm_size_t size; + natural_t nesting_level = 0; + vm_region_submap_info_64 info; + mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64; + vm_region_recurse_info_t recurse_info; + recurse_info = reinterpret_cast(&info); + + kern_return_t ret = + mach_vm_region_recurse(crashing_task_, + &addr, + &size, + &nesting_level, + recurse_info, + &info_count); + if (ret == KERN_SUCCESS && ip >= addr && ip < (addr + size)) { + // Try to get 128 bytes before and after the IP, but + // settle for whatever's available. + ip_memory_d.start_of_memory_range = + std::max(uintptr_t(addr), + uintptr_t(ip - (kIPMemorySize / 2))); + uintptr_t end_of_range = + std::min(uintptr_t(ip + (kIPMemorySize / 2)), + uintptr_t(addr + size)); + uintptr_t range_diff = end_of_range - + static_cast(ip_memory_d.start_of_memory_range); + ip_memory_d.memory.data_size = static_cast(range_diff); + have_ip_memory = true; + // This needs to get appended to the list even though + // the memory bytes aren't filled in yet so the entire + // list can be written first. The memory bytes will get filled + // in after the memory list is written. + memory_blocks_.push_back(ip_memory_d); + } + } + } + + // Now fill in the memory list and write it. + size_t memory_count = memory_blocks_.size(); + if (!list.AllocateObjectAndArray(memory_count, + sizeof(MDMemoryDescriptor))) + return false; + + memory_list_stream->stream_type = MD_MEMORY_LIST_STREAM; + memory_list_stream->location = list.location(); + + list.get()->number_of_memory_ranges = static_cast(memory_count); + + unsigned int i; + for (i = 0; i < memory_count; ++i) { + list.CopyIndexAfterObject(i, &memory_blocks_[i], + sizeof(MDMemoryDescriptor)); + } + + if (have_ip_memory) { + // Now read the memory around the instruction pointer. + UntypedMDRVA ip_memory(&writer_); + if (!ip_memory.Allocate(ip_memory_d.memory.data_size)) + return false; + + if (dynamic_images_) { + // Out-of-process. + vector memory; + if (ReadTaskMemory(crashing_task_, + ip_memory_d.start_of_memory_range, + ip_memory_d.memory.data_size, + memory) != KERN_SUCCESS) { + return false; + } + + ip_memory.Copy(&memory[0], ip_memory_d.memory.data_size); + } else { + // In-process, just copy from local memory. + ip_memory.Copy( + reinterpret_cast(ip_memory_d.start_of_memory_range), + ip_memory_d.memory.data_size); + } + + ip_memory_d.memory = ip_memory.location(); + // Write this again now that the data location is filled in. + list.CopyIndexAfterObject(i - 1, &ip_memory_d, + sizeof(MDMemoryDescriptor)); + } + + return true; +} + +bool +MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) { + TypedMDRVA exception(&writer_); + + if (!exception.Allocate()) + return false; + + exception_stream->stream_type = MD_EXCEPTION_STREAM; + exception_stream->location = exception.location(); + MDRawExceptionStream *exception_ptr = exception.get(); + exception_ptr->thread_id = exception_thread_; + + // This naming is confusing, but it is the proper translation from + // mach naming to minidump naming. + exception_ptr->exception_record.exception_code = exception_type_; + exception_ptr->exception_record.exception_flags = exception_code_; + + breakpad_thread_state_data_t state; + mach_msg_type_number_t state_count + = static_cast(sizeof(state)); + + if (!GetThreadState(exception_thread_, state, &state_count)) + return false; + + if (!WriteContext(state, &exception_ptr->thread_context)) + return false; + + if (exception_type_ == EXC_BAD_ACCESS) + exception_ptr->exception_record.exception_address = exception_subcode_; + else + exception_ptr->exception_record.exception_address = CurrentPCForStack(state); + + return true; +} + +bool MinidumpGenerator::WriteSystemInfoStream( + MDRawDirectory *system_info_stream) { + TypedMDRVA info(&writer_); + + if (!info.Allocate()) + return false; + + system_info_stream->stream_type = MD_SYSTEM_INFO_STREAM; + system_info_stream->location = info.location(); + + // CPU Information + uint32_t number_of_processors; + size_t len = sizeof(number_of_processors); + sysctlbyname("hw.ncpu", &number_of_processors, &len, NULL, 0); + MDRawSystemInfo *info_ptr = info.get(); + + switch (cpu_type_) { +#ifdef HAS_ARM_SUPPORT + case CPU_TYPE_ARM: + info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM; + break; +#endif +#ifdef HAS_ARM64_SUPPORT + case CPU_TYPE_ARM64: + info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64; + break; +#endif +#ifdef HAS_PPC_SUPPORT + case CPU_TYPE_POWERPC: + case CPU_TYPE_POWERPC64: + info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_PPC; + break; +#endif +#ifdef HAS_X86_SUPPORT + case CPU_TYPE_I386: + case CPU_TYPE_X86_64: + if (cpu_type_ == CPU_TYPE_I386) + info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_X86; + else + info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_AMD64; +#ifdef __i386__ + // ebx is used for PIC code, so we need + // to preserve it. +#define cpuid(op,eax,ebx,ecx,edx) \ + asm ("pushl %%ebx \n\t" \ + "cpuid \n\t" \ + "movl %%ebx,%1 \n\t" \ + "popl %%ebx" \ + : "=a" (eax), \ + "=g" (ebx), \ + "=c" (ecx), \ + "=d" (edx) \ + : "0" (op)) +#elif defined(__x86_64__) + +#define cpuid(op,eax,ebx,ecx,edx) \ + asm ("cpuid \n\t" \ + : "=a" (eax), \ + "=b" (ebx), \ + "=c" (ecx), \ + "=d" (edx) \ + : "0" (op)) +#endif + +#if defined(__i386__) || defined(__x86_64__) + int unused, unused2; + // get vendor id + cpuid(0, unused, info_ptr->cpu.x86_cpu_info.vendor_id[0], + info_ptr->cpu.x86_cpu_info.vendor_id[2], + info_ptr->cpu.x86_cpu_info.vendor_id[1]); + // get version and feature info + cpuid(1, info_ptr->cpu.x86_cpu_info.version_information, unused, unused2, + info_ptr->cpu.x86_cpu_info.feature_information); + + // family + info_ptr->processor_level = + (info_ptr->cpu.x86_cpu_info.version_information & 0xF00) >> 8; + // 0xMMSS (Model, Stepping) + info_ptr->processor_revision = static_cast( + (info_ptr->cpu.x86_cpu_info.version_information & 0xF) | + ((info_ptr->cpu.x86_cpu_info.version_information & 0xF0) << 4)); + + // decode extended model info + if (info_ptr->processor_level == 0xF || + info_ptr->processor_level == 0x6) { + info_ptr->processor_revision |= + ((info_ptr->cpu.x86_cpu_info.version_information & 0xF0000) >> 4); + } + + // decode extended family info + if (info_ptr->processor_level == 0xF) { + info_ptr->processor_level += + ((info_ptr->cpu.x86_cpu_info.version_information & 0xFF00000) >> 20); + } + +#endif // __i386__ || __x86_64_ + break; +#endif // HAS_X86_SUPPORT + default: + info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_UNKNOWN; + break; + } + + info_ptr->number_of_processors = static_cast(number_of_processors); +#if TARGET_OS_IPHONE + info_ptr->platform_id = MD_OS_IOS; +#else + info_ptr->platform_id = MD_OS_MAC_OS_X; +#endif // TARGET_OS_IPHONE + + MDLocationDescriptor build_string_loc; + + if (!writer_.WriteString(build_string_, 0, + &build_string_loc)) + return false; + + info_ptr->csd_version_rva = build_string_loc.rva; + info_ptr->major_version = os_major_version_; + info_ptr->minor_version = os_minor_version_; + info_ptr->build_number = os_build_number_; + + return true; +} + +bool MinidumpGenerator::WriteModuleStream(unsigned int index, + MDRawModule *module) { + if (dynamic_images_) { + // we're in a different process than the crashed process + DynamicImage *image = dynamic_images_->GetImage(index); + + if (!image) + return false; + + memset(module, 0, sizeof(MDRawModule)); + + MDLocationDescriptor string_location; + + string name = image->GetFilePath(); + if (!writer_.WriteString(name.c_str(), 0, &string_location)) + return false; + + module->base_of_image = image->GetVMAddr() + image->GetVMAddrSlide(); + module->size_of_image = static_cast(image->GetVMSize()); + module->module_name_rva = string_location.rva; + + // We'll skip the executable module, because they don't have + // LC_ID_DYLIB load commands, and the crash processing server gets + // version information from the Plist file, anyway. + if (index != static_cast(FindExecutableModule())) { + module->version_info.signature = MD_VSFIXEDFILEINFO_SIGNATURE; + module->version_info.struct_version |= MD_VSFIXEDFILEINFO_VERSION; + // Convert MAC dylib version format, which is a 32 bit number, to the + // format used by minidump. The mac format is <16 bits>.<8 bits>.<8 bits> + // so it fits nicely into the windows version with some massaging + // The mapping is: + // 1) upper 16 bits of MAC version go to lower 16 bits of product HI + // 2) Next most significant 8 bits go to upper 16 bits of product LO + // 3) Least significant 8 bits go to lower 16 bits of product LO + uint32_t modVersion = image->GetVersion(); + module->version_info.file_version_hi = 0; + module->version_info.file_version_hi = modVersion >> 16; + module->version_info.file_version_lo |= (modVersion & 0xff00) << 8; + module->version_info.file_version_lo |= (modVersion & 0xff); + } + + if (!WriteCVRecord(module, image->GetCPUType(), name.c_str(), false)) { + return false; + } + } else { + // Getting module info in the crashed process + const breakpad_mach_header *header; + header = (breakpad_mach_header*)_dyld_get_image_header(index); + if (!header) + return false; + +#ifdef __LP64__ + assert(header->magic == MH_MAGIC_64); + + if(header->magic != MH_MAGIC_64) + return false; +#else + assert(header->magic == MH_MAGIC); + + if(header->magic != MH_MAGIC) + return false; +#endif + + int cpu_type = header->cputype; + unsigned long slide = _dyld_get_image_vmaddr_slide(index); + const char* name = _dyld_get_image_name(index); + const struct load_command *cmd = + reinterpret_cast(header + 1); + + memset(module, 0, sizeof(MDRawModule)); + + for (unsigned int i = 0; cmd && (i < header->ncmds); i++) { + if (cmd->cmd == LC_SEGMENT_ARCH) { + + const breakpad_mach_segment_command *seg = + reinterpret_cast(cmd); + + if (!strcmp(seg->segname, "__TEXT")) { + MDLocationDescriptor string_location; + + if (!writer_.WriteString(name, 0, &string_location)) + return false; + + module->base_of_image = seg->vmaddr + slide; + module->size_of_image = static_cast(seg->vmsize); + module->module_name_rva = string_location.rva; + + bool in_memory = false; +#if TARGET_OS_IPHONE + in_memory = true; +#endif + if (!WriteCVRecord(module, cpu_type, name, in_memory)) + return false; + + return true; + } + } + + cmd = reinterpret_cast((char *)cmd + cmd->cmdsize); + } + } + + return true; +} + +int MinidumpGenerator::FindExecutableModule() { + if (dynamic_images_) { + int index = dynamic_images_->GetExecutableImageIndex(); + + if (index >= 0) { + return index; + } + } else { + int image_count = _dyld_image_count(); + const struct mach_header *header; + + for (int index = 0; index < image_count; ++index) { + header = _dyld_get_image_header(index); + + if (header->filetype == MH_EXECUTE) + return index; + } + } + + // failed - just use the first image + return 0; +} + +bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type, + const char *module_path, bool in_memory) { + TypedMDRVA cv(&writer_); + + // Only return the last path component of the full module path + const char *module_name = strrchr(module_path, '/'); + + // Increment past the slash + if (module_name) + ++module_name; + else + module_name = ""; + + size_t module_name_length = strlen(module_name); + + if (!cv.AllocateObjectAndArray(module_name_length + 1, sizeof(uint8_t))) + return false; + + if (!cv.CopyIndexAfterObject(0, module_name, module_name_length)) + return false; + + module->cv_record = cv.location(); + MDCVInfoPDB70 *cv_ptr = cv.get(); + cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE; + cv_ptr->age = 0; + + // Get the module identifier + unsigned char identifier[16]; + bool result = false; + if (in_memory) { + MacFileUtilities::MachoID macho(module_path, + reinterpret_cast(module->base_of_image), + static_cast(module->size_of_image)); + result = macho.UUIDCommand(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier); + if (!result) + result = macho.MD5(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier); + } + + if (!result) { + FileID file_id(module_path); + result = file_id.MachoIdentifier(cpu_type, CPU_SUBTYPE_MULTIPLE, + identifier); + } + + if (result) { + cv_ptr->signature.data1 = + static_cast(identifier[0]) << 24 | + static_cast(identifier[1]) << 16 | + static_cast(identifier[2]) << 8 | + static_cast(identifier[3]); + cv_ptr->signature.data2 = + static_cast(identifier[4] << 8) | identifier[5]; + cv_ptr->signature.data3 = + static_cast(identifier[6] << 8) | identifier[7]; + cv_ptr->signature.data4[0] = identifier[8]; + cv_ptr->signature.data4[1] = identifier[9]; + cv_ptr->signature.data4[2] = identifier[10]; + cv_ptr->signature.data4[3] = identifier[11]; + cv_ptr->signature.data4[4] = identifier[12]; + cv_ptr->signature.data4[5] = identifier[13]; + cv_ptr->signature.data4[6] = identifier[14]; + cv_ptr->signature.data4[7] = identifier[15]; + } + + return true; +} + +bool MinidumpGenerator::WriteModuleListStream( + MDRawDirectory *module_list_stream) { + TypedMDRVA list(&writer_); + + uint32_t image_count = dynamic_images_ ? + dynamic_images_->GetImageCount() : + _dyld_image_count(); + + if (!list.AllocateObjectAndArray(image_count, MD_MODULE_SIZE)) + return false; + + module_list_stream->stream_type = MD_MODULE_LIST_STREAM; + module_list_stream->location = list.location(); + list.get()->number_of_modules = static_cast(image_count); + + // Write out the executable module as the first one + MDRawModule module; + uint32_t executableIndex = FindExecutableModule(); + + if (!WriteModuleStream(static_cast(executableIndex), &module)) { + return false; + } + + list.CopyIndexAfterObject(0, &module, MD_MODULE_SIZE); + int destinationIndex = 1; // Write all other modules after this one + + for (uint32_t i = 0; i < image_count; ++i) { + if (i != executableIndex) { + if (!WriteModuleStream(static_cast(i), &module)) { + return false; + } + + list.CopyIndexAfterObject(destinationIndex++, &module, MD_MODULE_SIZE); + } + } + + return true; +} + +bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) { + TypedMDRVA info(&writer_); + + if (!info.Allocate()) + return false; + + misc_info_stream->stream_type = MD_MISC_INFO_STREAM; + misc_info_stream->location = info.location(); + + MDRawMiscInfo *info_ptr = info.get(); + info_ptr->size_of_info = static_cast(sizeof(MDRawMiscInfo)); + info_ptr->flags1 = MD_MISCINFO_FLAGS1_PROCESS_ID | + MD_MISCINFO_FLAGS1_PROCESS_TIMES | + MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO; + + // Process ID + info_ptr->process_id = getpid(); + + // Times + struct rusage usage; + if (getrusage(RUSAGE_SELF, &usage) != -1) { + // Omit the fractional time since the MDRawMiscInfo only wants seconds + info_ptr->process_user_time = + static_cast(usage.ru_utime.tv_sec); + info_ptr->process_kernel_time = + static_cast(usage.ru_stime.tv_sec); + } + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, + static_cast(info_ptr->process_id) }; + uint mibsize = static_cast(sizeof(mib) / sizeof(mib[0])); + struct kinfo_proc proc; + size_t size = sizeof(proc); + if (sysctl(mib, mibsize, &proc, &size, NULL, 0) == 0) { + info_ptr->process_create_time = + static_cast(proc.kp_proc.p_starttime.tv_sec); + } + + // Speed + uint64_t speed; + const uint64_t kOneMillion = 1000 * 1000; + size = sizeof(speed); + sysctlbyname("hw.cpufrequency_max", &speed, &size, NULL, 0); + info_ptr->processor_max_mhz = static_cast(speed / kOneMillion); + info_ptr->processor_mhz_limit = static_cast(speed / kOneMillion); + size = sizeof(speed); + sysctlbyname("hw.cpufrequency", &speed, &size, NULL, 0); + info_ptr->processor_current_mhz = static_cast(speed / kOneMillion); + + return true; +} + +bool MinidumpGenerator::WriteBreakpadInfoStream( + MDRawDirectory *breakpad_info_stream) { + TypedMDRVA info(&writer_); + + if (!info.Allocate()) + return false; + + breakpad_info_stream->stream_type = MD_BREAKPAD_INFO_STREAM; + breakpad_info_stream->location = info.location(); + MDRawBreakpadInfo *info_ptr = info.get(); + + if (exception_thread_ && exception_type_) { + info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID | + MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID; + info_ptr->dump_thread_id = handler_thread_; + info_ptr->requesting_thread_id = exception_thread_; + } else { + info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID; + info_ptr->dump_thread_id = handler_thread_; + info_ptr->requesting_thread_id = 0; + } + + return true; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h b/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h new file mode 100644 index 0000000000..4e4b4a6848 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h @@ -0,0 +1,236 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// minidump_generator.h: Create a minidump of the current MacOS process. + +#ifndef CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__ +#define CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__ + +#include +#include + +#include + +#include "client/mac/handler/ucontext_compat.h" +#include "client/minidump_file_writer.h" +#include "common/memory.h" +#include "common/mac/macho_utilities.h" +#include "google_breakpad/common/minidump_format.h" + +#include "dynamic_images.h" +#include "mach_vm_compat.h" + +#if !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) + #define HAS_PPC_SUPPORT +#endif +#if defined(__arm__) +#define HAS_ARM_SUPPORT +#elif defined(__aarch64__) +#define HAS_ARM64_SUPPORT +#elif defined(__i386__) || defined(__x86_64__) + #define HAS_X86_SUPPORT +#endif + +namespace google_breakpad { + +using std::string; + +// Use the REGISTER_FROM_THREADSTATE to access a register name from the +// breakpad_thread_state_t structure. +#if __DARWIN_UNIX03 || TARGET_CPU_X86_64 || TARGET_CPU_PPC64 || TARGET_CPU_ARM +// In The 10.5 SDK Headers Apple prepended __ to the variable names in the +// i386_thread_state_t structure. There's no good way to tell what version of +// the SDK we're compiling against so we just toggle on the same preprocessor +// symbol Apple's headers use. +#define REGISTER_FROM_THREADSTATE(a, b) ((a)->__ ## b) +#else +#define REGISTER_FROM_THREADSTATE(a, b) (a->b) +#endif + +// Creates a minidump file of the current process. If there is exception data, +// use SetExceptionInformation() to add this to the minidump. The minidump +// file is generated by the Write() function. +// Usage: +// MinidumpGenerator minidump(); +// minidump.Write("/tmp/minidump"); +// +class MinidumpGenerator { + public: + MinidumpGenerator(); + MinidumpGenerator(mach_port_t crashing_task, mach_port_t handler_thread); + + virtual ~MinidumpGenerator(); + + // Return /.dmp + // Sets |unique_name| (if requested) to the unique name for the minidump + static string UniqueNameInDirectory(const string &dir, string *unique_name); + + // Write out the minidump into |path| + // All of the components of |path| must exist and be writable + // Return true if successful, false otherwise + bool Write(const char *path); + + // Specify some exception information, if applicable + void SetExceptionInformation(int type, int code, int subcode, + mach_port_t thread_name) { + exception_type_ = type; + exception_code_ = code; + exception_subcode_ = subcode; + exception_thread_ = thread_name; + } + + // Specify the task context. If |task_context| is not NULL, it will be used + // to retrieve the context of the current thread, instead of using + // |thread_get_state|. + void SetTaskContext(breakpad_ucontext_t *task_context); + + // Gather system information. This should be call at least once before using + // the MinidumpGenerator class. + static void GatherSystemInformation(); + + protected: + // Overridable Stream writers + virtual bool WriteExceptionStream(MDRawDirectory *exception_stream); + + // Overridable Helper + virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread); + + private: + typedef bool (MinidumpGenerator::*WriteStreamFN)(MDRawDirectory *); + + // Stream writers + bool WriteThreadListStream(MDRawDirectory *thread_list_stream); + bool WriteMemoryListStream(MDRawDirectory *memory_list_stream); + bool WriteSystemInfoStream(MDRawDirectory *system_info_stream); + bool WriteModuleListStream(MDRawDirectory *module_list_stream); + bool WriteMiscInfoStream(MDRawDirectory *misc_info_stream); + bool WriteBreakpadInfoStream(MDRawDirectory *breakpad_info_stream); + + // Helpers + uint64_t CurrentPCForStack(breakpad_thread_state_data_t state); + bool GetThreadState(thread_act_t target_thread, thread_state_t state, + mach_msg_type_number_t *count); + bool WriteStackFromStartAddress(mach_vm_address_t start_addr, + MDMemoryDescriptor *stack_location); + bool WriteStack(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContext(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + bool WriteCVRecord(MDRawModule *module, int cpu_type, + const char *module_path, bool in_memory); + bool WriteModuleStream(unsigned int index, MDRawModule *module); + size_t CalculateStackSize(mach_vm_address_t start_addr); + int FindExecutableModule(); + + // Per-CPU implementations of these methods +#ifdef HAS_ARM_SUPPORT + bool WriteStackARM(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContextARM(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + uint64_t CurrentPCForStackARM(breakpad_thread_state_data_t state); +#endif +#ifdef HAS_ARM64_SUPPORT + bool WriteStackARM64(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContextARM64(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + uint64_t CurrentPCForStackARM64(breakpad_thread_state_data_t state); +#endif +#ifdef HAS_PPC_SUPPORT + bool WriteStackPPC(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContextPPC(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + uint64_t CurrentPCForStackPPC(breakpad_thread_state_data_t state); + bool WriteStackPPC64(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContextPPC64(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + uint64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state); +#endif +#ifdef HAS_X86_SUPPORT + bool WriteStackX86(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContextX86(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + uint64_t CurrentPCForStackX86(breakpad_thread_state_data_t state); + bool WriteStackX86_64(breakpad_thread_state_data_t state, + MDMemoryDescriptor *stack_location); + bool WriteContextX86_64(breakpad_thread_state_data_t state, + MDLocationDescriptor *register_location); + uint64_t CurrentPCForStackX86_64(breakpad_thread_state_data_t state); +#endif + + // disallow copy ctor and operator= + explicit MinidumpGenerator(const MinidumpGenerator &); + void operator=(const MinidumpGenerator &); + + protected: + // Use this writer to put the data to disk + MinidumpFileWriter writer_; + + private: + // Exception information + int exception_type_; + int exception_code_; + int exception_subcode_; + mach_port_t exception_thread_; + mach_port_t crashing_task_; + mach_port_t handler_thread_; + + // CPU type of the task being dumped. + cpu_type_t cpu_type_; + + // System information + static char build_string_[16]; + static int os_major_version_; + static int os_minor_version_; + static int os_build_number_; + + // Context of the task to dump. + breakpad_ucontext_t *task_context_; + + // Information about dynamically loaded code + DynamicImages *dynamic_images_; + + // PageAllocator makes it possible to allocate memory + // directly from the system, even while handling an exception. + mutable PageAllocator allocator_; + + protected: + // Blocks of memory written to the dump. These are all currently + // written while writing the thread list stream, but saved here + // so a memory list stream can be written afterwards. + wasteful_vector memory_blocks_; +}; + +} // namespace google_breakpad + +#endif // CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h b/Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h new file mode 100644 index 0000000000..1e4b752e51 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h @@ -0,0 +1,47 @@ +// Copyright 2013 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ +#define CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ + +#include + +// The purpose of this file is to work around the fact that ucontext_t's +// uc_mcontext member is an mcontext_t rather than an mcontext64_t on ARM64. +#if defined(__aarch64__) +// doesn't include the below file. +#include +typedef ucontext64_t breakpad_ucontext_t; +#define breakpad_uc_mcontext uc_mcontext64 +#else +typedef ucontext_t breakpad_ucontext_t; +#define breakpad_uc_mcontext uc_mcontext +#endif // defined(__aarch64__) + +#endif // CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h b/Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h new file mode 100644 index 0000000000..0e12e00b69 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h @@ -0,0 +1,97 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// minidump_file_writer-inl.h: Minidump file writer implementation. +// +// See minidump_file_writer.h for documentation. + +#ifndef CLIENT_MINIDUMP_FILE_WRITER_INL_H__ +#define CLIENT_MINIDUMP_FILE_WRITER_INL_H__ + +#include + +#include "client/minidump_file_writer.h" +#include "google_breakpad/common/minidump_size.h" + +namespace google_breakpad { + +template +inline bool TypedMDRVA::Allocate() { + allocation_state_ = SINGLE_OBJECT; + return UntypedMDRVA::Allocate(minidump_size::size()); +} + +template +inline bool TypedMDRVA::Allocate(size_t additional) { + allocation_state_ = SINGLE_OBJECT; + return UntypedMDRVA::Allocate(minidump_size::size() + additional); +} + +template +inline bool TypedMDRVA::AllocateArray(size_t count) { + assert(count); + allocation_state_ = ARRAY; + return UntypedMDRVA::Allocate(minidump_size::size() * count); +} + +template +inline bool TypedMDRVA::AllocateObjectAndArray(size_t count, + size_t length) { + assert(count && length); + allocation_state_ = SINGLE_OBJECT_WITH_ARRAY; + return UntypedMDRVA::Allocate(minidump_size::size() + count * length); +} + +template +inline bool TypedMDRVA::CopyIndex(unsigned int index, MDType *item) { + assert(allocation_state_ == ARRAY); + return writer_->Copy( + static_cast(position_ + index * minidump_size::size()), + item, minidump_size::size()); +} + +template +inline bool TypedMDRVA::CopyIndexAfterObject(unsigned int index, + const void *src, + size_t length) { + assert(allocation_state_ == SINGLE_OBJECT_WITH_ARRAY); + return writer_->Copy( + static_cast(position_ + minidump_size::size() + + index * length), + src, length); +} + +template +inline bool TypedMDRVA::Flush() { + return writer_->Copy(position_, &data_, minidump_size::size()); +} + +} // namespace google_breakpad + +#endif // CLIENT_MINIDUMP_FILE_WRITER_INL_H__ diff --git a/Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc b/Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc new file mode 100644 index 0000000000..a1957f324a --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc @@ -0,0 +1,350 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// minidump_file_writer.cc: Minidump file writer implementation. +// +// See minidump_file_writer.h for documentation. + +#include +#include +#include +#include +#include + +#include "client/minidump_file_writer-inl.h" +#include "common/linux/linux_libc_support.h" +#include "common/string_conversion.h" +#if defined(__linux__) && __linux__ +#include "third_party/lss/linux_syscall_support.h" +#endif + +#if defined(__ANDROID__) +#include + +namespace { + +bool g_need_ftruncate_workaround = false; +bool g_checked_need_ftruncate_workaround = false; + +void CheckNeedsFTruncateWorkAround(int file) { + if (g_checked_need_ftruncate_workaround) { + return; + } + g_checked_need_ftruncate_workaround = true; + + // Attempt an idempotent truncate that chops off nothing and see if we + // run into any sort of errors. + off_t offset = sys_lseek(file, 0, SEEK_END); + if (offset == -1) { + // lseek failed. Don't apply work around. It's unlikely that we can write + // to a minidump with either method. + return; + } + + int result = ftruncate(file, offset); + if (result == -1 && errno == EACCES) { + // It very likely that we are running into the kernel bug in M devices. + // We are going to deploy the workaround for writing minidump files + // without uses of ftruncate(). This workaround should be fine even + // for kernels without the bug. + // See http://crbug.com/542840 for more details. + g_need_ftruncate_workaround = true; + } +} + +bool NeedsFTruncateWorkAround() { + return g_need_ftruncate_workaround; +} + +} // namespace +#endif // defined(__ANDROID__) + +namespace google_breakpad { + +const MDRVA MinidumpFileWriter::kInvalidMDRVA = static_cast(-1); + +MinidumpFileWriter::MinidumpFileWriter() + : file_(-1), + close_file_when_destroyed_(true), + position_(0), + size_(0) { +} + +MinidumpFileWriter::~MinidumpFileWriter() { + if (close_file_when_destroyed_) + Close(); +} + +bool MinidumpFileWriter::Open(const char *path) { + assert(file_ == -1); +#if defined(__linux__) && __linux__ + file_ = sys_open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); +#else + file_ = open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); +#endif + + return file_ != -1; +} + +void MinidumpFileWriter::SetFile(const int file) { + assert(file_ == -1); + file_ = file; + close_file_when_destroyed_ = false; +#if defined(__ANDROID__) + CheckNeedsFTruncateWorkAround(file); +#endif +} + +bool MinidumpFileWriter::Close() { + bool result = true; + + if (file_ != -1) { +#if defined(__ANDROID__) + if (!NeedsFTruncateWorkAround() && ftruncate(file_, position_)) { + return false; + } +#else + if (ftruncate(file_, position_)) { + return false; + } +#endif +#if defined(__linux__) && __linux__ + result = (sys_close(file_) == 0); +#else + result = (close(file_) == 0); +#endif + file_ = -1; + } + + return result; +} + +bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str, + unsigned int length, + TypedMDRVA *mdstring) { + bool result = true; + if (sizeof(wchar_t) == sizeof(uint16_t)) { + // Shortcut if wchar_t is the same size as MDString's buffer + result = mdstring->Copy(str, mdstring->get()->length); + } else { + uint16_t out[2]; + int out_idx = 0; + + // Copy the string character by character + while (length && result) { + UTF32ToUTF16Char(*str, out); + if (!out[0]) + return false; + + // Process one character at a time + --length; + ++str; + + // Append the one or two UTF-16 characters. The first one will be non- + // zero, but the second one may be zero, depending on the conversion from + // UTF-32. + int out_count = out[1] ? 2 : 1; + size_t out_size = sizeof(uint16_t) * out_count; + result = mdstring->CopyIndexAfterObject(out_idx, out, out_size); + out_idx += out_count; + } + } + return result; +} + +bool MinidumpFileWriter::CopyStringToMDString(const char *str, + unsigned int length, + TypedMDRVA *mdstring) { + bool result = true; + uint16_t out[2]; + int out_idx = 0; + + // Copy the string character by character + while (length && result) { + int conversion_count = UTF8ToUTF16Char(str, length, out); + if (!conversion_count) + return false; + + // Move the pointer along based on the nubmer of converted characters + length -= conversion_count; + str += conversion_count; + + // Append the one or two UTF-16 characters + int out_count = out[1] ? 2 : 1; + size_t out_size = sizeof(uint16_t) * out_count; + result = mdstring->CopyIndexAfterObject(out_idx, out, out_size); + out_idx += out_count; + } + return result; +} + +template +bool MinidumpFileWriter::WriteStringCore(const CharType *str, + unsigned int length, + MDLocationDescriptor *location) { + assert(str); + assert(location); + // Calculate the mdstring length by either limiting to |length| as passed in + // or by finding the location of the NULL character. + unsigned int mdstring_length = 0; + if (!length) + length = INT_MAX; + for (; mdstring_length < length && str[mdstring_length]; ++mdstring_length) + ; + + // Allocate the string buffer + TypedMDRVA mdstring(this); + if (!mdstring.AllocateObjectAndArray(mdstring_length + 1, sizeof(uint16_t))) + return false; + + // Set length excluding the NULL and copy the string + mdstring.get()->length = + static_cast(mdstring_length * sizeof(uint16_t)); + bool result = CopyStringToMDString(str, mdstring_length, &mdstring); + + // NULL terminate + if (result) { + uint16_t ch = 0; + result = mdstring.CopyIndexAfterObject(mdstring_length, &ch, sizeof(ch)); + + if (result) + *location = mdstring.location(); + } + + return result; +} + +bool MinidumpFileWriter::WriteString(const wchar_t *str, unsigned int length, + MDLocationDescriptor *location) { + return WriteStringCore(str, length, location); +} + +bool MinidumpFileWriter::WriteString(const char *str, unsigned int length, + MDLocationDescriptor *location) { + return WriteStringCore(str, length, location); +} + +bool MinidumpFileWriter::WriteMemory(const void *src, size_t size, + MDMemoryDescriptor *output) { + assert(src); + assert(output); + UntypedMDRVA mem(this); + + if (!mem.Allocate(size)) + return false; + if (!mem.Copy(src, mem.size())) + return false; + + output->start_of_memory_range = reinterpret_cast(src); + output->memory = mem.location(); + + return true; +} + +MDRVA MinidumpFileWriter::Allocate(size_t size) { + assert(size); + assert(file_ != -1); +#if defined(__ANDROID__) + if (NeedsFTruncateWorkAround()) { + // If ftruncate() is not available. We simply increase the size beyond the + // current file size. sys_write() will expand the file when data is written + // to it. Because we did not over allocate to fit memory pages, we also + // do not need to ftruncate() the file once we are done. + size_ += size; + + // We don't need to seek since the file is unchanged. + MDRVA current_position = position_; + position_ += static_cast(size); + return current_position; + } +#endif + size_t aligned_size = (size + 7) & ~7; // 64-bit alignment + + if (position_ + aligned_size > size_) { + size_t growth = aligned_size; + size_t minimal_growth = getpagesize(); + + // Ensure that the file grows by at least the size of a memory page + if (growth < minimal_growth) + growth = minimal_growth; + + size_t new_size = size_ + growth; + if (ftruncate(file_, new_size) != 0) + return kInvalidMDRVA; + + size_ = new_size; + } + + MDRVA current_position = position_; + position_ += static_cast(aligned_size); + + return current_position; +} + +bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) { + assert(src); + assert(size); + assert(file_ != -1); + + // Ensure that the data will fit in the allocated space + if (static_cast(size + position) > size_) + return false; + + // Seek and write the data +#if defined(__linux__) && __linux__ + if (sys_lseek(file_, position, SEEK_SET) == static_cast(position)) { + if (sys_write(file_, src, size) == size) { + return true; + } + } +#else + if (lseek(file_, position, SEEK_SET) == static_cast(position)) { + if (write(file_, src, size) == size) { + return true; + } + } +#endif + return false; +} + +bool UntypedMDRVA::Allocate(size_t size) { + assert(size_ == 0); + size_ = size; + position_ = writer_->Allocate(size_); + return position_ != MinidumpFileWriter::kInvalidMDRVA; +} + +bool UntypedMDRVA::Copy(MDRVA pos, const void *src, size_t size) { + assert(src); + assert(size); + assert(pos + size <= position_ + size_); + return writer_->Copy(pos, src, size); +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/minidump_file_writer.h b/Telegram/ThirdParty/breakpad/client/minidump_file_writer.h new file mode 100644 index 0000000000..ce32b6d087 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/client/minidump_file_writer.h @@ -0,0 +1,272 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// minidump_file_writer.h: Implements file-based minidump generation. It's +// intended to be used with the Google Breakpad open source crash handling +// project. + +#ifndef CLIENT_MINIDUMP_FILE_WRITER_H__ +#define CLIENT_MINIDUMP_FILE_WRITER_H__ + +#include + +#include "google_breakpad/common/minidump_format.h" + +namespace google_breakpad { + +class UntypedMDRVA; +template class TypedMDRVA; + +// The user of this class can Open() a file and add minidump streams, data, and +// strings using the definitions in minidump_format.h. Since this class is +// expected to be used in a situation where the current process may be +// damaged, it will not allocate heap memory. +// Sample usage: +// MinidumpFileWriter writer; +// writer.Open("/tmp/minidump.dmp"); +// TypedMDRVA header(&writer_); +// header.Allocate(); +// header->get()->signature = MD_HEADER_SIGNATURE; +// : +// writer.Close(); +// +// An alternative is to use SetFile and provide a file descriptor: +// MinidumpFileWriter writer; +// writer.SetFile(minidump_fd); +// TypedMDRVA header(&writer_); +// header.Allocate(); +// header->get()->signature = MD_HEADER_SIGNATURE; +// : +// writer.Close(); + +class MinidumpFileWriter { +public: + // Invalid MDRVA (Minidump Relative Virtual Address) + // returned on failed allocation + static const MDRVA kInvalidMDRVA; + + MinidumpFileWriter(); + ~MinidumpFileWriter(); + + // Open |path| as the destination of the minidump data. If |path| already + // exists, then Open() will fail. + // Return true on success, or false on failure. + bool Open(const char *path); + + // Sets the file descriptor |file| as the destination of the minidump data. + // Can be used as an alternative to Open() when a file descriptor is + // available. + // Note that |fd| is not closed when the instance of MinidumpFileWriter is + // destroyed. + void SetFile(const int file); + + // Close the current file (that was either created when Open was called, or + // specified with SetFile). + // Return true on success, or false on failure. + bool Close(); + + // Copy the contents of |str| to a MDString and write it to the file. + // |str| is expected to be either UTF-16 or UTF-32 depending on the size + // of wchar_t. + // Maximum |length| of characters to copy from |str|, or specify 0 to use the + // entire NULL terminated string. Copying will stop at the first NULL. + // |location| the allocated location + // Return true on success, or false on failure + bool WriteString(const wchar_t *str, unsigned int length, + MDLocationDescriptor *location); + + // Same as above, except with |str| as a UTF-8 string + bool WriteString(const char *str, unsigned int length, + MDLocationDescriptor *location); + + // Write |size| bytes starting at |src| into the current position. + // Return true on success and set |output| to position, or false on failure + bool WriteMemory(const void *src, size_t size, MDMemoryDescriptor *output); + + // Copies |size| bytes from |src| to |position| + // Return true on success, or false on failure + bool Copy(MDRVA position, const void *src, ssize_t size); + + // Return the current position for writing to the minidump + inline MDRVA position() const { return position_; } + + private: + friend class UntypedMDRVA; + + // Allocates an area of |size| bytes. + // Returns the position of the allocation, or kInvalidMDRVA if it was + // unable to allocate the bytes. + MDRVA Allocate(size_t size); + + // The file descriptor for the output file. + int file_; + + // Whether |file_| should be closed when the instance is destroyed. + bool close_file_when_destroyed_; + + // Current position in buffer + MDRVA position_; + + // Current allocated size + size_t size_; + + // Copy |length| characters from |str| to |mdstring|. These are distinct + // because the underlying MDString is a UTF-16 based string. The wchar_t + // variant may need to create a MDString that has more characters than the + // source |str|, whereas the UTF-8 variant may coalesce characters to form + // a single UTF-16 character. + bool CopyStringToMDString(const wchar_t *str, unsigned int length, + TypedMDRVA *mdstring); + bool CopyStringToMDString(const char *str, unsigned int length, + TypedMDRVA *mdstring); + + // The common templated code for writing a string + template + bool WriteStringCore(const CharType *str, unsigned int length, + MDLocationDescriptor *location); +}; + +// Represents an untyped allocated chunk +class UntypedMDRVA { + public: + explicit UntypedMDRVA(MinidumpFileWriter *writer) + : writer_(writer), + position_(writer->position()), + size_(0) {} + + // Allocates |size| bytes. Must not call more than once. + // Return true on success, or false on failure + bool Allocate(size_t size); + + // Returns the current position or kInvalidMDRVA if allocation failed + inline MDRVA position() const { return position_; } + + // Number of bytes allocated + inline size_t size() const { return size_; } + + // Return size and position + inline MDLocationDescriptor location() const { + MDLocationDescriptor location = { static_cast(size_), + position_ }; + return location; + } + + // Copy |size| bytes starting at |src| into the minidump at |position| + // Return true on success, or false on failure + bool Copy(MDRVA position, const void *src, size_t size); + + // Copy |size| bytes from |src| to the current position + inline bool Copy(const void *src, size_t size) { + return Copy(position_, src, size); + } + + protected: + // Writer we associate with + MinidumpFileWriter *writer_; + + // Position of the start of the data + MDRVA position_; + + // Allocated size + size_t size_; +}; + +// Represents a Minidump object chunk. Additional memory can be allocated at +// the end of the object as a: +// - single allocation +// - Array of MDType objects +// - A MDType object followed by an array +template +class TypedMDRVA : public UntypedMDRVA { + public: + // Constructs an unallocated MDRVA + explicit TypedMDRVA(MinidumpFileWriter *writer) + : UntypedMDRVA(writer), + data_(), + allocation_state_(UNALLOCATED) {} + + inline ~TypedMDRVA() { + // Ensure that the data_ object is written out + if (allocation_state_ != ARRAY) + Flush(); + } + + // Address of object data_ of MDType. This is not declared const as the + // typical usage will be to access the underlying |data_| object as to + // alter its contents. + MDType *get() { return &data_; } + + // Allocates minidump_size::size() bytes. + // Must not call more than once. + // Return true on success, or false on failure + bool Allocate(); + + // Allocates minidump_size::size() + |additional| bytes. + // Must not call more than once. + // Return true on success, or false on failure + bool Allocate(size_t additional); + + // Allocate an array of |count| elements of MDType. + // Must not call more than once. + // Return true on success, or false on failure + bool AllocateArray(size_t count); + + // Allocate an array of |count| elements of |size| after object of MDType + // Must not call more than once. + // Return true on success, or false on failure + bool AllocateObjectAndArray(size_t count, size_t size); + + // Copy |item| to |index| + // Must have been allocated using AllocateArray(). + // Return true on success, or false on failure + bool CopyIndex(unsigned int index, MDType *item); + + // Copy |size| bytes starting at |str| to |index| + // Must have been allocated using AllocateObjectAndArray(). + // Return true on success, or false on failure + bool CopyIndexAfterObject(unsigned int index, const void *src, size_t size); + + // Write data_ + bool Flush(); + + private: + enum AllocationState { + UNALLOCATED = 0, + SINGLE_OBJECT, + ARRAY, + SINGLE_OBJECT_WITH_ARRAY + }; + + MDType data_; + AllocationState allocation_state_; +}; + +} // namespace google_breakpad + +#endif // CLIENT_MINIDUMP_FILE_WRITER_H__ diff --git a/Telegram/ThirdParty/breakpad/common/convert_UTF.c b/Telegram/ThirdParty/breakpad/common/convert_UTF.c new file mode 100644 index 0000000000..12a3c89174 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/convert_UTF.c @@ -0,0 +1,554 @@ +/* + * Copyright © 1991-2015 Unicode, Inc. All rights reserved. + * Distributed under the Terms of Use in + * http://www.unicode.org/copyright.html. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of the Unicode data files and any associated documentation + * (the "Data Files") or Unicode software and any associated documentation + * (the "Software") to deal in the Data Files or Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, and/or sell copies of + * the Data Files or Software, and to permit persons to whom the Data Files + * or Software are furnished to do so, provided that + * (a) this copyright and permission notice appear with all copies + * of the Data Files or Software, + * (b) this copyright and permission notice appear in associated + * documentation, and + * (c) there is clear notice in each modified Data File or in the Software + * as well as in the documentation associated with the Data File(s) or + * Software that the data or software has been modified. + * + * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THE DATA FILES OR SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in these Data Files or Software without prior + * written authorization of the copyright holder. + */ + +/* --------------------------------------------------------------------- + +Conversions between UTF32, UTF-16, and UTF-8. Source code file. +Author: Mark E. Davis, 1994. +Rev History: Rick McGowan, fixes & updates May 2001. +Sept 2001: fixed const & error conditions per +mods suggested by S. Parent & A. Lillich. +June 2002: Tim Dodd added detection and handling of incomplete +source sequences, enhanced error detection, added casts +to eliminate compiler warnings. +July 2003: slight mods to back out aggressive FFFE detection. +Jan 2004: updated switches in from-UTF8 conversions. +Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. + +See the header file "ConvertUTF.h" for complete documentation. + +------------------------------------------------------------------------ */ + + +#include "convert_UTF.h" +#ifdef CVTUTF_DEBUG +#include +#endif + +static const int halfShift = 10; /* used for shifting by 10 bits */ + +static const UTF32 halfBase = 0x0010000UL; +static const UTF32 halfMask = 0x3FFUL; + +#define UNI_SUR_HIGH_START (UTF32)0xD800 +#define UNI_SUR_HIGH_END (UTF32)0xDBFF +#define UNI_SUR_LOW_START (UTF32)0xDC00 +#define UNI_SUR_LOW_END (UTF32)0xDFFF + +#ifndef false +#define false 0 +#endif +#ifndef true +#define true 1 +#endif + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF32* source = *sourceStart; + UTF16* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + if (target >= targetEnd) { + result = targetExhausted; break; + } + ch = *source++; + if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ + /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == strictConversion) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + *target++ = (UTF16)ch; /* normal case */ + } + } else if (ch > UNI_MAX_LEGAL_UTF32) { + if (flags == strictConversion) { + result = sourceIllegal; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + /* target is a character in range 0xFFFF - 0x10FFFF. */ + if (target + 1 >= targetEnd) { + --source; /* Back up source pointer! */ + result = targetExhausted; break; + } + ch -= halfBase; + *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); + *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); + } + } +*sourceStart = source; +*targetStart = target; +return result; +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF16* source = *sourceStart; + UTF32* target = *targetStart; + UTF32 ch, ch2; + while (source < sourceEnd) { + const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ + ch = *source++; + /* If we have a surrogate pair, convert to UTF32 first. */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + /* If the 16 bits following the high surrogate are in the source buffer... */ + if (source < sourceEnd) { + ch2 = *source; + /* If it's a low surrogate, convert to UTF32. */ + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + ++source; + } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } else { /* We don't have the 16 bits following the high surrogate. */ + --source; /* return to the high surrogate */ + result = sourceExhausted; + break; + } + } else if (flags == strictConversion) { + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } + if (target >= targetEnd) { + source = oldSource; /* Back up source pointer! */ + result = targetExhausted; break; + } + *target++ = ch; + } + *sourceStart = source; + *targetStart = target; +#ifdef CVTUTF_DEBUG + if (result == sourceIllegal) { + fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); + fflush(stderr); + } +#endif + return result; +} + +/* --------------------------------------------------------------------- */ + +/* + * Index into the table below with the first byte of a UTF-8 sequence to + * get the number of trailing bytes that are supposed to follow it. + * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is + * left as-is for anyone who may want to do such conversion, which was + * allowed in earlier algorithms. + */ +static const char trailingBytesForUTF8[256] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 +}; + +/* + * Magic values subtracted from a buffer value during UTF8 conversion. + * This table contains as many values as there might be trailing bytes + * in a UTF-8 sequence. + */ +static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, + 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; + +/* + * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed + * into the first byte, depending on how many bytes follow. There are + * as many entries in this table as there are UTF-8 sequence types. + * (I.e., one byte sequence, two byte... etc.). Remember that sequencs + * for *legal* UTF-8 will be 4 or fewer bytes total. + */ +static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + +/* --------------------------------------------------------------------- */ + +/* The interface converts a whole buffer to avoid function-call overhead. +* Constants have been gathered. Loops & conditionals have been removed as +* much as possible for efficiency, in favor of drop-through switches. +* (See "Note A" at the bottom of the file for equivalent code.) +* If your compiler supports it, the "isLegalUTF8" call can be turned +* into an inline function. +*/ + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF16* source = *sourceStart; + UTF8* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + unsigned short bytesToWrite = 0; + const UTF32 byteMask = 0xBF; + const UTF32 byteMark = 0x80; + const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ + ch = *source++; + /* If we have a surrogate pair, convert to UTF32 first. */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + /* If the 16 bits following the high surrogate are in the source buffer... */ + if (source < sourceEnd) { + UTF32 ch2 = *source; + /* If it's a low surrogate, convert to UTF32. */ + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + ++source; + } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } else { /* We don't have the 16 bits following the high surrogate. */ + --source; /* return to the high surrogate */ + result = sourceExhausted; + break; + } + } else if (flags == strictConversion) { + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } + /* Figure out how many bytes the result will require */ + if (ch < (UTF32)0x80) { bytesToWrite = 1; + } else if (ch < (UTF32)0x800) { bytesToWrite = 2; + } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; + } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; + } else { bytesToWrite = 3; + ch = UNI_REPLACEMENT_CHAR; + } + + target += bytesToWrite; + if (target > targetEnd) { + source = oldSource; /* Back up source pointer! */ + target -= bytesToWrite; result = targetExhausted; break; + } + switch (bytesToWrite) { /* note: everything falls through. */ + case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); + } + target += bytesToWrite; + } +*sourceStart = source; +*targetStart = target; +return result; +} + +/* --------------------------------------------------------------------- */ + +/* + * Utility routine to tell whether a sequence of bytes is legal UTF-8. + * This must be called with the length pre-determined by the first byte. + * If not calling this from ConvertUTF8to*, then the length can be set by: + * length = trailingBytesForUTF8[*source]+1; + * and the sequence is illegal right away if there aren't that many bytes + * available. + * If presented with a length > 4, this returns false. The Unicode + * definition of UTF-8 goes up to 4-byte sequences. + */ + +static Boolean isLegalUTF8(const UTF8 *source, int length) { + UTF8 a; + const UTF8 *srcptr = source+length; + switch (length) { + default: return false; + /* Everything else falls through when "true"... */ + case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; + case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; + case 2: if ((a = (*--srcptr)) > 0xBF) return false; + + switch (*source) { + /* no fall-through in this inner switch */ + case 0xE0: if (a < 0xA0) return false; break; + case 0xED: if (a > 0x9F) return false; break; + case 0xF0: if (a < 0x90) return false; break; + case 0xF4: if (a > 0x8F) return false; break; + default: if (a < 0x80) return false; + } + + case 1: if (*source >= 0x80 && *source < 0xC2) return false; + } + if (*source > 0xF4) return false; + return true; +} + +/* --------------------------------------------------------------------- */ + +/* + * Exported function to return whether a UTF-8 sequence is legal or not. + * This is not used here; it's just exported. + */ +Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { + int length = trailingBytesForUTF8[*source]+1; + if (source+length > sourceEnd) { + return false; + } + return isLegalUTF8(source, length); +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF8* source = *sourceStart; + UTF16* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch = 0; + unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + if (source + extraBytesToRead >= sourceEnd) { + result = sourceExhausted; break; + } + /* Do this check whether lenient or strict */ + if (! isLegalUTF8(source, extraBytesToRead+1)) { + result = sourceIllegal; + break; + } + /* + * The cases all fall through. See "Note A" below. + */ + switch (extraBytesToRead) { + case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ + case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ + case 3: ch += *source++; ch <<= 6; + case 2: ch += *source++; ch <<= 6; + case 1: ch += *source++; ch <<= 6; + case 0: ch += *source++; + } + ch -= offsetsFromUTF8[extraBytesToRead]; + + if (target >= targetEnd) { + source -= (extraBytesToRead+1); /* Back up source pointer! */ + result = targetExhausted; break; + } + if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == strictConversion) { + source -= (extraBytesToRead+1); /* return to the illegal value itself */ + result = sourceIllegal; + break; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + *target++ = (UTF16)ch; /* normal case */ + } + } else if (ch > UNI_MAX_UTF16) { + if (flags == strictConversion) { + result = sourceIllegal; + source -= (extraBytesToRead+1); /* return to the start */ + break; /* Bail out; shouldn't continue */ + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + /* target is a character in range 0xFFFF - 0x10FFFF. */ + if (target + 1 >= targetEnd) { + source -= (extraBytesToRead+1); /* Back up source pointer! */ + result = targetExhausted; break; + } + ch -= halfBase; + *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); + *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); + } + } +*sourceStart = source; +*targetStart = target; +return result; +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF32* source = *sourceStart; + UTF8* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + unsigned short bytesToWrite = 0; + const UTF32 byteMask = 0xBF; + const UTF32 byteMark = 0x80; + ch = *source++; + if (flags == strictConversion ) { + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } + /* + * Figure out how many bytes the result will require. Turn any + * illegally large UTF32 things (> Plane 17) into replacement chars. + */ + if (ch < (UTF32)0x80) { bytesToWrite = 1; + } else if (ch < (UTF32)0x800) { bytesToWrite = 2; + } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; + } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; + } else { bytesToWrite = 3; + ch = UNI_REPLACEMENT_CHAR; + result = sourceIllegal; + } + + target += bytesToWrite; + if (target > targetEnd) { + --source; /* Back up source pointer! */ + target -= bytesToWrite; result = targetExhausted; break; + } + switch (bytesToWrite) { /* note: everything falls through. */ + case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); + } + target += bytesToWrite; + } +*sourceStart = source; +*targetStart = target; +return result; +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF8* source = *sourceStart; + UTF32* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch = 0; + unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + if (source + extraBytesToRead >= sourceEnd) { + result = sourceExhausted; break; + } + /* Do this check whether lenient or strict */ + if (! isLegalUTF8(source, extraBytesToRead+1)) { + result = sourceIllegal; + break; + } + /* + * The cases all fall through. See "Note A" below. + */ + switch (extraBytesToRead) { + case 5: ch += *source++; ch <<= 6; + case 4: ch += *source++; ch <<= 6; + case 3: ch += *source++; ch <<= 6; + case 2: ch += *source++; ch <<= 6; + case 1: ch += *source++; ch <<= 6; + case 0: ch += *source++; + } + ch -= offsetsFromUTF8[extraBytesToRead]; + + if (target >= targetEnd) { + source -= (extraBytesToRead+1); /* Back up the source pointer! */ + result = targetExhausted; break; + } + if (ch <= UNI_MAX_LEGAL_UTF32) { + /* + * UTF-16 surrogate values are illegal in UTF-32, and anything + * over Plane 17 (> 0x10FFFF) is illegal. + */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == strictConversion) { + source -= (extraBytesToRead+1); /* return to the illegal value itself */ + result = sourceIllegal; + break; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + *target++ = ch; + } + } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ + result = sourceIllegal; + *target++ = UNI_REPLACEMENT_CHAR; + } + } + *sourceStart = source; + *targetStart = target; + return result; +} + +/* --------------------------------------------------------------------- + +Note A. +The fall-through switches in UTF-8 reading code save a +temp variable, some decrements & conditionals. The switches +are equivalent to the following loop: +{ + int tmpBytesToRead = extraBytesToRead+1; + do { + ch += *source++; + --tmpBytesToRead; + if (tmpBytesToRead) ch <<= 6; + } while (tmpBytesToRead > 0); +} +In UTF-8 writing code, the switches on "bytesToWrite" are +similarly unrolled loops. + +--------------------------------------------------------------------- */ diff --git a/Telegram/ThirdParty/breakpad/common/convert_UTF.h b/Telegram/ThirdParty/breakpad/common/convert_UTF.h new file mode 100644 index 0000000000..644d099506 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/convert_UTF.h @@ -0,0 +1,164 @@ +/* + * Copyright © 1991-2015 Unicode, Inc. All rights reserved. + * Distributed under the Terms of Use in + * http://www.unicode.org/copyright.html. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of the Unicode data files and any associated documentation + * (the "Data Files") or Unicode software and any associated documentation + * (the "Software") to deal in the Data Files or Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, and/or sell copies of + * the Data Files or Software, and to permit persons to whom the Data Files + * or Software are furnished to do so, provided that + * (a) this copyright and permission notice appear with all copies + * of the Data Files or Software, + * (b) this copyright and permission notice appear in associated + * documentation, and + * (c) there is clear notice in each modified Data File or in the Software + * as well as in the documentation associated with the Data File(s) or + * Software that the data or software has been modified. + * + * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THE DATA FILES OR SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in these Data Files or Software without prior + * written authorization of the copyright holder. + */ + +#ifndef COMMON_CONVERT_UTF_H_ +#define COMMON_CONVERT_UTF_H_ + +/* --------------------------------------------------------------------- + +Conversions between UTF32, UTF-16, and UTF-8. Header file. + +Several funtions are included here, forming a complete set of +conversions between the three formats. UTF-7 is not included +here, but is handled in a separate source file. + +Each of these routines takes pointers to input buffers and output +buffers. The input buffers are const. + +Each routine converts the text between *sourceStart and sourceEnd, +putting the result into the buffer between *targetStart and +targetEnd. Note: the end pointers are *after* the last item: e.g. +*(sourceEnd - 1) is the last item. + +The return result indicates whether the conversion was successful, +and if not, whether the problem was in the source or target buffers. +(Only the first encountered problem is indicated.) + +After the conversion, *sourceStart and *targetStart are both +updated to point to the end of last text successfully converted in +the respective buffers. + +Input parameters: +sourceStart - pointer to a pointer to the source buffer. +The contents of this are modified on return so that +it points at the next thing to be converted. +targetStart - similarly, pointer to pointer to the target buffer. +sourceEnd, targetEnd - respectively pointers to the ends of the +two buffers, for overflow checking only. + +These conversion functions take a ConversionFlags argument. When this +flag is set to strict, both irregular sequences and isolated surrogates +will cause an error. When the flag is set to lenient, both irregular +sequences and isolated surrogates are converted. + +Whether the flag is strict or lenient, all illegal sequences will cause +an error return. This includes sequences such as: , , +or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code +must check for illegal sequences. + +When the flag is set to lenient, characters over 0x10FFFF are converted +to the replacement character; otherwise (when the flag is set to strict) +they constitute an error. + +Output parameters: +The value "sourceIllegal" is returned from some routines if the input +sequence is malformed. When "sourceIllegal" is returned, the source +value will point to the illegal value that caused the problem. E.g., +in UTF-8 when a sequence is malformed, it points to the start of the +malformed sequence. + +Author: Mark E. Davis, 1994. +Rev History: Rick McGowan, fixes & updates May 2001. +Fixes & updates, Sept 2001. + +------------------------------------------------------------------------ */ + +/* --------------------------------------------------------------------- +The following 4 definitions are compiler-specific. +The C standard does not guarantee that wchar_t has at least +16 bits, so wchar_t is no less portable than unsigned short! +All should be unsigned values to avoid sign extension during +bit mask & shift operations. +------------------------------------------------------------------------ */ + +typedef unsigned long UTF32; /* at least 32 bits */ +typedef unsigned short UTF16; /* at least 16 bits */ +typedef unsigned char UTF8; /* typically 8 bits */ +typedef unsigned char Boolean; /* 0 or 1 */ + +/* Some fundamental constants */ +#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD +#define UNI_MAX_BMP (UTF32)0x0000FFFF +#define UNI_MAX_UTF16 (UTF32)0x0010FFFF +#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF +#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF + +typedef enum { + conversionOK, /* conversion successful */ + sourceExhausted, /* partial character in source, but hit end */ + targetExhausted, /* insuff. room in target for conversion */ + sourceIllegal /* source sequence is illegal/malformed */ +} ConversionResult; + +typedef enum { + strictConversion = 0, + lenientConversion +} ConversionFlags; + +/* This is for C++ and does no harm in C */ +#ifdef __cplusplus +extern "C" { +#endif + +ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); + +Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); + +#ifdef __cplusplus +} +#endif + +/* --------------------------------------------------------------------- */ + +#endif // COMMON_CONVERT_UTF_H_ diff --git a/Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h b/Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h new file mode 100644 index 0000000000..ec5a8d6b6b --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h @@ -0,0 +1,96 @@ +// Copyright (c) 2009, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This header provides replacements for libc functions that we need. We if +// call the libc functions directly we risk crashing in the dynamic linker as +// it tries to resolve uncached PLT entries. + +#ifndef CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_ +#define CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_ + +#include +#include +#include + +extern "C" { + +extern size_t my_strlen(const char* s); + +extern int my_strcmp(const char* a, const char* b); + +extern int my_strncmp(const char* a, const char* b, size_t len); + +// Parse a non-negative integer. +// result: (output) the resulting non-negative integer +// s: a NUL terminated string +// Return true iff successful. +extern bool my_strtoui(int* result, const char* s); + +// Return the length of the given unsigned integer when expressed in base 10. +extern unsigned my_uint_len(uintmax_t i); + +// Convert an unsigned integer to a string +// output: (output) the resulting string is written here. This buffer must be +// large enough to hold the resulting string. Call |my_uint_len| to get the +// required length. +// i: the unsigned integer to serialise. +// i_len: the length of the integer in base 10 (see |my_uint_len|). +extern void my_uitos(char* output, uintmax_t i, unsigned i_len); + +extern const char* my_strchr(const char* haystack, char needle); + +extern const char* my_strrchr(const char* haystack, char needle); + +// Read a hex value +// result: (output) the resulting value +// s: a string +// Returns a pointer to the first invalid charactor. +extern const char* my_read_hex_ptr(uintptr_t* result, const char* s); + +extern const char* my_read_decimal_ptr(uintptr_t* result, const char* s); + +extern void my_memset(void* ip, char c, size_t len); + +extern void* my_memchr(const void* src, int c, size_t len); + +// The following are considered safe to use in a compromised environment. +// Besides, this gives the compiler an opportunity to optimize their calls. +#define my_memcpy memcpy +#define my_memmove memmove +#define my_memcmp memcmp + +extern size_t my_strlcpy(char* s1, const char* s2, size_t len); + +extern size_t my_strlcat(char* s1, const char* s2, size_t len); + +extern int my_isspace(int ch); + +} // extern "C" + +#endif // CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/MachIPC.h b/Telegram/ThirdParty/breakpad/common/mac/MachIPC.h new file mode 100644 index 0000000000..8df9165bb3 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/MachIPC.h @@ -0,0 +1,301 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// MachIPC.h +// +// Some helpful wrappers for using Mach IPC calls + +#ifndef MACH_IPC_H__ +#define MACH_IPC_H__ + +#import +#import +#import +#import + +#import + +//============================================================================== +// DISCUSSION: +// +// The three main classes of interest are +// +// MachMessage: a wrapper for a mach message of the following form +// mach_msg_header_t +// mach_msg_body_t +// optional descriptors +// optional extra message data +// +// MachReceiveMessage and MachSendMessage subclass MachMessage +// and are used instead of MachMessage which is an abstract base class +// +// ReceivePort: +// Represents a mach port for which we have receive rights +// +// MachPortSender: +// Represents a mach port for which we have send rights +// +// Here's an example to receive a message on a server port: +// +// // This creates our named server port +// ReceivePort receivePort("com.Google.MyService"); +// +// MachReceiveMessage message; +// kern_return_t result = receivePort.WaitForMessage(&message, 0); +// +// if (result == KERN_SUCCESS && message.GetMessageID() == 57) { +// mach_port_t task = message.GetTranslatedPort(0); +// mach_port_t thread = message.GetTranslatedPort(1); +// +// char *messageString = message.GetData(); +// +// printf("message string = %s\n", messageString); +// } +// +// Here is an example of using these classes to send a message to this port: +// +// // send to already named port +// MachPortSender sender("com.Google.MyService"); +// MachSendMessage message(57); // our message ID is 57 +// +// // add some ports to be translated for us +// message.AddDescriptor(mach_task_self()); // our task +// message.AddDescriptor(mach_thread_self()); // this thread +// +// char messageString[] = "Hello server!\n"; +// message.SetData(messageString, strlen(messageString)+1); +// +// kern_return_t result = sender.SendMessage(message, 1000); // timeout 1000ms +// + +namespace google_breakpad { +#define PRINT_MACH_RESULT(result_, message_) \ + printf(message_" %s (%d)\n", mach_error_string(result_), result_ ); + +//============================================================================== +// A wrapper class for mach_msg_port_descriptor_t (with same memory layout) +// with convenient constructors and accessors +class MachMsgPortDescriptor : public mach_msg_port_descriptor_t { + public: + // General-purpose constructor + MachMsgPortDescriptor(mach_port_t in_name, + mach_msg_type_name_t in_disposition) { + name = in_name; + pad1 = 0; + pad2 = 0; + disposition = in_disposition; + type = MACH_MSG_PORT_DESCRIPTOR; + } + + // For passing send rights to a port + MachMsgPortDescriptor(mach_port_t in_name) { + name = in_name; + pad1 = 0; + pad2 = 0; + disposition = MACH_MSG_TYPE_COPY_SEND; + type = MACH_MSG_PORT_DESCRIPTOR; + } + + // Copy constructor + MachMsgPortDescriptor(const MachMsgPortDescriptor& desc) { + name = desc.name; + pad1 = desc.pad1; + pad2 = desc.pad2; + disposition = desc.disposition; + type = desc.type; + } + + mach_port_t GetMachPort() const { + return name; + } + + mach_msg_type_name_t GetDisposition() const { + return disposition; + } + + // For convenience + operator mach_port_t() const { + return GetMachPort(); + } +}; + +//============================================================================== +// MachMessage: a wrapper for a mach message +// (mach_msg_header_t, mach_msg_body_t, extra data) +// +// This considerably simplifies the construction of a message for sending +// and the getting at relevant data and descriptors for the receiver. +// +// Currently the combined size of the descriptors plus data must be +// less than 1024. But as a benefit no memory allocation is necessary. +// +// TODO: could consider adding malloc() support for very large messages +// +// A MachMessage object is used by ReceivePort::WaitForMessage +// and MachPortSender::SendMessage +// +class MachMessage { + public: + + // The receiver of the message can retrieve the raw data this way + uint8_t *GetData() { + return GetDataLength() > 0 ? GetDataPacket()->data : NULL; + } + + uint32_t GetDataLength() { + return EndianU32_LtoN(GetDataPacket()->data_length); + } + + // The message ID may be used as a code identifying the type of message + void SetMessageID(int32_t message_id) { + GetDataPacket()->id = EndianU32_NtoL(message_id); + } + + int32_t GetMessageID() { return EndianU32_LtoN(GetDataPacket()->id); } + + // Adds a descriptor (typically a mach port) to be translated + // returns true if successful, otherwise not enough space + bool AddDescriptor(const MachMsgPortDescriptor &desc); + + int GetDescriptorCount() const { return body.msgh_descriptor_count; } + MachMsgPortDescriptor *GetDescriptor(int n); + + // Convenience method which gets the mach port described by the descriptor + mach_port_t GetTranslatedPort(int n); + + // A simple message is one with no descriptors + bool IsSimpleMessage() const { return GetDescriptorCount() == 0; } + + // Sets raw data for the message (returns false if not enough space) + bool SetData(void *data, int32_t data_length); + + protected: + // Consider this an abstract base class - must create an actual instance + // of MachReceiveMessage or MachSendMessage + + MachMessage() { + memset(this, 0, sizeof(MachMessage)); + } + + friend class ReceivePort; + friend class MachPortSender; + + // Represents raw data in our message + struct MessageDataPacket { + int32_t id; // little-endian + int32_t data_length; // little-endian + uint8_t data[1]; // actual size limited by sizeof(MachMessage) + }; + + MessageDataPacket* GetDataPacket(); + + void SetDescriptorCount(int n); + void SetDescriptor(int n, const MachMsgPortDescriptor &desc); + + // Returns total message size setting msgh_size in the header to this value + mach_msg_size_t CalculateSize(); + + mach_msg_header_t head; + mach_msg_body_t body; + uint8_t padding[1024]; // descriptors and data may be embedded here +}; + +//============================================================================== +// MachReceiveMessage and MachSendMessage are useful to separate the idea +// of a mach message being sent and being received, and adds increased type +// safety: +// ReceivePort::WaitForMessage() only accepts a MachReceiveMessage +// MachPortSender::SendMessage() only accepts a MachSendMessage + +//============================================================================== +class MachReceiveMessage : public MachMessage { + public: + MachReceiveMessage() : MachMessage() {}; +}; + +//============================================================================== +class MachSendMessage : public MachMessage { + public: + MachSendMessage(int32_t message_id); +}; + +//============================================================================== +// Represents a mach port for which we have receive rights +class ReceivePort { + public: + // Creates a new mach port for receiving messages and registers a name for it + explicit ReceivePort(const char *receive_port_name); + + // Given an already existing mach port, use it. We take ownership of the + // port and deallocate it in our destructor. + explicit ReceivePort(mach_port_t receive_port); + + // Create a new mach port for receiving messages + ReceivePort(); + + ~ReceivePort(); + + // Waits on the mach port until message received or timeout + kern_return_t WaitForMessage(MachReceiveMessage *out_message, + mach_msg_timeout_t timeout); + + // The underlying mach port that we wrap + mach_port_t GetPort() const { return port_; } + + private: + ReceivePort(const ReceivePort&); // disable copy c-tor + + mach_port_t port_; + kern_return_t init_result_; +}; + +//============================================================================== +// Represents a mach port for which we have send rights +class MachPortSender { + public: + // get a port with send rights corresponding to a named registered service + explicit MachPortSender(const char *receive_port_name); + + + // Given an already existing mach port, use it. + explicit MachPortSender(mach_port_t send_port); + + kern_return_t SendMessage(MachSendMessage &message, + mach_msg_timeout_t timeout); + + private: + MachPortSender(const MachPortSender&); // disable copy c-tor + + mach_port_t send_port_; + kern_return_t init_result_; +}; + +} // namespace google_breakpad + +#endif // MACH_IPC_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm b/Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm new file mode 100644 index 0000000000..dc9773f77a --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm @@ -0,0 +1,306 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// MachIPC.mm +// Wrapper for mach IPC calls + +#import +#import "MachIPC.h" +#include "common/mac/bootstrap_compat.h" + +namespace google_breakpad { +//============================================================================== +MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() { + head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); + + // head.msgh_remote_port = ...; // filled out in MachPortSender::SendMessage() + head.msgh_local_port = MACH_PORT_NULL; + head.msgh_reserved = 0; + head.msgh_id = 0; + + SetDescriptorCount(0); // start out with no descriptors + + SetMessageID(message_id); + SetData(NULL, 0); // client may add data later +} + +//============================================================================== +// returns true if successful +bool MachMessage::SetData(void *data, + int32_t data_length) { + // first check to make sure we have enough space + size_t size = CalculateSize(); + size_t new_size = size + data_length; + + if (new_size > sizeof(MachMessage)) { + return false; // not enough space + } + + GetDataPacket()->data_length = EndianU32_NtoL(data_length); + if (data) memcpy(GetDataPacket()->data, data, data_length); + + CalculateSize(); + + return true; +} + +//============================================================================== +// calculates and returns the total size of the message +// Currently, the entire message MUST fit inside of the MachMessage +// messsage size <= sizeof(MachMessage) +mach_msg_size_t MachMessage::CalculateSize() { + size_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t); + + // add space for MessageDataPacket + int32_t alignedDataLength = (GetDataLength() + 3) & ~0x3; + size += 2*sizeof(int32_t) + alignedDataLength; + + // add space for descriptors + size += GetDescriptorCount() * sizeof(MachMsgPortDescriptor); + + head.msgh_size = static_cast(size); + + return head.msgh_size; +} + +//============================================================================== +MachMessage::MessageDataPacket *MachMessage::GetDataPacket() { + size_t desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount(); + MessageDataPacket *packet = + reinterpret_cast(padding + desc_size); + + return packet; +} + +//============================================================================== +void MachMessage::SetDescriptor(int n, + const MachMsgPortDescriptor &desc) { + MachMsgPortDescriptor *desc_array = + reinterpret_cast(padding); + desc_array[n] = desc; +} + +//============================================================================== +// returns true if successful otherwise there was not enough space +bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) { + // first check to make sure we have enough space + int size = CalculateSize(); + size_t new_size = size + sizeof(MachMsgPortDescriptor); + + if (new_size > sizeof(MachMessage)) { + return false; // not enough space + } + + // unfortunately, we need to move the data to allow space for the + // new descriptor + u_int8_t *p = reinterpret_cast(GetDataPacket()); + bcopy(p, p+sizeof(MachMsgPortDescriptor), GetDataLength()+2*sizeof(int32_t)); + + SetDescriptor(GetDescriptorCount(), desc); + SetDescriptorCount(GetDescriptorCount() + 1); + + CalculateSize(); + + return true; +} + +//============================================================================== +void MachMessage::SetDescriptorCount(int n) { + body.msgh_descriptor_count = n; + + if (n > 0) { + head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; + } else { + head.msgh_bits &= ~MACH_MSGH_BITS_COMPLEX; + } +} + +//============================================================================== +MachMsgPortDescriptor *MachMessage::GetDescriptor(int n) { + if (n < GetDescriptorCount()) { + MachMsgPortDescriptor *desc = + reinterpret_cast(padding); + return desc + n; + } + + return nil; +} + +//============================================================================== +mach_port_t MachMessage::GetTranslatedPort(int n) { + if (n < GetDescriptorCount()) { + return GetDescriptor(n)->GetMachPort(); + } + return MACH_PORT_NULL; +} + +#pragma mark - + +//============================================================================== +// create a new mach port for receiving messages and register a name for it +ReceivePort::ReceivePort(const char *receive_port_name) { + mach_port_t current_task = mach_task_self(); + + init_result_ = mach_port_allocate(current_task, + MACH_PORT_RIGHT_RECEIVE, + &port_); + + if (init_result_ != KERN_SUCCESS) + return; + + init_result_ = mach_port_insert_right(current_task, + port_, + port_, + MACH_MSG_TYPE_MAKE_SEND); + + if (init_result_ != KERN_SUCCESS) + return; + + mach_port_t task_bootstrap_port = 0; + init_result_ = task_get_bootstrap_port(current_task, &task_bootstrap_port); + + if (init_result_ != KERN_SUCCESS) + return; + + init_result_ = breakpad::BootstrapRegister( + bootstrap_port, + const_cast(receive_port_name), + port_); +} + +//============================================================================== +// create a new mach port for receiving messages +ReceivePort::ReceivePort() { + mach_port_t current_task = mach_task_self(); + + init_result_ = mach_port_allocate(current_task, + MACH_PORT_RIGHT_RECEIVE, + &port_); + + if (init_result_ != KERN_SUCCESS) + return; + + init_result_ = mach_port_insert_right(current_task, + port_, + port_, + MACH_MSG_TYPE_MAKE_SEND); +} + +//============================================================================== +// Given an already existing mach port, use it. We take ownership of the +// port and deallocate it in our destructor. +ReceivePort::ReceivePort(mach_port_t receive_port) + : port_(receive_port), + init_result_(KERN_SUCCESS) { +} + +//============================================================================== +ReceivePort::~ReceivePort() { + if (init_result_ == KERN_SUCCESS) + mach_port_deallocate(mach_task_self(), port_); +} + +//============================================================================== +kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message, + mach_msg_timeout_t timeout) { + if (!out_message) { + return KERN_INVALID_ARGUMENT; + } + + // return any error condition encountered in constructor + if (init_result_ != KERN_SUCCESS) + return init_result_; + + out_message->head.msgh_bits = 0; + out_message->head.msgh_local_port = port_; + out_message->head.msgh_remote_port = MACH_PORT_NULL; + out_message->head.msgh_reserved = 0; + out_message->head.msgh_id = 0; + + mach_msg_option_t options = MACH_RCV_MSG; + if (timeout != MACH_MSG_TIMEOUT_NONE) + options |= MACH_RCV_TIMEOUT; + kern_return_t result = mach_msg(&out_message->head, + options, + 0, + sizeof(MachMessage), + port_, + timeout, // timeout in ms + MACH_PORT_NULL); + + return result; +} + +#pragma mark - + +//============================================================================== +// get a port with send rights corresponding to a named registered service +MachPortSender::MachPortSender(const char *receive_port_name) { + mach_port_t task_bootstrap_port = 0; + init_result_ = task_get_bootstrap_port(mach_task_self(), + &task_bootstrap_port); + + if (init_result_ != KERN_SUCCESS) + return; + + init_result_ = bootstrap_look_up(task_bootstrap_port, + const_cast(receive_port_name), + &send_port_); +} + +//============================================================================== +MachPortSender::MachPortSender(mach_port_t send_port) + : send_port_(send_port), + init_result_(KERN_SUCCESS) { +} + +//============================================================================== +kern_return_t MachPortSender::SendMessage(MachSendMessage &message, + mach_msg_timeout_t timeout) { + if (message.head.msgh_size == 0) { + return KERN_INVALID_VALUE; // just for safety -- never should occur + }; + + if (init_result_ != KERN_SUCCESS) + return init_result_; + + message.head.msgh_remote_port = send_port_; + + kern_return_t result = mach_msg(&message.head, + MACH_SEND_MSG | MACH_SEND_TIMEOUT, + message.head.msgh_size, + 0, + MACH_PORT_NULL, + timeout, // timeout in ms + MACH_PORT_NULL); + + return result; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc b/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc new file mode 100644 index 0000000000..d875d95b5f --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc @@ -0,0 +1,42 @@ +// Copyright (c) 2012, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common/mac/bootstrap_compat.h" + +namespace breakpad { + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +kern_return_t BootstrapRegister(mach_port_t bp, + name_t service_name, + mach_port_t sp) { + return bootstrap_register(bp, service_name, sp); +} +#pragma GCC diagnostic warning "-Wdeprecated-declarations" + +} // namesapce breakpad diff --git a/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h b/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h new file mode 100644 index 0000000000..8ca7357c34 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h @@ -0,0 +1,54 @@ +// Copyright (c) 2012, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef COMMON_MAC_BOOTSTRAP_COMPAT_H_ +#define COMMON_MAC_BOOTSTRAP_COMPAT_H_ + +#include + +namespace breakpad { + +// Wrapper for bootstrap_register to avoid deprecation warnings. +// +// In 10.6, it's possible to call bootstrap_check_in as the one-stop-shop for +// handling what bootstrap_register is used for. In 10.5, bootstrap_check_in +// can't check in a service whose name has not yet been registered, despite +// bootstrap_register being marked as deprecated in that OS release. Breakpad +// needs to register new service names, and in 10.5, calling +// bootstrap_register is the only way to achieve that. Attempts to call +// bootstrap_check_in for a new service name on 10.5 will result in +// BOOTSTRAP_UNKNOWN_SERVICE being returned rather than registration of the +// new service name. +kern_return_t BootstrapRegister(mach_port_t bp, + name_t service_name, + mach_port_t sp); + +} // namespace breakpad + +#endif // COMMON_MAC_BOOTSTRAP_COMPAT_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/byteswap.h b/Telegram/ThirdParty/breakpad/common/mac/byteswap.h new file mode 100644 index 0000000000..b7bbc0b95b --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/byteswap.h @@ -0,0 +1,73 @@ +// -*- mode: c++ -*- + +// Copyright (c) 2010, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Original author: Jim Blandy + +// byteswap.h: Overloaded functions for conveniently byteswapping values. + +#ifndef COMMON_MAC_BYTESWAP_H_ +#define COMMON_MAC_BYTESWAP_H_ + +#ifdef __APPLE__ +#include + +static inline uint16_t ByteSwap(uint16_t v) { return OSSwapInt16(v); } +static inline uint32_t ByteSwap(uint32_t v) { return OSSwapInt32(v); } +static inline uint64_t ByteSwap(uint64_t v) { return OSSwapInt64(v); } +static inline int16_t ByteSwap(int16_t v) { return OSSwapInt16(v); } +static inline int32_t ByteSwap(int32_t v) { return OSSwapInt32(v); } +static inline int64_t ByteSwap(int64_t v) { return OSSwapInt64(v); } + +#elif defined(__linux__) +// For NXByteOrder +#include +#include +#include +#include_next + +static inline uint16_t ByteSwap(uint16_t v) { return bswap_16(v); } +static inline uint32_t ByteSwap(uint32_t v) { return bswap_32(v); } +static inline uint64_t ByteSwap(uint64_t v) { return bswap_64(v); } +static inline int16_t ByteSwap(int16_t v) { return bswap_16(v); } +static inline int32_t ByteSwap(int32_t v) { return bswap_32(v); } +static inline int64_t ByteSwap(int64_t v) { return bswap_64(v); } + +static inline NXByteOrder NXHostByteOrder() { +#ifdef __LITTLE_ENDIAN + return NX_LittleEndian; +#else + return NX_BigEndian; +#endif +} + +#endif // __APPLE__ + +#endif // COMMON_MAC_BYTESWAP_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/file_id.cc b/Telegram/ThirdParty/breakpad/common/mac/file_id.cc new file mode 100644 index 0000000000..4661d5d625 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/file_id.cc @@ -0,0 +1,106 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// file_id.cc: Return a unique identifier for a file +// +// See file_id.h for documentation +// +// Author: Dan Waylonis + +#include +#include +#include +#include + +#include "common/mac/file_id.h" +#include "common/mac/macho_id.h" + +using MacFileUtilities::MachoID; + +namespace google_breakpad { + +FileID::FileID(const char *path) { + snprintf(path_, sizeof(path_), "%s", path); +} + +bool FileID::FileIdentifier(unsigned char identifier[16]) { + int fd = open(path_, O_RDONLY); + if (fd == -1) + return false; + + MD5Context md5; + MD5Init(&md5); + + // Read 4k x 2 bytes at a time. This is faster than just 4k bytes, but + // doesn't seem to be an unreasonable size for the stack. + unsigned char buffer[4096 * 2]; + size_t buffer_size = sizeof(buffer); + while ((buffer_size = read(fd, buffer, buffer_size) > 0)) { + MD5Update(&md5, buffer, static_cast(buffer_size)); + } + + close(fd); + MD5Final(identifier, &md5); + + return true; +} + +bool FileID::MachoIdentifier(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]) { + MachoID macho(path_); + + if (macho.UUIDCommand(cpu_type, cpu_subtype, identifier)) + return true; + + return macho.MD5(cpu_type, cpu_subtype, identifier); +} + +// static +void FileID::ConvertIdentifierToString(const unsigned char identifier[16], + char *buffer, int buffer_length) { + int buffer_idx = 0; + for (int idx = 0; (buffer_idx < buffer_length) && (idx < 16); ++idx) { + int hi = (identifier[idx] >> 4) & 0x0F; + int lo = (identifier[idx]) & 0x0F; + + if (idx == 4 || idx == 6 || idx == 8 || idx == 10) + buffer[buffer_idx++] = '-'; + + buffer[buffer_idx++] = + static_cast((hi >= 10) ? ('A' + hi - 10) : ('0' + hi)); + buffer[buffer_idx++] = + static_cast((lo >= 10) ? ('A' + lo - 10) : ('0' + lo)); + } + + // NULL terminate + buffer[(buffer_idx < buffer_length) ? buffer_idx : buffer_idx - 1] = 0; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/mac/file_id.h b/Telegram/ThirdParty/breakpad/common/mac/file_id.h new file mode 100644 index 0000000000..1d6dfde1b0 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/file_id.h @@ -0,0 +1,81 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// file_id.h: Return a unique identifier for a file +// +// Author: Dan Waylonis + +#ifndef COMMON_MAC_FILE_ID_H__ +#define COMMON_MAC_FILE_ID_H__ + +#include +#include + +namespace google_breakpad { + +class FileID { + public: + FileID(const char *path); + ~FileID() {}; + + // Load the identifier for the file path specified in the constructor into + // |identifier|. Return false if the identifier could not be created for the + // file. + // The current implementation will return the MD5 hash of the file's bytes. + bool FileIdentifier(unsigned char identifier[16]); + + // Treat the file as a mach-o file that will contain one or more archicture. + // Accepted values for |cpu_type| and |cpu_subtype| (e.g., CPU_TYPE_X86 or + // CPU_TYPE_POWERPC) are listed in /usr/include/mach/machine.h. + // If |cpu_type| is 0, then the native cpu type is used. If |cpu_subtype| is + // CPU_SUBTYPE_MULTIPLE, the match is only done on |cpu_type|. + // Returns false if opening the file failed or if the |cpu_type|/|cpu_subtype| + // is not present in the file. + // Return the unique identifier in |identifier|. + // The current implementation will look for the (in order of priority): + // LC_UUID, LC_ID_DYLIB, or MD5 hash of the given |cpu_type|. + bool MachoIdentifier(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]); + + // Convert the |identifier| data to a NULL terminated string. The string will + // be formatted as a UUID (e.g., 22F065BB-FC9C-49F7-80FE-26A7CEBD7BCE). + // The |buffer| should be at least 37 bytes long to receive all of the data + // and termination. Shorter buffers will contain truncated data. + static void ConvertIdentifierToString(const unsigned char identifier[16], + char *buffer, int buffer_length); + + private: + // Storage for the path specified + char path_[PATH_MAX]; +}; + +} // namespace google_breakpad + +#endif // COMMON_MAC_FILE_ID_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_id.cc b/Telegram/ThirdParty/breakpad/common/mac/macho_id.cc new file mode 100644 index 0000000000..c396ad888d --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/macho_id.cc @@ -0,0 +1,369 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// macho_id.cc: Functions to gather identifying information from a macho file +// +// See macho_id.h for documentation +// +// Author: Dan Waylonis + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common/mac/macho_id.h" +#include "common/mac/macho_walker.h" +#include "common/mac/macho_utilities.h" + +namespace MacFileUtilities { + +using google_breakpad::MD5Init; +using google_breakpad::MD5Update; +using google_breakpad::MD5Final; + +MachoID::MachoID(const char *path) + : memory_(0), + memory_size_(0), + crc_(0), + md5_context_(), + update_function_(NULL) { + snprintf(path_, sizeof(path_), "%s", path); +} + +MachoID::MachoID(const char *path, void *memory, size_t size) + : memory_(memory), + memory_size_(size), + crc_(0), + md5_context_(), + update_function_(NULL) { + snprintf(path_, sizeof(path_), "%s", path); +} + +MachoID::~MachoID() { +} + +// The CRC info is from http://en.wikipedia.org/wiki/Adler-32 +// With optimizations from http://www.zlib.net/ + +// The largest prime smaller than 65536 +#define MOD_ADLER 65521 +// MAX_BLOCK is the largest n such that 255n(n+1)/2 + (n+1)(MAX_BLOCK-1) <= 2^32-1 +#define MAX_BLOCK 5552 + +void MachoID::UpdateCRC(unsigned char *bytes, size_t size) { +// Unrolled loops for summing +#define DO1(buf,i) {sum1 += (buf)[i]; sum2 += sum1;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + // Split up the crc + uint32_t sum1 = crc_ & 0xFFFF; + uint32_t sum2 = (crc_ >> 16) & 0xFFFF; + + // Do large blocks + while (size >= MAX_BLOCK) { + size -= MAX_BLOCK; + int block_count = MAX_BLOCK / 16; + do { + DO16(bytes); + bytes += 16; + } while (--block_count); + sum1 %= MOD_ADLER; + sum2 %= MOD_ADLER; + } + + // Do remaining bytes + if (size) { + while (size >= 16) { + size -= 16; + DO16(bytes); + bytes += 16; + } + while (size--) { + sum1 += *bytes++; + sum2 += sum1; + } + sum1 %= MOD_ADLER; + sum2 %= MOD_ADLER; + crc_ = (sum2 << 16) | sum1; + } +} + +void MachoID::UpdateMD5(unsigned char *bytes, size_t size) { + MD5Update(&md5_context_, bytes, static_cast(size)); +} + +void MachoID::Update(MachoWalker *walker, off_t offset, size_t size) { + if (!update_function_ || !size) + return; + + // Read up to 4k bytes at a time + unsigned char buffer[4096]; + size_t buffer_size; + off_t file_offset = offset; + while (size > 0) { + if (size > sizeof(buffer)) { + buffer_size = sizeof(buffer); + size -= buffer_size; + } else { + buffer_size = size; + size = 0; + } + + if (!walker->ReadBytes(buffer, buffer_size, file_offset)) + return; + + (this->*update_function_)(buffer, buffer_size); + file_offset += buffer_size; + } +} + +bool MachoID::UUIDCommand(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char bytes[16]) { + struct breakpad_uuid_command uuid_cmd; + uuid_cmd.cmd = 0; + if (!WalkHeader(cpu_type, cpu_subtype, UUIDWalkerCB, &uuid_cmd)) + return false; + + // If we found the command, we'll have initialized the uuid_command + // structure + if (uuid_cmd.cmd == LC_UUID) { + memcpy(bytes, uuid_cmd.uuid, sizeof(uuid_cmd.uuid)); + return true; + } + + return false; +} + +bool MachoID::IDCommand(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]) { + struct dylib_command dylib_cmd; + dylib_cmd.cmd = 0; + if (!WalkHeader(cpu_type, cpu_subtype, IDWalkerCB, &dylib_cmd)) + return false; + + // If we found the command, we'll have initialized the dylib_command + // structure + if (dylib_cmd.cmd == LC_ID_DYLIB) { + // Take the hashed filename, version, and compatability version bytes + // to form the first 12 bytes, pad the rest with zeros + + // create a crude hash of the filename to generate the first 4 bytes + identifier[0] = 0; + identifier[1] = 0; + identifier[2] = 0; + identifier[3] = 0; + + for (int j = 0, i = (int)strlen(path_)-1; i>=0 && path_[i]!='/'; ++j, --i) { + identifier[j%4] += path_[i]; + } + + identifier[4] = (dylib_cmd.dylib.current_version >> 24) & 0xFF; + identifier[5] = (dylib_cmd.dylib.current_version >> 16) & 0xFF; + identifier[6] = (dylib_cmd.dylib.current_version >> 8) & 0xFF; + identifier[7] = dylib_cmd.dylib.current_version & 0xFF; + identifier[8] = (dylib_cmd.dylib.compatibility_version >> 24) & 0xFF; + identifier[9] = (dylib_cmd.dylib.compatibility_version >> 16) & 0xFF; + identifier[10] = (dylib_cmd.dylib.compatibility_version >> 8) & 0xFF; + identifier[11] = dylib_cmd.dylib.compatibility_version & 0xFF; + identifier[12] = (cpu_type >> 24) & 0xFF; + identifier[13] = (cpu_type >> 16) & 0xFF; + identifier[14] = (cpu_type >> 8) & 0xFF; + identifier[15] = cpu_type & 0xFF; + + return true; + } + + return false; +} + +uint32_t MachoID::Adler32(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { + update_function_ = &MachoID::UpdateCRC; + crc_ = 0; + + if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) + return 0; + + return crc_; +} + +bool MachoID::MD5(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char identifier[16]) { + update_function_ = &MachoID::UpdateMD5; + + MD5Init(&md5_context_); + + if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) + return false; + + MD5Final(identifier, &md5_context_); + return true; +} + +bool MachoID::WalkHeader(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + MachoWalker::LoadCommandCallback callback, + void *context) { + if (memory_) { + MachoWalker walker(memory_, memory_size_, callback, context); + return walker.WalkHeader(cpu_type, cpu_subtype); + } else { + MachoWalker walker(path_, callback, context); + return walker.WalkHeader(cpu_type, cpu_subtype); + } +} + +// static +bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, + bool swap, void *context) { + MachoID *macho_id = (MachoID *)context; + + if (cmd->cmd == LC_SEGMENT) { + struct segment_command seg; + + if (!walker->ReadBytes(&seg, sizeof(seg), offset)) + return false; + + if (swap) + breakpad_swap_segment_command(&seg); + + struct mach_header_64 header; + off_t header_offset; + + if (!walker->CurrentHeader(&header, &header_offset)) + return false; + + // Process segments that have sections: + // (e.g., __TEXT, __DATA, __IMPORT, __OBJC) + offset += sizeof(struct segment_command); + struct section sec; + for (unsigned long i = 0; i < seg.nsects; ++i) { + if (!walker->ReadBytes(&sec, sizeof(sec), offset)) + return false; + + if (swap) + breakpad_swap_section(&sec, 1); + + // sections of type S_ZEROFILL are "virtual" and contain no data + // in the file itself + if ((sec.flags & SECTION_TYPE) != S_ZEROFILL && sec.offset != 0) + macho_id->Update(walker, header_offset + sec.offset, sec.size); + + offset += sizeof(struct section); + } + } else if (cmd->cmd == LC_SEGMENT_64) { + struct segment_command_64 seg64; + + if (!walker->ReadBytes(&seg64, sizeof(seg64), offset)) + return false; + + if (swap) + breakpad_swap_segment_command_64(&seg64); + + struct mach_header_64 header; + off_t header_offset; + + if (!walker->CurrentHeader(&header, &header_offset)) + return false; + + // Process segments that have sections: + // (e.g., __TEXT, __DATA, __IMPORT, __OBJC) + offset += sizeof(struct segment_command_64); + struct section_64 sec64; + for (unsigned long i = 0; i < seg64.nsects; ++i) { + if (!walker->ReadBytes(&sec64, sizeof(sec64), offset)) + return false; + + if (swap) + breakpad_swap_section_64(&sec64, 1); + + // sections of type S_ZEROFILL are "virtual" and contain no data + // in the file itself + if ((sec64.flags & SECTION_TYPE) != S_ZEROFILL && sec64.offset != 0) + macho_id->Update(walker, + header_offset + sec64.offset, + (size_t)sec64.size); + + offset += sizeof(struct section_64); + } + } + + // Continue processing + return true; +} + +// static +bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, + bool swap, void *context) { + if (cmd->cmd == LC_UUID) { + struct breakpad_uuid_command *uuid_cmd = + (struct breakpad_uuid_command *)context; + + if (!walker->ReadBytes(uuid_cmd, sizeof(struct breakpad_uuid_command), + offset)) + return false; + + if (swap) + breakpad_swap_uuid_command(uuid_cmd); + + return false; + } + + // Continue processing + return true; +} + +// static +bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, + bool swap, void *context) { + if (cmd->cmd == LC_ID_DYLIB) { + struct dylib_command *dylib_cmd = (struct dylib_command *)context; + + if (!walker->ReadBytes(dylib_cmd, sizeof(struct dylib_command), offset)) + return false; + + if (swap) + breakpad_swap_dylib_command(dylib_cmd); + + return false; + } + + // Continue processing + return true; +} + +} // namespace MacFileUtilities diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_id.h b/Telegram/ThirdParty/breakpad/common/mac/macho_id.h new file mode 100644 index 0000000000..1037549124 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/macho_id.h @@ -0,0 +1,131 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// macho_id.h: Functions to gather identifying information from a macho file +// +// Author: Dan Waylonis + +#ifndef COMMON_MAC_MACHO_ID_H__ +#define COMMON_MAC_MACHO_ID_H__ + +#include +#include +#include + +#include "common/mac/macho_walker.h" +#include "common/md5.h" + +namespace MacFileUtilities { + +class MachoID { + public: + MachoID(const char *path); + MachoID(const char *path, void *memory, size_t size); + ~MachoID(); + + // For the given |cpu_type| and |cpu_subtype|, return a UUID from the LC_UUID + // command. + // Return false if there isn't a LC_UUID command. + bool UUIDCommand(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]); + + // For the given |cpu_type| and |cpu_subtype|, return a UUID from the + // LC_ID_DYLIB command. + // Return false if there isn't a LC_ID_DYLIB command. + bool IDCommand(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]); + + // For the given |cpu_type| and |cpu_subtype|, return the Adler32 CRC for the + // mach-o data segment(s). + // Return 0 on error (e.g., if the file is not a mach-o file) + uint32_t Adler32(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype); + + // For the given |cpu_type|, and |cpu_subtype| return the MD5 for the mach-o + // data segment(s). + // Return true on success, false otherwise + bool MD5(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + unsigned char identifier[16]); + + private: + // Signature of class member function to be called with data read from file + typedef void (MachoID::*UpdateFunction)(unsigned char *bytes, size_t size); + + // Update the CRC value by examining |size| |bytes| and applying the algorithm + // to each byte. + void UpdateCRC(unsigned char *bytes, size_t size); + + // Update the MD5 value by examining |size| |bytes| and applying the algorithm + // to each byte. + void UpdateMD5(unsigned char *bytes, size_t size); + + // Bottleneck for update routines + void Update(MachoWalker *walker, off_t offset, size_t size); + + // Factory for the MachoWalker + bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, + MachoWalker::LoadCommandCallback callback, void *context); + + // The callback from the MachoWalker for CRC and MD5 + static bool WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, + bool swap, void *context); + + // The callback from the MachoWalker for LC_UUID + static bool UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, + bool swap, void *context); + + // The callback from the MachoWalker for LC_ID_DYLIB + static bool IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, + bool swap, void *context); + + // File path + char path_[PATH_MAX]; + + // Memory region to read from + void *memory_; + + // Size of the memory region + size_t memory_size_; + + // The current crc value + uint32_t crc_; + + // The MD5 context + google_breakpad::MD5Context md5_context_; + + // The current update to call from the Update callback + UpdateFunction update_function_; +}; + +} // namespace MacFileUtilities + +#endif // COMMON_MAC_MACHO_ID_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc b/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc new file mode 100644 index 0000000000..f56fe768c1 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc @@ -0,0 +1,155 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// macho_utilties.cc: Utilities for dealing with mach-o files +// +// Author: Dave Camp + +#include "common/mac/byteswap.h" +#include "common/mac/macho_utilities.h" + +#include +#include + +void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc) { + uc->cmd = ByteSwap(uc->cmd); + uc->cmdsize = ByteSwap(uc->cmdsize); +} + +void breakpad_swap_load_command(struct load_command *lc) { + lc->cmd = ByteSwap(lc->cmd); + lc->cmdsize = ByteSwap(lc->cmdsize); +} + +void breakpad_swap_dylib_command(struct dylib_command *dc) { + dc->cmd = ByteSwap(dc->cmd); + dc->cmdsize = ByteSwap(dc->cmdsize); + + dc->dylib.name.offset = ByteSwap(dc->dylib.name.offset); + dc->dylib.timestamp = ByteSwap(dc->dylib.timestamp); + dc->dylib.current_version = ByteSwap(dc->dylib.current_version); + dc->dylib.compatibility_version = ByteSwap(dc->dylib.compatibility_version); +} + +void breakpad_swap_segment_command(struct segment_command *sc) { + sc->cmd = ByteSwap(sc->cmd); + sc->cmdsize = ByteSwap(sc->cmdsize); + + sc->vmaddr = ByteSwap(sc->vmaddr); + sc->vmsize = ByteSwap(sc->vmsize); + sc->fileoff = ByteSwap(sc->fileoff); + sc->filesize = ByteSwap(sc->filesize); + sc->maxprot = ByteSwap(sc->maxprot); + sc->initprot = ByteSwap(sc->initprot); + sc->nsects = ByteSwap(sc->nsects); + sc->flags = ByteSwap(sc->flags); +} + +void breakpad_swap_segment_command_64(struct segment_command_64 *sg) { + sg->cmd = ByteSwap(sg->cmd); + sg->cmdsize = ByteSwap(sg->cmdsize); + + sg->vmaddr = ByteSwap(sg->vmaddr); + sg->vmsize = ByteSwap(sg->vmsize); + sg->fileoff = ByteSwap(sg->fileoff); + sg->filesize = ByteSwap(sg->filesize); + + sg->maxprot = ByteSwap(sg->maxprot); + sg->initprot = ByteSwap(sg->initprot); + sg->nsects = ByteSwap(sg->nsects); + sg->flags = ByteSwap(sg->flags); +} + +void breakpad_swap_fat_header(struct fat_header *fh) { + fh->magic = ByteSwap(fh->magic); + fh->nfat_arch = ByteSwap(fh->nfat_arch); +} + +void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs) { + for (uint32_t i = 0; i < narchs; ++i) { + fa[i].cputype = ByteSwap(fa[i].cputype); + fa[i].cpusubtype = ByteSwap(fa[i].cpusubtype); + fa[i].offset = ByteSwap(fa[i].offset); + fa[i].size = ByteSwap(fa[i].size); + fa[i].align = ByteSwap(fa[i].align); + } +} + +void breakpad_swap_mach_header(struct mach_header *mh) { + mh->magic = ByteSwap(mh->magic); + mh->cputype = ByteSwap(mh->cputype); + mh->cpusubtype = ByteSwap(mh->cpusubtype); + mh->filetype = ByteSwap(mh->filetype); + mh->ncmds = ByteSwap(mh->ncmds); + mh->sizeofcmds = ByteSwap(mh->sizeofcmds); + mh->flags = ByteSwap(mh->flags); +} + +void breakpad_swap_mach_header_64(struct mach_header_64 *mh) { + mh->magic = ByteSwap(mh->magic); + mh->cputype = ByteSwap(mh->cputype); + mh->cpusubtype = ByteSwap(mh->cpusubtype); + mh->filetype = ByteSwap(mh->filetype); + mh->ncmds = ByteSwap(mh->ncmds); + mh->sizeofcmds = ByteSwap(mh->sizeofcmds); + mh->flags = ByteSwap(mh->flags); + mh->reserved = ByteSwap(mh->reserved); +} + +void breakpad_swap_section(struct section *s, + uint32_t nsects) { + for (uint32_t i = 0; i < nsects; i++) { + s[i].addr = ByteSwap(s[i].addr); + s[i].size = ByteSwap(s[i].size); + + s[i].offset = ByteSwap(s[i].offset); + s[i].align = ByteSwap(s[i].align); + s[i].reloff = ByteSwap(s[i].reloff); + s[i].nreloc = ByteSwap(s[i].nreloc); + s[i].flags = ByteSwap(s[i].flags); + s[i].reserved1 = ByteSwap(s[i].reserved1); + s[i].reserved2 = ByteSwap(s[i].reserved2); + } +} + +void breakpad_swap_section_64(struct section_64 *s, + uint32_t nsects) { + for (uint32_t i = 0; i < nsects; i++) { + s[i].addr = ByteSwap(s[i].addr); + s[i].size = ByteSwap(s[i].size); + + s[i].offset = ByteSwap(s[i].offset); + s[i].align = ByteSwap(s[i].align); + s[i].reloff = ByteSwap(s[i].reloff); + s[i].nreloc = ByteSwap(s[i].nreloc); + s[i].flags = ByteSwap(s[i].flags); + s[i].reserved1 = ByteSwap(s[i].reserved1); + s[i].reserved2 = ByteSwap(s[i].reserved2); + } +} diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h b/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h new file mode 100644 index 0000000000..00563a77c8 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h @@ -0,0 +1,95 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// macho_utilities.h: Utilities for dealing with mach-o files +// +// Author: Dave Camp + +#ifndef COMMON_MAC_MACHO_UTILITIES_H__ +#define COMMON_MAC_MACHO_UTILITIES_H__ + +#include +#include + +/* Some #defines and structs that aren't defined in older SDKs */ +#ifndef CPU_ARCH_ABI64 +# define CPU_ARCH_ABI64 0x01000000 +#endif + +#ifndef CPU_TYPE_X86 +# define CPU_TYPE_X86 CPU_TYPE_I386 +#endif + +#ifndef CPU_TYPE_POWERPC64 +# define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) +#endif + +#ifndef LC_UUID +# define LC_UUID 0x1b /* the uuid */ +#endif + +// The uuid_command struct/swap routines were added during the 10.4 series. +// Their presence isn't guaranteed. +struct breakpad_uuid_command { + uint32_t cmd; /* LC_UUID */ + uint32_t cmdsize; /* sizeof(struct uuid_command) */ + uint8_t uuid[16]; /* the 128-bit uuid */ +}; + +void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc); + +void breakpad_swap_load_command(struct load_command *lc); + +void breakpad_swap_dylib_command(struct dylib_command *dc); + +// Older SDKs defines thread_state_data_t as an int[] instead +// of the natural_t[] it should be. +typedef natural_t breakpad_thread_state_data_t[THREAD_STATE_MAX]; + +void breakpad_swap_segment_command(struct segment_command *sc); + +// The 64-bit swap routines were added during the 10.4 series, their +// presence isn't guaranteed. +void breakpad_swap_segment_command_64(struct segment_command_64 *sg); + +void breakpad_swap_fat_header(struct fat_header *fh); + +void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs); + +void breakpad_swap_mach_header(struct mach_header *mh); + +void breakpad_swap_mach_header_64(struct mach_header_64 *mh); + +void breakpad_swap_section(struct section *s, + uint32_t nsects); + +void breakpad_swap_section_64(struct section_64 *s, + uint32_t nsects); + +#endif diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc b/Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc new file mode 100644 index 0000000000..1acd86656b --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc @@ -0,0 +1,268 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// macho_walker.cc: Iterate over the load commands in a mach-o file +// +// See macho_walker.h for documentation +// +// Author: Dan Waylonis + +#include +#include +#include +#include +#include +#include +#include + +#include "common/mac/byteswap.h" +#include "common/mac/macho_walker.h" +#include "common/mac/macho_utilities.h" + +namespace MacFileUtilities { + +MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback, + void *context) + : file_(-1), + memory_(NULL), + memory_size_(0), + callback_(callback), + callback_context_(context), + current_header_(NULL), + current_header_size_(0), + current_header_offset_(0) { + file_ = open(path, O_RDONLY); +} + +MachoWalker::MachoWalker(void *memory, size_t size, + LoadCommandCallback callback, void *context) + : file_(-1), + memory_(memory), + memory_size_(size), + callback_(callback), + callback_context_(context), + current_header_(NULL), + current_header_size_(0), + current_header_offset_(0) { +} + +MachoWalker::~MachoWalker() { + if (file_ != -1) + close(file_); +} + +bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { + cpu_type_t valid_cpu_type = cpu_type; + cpu_subtype_t valid_cpu_subtype = cpu_subtype; + // if |cpu_type| is 0, use the native cpu type. + if (cpu_type == 0) { + const NXArchInfo *arch = NXGetLocalArchInfo(); + assert(arch); + valid_cpu_type = arch->cputype; + valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE; + } + off_t offset; + if (FindHeader(valid_cpu_type, valid_cpu_subtype, offset)) { + if (cpu_type & CPU_ARCH_ABI64) + return WalkHeader64AtOffset(offset); + + return WalkHeaderAtOffset(offset); + } + + return false; +} + +bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) { + if (memory_) { + if (offset < 0) + return false; + bool result = true; + if (offset + size > memory_size_) { + if (static_cast(offset) >= memory_size_) + return false; + size = memory_size_ - static_cast(offset); + result = false; + } + memcpy(buffer, static_cast(memory_) + offset, size); + return result; + } else { + return pread(file_, buffer, size, offset) == (ssize_t)size; + } +} + +bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) { + if (current_header_) { + memcpy(header, current_header_, sizeof(mach_header_64)); + *offset = current_header_offset_; + return true; + } + + return false; +} + +bool MachoWalker::FindHeader(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + off_t &offset) { + // Read the magic bytes that's common amongst all mach-o files + uint32_t magic; + if (!ReadBytes(&magic, sizeof(magic), 0)) + return false; + + offset = sizeof(magic); + + // Figure out what type of file we've got + bool is_fat = false; + if (magic == FAT_MAGIC || magic == FAT_CIGAM) { + is_fat = true; + } + else if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 && + magic != MH_CIGAM_64) { + return false; + } + + if (!is_fat) { + // If we don't have a fat header, check if the cpu type matches the single + // header + struct mach_header header; + if (!ReadBytes(&header, sizeof(header), 0)) + return false; + + if (magic == MH_CIGAM || magic == MH_CIGAM_64) + breakpad_swap_mach_header(&header); + + if (cpu_type != header.cputype || + (cpu_subtype != CPU_SUBTYPE_MULTIPLE && + cpu_subtype != header.cpusubtype)) { + return false; + } + + offset = 0; + return true; + } else { + // Read the fat header and find an appropriate architecture + offset = 0; + struct fat_header fat; + if (!ReadBytes(&fat, sizeof(fat), offset)) + return false; + + if (NXHostByteOrder() != NX_BigEndian) + breakpad_swap_fat_header(&fat); + + offset += sizeof(fat); + + // Search each architecture for the desired one + struct fat_arch arch; + for (uint32_t i = 0; i < fat.nfat_arch; ++i) { + if (!ReadBytes(&arch, sizeof(arch), offset)) + return false; + + if (NXHostByteOrder() != NX_BigEndian) + breakpad_swap_fat_arch(&arch, 1); + + if (arch.cputype == cpu_type && + (cpu_subtype == CPU_SUBTYPE_MULTIPLE || + arch.cpusubtype == cpu_subtype)) { + offset = arch.offset; + return true; + } + + offset += sizeof(arch); + } + } + + return false; +} + +bool MachoWalker::WalkHeaderAtOffset(off_t offset) { + struct mach_header header; + if (!ReadBytes(&header, sizeof(header), offset)) + return false; + + bool swap = (header.magic == MH_CIGAM); + if (swap) + breakpad_swap_mach_header(&header); + + // Copy the data into the mach_header_64 structure. Since the 32-bit and + // 64-bit only differ in the last field (reserved), this is safe to do. + struct mach_header_64 header64; + memcpy((void *)&header64, (const void *)&header, sizeof(header)); + header64.reserved = 0; + + current_header_ = &header64; + current_header_size_ = sizeof(header); // 32-bit, not 64-bit + current_header_offset_ = offset; + offset += current_header_size_; + bool result = WalkHeaderCore(offset, header.ncmds, swap); + current_header_ = NULL; + current_header_size_ = 0; + current_header_offset_ = 0; + return result; +} + +bool MachoWalker::WalkHeader64AtOffset(off_t offset) { + struct mach_header_64 header; + if (!ReadBytes(&header, sizeof(header), offset)) + return false; + + bool swap = (header.magic == MH_CIGAM_64); + if (swap) + breakpad_swap_mach_header_64(&header); + + current_header_ = &header; + current_header_size_ = sizeof(header); + current_header_offset_ = offset; + offset += current_header_size_; + bool result = WalkHeaderCore(offset, header.ncmds, swap); + current_header_ = NULL; + current_header_size_ = 0; + current_header_offset_ = 0; + return result; +} + +bool MachoWalker::WalkHeaderCore(off_t offset, uint32_t number_of_commands, + bool swap) { + for (uint32_t i = 0; i < number_of_commands; ++i) { + struct load_command cmd; + if (!ReadBytes(&cmd, sizeof(cmd), offset)) + return false; + + if (swap) + breakpad_swap_load_command(&cmd); + + // Call the user callback + if (callback_ && !callback_(this, &cmd, offset, swap, callback_context_)) + break; + + offset += cmd.cmdsize; + } + + return true; +} + +} // namespace MacFileUtilities diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_walker.h b/Telegram/ThirdParty/breakpad/common/mac/macho_walker.h new file mode 100644 index 0000000000..dd535814a1 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/macho_walker.h @@ -0,0 +1,119 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// macho_walker.h: Iterate over the load commands in a mach-o file +// +// Author: Dan Waylonis + +#ifndef COMMON_MAC_MACHO_WALKER_H__ +#define COMMON_MAC_MACHO_WALKER_H__ + +#include +#include +#include + +namespace MacFileUtilities { + +class MachoWalker { + public: + // A callback function executed when a new load command is read. If no + // further processing of load commands is desired, return false. Otherwise, + // return true. + // |cmd| is the current command, and |offset| is the location relative to the + // beginning of the file (not header) where the command was read. If |swap| + // is set, then any command data (other than the returned load_command) should + // be swapped when read + typedef bool (*LoadCommandCallback)(MachoWalker *walker, load_command *cmd, + off_t offset, bool swap, void *context); + + MachoWalker(const char *path, LoadCommandCallback callback, void *context); + MachoWalker(void *memory, size_t size, LoadCommandCallback callback, + void *context); + ~MachoWalker(); + + // Begin walking the header for |cpu_type| and |cpu_subtype|. If |cpu_type| + // is 0, then the native cpu type is used. Otherwise, accepted values are + // listed in /usr/include/mach/machine.h (e.g., CPU_TYPE_X86 or + // CPU_TYPE_POWERPC). If |cpu_subtype| is CPU_SUBTYPE_MULTIPLE, the match is + // only done on |cpu_type|. + // Returns false if opening the file failed or if the |cpu_type|/|cpu_subtype| + // is not present in the file. + bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); + + // Read |size| bytes from the opened file at |offset| into |buffer| + bool ReadBytes(void *buffer, size_t size, off_t offset); + + // Return the current header and header offset + bool CurrentHeader(struct mach_header_64 *header, off_t *offset); + + private: + // Locate (if any) the header offset for |cpu_type| and return in |offset|. + // Return true if found, false otherwise. + bool FindHeader(cpu_type_t cpu_type, + cpu_subtype_t cpu_subtype, + off_t &offset); + + // Process an individual header starting at |offset| from the start of the + // file. Return true if successful, false otherwise. + bool WalkHeaderAtOffset(off_t offset); + bool WalkHeader64AtOffset(off_t offset); + + // Bottleneck for walking the load commands + bool WalkHeaderCore(off_t offset, uint32_t number_of_commands, bool swap); + + // File descriptor to the opened file + int file_; + + // Memory location to read from. + void *memory_; + + // Size of the memory segment we can read from. + size_t memory_size_; + + // User specified callback & context + LoadCommandCallback callback_; + void *callback_context_; + + // Current header, size, and offset. The mach_header_64 is used for both + // 32-bit and 64-bit headers because they only differ in their last field + // (reserved). By adding the |current_header_size_| and the + // |current_header_offset_|, you can determine the offset in the file just + // after the header. + struct mach_header_64 *current_header_; + unsigned long current_header_size_; + off_t current_header_offset_; + + private: + MachoWalker(const MachoWalker &); + MachoWalker &operator=(const MachoWalker &); +}; + +} // namespace MacFileUtilities + +#endif // COMMON_MAC_MACHO_WALKER_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h b/Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h new file mode 100644 index 0000000000..d6d1bef971 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h @@ -0,0 +1,56 @@ +// Copyright (c) 2010 Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Inline implementation of ScopedTaskSuspend, which suspends a Mach +// task for the duration of its scope. + +#ifndef GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ +#define GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ + +#include + +namespace google_breakpad { + +class ScopedTaskSuspend { + public: + explicit ScopedTaskSuspend(mach_port_t target) : target_(target) { + task_suspend(target_); + } + + ~ScopedTaskSuspend() { + task_resume(target_); + } + + private: + mach_port_t target_; +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc b/Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc new file mode 100644 index 0000000000..07c0f42680 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc @@ -0,0 +1,84 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common/scoped_ptr.h" +#include "common/mac/string_utilities.h" + +namespace MacStringUtils { + +using google_breakpad::scoped_array; + +std::string ConvertToString(CFStringRef str) { + CFIndex length = CFStringGetLength(str); + std::string result; + + if (!length) + return result; + + CFIndex maxUTF8Length = + CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); + scoped_array buffer(new UInt8[maxUTF8Length + 1]); + CFIndex actualUTF8Length; + CFStringGetBytes(str, CFRangeMake(0, length), kCFStringEncodingUTF8, 0, + false, buffer.get(), maxUTF8Length, &actualUTF8Length); + buffer[actualUTF8Length] = 0; + result.assign((const char *)buffer.get()); + + return result; +} + +unsigned int IntegerValueAtIndex(string &str, unsigned int idx) { + string digits("0123456789"), temp; + size_t start = 0; + size_t end; + size_t found = 0; + unsigned int result = 0; + + for (; found <= idx; ++found) { + end = str.find_first_not_of(digits, start); + + if (end == string::npos) + end = str.size(); + + temp = str.substr(start, end - start); + + if (found == idx) { + result = atoi(temp.c_str()); + } + + start = str.find_first_of(digits, end + 1); + + if (start == string::npos) + break; + } + + return result; +} + +} // namespace MacStringUtils diff --git a/Telegram/ThirdParty/breakpad/common/mac/string_utilities.h b/Telegram/ThirdParty/breakpad/common/mac/string_utilities.h new file mode 100644 index 0000000000..6d89c834e7 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/mac/string_utilities.h @@ -0,0 +1,52 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// string_utilities.h: Utilities for strings for Mac platform + +#ifndef COMMON_MAC_STRING_UTILITIES_H__ +#define COMMON_MAC_STRING_UTILITIES_H__ + +#include + +#include + +namespace MacStringUtils { + +using std::string; + +// Convert a CoreFoundation string into a std::string +string ConvertToString(CFStringRef str); + +// Return the idx'th decimal integer in str, separated by non-decimal-digits +// E.g., str = 10.4.8, idx = 1 -> 4 +unsigned int IntegerValueAtIndex(string &str, unsigned int idx); + +} // namespace MacStringUtils + +#endif // COMMON_MAC_STRING_UTILITIES_H__ diff --git a/Telegram/ThirdParty/breakpad/common/md5.cc b/Telegram/ThirdParty/breakpad/common/md5.cc new file mode 100644 index 0000000000..a0d9a1bdd8 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/md5.cc @@ -0,0 +1,251 @@ +/* + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to MD5Init, call MD5Update as + * needed on buffers full of bytes, and then call MD5Final, which + * will fill a supplied 16-byte array with the digest. + */ + +#include + +#include "common/md5.h" + +namespace google_breakpad { + +#ifndef WORDS_BIGENDIAN +#define byteReverse(buf, len) /* Nothing */ +#else +/* + * Note: this code is harmless on little-endian machines. + */ +static void byteReverse(unsigned char *buf, unsigned longs) +{ + u32 t; + do { + t = (u32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | + ((unsigned) buf[1] << 8 | buf[0]); + *(u32 *) buf = t; + buf += 4; + } while (--longs); +} +#endif + +static void MD5Transform(u32 buf[4], u32 const in[16]); + +/* + * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious + * initialization constants. + */ +void MD5Init(struct MD5Context *ctx) +{ + ctx->buf[0] = 0x67452301; + ctx->buf[1] = 0xefcdab89; + ctx->buf[2] = 0x98badcfe; + ctx->buf[3] = 0x10325476; + + ctx->bits[0] = 0; + ctx->bits[1] = 0; +} + +/* + * Update context to reflect the concatenation of another buffer full + * of bytes. + */ +void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len) +{ + u32 t; + + /* Update bitcount */ + + t = ctx->bits[0]; + if ((ctx->bits[0] = t + ((u32) len << 3)) < t) + ctx->bits[1]++; /* Carry from low to high */ + ctx->bits[1] += len >> 29; + + t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ + + /* Handle any leading odd-sized chunks */ + + if (t) { + unsigned char *p = (unsigned char *) ctx->in + t; + + t = 64 - t; + if (len < t) { + memcpy(p, buf, len); + return; + } + memcpy(p, buf, t); + byteReverse(ctx->in, 16); + MD5Transform(ctx->buf, (u32 *) ctx->in); + buf += t; + len -= t; + } + /* Process data in 64-byte chunks */ + + while (len >= 64) { + memcpy(ctx->in, buf, 64); + byteReverse(ctx->in, 16); + MD5Transform(ctx->buf, (u32 *) ctx->in); + buf += 64; + len -= 64; + } + + /* Handle any remaining bytes of data. */ + + memcpy(ctx->in, buf, len); +} + +/* + * Final wrapup - pad to 64-byte boundary with the bit pattern + * 1 0* (64-bit count of bits processed, MSB-first) + */ +void MD5Final(unsigned char digest[16], struct MD5Context *ctx) +{ + unsigned count; + unsigned char *p; + + /* Compute number of bytes mod 64 */ + count = (ctx->bits[0] >> 3) & 0x3F; + + /* Set the first char of padding to 0x80. This is safe since there is + always at least one byte free */ + p = ctx->in + count; + *p++ = 0x80; + + /* Bytes of padding needed to make 64 bytes */ + count = 64 - 1 - count; + + /* Pad out to 56 mod 64 */ + if (count < 8) { + /* Two lots of padding: Pad the first block to 64 bytes */ + memset(p, 0, count); + byteReverse(ctx->in, 16); + MD5Transform(ctx->buf, (u32 *) ctx->in); + + /* Now fill the next block with 56 bytes */ + memset(ctx->in, 0, 56); + } else { + /* Pad block to 56 bytes */ + memset(p, 0, count - 8); + } + byteReverse(ctx->in, 14); + + /* Append length in bits and transform */ + ((u32 *) ctx->in)[14] = ctx->bits[0]; + ((u32 *) ctx->in)[15] = ctx->bits[1]; + + MD5Transform(ctx->buf, (u32 *) ctx->in); + byteReverse((unsigned char *) ctx->buf, 4); + memcpy(digest, ctx->buf, 16); + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ +} + +/* The four core functions - F1 is optimized somewhat */ + +/* #define F1(x, y, z) (x & y | ~x & z) */ +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) + +/* This is the central step in the MD5 algorithm. */ +#define MD5STEP(f, w, x, y, z, data, s) \ + ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) + +/* + * The core of the MD5 algorithm, this alters an existing MD5 hash to + * reflect the addition of 16 longwords of new data. MD5Update blocks + * the data and converts bytes into longwords for this routine. + */ +static void MD5Transform(u32 buf[4], u32 const in[16]) +{ + u32 a, b, c, d; + + a = buf[0]; + b = buf[1]; + c = buf[2]; + d = buf[3]; + + MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); + MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); + MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); + MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); + MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); + MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); + MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); + MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); + MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); + MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); + MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); + MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); + MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); + MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); + MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); + MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); + + MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); + MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); + MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); + MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); + MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); + MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); + MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); + MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); + MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); + MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); + MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); + MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); + MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); + MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); + MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); + MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); + + MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); + MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); + MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); + MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); + MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); + MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); + MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); + MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); + MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); + MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); + MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); + MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); + MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); + MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); + MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); + MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); + + MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); + MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); + MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); + MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); + MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); + MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); + MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); + MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); + MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); + MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); + MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); + MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); + MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); + MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); + MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); + MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} + +} // namespace google_breakpad + diff --git a/Telegram/ThirdParty/breakpad/common/md5.h b/Telegram/ThirdParty/breakpad/common/md5.h new file mode 100644 index 0000000000..2ab0ab95ae --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/md5.h @@ -0,0 +1,27 @@ +// Copyright 2007 Google Inc. All Rights Reserved. +// Author: liuli@google.com (Liu Li) +#ifndef COMMON_MD5_H__ +#define COMMON_MD5_H__ + +#include + +namespace google_breakpad { + +typedef uint32_t u32; +typedef uint8_t u8; + +struct MD5Context { + u32 buf[4]; + u32 bits[2]; + u8 in[64]; +}; + +void MD5Init(struct MD5Context *ctx); + +void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len); + +void MD5Final(unsigned char digest[16], struct MD5Context *ctx); + +} // namespace google_breakpad + +#endif // COMMON_MD5_H__ diff --git a/Telegram/ThirdParty/breakpad/common/memory.h b/Telegram/ThirdParty/breakpad/common/memory.h new file mode 100644 index 0000000000..d6aa137d35 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/memory.h @@ -0,0 +1,212 @@ +// Copyright (c) 2009, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_ +#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_ + +#include +#include +#include +#include + +#include +#include + +#if defined(MEMORY_SANITIZER) +#include +#endif + +#ifdef __APPLE__ +#define sys_mmap mmap +#define sys_mmap2 mmap +#define sys_munmap munmap +#define MAP_ANONYMOUS MAP_ANON +#else +#include "third_party/lss/linux_syscall_support.h" +#endif + +namespace google_breakpad { + +// This is very simple allocator which fetches pages from the kernel directly. +// Thus, it can be used even when the heap may be corrupted. +// +// There is no free operation. The pages are only freed when the object is +// destroyed. +class PageAllocator { + public: + PageAllocator() + : page_size_(getpagesize()), + last_(NULL), + current_page_(NULL), + page_offset_(0) { + } + + ~PageAllocator() { + FreeAll(); + } + + void *Alloc(size_t bytes) { + if (!bytes) + return NULL; + + if (current_page_ && page_size_ - page_offset_ >= bytes) { + uint8_t *const ret = current_page_ + page_offset_; + page_offset_ += bytes; + if (page_offset_ == page_size_) { + page_offset_ = 0; + current_page_ = NULL; + } + + return ret; + } + + const size_t pages = + (bytes + sizeof(PageHeader) + page_size_ - 1) / page_size_; + uint8_t *const ret = GetNPages(pages); + if (!ret) + return NULL; + + page_offset_ = + (page_size_ - (page_size_ * pages - (bytes + sizeof(PageHeader)))) % + page_size_; + current_page_ = page_offset_ ? ret + page_size_ * (pages - 1) : NULL; + + return ret + sizeof(PageHeader); + } + + // Checks whether the page allocator owns the passed-in pointer. + // This method exists for testing pursposes only. + bool OwnsPointer(const void* p) { + for (PageHeader* header = last_; header; header = header->next) { + const char* current = reinterpret_cast(header); + if ((p >= current) && (p < current + header->num_pages * page_size_)) + return true; + } + + return false; + } + + private: + uint8_t *GetNPages(size_t num_pages) { +#if defined(__x86_64__) || defined(__aarch64__) || defined(__aarch64__) || \ + ((defined(__mips__) && _MIPS_SIM == _ABI64)) + void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#else + void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#endif + if (a == MAP_FAILED) + return NULL; + +#if defined(MEMORY_SANITIZER) + // We need to indicate to MSan that memory allocated through sys_mmap is + // initialized, since linux_syscall_support.h doesn't have MSan hooks. + __msan_unpoison(a, page_size_ * num_pages); +#endif + + struct PageHeader *header = reinterpret_cast(a); + header->next = last_; + header->num_pages = num_pages; + last_ = header; + + return reinterpret_cast(a); + } + + void FreeAll() { + PageHeader *next; + + for (PageHeader *cur = last_; cur; cur = next) { + next = cur->next; + sys_munmap(cur, cur->num_pages * page_size_); + } + } + + struct PageHeader { + PageHeader *next; // pointer to the start of the next set of pages. + size_t num_pages; // the number of pages in this set. + }; + + const size_t page_size_; + PageHeader *last_; + uint8_t *current_page_; + size_t page_offset_; +}; + +// Wrapper to use with STL containers +template +struct PageStdAllocator : public std::allocator { + typedef typename std::allocator::pointer pointer; + typedef typename std::allocator::size_type size_type; + + explicit PageStdAllocator(PageAllocator& allocator): allocator_(allocator) {} + template PageStdAllocator(const PageStdAllocator& other) + : allocator_(other.allocator_) {} + + inline pointer allocate(size_type n, const void* = 0) { + return static_cast(allocator_.Alloc(sizeof(T) * n)); + } + + inline void deallocate(pointer, size_type) { + // The PageAllocator doesn't free. + } + + template struct rebind { + typedef PageStdAllocator other; + }; + + private: + // Silly workaround for the gcc from Android's ndk (gcc 4.6), which will + // otherwise complain that `other.allocator_` is private in the constructor + // code. + template friend struct PageStdAllocator; + + PageAllocator& allocator_; +}; + +// A wasteful vector is a std::vector, except that it allocates memory from a +// PageAllocator. It's wasteful because, when resizing, it always allocates a +// whole new array since the PageAllocator doesn't support realloc. +template +class wasteful_vector : public std::vector > { + public: + wasteful_vector(PageAllocator* allocator, unsigned size_hint = 16) + : std::vector >(PageStdAllocator(*allocator)) { + std::vector >::reserve(size_hint); + } +}; + +} // namespace google_breakpad + +inline void* operator new(size_t nbytes, + google_breakpad::PageAllocator& allocator) { + return allocator.Alloc(nbytes); +} + +#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_ diff --git a/Telegram/ThirdParty/breakpad/common/string_conversion.cc b/Telegram/ThirdParty/breakpad/common/string_conversion.cc new file mode 100644 index 0000000000..9c0d623fc1 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/string_conversion.cc @@ -0,0 +1,155 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "common/convert_UTF.h" +#include "common/scoped_ptr.h" +#include "common/string_conversion.h" +#include "common/using_std_string.h" + +namespace google_breakpad { + +using std::vector; + +void UTF8ToUTF16(const char *in, vector *out) { + size_t source_length = strlen(in); + const UTF8 *source_ptr = reinterpret_cast(in); + const UTF8 *source_end_ptr = source_ptr + source_length; + // Erase the contents and zero fill to the expected size + out->clear(); + out->insert(out->begin(), source_length, 0); + uint16_t *target_ptr = &(*out)[0]; + uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t); + ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr, + &target_ptr, target_end_ptr, + strictConversion); + + // Resize to be the size of the # of converted characters + NULL + out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0); +} + +int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]) { + const UTF8 *source_ptr = reinterpret_cast(in); + const UTF8 *source_end_ptr = source_ptr + sizeof(char); + uint16_t *target_ptr = out; + uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t); + out[0] = out[1] = 0; + + // Process one character at a time + while (1) { + ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr, + &target_ptr, target_end_ptr, + strictConversion); + + if (result == conversionOK) + return static_cast(source_ptr - reinterpret_cast(in)); + + // Add another character to the input stream and try again + source_ptr = reinterpret_cast(in); + ++source_end_ptr; + + if (source_end_ptr > reinterpret_cast(in) + in_length) + break; + } + + return 0; +} + +void UTF32ToUTF16(const wchar_t *in, vector *out) { + size_t source_length = wcslen(in); + const UTF32 *source_ptr = reinterpret_cast(in); + const UTF32 *source_end_ptr = source_ptr + source_length; + // Erase the contents and zero fill to the expected size + out->clear(); + out->insert(out->begin(), source_length, 0); + uint16_t *target_ptr = &(*out)[0]; + uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t); + ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr, + &target_ptr, target_end_ptr, + strictConversion); + + // Resize to be the size of the # of converted characters + NULL + out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0); +} + +void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]) { + const UTF32 *source_ptr = reinterpret_cast(&in); + const UTF32 *source_end_ptr = source_ptr + 1; + uint16_t *target_ptr = out; + uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t); + out[0] = out[1] = 0; + ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr, + &target_ptr, target_end_ptr, + strictConversion); + + if (result != conversionOK) { + out[0] = out[1] = 0; + } +} + +static inline uint16_t Swap(uint16_t value) { + return (value >> 8) | static_cast(value << 8); +} + +string UTF16ToUTF8(const vector &in, bool swap) { + const UTF16 *source_ptr = &in[0]; + scoped_array source_buffer; + + // If we're to swap, we need to make a local copy and swap each byte pair + if (swap) { + int idx = 0; + source_buffer.reset(new uint16_t[in.size()]); + UTF16 *source_buffer_ptr = source_buffer.get(); + for (vector::const_iterator it = in.begin(); + it != in.end(); ++it, ++idx) + source_buffer_ptr[idx] = Swap(*it); + + source_ptr = source_buffer.get(); + } + + // The maximum expansion would be 4x the size of the input string. + const UTF16 *source_end_ptr = source_ptr + in.size(); + size_t target_capacity = in.size() * 4; + scoped_array target_buffer(new UTF8[target_capacity]); + UTF8 *target_ptr = target_buffer.get(); + UTF8 *target_end_ptr = target_ptr + target_capacity; + ConversionResult result = ConvertUTF16toUTF8(&source_ptr, source_end_ptr, + &target_ptr, target_end_ptr, + strictConversion); + + if (result == conversionOK) { + const char *targetPtr = reinterpret_cast(target_buffer.get()); + return targetPtr; + } + + return ""; +} + +} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/string_conversion.h b/Telegram/ThirdParty/breakpad/common/string_conversion.h new file mode 100644 index 0000000000..b9ba96a2e1 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/string_conversion.h @@ -0,0 +1,68 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// string_conversion.h: Conversion between different UTF-8/16/32 encodings. + +#ifndef COMMON_STRING_CONVERSION_H__ +#define COMMON_STRING_CONVERSION_H__ + +#include +#include + +#include "common/using_std_string.h" +#include "google_breakpad/common/breakpad_types.h" + +namespace google_breakpad { + +using std::vector; + +// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the +// conversion failed, |out| will be zero length. +void UTF8ToUTF16(const char *in, vector *out); + +// Convert at least one character (up to a maximum of |in_length|) from |in| +// to UTF-16 into |out|. Return the number of characters consumed from |in|. +// Any unused characters in |out| will be initialized to 0. No memory will +// be allocated by this routine. +int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]); + +// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the +// conversion failed, |out| will be zero length. +void UTF32ToUTF16(const wchar_t *in, vector *out); + +// Convert |in| to UTF-16 into |out|. Any unused characters in |out| will be +// initialized to 0. No memory will be allocated by this routine. +void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]); + +// Convert |in| to UTF-8. If |swap| is true, swap bytes before converting. +string UTF16ToUTF8(const vector &in, bool swap); + +} // namespace google_breakpad + +#endif // COMMON_STRING_CONVERSION_H__ diff --git a/Telegram/ThirdParty/breakpad/common/using_std_string.h b/Telegram/ThirdParty/breakpad/common/using_std_string.h new file mode 100644 index 0000000000..13c1da59cc --- /dev/null +++ b/Telegram/ThirdParty/breakpad/common/using_std_string.h @@ -0,0 +1,65 @@ +// -*- mode: C++ -*- + +// Copyright (c) 2012, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Original author: Ivan Penkov + +// using_std_string.h: Allows building this code in environments where +// global string (::string) exists. +// +// The problem: +// ------------- +// Let's say you want to build this code in an environment where a global +// string type is defined (i.e. ::string). Now, let's suppose that ::string +// is different that std::string and you'd like to have the option to easily +// choose between the two string types. Ideally you'd like to control which +// string type is chosen by simply #defining an identifier. +// +// The solution: +// ------------- +// #define HAS_GLOBAL_STRING somewhere in a global header file and then +// globally replace std::string with string. Then include this header +// file everywhere where string is used. If you want to revert back to +// using std::string, simply remove the #define (HAS_GLOBAL_STRING). + +#ifndef THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_ +#define THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_ + +#ifdef HAS_GLOBAL_STRING + typedef ::string google_breakpad_string; +#else + using std::string; + typedef std::string google_breakpad_string; +#endif + +// Inicates that type google_breakpad_string is defined +#define HAS_GOOGLE_BREAKPAD_STRING + +#endif // THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h new file mode 100644 index 0000000000..918544b662 --- /dev/null +++ b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h @@ -0,0 +1,107 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +// minidump_size.h: Provides a C++ template for programmatic access to +// the sizes of various types defined in minidump_format.h. +// +// Author: Mark Mentovai + +#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__ +#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__ + +#include + +#include "google_breakpad/common/minidump_format.h" + +namespace google_breakpad { + +template +class minidump_size { + public: + static size_t size() { return sizeof(T); } +}; + +// Explicit specializations for variable-length types. The size returned +// for these should be the size for an object without its variable-length +// section. + +template<> +class minidump_size { + public: + static size_t size() { return MDString_minsize; } +}; + +template<> +class minidump_size { + public: + static size_t size() { return MDRawThreadList_minsize; } +}; + +template<> +class minidump_size { + public: + static size_t size() { return MDCVInfoPDB20_minsize; } +}; + +template<> +class minidump_size { + public: + static size_t size() { return MDCVInfoPDB70_minsize; } +}; + +template<> +class minidump_size { + public: + static size_t size() { return MDImageDebugMisc_minsize; } +}; + +template<> +class minidump_size { + public: + static size_t size() { return MDRawModuleList_minsize; } +}; + +template<> +class minidump_size { + public: + static size_t size() { return MDRawMemoryList_minsize; } +}; + +// Explicit specialization for MDRawModule, for which sizeof may include +// tail-padding on some architectures but not others. + +template<> +class minidump_size { + public: + static size_t size() { return MD_MODULE_SIZE; } +}; + +} // namespace google_breakpad + +#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__ diff --git a/Telegram/ThirdParty/minizip/ioapi.c b/Telegram/ThirdParty/minizip/ioapi.c new file mode 100644 index 0000000000..7f5c191b2a --- /dev/null +++ b/Telegram/ThirdParty/minizip/ioapi.c @@ -0,0 +1,247 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS))) + #define _CRT_SECURE_NO_WARNINGS +#endif + +#if defined(__APPLE__) || defined(IOAPI_NO_64) +// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions +#define FOPEN_FUNC(filename, mode) fopen(filename, mode) +#define FTELLO_FUNC(stream) ftello(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin) +#else +#define FOPEN_FUNC(filename, mode) fopen64(filename, mode) +#define FTELLO_FUNC(stream) ftello64(stream) +#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin) +#endif + + +#include "ioapi.h" + +voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) +{ + if (pfilefunc->zfile_func64.zopen64_file != NULL) + return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); + else + { + return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); + } +} + +long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); + else + { + uLong offsetTruncated = (uLong)offset; + if (offsetTruncated != offset) + return -1; + else + return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); + } +} + +ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); + else + { + uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); + if ((tell_uLong) == MAXU32) + return (ZPOS64_T)-1; + else + return tell_uLong; + } +} + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) +{ + p_filefunc64_32->zfile_func64.zopen64_file = NULL; + p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; + p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; + p_filefunc64_32->zfile_func64.ztell64_file = NULL; + p_filefunc64_32->zfile_func64.zseek64_file = NULL; + p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; + p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; + p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; +} + + + +static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); +static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); +static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); +static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); +static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); + +static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + +static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = FOPEN_FUNC((const char*)filename, mode_fopen); + return file; +} + + +static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + + +static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) +{ + ZPOS64_T ret; + ret = FTELLO_FUNC((FILE *)stream); + return ret; +} + +static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + if (fseek((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + return ret; +} + +static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + + if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + + return ret; +} + + +static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = fopen64_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell64_file = ftell64_file_func; + pzlib_filefunc_def->zseek64_file = fseek64_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/Telegram/ThirdParty/minizip/zip.c b/Telegram/ThirdParty/minizip/zip.c index ea54853e85..3c1a7bff25 100644 --- a/Telegram/ThirdParty/minizip/zip.c +++ b/Telegram/ThirdParty/minizip/zip.c @@ -1411,7 +1411,7 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in if (zi->in_opened_file_inzip == 0) return ZIP_PARAMERROR; - zi->ci.crc32 = crc32(zi->ci.crc32,buf,(uInt)len); + zi->ci.crc32 = crc32(zi->ci.crc32,(const Bytef *)buf,(uInt)len); #ifdef HAVE_BZIP2 if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw)) From b1f267e4dcaaf928cad89b7d2d88cf1a45b166ce Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Feb 2016 13:39:51 +0300 Subject: [PATCH 040/316] added breakpad for linux --- Telegram/Telegram.pro | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 64d4739b0b..b0ea1e9d8c 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -273,11 +273,16 @@ HEADERS += \ ./SourceFiles/pspecific_mac.h } +SOURCES += \ + ./ThirdParty/minizip/zip.c \ + ./ThirdParty/minizip/ioapi.c + CONFIG += precompile_header PRECOMPILED_HEADER = ./SourceFiles/stdafx.h QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-result -Wno-unused-parameter -Wno-unused-variable -Wno-switch -Wno-comment -Wno-unused-but-set-variable +QMAKE_CFLAGS_WARN_ON += -Wno-unused-result -Wno-unused-parameter -Wno-unused-variable -Wno-switch -Wno-comment -Wno-unused-but-set-variable CONFIG(release, debug|release) { QMAKE_CXXFLAGS_RELEASE -= -O2 @@ -294,7 +299,9 @@ INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\ ./../../Libraries/QtStatic/qtbase/include\ /usr/local/include/opus\ ./SourceFiles\ - ./GeneratedFiles + ./GeneratedFiles\ + ./ThirdParty/minizip\ + ./../../Libraries/breakpad/src INCLUDEPATH += "/usr/include/libappindicator-0.1" INCLUDEPATH += "/usr/include/gtk-2.0" @@ -311,11 +318,13 @@ INCLUDEPATH += "/usr/include/atk-1.0" INCLUDEPATH += "/usr/include/dee-1.0" INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4" -LIBS += -lcrypto -lssl -lz -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva +LIBS += -lcrypto -lssl -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a +LIBS += /usr/local/lib/libz.a LIBS += /usr/local/lib/libxkbcommon.a +LIBS += ./../../../Libraries/breakpad/src/client/linux/libbreakpad_client.a RESOURCES += \ ./SourceFiles/telegram.qrc \ From fa2767cc656d0f034fdc7f218147d9af4d3b883a Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Feb 2016 14:09:11 +0300 Subject: [PATCH 041/316] always writing tdata/working stacktrace when breakpad catches a crash --- Telegram/SourceFiles/logs.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 086c7b4612..bebdd736b0 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -389,8 +389,6 @@ namespace Logs { return false; } - - if (LogsInMemory) { t_assert(LogsInMemory != DeletedLogsInMemory); LogsInMemoryList list = *LogsInMemory; @@ -720,7 +718,9 @@ namespace SignalHandlers { } if (name) { dump() << "Caught signal " << signum << " (" << name << ") in thread " << uint64(thread) << "\n"; - } else { + } else if (signum == -1) { + dump() << "Google Breakpad caught a crash, minidump written in thread " << uint64(thread) << "\n"; + } else { dump() << "Caught signal " << signum << " in thread " << uint64(thread) << "\n"; } @@ -809,9 +809,7 @@ namespace SignalHandlers { bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) #endif { -#ifdef Q_OS_MAC Handler(-1, 0, 0); -#endif return success; } From 9f7b92eccd6dfca201cbef9d947103d7b9016b8d Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Feb 2016 14:50:07 +0300 Subject: [PATCH 042/316] improved minidump choosing when sending crash report --- Telegram/SourceFiles/logs.cpp | 32 +++++++++++++++++++ Telegram/SourceFiles/logs.h | 1 + Telegram/SourceFiles/window.cpp | 56 ++++++++++++++++++++------------- 3 files changed, 68 insertions(+), 21 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index bebdd736b0..54e754364a 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -600,6 +600,19 @@ namespace SignalHandlers { return stream; } + const dump &operator<<(const dump &stream, const wchar_t *str) { + if (!CrashDumpFile) return stream; + + for (int i = 0, l = wcslen(str); i < l; ++i) { + if (str[i] >= 0 && str[i] < 128) { + _writeChar(char(str[i])); + } else { + _writeChar('?'); + } + } + return stream; + } + template const dump &_writeNumber(const dump &stream, Type number) { if (!CrashDumpFile) return stream; @@ -658,6 +671,9 @@ namespace SignalHandlers { bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; + const char *BreakpadDumpPath = 0; + const wchar_t *BreakpadDumpPathW = 0; + // see https://github.com/benbjohnson/bandicoot #if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 struct sigaction SIG_def[32]; @@ -720,6 +736,11 @@ namespace SignalHandlers { dump() << "Caught signal " << signum << " (" << name << ") in thread " << uint64(thread) << "\n"; } else if (signum == -1) { dump() << "Google Breakpad caught a crash, minidump written in thread " << uint64(thread) << "\n"; + if (BreakpadDumpPath) { + dump() << "Minidump: " << BreakpadDumpPath << "\n"; + } else if (BreakpadDumpPathW) { + dump() << "Minidump: " << BreakpadDumpPathW << "\n"; + } } else { dump() << "Caught signal " << signum << " in thread " << uint64(thread) << "\n"; } @@ -809,7 +830,18 @@ namespace SignalHandlers { bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) #endif { +#ifdef Q_OS_WIN + BreakpadDumpPathW = _minidump_id; + Handler(-1); +#else + +#ifdef Q_OS_MAC + BreakpadDumpPath = _minidump_id; +#else + BreakpadDumpPath = md.path(); +#endif Handler(-1, 0, 0); +#endif return success; } diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 9deebadb1c..e8e2c99984 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -92,6 +92,7 @@ namespace SignalHandlers { ~dump(); }; const dump &operator<<(const dump &stream, const char *str); + const dump &operator<<(const dump &stream, const wchar_t *str); const dump &operator<<(const dump &stream, int num); const dump &operator<<(const dump &stream, unsigned int num); const dump &operator<<(const dump &stream, unsigned long num); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index d4ae8fc398..9e3c8ccff7 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2018,28 +2018,42 @@ LastCrashedWindow::LastCrashedWindow() { if (_sendingState != SendingNoReport) { - QString maxDump, maxDumpFull; - QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); - qint64 maxDumpSize = 0; - QFileInfoList list = QDir(cWorkingDir() + qsl("tdumps")).entryInfoList(); - for (int32 i = 0, l = list.size(); i < l; ++i) { - QString name = list.at(i).fileName(); - if (name.endsWith(qstr(".dmp"))) { - QDateTime modified = list.at(i).lastModified(); - if (maxDump.isEmpty() || qAbs(workingModified.secsTo(modified)) < qAbs(workingModified.secsTo(maxDumpModified))) { - maxDump = name; - maxDumpModified = modified; - maxDumpFull = list.at(i).absoluteFilePath(); - maxDumpSize = list.at(i).size(); - } - } - } - if (!maxDump.isEmpty() && qAbs(workingModified.secsTo(maxDumpModified)) < 10) { - _minidumpName = maxDump; - _minidumpFull = maxDumpFull; - } + qint64 dumpSize = 0; + QString possibleDump = getReportField(qstr("minidump"), qstr("Minidump:")); + if (!possibleDump.isEmpty()) { + if (!possibleDump.startsWith('/')) { + possibleDump = cWorkingDir() + qsl("tdumps/") + possibleDump; + } + QFileInfo possibleInfo(possibleDump); + if (possibleInfo.exists()) { + _minidumpName = possibleInfo.fileName(); + _minidumpFull = possibleInfo.absoluteFilePath(); + dumpSize = possibleInfo.size(); + } + } + if (_minidumpFull.isEmpty()) { + QString maxDump, maxDumpFull; + QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); + QFileInfoList list = QDir(cWorkingDir() + qsl("tdumps")).entryInfoList(); + for (int32 i = 0, l = list.size(); i < l; ++i) { + QString name = list.at(i).fileName(); + if (name.endsWith(qstr(".dmp"))) { + QDateTime modified = list.at(i).lastModified(); + if (maxDump.isEmpty() || qAbs(workingModified.secsTo(modified)) < qAbs(workingModified.secsTo(maxDumpModified))) { + maxDump = name; + maxDumpModified = modified; + maxDumpFull = list.at(i).absoluteFilePath(); + dumpSize = list.at(i).size(); + } + } + } + if (!maxDump.isEmpty() && qAbs(workingModified.secsTo(maxDumpModified)) < 10) { + _minidumpName = maxDump; + _minidumpFull = maxDumpFull; + } + } - _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(maxDumpSize / 1024)); + _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(dumpSize / 1024)); } _networkSettings.setText(qsl("NETWORK SETTINGS")); From 44c12064a65847b0451b9ea7c14e3fb20841f7ae Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Feb 2016 15:09:23 +0300 Subject: [PATCH 043/316] fixed crash reports for windows --- Telegram/SourceFiles/logs.cpp | 2 +- Telegram/SourceFiles/window.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 54e754364a..78c6f4437d 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -19,7 +19,7 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include +#include #include "pspecific.h" // see https://blog.inventic.eu/2012/08/qt-and-google-breakpad/ diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 9e3c8ccff7..e675b15bb2 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2024,6 +2024,9 @@ LastCrashedWindow::LastCrashedWindow() if (!possibleDump.startsWith('/')) { possibleDump = cWorkingDir() + qsl("tdumps/") + possibleDump; } + if (!possibleDump.endsWith('.dmp')) { + possibleDump += qsl(".dmp"); + } QFileInfo possibleInfo(possibleDump); if (possibleInfo.exists()) { _minidumpName = possibleInfo.fileName(); From 5940ae6411e6e67702d9093af90926d6424c66dc Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 2 Feb 2016 14:48:46 +0300 Subject: [PATCH 044/316] google crashpad added to os x version --- Telegram/SourceFiles/logs.cpp | 115 ++++---- Telegram/SourceFiles/pspecific_mac.cpp | 4 + Telegram/SourceFiles/settings.cpp | 42 ++- Telegram/SourceFiles/settings.h | 1 + Telegram/SourceFiles/window.cpp | 7 +- Telegram/Telegram.xcodeproj/project.pbxproj | 276 +++----------------- 6 files changed, 135 insertions(+), 310 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index bebdd736b0..a3cb642ea7 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -26,7 +26,13 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #ifdef Q_OS_WIN #include "client/windows/handler/exception_handler.h" #elif defined Q_OS_MAC + +#ifdef MAC_USE_BREAKPAD #include "client/mac/handler/exception_handler.h" +#else +#include "client/crashpad_client.h" +#endif + #elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 #include "client/linux/handler/exception_handler.h" #endif @@ -658,6 +664,9 @@ namespace SignalHandlers { bool LoggingCrashHeaderWritten = false; QMutex LoggingCrashMutex; + typedef std::map AnnotationsMap; + AnnotationsMap ProcessAnnotations; + // see https://github.com/benbjohnson/bandicoot #if defined Q_OS_MAC || defined Q_OS_LINUX32 || defined Q_OS_LINUX64 struct sigaction SIG_def[32]; @@ -691,28 +700,9 @@ namespace SignalHandlers { if (!LoggingCrashHeaderWritten) { LoggingCrashHeaderWritten = true; - dump() << "Binary: " << LaunchedBinaryName << "\n"; - dump() << "ApiId: " << ApiId << "\n"; - if (cBetaVersion()) { - dump() << "Version: " << cBetaVersion() << " beta\n"; - } else { - dump() << "Version: " << AppVersion; - if (cDevVersion()) { - dump() << " dev\n"; - } else { - dump() << "\n"; - } + for (AnnotationsMap::const_iterator i = ProcessAnnotations.cbegin(), e = ProcessAnnotations.cend(); i != e; ++i) { + dump() << i->first.c_str() << ": " << i->second.c_str() << "\n"; } - dump() << "Launched: " << LaunchedDateTimeStr << "\n"; - dump() << "Platform: "; - switch (cPlatform()) { - case dbipWindows: dump() << "win"; break; - case dbipMac: dump() << "mac"; break; - case dbipMacOld: dump() << "macold"; break; - case dbipLinux64: dump() << "linux64"; break; - case dbipLinux32: dump() << "linux32"; break; - } - dump() << "\n"; psWriteDump(); dump() << "\n"; } @@ -799,6 +789,8 @@ namespace SignalHandlers { LoggingCrashThreadId = 0; } + bool SetSignalHandlers = true; +#if !defined Q_OS_MAC || defined MAC_USE_BREAKPAD google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0; #ifdef Q_OS_WIN @@ -812,31 +804,54 @@ namespace SignalHandlers { Handler(-1, 0, 0); return success; } +#endif void StartBreakpad() { - QString dumpPath = cWorkingDir() + qsl("tdumps"); - QDir().mkpath(dumpPath); + ProcessAnnotations["Binary"] = cExeName().toUtf8().toStdString(); + ProcessAnnotations["ApiId"] = QString::number(ApiId).toUtf8().toStdString(); + ProcessAnnotations["Version"] = (cBetaVersion() ? qsl("%1 beta").arg(cBetaVersion()) : (cDevVersion() ? qsl("%1 dev") : qsl("%1")).arg(AppVersion)).toUtf8().toStdString(); + ProcessAnnotations["Launched"] = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8().toStdString(); + ProcessAnnotations["Platform"] = cPlatformString().toUtf8().toStdString(); + + QString dumpspath = cWorkingDir() + qsl("tdata/dumps"); + QDir().mkpath(dumpspath); #ifdef Q_OS_WIN BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( - dumpPath.toStdWString(), + dumpspath.toStdWString(), /*FilterCallback*/ 0, DumpCallback, /*context*/ 0, true ); #elif defined Q_OS_MAC + +#ifdef MAC_USE_BREAKPAD BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( - dumpPath.toStdString(), + dumpspath.toUtf8().toStdString(), /*FilterCallback*/ 0, DumpCallback, /*context*/ 0, true, 0 ); + SetSignalHandlers = false; +#else + crashpad::CrashpadClient crashpad_client; + std::string handler = (cExeDir() + cExeName() + qsl("/Contents/Helpers/crashpad_handler")).toUtf8().toStdString(); + std::string database = dumpspath.toUtf8().toStdString(); + if (crashpad_client.StartHandler(base::FilePath(handler), + base::FilePath(database), + std::string(), + ProcessAnnotations, + std::vector(), + false)) { + crashpad_client.UseHandler(); + } +#endif #elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( - google_breakpad::MinidumpDescriptor(dumpPath.toStdString()), + google_breakpad::MinidumpDescriptor(dumpspath.toUtf8().toStdString()), /*FilterCallback*/ 0, DumpCallback, /*context*/ 0, @@ -847,11 +862,13 @@ namespace SignalHandlers { } void FinishBreakpad() { +#if !defined Q_OS_MAC || defined MAC_USE_BREAKPAD if (BreakpadExceptionHandler) { google_breakpad::ExceptionHandler *h = BreakpadExceptionHandler; BreakpadExceptionHandler = 0; delete h; } +#endif } Status start() { @@ -882,36 +899,27 @@ namespace SignalHandlers { CrashDumpFile = fopen(CrashDumpPath.constData(), "wb"); if (CrashDumpFile) { CrashDumpFileNo = fileno(CrashDumpFile); - - QByteArray launchedDateTime = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8(); - t_assert(launchedDateTime.size() < int(sizeof(LaunchedDateTimeStr))); - memcpy(LaunchedDateTimeStr, launchedDateTime.constData(), launchedDateTime.size()); - - QByteArray launchedBinaryName = cExeName().toUtf8(); - t_assert(launchedBinaryName.size() < int(sizeof(LaunchedBinaryName))); - memcpy(LaunchedBinaryName, launchedBinaryName.constData(), launchedBinaryName.size()); - + if (SetSignalHandlers) { #ifndef Q_OS_WIN - struct sigaction sigact; + struct sigaction sigact; - sigact.sa_sigaction = SignalHandlers::Handler; - sigemptyset(&sigact.sa_mask); - sigact.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; + sigact.sa_sigaction = SignalHandlers::Handler; + sigemptyset(&sigact.sa_mask); + sigact.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; -#ifndef Q_OS_MAC // let breakpad handle this - sigaction(SIGABRT, &sigact, &SIG_def[SIGABRT]); -#endif - sigaction(SIGSEGV, &sigact, &SIG_def[SIGSEGV]); - sigaction(SIGILL, &sigact, &SIG_def[SIGILL]); - sigaction(SIGFPE, &sigact, &SIG_def[SIGFPE]); - sigaction(SIGBUS, &sigact, &SIG_def[SIGBUS]); - sigaction(SIGSYS, &sigact, &SIG_def[SIGSYS]); + sigaction(SIGABRT, &sigact, &SIG_def[SIGABRT]); + sigaction(SIGSEGV, &sigact, &SIG_def[SIGSEGV]); + sigaction(SIGILL, &sigact, &SIG_def[SIGILL]); + sigaction(SIGFPE, &sigact, &SIG_def[SIGFPE]); + sigaction(SIGBUS, &sigact, &SIG_def[SIGBUS]); + sigaction(SIGSYS, &sigact, &SIG_def[SIGSYS]); #else - signal(SIGABRT, SignalHandlers::Handler); - signal(SIGSEGV, SignalHandlers::Handler); - signal(SIGILL, SignalHandlers::Handler); - signal(SIGFPE, SignalHandlers::Handler); + signal(SIGABRT, SignalHandlers::Handler); + signal(SIGSEGV, SignalHandlers::Handler); + signal(SIGILL, SignalHandlers::Handler); + signal(SIGFPE, SignalHandlers::Handler); #endif + } return Started; } @@ -921,10 +929,7 @@ namespace SignalHandlers { } void finish() { - if (BreakpadExceptionHandler) { - delete BreakpadExceptionHandler; - BreakpadExceptionHandler = 0; - } + FinishBreakpad(); if (CrashDumpFile) { fclose(CrashDumpFile); unlink(CrashDumpPath.constData()); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index e86334561f..2b51f85b88 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -688,6 +688,10 @@ QString psPrepareCrashDump(const QByteArray &crashdump, QString dumpfile) { result.append(qstr("BAD LINE: ")).append(line).append('\n'); continue; } + if (lst.size() > 5 && lst.at(3) == qsl("0x0") && lst.at(4) == qsl("+") && lst.at(5) == qsl("1")) { + result.append(qsl("(0x1 separator)\n")); + continue; + } if (i - start < atos.size()) { if (!atos.at(i - start).isEmpty()) { result.append(atos.at(i - start)).append('\n'); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 7d77c05eef..e17e7f0eaa 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -139,19 +139,17 @@ bool gCustomNotifies = true; #ifdef Q_OS_WIN DBIPlatform gPlatform = dbipWindows; -QUrl gUpdateURL = QUrl(qsl("http://tdesktop.com/win/tupdates/current")); #elif defined Q_OS_MAC DBIPlatform gPlatform = dbipMac; -QUrl gUpdateURL = QUrl(qsl("http://tdesktop.com/mac/tupdates/current")); -#elif defined Q_OS_LINUX32 -DBIPlatform gPlatform = dbipLinux32; -QUrl gUpdateURL = QUrl(qsl("http://tdesktop.com/linux32/tupdates/current")); #elif defined Q_OS_LINUX64 DBIPlatform gPlatform = dbipLinux64; -QUrl gUpdateURL = QUrl(qsl("http://tdesktop.com/linux/tupdates/current")); +#elif defined Q_OS_LINUX32 +DBIPlatform gPlatform = dbipLinux32; #else #error Unknown platform #endif +QString gPlatformString; +QUrl gUpdateURL; bool gIsElCapitan = false; bool gContactsReceived = false; @@ -183,14 +181,36 @@ bool gAutoPlayGif = true; void settingsParseArgs(int argc, char *argv[]) { #ifdef Q_OS_MAC - gIsElCapitan = (QSysInfo::macVersion() >= QSysInfo::MV_10_11); - if (QSysInfo::macVersion() < QSysInfo::MV_10_8) { - gUpdateURL = QUrl(qsl("http://tdesktop.com/mac32/tupdates/current")); + if (QSysInfo::macVersion() >= QSysInfo::MV_10_11) { + gIsElCapitan = true; + } else if (QSysInfo::macVersion() < QSysInfo::MV_10_8) { gPlatform = dbipMacOld; - } else { - gCustomNotifies = false; } #endif + + switch (cPlatform()) { + case dbipWindows: + gUpdateURL = QUrl(qsl("http://tdesktop.com/win/tupdates/current")); + gPlatformString = qsl("Windows"); + break; + case dbipMac: + gUpdateURL = QUrl(qsl("http://tdesktop.com/mac/tupdates/current")); + gPlatformString = qsl("MacOS"); + gCustomNotifies = false; + break; + case dbipMacOld: + gUpdateURL = QUrl(qsl("http://tdesktop.com/mac32/tupdates/current")); + gPlatformString = qsl("MacOSold"); + break; + case dbipLinux64: + gUpdateURL = QUrl(qsl("http://tdesktop.com/linux/tupdates/current")); + gPlatformString = qsl("Linux64bit"); + break; + case dbipLinux32: + gUpdateURL = QUrl(qsl("http://tdesktop.com/linux32/tupdates/current")); + gPlatformString = qsl("Linux32bit"); + break; + } QStringList args; for (int32 i = 0; i < argc; ++i) { diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 3272b83364..42554b7440 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -317,6 +317,7 @@ DeclareSetting(int32, IntRetinaFactor); DeclareSetting(bool, CustomNotifies); DeclareReadSetting(DBIPlatform, Platform); +DeclareReadSetting(QString, PlatformString); DeclareReadSetting(bool, IsElCapitan); DeclareReadSetting(QUrl, UpdateURL); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index d4ae8fc398..f23b0a5a33 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2021,7 +2021,11 @@ LastCrashedWindow::LastCrashedWindow() QString maxDump, maxDumpFull; QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); qint64 maxDumpSize = 0; - QFileInfoList list = QDir(cWorkingDir() + qsl("tdumps")).entryInfoList(); + QString dumpspath = cWorkingDir() + qsl("tdata/dumps"); +#if defined Q_OS_MAC && !defined MAC_USE_BREAKPAD + dumpspath += qsl("/completed"); +#endif + QFileInfoList list = QDir(dumpspath).entryInfoList(); for (int32 i = 0, l = list.size(); i < l; ++i) { QString name = list.at(i).fileName(); if (name.endsWith(qstr(".dmp"))) { @@ -2286,6 +2290,7 @@ void LastCrashedWindow::onCheckingFinished() { return; } else if (result != "Report") { _pleaseSendReport.setText(qsl("This report is about some old version of Telegram Desktop.")); + _pleaseSendReport.setText(qsl("Response: %1").arg(QString::fromLatin1(result))); _sendingState = SendingTooOld; updateControls(); return; diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index ea1644d6de..121a09c1cb 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -45,23 +45,6 @@ 07129D6A1C16D230002DC495 /* mtpAuthKey.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D691C16D230002DC495 /* mtpAuthKey.cpp */; }; 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D6C1C16D245002DC495 /* facades.cpp */; }; 071AD8D21C5E8E6D008C9E90 /* zip.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D11C5E8E6D008C9E90 /* zip.c */; }; - 071AD8D71C5E8F35008C9E90 /* breakpad_nlist_64.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D31C5E8F35008C9E90 /* breakpad_nlist_64.cc */; }; - 071AD8D81C5E8F35008C9E90 /* dynamic_images.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D41C5E8F35008C9E90 /* dynamic_images.cc */; }; - 071AD8D91C5E8F35008C9E90 /* exception_handler.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D51C5E8F35008C9E90 /* exception_handler.cc */; }; - 071AD8DA1C5E8F35008C9E90 /* minidump_generator.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D61C5E8F35008C9E90 /* minidump_generator.cc */; }; - 071AD8DE1C5E912C008C9E90 /* crash_generation_client.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8DC1C5E912C008C9E90 /* crash_generation_client.cc */; }; - 071AD8DF1C5E912C008C9E90 /* crash_generation_server.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8DD1C5E912C008C9E90 /* crash_generation_server.cc */; }; - 071AD8E21C5E9143008C9E90 /* minidump_file_writer.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E11C5E9143008C9E90 /* minidump_file_writer.cc */; }; - 071AD8E61C5E9196008C9E90 /* convert_UTF.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E31C5E9196008C9E90 /* convert_UTF.c */; }; - 071AD8E71C5E9196008C9E90 /* md5.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E41C5E9196008C9E90 /* md5.cc */; }; - 071AD8E81C5E9196008C9E90 /* string_conversion.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E51C5E9196008C9E90 /* string_conversion.cc */; }; - 071AD8F01C5E91E3008C9E90 /* bootstrap_compat.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8E91C5E91E3008C9E90 /* bootstrap_compat.cc */; }; - 071AD8F11C5E91E3008C9E90 /* file_id.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EA1C5E91E3008C9E90 /* file_id.cc */; }; - 071AD8F21C5E91E3008C9E90 /* MachIPC.mm in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EB1C5E91E3008C9E90 /* MachIPC.mm */; }; - 071AD8F31C5E91E3008C9E90 /* macho_id.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EC1C5E91E3008C9E90 /* macho_id.cc */; }; - 071AD8F41C5E91E3008C9E90 /* macho_utilities.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8ED1C5E91E3008C9E90 /* macho_utilities.cc */; }; - 071AD8F51C5E91E3008C9E90 /* macho_walker.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EE1C5E91E3008C9E90 /* macho_walker.cc */; }; - 071AD8F61C5E91E3008C9E90 /* string_utilities.cc in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8EF1C5E91E3008C9E90 /* string_utilities.cc */; }; 071AD8F81C5E99D6008C9E90 /* ioapi.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8F71C5E99D6008C9E90 /* ioapi.c */; }; 071AD90A1C5EA2A5008C9E90 /* Breakpad.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */; }; 0732E4A9199E262300D50FE7 /* overviewwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0732E4A7199E262300D50FE7 /* overviewwidget.cpp */; }; @@ -299,67 +282,7 @@ 071AD86B1C5E8536008C9E90 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = ThirdParty/minizip/crypt.h; sourceTree = SOURCE_ROOT; }; 071AD86C1C5E8536008C9E90 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = ThirdParty/minizip/ioapi.h; sourceTree = SOURCE_ROOT; }; 071AD86E1C5E8536008C9E90 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = ThirdParty/minizip/zip.h; sourceTree = SOURCE_ROOT; }; - 071AD8751C5E85A0008C9E90 /* exception_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = exception_handler.h; path = ThirdParty/breakpad/client/mac/handler/exception_handler.h; sourceTree = SOURCE_ROOT; }; - 071AD8791C5E8672008C9E90 /* crash_generation_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crash_generation_client.h; sourceTree = ""; }; - 071AD87B1C5E8688008C9E90 /* ucontext_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ucontext_compat.h; path = ThirdParty/breakpad/client/mac/handler/ucontext_compat.h; sourceTree = SOURCE_ROOT; }; - 071AD87F1C5E87AA008C9E90 /* scoped_ptr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scoped_ptr.h; path = ThirdParty/breakpad/common/scoped_ptr.h; sourceTree = SOURCE_ROOT; }; - 071AD8811C5E87C2008C9E90 /* MachIPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MachIPC.h; path = ThirdParty/breakpad/common/mac/MachIPC.h; sourceTree = SOURCE_ROOT; }; - 071AD8851C5E8853008C9E90 /* bootstrap_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bootstrap_compat.h; path = ThirdParty/breakpad/common/mac/bootstrap_compat.h; sourceTree = SOURCE_ROOT; }; - 071AD8881C5E8886008C9E90 /* minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_generator.h; path = ThirdParty/breakpad/client/mac/handler/minidump_generator.h; sourceTree = SOURCE_ROOT; }; - 071AD88B1C5E88AA008C9E90 /* crash_generation_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crash_generation_server.h; sourceTree = ""; }; - 071AD88D1C5E88CD008C9E90 /* minidump_file_writer-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "minidump_file_writer-inl.h"; path = "ThirdParty/breakpad/client/minidump_file_writer-inl.h"; sourceTree = SOURCE_ROOT; }; - 071AD88F1C5E88CD008C9E90 /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_file_writer.h; path = ThirdParty/breakpad/client/minidump_file_writer.h; sourceTree = SOURCE_ROOT; }; - 071AD8911C5E88EA008C9E90 /* client_info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = client_info.h; sourceTree = ""; }; - 071AD8921C5E8994008C9E90 /* memory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = memory.h; path = ThirdParty/breakpad/common/memory.h; sourceTree = SOURCE_ROOT; }; - 071AD8951C5E89D1008C9E90 /* breakpad_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = breakpad_types.h; path = ThirdParty/breakpad/google_breakpad/common/breakpad_types.h; sourceTree = SOURCE_ROOT; }; - 071AD8961C5E89D1008C9E90 /* minidump_cpu_amd64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_amd64.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h; sourceTree = SOURCE_ROOT; }; - 071AD8971C5E89D1008C9E90 /* minidump_cpu_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_arm.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h; sourceTree = SOURCE_ROOT; }; - 071AD8981C5E89D1008C9E90 /* minidump_cpu_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_arm64.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h; sourceTree = SOURCE_ROOT; }; - 071AD8991C5E89D1008C9E90 /* minidump_cpu_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_mips.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h; sourceTree = SOURCE_ROOT; }; - 071AD89A1C5E89D1008C9E90 /* minidump_cpu_ppc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_ppc.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h; sourceTree = SOURCE_ROOT; }; - 071AD89B1C5E89D1008C9E90 /* minidump_cpu_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_ppc64.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h; sourceTree = SOURCE_ROOT; }; - 071AD89C1C5E89D1008C9E90 /* minidump_cpu_sparc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_sparc.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h; sourceTree = SOURCE_ROOT; }; - 071AD89D1C5E89D1008C9E90 /* minidump_cpu_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_cpu_x86.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h; sourceTree = SOURCE_ROOT; }; - 071AD89E1C5E89D1008C9E90 /* minidump_exception_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_linux.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h; sourceTree = SOURCE_ROOT; }; - 071AD89F1C5E89D1008C9E90 /* minidump_exception_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_mac.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h; sourceTree = SOURCE_ROOT; }; - 071AD8A01C5E89D1008C9E90 /* minidump_exception_ps3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_ps3.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h; sourceTree = SOURCE_ROOT; }; - 071AD8A11C5E89D1008C9E90 /* minidump_exception_solaris.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_solaris.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h; sourceTree = SOURCE_ROOT; }; - 071AD8A21C5E89D1008C9E90 /* minidump_exception_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_exception_win32.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h; sourceTree = SOURCE_ROOT; }; - 071AD8A31C5E89D1008C9E90 /* minidump_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_format.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_format.h; sourceTree = SOURCE_ROOT; }; - 071AD8A41C5E89D1008C9E90 /* minidump_size.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_size.h; path = ThirdParty/breakpad/google_breakpad/common/minidump_size.h; sourceTree = SOURCE_ROOT; }; - 071AD8A61C5E8A30008C9E90 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ThirdParty/breakpad/common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; }; - 071AD8A91C5E8A7B008C9E90 /* dynamic_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_images.h; path = ThirdParty/breakpad/client/mac/handler/dynamic_images.h; sourceTree = SOURCE_ROOT; }; - 071AD8AB1C5E8A99008C9E90 /* mach_vm_compat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mach_vm_compat.h; path = ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h; sourceTree = SOURCE_ROOT; }; - 071AD8AD1C5E8B07008C9E90 /* breakpad_nlist_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = breakpad_nlist_64.h; path = ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h; sourceTree = SOURCE_ROOT; }; - 071AD8AF1C5E8B16008C9E90 /* byteswap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = byteswap.h; path = ThirdParty/breakpad/common/mac/byteswap.h; sourceTree = SOURCE_ROOT; }; - 071AD8B11C5E8B23008C9E90 /* linux_libc_support.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = linux_libc_support.h; path = ThirdParty/breakpad/common/linux/linux_libc_support.h; sourceTree = SOURCE_ROOT; }; - 071AD8B31C5E8B43008C9E90 /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ThirdParty/breakpad/common/string_conversion.h; sourceTree = SOURCE_ROOT; }; - 071AD8B61C5E8B5C008C9E90 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ThirdParty/breakpad/common/mac/file_id.h; sourceTree = SOURCE_ROOT; }; - 071AD8B81C5E8B81008C9E90 /* scoped_task_suspend-inl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "scoped_task_suspend-inl.h"; path = "ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h"; sourceTree = SOURCE_ROOT; }; - 071AD8BA1C5E8B9B008C9E90 /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ThirdParty/breakpad/common/mac/macho_id.h; sourceTree = SOURCE_ROOT; }; - 071AD8BD1C5E8BB0008C9E90 /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ThirdParty/breakpad/common/convert_UTF.h; sourceTree = SOURCE_ROOT; }; - 071AD8BF1C5E8BC8008C9E90 /* using_std_string.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = using_std_string.h; path = ThirdParty/breakpad/common/using_std_string.h; sourceTree = SOURCE_ROOT; }; - 071AD8C11C5E8BE5008C9E90 /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ThirdParty/breakpad/common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; }; - 071AD8C41C5E8BFD008C9E90 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = md5.h; path = ThirdParty/breakpad/common/md5.h; sourceTree = SOURCE_ROOT; }; - 071AD8C71C5E8C14008C9E90 /* string_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_utilities.h; path = ThirdParty/breakpad/common/mac/string_utilities.h; sourceTree = SOURCE_ROOT; }; 071AD8D11C5E8E6D008C9E90 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = ThirdParty/minizip/zip.c; sourceTree = SOURCE_ROOT; }; - 071AD8D31C5E8F35008C9E90 /* breakpad_nlist_64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = breakpad_nlist_64.cc; path = ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc; sourceTree = SOURCE_ROOT; }; - 071AD8D41C5E8F35008C9E90 /* dynamic_images.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dynamic_images.cc; path = ThirdParty/breakpad/client/mac/handler/dynamic_images.cc; sourceTree = SOURCE_ROOT; }; - 071AD8D51C5E8F35008C9E90 /* exception_handler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler.cc; path = ThirdParty/breakpad/client/mac/handler/exception_handler.cc; sourceTree = SOURCE_ROOT; }; - 071AD8D61C5E8F35008C9E90 /* minidump_generator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_generator.cc; path = ThirdParty/breakpad/client/mac/handler/minidump_generator.cc; sourceTree = SOURCE_ROOT; }; - 071AD8DC1C5E912C008C9E90 /* crash_generation_client.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crash_generation_client.cc; sourceTree = ""; }; - 071AD8DD1C5E912C008C9E90 /* crash_generation_server.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crash_generation_server.cc; sourceTree = ""; }; - 071AD8E11C5E9143008C9E90 /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer.cc; path = ThirdParty/breakpad/client/minidump_file_writer.cc; sourceTree = SOURCE_ROOT; }; - 071AD8E31C5E9196008C9E90 /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ThirdParty/breakpad/common/convert_UTF.c; sourceTree = SOURCE_ROOT; }; - 071AD8E41C5E9196008C9E90 /* md5.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = md5.cc; path = ThirdParty/breakpad/common/md5.cc; sourceTree = SOURCE_ROOT; }; - 071AD8E51C5E9196008C9E90 /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ThirdParty/breakpad/common/string_conversion.cc; sourceTree = SOURCE_ROOT; }; - 071AD8E91C5E91E3008C9E90 /* bootstrap_compat.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bootstrap_compat.cc; path = ThirdParty/breakpad/common/mac/bootstrap_compat.cc; sourceTree = SOURCE_ROOT; }; - 071AD8EA1C5E91E3008C9E90 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ThirdParty/breakpad/common/mac/file_id.cc; sourceTree = SOURCE_ROOT; }; - 071AD8EB1C5E91E3008C9E90 /* MachIPC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MachIPC.mm; path = ThirdParty/breakpad/common/mac/MachIPC.mm; sourceTree = SOURCE_ROOT; }; - 071AD8EC1C5E91E3008C9E90 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ThirdParty/breakpad/common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; }; - 071AD8ED1C5E91E3008C9E90 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ThirdParty/breakpad/common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; }; - 071AD8EE1C5E91E3008C9E90 /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ThirdParty/breakpad/common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; }; - 071AD8EF1C5E91E3008C9E90 /* string_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_utilities.cc; path = ThirdParty/breakpad/common/mac/string_utilities.cc; sourceTree = SOURCE_ROOT; }; 071AD8F71C5E99D6008C9E90 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = ThirdParty/minizip/ioapi.c; sourceTree = SOURCE_ROOT; }; 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Breakpad.framework; path = Users/antanubis/TBuild/Libraries/breakpad/Breakpad.framework; sourceTree = ""; }; 071AD90B1C5EA37D008C9E90 /* Breakpad.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Breakpad.framework; path = "Users/antanubis/Library/Developer/Xcode/DerivedData/Breakpad-ffxagkgqghkohhawycvgjexmnjhs/Build/Products/Debug/Breakpad.framework"; sourceTree = ""; }; @@ -846,7 +769,6 @@ 071AD8691C5E8504008C9E90 /* ThirdParty */ = { isa = PBXGroup; children = ( - 071AD8701C5E8546008C9E90 /* breakpad */, 071AD86A1C5E8522008C9E90 /* minizip */, ); name = ThirdParty; @@ -864,146 +786,6 @@ name = minizip; sourceTree = ""; }; - 071AD8701C5E8546008C9E90 /* breakpad */ = { - isa = PBXGroup; - children = ( - 071AD8931C5E89BE008C9E90 /* google_breakpad */, - 071AD87E1C5E8792008C9E90 /* common */, - 071AD8711C5E8569008C9E90 /* client */, - ); - name = breakpad; - sourceTree = ""; - }; - 071AD8711C5E8569008C9E90 /* client */ = { - isa = PBXGroup; - children = ( - 071AD88D1C5E88CD008C9E90 /* minidump_file_writer-inl.h */, - 071AD88F1C5E88CD008C9E90 /* minidump_file_writer.h */, - 071AD8E11C5E9143008C9E90 /* minidump_file_writer.cc */, - 071AD8721C5E8575008C9E90 /* mac */, - ); - name = client; - sourceTree = ""; - }; - 071AD8721C5E8575008C9E90 /* mac */ = { - isa = PBXGroup; - children = ( - 071AD8771C5E8672008C9E90 /* crash_generation */, - 071AD8731C5E8579008C9E90 /* handler */, - ); - name = mac; - sourceTree = ""; - }; - 071AD8731C5E8579008C9E90 /* handler */ = { - isa = PBXGroup; - children = ( - 071AD8D31C5E8F35008C9E90 /* breakpad_nlist_64.cc */, - 071AD8AD1C5E8B07008C9E90 /* breakpad_nlist_64.h */, - 071AD8D41C5E8F35008C9E90 /* dynamic_images.cc */, - 071AD8A91C5E8A7B008C9E90 /* dynamic_images.h */, - 071AD8751C5E85A0008C9E90 /* exception_handler.h */, - 071AD8D51C5E8F35008C9E90 /* exception_handler.cc */, - 071AD8AB1C5E8A99008C9E90 /* mach_vm_compat.h */, - 071AD8881C5E8886008C9E90 /* minidump_generator.h */, - 071AD8D61C5E8F35008C9E90 /* minidump_generator.cc */, - 071AD87B1C5E8688008C9E90 /* ucontext_compat.h */, - ); - name = handler; - sourceTree = ""; - }; - 071AD8771C5E8672008C9E90 /* crash_generation */ = { - isa = PBXGroup; - children = ( - 071AD8911C5E88EA008C9E90 /* client_info.h */, - 071AD8791C5E8672008C9E90 /* crash_generation_client.h */, - 071AD8DC1C5E912C008C9E90 /* crash_generation_client.cc */, - 071AD88B1C5E88AA008C9E90 /* crash_generation_server.h */, - 071AD8DD1C5E912C008C9E90 /* crash_generation_server.cc */, - ); - name = crash_generation; - path = ThirdParty/breakpad/client/mac/crash_generation; - sourceTree = SOURCE_ROOT; - }; - 071AD87E1C5E8792008C9E90 /* common */ = { - isa = PBXGroup; - children = ( - 071AD8B01C5E8B1B008C9E90 /* linux */, - 071AD8801C5E87B5008C9E90 /* mac */, - 071AD8BD1C5E8BB0008C9E90 /* convert_UTF.h */, - 071AD8E31C5E9196008C9E90 /* convert_UTF.c */, - 071AD8C41C5E8BFD008C9E90 /* md5.h */, - 071AD8E41C5E9196008C9E90 /* md5.cc */, - 071AD8921C5E8994008C9E90 /* memory.h */, - 071AD87F1C5E87AA008C9E90 /* scoped_ptr.h */, - 071AD8B31C5E8B43008C9E90 /* string_conversion.h */, - 071AD8E51C5E9196008C9E90 /* string_conversion.cc */, - 071AD8BF1C5E8BC8008C9E90 /* using_std_string.h */, - ); - name = common; - sourceTree = ""; - }; - 071AD8801C5E87B5008C9E90 /* mac */ = { - isa = PBXGroup; - children = ( - 071AD8851C5E8853008C9E90 /* bootstrap_compat.h */, - 071AD8E91C5E91E3008C9E90 /* bootstrap_compat.cc */, - 071AD8AF1C5E8B16008C9E90 /* byteswap.h */, - 071AD8B61C5E8B5C008C9E90 /* file_id.h */, - 071AD8EA1C5E91E3008C9E90 /* file_id.cc */, - 071AD8811C5E87C2008C9E90 /* MachIPC.h */, - 071AD8EB1C5E91E3008C9E90 /* MachIPC.mm */, - 071AD8BA1C5E8B9B008C9E90 /* macho_id.h */, - 071AD8EC1C5E91E3008C9E90 /* macho_id.cc */, - 071AD8A61C5E8A30008C9E90 /* macho_utilities.h */, - 071AD8ED1C5E91E3008C9E90 /* macho_utilities.cc */, - 071AD8C11C5E8BE5008C9E90 /* macho_walker.h */, - 071AD8EE1C5E91E3008C9E90 /* macho_walker.cc */, - 071AD8B81C5E8B81008C9E90 /* scoped_task_suspend-inl.h */, - 071AD8C71C5E8C14008C9E90 /* string_utilities.h */, - 071AD8EF1C5E91E3008C9E90 /* string_utilities.cc */, - ); - name = mac; - sourceTree = ""; - }; - 071AD8931C5E89BE008C9E90 /* google_breakpad */ = { - isa = PBXGroup; - children = ( - 071AD8941C5E89C4008C9E90 /* common */, - ); - name = google_breakpad; - sourceTree = ""; - }; - 071AD8941C5E89C4008C9E90 /* common */ = { - isa = PBXGroup; - children = ( - 071AD8951C5E89D1008C9E90 /* breakpad_types.h */, - 071AD8961C5E89D1008C9E90 /* minidump_cpu_amd64.h */, - 071AD8971C5E89D1008C9E90 /* minidump_cpu_arm.h */, - 071AD8981C5E89D1008C9E90 /* minidump_cpu_arm64.h */, - 071AD8991C5E89D1008C9E90 /* minidump_cpu_mips.h */, - 071AD89A1C5E89D1008C9E90 /* minidump_cpu_ppc.h */, - 071AD89B1C5E89D1008C9E90 /* minidump_cpu_ppc64.h */, - 071AD89C1C5E89D1008C9E90 /* minidump_cpu_sparc.h */, - 071AD89D1C5E89D1008C9E90 /* minidump_cpu_x86.h */, - 071AD89E1C5E89D1008C9E90 /* minidump_exception_linux.h */, - 071AD89F1C5E89D1008C9E90 /* minidump_exception_mac.h */, - 071AD8A01C5E89D1008C9E90 /* minidump_exception_ps3.h */, - 071AD8A11C5E89D1008C9E90 /* minidump_exception_solaris.h */, - 071AD8A21C5E89D1008C9E90 /* minidump_exception_win32.h */, - 071AD8A31C5E89D1008C9E90 /* minidump_format.h */, - 071AD8A41C5E89D1008C9E90 /* minidump_size.h */, - ); - name = common; - sourceTree = ""; - }; - 071AD8B01C5E8B1B008C9E90 /* linux */ = { - isa = PBXGroup; - children = ( - 071AD8B11C5E8B23008C9E90 /* linux_libc_support.h */, - ); - name = linux; - sourceTree = ""; - }; 074968CB1A44D0B800394F46 /* langs */ = { isa = PBXGroup; children = ( @@ -1578,6 +1360,7 @@ 07C3AF25194336160016CFF1 /* Resources */, 07489B6B1A28949600348CD9 /* Build Updater */, 0746AC8F1A28D4140040AE26 /* Clean Updater */, + 071AD90E1C60AA74008C9E90 /* Copy crashpad_handler */, 07489B6D1A28972E00348CD9 /* Sign Application */, ); buildRules = ( @@ -1659,6 +1442,20 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 071AD90E1C60AA74008C9E90 /* Copy crashpad_handler */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy crashpad_handler"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "mkdir -p \"$CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/Contents/Helpers\" && cp \"./../../Libraries/crashpad/crashpad/out/Release/crashpad_handler\" \"$CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/Contents/Helpers/\""; + }; 0746AC8F1A28D4140040AE26 /* Clean Updater */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1774,7 +1571,6 @@ 0732E4A9199E262300D50FE7 /* overviewwidget.cpp in Compile Sources */, 1DF53374E3B6A31661548D08 /* historywidget.cpp in Compile Sources */, 078A2FCD1A811CA600CCC7A0 /* backgroundbox.cpp in Compile Sources */, - 071AD8D81C5E8F35008C9E90 /* dynamic_images.cc in Compile Sources */, 37A3C6C782A0E4BC7B09536B /* langloaderplain.cpp in Compile Sources */, 19A66ECD6EE2F8356F27D32D /* layerwidget.cpp in Compile Sources */, 89ADB41E48A3B5E24ABB626C /* profilewidget.cpp in Compile Sources */, @@ -1788,28 +1584,23 @@ 4078D5D614EB3ECF7F1848C7 /* types.cpp in Compile Sources */, 68FFEB7CA30BF0149161B809 /* window.cpp in Compile Sources */, 0CB7DE9A54CC9BF86FB7B5CA /* mtp.cpp in Compile Sources */, - 071AD8E71C5E9196008C9E90 /* md5.cc in Compile Sources */, DF259E9677CC63AF8754032B /* mtpConnection.cpp in Compile Sources */, 074FCB9119D36E60004C6EB2 /* moc_popupmenu.cpp in Compile Sources */, B6346B66B0A2228A91D8A5D9 /* mtpDC.cpp in Compile Sources */, 0755AEDF1AD12A80004D738A /* moc_sessionsbox.cpp in Compile Sources */, 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */, B8CA3E1E11A7E0E7DF9E1CDE /* mtpFileLoader.cpp in Compile Sources */, - 071AD8DF1C5E912C008C9E90 /* crash_generation_server.cc in Compile Sources */, 0755AEDD1AD12A80004D738A /* moc_abstractbox.cpp in Compile Sources */, 99F0A9B2AFE5ABDCBFC04510 /* mtpRPC.cpp in Compile Sources */, A297B1E3CE33CC501DFEDB6E /* mtpSession.cpp in Compile Sources */, D1FC601FC2F9F3E33F3A14E9 /* animation.cpp in Compile Sources */, 8F65F0D95B1F0CEB859F2FB3 /* boxshadow.cpp in Compile Sources */, - 071AD8F41C5E91E3008C9E90 /* macho_utilities.cc in Compile Sources */, D7EF8F129FCCE9AB3F3F081F /* button.cpp in Compile Sources */, 07DC42A01B5EA15300B6B888 /* numbers.cpp in Compile Sources */, C03447C9A7D9FF73463B8BB5 /* countryinput.cpp in Compile Sources */, 07BE850F1A2093C9008ACB9F /* localstorage.cpp in Compile Sources */, CDB0266A8B7CB20A95266BCD /* emoji_config.cpp in Compile Sources */, - 071AD8DA1C5E8F35008C9E90 /* minidump_generator.cc in Compile Sources */, 0732E4AC199E268A00D50FE7 /* moc_overviewwidget.cpp in Compile Sources */, - 071AD8F01C5E91E3008C9E90 /* bootstrap_compat.cc in Compile Sources */, 7C2B2DEE467A4C4679F1C3C9 /* filedialog.cpp in Compile Sources */, 832C50BFD7D09AF042A51D4F /* flatbutton.cpp in Compile Sources */, B91D13BCC3963CB9C12D24A4 /* flatcheckbox.cpp in Compile Sources */, @@ -1818,7 +1609,6 @@ 03270F718426CFE84729079E /* flattextarea.cpp in Compile Sources */, E3D7A5CA24541D5DB69D6606 /* images.cpp in Compile Sources */, ADE99904299B99EB6135E8D9 /* scrollarea.cpp in Compile Sources */, - 071AD8F11C5E91E3008C9E90 /* file_id.cc in Compile Sources */, 07129D6A1C16D230002DC495 /* mtpAuthKey.cpp in Compile Sources */, 90085DF442550A0845D5AF37 /* style_core.cpp in Compile Sources */, 074FCB8E19D36851004C6EB2 /* popupmenu.cpp in Compile Sources */, @@ -1838,7 +1628,6 @@ 07DB67511AD07CB800A51329 /* intropwdcheck.cpp in Compile Sources */, 3ABE4F9B2264F770D944106D /* emojibox.cpp in Compile Sources */, 07D703BB19B88FB900C4EED2 /* moc_audio.cpp in Compile Sources */, - 071AD8E81C5E9196008C9E90 /* string_conversion.cc in Compile Sources */, 77B998AC22A13EF3DDEE07AC /* photocropbox.cpp in Compile Sources */, F278C423357CA99797EA30AB /* photosendbox.cpp in Compile Sources */, E8D95529CED88F18818C9A8B /* intro.cpp in Compile Sources */, @@ -1862,27 +1651,20 @@ A24E4B5B683764E07683ECEC /* moc_mainwidget.cpp in Compile Sources */, 0710CA051B0B9404001B4272 /* moc_stickersetbox.cpp in Compile Sources */, 07DE92A71AA4925B00A18F6F /* autolockbox.cpp in Compile Sources */, - 071AD8F51C5E91E3008C9E90 /* macho_walker.cc in Compile Sources */, 07D8509919F8320900623D75 /* usernamebox.cpp in Compile Sources */, - 071AD8F21C5E91E3008C9E90 /* MachIPC.mm in Compile Sources */, - 071AD8DE1C5E912C008C9E90 /* crash_generation_client.cc in Compile Sources */, A469EC9C4C367E0B773A9BB7 /* moc_settingswidget.cpp in Compile Sources */, FD2FE0C564A7389A2E609EC7 /* moc_sysbuttons.cpp in Compile Sources */, E97B3CFAB59B49BACFFC5F7C /* moc_title.cpp in Compile Sources */, 07D8510819F8340A00623D75 /* moc_usernamebox.cpp in Compile Sources */, 9A0D5DDC7816FC2538EB6A96 /* moc_window.cpp in Compile Sources */, - 071AD8D91C5E8F35008C9E90 /* exception_handler.cc in Compile Sources */, 06EABCC49D2EEE4076322BE7 /* moc_mtp.cpp in Compile Sources */, 0755AEDE1AD12A80004D738A /* moc_intropwdcheck.cpp in Compile Sources */, 07DE92AA1AA4928200A18F6F /* moc_autolockbox.cpp in Compile Sources */, 07B604351B46A20900CA29FE /* moc_playerwidget.cpp in Compile Sources */, 8F6F5D7F82036331E8C6DAE6 /* moc_mtpConnection.cpp in Compile Sources */, B780F9E21269259B90A1F32A /* moc_mtpDC.cpp in Compile Sources */, - 071AD8F31C5E91E3008C9E90 /* macho_id.cc in Compile Sources */, 07080BCF1A43588C00741A51 /* lang_auto.cpp in Compile Sources */, 07539B1D1A1416AF00083EFC /* moc_history.cpp in Compile Sources */, - 071AD8E61C5E9196008C9E90 /* convert_UTF.c in Compile Sources */, - 071AD8F61C5E91E3008C9E90 /* string_utilities.cc in Compile Sources */, 2A500B102B7CE80F3EB6E13E /* moc_mtpFileLoader.cpp in Compile Sources */, 07A6933519927B160099CB9F /* moc_mediaview.cpp in Compile Sources */, 07A69332199277BA0099CB9F /* mediaview.cpp in Compile Sources */, @@ -1894,7 +1676,6 @@ 07DE92A01AA4923300A18F6F /* passcodewidget.cpp in Compile Sources */, B0B88EFE444C0DE673389418 /* moc_flatbutton.cpp in Compile Sources */, 1BD711B4C358EA7D727BF358 /* moc_flatcheckbox.cpp in Compile Sources */, - 071AD8D71C5E8F35008C9E90 /* breakpad_nlist_64.cc in Compile Sources */, 565F748438E6CE0148C54AFE /* moc_flatinput.cpp in Compile Sources */, 8B71D1C7BB9DCEE6511219C2 /* moc_flatlabel.cpp in Compile Sources */, 0710C9FE1B0B9376001B4272 /* stickersetbox.cpp in Compile Sources */, @@ -1908,7 +1689,6 @@ 7062978F12EEA525893A5E6F /* moc_aboutbox.cpp in Compile Sources */, E8B28580819B882A5964561A /* moc_addcontactbox.cpp in Compile Sources */, 07B604321B46A0EC00CA29FE /* playerwidget.cpp in Compile Sources */, - 071AD8E21C5E9143008C9E90 /* minidump_file_writer.cc in Compile Sources */, D6874C00733283846ACA9AB2 /* moc_confirmbox.cpp in Compile Sources */, ED2557A57C6782721DC494AF /* moc_connectionbox.cpp in Compile Sources */, 5FC914F652D1B16FDA8F0634 /* moc_contactsbox.cpp in Compile Sources */, @@ -2009,6 +1789,8 @@ isa = XCBuildConfiguration; buildSettings = { CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; CLANG_WARN_EMPTY_BODY = YES; @@ -2058,6 +1840,8 @@ "/usr/local/Qt-5.5.1/mkspecs/macx-clang", ./ThirdParty/breakpad, ./ThirdParty/minizip, + ./../../Libraries/crashpad/crashpad, + ./../../Libraries/crashpad/crashpad/third_party/mini_chromium/mini_chromium, ); INFOPLIST_FILE = Telegram.plist; INSTALL_DIR = ./../Mac/Release/; @@ -2094,8 +1878,6 @@ OTHER_CPLUSPLUSFLAGS = ( "-pipe", "-g", - "-std=c++11", - "-stdlib=libc++", "-Wall", "-W", "-fPIE", @@ -2113,11 +1895,11 @@ ); OTHER_LDFLAGS = ( "-headerpad_max_install_names", - "-stdlib=libc++", "-L/usr/local/Qt-5.5.1/lib", "-L/usr/local/Qt-5.5.1/plugins/bearer", "-L/usr/local/Qt-5.5.1/plugins/platforms", "-lcups", + "-lbsm", "-L/usr/local/Qt-5.5.1/plugins/imageformats", /usr/local/lib/libz.a, "-lm", @@ -2131,7 +1913,10 @@ /usr/local/lib/libswresample.a, /usr/local/lib/libavutil.a, /usr/local/lib/libiconv.a, - "../../Libraries/openssl-xcode/libcrypto.a", + "./../../Libraries/openssl-xcode/libcrypto.a", + ./../../Libraries/crashpad/crashpad/out/Release/libbase.a, + ./../../Libraries/crashpad/crashpad/out/Release/libcrashpad_client.a, + ./../../Libraries/crashpad/crashpad/out/Release/libcrashpad_util.a, "-g", ); PRODUCT_NAME = Telegram; @@ -2145,6 +1930,8 @@ isa = XCBuildConfiguration; buildSettings = { CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang; + CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; + CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = NO; CLANG_WARN_CONSTANT_CONVERSION = NO; CLANG_WARN_EMPTY_BODY = YES; @@ -2195,6 +1982,8 @@ "/usr/local/Qt-5.5.1/mkspecs/macx-clang", ./ThirdParty/breakpad, ./ThirdParty/minizip, + ./../../Libraries/crashpad/crashpad, + ./../../Libraries/crashpad/crashpad/third_party/mini_chromium/mini_chromium, ); INFOPLIST_FILE = Telegram.plist; INSTALL_DIR = ./../Mac/Debug/; @@ -2232,8 +2021,6 @@ OTHER_CPLUSPLUSFLAGS = ( "-pipe", "-g", - "-std=c++11", - "-stdlib=libc++", "-Wall", "-W", "-fPIE", @@ -2251,11 +2038,11 @@ ); OTHER_LDFLAGS = ( "-headerpad_max_install_names", - "-stdlib=libc++", "-L/usr/local/Qt-5.5.1/lib", "-L/usr/local/Qt-5.5.1/plugins/bearer", "-L/usr/local/Qt-5.5.1/plugins/platforms", "-lcups", + "-lbsm", "-L/usr/local/Qt-5.5.1/plugins/imageformats", /usr/local/lib/libz.a, "-lm", @@ -2269,7 +2056,10 @@ /usr/local/lib/libswresample.a, /usr/local/lib/libavutil.a, /usr/local/lib/libiconv.a, - "../../Libraries/openssl-xcode/libcrypto.a", + "./../../Libraries/openssl-xcode/libcrypto.a", + ./../../Libraries/crashpad/crashpad/out/Release/libbase.a, + ./../../Libraries/crashpad/crashpad/out/Release/libcrashpad_client.a, + ./../../Libraries/crashpad/crashpad/out/Release/libcrashpad_util.a, "-g", ); PRODUCT_NAME = Telegram; From f7f041f11d1437eed2ea704e04e5c098f946eabf Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 2 Feb 2016 15:50:12 +0300 Subject: [PATCH 045/316] instructions updated for zlib --- QTCREATOR.md | 14 ++++++++++++++ Telegram/SourceFiles/logs.cpp | 17 +++++++++-------- Telegram/SourceFiles/structs.cpp | 4 +--- Telegram/SourceFiles/structs.h | 9 ++++++++- Telegram/Telegram.xcodeproj/project.pbxproj | 6 ++---- XCODE.md | 16 +++++++++++++++- XCODEold.md | 16 +++++++++++++++- 7 files changed, 64 insertions(+), 18 deletions(-) diff --git a/QTCREATOR.md b/QTCREATOR.md index d963f9badf..e4c584b74a 100644 --- a/QTCREATOR.md +++ b/QTCREATOR.md @@ -32,6 +32,20 @@ Install dev libraries sudo apt-get install libexif-dev liblzma-dev libz-dev libssl-dev libappindicator-dev libunity-dev +####zlib 1.2.8 + +http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, zipfile format**](http://zlib.net/zlib128.zip) + +Extract to **/home/user/TBuild/Libraries** + +#####Building library + +In Terminal go to **/home/user/TBuild/Libraries/zlib-1.2.8** and run: + + ./configure + make + sudo make install + Install audio libraries ####Opus codec 1.1 diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 641c7fd576..b776cba00f 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -715,7 +715,8 @@ namespace SignalHandlers { if (!LoggingCrashHeaderWritten) { LoggingCrashHeaderWritten = true; - for (AnnotationsMap::const_iterator i = ProcessAnnotations.cbegin(), e = ProcessAnnotations.cend(); i != e; ++i) { + const AnnotationsMap c_ProcessAnnotations(ProcessAnnotations); + for (AnnotationsMap::const_iterator i = c_ProcessAnnotations.begin(), e = c_ProcessAnnotations.end(); i != e; ++i) { dump() << i->first.c_str() << ": " << i->second.c_str() << "\n"; } psWriteDump(); @@ -839,11 +840,11 @@ namespace SignalHandlers { #endif void StartBreakpad() { - ProcessAnnotations["Binary"] = cExeName().toUtf8().toStdString(); - ProcessAnnotations["ApiId"] = QString::number(ApiId).toUtf8().toStdString(); - ProcessAnnotations["Version"] = (cBetaVersion() ? qsl("%1 beta").arg(cBetaVersion()) : (cDevVersion() ? qsl("%1 dev") : qsl("%1")).arg(AppVersion)).toUtf8().toStdString(); - ProcessAnnotations["Launched"] = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8().toStdString(); - ProcessAnnotations["Platform"] = cPlatformString().toUtf8().toStdString(); + 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(); + ProcessAnnotations["Launched"] = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8().constData(); + ProcessAnnotations["Platform"] = cPlatformString().toUtf8().constData(); QString dumpspath = cWorkingDir() + qsl("tdata/dumps"); QDir().mkpath(dumpspath); @@ -870,8 +871,8 @@ namespace SignalHandlers { SetSignalHandlers = false; #else crashpad::CrashpadClient crashpad_client; - std::string handler = (cExeDir() + cExeName() + qsl("/Contents/Helpers/crashpad_handler")).toUtf8().toStdString(); - std::string database = dumpspath.toUtf8().toStdString(); + std::string handler = (cExeDir() + cExeName() + qsl("/Contents/Helpers/crashpad_handler")).toUtf8().constData(); + std::string database = dumpspath.toUtf8().constData(); if (crashpad_client.StartHandler(base::FilePath(handler), base::FilePath(database), std::string(), diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 1660203d18..81c7e8568b 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -61,9 +61,7 @@ const InterfacesMetadata *GetInterfacesMetadata(uint64 mask) { return i.value(); } -InterfaceWrapStruct InterfaceWraps[64] = { - { 0, 0, 0 } -}; +InterfaceWrapStruct InterfaceWraps[64]; QAtomicInt InterfaceIndexLast(0); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 66d2d64735..5655fafa54 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -25,6 +25,13 @@ typedef void(*InterfaceConstruct)(void *location, Interfaces *interfaces); typedef void(*InterfaceDestruct)(void *location); struct InterfaceWrapStruct { + InterfaceWrapStruct() : Size(0), Construct(0), Destruct(0) { + } + InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct) + : Size(size) + , Construct(construct) + , Destruct(destruct) { + } int Size; InterfaceConstruct Construct; InterfaceDestruct Destruct; @@ -62,7 +69,7 @@ public: if (InterfaceIndexLast.testAndSetOrdered(last, last + 1)) { t_assert(last < 64); if (_index.testAndSetOrdered(0, last + 1)) { - InterfaceWraps[last] = { InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct }; + InterfaceWraps[last] = InterfaceWrapStruct(InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct); } break; } diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 121a09c1cb..70a484b14d 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -46,7 +46,6 @@ 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D6C1C16D245002DC495 /* facades.cpp */; }; 071AD8D21C5E8E6D008C9E90 /* zip.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D11C5E8E6D008C9E90 /* zip.c */; }; 071AD8F81C5E99D6008C9E90 /* ioapi.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8F71C5E99D6008C9E90 /* ioapi.c */; }; - 071AD90A1C5EA2A5008C9E90 /* Breakpad.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */; }; 0732E4A9199E262300D50FE7 /* overviewwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0732E4A7199E262300D50FE7 /* overviewwidget.cpp */; }; 0732E4AC199E268A00D50FE7 /* moc_overviewwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0732E4AB199E268A00D50FE7 /* moc_overviewwidget.cpp */; }; 074756191A1372C600CA07F7 /* moc_types.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 074756181A1372C600CA07F7 /* moc_types.cpp */; }; @@ -710,7 +709,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 071AD90A1C5EA2A5008C9E90 /* Breakpad.framework in Link Binary With Libraries */, 0752F8751C2C89F40026D0BC /* VideoToolbox.framework in Link Binary With Libraries */, 0752F8731C2C89220026D0BC /* VideoDecodeAcceleration.framework in Link Binary With Libraries */, 07CAACD81AEA64F00058E508 /* AudioUnit.framework in Link Binary With Libraries */, @@ -1805,7 +1803,7 @@ DYLIB_COMPATIBILITY_VERSION = 0.9; DYLIB_CURRENT_VERSION = 0.9.19; ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_SEARCH_PATHS = ./../../Libraries/breakpad; + FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1947,7 +1945,7 @@ DYLIB_CURRENT_VERSION = 0.9.19; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ./../../Libraries/breakpad; + FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; GCC_NO_COMMON_BLOCKS = YES; diff --git a/XCODE.md b/XCODE.md index 96b94b667f..00a0dfbd76 100644 --- a/XCODE.md +++ b/XCODE.md @@ -28,6 +28,20 @@ In your build Terminal run: to set minimal supported OS version to 10.8 for future console builds. +####zlib 1.2.8 + +http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, zipfile format**](http://zlib.net/zlib128.zip) + +Extract to **/Users/user/TBuild/Libraries** + +#####Building library + +In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run: + + CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure + make + sudo make install + ####OpenSSL 1.0.1g #####Get openssl-xcode project file @@ -37,7 +51,7 @@ From https://github.com/telegramdesktop/openssl-xcode with git in Terminal: * go to **/Users/user/TBuild/Libraries * run: - git clone https://github.com/telegramdesktop/openssl-xcode.git + git clone https://github.com/telegramdesktop/openssl-xcode.git or: diff --git a/XCODEold.md b/XCODEold.md index 8decf2b10b..00d2e3e37a 100644 --- a/XCODEold.md +++ b/XCODEold.md @@ -22,6 +22,20 @@ In your build Terminal run to set minimal supported OS version to 10.6 for future console builds. +####zlib 1.2.8 + +http://www.zlib.net/ > Download [**zlib source code, version 1.2.8, zipfile format**](http://zlib.net/zlib128.zip) + +Extract to **/Users/user/TBuild/Libraries** + +#####Building library + +In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run: + + prefix=/usr/local/zlib_old CFLAGS="-mmacosx-version-min=10.6" LDFLAGS="-mmacosx-version-min=10.6" ./configure + make + sudo make install + ####OpenSSL 1.0.1g Get sources from https://github.com/telegramdesktop/openssl-xcode, by git – in Terminal go to **/Users/user/TBuild/Libraries** and run @@ -85,7 +99,7 @@ to have **/Users/user/TBuild/Libraries/openal-soft/CMakeLists.txt** In Terminal go to **/Users/user/TBuild/Libraries/openal-soft/build** and there run - cmake -D LIBTYPE:STRING=STATIC -D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 .. + cmake -D LIBTYPE:STRING=STATIC -D CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.6 -D CMAKE_INSTALL_PREFIX:STRING=/usr/local/openal_old .. make sudo make install From 02961ecc99df94a226b639a6b5edcaff23e45e82 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 2 Feb 2016 19:00:46 +0300 Subject: [PATCH 046/316] added mini_chromium patch for 10.6 and 10.8 os x google crashpad build --- Telegram/_mini_chromium_patch.diff | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Telegram/_mini_chromium_patch.diff diff --git a/Telegram/_mini_chromium_patch.diff b/Telegram/_mini_chromium_patch.diff new file mode 100644 index 0000000000..3dab62ec2c --- /dev/null +++ b/Telegram/_mini_chromium_patch.diff @@ -0,0 +1,52 @@ +diff --git a/base/mac/scoped_nsobject.h b/base/mac/scoped_nsobject.h +index 2e157a4..5a306a1 100644 +--- a/base/mac/scoped_nsobject.h ++++ b/base/mac/scoped_nsobject.h +@@ -11,6 +11,7 @@ + + #include "base/compiler_specific.h" + #include "base/mac/scoped_typeref.h" ++#include "base/template_util.h" + + namespace base { + +@@ -55,7 +56,7 @@ class scoped_nsobject : public scoped_nsprotocol { + public: + using scoped_nsprotocol::scoped_nsprotocol; + +- static_assert(std::is_same::value == false, ++ static_assert(is_same::value == false, + "Use ScopedNSAutoreleasePool instead"); + }; + +diff --git a/base/macros.h b/base/macros.h +index 5d96783..096704c 100644 +--- a/base/macros.h ++++ b/base/macros.h +@@ -42,8 +42,9 @@ char (&ArraySizeHelper(const T (&array)[N]))[N]; + + template + inline Dest bit_cast(const Source& source) { ++#if __cplusplus >= 201103L + static_assert(sizeof(Dest) == sizeof(Source), "sizes must be equal"); +- ++#endif + Dest dest; + memcpy(&dest, &source, sizeof(dest)); + return dest; +diff --git a/build/common.gypi b/build/common.gypi +index 1affc70..6e8f292 100644 +--- a/build/common.gypi ++++ b/build/common.gypi +@@ -66,6 +66,11 @@ + 'conditions': [ + ['clang!=0', { + 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', # -std=c++11 ++ 'conditions': [ ++ ['mac_deployment_target=="10.8"', { ++ 'CLANG_CXX_LIBRARY': 'libc++', # force -stdlib=libc++ for 10.8 ++ }] ++ ], + + # Don't link in libarclite_macosx.a, see http://crbug.com/156530. + 'CLANG_LINK_OBJC_RUNTIME': 'NO', # -fno-objc-link-runtime From 9d2b83c4d50e4cfb0b5e60b6d2367c999cd7355f Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 2 Feb 2016 19:12:45 +0300 Subject: [PATCH 047/316] fixed release build for win --- Telegram/Telegram.vcxproj | 268 ++++++++++++++++++++------------------ 1 file changed, 138 insertions(+), 130 deletions(-) diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 21af719fa8..081bce3516 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -96,7 +96,7 @@ AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\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) + .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\SourceFiles;.\GeneratedFiles;.\ThirdParty\breakpad;.\ThirdParty\minizip;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) ProgramDatabase MultiThreaded false @@ -126,7 +126,7 @@ AL_LIBTYPE_STATIC;CUSTOM_API_ID;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\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) + .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\SourceFiles;.\GeneratedFiles;.\ThirdParty\breakpad;.\ThirdParty\minizip;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) ProgramDatabase MultiThreaded false @@ -1055,15 +1055,23 @@ NotUsing + NotUsing + NotUsing NotUsing + NotUsing + NotUsing NotUsing + NotUsing + NotUsing NotUsing + NotUsing + NotUsing @@ -1095,7 +1103,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/types.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing types.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1103,7 +1111,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/types.h" Moc%27ing window.h... @@ -1113,8 +1121,8 @@ Moc%27ing window.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/window.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.\ThirdParty\breakpad" "-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/window.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1145,8 +1153,8 @@ Moc%27ing application.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/application.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.\ThirdParty\breakpad" "-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/application.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1159,7 +1167,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/apiwrap.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing apiwrap.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1167,7 +1175,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/apiwrap.h" @@ -1178,8 +1186,8 @@ Moc%27ing aboutbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/aboutbox.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.\ThirdParty\breakpad" "-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/boxes/aboutbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1192,8 +1200,8 @@ Moc%27ing addcontactbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/addcontactbox.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.\ThirdParty\breakpad" "-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/boxes/addcontactbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1206,8 +1214,8 @@ Moc%27ing confirmbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/confirmbox.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.\ThirdParty\breakpad" "-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/boxes/confirmbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1220,8 +1228,8 @@ Moc%27ing connectionbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/connectionbox.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.\ThirdParty\breakpad" "-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/boxes/connectionbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1234,8 +1242,8 @@ Moc%27ing contactsbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/contactsbox.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.\ThirdParty\breakpad" "-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/boxes/contactsbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1248,8 +1256,8 @@ Moc%27ing photocropbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/photocropbox.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.\ThirdParty\breakpad" "-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/boxes/photocropbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1262,8 +1270,8 @@ Moc%27ing photosendbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/photosendbox.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.\ThirdParty\breakpad" "-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/boxes/photosendbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1276,8 +1284,8 @@ Moc%27ing emojibox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/emojibox.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.\ThirdParty\breakpad" "-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/boxes/emojibox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1290,8 +1298,8 @@ Moc%27ing downloadpathbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/downloadpathbox.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.\ThirdParty\breakpad" "-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/boxes/downloadpathbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1300,7 +1308,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/audio.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing audio.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1308,13 +1316,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/audio.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/usernamebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing usernamebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1322,13 +1330,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/usernamebox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/languagebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing languagebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1336,13 +1344,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/languagebox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/backgroundbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing backgroundbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1350,13 +1358,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/backgroundbox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/autolockbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autolockbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1364,13 +1372,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/autolockbox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/passcodebox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodebox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1378,13 +1386,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/passcodebox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/sessionsbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing sessionsbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1392,13 +1400,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/sessionsbox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/abstractbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing abstractbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1406,13 +1414,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/abstractbox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/stickersetbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing stickersetbox.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1420,13 +1428,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/boxes/stickersetbox.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/autoupdater.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing autoupdater.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1434,7 +1442,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/autoupdater.h" @@ -1445,8 +1453,8 @@ Moc%27ing animation.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/animation.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.\ThirdParty\breakpad" "-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/gui/animation.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1459,8 +1467,8 @@ Moc%27ing button.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/button.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.\ThirdParty\breakpad" "-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/gui/button.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1473,8 +1481,8 @@ Moc%27ing flatbutton.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/flatbutton.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.\ThirdParty\breakpad" "-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/gui/flatbutton.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1487,8 +1495,8 @@ Moc%27ing flatinput.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/flatinput.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.\ThirdParty\breakpad" "-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/gui/flatinput.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1501,8 +1509,8 @@ Moc%27ing countryinput.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/countryinput.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.\ThirdParty\breakpad" "-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/gui/countryinput.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1516,8 +1524,8 @@ Moc%27ing scrollarea.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/scrollarea.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.\ThirdParty\breakpad" "-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/gui/scrollarea.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1530,8 +1538,8 @@ Moc%27ing dialogswidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/dialogswidget.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.\ThirdParty\breakpad" "-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/dialogswidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1544,8 +1552,8 @@ Moc%27ing flattextarea.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/flattextarea.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.\ThirdParty\breakpad" "-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/gui/flattextarea.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1558,8 +1566,8 @@ Moc%27ing fileuploader.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/fileuploader.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.\ThirdParty\breakpad" "-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/fileuploader.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1572,8 +1580,8 @@ Moc%27ing dropdown.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/dropdown.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.\ThirdParty\breakpad" "-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/dropdown.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1584,7 +1592,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/popupmenu.h" $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing popupmenu.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1592,7 +1600,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/popupmenu.h" @@ -1603,8 +1611,8 @@ Moc%27ing flatcheckbox.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/flatcheckbox.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.\ThirdParty\breakpad" "-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/gui/flatcheckbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1638,8 +1646,8 @@ Moc%27ing flatlabel.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/flatlabel.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.\ThirdParty\breakpad" "-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/gui/flatlabel.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1652,8 +1660,8 @@ Moc%27ing twidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/gui/twidget.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.\ThirdParty\breakpad" "-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/gui/twidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1663,13 +1671,13 @@ Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1682,8 +1690,8 @@ Moc%27ing historywidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/historywidget.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.\ThirdParty\breakpad" "-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/historywidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1696,8 +1704,8 @@ Moc%27ing intro.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.h" + "$(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.\ThirdParty\breakpad" "-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/intro/intro.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.\ThirdParty\breakpad" "-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/intro/intro.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1710,8 +1718,8 @@ Moc%27ing introcode.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/intro/introcode.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.\ThirdParty\breakpad" "-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/intro/introcode.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1724,8 +1732,8 @@ Moc%27ing introphone.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/intro/introphone.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.\ThirdParty\breakpad" "-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/intro/introphone.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1738,8 +1746,8 @@ Moc%27ing introsignup.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/intro/introsignup.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.\ThirdParty\breakpad" "-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/intro/introsignup.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1748,7 +1756,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/intro/intropwdcheck.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing intropwdcheck.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1756,7 +1764,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/intro/intropwdcheck.h" @@ -1767,8 +1775,8 @@ Moc%27ing layerwidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/layerwidget.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.\ThirdParty\breakpad" "-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/layerwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1781,8 +1789,8 @@ Moc%27ing localimageloader.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/localimageloader.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.\ThirdParty\breakpad" "-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/localimageloader.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1793,7 +1801,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/localstorage.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing localstorage.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1801,7 +1809,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/localstorage.h" @@ -1832,8 +1840,8 @@ Moc%27ing mtpConnection.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mtproto/mtpConnection.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.\ThirdParty\breakpad" "-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/mtproto/mtpConnection.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1846,8 +1854,8 @@ Moc%27ing mainwidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mainwidget.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.\ThirdParty\breakpad" "-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/mainwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1860,8 +1868,8 @@ Moc%27ing mtp.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mtproto/mtp.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.\ThirdParty\breakpad" "-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/mtproto/mtp.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1870,7 +1878,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mediaview.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing mediaview.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1878,7 +1886,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mediaview.h" @@ -1889,8 +1897,8 @@ Moc%27ing mtpFileLoader.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mtproto/mtpFileLoader.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.\ThirdParty\breakpad" "-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/mtproto/mtpFileLoader.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1905,8 +1913,8 @@ Moc%27ing mtpDC.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mtproto/mtpDC.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.\ThirdParty\breakpad" "-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/mtproto/mtpDC.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1921,8 +1929,8 @@ Moc%27ing mtpSession.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/mtproto/mtpSession.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.\ThirdParty\breakpad" "-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/mtproto/mtpSession.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1935,8 +1943,8 @@ Moc%27ing settingswidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/settingswidget.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.\ThirdParty\breakpad" "-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/settingswidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1949,8 +1957,8 @@ Moc%27ing profilewidget.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/profilewidget.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.\ThirdParty\breakpad" "-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/profilewidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1963,8 +1971,8 @@ Moc%27ing pspecific_wnd.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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.\ThirdParty\breakpad" "-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) @@ -1974,7 +1982,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/overviewwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing overviewwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1982,13 +1990,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/overviewwidget.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/passcodewidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing passcodewidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1996,13 +2004,13 @@ $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/passcodewidget.h" $(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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/playerwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing playerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2010,7 +2018,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/playerwidget.h" @@ -2018,7 +2026,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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_linux.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_linux.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2026,7 +2034,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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_linux.h" true true true @@ -2035,7 +2043,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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_mac.h" $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing pspecific_mac.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2043,7 +2051,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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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_mac.h" true true true @@ -2083,8 +2091,8 @@ Moc%27ing sysbuttons.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/sysbuttons.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.\ThirdParty\breakpad" "-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/sysbuttons.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -2097,8 +2105,8 @@ Moc%27ing title.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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -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.\ThirdParty\breakpad" "-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/title.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.\ThirdParty\breakpad" "-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/title.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) From ab00a0310a950968d82b9840e0b273d013d2a4e2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 2 Feb 2016 19:21:07 +0300 Subject: [PATCH 048/316] added crashing in settings --- Telegram/SourceFiles/settingswidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index ecb5d2468d..e52872678b 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -803,7 +803,9 @@ void SettingsInner::keyPressEvent(QKeyEvent *e) { break; } else if (str == qstr("loadlang")) { chooseCustomLang(); - } else if (qsl("debugmode").startsWith(str) || qsl("testmode").startsWith(str) || qsl("loadlang").startsWith(str)) { + } 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)) { break; } ++from; From 837432a4f3d793ca1c9481b30e1b07ccc6f2ccb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 3 Feb 2016 17:01:34 +0300 Subject: [PATCH 049/316] fixed connection on app state change --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/settingswidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 6ac2a77b67..051d171f84 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -720,7 +720,7 @@ AppClass::AppClass() : QObject() application()->installNativeEventFilter(psNativeEventFilter()); - connect(application(), SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); + Sandboxer::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause())); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index e52872678b..8b5e3bf0b9 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -221,7 +221,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) connect(App::main(), SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(peerUpdated(PeerData *))); connect(App::main(), SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(peerUpdated(PeerData *))); - connect(App::app(), SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onReloadPassword(Qt::ApplicationState))); + Sandboxer::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onReloadPassword(Qt::ApplicationState))); } // profile From fd0a119885a32a6e315733e07a7f7e78c6ea086a Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 4 Feb 2016 15:44:39 +0300 Subject: [PATCH 050/316] langs updated, build scripts updated --- README.md | 2 + Telegram/Build.bat | 30 +- Telegram/Build.sh | 62 ++- Telegram/Deploy.sh | 8 +- Telegram/SourceFiles/facades.cpp | 6 +- Telegram/SourceFiles/langs/lang_de.strings | 12 +- Telegram/SourceFiles/langs/lang_es.strings | 6 +- Telegram/SourceFiles/langs/lang_it.strings | 8 +- Telegram/SourceFiles/langs/lang_ko.strings | 4 +- Telegram/SourceFiles/langs/lang_nl.strings | 6 +- Telegram/SourceFiles/langs/lang_pt_BR.strings | 6 +- Telegram/SourceFiles/logs.cpp | 8 +- Telegram/Telegram.xcodeproj/project.pbxproj | 30 -- Telegram/_breakpad_appstore_patch.diff | 366 ++++++++++++++++++ 14 files changed, 486 insertions(+), 68 deletions(-) create mode 100644 Telegram/_breakpad_appstore_patch.diff diff --git a/README.md b/README.md index b2dc768a2c..df84d73516 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ The source code is published under GPLv3 with OpenSSL exception, the license is * libexif 0.6.20 ([LGPL](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)) * LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html)) * liblzma ([public domain](http://tukaani.org/xz/)) +* Google Breakpad ([License](https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE)) +* Google Crashpad ([Apache License 2.0](https://chromium.googlesource.com/crashpad/crashpad/+/master/LICENSE)) * OpenAL Soft ([LGPL](http://kcat.strangesoft.net/openal.html)) * Opus codec ([BSD license](http://www.opus-codec.org/license/)) * FFmpeg ([LGPL](https://www.ffmpeg.org/legal.html)) diff --git a/Telegram/Build.bat b/Telegram/Build.bat index 650a937ee5..5e2da4a8f1 100644 --- a/Telegram/Build.bat +++ b/Telegram/Build.bat @@ -29,6 +29,8 @@ set "HomePath=..\..\Telegram" set "ReleasePath=..\Win32\Deploy" set "DeployPath=%ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStrFull%" set "SignPath=..\..\TelegramPrivate\Sign.bat" +set "BinaryName=Telegram" +set "DropboxSymbolsPath=Z:\Dropbox\Telegram\symbols" if %BetaVersion% neq 0 ( if exist %DeployPath%\ ( @@ -71,9 +73,13 @@ echo . echo Version %AppVersionStrFull% build successfull. Preparing.. echo . +echo Dumping debug symbols.. +call ..\..\Libraries\breakpad\src\tools\windows\binaries\dump_syms.exe %ReleasePath%\%BinaryName%.pdb > %ReleasePath%\%BinaryName%.sym +echo Done! + set "PATH=%PATH%;C:\Program Files\7-Zip;C:\Program Files (x86)\Inno Setup 5" -call %SignPath% %ReleasePath%\Telegram.exe +call %SignPath% %ReleasePath%\%BinaryName%.exe if %errorlevel% neq 0 goto error call %SignPath% %ReleasePath%\Updater.exe @@ -90,7 +96,7 @@ if %BetaVersion% equ 0 ( ) cd %ReleasePath% -call Packer.exe -version %VersionForPacker% -path Telegram.exe -path Updater.exe %DevParam% +call Packer.exe -version %VersionForPacker% -path %BinaryName%.exe -path Updater.exe %DevParam% cd %HomePath% if %errorlevel% neq 0 goto error @@ -109,6 +115,22 @@ if %BetaVersion% neq 0 ( set "PortableFile=tbeta%BetaVersion%_%BetaSignature%.zip" ) +for /f ^"usebackq^ eol^=^ + +^ delims^=^" %%a in (..\Win32\Debug\Telegram.sym) do ( + set "SymbolsHashLine=%%a" + goto symbolslinedone +) +:symbolslinedone +FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsH +ash=%%l" + +echo Copying %BinaryName%.sym to %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% +if not exist %DropboxSymbolsPath%\%BinaryName% mkdir %DropboxSymbolsPath%\%BinaryName% +if not exist %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% mkdir %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% +xcopy %ReleasePath%\%BinaryName%.sym %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash%\ +echo Done! + if not exist %ReleasePath%\deploy mkdir %ReleasePath%\deploy if not exist %ReleasePath%\deploy\%AppVersionStrMajor% mkdir %ReleasePath%\deploy\%AppVersionStrMajor% mkdir %DeployPath% @@ -144,7 +166,7 @@ if not exist %DeployPath%\%PortableFile% goto error if %BetaVersion% equ 0 ( if not exist %DeployPath%\%SetupFile% goto error ) -if not exist %DeployPath%\Telegram.pdb goto error +if not exist %DeployPath%\%BinaryName%.pdb goto error if not exist %DeployPath%\Updater.exe goto error if not exist %DeployPath%\Updater.pdb goto error if not exist %FinalReleasePath%\%AppVersionStrMajor% mkdir %FinalReleasePath%\%AppVersionStrMajor% @@ -157,7 +179,7 @@ if %BetaVersion% equ 0 ( ) else ( xcopy %DeployPath%\%BetaKeyFile% %FinalDeployPath%\ /Y ) -xcopy %DeployPath%\Telegram.pdb %FinalDeployPath%\ +xcopy %DeployPath%\%BinaryName%.pdb %FinalDeployPath%\ xcopy %DeployPath%\Updater.exe %FinalDeployPath%\ xcopy %DeployPath%\Updater.pdb %FinalDeployPath%\ diff --git a/Telegram/Build.sh b/Telegram/Build.sh index 3aa9b88f66..302419fada 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -37,6 +37,7 @@ if [ "$BuildTarget" == "linux" ]; then WorkPath="./../Linux" FixScript="$HomePath/FixMake.sh" ReleasePath="./../Linux/Release" + BinaryName="Telegram" elif [ "$BuildTarget" == "linux32" ]; then echo "Building version $AppVersionStrFull for Linux 32bit.." UpdateFile="tlinux32upd$AppVersion" @@ -44,6 +45,7 @@ elif [ "$BuildTarget" == "linux32" ]; then WorkPath="./../Linux" FixScript="$HomePath/FixMake32.sh" ReleasePath="./../Linux/Release" + BinaryName="Telegram" elif [ "$BuildTarget" == "mac" ]; then echo "Building version $AppVersionStrFull for OS X 10.8+.." UpdateFile="tmacupd$AppVersion" @@ -104,6 +106,9 @@ fi #fi if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then + + DropboxSymbolsPath="/media/psf/Home/Dropbox/Telegram/symbols" + mkdir -p "$WorkPath/ReleaseIntermediateUpdater" cd "$WorkPath/ReleaseIntermediateUpdater" /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Updater.pro" @@ -118,8 +123,8 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then make echo "Telegram build complete!" cd "$HomePath" - if [ ! -f "$ReleasePath/Telegram" ]; then - echo "Telegram not found!" + if [ ! -f "$ReleasePath/$BinaryName" ]; then + echo "$BinaryName not found!" exit 1 fi @@ -128,8 +133,16 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then exit 1 fi + echo "Dumping debug symbols.." + "./../../Libraries/breakpad/src/tools/linux/dump_syms/dump_syms" "$ReleasePath/$BinaryName" > "$ReleasePath/$BinaryName.sym" + echo "Done!" + + echo "Stripping the executable.." + strip -s "$ReleasePath/$BinaryName" + echo "Done!" + echo "Preparing version $AppVersionStrFull, executing Packer.." - cd "$ReleasePath" && "./Packer" -path Telegram -path Updater -version $VersionForPacker $DevParam && cd "$HomePath" + cd "$ReleasePath" && "./Packer" -path "$BinaryName" -path Updater -version $VersionForPacker $DevParam && cd "$HomePath" echo "Packer done!" if [ "$BetaVersion" != "0" ]; then @@ -146,6 +159,12 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then SetupFile="tbeta${BetaVersion}_${BetaSignature}.tar.xz" fi + SymbolsHash=`head -n 1 "$ReleasePath/$BinaryName.sym" | awk -F " " 'END {print $4}'` + echo "Copying $BinaryName.sym to $DropboxSymbolsPath/$BinaryName/$SymbolsHash" + mkdir -p "$DropboxSymbolsPath/$BinaryName/$SymbolsHash" + cp "$ReleasePath/$BinaryName.sym" "$DropboxSymbolsPath/$BinaryName/$SymbolsHash/" + echo "Done!" + if [ ! -d "$ReleasePath/deploy" ]; then mkdir "$ReleasePath/deploy" fi @@ -154,10 +173,10 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then mkdir "$ReleasePath/deploy/$AppVersionStrMajor" fi - echo "Copying Telegram, Updater and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStrFull.."; + echo "Copying $BinaryName, Updater and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStrFull.."; mkdir "$DeployPath" - mkdir "$DeployPath/Telegram" - mv "$ReleasePath/Telegram" "$DeployPath/Telegram/" + mkdir "$DeployPath/$BinaryName" + mv "$ReleasePath/$BinaryName" "$DeployPath/Telegram/" mv "$ReleasePath/Updater" "$DeployPath/Telegram/" mv "$ReleasePath/$UpdateFile" "$DeployPath/" if [ "$BetaVersion" != "0" ]; then @@ -168,6 +187,8 @@ fi if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then + DropboxSymbolsPath="./../../../Dropbox/Telegram/symbols" + touch "./SourceFiles/telegram.qrc" xcodebuild -project Telegram.xcodeproj -alltargets -configuration Release build @@ -181,6 +202,28 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg exit 1 fi + if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then + echo "Removing Updater debug symbols.." + rm -rf "$ReleasePath/$BinaryName.app/Contents/Frameworks/Updater.dSYM" + echo "Done!" + fi + + echo "Dumping debug symbols.." + "./../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" > "$ReleasePath/$BinaryName.sym" + echo "Done!" + + echo "Stripping the executable.." + strip "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" + echo "Done!" + + echo "Signing the application.." + if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then + codesign --force --deep --sign "Developer ID Application: John Preston" "$ReleasePath/$BinaryName.app" + elif [ "$BuildTarget" == "macstore" ]; then + codesign --force --deep --sign "3rd Party Mac Developer Application: TELEGRAM MESSENGER LLP (6N38VWS5BX)" "$ReleasePath/$BinaryName.app" --entitlements "Telegram/Telegram Desktop.entitlements" + fi + echo "Done!" + AppUUID=`dwarfdump -u "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" | awk -F " " '{print $2}'` DsymUUID=`dwarfdump -u "$ReleasePath/$BinaryName.app.dSYM" | awk -F " " '{print $2}'` if [ "$AppUUID" != "$DsymUUID" ]; then @@ -215,6 +258,12 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg fi fi + SymbolsHash=`head -n 1 "$ReleasePath/$BinaryName.sym" | awk -F " " 'END {print $4}'` + echo "Copying $BinaryName.sym to $DropboxSymbolsPath/$BinaryName/$SymbolsHash" + mkdir -p "$DropboxSymbolsPath/$BinaryName/$SymbolsHash" + cp "$ReleasePath/$BinaryName.sym" "$DropboxSymbolsPath/$BinaryName/$SymbolsHash/" + echo "Done!" + if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then if [ "$BetaVersion" == "0" ]; then cd "$ReleasePath" @@ -294,6 +343,7 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg rm "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" rm -rf "$ReleasePath/$BinaryName.app/Contents/_CodeSignature" + mkdir -p "$DropboxDeployPath" cp -v "$DeployPath/$BinaryName.app" "$DropboxDeployPath/" cp -rv "$DeployPath/$BinaryName.app.dSYM" "$DropboxDeployPath/" fi diff --git a/Telegram/Deploy.sh b/Telegram/Deploy.sh index 058cbf09d2..4a54d780a7 100755 --- a/Telegram/Deploy.sh +++ b/Telegram/Deploy.sh @@ -165,13 +165,7 @@ fi fi fi - if [ ! -d "$DropboxPath" ]; then - mkdir "$DropboxPath" - fi - - if [ ! -d "$DropboxDeployPath" ]; then - mkdir "$DropboxDeployPath" - fi + mkdir -p "$DropboxDeployPath" fi #fi diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 5023c7ed7a..e434100510 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -199,7 +199,7 @@ namespace Global { dataStream.setVersion(QDataStream::Qt_5_3); dataStream << quint64(cRealBetaVersion()) << cBetaPrivateKey(); } else { - LOG(("Error: could not open '%1' for writing private key!").arg(beta.fileName())); + LOG(("FATAL: Could not open '%1' for writing private key!").arg(beta.fileName())); return false; } } else if (beta.exists()) { @@ -216,11 +216,11 @@ namespace Global { cSetBetaPrivateKey(k); cSetRealBetaVersion(v); } else { - LOG(("Error: '%1' is corrupted, reinstall private beta!").arg(beta.fileName())); + LOG(("FATAL: '%1' is corrupted, reinstall private beta!").arg(beta.fileName())); return false; } } else { - LOG(("Error: could not open '%1' for reading private key!").arg(beta.fileName())); + LOG(("FATAL: could not open '%1' for reading private key!").arg(beta.fileName())); return false; } } diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 6764779b1a..fc48c7322e 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -78,7 +78,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_weekday7_full" = "Sonntag"; "lng_month_day" = "{day}. {month}"; -"lng_month_day_year" = "{day} {month}, {year}"; +"lng_month_day_year" = "{day}. {month} {year}"; "lng_month_year" = "{month}, {year}"; "lng_box_ok" = "OK"; @@ -454,7 +454,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_chat_all_members_admins" = "Alle Mitglieder Sind Admins"; "lng_chat_about_all_admins" = "Gruppenmitglieder können neue Leute hinzufügen sowie den Gruppennamen und das Bild ändern."; -"lng_chat_about_admins" = "Nur Admins können neue neue Leute hinzufügen und entfernen, den Gruppennamen und das Bild ändern."; +"lng_chat_about_admins" = "Nur Admins können neue Leute hinzufügen und entfernen, den Gruppennamen und das Bild ändern."; "lng_participant_filter" = "Suche"; "lng_participant_invite" = "Einladen"; @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "Sicher, dass du diese Gruppe löschen willst? Alle Mitglieder und Nachrichten werden entfernt."; "lng_message_empty" = "Leere Nachricht"; -"lng_media_unsupported" = "Format Nicht Unterstützt"; +"lng_message_unsupported" = "Diese Nachricht wird von deiner Telegram Desktop Version nicht unterstützt. Bitte aktualisiere sie in den Einstellungen oder über {link}"; "lng_action_add_user" = "{from} hat {user} hinzugefügt"; "lng_action_add_users_many" = "{from} hat {users} hinzugefügt"; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "Gespeicherte GIFs"; "lng_inline_bot_results" = "Ergebnisse von {inline_bot}"; "lng_inline_bot_no_results" = "Keine Ergebnisse"; +"lng_inline_bot_via" = "via {inline_bot}"; "lng_box_remove" = "Entfernen"; @@ -793,7 +794,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_delete" = "Löschen"; "lng_selected_forward" = "Weiterleiten"; "lng_selected_count" = "{count:_not_used_|# Nachricht|# Nachrichten}"; -"lng_selected_cancel_sure_this" = "Upload wirklich abbrechen?"; +"lng_selected_cancel_sure_this" = "Upload abbrechen?"; +"lng_selected_upload_stop" = "Abbrechen"; "lng_selected_delete_sure_this" = "Diese Nachricht wirklich löschen?"; "lng_selected_delete_sure" = "Willst du {count:_not_used_|# Nachricht|# Nachrichten} löschen?"; "lng_box_delete" = "Löschen"; @@ -877,7 +879,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_mac_menu_redo" = "Wiederholen"; "lng_mac_menu_cut" = "Ausschneiden"; "lng_mac_menu_copy" = "Kopieren"; -"lng_mac_menu_paste" = "Einsetzen"; +"lng_mac_menu_paste" = "Einfügen"; "lng_mac_menu_delete" = "Löschen"; "lng_mac_menu_select_all" = "Alles auswählen"; "lng_mac_menu_window" = "Fenster"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 20716ed5d5..ecb880634f 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "¿Quieres eliminar este grupo? Todos los miembros y mensajes se perderán."; "lng_message_empty" = "Mensaje vacío"; -"lng_media_unsupported" = "Multimedia no soportada"; +"lng_message_unsupported" = "Este mensaje no es soportado por tu versión de Telegram Desktop. Por favor, actualiza a la última versión desde Ajustes o instálala desde {link}"; "lng_action_add_user" = "{from} añadió a {user}"; "lng_action_add_users_many" = "{from} añadió a {users}"; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "GIF guardados"; "lng_inline_bot_results" = "Resultados de {inline_bot}"; "lng_inline_bot_no_results" = "Sin resultados"; +"lng_inline_bot_via" = "vía {inline_bot}"; "lng_box_remove" = "Eliminar"; @@ -793,7 +794,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_delete" = "Eliminar"; "lng_selected_forward" = "Reenviar"; "lng_selected_count" = "{count:_not_used_|# mensaje|# mensajes}"; -"lng_selected_cancel_sure_this" = "¿Quieres cancelar este envío?"; +"lng_selected_cancel_sure_this" = "¿Cancelar envío?"; +"lng_selected_upload_stop" = "Detener"; "lng_selected_delete_sure_this" = "¿Quieres eliminar este mensaje?"; "lng_selected_delete_sure" = "¿Quieres eliminar {count:_not_used_|# mensaje|# mensajes}?"; "lng_box_delete" = "Eliminar"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 28d9b9eaee..b68200cac0 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "Sei sicuro di voler eliminare questo gruppo? Tutti i membri verranno rimossi e i messaggi verranno persi."; "lng_message_empty" = "Messaggio vuoto"; -"lng_media_unsupported" = "Media non supportato"; +"lng_message_unsupported" = "Questo messaggio non è supportato dalla tua versione di Telegram Desktop. Per favore, aggiorna all'ultima versione dalle Impostazioni o installalo da {link}"; "lng_action_add_user" = "{from} ha aggiunto {user}"; "lng_action_add_users_many" = "{from} ha aggiunto {users}"; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "GIF salvate"; "lng_inline_bot_results" = "Risultati da {inline_bot}"; "lng_inline_bot_no_results" = "Nessun risultato"; +"lng_inline_bot_via" = "via {inline_bot}"; "lng_box_remove" = "Rimuovi"; @@ -793,7 +794,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_delete" = "Elimina"; "lng_selected_forward" = "Inoltra"; "lng_selected_count" = "{count:_not_used_|# messaggio|# messaggi}"; -"lng_selected_cancel_sure_this" = "Vuoi annullare il caricamento?"; +"lng_selected_cancel_sure_this" = "Annullare il caricamento?"; +"lng_selected_upload_stop" = "Arresta "; "lng_selected_delete_sure_this" = "Vuoi eliminare questo messaggio?"; "lng_selected_delete_sure" = "Vuoi eliminare {count:_not_used_|# messaggio|# messaggi}?"; "lng_box_delete" = "Elimina"; @@ -832,7 +834,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}"; "lng_new_version_minor" = "— Bug fix e altri miglioramenti minori"; -"lng_new_version_text" = "Rivoluzione GIF: L'invio e il download delle GIF sono ora 10 volte più veloci, riproduci automaticamente le GIF e salva le tue GIF preferite in una pagina dedicata nel pannello sticker.\n\nPiù info sulle GIF:\n{gifs_link}\n\n@-Bot: Un nuovo modo di aggiungere contenuto dai bot in qualsiasi chat. Scrivi l'username di un bot e la tua domanda nel campo di scrittura per ricevere risultati immediati e inviarli nella chat. Prova a scrivere “@gif dog” nella tua prossima chat. Bot di esempio: @gif, @wiki, @bing, @vid, @bold.\n\nPiù info sui @-Bot:\n{bots_link}\n\nInoltre in questa versione: Nuovo design per i media, impostazioni di download automatico per foto, note vocali e GIF."; +"lng_new_version_text" = "Rivoluzione GIF: L'invio e il download delle GIF sono ora 10 volte più veloci, riproduci automaticamente le GIF e salva le tue GIF preferite in una pagina dedicata nel pannello sticker.\n\nPiù info sulle GIF:\n{gifs_link}\n\nInline Bot: Un nuovo modo di aggiungere contenuto dai bot in qualsiasi chat. Scrivi l'username di un bot e la tua domanda nel campo di scrittura per ricevere risultati immediati e inviarli nella chat. Prova a scrivere “@gif dog” nella tua prossima chat. Bot di esempio: @gif, @wiki, @bing, @vid, @bold.\n\nPiù info sugli Inline Bot:\n{bots_link}\n\nInoltre in questa versione: Nuovo design per i media, impostazioni di download automatico per foto, note vocali e GIF."; "lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 09113ebe73..2c7022c509 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "정말로 그룹방을 삭제하시겠습니까? 모든 구성원 및 메시지가 삭제됩니다."; "lng_message_empty" = "메시지 없음"; -"lng_media_unsupported" = "지원하지 않는 미디어"; +"lng_message_unsupported" = "이 메시지는 텔레그램 데스크탑에서 호환이 되지 않습니다. 설정에서 최신 버전으로 업데이트를 하던가 {link}를 통하여 설치해주세요."; "lng_action_add_user" = "{from} 님께서 {user} 님을 초대하셨습니다."; "lng_action_add_users_many" = "{from}님께서 {users}명을 초대하였습니다."; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "저장된 GIF"; "lng_inline_bot_results" = "{inline_bot} 결과"; "lng_inline_bot_no_results" = "결과 없음"; +"lng_inline_bot_via" = "{inline_bot} 결과"; "lng_box_remove" = "삭제"; @@ -794,6 +795,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_forward" = "전달"; "lng_selected_count" = "{count:_not_used_|# 메시지|# 메시지}"; "lng_selected_cancel_sure_this" = "업로드를 취소하시겠습니까?"; +"lng_selected_upload_stop" = "정지"; "lng_selected_delete_sure_this" = "메시지를 삭제하시겠습니까?"; "lng_selected_delete_sure" = "{count:_not_used_|# 메시지|# 메시지}를 삭제하시겠습니까?"; "lng_box_delete" = "삭제"; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index fe6af5786c..b1993615f1 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "Groep echt verwijderen? Berichten worden gewist en alle deelnemers verwijderd."; "lng_message_empty" = "Leeg bericht"; -"lng_media_unsupported" = "Niet-ondersteunde media"; +"lng_message_unsupported" = "Dit bericht wordt niet ondersteund door jouw versie van Telegram Desktop. Werk bij naar de laatste versie via de instellingen of installeer vanuit {link}"; "lng_action_add_user" = "{from} heeft {user} toegevoegd"; "lng_action_add_users_many" = "{from} heeft {users} toegevoegd"; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "Opgeslagen GIF's"; "lng_inline_bot_results" = "Resultaten van {inline_bot}"; "lng_inline_bot_no_results" = "Geen resultaten"; +"lng_inline_bot_via" = "via {inline_bot}"; "lng_box_remove" = "Verwijder"; @@ -793,7 +794,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_delete" = "Verwijder"; "lng_selected_forward" = "Doorsturen"; "lng_selected_count" = "{count:_not_used_|# bericht|# berichten}"; -"lng_selected_cancel_sure_this" = "Wil je deze upload annuleren?"; +"lng_selected_cancel_sure_this" = "Upload annuleren?"; +"lng_selected_upload_stop" = "Stoppen"; "lng_selected_delete_sure_this" = "Wil je dit bericht verwijderen?"; "lng_selected_delete_sure" = "Wil je {count:_not_used_|# bericht|# berichten} verwijderen?"; "lng_box_delete" = "Verwijder"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index 200c3741e5..26d2c98b35 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -498,7 +498,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_sure_delete_group" = "Tem certeza que deseja apagar este grupo? Todos os membros serão removidos e todas as mensagens serão perdidas."; "lng_message_empty" = "Mensagem Vazia"; -"lng_media_unsupported" = "Mídia Não-Suportada"; +"lng_message_unsupported" = "Essa mensagem não é suportada em sua versão do Telegram Desktop. Atualize para a última versão nas Configurações ou instale por aqui {link}"; "lng_action_add_user" = "{from} adicionou {user}"; "lng_action_add_users_many" = "{from} adicionou {users}"; @@ -600,6 +600,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_saved_gifs" = "GIFs Salvos"; "lng_inline_bot_results" = "Resultados de {inline_bot}"; "lng_inline_bot_no_results" = "Nenhum resultado"; +"lng_inline_bot_via" = "via {inline_bot}"; "lng_box_remove" = "Remover"; @@ -793,7 +794,8 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org "lng_selected_delete" = "Apagar"; "lng_selected_forward" = "Encaminhar"; "lng_selected_count" = "{count:_not_used_|# mensagem|# mensagens}"; -"lng_selected_cancel_sure_this" = "Você deseja cancelar o envio?"; +"lng_selected_cancel_sure_this" = "Cancelar envio?"; +"lng_selected_upload_stop" = "Parar"; "lng_selected_delete_sure_this" = "Você deseja apagar essa mensagem?"; "lng_selected_delete_sure" = "Você deseja apagar {count:_not_used_|# mensagem|# mensagens}?"; "lng_box_delete" = "Apagar"; diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index b776cba00f..c987c70c62 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -338,7 +338,7 @@ namespace Logs { LOG(("Arguments: %1").arg(cArguments())); if (!LogsData) { - LOG(("Could not open '%1' for writing log!").arg(_logsFilePath(LogDataMain, qsl("_startXX")))); + LOG(("FATAL: Could not open '%1' for writing log!").arg(_logsFilePath(LogDataMain, qsl("_startXX")))); return; } @@ -391,7 +391,7 @@ namespace Logs { delete LogsData; LogsData = 0; - LOG(("Could not move logging to '%1'!").arg(_logsFilePath(LogDataMain))); + LOG(("FATAL: Could not move logging to '%1'!").arg(_logsFilePath(LogDataMain))); return false; } @@ -860,6 +860,7 @@ namespace SignalHandlers { #elif defined Q_OS_MAC #ifdef MAC_USE_BREAKPAD +#ifndef _DEBUG BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( dumpspath.toUtf8().toStdString(), /*FilterCallback*/ 0, @@ -868,6 +869,7 @@ namespace SignalHandlers { true, 0 ); +#endif SetSignalHandlers = false; #else crashpad::CrashpadClient crashpad_client; @@ -956,7 +958,7 @@ namespace SignalHandlers { return Started; } - LOG(("Could not open '%1' for writing!").arg(QString::fromUtf8(CrashDumpPath))); + LOG(("FATAL: Could not open '%1' for writing!").arg(QString::fromUtf8(CrashDumpPath))); return CantOpen; } diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 70a484b14d..22ede49fcf 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1357,9 +1357,7 @@ 07C3AF341948FC3B0016CFF1 /* Force Resources Directory */, 07C3AF25194336160016CFF1 /* Resources */, 07489B6B1A28949600348CD9 /* Build Updater */, - 0746AC8F1A28D4140040AE26 /* Clean Updater */, 071AD90E1C60AA74008C9E90 /* Copy crashpad_handler */, - 07489B6D1A28972E00348CD9 /* Sign Application */, ); buildRules = ( ); @@ -1454,20 +1452,6 @@ shellPath = /bin/sh; shellScript = "mkdir -p \"$CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/Contents/Helpers\" && cp \"./../../Libraries/crashpad/crashpad/out/Release/crashpad_handler\" \"$CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/Contents/Helpers/\""; }; - 0746AC8F1A28D4140040AE26 /* Clean Updater */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Clean Updater"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "rm -rf \"$CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/Updater.dSYM\""; - }; 07489B6B1A28949600348CD9 /* Build Updater */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1482,20 +1466,6 @@ shellPath = /bin/sh; shellScript = "xcodebuild -project Updater.xcodeproj -configuration $CONFIGURATION"; }; - 07489B6D1A28972E00348CD9 /* Sign Application */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Sign Application"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "codesign --force --deep --sign \"Developer ID Application: John Preston\" \"$CONFIGURATION_BUILD_DIR/$PRODUCT_NAME.app\""; - }; 07C3AF341948FC3B0016CFF1 /* Force Resources Directory */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/Telegram/_breakpad_appstore_patch.diff b/Telegram/_breakpad_appstore_patch.diff new file mode 100644 index 0000000000..9b12b92b8c --- /dev/null +++ b/Telegram/_breakpad_appstore_patch.diff @@ -0,0 +1,366 @@ +diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj +index 584ec5d..9cea428 100644 +--- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj ++++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj +@@ -174,7 +174,6 @@ + F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */; }; + F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; + F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; +- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */ = {isa = PBXBuildFile; fileRef = F92C53540ECCE349009BE4BA /* Inspector */; }; + F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */; }; + F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; }; + F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; +@@ -213,7 +212,6 @@ + F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */; }; + F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; + F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; +- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */ = {isa = PBXBuildFile; fileRef = F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */; }; + F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */; }; + F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */; }; + F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */; }; +@@ -417,13 +415,6 @@ + remoteGlobalIDString = F92C563B0ECD10B3009BE4BA; + remoteInfo = breakpadUtilities; + }; +- F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */ = { +- isa = PBXContainerItemProxy; +- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; +- proxyType = 1; +- remoteGlobalIDString = F92C53530ECCE349009BE4BA; +- remoteInfo = Inspector; +- }; + F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; +@@ -536,13 +527,6 @@ + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = Breakpad; + }; +- F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */ = { +- isa = PBXContainerItemProxy; +- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; +- proxyType = 1; +- remoteGlobalIDString = F92C569F0ECE04A7009BE4BA; +- remoteInfo = crash_report_sender; +- }; + /* End PBXContainerItemProxy section */ + + /* Begin PBXCopyFilesBuildPhase section */ +@@ -1193,8 +1177,6 @@ + ); + dependencies = ( + F92C56860ECD15EF009BE4BA /* PBXTargetDependency */, +- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */, +- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */, + ); + name = Breakpad; + productInstallPath = "$(HOME)/Library/Frameworks"; +@@ -1401,6 +1383,8 @@ + /* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; ++ attributes = { ++ }; + buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; +@@ -1589,8 +1573,6 @@ + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( +- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */, +- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */, + F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; +@@ -1962,11 +1944,6 @@ + target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; + targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */; + }; +- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */ = { +- isa = PBXTargetDependency; +- target = F92C53530ECCE349009BE4BA /* Inspector */; +- targetProxy = F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */; +- }; + F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F93803BD0F80820F004D428B /* generator_test */; +@@ -2027,11 +2004,6 @@ + target = 8DC2EF4F0486A6940098B216 /* Breakpad */; + targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */; + }; +- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */ = { +- isa = PBXTargetDependency; +- target = F92C569F0ECE04A7009BE4BA /* crash_report_sender */; +- targetProxy = F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */; +- }; + /* End PBXTargetDependency section */ + + /* Begin PBXVariantGroup section */ +@@ -2128,8 +2100,12 @@ + isa = XCBuildConfiguration; + baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; + buildSettings = { ++ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; +- SDKROOT = macosx10.5; ++ GCC_VERSION = ""; ++ MACOSX_DEPLOYMENT_TARGET = 10.8; ++ SDKROOT = macosx; + }; + name = Debug; + }; +@@ -2137,7 +2113,12 @@ + isa = XCBuildConfiguration; + baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */; + buildSettings = { ++ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; ++ GCC_VERSION = ""; ++ MACOSX_DEPLOYMENT_TARGET = 10.8; ++ SDKROOT = macosx; + }; + name = Release; + }; +@@ -2456,7 +2437,12 @@ + isa = XCBuildConfiguration; + baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; + buildSettings = { ++ CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; ++ GCC_VERSION = ""; ++ MACOSX_DEPLOYMENT_TARGET = 10.8; ++ SDKROOT = macosx; + }; + name = "Debug With Code Coverage"; + }; +diff --git a/src/client/mac/Framework/Breakpad.mm b/src/client/mac/Framework/Breakpad.mm +index 1d2e519..943310f 100644 +--- a/src/client/mac/Framework/Breakpad.mm ++++ b/src/client/mac/Framework/Breakpad.mm +@@ -355,10 +355,10 @@ bool Breakpad::Initialize(NSDictionary *parameters) { + return false; + } + +- if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue]) ++// if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue]) + return InitializeInProcess(parameters); +- else +- return InitializeOutOfProcess(parameters); ++// else ++// return InitializeOutOfProcess(parameters); + } + + //============================================================================= +@@ -373,52 +373,52 @@ bool Breakpad::InitializeInProcess(NSDictionary* parameters) { + } + + //============================================================================= +-bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) { +- // Get path to Inspector executable. +- NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION); +- +- // Standardize path (resolve symlinkes, etc.) and escape spaces +- inspectorPathString = [inspectorPathString stringByStandardizingPath]; +- inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "] +- componentsJoinedByString:@"\\ "]; +- +- // Create an on-demand server object representing the Inspector. +- // In case of a crash, we simply need to call the LaunchOnDemand() +- // method on it, then send a mach message to its service port. +- // It will then launch and perform a process inspection of our crashed state. +- // See the HandleException() method for the details. +-#define RECEIVE_PORT_NAME "com.Breakpad.Inspector" +- +- name_t portName; +- snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid()); +- +- // Save the location of the Inspector +- strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation], +- sizeof(inspector_path_)); +- +- // Append a single command-line argument to the Inspector path +- // representing the bootstrap name of the launch-on-demand receive port. +- // When the Inspector is launched, it can use this to lookup the port +- // by calling bootstrap_check_in(). +- strlcat(inspector_path_, " ", sizeof(inspector_path_)); +- strlcat(inspector_path_, portName, sizeof(inspector_path_)); +- +- kern_return_t kr = inspector_.Initialize(inspector_path_, +- portName, +- true); // shutdown on exit +- +- if (kr != KERN_SUCCESS) { +- return false; +- } +- +- // Create the handler (allocating it in our special protected pool) +- handler_ = +- new (gBreakpadAllocator->Allocate( +- sizeof(google_breakpad::ExceptionHandler))) +- google_breakpad::ExceptionHandler( +- Breakpad::ExceptionHandlerDirectCallback, this, true); +- return true; +-} ++//bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) { ++// // Get path to Inspector executable. ++// NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION); ++// ++// // Standardize path (resolve symlinkes, etc.) and escape spaces ++// inspectorPathString = [inspectorPathString stringByStandardizingPath]; ++// inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "] ++// componentsJoinedByString:@"\\ "]; ++// ++// // Create an on-demand server object representing the Inspector. ++// // In case of a crash, we simply need to call the LaunchOnDemand() ++// // method on it, then send a mach message to its service port. ++// // It will then launch and perform a process inspection of our crashed state. ++// // See the HandleException() method for the details. ++//#define RECEIVE_PORT_NAME "com.Breakpad.Inspector" ++// ++// name_t portName; ++// snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid()); ++// ++// // Save the location of the Inspector ++// strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation], ++// sizeof(inspector_path_)); ++// ++// // Append a single command-line argument to the Inspector path ++// // representing the bootstrap name of the launch-on-demand receive port. ++// // When the Inspector is launched, it can use this to lookup the port ++// // by calling bootstrap_check_in(). ++// strlcat(inspector_path_, " ", sizeof(inspector_path_)); ++// strlcat(inspector_path_, portName, sizeof(inspector_path_)); ++// ++// kern_return_t kr = inspector_.Initialize(inspector_path_, ++// portName, ++// true); // shutdown on exit ++// ++// if (kr != KERN_SUCCESS) { ++// return false; ++// } ++// ++// // Create the handler (allocating it in our special protected pool) ++// handler_ = ++// new (gBreakpadAllocator->Allocate( ++// sizeof(google_breakpad::ExceptionHandler))) ++// google_breakpad::ExceptionHandler( ++// Breakpad::ExceptionHandlerDirectCallback, this, true); ++// return true; ++//} + + //============================================================================= + Breakpad::~Breakpad() { +@@ -445,10 +445,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { + NSString *version = [parameters objectForKey:@BREAKPAD_VERSION]; + NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL]; + NSString *interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL]; +- NSString *inspectorPathString = +- [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION]; +- NSString *reporterPathString = +- [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION]; ++// NSString *inspectorPathString = ++// [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION]; ++// NSString *reporterPathString = ++// [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION]; + NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT]; + NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES]; + NSString *logFileTailSize = +@@ -536,39 +536,39 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { + } + + // Find the helper applications if not specified in user config. +- NSString *resourcePath = nil; +- if (!inspectorPathString || !reporterPathString) { +- resourcePath = GetResourcePath(); +- if (!resourcePath) { +- return false; +- } +- } ++// NSString *resourcePath = nil; ++// if (!inspectorPathString || !reporterPathString) { ++// resourcePath = GetResourcePath(); ++// if (!resourcePath) { ++// return false; ++// } ++// } + + // Find Inspector. +- if (!inspectorPathString) { +- inspectorPathString = +- [resourcePath stringByAppendingPathComponent:@"Inspector"]; +- } +- +- // Verify that there is an Inspector tool. +- if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) { +- return false; +- } ++// if (!inspectorPathString) { ++// inspectorPathString = ++// [resourcePath stringByAppendingPathComponent:@"Inspector"]; ++// } ++// ++// // Verify that there is an Inspector tool. ++// if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) { ++// return false; ++// } + + // Find Reporter. +- if (!reporterPathString) { +- reporterPathString = +- [resourcePath +- stringByAppendingPathComponent:@"crash_report_sender.app"]; +- reporterPathString = +- [[NSBundle bundleWithPath:reporterPathString] executablePath]; +- } ++// if (!reporterPathString) { ++// reporterPathString = ++// [resourcePath ++// stringByAppendingPathComponent:@"crash_report_sender.app"]; ++// reporterPathString = ++// [[NSBundle bundleWithPath:reporterPathString] executablePath]; ++// } + + // Verify that there is a Reporter application. +- if (![[NSFileManager defaultManager] +- fileExistsAtPath:reporterPathString]) { +- return false; +- } ++// if (![[NSFileManager defaultManager] ++// fileExistsAtPath:reporterPathString]) { ++// return false; ++// } + + if (!dumpSubdirectory) { + dumpSubdirectory = @""; +@@ -601,10 +601,10 @@ bool Breakpad::ExtractParameters(NSDictionary *parameters) { + dictionary.SetKeyValue(BREAKPAD_REPORT_INTERVAL, [interval UTF8String]); + dictionary.SetKeyValue(BREAKPAD_SKIP_CONFIRM, [skipConfirm UTF8String]); + dictionary.SetKeyValue(BREAKPAD_CONFIRM_TIMEOUT, [timeout UTF8String]); +- dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION, +- [inspectorPathString fileSystemRepresentation]); +- dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION, +- [reporterPathString fileSystemRepresentation]); ++// dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION, ++// [inspectorPathString fileSystemRepresentation]); ++// dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION, ++// [reporterPathString fileSystemRepresentation]); + dictionary.SetKeyValue(BREAKPAD_LOGFILE_UPLOAD_SIZE, + [logFileTailSize UTF8String]); + dictionary.SetKeyValue(BREAKPAD_REQUEST_COMMENTS, +@@ -762,9 +762,9 @@ bool Breakpad::HandleException(int exception_type, + bool Breakpad::HandleMinidump(const char *dump_dir, const char *minidump_id) { + google_breakpad::ConfigFile config_file; + config_file.WriteFile(dump_dir, config_params_, dump_dir, minidump_id); +- google_breakpad::LaunchReporter( +- config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION), +- config_file.GetFilePath()); ++// google_breakpad::LaunchReporter( ++// config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION), ++// config_file.GetFilePath()); + return true; + } + From 952f24e4e1d43a0613984037221540a6e37cafe7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 4 Feb 2016 17:49:08 +0300 Subject: [PATCH 051/316] beta version 9019001 with new crash tracking --- Telegram/SourceFiles/config.h | 2 +- Telegram/Version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 4a1637ba04..716414b06a 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9019; static const wchar_t *AppVersionStr = L"0.9.19"; static const bool DevVersion = true; -//#define BETA_VERSION (9015008ULL) // just comment this line to build public version +#define BETA_VERSION (9019001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Version b/Telegram/Version index 9aa9665cef..fba09052d8 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.19 AppVersionStr 0.9.19 DevChannel 1 -BetaVersion 0 9015008 +BetaVersion 9019001 From 91e1330b5966b0422b9ada4750249985582b4390 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 4 Feb 2016 20:45:53 +0300 Subject: [PATCH 052/316] improved breakpad appstore patch --- Telegram/Build.sh | 2 +- Telegram/_breakpad_appstore_patch.diff | 147 +++++++++++++++++++++---- 2 files changed, 126 insertions(+), 23 deletions(-) diff --git a/Telegram/Build.sh b/Telegram/Build.sh index 302419fada..f7a64597ff 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -209,7 +209,7 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg fi echo "Dumping debug symbols.." - "./../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" > "$ReleasePath/$BinaryName.sym" + "./../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "$ReleasePath/$BinaryName.app.dSYM" > "$ReleasePath/$BinaryName.sym" 2>/dev/null echo "Done!" echo "Stripping the executable.." diff --git a/Telegram/_breakpad_appstore_patch.diff b/Telegram/_breakpad_appstore_patch.diff index 9b12b92b8c..7ef79fa216 100644 --- a/Telegram/_breakpad_appstore_patch.diff +++ b/Telegram/_breakpad_appstore_patch.diff @@ -1,16 +1,40 @@ diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj -index 584ec5d..9cea428 100644 +index 584ec5d..1c7214f 100644 --- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj +++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj -@@ -174,7 +174,6 @@ +@@ -35,6 +35,19 @@ + /* End PBXAggregateTarget section */ + + /* Begin PBXBuildFile section */ ++ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; }; ++ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; }; ++ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; }; ++ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; }; ++ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; }; ++ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; }; ++ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; }; ++ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; }; ++ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; }; ++ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; }; ++ 0748C04E1C63C51C004489BF /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; }; ++ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; }; ++ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; }; + 162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; }; + 162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 162F64F1161C577500CD68D5 /* arch_utilities.h */; }; + 162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; }; +@@ -170,11 +183,8 @@ + F92C564A0ECD10CA009BE4BA /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; }; + F92C564C0ECD10DD009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; + F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C554A0ECCF530009BE4BA /* Carbon.framework */; }; +- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */; }; F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; - F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; +- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; - F92C568A0ECD15F9009BE4BA /* Inspector in Resources */ = {isa = PBXBuildFile; fileRef = F92C53540ECCE349009BE4BA /* Inspector */; }; F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */; }; F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; }; F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; -@@ -213,7 +212,6 @@ +@@ -213,7 +223,6 @@ F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */; }; F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; @@ -18,10 +42,17 @@ index 584ec5d..9cea428 100644 F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */; }; F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */; }; F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */; }; -@@ -417,13 +415,6 @@ +@@ -410,20 +419,6 @@ remoteGlobalIDString = F92C563B0ECD10B3009BE4BA; remoteInfo = breakpadUtilities; }; +- F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */ = { +- isa = PBXContainerItemProxy; +- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; +- proxyType = 1; +- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA; +- remoteInfo = breakpadUtilities; +- }; - F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -32,7 +63,7 @@ index 584ec5d..9cea428 100644 F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; -@@ -536,13 +527,6 @@ +@@ -536,13 +531,6 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = Breakpad; }; @@ -46,10 +77,28 @@ index 584ec5d..9cea428 100644 /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ -@@ -1193,8 +1177,6 @@ +@@ -715,7 +703,6 @@ + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( +- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */, + 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; +@@ -1183,18 +1170,13 @@ + isa = PBXNativeTarget; + buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */; + buildPhases = ( +- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */, + 8DC2EF500486A6940098B216 /* Headers */, +- 8DC2EF520486A6940098B216 /* Resources */, + 8DC2EF540486A6940098B216 /* Sources */, + 8DC2EF560486A6940098B216 /* Frameworks */, + ); + buildRules = ( ); dependencies = ( - F92C56860ECD15EF009BE4BA /* PBXTargetDependency */, +- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */, - F92C56880ECD15F1009BE4BA /* PBXTargetDependency */, - F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */, ); @@ -64,19 +113,73 @@ index 584ec5d..9cea428 100644 buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; -@@ -1589,8 +1573,6 @@ - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( +@@ -1585,16 +1569,6 @@ + /* End PBXReferenceProxy section */ + + /* Begin PBXResourcesBuildPhase section */ +- 8DC2EF520486A6940098B216 /* Resources */ = { +- isa = PBXResourcesBuildPhase; +- buildActionMask = 2147483647; +- files = ( - F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */, - F92C568A0ECD15F9009BE4BA /* Inspector in Resources */, - F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; -@@ -1962,11 +1944,6 @@ - target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; - targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */; +- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */, +- ); +- runOnlyForDeploymentPostprocessing = 0; +- }; + F92C569C0ECE04A7009BE4BA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; +@@ -1642,20 +1616,6 @@ + shellPath = /bin/sh; + shellScript = "install_name_tool -id \"@executable_path/../Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n"; }; +- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */ = { +- isa = PBXShellScriptBuildPhase; +- buildActionMask = 2147483647; +- files = ( +- ); +- inputPaths = ( +- ); +- name = "Change install name of breakpadUtilities"; +- outputPaths = ( +- ); +- runOnlyForDeploymentPostprocessing = 0; +- shellPath = /bin/sh; +- shellScript = "#!/bin/bash\ninstall_name_tool -id \"@executable_path/../Frameworks/Breakpad.framework/Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n"; +- }; + F9C77DD80F7DD5CF0045F7DB /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; +@@ -1676,6 +1636,19 @@ + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( ++ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */, ++ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */, ++ 0748C04E1C63C51C004489BF /* md5.cc in Sources */, ++ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */, ++ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */, ++ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */, ++ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */, ++ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */, ++ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */, ++ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */, ++ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */, ++ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */, ++ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */, + F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */, + F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */, + F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */, +@@ -1957,16 +1930,6 @@ + target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; + targetProxy = F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */; + }; +- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */ = { +- isa = PBXTargetDependency; +- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; +- targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */; +- }; - F92C56880ECD15F1009BE4BA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = F92C53530ECCE349009BE4BA /* Inspector */; @@ -85,7 +188,7 @@ index 584ec5d..9cea428 100644 F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F93803BD0F80820F004D428B /* generator_test */; -@@ -2027,11 +2004,6 @@ +@@ -2027,11 +1990,6 @@ target = 8DC2EF4F0486A6940098B216 /* Breakpad */; targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */; }; @@ -97,7 +200,7 @@ index 584ec5d..9cea428 100644 /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ -@@ -2128,8 +2100,12 @@ +@@ -2128,8 +2086,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { @@ -111,7 +214,7 @@ index 584ec5d..9cea428 100644 }; name = Debug; }; -@@ -2137,7 +2113,12 @@ +@@ -2137,7 +2099,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { @@ -124,7 +227,7 @@ index 584ec5d..9cea428 100644 }; name = Release; }; -@@ -2456,7 +2437,12 @@ +@@ -2456,7 +2423,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { From f3a4b5460196ff3a6b1e24ce09596e0b1e07d10a Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 01:16:25 +0300 Subject: [PATCH 053/316] fixed bugs in crash dump finding and in beta version --- Telegram/SourceFiles/facades.cpp | 1 + Telegram/SourceFiles/window.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index e434100510..4cb9c62023 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -191,6 +191,7 @@ namespace Global { QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta")); if (cBetaVersion()) { cForceWorkingDir(cExeDir() + qsl("TelegramBeta_data/")); + QDir().mkpath(cWorkingDir() + qstr("tdata")); if (*BetaPrivateKey) { cSetBetaPrivateKey(QByteArray(BetaPrivateKey)); } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 6525b79dde..43c2b25a8d 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2028,7 +2028,7 @@ LastCrashedWindow::LastCrashedWindow() if (!possibleDump.startsWith('/')) { possibleDump = dumpspath + '/' + possibleDump; } - if (!possibleDump.endsWith('.dmp')) { + if (!possibleDump.endsWith(qstr(".dmp"))) { possibleDump += qsl(".dmp"); } QFileInfo possibleInfo(possibleDump); From cec7ebc24f5c0f40c0fee788b13b976f82a9c709 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 13:21:57 +0300 Subject: [PATCH 054/316] fixed build script, 0.9.19.1 version in .rc --- Telegram/Build.bat | 5 ++--- Telegram/Telegram.rc | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Telegram/Build.bat b/Telegram/Build.bat index 5e2da4a8f1..d6c274cb38 100644 --- a/Telegram/Build.bat +++ b/Telegram/Build.bat @@ -117,13 +117,12 @@ if %BetaVersion% neq 0 ( for /f ^"usebackq^ eol^=^ -^ delims^=^" %%a in (..\Win32\Debug\Telegram.sym) do ( +^ delims^=^" %%a in (%ReleasePath%\%BinaryName%.sym) do ( set "SymbolsHashLine=%%a" goto symbolslinedone ) :symbolslinedone -FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsH -ash=%%l" +FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsHash=%%l" echo Copying %BinaryName%.sym to %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% if not exist %DropboxSymbolsPath%\%BinaryName% mkdir %DropboxSymbolsPath%\%BinaryName% diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index e22500f40a..7b4720543a 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,19,0 - PRODUCTVERSION 0,9,19,0 + FILEVERSION 0,9,19,1 + PRODUCTVERSION 0,9,19,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.19.0" + VALUE "FileVersion", "0.9.19.1" VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.19.0" + VALUE "ProductVersion", "0.9.19.1" END END BLOCK "VarFileInfo" From 6e8fc37ca95d0a41af2724bcd8eb7cfb822435d9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 16:31:24 +0300 Subject: [PATCH 055/316] using libs for google breakpad on windows --- Telegram/Telegram.vcxproj | 438 ++-- Telegram/Telegram.vcxproj.filters | 102 - .../client/linux/handler/exception_handler.cc | 765 ------ .../client/linux/handler/exception_handler.h | 278 -- .../client/mac/crash_generation/client_info.h | 47 - .../crash_generation_client.cc | 72 - .../crash_generation_client.h | 65 - .../crash_generation_server.cc | 166 -- .../crash_generation_server.h | 150 -- .../client/mac/handler/breakpad_nlist_64.cc | 402 --- .../client/mac/handler/breakpad_nlist_64.h | 47 - .../client/mac/handler/dynamic_images.cc | 573 ----- .../client/mac/handler/dynamic_images.h | 319 --- .../client/mac/handler/exception_handler.cc | 855 ------- .../client/mac/handler/exception_handler.h | 281 -- .../client/mac/handler/mach_vm_compat.h | 48 - .../client/mac/handler/minidump_generator.cc | 1591 ------------ .../client/mac/handler/minidump_generator.h | 236 -- .../client/mac/handler/ucontext_compat.h | 47 - .../client/minidump_file_writer-inl.h | 97 - .../breakpad/client/minidump_file_writer.cc | 350 --- .../breakpad/client/minidump_file_writer.h | 272 -- .../client/windows/common/ipc_protocol.h | 181 -- .../crash_generation_client.cc | 405 --- .../crash_generation_client.h | 182 -- .../windows/handler/exception_handler.cc | 1073 -------- .../windows/handler/exception_handler.h | 522 ---- .../ThirdParty/breakpad/common/convert_UTF.c | 554 ---- .../ThirdParty/breakpad/common/convert_UTF.h | 164 -- .../common/linux/linux_libc_support.h | 96 - .../ThirdParty/breakpad/common/mac/MachIPC.h | 301 --- .../ThirdParty/breakpad/common/mac/MachIPC.mm | 306 --- .../breakpad/common/mac/bootstrap_compat.cc | 42 - .../breakpad/common/mac/bootstrap_compat.h | 54 - .../ThirdParty/breakpad/common/mac/byteswap.h | 73 - .../ThirdParty/breakpad/common/mac/file_id.cc | 106 - .../ThirdParty/breakpad/common/mac/file_id.h | 81 - .../breakpad/common/mac/macho_id.cc | 369 --- .../ThirdParty/breakpad/common/mac/macho_id.h | 131 - .../breakpad/common/mac/macho_utilities.cc | 155 -- .../breakpad/common/mac/macho_utilities.h | 95 - .../breakpad/common/mac/macho_walker.cc | 268 -- .../breakpad/common/mac/macho_walker.h | 119 - .../common/mac/scoped_task_suspend-inl.h | 56 - .../breakpad/common/mac/string_utilities.cc | 84 - .../breakpad/common/mac/string_utilities.h | 52 - Telegram/ThirdParty/breakpad/common/md5.cc | 251 -- Telegram/ThirdParty/breakpad/common/md5.h | 27 - Telegram/ThirdParty/breakpad/common/memory.h | 212 -- .../ThirdParty/breakpad/common/scoped_ptr.h | 404 --- .../breakpad/common/string_conversion.cc | 155 -- .../breakpad/common/string_conversion.h | 68 - .../breakpad/common/using_std_string.h | 65 - .../breakpad/common/windows/guid_string.cc | 76 - .../breakpad/common/windows/guid_string.h | 58 - .../common/windows/string_utils-inl.h | 142 -- .../google_breakpad/common/breakpad_types.h | 68 - .../common/minidump_cpu_amd64.h | 235 -- .../google_breakpad/common/minidump_cpu_arm.h | 151 -- .../common/minidump_cpu_arm64.h | 140 - .../common/minidump_cpu_mips.h | 160 -- .../google_breakpad/common/minidump_cpu_ppc.h | 168 -- .../common/minidump_cpu_ppc64.h | 134 - .../common/minidump_cpu_sparc.h | 163 -- .../google_breakpad/common/minidump_cpu_x86.h | 174 -- .../common/minidump_exception_linux.h | 87 - .../common/minidump_exception_mac.h | 205 -- .../common/minidump_exception_ps3.h | 67 - .../common/minidump_exception_solaris.h | 94 - .../common/minidump_exception_win32.h | 2261 ----------------- .../google_breakpad/common/minidump_format.h | 972 ------- .../google_breakpad/common/minidump_size.h | 107 - 72 files changed, 201 insertions(+), 19113 deletions(-) delete mode 100644 Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h delete mode 100644 Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h delete mode 100644 Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h delete mode 100644 Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/minidump_file_writer.h delete mode 100644 Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h delete mode 100644 Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h delete mode 100644 Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc delete mode 100644 Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h delete mode 100644 Telegram/ThirdParty/breakpad/common/convert_UTF.c delete mode 100644 Telegram/ThirdParty/breakpad/common/convert_UTF.h delete mode 100644 Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/MachIPC.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/byteswap.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/file_id.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/file_id.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_id.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_id.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/macho_walker.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/mac/string_utilities.h delete mode 100644 Telegram/ThirdParty/breakpad/common/md5.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/md5.h delete mode 100644 Telegram/ThirdParty/breakpad/common/memory.h delete mode 100644 Telegram/ThirdParty/breakpad/common/scoped_ptr.h delete mode 100644 Telegram/ThirdParty/breakpad/common/string_conversion.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/string_conversion.h delete mode 100644 Telegram/ThirdParty/breakpad/common/using_std_string.h delete mode 100644 Telegram/ThirdParty/breakpad/common/windows/guid_string.cc delete mode 100644 Telegram/ThirdParty/breakpad/common/windows/guid_string.h delete mode 100644 Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h delete mode 100644 Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 081bce3516..16a8dc9350 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -69,7 +69,7 @@ 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;.\ThirdParty\breakpad;.\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) + .\..\..\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 Use @@ -82,8 +82,8 @@ Windows $(OutDir)$(ProjectName).exe - .\..\..\Libraries\lzma\C\Util\LzmaLib\Debug;.\..\..\Libraries\libexif-0.6.20\win32\Debug;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Debug;.\..\..\Libraries\openal-soft\build\Debug;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatDebug;.\..\..\Libraries\openssl_debug\Debug\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmaind.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Cored.lib;Qt5Guid.lib;qtharfbuzzngd.lib;qtpcred.lib;qtfreetyped.lib;Qt5Widgetsd.lib;Qt5Networkd.lib;Qt5PlatformSupportd.lib;platforms\qwindowsd.lib;imageformats\qwebpd.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;LzmaLib.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies) + .\..\..\Libraries\lzma\C\Util\LzmaLib\Debug;.\..\..\Libraries\libexif-0.6.20\win32\Debug;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Debug;.\..\..\Libraries\openal-soft\build\Debug;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatDebug;.\..\..\Libraries\openssl_debug\Debug\lib;.\..\..\Libraries\breakpad\src\client\windows\Debug;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmaind.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Cored.lib;Qt5Guid.lib;qtharfbuzzngd.lib;qtpcred.lib;qtfreetyped.lib;Qt5Widgetsd.lib;Qt5Networkd.lib;Qt5PlatformSupportd.lib;platforms\qwindowsd.lib;imageformats\qwebpd.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;LzmaLib.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;lib\common.lib;lib\exception_handler.lib;lib\crash_generation_client.lib;%(AdditionalDependencies) true LIBCMT @@ -96,7 +96,7 @@ AL_LIBTYPE_STATIC;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\SourceFiles;.\GeneratedFiles;.\ThirdParty\breakpad;.\ThirdParty\minizip;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) + .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\SourceFiles;.\GeneratedFiles;.\..\..\Libraries\breakpad\src;.\ThirdParty\minizip;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) ProgramDatabase MultiThreaded false @@ -111,8 +111,8 @@ Windows $(OutDir)$(ProjectName).exe - .\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies) + .\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;.\..\..\Libraries\breakpad\src\client\windows\Release;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;lib\common.lib;lib\exception_handler.lib;lib\crash_generation_client.lib;%(AdditionalDependencies) $(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib $(IntDir)$(TargetName).pgd @@ -126,7 +126,7 @@ AL_LIBTYPE_STATIC;CUSTOM_API_ID;UNICODE;WIN32;WIN64;HAVE_STDINT_H;ZLIB_WINAPI;QT_NO_DEBUG;NDEBUG;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\SourceFiles;.\GeneratedFiles;.\ThirdParty\breakpad;.\ThirdParty\minizip;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) + .\..\..\Libraries\lzma\C;.\..\..\Libraries\libexif-0.6.20;.\..\..\Libraries\zlib-1.2.8;.\..\..\Libraries\openssl\Release\include;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\openal-soft\include;.\SourceFiles;.\GeneratedFiles;.\..\..\Libraries\breakpad\src;.\ThirdParty\minizip;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);.\..\..\Libraries\QtStatic\qtbase\include\QtCore\5.5.1\QtCore;.\..\..\Libraries\QtStatic\qtbase\include\QtGui\5.5.1\QtGui;%(AdditionalIncludeDirectories) ProgramDatabase MultiThreaded false @@ -141,8 +141,8 @@ Windows $(OutDir)$(ProjectName).exe - .\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies) + .\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;.\..\..\Libraries\breakpad\src\client\windows\Release;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories) + kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;lib\common.lib;lib\exception_handler.lib;lib\crash_generation_client.lib;%(AdditionalDependencies) $(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib @@ -1053,21 +1053,6 @@ - - NotUsing - NotUsing - NotUsing - - - NotUsing - NotUsing - NotUsing - - - NotUsing - NotUsing - NotUsing - NotUsing NotUsing @@ -1075,27 +1060,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -1103,26 +1067,26 @@ $(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 -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.\ThirdParty\breakpad" "-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/types.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/types.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/types.h" + "$(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/types.h" 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/window.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.\ThirdParty\breakpad" "-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/window.h" + "$(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/window.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/window.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1148,13 +1112,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/application.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.\ThirdParty\breakpad" "-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/application.h" + "$(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/application.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/application.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1167,27 +1131,27 @@ $(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 -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.\ThirdParty\breakpad" "-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/apiwrap.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/apiwrap.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/apiwrap.h" + "$(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/apiwrap.h" 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/aboutbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/aboutbox.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/boxes/aboutbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1195,13 +1159,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/addcontactbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/addcontactbox.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/boxes/addcontactbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1209,13 +1173,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/confirmbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/confirmbox.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/boxes/confirmbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1223,13 +1187,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/connectionbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/connectionbox.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/boxes/connectionbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1237,13 +1201,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/contactsbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/contactsbox.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/boxes/contactsbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1251,13 +1215,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/photocropbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/photocropbox.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/boxes/photocropbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1265,13 +1229,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/photosendbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/photosendbox.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/boxes/photosendbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1279,13 +1243,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/emojibox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/emojibox.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/boxes/emojibox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1293,13 +1257,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/boxes/downloadpathbox.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.\ThirdParty\breakpad" "-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/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 -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/boxes/downloadpathbox.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/boxes/downloadpathbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1308,153 +1272,153 @@ $(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 -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.\ThirdParty\breakpad" "-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/audio.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/audio.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/audio.h" + "$(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/audio.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/usernamebox.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/boxes/usernamebox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/usernamebox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/languagebox.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/boxes/languagebox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/languagebox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/backgroundbox.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/boxes/backgroundbox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/backgroundbox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/autolockbox.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/boxes/autolockbox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/autolockbox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/passcodebox.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/boxes/passcodebox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/passcodebox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/sessionsbox.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/boxes/sessionsbox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/sessionsbox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/abstractbox.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/boxes/abstractbox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/abstractbox.h" $(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 -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.\ThirdParty\breakpad" "-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/boxes/stickersetbox.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/boxes/stickersetbox.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/boxes/stickersetbox.h" $(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 -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.\ThirdParty\breakpad" "-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/autoupdater.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/autoupdater.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/autoupdater.h" + "$(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/autoupdater.h" 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/animation.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.\ThirdParty\breakpad" "-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/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 -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/gui/animation.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/gui/animation.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1462,13 +1426,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/button.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.\ThirdParty\breakpad" "-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/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 -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/gui/button.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/gui/button.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1476,13 +1440,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/flatbutton.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.\ThirdParty\breakpad" "-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/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 -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/gui/flatbutton.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/gui/flatbutton.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1490,13 +1454,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/flatinput.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.\ThirdParty\breakpad" "-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/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 -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/gui/flatinput.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/gui/flatinput.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1504,13 +1468,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/countryinput.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.\ThirdParty\breakpad" "-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/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 -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/gui/countryinput.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/gui/countryinput.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1519,13 +1483,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/scrollarea.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.\ThirdParty\breakpad" "-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/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 -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/gui/scrollarea.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/gui/scrollarea.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1533,13 +1497,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/dialogswidget.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.\ThirdParty\breakpad" "-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/dialogswidget.h" + "$(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/dialogswidget.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/dialogswidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1547,13 +1511,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/flattextarea.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.\ThirdParty\breakpad" "-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/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 -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/gui/flattextarea.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/gui/flattextarea.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1561,13 +1525,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/fileuploader.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.\ThirdParty\breakpad" "-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/fileuploader.h" + "$(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/fileuploader.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/fileuploader.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1575,13 +1539,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/dropdown.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.\ThirdParty\breakpad" "-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/dropdown.h" + "$(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/dropdown.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/dropdown.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1592,27 +1556,27 @@ $(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 -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.\ThirdParty\breakpad" "-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/gui/popupmenu.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/gui/popupmenu.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/gui/popupmenu.h" 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/flatcheckbox.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.\ThirdParty\breakpad" "-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/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 -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/gui/flatcheckbox.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/gui/flatcheckbox.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1641,13 +1605,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/flatlabel.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.\ThirdParty\breakpad" "-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/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 -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/gui/flatlabel.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/gui/flatlabel.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1655,13 +1619,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/gui/twidget.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.\ThirdParty\breakpad" "-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/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 -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/gui/twidget.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/gui/twidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1671,13 +1635,13 @@ Moc%27ing history.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(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.\ThirdParty\breakpad" "-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" + "$(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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.\ThirdParty\breakpad" "-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" + "$(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" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1685,13 +1649,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/historywidget.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.\ThirdParty\breakpad" "-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/historywidget.h" + "$(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/historywidget.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/historywidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1699,13 +1663,13 @@ Moc%27ing intro.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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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/intro.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/intro.h" Moc%27ing intro.h... Moc%27ing intro.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.\ThirdParty\breakpad" "-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/intro/intro.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.\ThirdParty\breakpad" "-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/intro/intro.h" + "$(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/intro/intro.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/intro/intro.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1713,13 +1677,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/intro/introcode.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.\ThirdParty\breakpad" "-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/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 -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/intro/introcode.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/intro/introcode.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1727,13 +1691,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/intro/introphone.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.\ThirdParty\breakpad" "-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/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 -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/intro/introphone.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/intro/introphone.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1741,13 +1705,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/intro/introsignup.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.\ThirdParty\breakpad" "-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/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 -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/intro/introsignup.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/intro/introsignup.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1756,27 +1720,27 @@ $(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 -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.\ThirdParty\breakpad" "-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/intro/intropwdcheck.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/intro/intropwdcheck.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/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 -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/intro/intropwdcheck.h" 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/layerwidget.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.\ThirdParty\breakpad" "-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/layerwidget.h" + "$(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/layerwidget.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/layerwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1784,13 +1748,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/localimageloader.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.\ThirdParty\breakpad" "-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/localimageloader.h" + "$(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/localimageloader.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/localimageloader.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1801,15 +1765,15 @@ $(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 -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.\ThirdParty\breakpad" "-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/localstorage.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/localstorage.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/localstorage.h" + "$(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/localstorage.h" @@ -1835,13 +1799,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/mtproto/mtpConnection.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.\ThirdParty\breakpad" "-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/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 -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/mtproto/mtpConnection.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/mtproto/mtpConnection.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1849,13 +1813,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/mainwidget.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.\ThirdParty\breakpad" "-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/mainwidget.h" + "$(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/mainwidget.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/mainwidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1863,13 +1827,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/mtproto/mtp.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.\ThirdParty\breakpad" "-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/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 -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/mtproto/mtp.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/mtproto/mtp.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1878,27 +1842,27 @@ $(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 -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.\ThirdParty\breakpad" "-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/mediaview.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/mediaview.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/mediaview.h" + "$(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/mediaview.h" 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/mtproto/mtpFileLoader.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.\ThirdParty\breakpad" "-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/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 -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/mtproto/mtpFileLoader.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/mtproto/mtpFileLoader.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1908,13 +1872,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/mtproto/mtpDC.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.\ThirdParty\breakpad" "-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/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 -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/mtproto/mtpDC.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/mtproto/mtpDC.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1924,13 +1888,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/mtproto/mtpSession.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.\ThirdParty\breakpad" "-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/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 -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/mtproto/mtpSession.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/mtproto/mtpSession.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1938,13 +1902,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/settingswidget.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.\ThirdParty\breakpad" "-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/settingswidget.h" + "$(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/settingswidget.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/settingswidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1952,13 +1916,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/profilewidget.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.\ThirdParty\breakpad" "-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/profilewidget.h" + "$(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/profilewidget.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/profilewidget.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1966,13 +1930,13 @@ Moc%27ing pspecific_wnd.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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 -DUNICODE -DWIN32 -DWIN64 -DHAVE_STDINT_H -DZLIB_WINAPI -D_SCL_SECURE_NO_WARNINGS "-I.\..\..\Libraries\lzma\C" "-I.\..\..\Libraries\libexif-0.6.20" "-I.\..\..\Libraries\zlib-1.2.8" "-I.\..\..\Libraries\openssl_debug\Debug\include" "-I.\..\..\Libraries\ffmpeg" "-I.\..\..\Libraries\openal-soft\include" "-I.\..\..\Libraries\breakpad\src" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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... .\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.\ThirdParty\breakpad" "-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.\ThirdParty\breakpad" "-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 -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) @@ -1982,43 +1946,43 @@ $(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 -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.\ThirdParty\breakpad" "-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/overviewwidget.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/overviewwidget.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/overviewwidget.h" + "$(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/overviewwidget.h" $(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 -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.\ThirdParty\breakpad" "-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/passcodewidget.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/passcodewidget.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/passcodewidget.h" + "$(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/passcodewidget.h" $(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 -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.\ThirdParty\breakpad" "-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/playerwidget.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/playerwidget.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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/playerwidget.h" + "$(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/playerwidget.h" @@ -2026,15 +1990,15 @@ $(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 -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.\ThirdParty\breakpad" "-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_linux.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_linux.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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_linux.h" + "$(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_linux.h" true true true @@ -2043,15 +2007,15 @@ $(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 -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.\ThirdParty\breakpad" "-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_mac.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_mac.h" $(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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 - "$(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.\ThirdParty\breakpad" "-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_mac.h" + "$(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_mac.h" true true true @@ -2086,13 +2050,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/sysbuttons.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.\ThirdParty\breakpad" "-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/sysbuttons.h" + "$(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/sysbuttons.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/sysbuttons.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -2100,13 +2064,13 @@ 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.\ThirdParty\breakpad" "-I.\ThirdParty\minizip" "-I.\SourceFiles" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-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 .\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.\ThirdParty\breakpad" "-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/title.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.\ThirdParty\breakpad" "-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/title.h" + "$(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/title.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/title.h" $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index 394abb94be..ddc386b0a0 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -52,36 +52,6 @@ {1abe710c-3c36-484c-b2a5-881c29a051c2} - - {7bd3aaf0-4c45-4177-841d-e09b420f969b} - - - {7e91af88-3ca1-43f3-b213-ae3a6e9adbe3} - - - {729af6c6-f616-40f3-86d8-7a177a4ca581} - - - {6ebf64cf-1373-4c85-bc7c-a334da36957d} - - - {342ef107-8d0a-4518-a4ef-186706a51186} - - - {ea350daa-d09f-4e6a-a31d-46c971c7e117} - - - {22eae21d-0b6e-4c24-b12a-cad8538b25cf} - - - {6a602fc1-ef90-4276-ad51-e68e520a750d} - - - {8c8b7809-73e8-4074-986d-39cfda2961a0} - - - {1a35c875-fa31-4146-9555-1443abb58026} - @@ -936,15 +906,6 @@ ThirdParty\minizip - - ThirdParty\breakpad\client\windows\handler - - - ThirdParty\breakpad\client\windows\crash_generation - - - ThirdParty\breakpad\common\windows - @@ -1043,69 +1004,6 @@ ThirdParty\minizip - - ThirdParty\breakpad\client\windows\handler - - - ThirdParty\breakpad\client\windows\common - - - ThirdParty\breakpad\client\windows\crash_generation - - - ThirdParty\breakpad\common\windows - - - ThirdParty\breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\common\windows - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - - - ThirdParty\breakpad\google_breakpad\common - diff --git a/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc b/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc deleted file mode 100644 index 148d61f9f3..0000000000 --- a/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.cc +++ /dev/null @@ -1,765 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// The ExceptionHandler object installs signal handlers for a number of -// signals. We rely on the signal handler running on the thread which crashed -// in order to identify it. This is true of the synchronous signals (SEGV etc), -// but not true of ABRT. Thus, if you send ABRT to yourself in a program which -// uses ExceptionHandler, you need to use tgkill to direct it to the current -// thread. -// -// The signal flow looks like this: -// -// SignalHandler (uses a global stack of ExceptionHandler objects to find -// | one to handle the signal. If the first rejects it, try -// | the second etc...) -// V -// HandleSignal ----------------------------| (clones a new process which -// | | shares an address space with -// (wait for cloned | the crashed process. This -// process) | allows us to ptrace the crashed -// | | process) -// V V -// (set signal handler to ThreadEntry (static function to bounce -// SIG_DFL and rethrow, | back into the object) -// killing the crashed | -// process) V -// DoDump (writes minidump) -// | -// V -// sys_exit -// - -// This code is a little fragmented. Different functions of the ExceptionHandler -// class run in a number of different contexts. Some of them run in a normal -// context and are easy to code, others run in a compromised context and the -// restrictions at the top of minidump_writer.cc apply: no libc and use the -// alternative malloc. Each function should have comment above it detailing the -// context which it runs in. - -#include "client/linux/handler/exception_handler.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include "common/basictypes.h" -#include "common/linux/linux_libc_support.h" -#include "common/memory.h" -#include "client/linux/log/log.h" -#include "client/linux/microdump_writer/microdump_writer.h" -#include "client/linux/minidump_writer/linux_dumper.h" -#include "client/linux/minidump_writer/minidump_writer.h" -#include "common/linux/eintr_wrapper.h" -#include "third_party/lss/linux_syscall_support.h" - -#if defined(__ANDROID__) -#include "linux/sched.h" -#endif - -#ifndef PR_SET_PTRACER -#define PR_SET_PTRACER 0x59616d61 -#endif - -// A wrapper for the tgkill syscall: send a signal to a specific thread. -static int tgkill(pid_t tgid, pid_t tid, int sig) { - return syscall(__NR_tgkill, tgid, tid, sig); - return 0; -} - -namespace google_breakpad { - -namespace { -// The list of signals which we consider to be crashes. The default action for -// all these signals must be Core (see man 7 signal) because we rethrow the -// signal after handling it and expect that it'll be fatal. -const int kExceptionSignals[] = { - SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS -}; -const int kNumHandledSignals = - sizeof(kExceptionSignals) / sizeof(kExceptionSignals[0]); -struct sigaction old_handlers[kNumHandledSignals]; -bool handlers_installed = false; - -// InstallAlternateStackLocked will store the newly installed stack in new_stack -// and (if it exists) the previously installed stack in old_stack. -stack_t old_stack; -stack_t new_stack; -bool stack_installed = false; - -// Create an alternative stack to run the signal handlers on. This is done since -// the signal might have been caused by a stack overflow. -// Runs before crashing: normal context. -void InstallAlternateStackLocked() { - if (stack_installed) - return; - - memset(&old_stack, 0, sizeof(old_stack)); - memset(&new_stack, 0, sizeof(new_stack)); - - // SIGSTKSZ may be too small to prevent the signal handlers from overrunning - // the alternative stack. Ensure that the size of the alternative stack is - // large enough. - static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ); - - // Only set an alternative stack if there isn't already one, or if the current - // one is too small. - if (sys_sigaltstack(NULL, &old_stack) == -1 || !old_stack.ss_sp || - old_stack.ss_size < kSigStackSize) { - new_stack.ss_sp = calloc(1, kSigStackSize); - new_stack.ss_size = kSigStackSize; - - if (sys_sigaltstack(&new_stack, NULL) == -1) { - free(new_stack.ss_sp); - return; - } - stack_installed = true; - } -} - -// Runs before crashing: normal context. -void RestoreAlternateStackLocked() { - if (!stack_installed) - return; - - stack_t current_stack; - if (sys_sigaltstack(NULL, ¤t_stack) == -1) - return; - - // Only restore the old_stack if the current alternative stack is the one - // installed by the call to InstallAlternateStackLocked. - if (current_stack.ss_sp == new_stack.ss_sp) { - if (old_stack.ss_sp) { - if (sys_sigaltstack(&old_stack, NULL) == -1) - return; - } else { - stack_t disable_stack; - disable_stack.ss_flags = SS_DISABLE; - if (sys_sigaltstack(&disable_stack, NULL) == -1) - return; - } - } - - free(new_stack.ss_sp); - stack_installed = false; -} - -void InstallDefaultHandler(int sig) { -#if defined(__ANDROID__) - // Android L+ expose signal and sigaction symbols that override the system - // ones. There is a bug in these functions where a request to set the handler - // to SIG_DFL is ignored. In that case, an infinite loop is entered as the - // signal is repeatedly sent to breakpad's signal handler. - // To work around this, directly call the system's sigaction. - struct kernel_sigaction sa; - memset(&sa, 0, sizeof(sa)); - sys_sigemptyset(&sa.sa_mask); - sa.sa_handler_ = SIG_DFL; - sa.sa_flags = SA_RESTART; - sys_rt_sigaction(sig, &sa, NULL, sizeof(kernel_sigset_t)); -#else - signal(sig, SIG_DFL); -#endif -} - -// The global exception handler stack. This is needed because there may exist -// multiple ExceptionHandler instances in a process. Each will have itself -// registered in this stack. -std::vector* g_handler_stack_ = NULL; -pthread_mutex_t g_handler_stack_mutex_ = PTHREAD_MUTEX_INITIALIZER; - -// sizeof(CrashContext) can be too big w.r.t the size of alternatate stack -// for SignalHandler(). Keep the crash context as a .bss field. Exception -// handlers are serialized by the |g_handler_stack_mutex_| and at most one at a -// time can use |g_crash_context_|. -ExceptionHandler::CrashContext g_crash_context_; - -} // namespace - -// Runs before crashing: normal context. -ExceptionHandler::ExceptionHandler(const MinidumpDescriptor& descriptor, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - bool install_handler, - const int server_fd) - : filter_(filter), - callback_(callback), - callback_context_(callback_context), - minidump_descriptor_(descriptor), - crash_handler_(NULL) { - if (server_fd >= 0) - crash_generation_client_.reset(CrashGenerationClient::TryCreate(server_fd)); - - if (!IsOutOfProcess() && !minidump_descriptor_.IsFD() && - !minidump_descriptor_.IsMicrodumpOnConsole()) - minidump_descriptor_.UpdatePath(); - -#if defined(__ANDROID__) - if (minidump_descriptor_.IsMicrodumpOnConsole()) - logger::initializeCrashLogWriter(); -#endif - - pthread_mutex_lock(&g_handler_stack_mutex_); - - // Pre-fault the crash context struct. This is to avoid failing due to OOM - // if handling an exception when the process ran out of virtual memory. - memset(&g_crash_context_, 0, sizeof(g_crash_context_)); - - if (!g_handler_stack_) - g_handler_stack_ = new std::vector; - if (install_handler) { - InstallAlternateStackLocked(); - InstallHandlersLocked(); - } - g_handler_stack_->push_back(this); - pthread_mutex_unlock(&g_handler_stack_mutex_); -} - -// Runs before crashing: normal context. -ExceptionHandler::~ExceptionHandler() { - pthread_mutex_lock(&g_handler_stack_mutex_); - std::vector::iterator handler = - std::find(g_handler_stack_->begin(), g_handler_stack_->end(), this); - g_handler_stack_->erase(handler); - if (g_handler_stack_->empty()) { - delete g_handler_stack_; - g_handler_stack_ = NULL; - RestoreAlternateStackLocked(); - RestoreHandlersLocked(); - } - pthread_mutex_unlock(&g_handler_stack_mutex_); -} - -// Runs before crashing: normal context. -// static -bool ExceptionHandler::InstallHandlersLocked() { - if (handlers_installed) - return false; - - // Fail if unable to store all the old handlers. - for (int i = 0; i < kNumHandledSignals; ++i) { - if (sigaction(kExceptionSignals[i], NULL, &old_handlers[i]) == -1) - return false; - } - - struct sigaction sa; - memset(&sa, 0, sizeof(sa)); - sigemptyset(&sa.sa_mask); - - // Mask all exception signals when we're handling one of them. - for (int i = 0; i < kNumHandledSignals; ++i) - sigaddset(&sa.sa_mask, kExceptionSignals[i]); - - sa.sa_sigaction = SignalHandler; - sa.sa_flags = SA_ONSTACK | SA_SIGINFO; - - for (int i = 0; i < kNumHandledSignals; ++i) { - if (sigaction(kExceptionSignals[i], &sa, NULL) == -1) { - // At this point it is impractical to back out changes, and so failure to - // install a signal is intentionally ignored. - } - } - handlers_installed = true; - return true; -} - -// This function runs in a compromised context: see the top of the file. -// Runs on the crashing thread. -// static -void ExceptionHandler::RestoreHandlersLocked() { - if (!handlers_installed) - return; - - for (int i = 0; i < kNumHandledSignals; ++i) { - if (sigaction(kExceptionSignals[i], &old_handlers[i], NULL) == -1) { - InstallDefaultHandler(kExceptionSignals[i]); - } - } - handlers_installed = false; -} - -// void ExceptionHandler::set_crash_handler(HandlerCallback callback) { -// crash_handler_ = callback; -// } - -// This function runs in a compromised context: see the top of the file. -// Runs on the crashing thread. -// static -void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { - // All the exception signals are blocked at this point. - pthread_mutex_lock(&g_handler_stack_mutex_); - - // Sometimes, Breakpad runs inside a process where some other buggy code - // saves and restores signal handlers temporarily with 'signal' - // instead of 'sigaction'. This loses the SA_SIGINFO flag associated - // with this function. As a consequence, the values of 'info' and 'uc' - // become totally bogus, generally inducing a crash. - // - // The following code tries to detect this case. When it does, it - // resets the signal handlers with sigaction + SA_SIGINFO and returns. - // This forces the signal to be thrown again, but this time the kernel - // will call the function with the right arguments. - struct sigaction cur_handler; - if (sigaction(sig, NULL, &cur_handler) == 0 && - (cur_handler.sa_flags & SA_SIGINFO) == 0) { - // Reset signal handler with the right flags. - sigemptyset(&cur_handler.sa_mask); - sigaddset(&cur_handler.sa_mask, sig); - - cur_handler.sa_sigaction = SignalHandler; - cur_handler.sa_flags = SA_ONSTACK | SA_SIGINFO; - - if (sigaction(sig, &cur_handler, NULL) == -1) { - // When resetting the handler fails, try to reset the - // default one to avoid an infinite loop here. - InstallDefaultHandler(sig); - } - pthread_mutex_unlock(&g_handler_stack_mutex_); - return; - } - - bool handled = false; - for (int i = g_handler_stack_->size() - 1; !handled && i >= 0; --i) { - handled = (*g_handler_stack_)[i]->HandleSignal(sig, info, uc); - } - - // Upon returning from this signal handler, sig will become unmasked and then - // it will be retriggered. If one of the ExceptionHandlers handled it - // successfully, restore the default handler. Otherwise, restore the - // previously installed handler. Then, when the signal is retriggered, it will - // be delivered to the appropriate handler. - if (handled) { - InstallDefaultHandler(sig); - } else { - RestoreHandlersLocked(); - } - - pthread_mutex_unlock(&g_handler_stack_mutex_); - - // info->si_code <= 0 iff SI_FROMUSER (SI_FROMKERNEL otherwise). - if (info->si_code <= 0 || sig == SIGABRT) { - // This signal was triggered by somebody sending us the signal with kill(). - // In order to retrigger it, we have to queue a new signal by calling - // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is - // due to the kernel sending a SIGABRT from a user request via SysRQ. - if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { - // If we failed to kill ourselves (e.g. because a sandbox disallows us - // to do so), we instead resort to terminating our process. This will - // result in an incorrect exit code. - _exit(1); - } - } else { - // This was a synchronous signal triggered by a hard fault (e.g. SIGSEGV). - // No need to reissue the signal. It will automatically trigger again, - // when we return from the signal handler. - } -} - -struct ThreadArgument { - pid_t pid; // the crashing process - const MinidumpDescriptor* minidump_descriptor; - ExceptionHandler* handler; - const void* context; // a CrashContext structure - size_t context_size; -}; - -// This is the entry function for the cloned process. We are in a compromised -// context here: see the top of the file. -// static -int ExceptionHandler::ThreadEntry(void *arg) { - const ThreadArgument *thread_arg = reinterpret_cast(arg); - - // Block here until the crashing process unblocks us when - // we're allowed to use ptrace - thread_arg->handler->WaitForContinueSignal(); - - return thread_arg->handler->DoDump(thread_arg->pid, thread_arg->context, - thread_arg->context_size) == false; -} - -// This function runs in a compromised context: see the top of the file. -// Runs on the crashing thread. -bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { - if (filter_ && !filter_(callback_context_)) - return false; - - // Allow ourselves to be dumped if the signal is trusted. - bool signal_trusted = info->si_code > 0; - bool signal_pid_trusted = info->si_code == SI_USER || - info->si_code == SI_TKILL; - if (signal_trusted || (signal_pid_trusted && info->si_pid == getpid())) { - sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); - } - - // Fill in all the holes in the struct to make Valgrind happy. - memset(&g_crash_context_, 0, sizeof(g_crash_context_)); - memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t)); - memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext)); -#if defined(__aarch64__) - struct ucontext* uc_ptr = (struct ucontext*)uc; - struct fpsimd_context* fp_ptr = - (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; - if (fp_ptr->head.magic == FPSIMD_MAGIC) { - memcpy(&g_crash_context_.float_state, fp_ptr, - sizeof(g_crash_context_.float_state)); - } -#elif !defined(__ARM_EABI__) && !defined(__mips__) - // FP state is not part of user ABI on ARM Linux. - // In case of MIPS Linux FP state is already part of struct ucontext - // and 'float_state' is not a member of CrashContext. - struct ucontext* uc_ptr = (struct ucontext*)uc; - if (uc_ptr->uc_mcontext.fpregs) { - memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, - sizeof(g_crash_context_.float_state)); - } -#endif - g_crash_context_.tid = syscall(__NR_gettid); - if (crash_handler_ != NULL) { - if (crash_handler_(&g_crash_context_, sizeof(g_crash_context_), - callback_context_)) { - return true; - } - } - return GenerateDump(&g_crash_context_); -} - -// This is a public interface to HandleSignal that allows the client to -// generate a crash dump. This function may run in a compromised context. -bool ExceptionHandler::SimulateSignalDelivery(int sig) { - siginfo_t siginfo = {}; - // Mimic a trusted signal to allow tracing the process (see - // ExceptionHandler::HandleSignal(). - siginfo.si_code = SI_USER; - siginfo.si_pid = getpid(); - struct ucontext context; - getcontext(&context); - return HandleSignal(sig, &siginfo, &context); -} - -// This function may run in a compromised context: see the top of the file. -bool ExceptionHandler::GenerateDump(CrashContext *context) { - if (IsOutOfProcess()) - return crash_generation_client_->RequestDump(context, sizeof(*context)); - - // Allocating too much stack isn't a problem, and better to err on the side - // of caution than smash it into random locations. - static const unsigned kChildStackSize = 16000; - PageAllocator allocator; - uint8_t* stack = reinterpret_cast(allocator.Alloc(kChildStackSize)); - if (!stack) - return false; - // clone() needs the top-most address. (scrub just to be safe) - stack += kChildStackSize; - my_memset(stack - 16, 0, 16); - - ThreadArgument thread_arg; - thread_arg.handler = this; - thread_arg.minidump_descriptor = &minidump_descriptor_; - thread_arg.pid = getpid(); - thread_arg.context = context; - thread_arg.context_size = sizeof(*context); - - // We need to explicitly enable ptrace of parent processes on some - // kernels, but we need to know the PID of the cloned process before we - // can do this. Create a pipe here which we can use to block the - // cloned process after creating it, until we have explicitly enabled ptrace - if (sys_pipe(fdes) == -1) { - // Creating the pipe failed. We'll log an error but carry on anyway, - // as we'll probably still get a useful crash report. All that will happen - // is the write() and read() calls will fail with EBADF - static const char no_pipe_msg[] = "ExceptionHandler::GenerateDump " - "sys_pipe failed:"; - logger::write(no_pipe_msg, sizeof(no_pipe_msg) - 1); - logger::write(strerror(errno), strlen(strerror(errno))); - logger::write("\n", 1); - - // Ensure fdes[0] and fdes[1] are invalid file descriptors. - fdes[0] = fdes[1] = -1; - } - - const pid_t child = sys_clone( - ThreadEntry, stack, CLONE_FILES | CLONE_FS | CLONE_UNTRACED, - &thread_arg, NULL, NULL, NULL); - if (child == -1) { - sys_close(fdes[0]); - sys_close(fdes[1]); - return false; - } - - // Allow the child to ptrace us - sys_prctl(PR_SET_PTRACER, child, 0, 0, 0); - SendContinueSignalToChild(); - int status; - const int r = HANDLE_EINTR(sys_waitpid(child, &status, __WALL)); - - sys_close(fdes[0]); - sys_close(fdes[1]); - - if (r == -1) { - static const char msg[] = "ExceptionHandler::GenerateDump waitpid failed:"; - logger::write(msg, sizeof(msg) - 1); - logger::write(strerror(errno), strlen(strerror(errno))); - logger::write("\n", 1); - } - - bool success = r != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0; - if (callback_) - success = callback_(minidump_descriptor_, callback_context_, success); - return success; -} - -// This function runs in a compromised context: see the top of the file. -void ExceptionHandler::SendContinueSignalToChild() { - static const char okToContinueMessage = 'a'; - int r; - r = HANDLE_EINTR(sys_write(fdes[1], &okToContinueMessage, sizeof(char))); - if (r == -1) { - static const char msg[] = "ExceptionHandler::SendContinueSignalToChild " - "sys_write failed:"; - logger::write(msg, sizeof(msg) - 1); - logger::write(strerror(errno), strlen(strerror(errno))); - logger::write("\n", 1); - } -} - -// This function runs in a compromised context: see the top of the file. -// Runs on the cloned process. -void ExceptionHandler::WaitForContinueSignal() { - int r; - char receivedMessage; - r = HANDLE_EINTR(sys_read(fdes[0], &receivedMessage, sizeof(char))); - if (r == -1) { - static const char msg[] = "ExceptionHandler::WaitForContinueSignal " - "sys_read failed:"; - logger::write(msg, sizeof(msg) - 1); - logger::write(strerror(errno), strlen(strerror(errno))); - logger::write("\n", 1); - } -} - -// This function runs in a compromised context: see the top of the file. -// Runs on the cloned process. -bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context, - size_t context_size) { - if (minidump_descriptor_.IsMicrodumpOnConsole()) { - return google_breakpad::WriteMicrodump( - crashing_process, - context, - context_size, - mapping_list_, - *minidump_descriptor_.microdump_extra_info()); - } - if (minidump_descriptor_.IsFD()) { - return google_breakpad::WriteMinidump(minidump_descriptor_.fd(), - minidump_descriptor_.size_limit(), - crashing_process, - context, - context_size, - mapping_list_, - app_memory_list_); - } - return google_breakpad::WriteMinidump(minidump_descriptor_.path(), - minidump_descriptor_.size_limit(), - crashing_process, - context, - context_size, - mapping_list_, - app_memory_list_); -} - -// static -bool ExceptionHandler::WriteMinidump(const string& dump_path, - MinidumpCallback callback, - void* callback_context) { - MinidumpDescriptor descriptor(dump_path); - ExceptionHandler eh(descriptor, NULL, callback, callback_context, false, -1); - return eh.WriteMinidump(); -} - -// In order to making using EBP to calculate the desired value for ESP -// a valid operation, ensure that this function is compiled with a -// frame pointer using the following attribute. This attribute -// is supported on GCC but not on clang. -#if defined(__i386__) && defined(__GNUC__) && !defined(__clang__) -__attribute__((optimize("no-omit-frame-pointer"))) -#endif -bool ExceptionHandler::WriteMinidump() { - if (!IsOutOfProcess() && !minidump_descriptor_.IsFD() && - !minidump_descriptor_.IsMicrodumpOnConsole()) { - // Update the path of the minidump so that this can be called multiple times - // and new files are created for each minidump. This is done before the - // generation happens, as clients may want to access the MinidumpDescriptor - // after this call to find the exact path to the minidump file. - minidump_descriptor_.UpdatePath(); - } else if (minidump_descriptor_.IsFD()) { - // Reposition the FD to its beginning and resize it to get rid of the - // previous minidump info. - lseek(minidump_descriptor_.fd(), 0, SEEK_SET); - ignore_result(ftruncate(minidump_descriptor_.fd(), 0)); - } - - // Allow this process to be dumped. - sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); - - CrashContext context; - int getcontext_result = getcontext(&context.context); - if (getcontext_result) - return false; - -#if defined(__i386__) - // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved - // from REG_UESP instead of from REG_ESP. REG_UESP is the user stack pointer - // and it only makes sense when running in kernel mode with a different stack - // pointer. When WriteMiniDump is called during normal processing REG_UESP is - // zero which leads to bad minidump files. - if (!context.context.uc_mcontext.gregs[REG_UESP]) { - // If REG_UESP is set to REG_ESP then that includes the stack space for the - // CrashContext object in this function, which is about 128 KB. Since the - // Linux dumper only records 32 KB of stack this would mean that nothing - // useful would be recorded. A better option is to set REG_UESP to REG_EBP, - // perhaps with a small negative offset in case there is any code that - // objects to them being equal. - context.context.uc_mcontext.gregs[REG_UESP] = - context.context.uc_mcontext.gregs[REG_EBP] - 16; - // The stack saving is based off of REG_ESP so it must be set to match the - // new REG_UESP. - context.context.uc_mcontext.gregs[REG_ESP] = - context.context.uc_mcontext.gregs[REG_UESP]; - } -#endif - -#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) - // FPU state is not part of ARM EABI ucontext_t. - memcpy(&context.float_state, context.context.uc_mcontext.fpregs, - sizeof(context.float_state)); -#endif - context.tid = sys_gettid(); - - // Add an exception stream to the minidump for better reporting. - memset(&context.siginfo, 0, sizeof(context.siginfo)); - context.siginfo.si_signo = MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED; -#if defined(__i386__) - context.siginfo.si_addr = - reinterpret_cast(context.context.uc_mcontext.gregs[REG_EIP]); -#elif defined(__x86_64__) - context.siginfo.si_addr = - reinterpret_cast(context.context.uc_mcontext.gregs[REG_RIP]); -#elif defined(__arm__) - context.siginfo.si_addr = - reinterpret_cast(context.context.uc_mcontext.arm_pc); -#elif defined(__aarch64__) - context.siginfo.si_addr = - reinterpret_cast(context.context.uc_mcontext.pc); -#elif defined(__mips__) - context.siginfo.si_addr = - reinterpret_cast(context.context.uc_mcontext.pc); -#else -#error "This code has not been ported to your platform yet." -#endif - - return GenerateDump(&context); -} - -void ExceptionHandler::AddMappingInfo(const string& name, - const uint8_t identifier[sizeof(MDGUID)], - uintptr_t start_address, - size_t mapping_size, - size_t file_offset) { - MappingInfo info; - info.start_addr = start_address; - info.size = mapping_size; - info.offset = file_offset; - strncpy(info.name, name.c_str(), sizeof(info.name) - 1); - info.name[sizeof(info.name) - 1] = '\0'; - - MappingEntry mapping; - mapping.first = info; - memcpy(mapping.second, identifier, sizeof(MDGUID)); - mapping_list_.push_back(mapping); -} - -void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) { - AppMemoryList::iterator iter = - std::find(app_memory_list_.begin(), app_memory_list_.end(), ptr); - if (iter != app_memory_list_.end()) { - // Don't allow registering the same pointer twice. - return; - } - - AppMemory app_memory; - app_memory.ptr = ptr; - app_memory.length = length; - app_memory_list_.push_back(app_memory); -} - -void ExceptionHandler::UnregisterAppMemory(void* ptr) { - AppMemoryList::iterator iter = - std::find(app_memory_list_.begin(), app_memory_list_.end(), ptr); - if (iter != app_memory_list_.end()) { - app_memory_list_.erase(iter); - } -} - -// static -bool ExceptionHandler::WriteMinidumpForChild(pid_t child, - pid_t child_blamed_thread, - const string& dump_path, - MinidumpCallback callback, - void* callback_context) { - // This function is not run in a compromised context. - MinidumpDescriptor descriptor(dump_path); - descriptor.UpdatePath(); - if (!google_breakpad::WriteMinidump(descriptor.path(), - child, - child_blamed_thread)) - return false; - - return callback ? callback(descriptor, callback_context, true) : true; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h b/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h deleted file mode 100644 index 591c310855..0000000000 --- a/Telegram/ThirdParty/breakpad/client/linux/handler/exception_handler.h +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ -#define CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ - -#include -#include -#include -#include - -#include - -#include "client/linux/crash_generation/crash_generation_client.h" -#include "client/linux/handler/minidump_descriptor.h" -#include "client/linux/minidump_writer/minidump_writer.h" -#include "common/scoped_ptr.h" -#include "common/using_std_string.h" -#include "google_breakpad/common/minidump_format.h" - -namespace google_breakpad { - -// ExceptionHandler -// -// ExceptionHandler can write a minidump file when an exception occurs, -// or when WriteMinidump() is called explicitly by your program. -// -// To have the exception handler write minidumps when an uncaught exception -// (crash) occurs, you should create an instance early in the execution -// of your program, and keep it around for the entire time you want to -// have crash handling active (typically, until shutdown). -// (NOTE): There should be only be one this kind of exception handler -// object per process. -// -// If you want to write minidumps without installing the exception handler, -// you can create an ExceptionHandler with install_handler set to false, -// then call WriteMinidump. You can also use this technique if you want to -// use different minidump callbacks for different call sites. -// -// In either case, a callback function is called when a minidump is written, -// which receives the full path or file descriptor of the minidump. The -// caller can collect and write additional application state to that minidump, -// and launch an external crash-reporting application. -// -// Caller should try to make the callbacks as crash-friendly as possible, -// it should avoid use heap memory allocation as much as possible. - -class ExceptionHandler { - public: - // A callback function to run before Breakpad performs any substantial - // processing of an exception. A FilterCallback is called before writing - // a minidump. |context| is the parameter supplied by the user as - // callback_context when the handler was created. - // - // If a FilterCallback returns true, Breakpad will continue processing, - // attempting to write a minidump. If a FilterCallback returns false, - // Breakpad will immediately report the exception as unhandled without - // writing a minidump, allowing another handler the opportunity to handle it. - typedef bool (*FilterCallback)(void *context); - - // A callback function to run after the minidump has been written. - // |descriptor| contains the file descriptor or file path containing the - // minidump. |context| is the parameter supplied by the user as - // callback_context when the handler was created. |succeeded| indicates - // whether a minidump file was successfully written. - // - // If an exception occurred and the callback returns true, Breakpad will - // treat the exception as fully-handled, suppressing any other handlers from - // being notified of the exception. If the callback returns false, Breakpad - // will treat the exception as unhandled, and allow another handler to handle - // it. If there are no other handlers, Breakpad will report the exception to - // the system as unhandled, allowing a debugger or native crash dialog the - // opportunity to handle the exception. Most callback implementations - // should normally return the value of |succeeded|, or when they wish to - // not report an exception of handled, false. Callbacks will rarely want to - // return true directly (unless |succeeded| is true). - typedef bool (*MinidumpCallback)(const MinidumpDescriptor& descriptor, - void* context, - bool succeeded); - - // In certain cases, a user may wish to handle the generation of the minidump - // themselves. In this case, they can install a handler callback which is - // called when a crash has occurred. If this function returns true, no other - // processing of occurs and the process will shortly be crashed. If this - // returns false, the normal processing continues. - typedef bool (*HandlerCallback)(const void* crash_context, - size_t crash_context_size, - void* context); - - // Creates a new ExceptionHandler instance to handle writing minidumps. - // Before writing a minidump, the optional |filter| callback will be called. - // Its return value determines whether or not Breakpad should write a - // minidump. The minidump content will be written to the file path or file - // descriptor from |descriptor|, and the optional |callback| is called after - // writing the dump file, as described above. - // If install_handler is true, then a minidump will be written whenever - // an unhandled exception occurs. If it is false, minidumps will only - // be written when WriteMinidump is called. - // If |server_fd| is valid, the minidump is generated out-of-process. If it - // is -1, in-process generation will always be used. - ExceptionHandler(const MinidumpDescriptor& descriptor, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - bool install_handler, - const int server_fd); - ~ExceptionHandler(); - - const MinidumpDescriptor& minidump_descriptor() const { - return minidump_descriptor_; - } - - void set_minidump_descriptor(const MinidumpDescriptor& descriptor) { - minidump_descriptor_ = descriptor; - } - - void set_crash_handler(HandlerCallback callback) { - crash_handler_ = callback; - } - - void set_crash_generation_client(CrashGenerationClient* client) { - crash_generation_client_.reset(client); - } - - // Writes a minidump immediately. This can be used to capture the execution - // state independently of a crash. - // Returns true on success. - // If the ExceptionHandler has been created with a path, a new file is - // generated for each minidump. The file path can be retrieved in the - // MinidumpDescriptor passed to the MinidumpCallback or by accessing the - // MinidumpDescriptor directly from the ExceptionHandler (with - // minidump_descriptor()). - // If the ExceptionHandler has been created with a file descriptor, the file - // descriptor is repositioned to its beginning and the previous generated - // minidump is overwritten. - // Note that this method is not supposed to be called from a compromised - // context as it uses the heap. - bool WriteMinidump(); - - // Convenience form of WriteMinidump which does not require an - // ExceptionHandler instance. - static bool WriteMinidump(const string& dump_path, - MinidumpCallback callback, - void* callback_context); - - // Write a minidump of |child| immediately. This can be used to - // capture the execution state of |child| independently of a crash. - // Pass a meaningful |child_blamed_thread| to make that thread in - // the child process the one from which a crash signature is - // extracted. - // - // WARNING: the return of this function *must* happen before - // the code that will eventually reap |child| executes. - // Otherwise there's a pernicious race condition in which |child| - // exits, is reaped, another process created with its pid, then that - // new process dumped. - static bool WriteMinidumpForChild(pid_t child, - pid_t child_blamed_thread, - const string& dump_path, - MinidumpCallback callback, - void* callback_context); - - // This structure is passed to minidump_writer.h:WriteMinidump via an opaque - // blob. It shouldn't be needed in any user code. - struct CrashContext { - siginfo_t siginfo; - pid_t tid; // the crashing thread. - struct ucontext context; -#if !defined(__ARM_EABI__) && !defined(__mips__) - // #ifdef this out because FP state is not part of user ABI for Linux ARM. - // In case of MIPS Linux FP state is already part of struct - // ucontext so 'float_state' is not required. - fpstate_t float_state; -#endif - }; - - // Returns whether out-of-process dump generation is used or not. - bool IsOutOfProcess() const { - return crash_generation_client_.get() != NULL; - } - - // Add information about a memory mapping. This can be used if - // a custom library loader is used that maps things in a way - // that the linux dumper can't handle by reading the maps file. - void AddMappingInfo(const string& name, - const uint8_t identifier[sizeof(MDGUID)], - uintptr_t start_address, - size_t mapping_size, - size_t file_offset); - - // Register a block of memory of length bytes starting at address ptr - // to be copied to the minidump when a crash happens. - void RegisterAppMemory(void* ptr, size_t length); - - // Unregister a block of memory that was registered with RegisterAppMemory. - void UnregisterAppMemory(void* ptr); - - // Force signal handling for the specified signal. - bool SimulateSignalDelivery(int sig); - - // Report a crash signal from an SA_SIGINFO signal handler. - bool HandleSignal(int sig, siginfo_t* info, void* uc); - - private: - // Save the old signal handlers and install new ones. - static bool InstallHandlersLocked(); - // Restore the old signal handlers. - static void RestoreHandlersLocked(); - - void PreresolveSymbols(); - bool GenerateDump(CrashContext *context); - void SendContinueSignalToChild(); - void WaitForContinueSignal(); - - static void SignalHandler(int sig, siginfo_t* info, void* uc); - static int ThreadEntry(void* arg); - bool DoDump(pid_t crashing_process, const void* context, - size_t context_size); - - const FilterCallback filter_; - const MinidumpCallback callback_; - void* const callback_context_; - - scoped_ptr crash_generation_client_; - - MinidumpDescriptor minidump_descriptor_; - - // Must be volatile. The compiler is unaware of the code which runs in - // the signal handler which reads this variable. Without volatile the - // compiler is free to optimise away writes to this variable which it - // believes are never read. - volatile HandlerCallback crash_handler_; - - // We need to explicitly enable ptrace of parent processes on some - // kernels, but we need to know the PID of the cloned process before we - // can do this. We create a pipe which we can use to block the - // cloned process after creating it, until we have explicitly enabled - // ptrace. This is used to store the file descriptors for the pipe - int fdes[2]; - - // Callers can add extra info about mappings for cases where the - // dumper code cannot extract enough information from /proc//maps. - MappingList mapping_list_; - - // Callers can request additional memory regions to be included in - // the dump. - AppMemoryList app_memory_list_; -}; - -} // namespace google_breakpad - -#endif // CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h deleted file mode 100644 index a3a95dcace..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/client_info.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ -#define CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ - -namespace google_breakpad { - -class ClientInfo { - public: - explicit ClientInfo(pid_t pid) : pid_(pid) {} - - pid_t pid() const { return pid_; } - - private: - pid_t pid_; -}; - -} // namespace google_breakpad - -#endif // CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc deleted file mode 100644 index ceeb3b32af..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "client/mac/crash_generation/crash_generation_client.h" - -#include "client/mac/crash_generation/crash_generation_server.h" -#include "common/mac/MachIPC.h" - -namespace google_breakpad { - -bool CrashGenerationClient::RequestDumpForException( - int exception_type, - int exception_code, - int exception_subcode, - mach_port_t crashing_thread) { - // The server will send a message to this port indicating that it - // has finished its work. - ReceivePort acknowledge_port; - - MachSendMessage message(kDumpRequestMessage); - message.AddDescriptor(mach_task_self()); // this task - message.AddDescriptor(crashing_thread); // crashing thread - message.AddDescriptor(mach_thread_self()); // handler thread - message.AddDescriptor(acknowledge_port.GetPort()); // message receive port - - ExceptionInfo info; - info.exception_type = exception_type; - info.exception_code = exception_code; - info.exception_subcode = exception_subcode; - message.SetData(&info, sizeof(info)); - - const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; - kern_return_t result = sender_.SendMessage(message, kSendTimeoutMs); - if (result != KERN_SUCCESS) - return false; - - // Give the server slightly longer to reply since it has to - // inspect this task and write the minidump. - const mach_msg_timeout_t kReceiveTimeoutMs = 5 * 1000; - MachReceiveMessage acknowledge_message; - result = acknowledge_port.WaitForMessage(&acknowledge_message, - kReceiveTimeoutMs); - return result == KERN_SUCCESS; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h deleted file mode 100644 index 527f577a51..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_client.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ -#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ - -#include "common/mac/MachIPC.h" - -namespace google_breakpad { - -class CrashGenerationClient { - public: - explicit CrashGenerationClient(const char* mach_port_name) - : sender_(mach_port_name) { - } - - // Request the crash server to generate a dump. - // - // Return true if the dump was successful; false otherwise. - bool RequestDumpForException(int exception_type, - int exception_code, - int exception_subcode, - mach_port_t crashing_thread); - - bool RequestDump() { - return RequestDumpForException(0, 0, 0, MACH_PORT_NULL); - } - - private: - MachPortSender sender_; - - // Prevent copy construction and assignment. - CrashGenerationClient(const CrashGenerationClient&); - CrashGenerationClient& operator=(const CrashGenerationClient&); -}; - -} // namespace google_breakpad - -#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc deleted file mode 100644 index 451e8d9c2a..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.cc +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "client/mac/crash_generation/crash_generation_server.h" - -#include - -#include "client/mac/crash_generation/client_info.h" -#include "client/mac/handler/minidump_generator.h" -#include "common/mac/scoped_task_suspend-inl.h" - -namespace google_breakpad { - -CrashGenerationServer::CrashGenerationServer( - const char *mach_port_name, - FilterCallback filter, - void *filter_context, - OnClientDumpRequestCallback dump_callback, - void *dump_context, - OnClientExitingCallback exit_callback, - void *exit_context, - bool generate_dumps, - const std::string &dump_path) - : filter_(filter), - filter_context_(filter_context), - dump_callback_(dump_callback), - dump_context_(dump_context), - exit_callback_(exit_callback), - exit_context_(exit_context), - generate_dumps_(generate_dumps), - dump_dir_(dump_path.empty() ? "/tmp" : dump_path), - started_(false), - receive_port_(mach_port_name), - mach_port_name_(mach_port_name) { -} - -CrashGenerationServer::~CrashGenerationServer() { - if (started_) - Stop(); -} - -bool CrashGenerationServer::Start() { - int thread_create_result = pthread_create(&server_thread_, NULL, - &WaitForMessages, this); - started_ = thread_create_result == 0; - return started_; -} - -bool CrashGenerationServer::Stop() { - if (!started_) - return false; - - // Send a quit message to the background thread, and then join it. - MachPortSender sender(mach_port_name_.c_str()); - MachSendMessage quit_message(kQuitMessage); - const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; - kern_return_t result = sender.SendMessage(quit_message, kSendTimeoutMs); - if (result == KERN_SUCCESS) { - int thread_join_result = pthread_join(server_thread_, NULL); - started_ = thread_join_result != 0; - } - - return !started_; -} - -// static -void *CrashGenerationServer::WaitForMessages(void *server) { - CrashGenerationServer *self = - reinterpret_cast(server); - while (self->WaitForOneMessage()) {} - return NULL; -} - -bool CrashGenerationServer::WaitForOneMessage() { - MachReceiveMessage message; - kern_return_t result = receive_port_.WaitForMessage(&message, - MACH_MSG_TIMEOUT_NONE); - if (result == KERN_SUCCESS) { - switch (message.GetMessageID()) { - case kDumpRequestMessage: { - ExceptionInfo &info = (ExceptionInfo &)*message.GetData(); - - mach_port_t remote_task = message.GetTranslatedPort(0); - mach_port_t crashing_thread = message.GetTranslatedPort(1); - mach_port_t handler_thread = message.GetTranslatedPort(2); - mach_port_t ack_port = message.GetTranslatedPort(3); - pid_t remote_pid = -1; - pid_for_task(remote_task, &remote_pid); - ClientInfo client(remote_pid); - - bool result; - std::string dump_path; - if (generate_dumps_ && (!filter_ || filter_(filter_context_))) { - ScopedTaskSuspend suspend(remote_task); - - MinidumpGenerator generator(remote_task, handler_thread); - dump_path = generator.UniqueNameInDirectory(dump_dir_, NULL); - - if (info.exception_type && info.exception_code) { - generator.SetExceptionInformation(info.exception_type, - info.exception_code, - info.exception_subcode, - crashing_thread); - } - result = generator.Write(dump_path.c_str()); - } else { - result = true; - } - - if (result && dump_callback_) { - dump_callback_(dump_context_, client, dump_path); - } - - // TODO(ted): support a way for the client to send additional data, - // perhaps with a callback so users of the server can read the data - // themselves? - - if (ack_port != MACH_PORT_DEAD && ack_port != MACH_PORT_NULL) { - MachPortSender sender(ack_port); - MachSendMessage ack_message(kAcknowledgementMessage); - const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000; - - sender.SendMessage(ack_message, kSendTimeoutMs); - } - - if (exit_callback_) { - exit_callback_(exit_context_, client); - } - break; - } - case kQuitMessage: - return false; - } - } else { // result != KERN_SUCCESS - return false; - } - return true; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h b/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h deleted file mode 100644 index 85bd5b5e33..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/crash_generation/crash_generation_server.h +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ -#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ - -#include - -#include - -#include "common/mac/MachIPC.h" - -namespace google_breakpad { - -class ClientInfo; - -// Messages the server can read via its mach port -enum { - kDumpRequestMessage = 1, - kAcknowledgementMessage = 2, - kQuitMessage = 3 -}; - -// Exception details sent by the client when requesting a dump. -struct ExceptionInfo { - int32_t exception_type; - int32_t exception_code; - int32_t exception_subcode; -}; - -class CrashGenerationServer { - public: - // WARNING: callbacks may be invoked on a different thread - // than that which creates the CrashGenerationServer. They must - // be thread safe. - typedef void (*OnClientDumpRequestCallback)(void *context, - const ClientInfo &client_info, - const std::string &file_path); - - typedef void (*OnClientExitingCallback)(void *context, - const ClientInfo &client_info); - // If a FilterCallback returns false, the dump will not be written. - typedef bool (*FilterCallback)(void *context); - - // Create an instance with the given parameters. - // - // mach_port_name: Named server port to listen on. - // filter: Callback for a client to cancel writing a dump. - // filter_context: Context for the filter callback. - // dump_callback: Callback for a client crash dump request. - // dump_context: Context for client crash dump request callback. - // exit_callback: Callback for client process exit. - // exit_context: Context for client exit callback. - // generate_dumps: Whether to automatically generate dumps. - // Client code of this class might want to generate dumps explicitly - // in the crash dump request callback. In that case, false can be - // passed for this parameter. - // dump_path: Path for generating dumps; required only if true is - // passed for generateDumps parameter; NULL can be passed otherwise. - CrashGenerationServer(const char *mach_port_name, - FilterCallback filter, - void *filter_context, - OnClientDumpRequestCallback dump_callback, - void *dump_context, - OnClientExitingCallback exit_callback, - void *exit_context, - bool generate_dumps, - const std::string &dump_path); - - ~CrashGenerationServer(); - - // Perform initialization steps needed to start listening to clients. - // - // Return true if initialization is successful; false otherwise. - bool Start(); - - // Stop the server. - bool Stop(); - - private: - // Return a unique filename at which a minidump can be written. - bool MakeMinidumpFilename(std::string &outFilename); - - // Loop reading client messages and responding to them until - // a quit message is received. - static void *WaitForMessages(void *server); - - // Wait for a single client message and respond to it. Returns false - // if a quit message was received or if an error occurred. - bool WaitForOneMessage(); - - FilterCallback filter_; - void *filter_context_; - - OnClientDumpRequestCallback dump_callback_; - void *dump_context_; - - OnClientExitingCallback exit_callback_; - void *exit_context_; - - bool generate_dumps_; - - std::string dump_dir_; - - bool started_; - - // The mach port that receives requests to dump from child processes. - ReceivePort receive_port_; - - // The name of the mach port. Stored so the Stop method can message - // the background thread to shut it down. - std::string mach_port_name_; - - // The thread that waits on the receive port. - pthread_t server_thread_; - - // Disable copy constructor and operator=. - CrashGenerationServer(const CrashGenerationServer&); - CrashGenerationServer& operator=(const CrashGenerationServer&); -}; - -} // namespace google_breakpad - -#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc deleted file mode 100644 index 3492b823da..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.cc +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -/* - * This file was copied from libc/gen/nlist.c from Darwin's source code - * The version of nlist used as a base is from 10.5.2, libc-498 - * http://www.opensource.apple.com/darwinsource/10.5.2/Libc-498/gen/nlist.c - * - * The full tarball is at: - * http://www.opensource.apple.com/darwinsource/tarballs/apsl/Libc-498.tar.gz - * - * I've modified it to be compatible with 64-bit images. -*/ - -#include "breakpad_nlist_64.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Stuff lifted from and since they are gone */ -/* - * Header prepended to each a.out file. - */ -struct exec { - unsigned short a_machtype; /* machine type */ - unsigned short a_magic; /* magic number */ - unsigned long a_text; /* size of text segment */ - unsigned long a_data; /* size of initialized data */ - unsigned long a_bss; /* size of uninitialized data */ - unsigned long a_syms; /* size of symbol table */ - unsigned long a_entry; /* entry point */ - unsigned long a_trsize; /* size of text relocation */ - unsigned long a_drsize; /* size of data relocation */ -}; - -#define OMAGIC 0407 /* old impure format */ -#define NMAGIC 0410 /* read-only text */ -#define ZMAGIC 0413 /* demand load format */ - -#define N_BADMAG(x) \ - (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC) -#define N_TXTOFF(x) \ - ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec)) -#define N_SYMOFF(x) \ - (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize) - -// Traits structs for specializing function templates to handle -// 32-bit/64-bit Mach-O files. -template -struct MachBits {}; - -typedef struct nlist nlist32; -typedef struct nlist_64 nlist64; - -template<> -struct MachBits { - typedef mach_header mach_header_type; - typedef uint32_t word_type; - static const uint32_t magic = MH_MAGIC; -}; - -template<> -struct MachBits { - typedef mach_header_64 mach_header_type; - typedef uint64_t word_type; - static const uint32_t magic = MH_MAGIC_64; -}; - -template -int -__breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames, - cpu_type_t cpu_type); - -/* - * nlist - retreive attributes from name list (string table version) - */ - -template -int breakpad_nlist_common(const char *name, - nlist_type *list, - const char **symbolNames, - cpu_type_t cpu_type) { - int fd = open(name, O_RDONLY, 0); - if (fd < 0) - return -1; - int n = __breakpad_fdnlist(fd, list, symbolNames, cpu_type); - close(fd); - return n; -} - -int breakpad_nlist(const char *name, - struct nlist *list, - const char **symbolNames, - cpu_type_t cpu_type) { - return breakpad_nlist_common(name, list, symbolNames, cpu_type); -} - -int breakpad_nlist(const char *name, - struct nlist_64 *list, - const char **symbolNames, - cpu_type_t cpu_type) { - return breakpad_nlist_common(name, list, symbolNames, cpu_type); -} - -/* Note: __fdnlist() is called from kvm_nlist in libkvm's kvm.c */ - -template -int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames, - cpu_type_t cpu_type) { - typedef typename MachBits::mach_header_type mach_header_type; - typedef typename MachBits::word_type word_type; - - const uint32_t magic = MachBits::magic; - - int maxlen = 500; - int nreq = 0; - for (nlist_type* q = list; - symbolNames[q-list] && symbolNames[q-list][0]; - q++, nreq++) { - - q->n_type = 0; - q->n_value = 0; - q->n_desc = 0; - q->n_sect = 0; - q->n_un.n_strx = 0; - } - - struct exec buf; - if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) || - (N_BADMAG(buf) && *((uint32_t *)&buf) != magic && - CFSwapInt32BigToHost(*((uint32_t *)&buf)) != FAT_MAGIC && - /* The following is the big-endian ppc64 check */ - (*((uint32_t*)&buf)) != FAT_MAGIC)) { - return -1; - } - - /* Deal with fat file if necessary */ - unsigned arch_offset = 0; - if (CFSwapInt32BigToHost(*((uint32_t *)&buf)) == FAT_MAGIC || - /* The following is the big-endian ppc64 check */ - *((unsigned int *)&buf) == FAT_MAGIC) { - /* Read in the fat header */ - struct fat_header fh; - if (lseek(fd, 0, SEEK_SET) == -1) { - return -1; - } - if (read(fd, (char *)&fh, sizeof(fh)) != sizeof(fh)) { - return -1; - } - - /* Convert fat_narchs to host byte order */ - fh.nfat_arch = CFSwapInt32BigToHost(fh.nfat_arch); - - /* Read in the fat archs */ - struct fat_arch *fat_archs = - (struct fat_arch *)malloc(fh.nfat_arch * sizeof(struct fat_arch)); - if (fat_archs == NULL) { - return -1; - } - if (read(fd, (char *)fat_archs, - sizeof(struct fat_arch) * fh.nfat_arch) != - (ssize_t)(sizeof(struct fat_arch) * fh.nfat_arch)) { - free(fat_archs); - return -1; - } - - /* - * Convert archs to host byte ordering (a constraint of - * cpusubtype_getbestarch() - */ - for (unsigned i = 0; i < fh.nfat_arch; i++) { - fat_archs[i].cputype = - CFSwapInt32BigToHost(fat_archs[i].cputype); - fat_archs[i].cpusubtype = - CFSwapInt32BigToHost(fat_archs[i].cpusubtype); - fat_archs[i].offset = - CFSwapInt32BigToHost(fat_archs[i].offset); - fat_archs[i].size = - CFSwapInt32BigToHost(fat_archs[i].size); - fat_archs[i].align = - CFSwapInt32BigToHost(fat_archs[i].align); - } - - struct fat_arch *fap = NULL; - for (unsigned i = 0; i < fh.nfat_arch; i++) { - if (fat_archs[i].cputype == cpu_type) { - fap = &fat_archs[i]; - break; - } - } - - if (!fap) { - free(fat_archs); - return -1; - } - arch_offset = fap->offset; - free(fat_archs); - - /* Read in the beginning of the architecture-specific file */ - if (lseek(fd, arch_offset, SEEK_SET) == -1) { - return -1; - } - if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf)) { - return -1; - } - } - - off_t sa; /* symbol address */ - off_t ss; /* start of strings */ - register_t n; - if (*((unsigned int *)&buf) == magic) { - if (lseek(fd, arch_offset, SEEK_SET) == -1) { - return -1; - } - mach_header_type mh; - if (read(fd, (char *)&mh, sizeof(mh)) != sizeof(mh)) { - return -1; - } - - struct load_command *load_commands = - (struct load_command *)malloc(mh.sizeofcmds); - if (load_commands == NULL) { - return -1; - } - if (read(fd, (char *)load_commands, mh.sizeofcmds) != - (ssize_t)mh.sizeofcmds) { - free(load_commands); - return -1; - } - struct symtab_command *stp = NULL; - struct load_command *lcp = load_commands; - // iterate through all load commands, looking for - // LC_SYMTAB load command - for (uint32_t i = 0; i < mh.ncmds; i++) { - if (lcp->cmdsize % sizeof(word_type) != 0 || - lcp->cmdsize <= 0 || - (char *)lcp + lcp->cmdsize > - (char *)load_commands + mh.sizeofcmds) { - free(load_commands); - return -1; - } - if (lcp->cmd == LC_SYMTAB) { - if (lcp->cmdsize != - sizeof(struct symtab_command)) { - free(load_commands); - return -1; - } - stp = (struct symtab_command *)lcp; - break; - } - lcp = (struct load_command *) - ((char *)lcp + lcp->cmdsize); - } - if (stp == NULL) { - free(load_commands); - return -1; - } - // sa points to the beginning of the symbol table - sa = stp->symoff + arch_offset; - // ss points to the beginning of the string table - ss = stp->stroff + arch_offset; - // n is the number of bytes in the symbol table - // each symbol table entry is an nlist structure - n = stp->nsyms * sizeof(nlist_type); - free(load_commands); - } else { - sa = N_SYMOFF(buf) + arch_offset; - ss = sa + buf.a_syms + arch_offset; - n = buf.a_syms; - } - - if (lseek(fd, sa, SEEK_SET) == -1) { - return -1; - } - - // the algorithm here is to read the nlist entries in m-sized - // chunks into q. q is then iterated over. for each entry in q, - // use the string table index(q->n_un.n_strx) to read the symbol - // name, then scan the nlist entries passed in by the user(via p), - // and look for a match - while (n) { - nlist_type space[BUFSIZ/sizeof (nlist_type)]; - register_t m = sizeof (space); - - if (n < m) - m = n; - if (read(fd, (char *)space, m) != m) - break; - n -= m; - off_t savpos = lseek(fd, 0, SEEK_CUR); - if (savpos == -1) { - return -1; - } - for (nlist_type* q = space; (m -= sizeof(nlist_type)) >= 0; q++) { - char nambuf[BUFSIZ]; - - if (q->n_un.n_strx == 0 || q->n_type & N_STAB) - continue; - - // seek to the location in the binary where the symbol - // name is stored & read it into memory - if (lseek(fd, ss+q->n_un.n_strx, SEEK_SET) == -1) { - return -1; - } - if (read(fd, nambuf, maxlen+1) == -1) { - return -1; - } - const char *s2 = nambuf; - for (nlist_type *p = list; - symbolNames[p-list] && symbolNames[p-list][0]; - p++) { - // get the symbol name the user has passed in that - // corresponds to the nlist entry that we're looking at - const char *s1 = symbolNames[p - list]; - while (*s1) { - if (*s1++ != *s2++) - goto cont; - } - if (*s2) - goto cont; - - p->n_value = q->n_value; - p->n_type = q->n_type; - p->n_desc = q->n_desc; - p->n_sect = q->n_sect; - p->n_un.n_strx = q->n_un.n_strx; - if (--nreq == 0) - return nreq; - - break; - cont: ; - } - } - if (lseek(fd, savpos, SEEK_SET) == -1) { - return -1; - } - } - return nreq; -} diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h b/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h deleted file mode 100644 index 1d2c639134..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/breakpad_nlist_64.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// breakpad_nlist.h -// -// This file is meant to provide a header for clients of the modified -// nlist function implemented to work on 64-bit. - -#ifndef CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__ - -#include - -int breakpad_nlist(const char *name, - struct nlist *list, - const char **symbolNames, - cpu_type_t cpu_type); -int breakpad_nlist(const char *name, - struct nlist_64 *list, - const char **symbolNames, - cpu_type_t cpu_type); - -#endif /* CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__ */ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc deleted file mode 100644 index cdba6df4ac..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.cc +++ /dev/null @@ -1,573 +0,0 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "client/mac/handler/dynamic_images.h" - -extern "C" { // needed to compile on Leopard - #include - #include - #include -} - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "breakpad_nlist_64.h" - -#if !TARGET_OS_IPHONE -#include - -#ifndef MAC_OS_X_VERSION_10_6 -#define MAC_OS_X_VERSION_10_6 1060 -#endif - -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 - -// Fallback declarations for TASK_DYLD_INFO and friends, introduced in -// in the Mac OS X 10.6 SDK. -#define TASK_DYLD_INFO 17 -struct task_dyld_info { - mach_vm_address_t all_image_info_addr; - mach_vm_size_t all_image_info_size; -}; -typedef struct task_dyld_info task_dyld_info_data_t; -typedef struct task_dyld_info *task_dyld_info_t; -#define TASK_DYLD_INFO_COUNT (sizeof(task_dyld_info_data_t) / sizeof(natural_t)) - -#endif - -#endif // !TARGET_OS_IPHONE - -namespace google_breakpad { - -using std::string; -using std::vector; - -//============================================================================== -// Returns the size of the memory region containing |address| and the -// number of bytes from |address| to the end of the region. -// We potentially, will extend the size of the original -// region by the size of the following region if it's contiguous with the -// first in order to handle cases when we're reading strings and they -// straddle two vm regions. -// -static mach_vm_size_t GetMemoryRegionSize(task_port_t target_task, - const uint64_t address, - mach_vm_size_t *size_to_end) { - mach_vm_address_t region_base = (mach_vm_address_t)address; - mach_vm_size_t region_size; - natural_t nesting_level = 0; - vm_region_submap_info_64 submap_info; - mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64; - - // Get information about the vm region containing |address| - vm_region_recurse_info_t region_info; - region_info = reinterpret_cast(&submap_info); - - kern_return_t result = - mach_vm_region_recurse(target_task, - ®ion_base, - ®ion_size, - &nesting_level, - region_info, - &info_count); - - if (result == KERN_SUCCESS) { - // Get distance from |address| to the end of this region - *size_to_end = region_base + region_size -(mach_vm_address_t)address; - - // If we want to handle strings as long as 4096 characters we may need - // to check if there's a vm region immediately following the first one. - // If so, we need to extend |*size_to_end| to go all the way to the end - // of the second region. - if (*size_to_end < 4096) { - // Second region starts where the first one ends - mach_vm_address_t region_base2 = - (mach_vm_address_t)(region_base + region_size); - mach_vm_size_t region_size2; - - // Get information about the following vm region - result = - mach_vm_region_recurse(target_task, - ®ion_base2, - ®ion_size2, - &nesting_level, - region_info, - &info_count); - - // Extend region_size to go all the way to the end of the 2nd region - if (result == KERN_SUCCESS - && region_base2 == region_base + region_size) { - region_size += region_size2; - } - } - - *size_to_end = region_base + region_size -(mach_vm_address_t)address; - } else { - region_size = 0; - *size_to_end = 0; - } - - return region_size; -} - -#define kMaxStringLength 8192 -//============================================================================== -// Reads a NULL-terminated string from another task. -// -// Warning! This will not read any strings longer than kMaxStringLength-1 -// -static string ReadTaskString(task_port_t target_task, - const uint64_t address) { - // The problem is we don't know how much to read until we know how long - // the string is. And we don't know how long the string is, until we've read - // the memory! So, we'll try to read kMaxStringLength bytes - // (or as many bytes as we can until we reach the end of the vm region). - mach_vm_size_t size_to_end; - GetMemoryRegionSize(target_task, address, &size_to_end); - - if (size_to_end > 0) { - mach_vm_size_t size_to_read = - size_to_end > kMaxStringLength ? kMaxStringLength : size_to_end; - - vector bytes; - if (ReadTaskMemory(target_task, address, (size_t)size_to_read, bytes) != - KERN_SUCCESS) - return string(); - - return string(reinterpret_cast(&bytes[0])); - } - - return string(); -} - -//============================================================================== -// Reads an address range from another task. The bytes read will be returned -// in bytes, which will be resized as necessary. -kern_return_t ReadTaskMemory(task_port_t target_task, - const uint64_t address, - size_t length, - vector &bytes) { - int systemPageSize = getpagesize(); - - // use the negative of the page size for the mask to find the page address - mach_vm_address_t page_address = address & (-systemPageSize); - - mach_vm_address_t last_page_address = - (address + length + (systemPageSize - 1)) & (-systemPageSize); - - mach_vm_size_t page_size = last_page_address - page_address; - uint8_t* local_start; - uint32_t local_length; - - kern_return_t r = mach_vm_read(target_task, - page_address, - page_size, - reinterpret_cast(&local_start), - &local_length); - - if (r != KERN_SUCCESS) - return r; - - bytes.resize(length); - memcpy(&bytes[0], - &local_start[(mach_vm_address_t)address - page_address], - length); - mach_vm_deallocate(mach_task_self(), (uintptr_t)local_start, local_length); - return KERN_SUCCESS; -} - -#pragma mark - - -//============================================================================== -// Traits structs for specializing function templates to handle -// 32-bit/64-bit Mach-O files. -struct MachO32 { - typedef mach_header mach_header_type; - typedef segment_command mach_segment_command_type; - typedef dyld_image_info32 dyld_image_info; - typedef dyld_all_image_infos32 dyld_all_image_infos; - typedef struct nlist nlist_type; - static const uint32_t magic = MH_MAGIC; - static const uint32_t segment_load_command = LC_SEGMENT; -}; - -struct MachO64 { - typedef mach_header_64 mach_header_type; - typedef segment_command_64 mach_segment_command_type; - typedef dyld_image_info64 dyld_image_info; - typedef dyld_all_image_infos64 dyld_all_image_infos; - typedef struct nlist_64 nlist_type; - static const uint32_t magic = MH_MAGIC_64; - static const uint32_t segment_load_command = LC_SEGMENT_64; -}; - -template -bool FindTextSection(DynamicImage& image) { - typedef typename MachBits::mach_header_type mach_header_type; - typedef typename MachBits::mach_segment_command_type - mach_segment_command_type; - - const mach_header_type* header = - reinterpret_cast(&image.header_[0]); - - if(header->magic != MachBits::magic) { - return false; - } - - const struct load_command *cmd = - reinterpret_cast(header + 1); - - bool found_text_section = false; - bool found_dylib_id_command = false; - for (unsigned int i = 0; cmd && (i < header->ncmds); ++i) { - if (!found_text_section) { - if (cmd->cmd == MachBits::segment_load_command) { - const mach_segment_command_type *seg = - reinterpret_cast(cmd); - - if (!strcmp(seg->segname, "__TEXT")) { - image.vmaddr_ = static_cast(seg->vmaddr); - image.vmsize_ = static_cast(seg->vmsize); - image.slide_ = 0; - - if (seg->fileoff == 0 && seg->filesize != 0) { - image.slide_ = - (uintptr_t)image.GetLoadAddress() - (uintptr_t)seg->vmaddr; - } - found_text_section = true; - } - } - } - - if (!found_dylib_id_command) { - if (cmd->cmd == LC_ID_DYLIB) { - const struct dylib_command *dc = - reinterpret_cast(cmd); - - image.version_ = dc->dylib.current_version; - found_dylib_id_command = true; - } - } - - if (found_dylib_id_command && found_text_section) { - return true; - } - - cmd = reinterpret_cast - (reinterpret_cast(cmd) + cmd->cmdsize); - } - - return false; -} - -//============================================================================== -// Initializes vmaddr_, vmsize_, and slide_ -void DynamicImage::CalculateMemoryAndVersionInfo() { - // unless we can process the header, ensure that calls to - // IsValid() will return false - vmaddr_ = 0; - vmsize_ = 0; - slide_ = 0; - version_ = 0; - - // The function template above does all the real work. - if (Is64Bit()) - FindTextSection(*this); - else - FindTextSection(*this); -} - -//============================================================================== -// The helper function template abstracts the 32/64-bit differences. -template -uint32_t GetFileTypeFromHeader(DynamicImage& image) { - typedef typename MachBits::mach_header_type mach_header_type; - - const mach_header_type* header = - reinterpret_cast(&image.header_[0]); - return header->filetype; -} - -uint32_t DynamicImage::GetFileType() { - if (Is64Bit()) - return GetFileTypeFromHeader(*this); - - return GetFileTypeFromHeader(*this); -} - -#pragma mark - - -//============================================================================== -// Loads information about dynamically loaded code in the given task. -DynamicImages::DynamicImages(mach_port_t task) - : task_(task), - cpu_type_(DetermineTaskCPUType(task)), - image_list_() { - ReadImageInfoForTask(); -} - -template -static uint64_t LookupSymbol(const char* symbol_name, - const char* filename, - cpu_type_t cpu_type) { - typedef typename MachBits::nlist_type nlist_type; - - nlist_type symbol_info[8] = {}; - const char *symbolNames[2] = { symbol_name, "\0" }; - nlist_type &list = symbol_info[0]; - int invalidEntriesCount = breakpad_nlist(filename, - &list, - symbolNames, - cpu_type); - - if(invalidEntriesCount != 0) { - return 0; - } - - assert(list.n_value); - return list.n_value; -} - -#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 -static bool HasTaskDyldInfo() { - return true; -} -#else -static SInt32 GetOSVersionInternal() { - SInt32 os_version = 0; - Gestalt(gestaltSystemVersion, &os_version); - return os_version; -} - -static SInt32 GetOSVersion() { - static SInt32 os_version = GetOSVersionInternal(); - return os_version; -} - -static bool HasTaskDyldInfo() { - return GetOSVersion() >= 0x1060; -} -#endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 10_6 - -uint64_t DynamicImages::GetDyldAllImageInfosPointer() { - if (HasTaskDyldInfo()) { - task_dyld_info_data_t task_dyld_info; - mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT; - if (task_info(task_, TASK_DYLD_INFO, (task_info_t)&task_dyld_info, - &count) != KERN_SUCCESS) { - return 0; - } - - return (uint64_t)task_dyld_info.all_image_info_addr; - } else { - const char *imageSymbolName = "_dyld_all_image_infos"; - const char *dyldPath = "/usr/lib/dyld"; - - if (Is64Bit()) - return LookupSymbol(imageSymbolName, dyldPath, cpu_type_); - return LookupSymbol(imageSymbolName, dyldPath, cpu_type_); - } -} - -//============================================================================== -// This code was written using dyld_debug.c (from Darwin) as a guide. - -template -void ReadImageInfo(DynamicImages& images, - uint64_t image_list_address) { - typedef typename MachBits::dyld_image_info dyld_image_info; - typedef typename MachBits::dyld_all_image_infos dyld_all_image_infos; - typedef typename MachBits::mach_header_type mach_header_type; - - // Read the structure inside of dyld that contains information about - // loaded images. We're reading from the desired task's address space. - - // Here we make the assumption that dyld loaded at the same address in - // the crashed process vs. this one. This is an assumption made in - // "dyld_debug.c" and is said to be nearly always valid. - vector dyld_all_info_bytes; - if (ReadTaskMemory(images.task_, - image_list_address, - sizeof(dyld_all_image_infos), - dyld_all_info_bytes) != KERN_SUCCESS) - return; - - dyld_all_image_infos *dyldInfo = - reinterpret_cast(&dyld_all_info_bytes[0]); - - // number of loaded images - int count = dyldInfo->infoArrayCount; - - // Read an array of dyld_image_info structures each containing - // information about a loaded image. - vector dyld_info_array_bytes; - if (ReadTaskMemory(images.task_, - dyldInfo->infoArray, - count * sizeof(dyld_image_info), - dyld_info_array_bytes) != KERN_SUCCESS) - return; - - dyld_image_info *infoArray = - reinterpret_cast(&dyld_info_array_bytes[0]); - images.image_list_.reserve(count); - - for (int i = 0; i < count; ++i) { - dyld_image_info &info = infoArray[i]; - - // First read just the mach_header from the image in the task. - vector mach_header_bytes; - if (ReadTaskMemory(images.task_, - info.load_address_, - sizeof(mach_header_type), - mach_header_bytes) != KERN_SUCCESS) - continue; // bail on this dynamic image - - mach_header_type *header = - reinterpret_cast(&mach_header_bytes[0]); - - // Now determine the total amount necessary to read the header - // plus all of the load commands. - size_t header_size = - sizeof(mach_header_type) + header->sizeofcmds; - - if (ReadTaskMemory(images.task_, - info.load_address_, - header_size, - mach_header_bytes) != KERN_SUCCESS) - continue; - - // Read the file name from the task's memory space. - string file_path; - if (info.file_path_) { - // Although we're reading kMaxStringLength bytes, it's copied in the - // the DynamicImage constructor below with the correct string length, - // so it's not really wasting memory. - file_path = ReadTaskString(images.task_, info.file_path_); - } - - // Create an object representing this image and add it to our list. - DynamicImage *new_image; - new_image = new DynamicImage(&mach_header_bytes[0], - header_size, - info.load_address_, - file_path, - static_cast(info.file_mod_date_), - images.task_, - images.cpu_type_); - - if (new_image->IsValid()) { - images.image_list_.push_back(DynamicImageRef(new_image)); - } else { - delete new_image; - } - } - - // sorts based on loading address - sort(images.image_list_.begin(), images.image_list_.end()); - // remove duplicates - this happens in certain strange cases - // You can see it in DashboardClient when Google Gadgets plugin - // is installed. Apple's crash reporter log and gdb "info shared" - // both show the same library multiple times at the same address - - vector::iterator it = unique(images.image_list_.begin(), - images.image_list_.end()); - images.image_list_.erase(it, images.image_list_.end()); -} - -void DynamicImages::ReadImageInfoForTask() { - uint64_t imageList = GetDyldAllImageInfosPointer(); - - if (imageList) { - if (Is64Bit()) - ReadImageInfo(*this, imageList); - else - ReadImageInfo(*this, imageList); - } -} - -//============================================================================== -DynamicImage *DynamicImages::GetExecutableImage() { - int executable_index = GetExecutableImageIndex(); - - if (executable_index >= 0) { - return GetImage(executable_index); - } - - return NULL; -} - -//============================================================================== -// returns -1 if failure to find executable -int DynamicImages::GetExecutableImageIndex() { - int image_count = GetImageCount(); - - for (int i = 0; i < image_count; ++i) { - DynamicImage *image = GetImage(i); - if (image->GetFileType() == MH_EXECUTE) { - return i; - } - } - - return -1; -} - -//============================================================================== -// static -cpu_type_t DynamicImages::DetermineTaskCPUType(task_t task) { - if (task == mach_task_self()) - return GetNativeCPUType(); - - int mib[CTL_MAXNAME]; - size_t mibLen = CTL_MAXNAME; - int err = sysctlnametomib("sysctl.proc_cputype", mib, &mibLen); - if (err == 0) { - assert(mibLen < CTL_MAXNAME); - pid_for_task(task, &mib[mibLen]); - mibLen += 1; - - cpu_type_t cpu_type; - size_t cpuTypeSize = sizeof(cpu_type); - sysctl(mib, static_cast(mibLen), &cpu_type, &cpuTypeSize, 0, 0); - return cpu_type; - } - - return GetNativeCPUType(); -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h b/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h deleted file mode 100644 index 65147900b8..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/dynamic_images.h +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// dynamic_images.h -// -// Implements most of the function of the dyld API, but allowing an -// arbitrary task to be introspected, unlike the dyld API which -// only allows operation on the current task. The current implementation -// is limited to use by 32-bit tasks. - -#ifndef CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__ -#define CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__ - -#include -#include -#include -#include - -#include -#include - -#include "mach_vm_compat.h" - -namespace google_breakpad { - -using std::string; -using std::vector; - -//============================================================================== -// The memory layout of this struct matches the dyld_image_info struct -// defined in "dyld_gdb.h" in the darwin source. -typedef struct dyld_image_info32 { - uint32_t load_address_; // struct mach_header* - uint32_t file_path_; // char* - uint32_t file_mod_date_; -} dyld_image_info32; - -typedef struct dyld_image_info64 { - uint64_t load_address_; // struct mach_header* - uint64_t file_path_; // char* - uint64_t file_mod_date_; -} dyld_image_info64; - -//============================================================================== -// This is as defined in "dyld_gdb.h" in the darwin source. -// _dyld_all_image_infos (in dyld) is a structure of this type -// which will be used to determine which dynamic code has been loaded. -typedef struct dyld_all_image_infos32 { - uint32_t version; // == 1 in Mac OS X 10.4 - uint32_t infoArrayCount; - uint32_t infoArray; // const struct dyld_image_info* - uint32_t notification; - bool processDetachedFromSharedRegion; -} dyld_all_image_infos32; - -typedef struct dyld_all_image_infos64 { - uint32_t version; // == 1 in Mac OS X 10.4 - uint32_t infoArrayCount; - uint64_t infoArray; // const struct dyld_image_info* - uint64_t notification; - bool processDetachedFromSharedRegion; -} dyld_all_image_infos64; - -// some typedefs to isolate 64/32 bit differences -#ifdef __LP64__ -typedef mach_header_64 breakpad_mach_header; -typedef segment_command_64 breakpad_mach_segment_command; -#else -typedef mach_header breakpad_mach_header; -typedef segment_command breakpad_mach_segment_command; -#endif - -// Helper functions to deal with 32-bit/64-bit Mach-O differences. -class DynamicImage; -template -bool FindTextSection(DynamicImage& image); - -template -uint32_t GetFileTypeFromHeader(DynamicImage& image); - -//============================================================================== -// Represents a single dynamically loaded mach-o image -class DynamicImage { - public: - DynamicImage(uint8_t *header, // data is copied - size_t header_size, // includes load commands - uint64_t load_address, - string file_path, - uintptr_t image_mod_date, - mach_port_t task, - cpu_type_t cpu_type) - : header_(header, header + header_size), - header_size_(header_size), - load_address_(load_address), - vmaddr_(0), - vmsize_(0), - slide_(0), - version_(0), - file_path_(file_path), - file_mod_date_(image_mod_date), - task_(task), - cpu_type_(cpu_type) { - CalculateMemoryAndVersionInfo(); - } - - // Size of mach_header plus load commands - size_t GetHeaderSize() const {return header_.size();} - - // Full path to mach-o binary - string GetFilePath() {return file_path_;} - - uint64_t GetModDate() const {return file_mod_date_;} - - // Actual address where the image was loaded - uint64_t GetLoadAddress() const {return load_address_;} - - // Address where the image should be loaded - mach_vm_address_t GetVMAddr() const {return vmaddr_;} - - // Difference between GetLoadAddress() and GetVMAddr() - ptrdiff_t GetVMAddrSlide() const {return slide_;} - - // Size of the image - mach_vm_size_t GetVMSize() const {return vmsize_;} - - // Task owning this loaded image - mach_port_t GetTask() {return task_;} - - // CPU type of the task - cpu_type_t GetCPUType() {return cpu_type_;} - - // filetype from the Mach-O header. - uint32_t GetFileType(); - - // Return true if the task is a 64-bit architecture. - bool Is64Bit() { return (GetCPUType() & CPU_ARCH_ABI64) == CPU_ARCH_ABI64; } - - uint32_t GetVersion() {return version_;} - // For sorting - bool operator<(const DynamicImage &inInfo) { - return GetLoadAddress() < inInfo.GetLoadAddress(); - } - - // Sanity checking - bool IsValid() {return GetVMSize() != 0;} - - private: - DynamicImage(const DynamicImage &); - DynamicImage &operator=(const DynamicImage &); - - friend class DynamicImages; - template - friend bool FindTextSection(DynamicImage& image); - template - friend uint32_t GetFileTypeFromHeader(DynamicImage& image); - - // Initializes vmaddr_, vmsize_, and slide_ - void CalculateMemoryAndVersionInfo(); - - const vector header_; // our local copy of the header - size_t header_size_; // mach_header plus load commands - uint64_t load_address_; // base address image is mapped into - mach_vm_address_t vmaddr_; - mach_vm_size_t vmsize_; - ptrdiff_t slide_; - uint32_t version_; // Dylib version - string file_path_; // path dyld used to load the image - uintptr_t file_mod_date_; // time_t of image file - - mach_port_t task_; - cpu_type_t cpu_type_; // CPU type of task_ -}; - -//============================================================================== -// DynamicImageRef is just a simple wrapper for a pointer to -// DynamicImage. The reason we use it instead of a simple typedef is so -// that we can use stl::sort() on a vector of DynamicImageRefs -// and simple class pointers can't implement operator<(). -// -class DynamicImageRef { - public: - explicit DynamicImageRef(DynamicImage *inP) : p(inP) {} - // The copy constructor is required by STL - DynamicImageRef(const DynamicImageRef &inRef) : p(inRef.p) {} - - bool operator<(const DynamicImageRef &inRef) const { - return (*const_cast(this)->p) - < (*const_cast(inRef).p); - } - - bool operator==(const DynamicImageRef &inInfo) const { - return (*const_cast(this)->p).GetLoadAddress() == - (*const_cast(inInfo)).GetLoadAddress(); - } - - // Be just like DynamicImage* - DynamicImage *operator->() {return p;} - operator DynamicImage*() {return p;} - - private: - DynamicImage *p; -}; - -// Helper function to deal with 32-bit/64-bit Mach-O differences. -class DynamicImages; -template -void ReadImageInfo(DynamicImages& images, uint64_t image_list_address); - -//============================================================================== -// An object of type DynamicImages may be created to allow introspection of -// an arbitrary task's dynamically loaded mach-o binaries. This makes the -// assumption that the current task has send rights to the target task. -class DynamicImages { - public: - explicit DynamicImages(mach_port_t task); - - ~DynamicImages() { - for (int i = 0; i < GetImageCount(); ++i) { - delete image_list_[i]; - } - } - - // Returns the number of dynamically loaded mach-o images. - int GetImageCount() const {return static_cast(image_list_.size());} - - // Returns an individual image. - DynamicImage *GetImage(int i) { - if (i < (int)image_list_.size()) { - return image_list_[i]; - } - return NULL; - } - - // Returns the image corresponding to the main executable. - DynamicImage *GetExecutableImage(); - int GetExecutableImageIndex(); - - // Returns the task which we're looking at. - mach_port_t GetTask() const {return task_;} - - // CPU type of the task - cpu_type_t GetCPUType() {return cpu_type_;} - - // Return true if the task is a 64-bit architecture. - bool Is64Bit() { return (GetCPUType() & CPU_ARCH_ABI64) == CPU_ARCH_ABI64; } - - // Determine the CPU type of the task being dumped. - static cpu_type_t DetermineTaskCPUType(task_t task); - - // Get the native CPU type of this task. - static cpu_type_t GetNativeCPUType() { -#if defined(__i386__) - return CPU_TYPE_I386; -#elif defined(__x86_64__) - return CPU_TYPE_X86_64; -#elif defined(__ppc__) - return CPU_TYPE_POWERPC; -#elif defined(__ppc64__) - return CPU_TYPE_POWERPC64; -#elif defined(__arm__) - return CPU_TYPE_ARM; -#elif defined(__aarch64__) - return CPU_TYPE_ARM64; -#else -#error "GetNativeCPUType not implemented for this architecture" -#endif - } - - private: - template - friend void ReadImageInfo(DynamicImages& images, uint64_t image_list_address); - - bool IsOurTask() {return task_ == mach_task_self();} - - // Initialization - void ReadImageInfoForTask(); - uint64_t GetDyldAllImageInfosPointer(); - - mach_port_t task_; - cpu_type_t cpu_type_; // CPU type of task_ - vector image_list_; -}; - -// Fill bytes with the contents of memory at a particular -// location in another task. -kern_return_t ReadTaskMemory(task_port_t target_task, - const uint64_t address, - size_t length, - vector &bytes); - -} // namespace google_breakpad - -#endif // CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc deleted file mode 100644 index 6928e98472..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.cc +++ /dev/null @@ -1,855 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include - -#include - -#include "client/mac/handler/exception_handler.h" -#include "client/mac/handler/minidump_generator.h" -#include "common/mac/macho_utilities.h" -#include "common/mac/scoped_task_suspend-inl.h" -#include "google_breakpad/common/minidump_exception_mac.h" - -#ifndef __EXCEPTIONS -// This file uses C++ try/catch (but shouldn't). Duplicate the macros from -// allowing this file to work properly with -// exceptions disabled even when other C++ libraries are used. #undef the try -// and catch macros first in case libstdc++ is in use and has already provided -// its own definitions. -#undef try -#define try if (true) -#undef catch -#define catch(X) if (false) -#endif // __EXCEPTIONS - -#ifndef USE_PROTECTED_ALLOCATIONS -#if TARGET_OS_IPHONE -#define USE_PROTECTED_ALLOCATIONS 1 -#else -#define USE_PROTECTED_ALLOCATIONS 0 -#endif -#endif - -// If USE_PROTECTED_ALLOCATIONS is activated then the -// gBreakpadAllocator needs to be setup in other code -// ahead of time. Please see ProtectedMemoryAllocator.h -// for more details. -#if USE_PROTECTED_ALLOCATIONS - #include "protected_memory_allocator.h" - extern ProtectedMemoryAllocator *gBreakpadAllocator; -#endif - -namespace google_breakpad { - -static union { -#if USE_PROTECTED_ALLOCATIONS -#if defined PAGE_MAX_SIZE - char protected_buffer[PAGE_MAX_SIZE] __attribute__((aligned(PAGE_MAX_SIZE))); -#else - char protected_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); -#endif // defined PAGE_MAX_SIZE -#endif // USE_PROTECTED_ALLOCATIONS - google_breakpad::ExceptionHandler *handler; -} gProtectedData; - -using std::map; - -// These structures and techniques are illustrated in -// Mac OS X Internals, Amit Singh, ch 9.7 -struct ExceptionMessage { - mach_msg_header_t header; - mach_msg_body_t body; - mach_msg_port_descriptor_t thread; - mach_msg_port_descriptor_t task; - NDR_record_t ndr; - exception_type_t exception; - mach_msg_type_number_t code_count; - integer_t code[EXCEPTION_CODE_MAX]; - char padding[512]; -}; - -struct ExceptionParameters { - ExceptionParameters() : count(0) {} - mach_msg_type_number_t count; - exception_mask_t masks[EXC_TYPES_COUNT]; - mach_port_t ports[EXC_TYPES_COUNT]; - exception_behavior_t behaviors[EXC_TYPES_COUNT]; - thread_state_flavor_t flavors[EXC_TYPES_COUNT]; -}; - -struct ExceptionReplyMessage { - mach_msg_header_t header; - NDR_record_t ndr; - kern_return_t return_code; -}; - -// Only catch these three exceptions. The other ones are nebulously defined -// and may result in treating a non-fatal exception as fatal. -exception_mask_t s_exception_mask = EXC_MASK_BAD_ACCESS | -EXC_MASK_BAD_INSTRUCTION | EXC_MASK_ARITHMETIC | EXC_MASK_BREAKPOINT; - -#if !TARGET_OS_IPHONE -extern "C" { - // Forward declarations for functions that need "C" style compilation - boolean_t exc_server(mach_msg_header_t* request, - mach_msg_header_t* reply); - - // This symbol must be visible to dlsym() - see - // http://code.google.com/p/google-breakpad/issues/detail?id=345 for details. - kern_return_t catch_exception_raise(mach_port_t target_port, - mach_port_t failed_thread, - mach_port_t task, - exception_type_t exception, - exception_data_t code, - mach_msg_type_number_t code_count) - __attribute__((visibility("default"))); -} -#endif - -kern_return_t ForwardException(mach_port_t task, - mach_port_t failed_thread, - exception_type_t exception, - exception_data_t code, - mach_msg_type_number_t code_count); - -#if TARGET_OS_IPHONE -// Implementation is based on the implementation generated by mig. -boolean_t breakpad_exc_server(mach_msg_header_t* InHeadP, - mach_msg_header_t* OutHeadP) { - OutHeadP->msgh_bits = - MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(InHeadP->msgh_bits), 0); - OutHeadP->msgh_remote_port = InHeadP->msgh_remote_port; - /* Minimal size: routine() will update it if different */ - OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t); - OutHeadP->msgh_local_port = MACH_PORT_NULL; - OutHeadP->msgh_id = InHeadP->msgh_id + 100; - - if (InHeadP->msgh_id != 2401) { - ((mig_reply_error_t*)OutHeadP)->NDR = NDR_record; - ((mig_reply_error_t*)OutHeadP)->RetCode = MIG_BAD_ID; - return FALSE; - } - -#ifdef __MigPackStructs -#pragma pack(4) -#endif - typedef struct { - mach_msg_header_t Head; - /* start of the kernel processed data */ - mach_msg_body_t msgh_body; - mach_msg_port_descriptor_t thread; - mach_msg_port_descriptor_t task; - /* end of the kernel processed data */ - NDR_record_t NDR; - exception_type_t exception; - mach_msg_type_number_t codeCnt; - integer_t code[2]; - mach_msg_trailer_t trailer; - } Request; - - typedef struct { - mach_msg_header_t Head; - NDR_record_t NDR; - kern_return_t RetCode; - } Reply; -#ifdef __MigPackStructs -#pragma pack() -#endif - - Request* In0P = (Request*)InHeadP; - Reply* OutP = (Reply*)OutHeadP; - - if (In0P->task.name != mach_task_self()) { - return FALSE; - } - OutP->RetCode = ForwardException(In0P->task.name, - In0P->thread.name, - In0P->exception, - In0P->code, - In0P->codeCnt); - OutP->NDR = NDR_record; - return TRUE; -} -#else -boolean_t breakpad_exc_server(mach_msg_header_t* request, - mach_msg_header_t* reply) { - return exc_server(request, reply); -} - -// Callback from exc_server() -kern_return_t catch_exception_raise(mach_port_t port, mach_port_t failed_thread, - mach_port_t task, - exception_type_t exception, - exception_data_t code, - mach_msg_type_number_t code_count) { - if (task != mach_task_self()) { - return KERN_FAILURE; - } - return ForwardException(task, failed_thread, exception, code, code_count); -} -#endif - -ExceptionHandler::ExceptionHandler(const string &dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - bool install_handler, - const char* port_name) - : dump_path_(), - filter_(filter), - callback_(callback), - callback_context_(callback_context), - directCallback_(NULL), - handler_thread_(NULL), - handler_port_(MACH_PORT_NULL), - previous_(NULL), - installed_exception_handler_(false), - is_in_teardown_(false), - last_minidump_write_result_(false), - use_minidump_write_mutex_(false) { - // This will update to the ID and C-string pointers - set_dump_path(dump_path); - MinidumpGenerator::GatherSystemInformation(); -#if !TARGET_OS_IPHONE - if (port_name) - crash_generation_client_.reset(new CrashGenerationClient(port_name)); -#endif - Setup(install_handler); -} - -// special constructor if we want to bypass minidump writing and -// simply get a callback with the exception information -ExceptionHandler::ExceptionHandler(DirectCallback callback, - void* callback_context, - bool install_handler) - : dump_path_(), - filter_(NULL), - callback_(NULL), - callback_context_(callback_context), - directCallback_(callback), - handler_thread_(NULL), - handler_port_(MACH_PORT_NULL), - previous_(NULL), - installed_exception_handler_(false), - is_in_teardown_(false), - last_minidump_write_result_(false), - use_minidump_write_mutex_(false) { - MinidumpGenerator::GatherSystemInformation(); - Setup(install_handler); -} - -ExceptionHandler::~ExceptionHandler() { - Teardown(); -} - -bool ExceptionHandler::WriteMinidump(bool write_exception_stream) { - // If we're currently writing, just return - if (use_minidump_write_mutex_) - return false; - - use_minidump_write_mutex_ = true; - last_minidump_write_result_ = false; - - // Lock the mutex. Since we just created it, this will return immediately. - if (pthread_mutex_lock(&minidump_write_mutex_) == 0) { - // Send an empty message to the handle port so that a minidump will - // be written - bool result = SendMessageToHandlerThread(write_exception_stream ? - kWriteDumpWithExceptionMessage : - kWriteDumpMessage); - if (!result) { - pthread_mutex_unlock(&minidump_write_mutex_); - return false; - } - - // Wait for the minidump writer to complete its writing. It will unlock - // the mutex when completed - pthread_mutex_lock(&minidump_write_mutex_); - } - - use_minidump_write_mutex_ = false; - UpdateNextID(); - return last_minidump_write_result_; -} - -// static -bool ExceptionHandler::WriteMinidump(const string &dump_path, - bool write_exception_stream, - MinidumpCallback callback, - void* callback_context) { - ExceptionHandler handler(dump_path, NULL, callback, callback_context, false, - NULL); - return handler.WriteMinidump(write_exception_stream); -} - -// static -bool ExceptionHandler::WriteMinidumpForChild(mach_port_t child, - mach_port_t child_blamed_thread, - const string &dump_path, - MinidumpCallback callback, - void* callback_context) { - ScopedTaskSuspend suspend(child); - - MinidumpGenerator generator(child, MACH_PORT_NULL); - string dump_id; - string dump_filename = generator.UniqueNameInDirectory(dump_path, &dump_id); - - generator.SetExceptionInformation(EXC_BREAKPOINT, -#if defined(__i386__) || defined(__x86_64__) - EXC_I386_BPT, -#elif defined(__ppc__) || defined(__ppc64__) - EXC_PPC_BREAKPOINT, -#elif defined(__arm__) || defined(__aarch64__) - EXC_ARM_BREAKPOINT, -#else -#error architecture not supported -#endif - 0, - child_blamed_thread); - bool result = generator.Write(dump_filename.c_str()); - - if (callback) { - return callback(dump_path.c_str(), dump_id.c_str(), - callback_context, result); - } - return result; -} - -bool ExceptionHandler::WriteMinidumpWithException( - int exception_type, - int exception_code, - int exception_subcode, - breakpad_ucontext_t* task_context, - mach_port_t thread_name, - bool exit_after_write, - bool report_current_thread) { - bool result = false; - - if (directCallback_) { - if (directCallback_(callback_context_, - exception_type, - exception_code, - exception_subcode, - thread_name) ) { - if (exit_after_write) - _exit(exception_type); - } -#if !TARGET_OS_IPHONE - } else if (IsOutOfProcess()) { - if (exception_type && exception_code) { - // If this is a real exception, give the filter (if any) a chance to - // decide if this should be sent. - if (filter_ && !filter_(callback_context_)) - return false; - result = crash_generation_client_->RequestDumpForException( - exception_type, - exception_code, - exception_subcode, - thread_name); - if (result && exit_after_write) { - _exit(exception_type); - } - } -#endif - } else { - string minidump_id; - - // Putting the MinidumpGenerator in its own context will ensure that the - // destructor is executed, closing the newly created minidump file. - if (!dump_path_.empty()) { - MinidumpGenerator md(mach_task_self(), - report_current_thread ? MACH_PORT_NULL : - mach_thread_self()); - md.SetTaskContext(task_context); - if (exception_type && exception_code) { - // If this is a real exception, give the filter (if any) a chance to - // decide if this should be sent. - if (filter_ && !filter_(callback_context_)) - return false; - - md.SetExceptionInformation(exception_type, exception_code, - exception_subcode, thread_name); - } - - result = md.Write(next_minidump_path_c_); - } - - // Call user specified callback (if any) - if (callback_) { - // If the user callback returned true and we're handling an exception - // (rather than just writing out the file), then we should exit without - // forwarding the exception to the next handler. - if (callback_(dump_path_c_, next_minidump_id_c_, callback_context_, - result)) { - if (exit_after_write) - _exit(exception_type); - } - } - } - - return result; -} - -kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread, - exception_type_t exception, - exception_data_t code, - mach_msg_type_number_t code_count) { - // At this time, we should have called Uninstall() on the exception handler - // so that the current exception ports are the ones that we should be - // forwarding to. - ExceptionParameters current; - - current.count = EXC_TYPES_COUNT; - mach_port_t current_task = mach_task_self(); - task_get_exception_ports(current_task, - s_exception_mask, - current.masks, - ¤t.count, - current.ports, - current.behaviors, - current.flavors); - - // Find the first exception handler that matches the exception - unsigned int found; - for (found = 0; found < current.count; ++found) { - if (current.masks[found] & (1 << exception)) { - break; - } - } - - // Nothing to forward - if (found == current.count) { - fprintf(stderr, "** No previous ports for forwarding!! \n"); - exit(KERN_FAILURE); - } - - mach_port_t target_port = current.ports[found]; - exception_behavior_t target_behavior = current.behaviors[found]; - - kern_return_t result; - // TODO: Handle the case where |target_behavior| has MACH_EXCEPTION_CODES - // set. https://code.google.com/p/google-breakpad/issues/detail?id=551 - switch (target_behavior) { - case EXCEPTION_DEFAULT: - result = exception_raise(target_port, failed_thread, task, exception, - code, code_count); - break; - default: - fprintf(stderr, "** Unknown exception behavior: %d\n", target_behavior); - result = KERN_FAILURE; - break; - } - - return result; -} - -// static -void* ExceptionHandler::WaitForMessage(void* exception_handler_class) { - ExceptionHandler* self = - reinterpret_cast(exception_handler_class); - ExceptionMessage receive; - - // Wait for the exception info - while (1) { - receive.header.msgh_local_port = self->handler_port_; - receive.header.msgh_size = static_cast(sizeof(receive)); - kern_return_t result = mach_msg(&(receive.header), - MACH_RCV_MSG | MACH_RCV_LARGE, 0, - receive.header.msgh_size, - self->handler_port_, - MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - - - if (result == KERN_SUCCESS) { - // Uninstall our handler so that we don't get in a loop if the process of - // writing out a minidump causes an exception. However, if the exception - // was caused by a fork'd process, don't uninstall things - - // If the actual exception code is zero, then we're calling this handler - // in a way that indicates that we want to either exit this thread or - // generate a minidump - // - // While reporting, all threads (except this one) must be suspended - // to avoid misleading stacks. If appropriate they will be resumed - // afterwards. - if (!receive.exception) { - // Don't touch self, since this message could have been sent - // from its destructor. - if (receive.header.msgh_id == kShutdownMessage) - return NULL; - - self->SuspendThreads(); - -#if USE_PROTECTED_ALLOCATIONS - if (gBreakpadAllocator) - gBreakpadAllocator->Unprotect(); -#endif - - mach_port_t thread = MACH_PORT_NULL; - int exception_type = 0; - int exception_code = 0; - if (receive.header.msgh_id == kWriteDumpWithExceptionMessage) { - thread = receive.thread.name; - exception_type = EXC_BREAKPOINT; -#if defined(__i386__) || defined(__x86_64__) - exception_code = EXC_I386_BPT; -#elif defined(__ppc__) || defined(__ppc64__) - exception_code = EXC_PPC_BREAKPOINT; -#elif defined(__arm__) || defined(__aarch64__) - exception_code = EXC_ARM_BREAKPOINT; -#else -#error architecture not supported -#endif - } - - // Write out the dump and save the result for later retrieval - self->last_minidump_write_result_ = - self->WriteMinidumpWithException(exception_type, exception_code, - 0, NULL, thread, - false, false); - -#if USE_PROTECTED_ALLOCATIONS - if (gBreakpadAllocator) - gBreakpadAllocator->Protect(); -#endif - - self->ResumeThreads(); - - if (self->use_minidump_write_mutex_) - pthread_mutex_unlock(&self->minidump_write_mutex_); - } else { - // When forking a child process with the exception handler installed, - // if the child crashes, it will send the exception back to the parent - // process. The check for task == self_task() ensures that only - // exceptions that occur in the parent process are caught and - // processed. If the exception was not caused by this task, we - // still need to call into the exception server and have it return - // KERN_FAILURE (see catch_exception_raise) in order for the kernel - // to move onto the host exception handler for the child task - if (receive.task.name == mach_task_self()) { - self->SuspendThreads(); - -#if USE_PROTECTED_ALLOCATIONS - if (gBreakpadAllocator) - gBreakpadAllocator->Unprotect(); -#endif - - int subcode = 0; - if (receive.exception == EXC_BAD_ACCESS && receive.code_count > 1) - subcode = receive.code[1]; - - // Generate the minidump with the exception data. - self->WriteMinidumpWithException(receive.exception, receive.code[0], - subcode, NULL, receive.thread.name, - true, false); - -#if USE_PROTECTED_ALLOCATIONS - // This may have become protected again within - // WriteMinidumpWithException, but it needs to be unprotected for - // UninstallHandler. - if (gBreakpadAllocator) - gBreakpadAllocator->Unprotect(); -#endif - - self->UninstallHandler(true); - -#if USE_PROTECTED_ALLOCATIONS - if (gBreakpadAllocator) - gBreakpadAllocator->Protect(); -#endif - } - // Pass along the exception to the server, which will setup the - // message and call catch_exception_raise() and put the return - // code into the reply. - ExceptionReplyMessage reply; - if (!breakpad_exc_server(&receive.header, &reply.header)) - exit(1); - - // Send a reply and exit - mach_msg(&(reply.header), MACH_SEND_MSG, - reply.header.msgh_size, 0, MACH_PORT_NULL, - MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - } - } - } - - return NULL; -} - -// static -void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { -#if USE_PROTECTED_ALLOCATIONS - if (gBreakpadAllocator) - gBreakpadAllocator->Unprotect(); -#endif - gProtectedData.handler->WriteMinidumpWithException( - EXC_SOFTWARE, - MD_EXCEPTION_CODE_MAC_ABORT, - 0, - static_cast(uc), - mach_thread_self(), - true, - true); -#if USE_PROTECTED_ALLOCATIONS - if (gBreakpadAllocator) - gBreakpadAllocator->Protect(); -#endif -} - -bool ExceptionHandler::InstallHandler() { - // If a handler is already installed, something is really wrong. - if (gProtectedData.handler != NULL) { - return false; - } - if (!IsOutOfProcess()) { - struct sigaction sa; - memset(&sa, 0, sizeof(sa)); - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGABRT); - sa.sa_sigaction = ExceptionHandler::SignalHandler; - sa.sa_flags = SA_SIGINFO; - - scoped_ptr old(new struct sigaction); - if (sigaction(SIGABRT, &sa, old.get()) == -1) { - return false; - } - old_handler_.swap(old); - gProtectedData.handler = this; -#if USE_PROTECTED_ALLOCATIONS - assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0); - mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ); -#endif - } - - try { -#if USE_PROTECTED_ALLOCATIONS - previous_ = new (gBreakpadAllocator->Allocate(sizeof(ExceptionParameters)) ) - ExceptionParameters(); -#else - previous_ = new ExceptionParameters(); -#endif - } - catch (std::bad_alloc) { - return false; - } - - // Save the current exception ports so that we can forward to them - previous_->count = EXC_TYPES_COUNT; - mach_port_t current_task = mach_task_self(); - kern_return_t result = task_get_exception_ports(current_task, - s_exception_mask, - previous_->masks, - &previous_->count, - previous_->ports, - previous_->behaviors, - previous_->flavors); - - // Setup the exception ports on this task - if (result == KERN_SUCCESS) - result = task_set_exception_ports(current_task, s_exception_mask, - handler_port_, EXCEPTION_DEFAULT, - THREAD_STATE_NONE); - - installed_exception_handler_ = (result == KERN_SUCCESS); - - return installed_exception_handler_; -} - -bool ExceptionHandler::UninstallHandler(bool in_exception) { - kern_return_t result = KERN_SUCCESS; - - if (old_handler_.get()) { - sigaction(SIGABRT, old_handler_.get(), NULL); -#if USE_PROTECTED_ALLOCATIONS - mprotect(gProtectedData.protected_buffer, PAGE_SIZE, - PROT_READ | PROT_WRITE); -#endif - old_handler_.reset(); - gProtectedData.handler = NULL; - } - - if (installed_exception_handler_) { - mach_port_t current_task = mach_task_self(); - - // Restore the previous ports - for (unsigned int i = 0; i < previous_->count; ++i) { - result = task_set_exception_ports(current_task, previous_->masks[i], - previous_->ports[i], - previous_->behaviors[i], - previous_->flavors[i]); - if (result != KERN_SUCCESS) - return false; - } - - // this delete should NOT happen if an exception just occurred! - if (!in_exception) { -#if USE_PROTECTED_ALLOCATIONS - previous_->~ExceptionParameters(); -#else - delete previous_; -#endif - } - - previous_ = NULL; - installed_exception_handler_ = false; - } - - return result == KERN_SUCCESS; -} - -bool ExceptionHandler::Setup(bool install_handler) { - if (pthread_mutex_init(&minidump_write_mutex_, NULL)) - return false; - - // Create a receive right - mach_port_t current_task = mach_task_self(); - kern_return_t result = mach_port_allocate(current_task, - MACH_PORT_RIGHT_RECEIVE, - &handler_port_); - // Add send right - if (result == KERN_SUCCESS) - result = mach_port_insert_right(current_task, handler_port_, handler_port_, - MACH_MSG_TYPE_MAKE_SEND); - - if (install_handler && result == KERN_SUCCESS) - if (!InstallHandler()) - return false; - - if (result == KERN_SUCCESS) { - // Install the handler in its own thread, detached as we won't be joining. - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - int thread_create_result = pthread_create(&handler_thread_, &attr, - &WaitForMessage, this); - pthread_attr_destroy(&attr); - result = thread_create_result ? KERN_FAILURE : KERN_SUCCESS; - } - - return result == KERN_SUCCESS; -} - -bool ExceptionHandler::Teardown() { - kern_return_t result = KERN_SUCCESS; - is_in_teardown_ = true; - - if (!UninstallHandler(false)) - return false; - - // Send an empty message so that the handler_thread exits - if (SendMessageToHandlerThread(kShutdownMessage)) { - mach_port_t current_task = mach_task_self(); - result = mach_port_deallocate(current_task, handler_port_); - if (result != KERN_SUCCESS) - return false; - } else { - return false; - } - - handler_thread_ = NULL; - handler_port_ = MACH_PORT_NULL; - pthread_mutex_destroy(&minidump_write_mutex_); - - return result == KERN_SUCCESS; -} - -bool ExceptionHandler::SendMessageToHandlerThread( - HandlerThreadMessage message_id) { - ExceptionMessage msg; - memset(&msg, 0, sizeof(msg)); - msg.header.msgh_id = message_id; - if (message_id == kWriteDumpMessage || - message_id == kWriteDumpWithExceptionMessage) { - // Include this thread's port. - msg.thread.name = mach_thread_self(); - msg.thread.disposition = MACH_MSG_TYPE_PORT_SEND; - msg.thread.type = MACH_MSG_PORT_DESCRIPTOR; - } - msg.header.msgh_size = sizeof(msg) - sizeof(msg.padding); - msg.header.msgh_remote_port = handler_port_; - msg.header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, - MACH_MSG_TYPE_MAKE_SEND_ONCE); - kern_return_t result = mach_msg(&(msg.header), - MACH_SEND_MSG | MACH_SEND_TIMEOUT, - msg.header.msgh_size, 0, 0, - MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - - return result == KERN_SUCCESS; -} - -void ExceptionHandler::UpdateNextID() { - next_minidump_path_ = - (MinidumpGenerator::UniqueNameInDirectory(dump_path_, &next_minidump_id_)); - - next_minidump_path_c_ = next_minidump_path_.c_str(); - next_minidump_id_c_ = next_minidump_id_.c_str(); -} - -bool ExceptionHandler::SuspendThreads() { - thread_act_port_array_t threads_for_task; - mach_msg_type_number_t thread_count; - - if (task_threads(mach_task_self(), &threads_for_task, &thread_count)) - return false; - - // suspend all of the threads except for this one - for (unsigned int i = 0; i < thread_count; ++i) { - if (threads_for_task[i] != mach_thread_self()) { - if (thread_suspend(threads_for_task[i])) - return false; - } - } - - return true; -} - -bool ExceptionHandler::ResumeThreads() { - thread_act_port_array_t threads_for_task; - mach_msg_type_number_t thread_count; - - if (task_threads(mach_task_self(), &threads_for_task, &thread_count)) - return false; - - // resume all of the threads except for this one - for (unsigned int i = 0; i < thread_count; ++i) { - if (threads_for_task[i] != mach_thread_self()) { - if (thread_resume(threads_for_task[i])) - return false; - } - } - - return true; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h b/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h deleted file mode 100644 index f1d9ae92de..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/exception_handler.h +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// exception_handler.h: MacOS exception handler -// This class can install a Mach exception port handler to trap most common -// programming errors. If an exception occurs, a minidump file will be -// generated which contains detailed information about the process and the -// exception. - -#ifndef CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__ -#define CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__ - -#include -#include - -#include - -#include "client/mac/handler/ucontext_compat.h" -#include "common/scoped_ptr.h" - -#if !TARGET_OS_IPHONE -#include "client/mac/crash_generation/crash_generation_client.h" -#endif - -namespace google_breakpad { - -using std::string; - -struct ExceptionParameters; - -enum HandlerThreadMessage { - // Message ID telling the handler thread to write a dump. - kWriteDumpMessage = 0, - // Message ID telling the handler thread to write a dump and include - // an exception stream. - kWriteDumpWithExceptionMessage = 1, - // Message ID telling the handler thread to quit. - kShutdownMessage = 2 -}; - -class ExceptionHandler { - public: - // A callback function to run before Breakpad performs any substantial - // processing of an exception. A FilterCallback is called before writing - // a minidump. context is the parameter supplied by the user as - // callback_context when the handler was created. - // - // If a FilterCallback returns true, Breakpad will continue processing, - // attempting to write a minidump. If a FilterCallback returns false, Breakpad - // will immediately report the exception as unhandled without writing a - // minidump, allowing another handler the opportunity to handle it. - typedef bool (*FilterCallback)(void *context); - - // A callback function to run after the minidump has been written. - // |minidump_id| is a unique id for the dump, so the minidump - // file is /.dmp. - // |context| is the value passed into the constructor. - // |succeeded| indicates whether a minidump file was successfully written. - // Return true if the exception was fully handled and breakpad should exit. - // Return false to allow any other exception handlers to process the - // exception. - typedef bool (*MinidumpCallback)(const char *dump_dir, - const char *minidump_id, - void *context, bool succeeded); - - // A callback function which will be called directly if an exception occurs. - // This bypasses the minidump file writing and simply gives the client - // the exception information. - typedef bool (*DirectCallback)( void *context, - int exception_type, - int exception_code, - int exception_subcode, - mach_port_t thread_name); - - // Creates a new ExceptionHandler instance to handle writing minidumps. - // Minidump files will be written to dump_path, and the optional callback - // is called after writing the dump file, as described above. - // If install_handler is true, then a minidump will be written whenever - // an unhandled exception occurs. If it is false, minidumps will only - // be written when WriteMinidump is called. - // If port_name is non-NULL, attempt to perform out-of-process dump generation - // If port_name is NULL, in-process dump generation will be used. - ExceptionHandler(const string &dump_path, - FilterCallback filter, MinidumpCallback callback, - void *callback_context, bool install_handler, - const char *port_name); - - // A special constructor if we want to bypass minidump writing and - // simply get a callback with the exception information. - ExceptionHandler(DirectCallback callback, - void *callback_context, - bool install_handler); - - ~ExceptionHandler(); - - // Get and set the minidump path. - string dump_path() const { return dump_path_; } - void set_dump_path(const string &dump_path) { - dump_path_ = dump_path; - dump_path_c_ = dump_path_.c_str(); - UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_. - } - - // Writes a minidump immediately. This can be used to capture the - // execution state independently of a crash. Returns true on success. - bool WriteMinidump() { - return WriteMinidump(false); - } - - bool WriteMinidump(bool write_exception_stream); - - // Convenience form of WriteMinidump which does not require an - // ExceptionHandler instance. - static bool WriteMinidump(const string &dump_path, MinidumpCallback callback, - void *callback_context) { - return WriteMinidump(dump_path, false, callback, callback_context); - } - - static bool WriteMinidump(const string &dump_path, - bool write_exception_stream, - MinidumpCallback callback, - void *callback_context); - - // Write a minidump of child immediately. This can be used to capture - // the execution state of a child process independently of a crash. - static bool WriteMinidumpForChild(mach_port_t child, - mach_port_t child_blamed_thread, - const std::string &dump_path, - MinidumpCallback callback, - void *callback_context); - - // Returns whether out-of-process dump generation is used or not. - bool IsOutOfProcess() const { -#if TARGET_OS_IPHONE - return false; -#else - return crash_generation_client_.get() != NULL; -#endif - } - - private: - // Install the mach exception handler - bool InstallHandler(); - - // Uninstall the mach exception handler (if any) - bool UninstallHandler(bool in_exception); - - // Setup the handler thread, and if |install_handler| is true, install the - // mach exception port handler - bool Setup(bool install_handler); - - // Uninstall the mach exception handler (if any) and terminate the helper - // thread - bool Teardown(); - - // Send a mach message to the exception handler. Return true on - // success, false otherwise. - bool SendMessageToHandlerThread(HandlerThreadMessage message_id); - - // All minidump writing goes through this one routine. - // |task_context| can be NULL. If not, it will be used to retrieve the - // context of the current thread, instead of using |thread_get_state|. - bool WriteMinidumpWithException(int exception_type, - int exception_code, - int exception_subcode, - breakpad_ucontext_t *task_context, - mach_port_t thread_name, - bool exit_after_write, - bool report_current_thread); - - // When installed, this static function will be call from a newly created - // pthread with |this| as the argument - static void *WaitForMessage(void *exception_handler_class); - - // Signal handler for SIGABRT. - static void SignalHandler(int sig, siginfo_t* info, void* uc); - - // disallow copy ctor and operator= - explicit ExceptionHandler(const ExceptionHandler &); - void operator=(const ExceptionHandler &); - - // Generates a new ID and stores it in next_minidump_id_, and stores the - // path of the next minidump to be written in next_minidump_path_. - void UpdateNextID(); - - // These functions will suspend/resume all threads except for the - // reporting thread - bool SuspendThreads(); - bool ResumeThreads(); - - // The destination directory for the minidump - string dump_path_; - - // The basename of the next minidump w/o extension - string next_minidump_id_; - - // The full path to the next minidump to be written, including extension - string next_minidump_path_; - - // Pointers to the UTF-8 versions of above - const char *dump_path_c_; - const char *next_minidump_id_c_; - const char *next_minidump_path_c_; - - // The callback function and pointer to be passed back after the minidump - // has been written - FilterCallback filter_; - MinidumpCallback callback_; - void *callback_context_; - - // The callback function to be passed back when we don't want a minidump - // file to be written - DirectCallback directCallback_; - - // The thread that is created for the handler - pthread_t handler_thread_; - - // The port that is waiting on an exception message to be sent, if the - // handler is installed - mach_port_t handler_port_; - - // These variables save the previous exception handler's data so that it - // can be re-installed when this handler is uninstalled - ExceptionParameters *previous_; - - // True, if we've installed the exception handler - bool installed_exception_handler_; - - // True, if we're in the process of uninstalling the exception handler and - // the thread. - bool is_in_teardown_; - - // Save the last result of the last minidump - bool last_minidump_write_result_; - - // A mutex for use when writing out a minidump that was requested on a - // thread other than the exception handler. - pthread_mutex_t minidump_write_mutex_; - - // True, if we're using the mutext to indicate when mindump writing occurs - bool use_minidump_write_mutex_; - - // Old signal handler for SIGABRT. Used to be able to restore it when - // uninstalling. - scoped_ptr old_handler_; - -#if !TARGET_OS_IPHONE - // Client for out-of-process dump generation. - scoped_ptr crash_generation_client_; -#endif -}; - -} // namespace google_breakpad - -#endif // CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h b/Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h deleted file mode 100644 index 9e9028b928..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/mach_vm_compat.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2011, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_ -#define CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_ - -#include - -// On iOS 5 and higher, mach/mach_vm.h is not supported. Use the corresponding -// vm_map functions instead. -#if TARGET_OS_IPHONE -#include -#define mach_vm_address_t vm_address_t -#define mach_vm_deallocate vm_deallocate -#define mach_vm_read vm_read -#define mach_vm_region_recurse vm_region_recurse_64 -#define mach_vm_size_t vm_size_t -#else -#include -#endif // TARGET_OS_IPHONE - -#endif // CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc b/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc deleted file mode 100644 index 7d6e81dbb8..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.cc +++ /dev/null @@ -1,1591 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "client/mac/handler/minidump_generator.h" - -#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT) -#include -#endif -#ifdef HAS_PPC_SUPPORT -#include -#endif -#ifdef HAS_X86_SUPPORT -#include -#endif - -#include "client/minidump_file_writer-inl.h" -#include "common/mac/file_id.h" -#include "common/mac/macho_id.h" -#include "common/mac/string_utilities.h" - -using MacStringUtils::ConvertToString; -using MacStringUtils::IntegerValueAtIndex; - -namespace google_breakpad { - -#if defined(__LP64__) && __LP64__ -#define LC_SEGMENT_ARCH LC_SEGMENT_64 -#else -#define LC_SEGMENT_ARCH LC_SEGMENT -#endif - -// constructor when generating from within the crashed process -MinidumpGenerator::MinidumpGenerator() - : writer_(), - exception_type_(0), - exception_code_(0), - exception_subcode_(0), - exception_thread_(0), - crashing_task_(mach_task_self()), - handler_thread_(mach_thread_self()), - cpu_type_(DynamicImages::GetNativeCPUType()), - task_context_(NULL), - dynamic_images_(NULL), - memory_blocks_(&allocator_) { - GatherSystemInformation(); -} - -// constructor when generating from a different process than the -// crashed process -MinidumpGenerator::MinidumpGenerator(mach_port_t crashing_task, - mach_port_t handler_thread) - : writer_(), - exception_type_(0), - exception_code_(0), - exception_subcode_(0), - exception_thread_(0), - crashing_task_(crashing_task), - handler_thread_(handler_thread), - cpu_type_(DynamicImages::GetNativeCPUType()), - task_context_(NULL), - dynamic_images_(NULL), - memory_blocks_(&allocator_) { - if (crashing_task != mach_task_self()) { - dynamic_images_ = new DynamicImages(crashing_task_); - cpu_type_ = dynamic_images_->GetCPUType(); - } else { - dynamic_images_ = NULL; - cpu_type_ = DynamicImages::GetNativeCPUType(); - } - - GatherSystemInformation(); -} - -MinidumpGenerator::~MinidumpGenerator() { - delete dynamic_images_; -} - -char MinidumpGenerator::build_string_[16]; -int MinidumpGenerator::os_major_version_ = 0; -int MinidumpGenerator::os_minor_version_ = 0; -int MinidumpGenerator::os_build_number_ = 0; - -// static -void MinidumpGenerator::GatherSystemInformation() { - // If this is non-zero, then we've already gathered the information - if (os_major_version_) - return; - - // This code extracts the version and build information from the OS - CFStringRef vers_path = - CFSTR("/System/Library/CoreServices/SystemVersion.plist"); - CFURLRef sys_vers = - CFURLCreateWithFileSystemPath(NULL, - vers_path, - kCFURLPOSIXPathStyle, - false); - CFReadStreamRef read_stream = CFReadStreamCreateWithFile(NULL, sys_vers); - CFRelease(sys_vers); - if (!read_stream) { - return; - } - if (!CFReadStreamOpen(read_stream)) { - CFRelease(read_stream); - return; - } - CFDataRef data = NULL; - CFIndex num_bytes_read = 0; - const UInt8 *data_bytes = - CFReadStreamGetBuffer(read_stream, 0, &num_bytes_read); - if (data_bytes) { - data = CFDataCreate(NULL, data_bytes, num_bytes_read); - } - CFReadStreamClose(read_stream); - CFRelease(read_stream); - if (!data) { - return; - } - CFDictionaryRef list = static_cast - (CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable, - NULL)); - CFRelease(data); - if (!list) { - return; - } - CFStringRef build_version = static_cast - (CFDictionaryGetValue(list, CFSTR("ProductBuildVersion"))); - CFStringRef product_version = static_cast - (CFDictionaryGetValue(list, CFSTR("ProductVersion"))); - string build_str = ConvertToString(build_version); - string product_str = ConvertToString(product_version); - - CFRelease(list); - - strlcpy(build_string_, build_str.c_str(), sizeof(build_string_)); - - // Parse the string that looks like "10.4.8" - os_major_version_ = IntegerValueAtIndex(product_str, 0); - os_minor_version_ = IntegerValueAtIndex(product_str, 1); - os_build_number_ = IntegerValueAtIndex(product_str, 2); -} - -void MinidumpGenerator::SetTaskContext(breakpad_ucontext_t *task_context) { - task_context_ = task_context; -} - -string MinidumpGenerator::UniqueNameInDirectory(const string &dir, - string *unique_name) { - CFUUIDRef uuid = CFUUIDCreate(NULL); - CFStringRef uuid_cfstr = CFUUIDCreateString(NULL, uuid); - CFRelease(uuid); - string file_name(ConvertToString(uuid_cfstr)); - CFRelease(uuid_cfstr); - string path(dir); - - // Ensure that the directory (if non-empty) has a trailing slash so that - // we can append the file name and have a valid pathname. - if (!dir.empty()) { - if (dir.at(dir.size() - 1) != '/') - path.append(1, '/'); - } - - path.append(file_name); - path.append(".dmp"); - - if (unique_name) - *unique_name = file_name; - - return path; -} - -bool MinidumpGenerator::Write(const char *path) { - WriteStreamFN writers[] = { - &MinidumpGenerator::WriteThreadListStream, - &MinidumpGenerator::WriteMemoryListStream, - &MinidumpGenerator::WriteSystemInfoStream, - &MinidumpGenerator::WriteModuleListStream, - &MinidumpGenerator::WriteMiscInfoStream, - &MinidumpGenerator::WriteBreakpadInfoStream, - // Exception stream needs to be the last entry in this array as it may - // be omitted in the case where the minidump is written without an - // exception. - &MinidumpGenerator::WriteExceptionStream, - }; - bool result = false; - - // If opening was successful, create the header, directory, and call each - // writer. The destructor for the TypedMDRVAs will cause the data to be - // flushed. The destructor for the MinidumpFileWriter will close the file. - if (writer_.Open(path)) { - TypedMDRVA header(&writer_); - TypedMDRVA dir(&writer_); - - if (!header.Allocate()) - return false; - - int writer_count = static_cast(sizeof(writers) / sizeof(writers[0])); - - // If we don't have exception information, don't write out the - // exception stream - if (!exception_thread_ && !exception_type_) - --writer_count; - - // Add space for all writers - if (!dir.AllocateArray(writer_count)) - return false; - - MDRawHeader *header_ptr = header.get(); - header_ptr->signature = MD_HEADER_SIGNATURE; - header_ptr->version = MD_HEADER_VERSION; - time(reinterpret_cast(&(header_ptr->time_date_stamp))); - header_ptr->stream_count = writer_count; - header_ptr->stream_directory_rva = dir.position(); - - MDRawDirectory local_dir; - result = true; - for (int i = 0; (result) && (i < writer_count); ++i) { - result = (this->*writers[i])(&local_dir); - - if (result) - dir.CopyIndex(i, &local_dir); - } - } - return result; -} - -size_t MinidumpGenerator::CalculateStackSize(mach_vm_address_t start_addr) { - mach_vm_address_t stack_region_base = start_addr; - mach_vm_size_t stack_region_size; - natural_t nesting_level = 0; - vm_region_submap_info_64 submap_info; - mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64; - - vm_region_recurse_info_t region_info; - region_info = reinterpret_cast(&submap_info); - - if (start_addr == 0) { - return 0; - } - - kern_return_t result = - mach_vm_region_recurse(crashing_task_, &stack_region_base, - &stack_region_size, &nesting_level, - region_info, &info_count); - - if (result != KERN_SUCCESS || start_addr < stack_region_base) { - // Failure or stack corruption, since mach_vm_region had to go - // higher in the process address space to find a valid region. - return 0; - } - - unsigned int tag = submap_info.user_tag; - - // If the user tag is VM_MEMORY_STACK, look for more readable regions with - // the same tag placed immediately above the computed stack region. Under - // some circumstances, the stack for thread 0 winds up broken up into - // multiple distinct abutting regions. This can happen for several reasons, - // including user code that calls setrlimit(RLIMIT_STACK, ...) or changes - // the access on stack pages by calling mprotect. - if (tag == VM_MEMORY_STACK) { - while (true) { - mach_vm_address_t next_region_base = stack_region_base + - stack_region_size; - mach_vm_address_t proposed_next_region_base = next_region_base; - mach_vm_size_t next_region_size; - nesting_level = 0; - info_count = VM_REGION_SUBMAP_INFO_COUNT_64; - result = mach_vm_region_recurse(crashing_task_, &next_region_base, - &next_region_size, &nesting_level, - region_info, &info_count); - if (result != KERN_SUCCESS || - next_region_base != proposed_next_region_base || - submap_info.user_tag != tag || - (submap_info.protection & VM_PROT_READ) == 0) { - break; - } - - stack_region_size += next_region_size; - } - } - - return stack_region_base + stack_region_size - start_addr; -} - -bool MinidumpGenerator::WriteStackFromStartAddress( - mach_vm_address_t start_addr, - MDMemoryDescriptor *stack_location) { - UntypedMDRVA memory(&writer_); - - bool result = false; - size_t size = CalculateStackSize(start_addr); - - if (size == 0) { - // In some situations the stack address for the thread can come back 0. - // In these cases we skip over the threads in question and stuff the - // stack with a clearly borked value. - start_addr = 0xDEADBEEF; - size = 16; - if (!memory.Allocate(size)) - return false; - - unsigned long long dummy_stack[2]; // Fill dummy stack with 16 bytes of - // junk. - dummy_stack[0] = 0xDEADBEEF; - dummy_stack[1] = 0xDEADBEEF; - - result = memory.Copy(dummy_stack, size); - } else { - - if (!memory.Allocate(size)) - return false; - - if (dynamic_images_) { - vector stack_memory; - if (ReadTaskMemory(crashing_task_, - start_addr, - size, - stack_memory) != KERN_SUCCESS) { - return false; - } - - result = memory.Copy(&stack_memory[0], size); - } else { - result = memory.Copy(reinterpret_cast(start_addr), size); - } - } - - stack_location->start_of_memory_range = start_addr; - stack_location->memory = memory.location(); - - return result; -} - -bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - switch (cpu_type_) { -#ifdef HAS_ARM_SUPPORT - case CPU_TYPE_ARM: - return WriteStackARM(state, stack_location); -#endif -#ifdef HAS_ARM64_SUPPORT - case CPU_TYPE_ARM64: - return WriteStackARM64(state, stack_location); -#endif -#ifdef HAS_PPC_SUPPORT - case CPU_TYPE_POWERPC: - return WriteStackPPC(state, stack_location); - case CPU_TYPE_POWERPC64: - return WriteStackPPC64(state, stack_location); -#endif -#ifdef HAS_X86_SUPPORT - case CPU_TYPE_I386: - return WriteStackX86(state, stack_location); - case CPU_TYPE_X86_64: - return WriteStackX86_64(state, stack_location); -#endif - default: - return false; - } -} - -bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) { - switch (cpu_type_) { -#ifdef HAS_ARM_SUPPORT - case CPU_TYPE_ARM: - return WriteContextARM(state, register_location); -#endif -#ifdef HAS_ARM64_SUPPORT - case CPU_TYPE_ARM64: - return WriteContextARM64(state, register_location); -#endif -#ifdef HAS_PPC_SUPPORT - case CPU_TYPE_POWERPC: - return WriteContextPPC(state, register_location); - case CPU_TYPE_POWERPC64: - return WriteContextPPC64(state, register_location); -#endif -#ifdef HAS_X86_SUPPORT - case CPU_TYPE_I386: - return WriteContextX86(state, register_location); - case CPU_TYPE_X86_64: - return WriteContextX86_64(state, register_location); -#endif - default: - return false; - } -} - -uint64_t MinidumpGenerator::CurrentPCForStack( - breakpad_thread_state_data_t state) { - switch (cpu_type_) { -#ifdef HAS_ARM_SUPPORT - case CPU_TYPE_ARM: - return CurrentPCForStackARM(state); -#endif -#ifdef HAS_ARM64_SUPPORT - case CPU_TYPE_ARM64: - return CurrentPCForStackARM64(state); -#endif -#ifdef HAS_PPC_SUPPORT - case CPU_TYPE_POWERPC: - return CurrentPCForStackPPC(state); - case CPU_TYPE_POWERPC64: - return CurrentPCForStackPPC64(state); -#endif -#ifdef HAS_X86_SUPPORT - case CPU_TYPE_I386: - return CurrentPCForStackX86(state); - case CPU_TYPE_X86_64: - return CurrentPCForStackX86_64(state); -#endif - default: - assert(0 && "Unknown CPU type!"); - return 0; - } -} - -#ifdef HAS_ARM_SUPPORT -bool MinidumpGenerator::WriteStackARM(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - arm_thread_state_t *machine_state = - reinterpret_cast(state); - mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp); - return WriteStackFromStartAddress(start_addr, stack_location); -} - -uint64_t -MinidumpGenerator::CurrentPCForStackARM(breakpad_thread_state_data_t state) { - arm_thread_state_t *machine_state = - reinterpret_cast(state); - - return REGISTER_FROM_THREADSTATE(machine_state, pc); -} - -bool MinidumpGenerator::WriteContextARM(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) -{ - TypedMDRVA context(&writer_); - arm_thread_state_t *machine_state = - reinterpret_cast(state); - - if (!context.Allocate()) - return false; - - *register_location = context.location(); - MDRawContextARM *context_ptr = context.get(); - context_ptr->context_flags = MD_CONTEXT_ARM_FULL; - -#define AddGPR(a) context_ptr->iregs[a] = REGISTER_FROM_THREADSTATE(machine_state, r[a]) - - context_ptr->iregs[13] = REGISTER_FROM_THREADSTATE(machine_state, sp); - context_ptr->iregs[14] = REGISTER_FROM_THREADSTATE(machine_state, lr); - context_ptr->iregs[15] = REGISTER_FROM_THREADSTATE(machine_state, pc); - context_ptr->cpsr = REGISTER_FROM_THREADSTATE(machine_state, cpsr); - - AddGPR(0); - AddGPR(1); - AddGPR(2); - AddGPR(3); - AddGPR(4); - AddGPR(5); - AddGPR(6); - AddGPR(7); - AddGPR(8); - AddGPR(9); - AddGPR(10); - AddGPR(11); - AddGPR(12); -#undef AddGPR - - return true; -} -#endif - -#ifdef HAS_ARM64_SUPPORT -bool MinidumpGenerator::WriteStackARM64(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - arm_thread_state64_t *machine_state = - reinterpret_cast(state); - mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp); - return WriteStackFromStartAddress(start_addr, stack_location); -} - -uint64_t -MinidumpGenerator::CurrentPCForStackARM64(breakpad_thread_state_data_t state) { - arm_thread_state64_t *machine_state = - reinterpret_cast(state); - - return REGISTER_FROM_THREADSTATE(machine_state, pc); -} - -bool -MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) -{ - TypedMDRVA context(&writer_); - arm_thread_state64_t *machine_state = - reinterpret_cast(state); - - if (!context.Allocate()) - return false; - - *register_location = context.location(); - MDRawContextARM64 *context_ptr = context.get(); - context_ptr->context_flags = MD_CONTEXT_ARM64_FULL; - -#define AddGPR(a) context_ptr->iregs[a] = \ - REGISTER_FROM_THREADSTATE(machine_state, x[a]) - - context_ptr->iregs[29] = REGISTER_FROM_THREADSTATE(machine_state, fp); - context_ptr->iregs[30] = REGISTER_FROM_THREADSTATE(machine_state, lr); - context_ptr->iregs[31] = REGISTER_FROM_THREADSTATE(machine_state, sp); - context_ptr->iregs[32] = REGISTER_FROM_THREADSTATE(machine_state, pc); - context_ptr->cpsr = REGISTER_FROM_THREADSTATE(machine_state, cpsr); - - AddGPR(0); - AddGPR(1); - AddGPR(2); - AddGPR(3); - AddGPR(4); - AddGPR(5); - AddGPR(6); - AddGPR(7); - AddGPR(8); - AddGPR(9); - AddGPR(10); - AddGPR(11); - AddGPR(12); - AddGPR(13); - AddGPR(14); - AddGPR(15); - AddGPR(16); - AddGPR(17); - AddGPR(18); - AddGPR(19); - AddGPR(20); - AddGPR(21); - AddGPR(22); - AddGPR(23); - AddGPR(24); - AddGPR(25); - AddGPR(26); - AddGPR(27); - AddGPR(28); -#undef AddGPR - - return true; -} -#endif - -#ifdef HAS_PCC_SUPPORT -bool MinidumpGenerator::WriteStackPPC(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - ppc_thread_state_t *machine_state = - reinterpret_cast(state); - mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1); - return WriteStackFromStartAddress(start_addr, stack_location); -} - -bool MinidumpGenerator::WriteStackPPC64(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - ppc_thread_state64_t *machine_state = - reinterpret_cast(state); - mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1); - return WriteStackFromStartAddress(start_addr, stack_location); -} - -uint64_t -MinidumpGenerator::CurrentPCForStackPPC(breakpad_thread_state_data_t state) { - ppc_thread_state_t *machine_state = - reinterpret_cast(state); - - return REGISTER_FROM_THREADSTATE(machine_state, srr0); -} - -uint64_t -MinidumpGenerator::CurrentPCForStackPPC64(breakpad_thread_state_data_t state) { - ppc_thread_state64_t *machine_state = - reinterpret_cast(state); - - return REGISTER_FROM_THREADSTATE(machine_state, srr0); -} - -bool MinidumpGenerator::WriteContextPPC(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) -{ - TypedMDRVA context(&writer_); - ppc_thread_state_t *machine_state = - reinterpret_cast(state); - - if (!context.Allocate()) - return false; - - *register_location = context.location(); - MDRawContextPPC *context_ptr = context.get(); - context_ptr->context_flags = MD_CONTEXT_PPC_BASE; - -#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ - REGISTER_FROM_THREADSTATE(machine_state, a)) -#define AddGPR(a) context_ptr->gpr[a] = \ - static_cast<__typeof__(context_ptr->a)>( \ - REGISTER_FROM_THREADSTATE(machine_state, r ## a) - - AddReg(srr0); - AddReg(cr); - AddReg(xer); - AddReg(ctr); - AddReg(lr); - AddReg(vrsave); - - AddGPR(0); - AddGPR(1); - AddGPR(2); - AddGPR(3); - AddGPR(4); - AddGPR(5); - AddGPR(6); - AddGPR(7); - AddGPR(8); - AddGPR(9); - AddGPR(10); - AddGPR(11); - AddGPR(12); - AddGPR(13); - AddGPR(14); - AddGPR(15); - AddGPR(16); - AddGPR(17); - AddGPR(18); - AddGPR(19); - AddGPR(20); - AddGPR(21); - AddGPR(22); - AddGPR(23); - AddGPR(24); - AddGPR(25); - AddGPR(26); - AddGPR(27); - AddGPR(28); - AddGPR(29); - AddGPR(30); - AddGPR(31); - AddReg(mq); -#undef AddReg -#undef AddGPR - - return true; -} - -bool MinidumpGenerator::WriteContextPPC64( - breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) { - TypedMDRVA context(&writer_); - ppc_thread_state64_t *machine_state = - reinterpret_cast(state); - - if (!context.Allocate()) - return false; - - *register_location = context.location(); - MDRawContextPPC64 *context_ptr = context.get(); - context_ptr->context_flags = MD_CONTEXT_PPC_BASE; - -#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ - REGISTER_FROM_THREADSTATE(machine_state, a)) -#define AddGPR(a) context_ptr->gpr[a] = \ - static_cast<__typeof__(context_ptr->a)>( \ - REGISTER_FROM_THREADSTATE(machine_state, r ## a) - - AddReg(srr0); - AddReg(cr); - AddReg(xer); - AddReg(ctr); - AddReg(lr); - AddReg(vrsave); - - AddGPR(0); - AddGPR(1); - AddGPR(2); - AddGPR(3); - AddGPR(4); - AddGPR(5); - AddGPR(6); - AddGPR(7); - AddGPR(8); - AddGPR(9); - AddGPR(10); - AddGPR(11); - AddGPR(12); - AddGPR(13); - AddGPR(14); - AddGPR(15); - AddGPR(16); - AddGPR(17); - AddGPR(18); - AddGPR(19); - AddGPR(20); - AddGPR(21); - AddGPR(22); - AddGPR(23); - AddGPR(24); - AddGPR(25); - AddGPR(26); - AddGPR(27); - AddGPR(28); - AddGPR(29); - AddGPR(30); - AddGPR(31); -#undef AddReg -#undef AddGPR - - return true; -} - -#endif - -#ifdef HAS_X86_SUPPORT -bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - i386_thread_state_t *machine_state = - reinterpret_cast(state); - - mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, esp); - return WriteStackFromStartAddress(start_addr, stack_location); -} - -bool MinidumpGenerator::WriteStackX86_64(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location) { - x86_thread_state64_t *machine_state = - reinterpret_cast(state); - - mach_vm_address_t start_addr = static_cast( - REGISTER_FROM_THREADSTATE(machine_state, rsp)); - return WriteStackFromStartAddress(start_addr, stack_location); -} - -uint64_t -MinidumpGenerator::CurrentPCForStackX86(breakpad_thread_state_data_t state) { - i386_thread_state_t *machine_state = - reinterpret_cast(state); - - return REGISTER_FROM_THREADSTATE(machine_state, eip); -} - -uint64_t -MinidumpGenerator::CurrentPCForStackX86_64(breakpad_thread_state_data_t state) { - x86_thread_state64_t *machine_state = - reinterpret_cast(state); - - return REGISTER_FROM_THREADSTATE(machine_state, rip); -} - -bool MinidumpGenerator::WriteContextX86(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) -{ - TypedMDRVA context(&writer_); - i386_thread_state_t *machine_state = - reinterpret_cast(state); - - if (!context.Allocate()) - return false; - - *register_location = context.location(); - MDRawContextX86 *context_ptr = context.get(); - -#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ - REGISTER_FROM_THREADSTATE(machine_state, a)) - - context_ptr->context_flags = MD_CONTEXT_X86; - AddReg(eax); - AddReg(ebx); - AddReg(ecx); - AddReg(edx); - AddReg(esi); - AddReg(edi); - AddReg(ebp); - AddReg(esp); - - AddReg(cs); - AddReg(ds); - AddReg(ss); - AddReg(es); - AddReg(fs); - AddReg(gs); - AddReg(eflags); - - AddReg(eip); -#undef AddReg - - return true; -} - -bool MinidumpGenerator::WriteContextX86_64( - breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location) { - TypedMDRVA context(&writer_); - x86_thread_state64_t *machine_state = - reinterpret_cast(state); - - if (!context.Allocate()) - return false; - - *register_location = context.location(); - MDRawContextAMD64 *context_ptr = context.get(); - -#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \ - REGISTER_FROM_THREADSTATE(machine_state, a)) - - context_ptr->context_flags = MD_CONTEXT_AMD64; - AddReg(rax); - AddReg(rbx); - AddReg(rcx); - AddReg(rdx); - AddReg(rdi); - AddReg(rsi); - AddReg(rbp); - AddReg(rsp); - AddReg(r8); - AddReg(r9); - AddReg(r10); - AddReg(r11); - AddReg(r12); - AddReg(r13); - AddReg(r14); - AddReg(r15); - AddReg(rip); - // according to AMD's software developer guide, bits above 18 are - // not used in the flags register. Since the minidump format - // specifies 32 bits for the flags register, we can truncate safely - // with no loss. - context_ptr->eflags = static_cast(REGISTER_FROM_THREADSTATE(machine_state, rflags)); - AddReg(cs); - AddReg(fs); - AddReg(gs); -#undef AddReg - - return true; -} -#endif - -bool MinidumpGenerator::GetThreadState(thread_act_t target_thread, - thread_state_t state, - mach_msg_type_number_t *count) { - if (task_context_ && target_thread == mach_thread_self()) { - switch (cpu_type_) { -#ifdef HAS_ARM_SUPPORT - case CPU_TYPE_ARM: - size_t final_size = - std::min(static_cast(*count), sizeof(arm_thread_state_t)); - memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size); - *count = static_cast(final_size); - return true; -#endif -#ifdef HAS_ARM64_SUPPORT - case CPU_TYPE_ARM64: { - size_t final_size = - std::min(static_cast(*count), sizeof(arm_thread_state64_t)); - memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size); - *count = static_cast(final_size); - return true; - } -#endif -#ifdef HAS_X86_SUPPORT - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: { - size_t state_size = cpu_type_ == CPU_TYPE_I386 ? - sizeof(i386_thread_state_t) : sizeof(x86_thread_state64_t); - size_t final_size = - std::min(static_cast(*count), state_size); - memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size); - *count = static_cast(final_size); - return true; - } -#endif - } - } - - thread_state_flavor_t flavor; - switch (cpu_type_) { -#ifdef HAS_ARM_SUPPORT - case CPU_TYPE_ARM: - flavor = ARM_THREAD_STATE; - break; -#endif -#ifdef HAS_ARM64_SUPPORT - case CPU_TYPE_ARM64: - flavor = ARM_THREAD_STATE64; - break; -#endif -#ifdef HAS_PPC_SUPPORT - case CPU_TYPE_POWERPC: - flavor = PPC_THREAD_STATE; - break; - case CPU_TYPE_POWERPC64: - flavor = PPC_THREAD_STATE64; - break; -#endif -#ifdef HAS_X86_SUPPORT - case CPU_TYPE_I386: - flavor = i386_THREAD_STATE; - break; - case CPU_TYPE_X86_64: - flavor = x86_THREAD_STATE64; - break; -#endif - default: - return false; - } - return thread_get_state(target_thread, flavor, - state, count) == KERN_SUCCESS; -} - -bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id, - MDRawThread *thread) { - breakpad_thread_state_data_t state; - mach_msg_type_number_t state_count - = static_cast(sizeof(state)); - - if (GetThreadState(thread_id, state, &state_count)) { - if (!WriteStack(state, &thread->stack)) - return false; - - memory_blocks_.push_back(thread->stack); - - if (!WriteContext(state, &thread->thread_context)) - return false; - - thread->thread_id = thread_id; - } else { - return false; - } - - return true; -} - -bool MinidumpGenerator::WriteThreadListStream( - MDRawDirectory *thread_list_stream) { - TypedMDRVA list(&writer_); - thread_act_port_array_t threads_for_task; - mach_msg_type_number_t thread_count; - int non_generator_thread_count; - - if (task_threads(crashing_task_, &threads_for_task, &thread_count)) - return false; - - // Don't include the generator thread - if (handler_thread_ != MACH_PORT_NULL) - non_generator_thread_count = thread_count - 1; - else - non_generator_thread_count = thread_count; - if (!list.AllocateObjectAndArray(non_generator_thread_count, - sizeof(MDRawThread))) - return false; - - thread_list_stream->stream_type = MD_THREAD_LIST_STREAM; - thread_list_stream->location = list.location(); - - list.get()->number_of_threads = non_generator_thread_count; - - MDRawThread thread; - int thread_idx = 0; - - for (unsigned int i = 0; i < thread_count; ++i) { - memset(&thread, 0, sizeof(MDRawThread)); - - if (threads_for_task[i] != handler_thread_) { - if (!WriteThreadStream(threads_for_task[i], &thread)) - return false; - - list.CopyIndexAfterObject(thread_idx++, &thread, sizeof(MDRawThread)); - } - } - - return true; -} - -bool MinidumpGenerator::WriteMemoryListStream( - MDRawDirectory *memory_list_stream) { - TypedMDRVA list(&writer_); - - // If the dump has an exception, include some memory around the - // instruction pointer. - const size_t kIPMemorySize = 256; // bytes - bool have_ip_memory = false; - MDMemoryDescriptor ip_memory_d; - if (exception_thread_ && exception_type_) { - breakpad_thread_state_data_t state; - mach_msg_type_number_t stateCount - = static_cast(sizeof(state)); - - if (GetThreadState(exception_thread_, state, &stateCount)) { - uint64_t ip = CurrentPCForStack(state); - // Bound it to the upper and lower bounds of the region - // it's contained within. If it's not in a known memory region, - // don't bother trying to write it. - mach_vm_address_t addr = static_cast(ip); - mach_vm_size_t size; - natural_t nesting_level = 0; - vm_region_submap_info_64 info; - mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64; - vm_region_recurse_info_t recurse_info; - recurse_info = reinterpret_cast(&info); - - kern_return_t ret = - mach_vm_region_recurse(crashing_task_, - &addr, - &size, - &nesting_level, - recurse_info, - &info_count); - if (ret == KERN_SUCCESS && ip >= addr && ip < (addr + size)) { - // Try to get 128 bytes before and after the IP, but - // settle for whatever's available. - ip_memory_d.start_of_memory_range = - std::max(uintptr_t(addr), - uintptr_t(ip - (kIPMemorySize / 2))); - uintptr_t end_of_range = - std::min(uintptr_t(ip + (kIPMemorySize / 2)), - uintptr_t(addr + size)); - uintptr_t range_diff = end_of_range - - static_cast(ip_memory_d.start_of_memory_range); - ip_memory_d.memory.data_size = static_cast(range_diff); - have_ip_memory = true; - // This needs to get appended to the list even though - // the memory bytes aren't filled in yet so the entire - // list can be written first. The memory bytes will get filled - // in after the memory list is written. - memory_blocks_.push_back(ip_memory_d); - } - } - } - - // Now fill in the memory list and write it. - size_t memory_count = memory_blocks_.size(); - if (!list.AllocateObjectAndArray(memory_count, - sizeof(MDMemoryDescriptor))) - return false; - - memory_list_stream->stream_type = MD_MEMORY_LIST_STREAM; - memory_list_stream->location = list.location(); - - list.get()->number_of_memory_ranges = static_cast(memory_count); - - unsigned int i; - for (i = 0; i < memory_count; ++i) { - list.CopyIndexAfterObject(i, &memory_blocks_[i], - sizeof(MDMemoryDescriptor)); - } - - if (have_ip_memory) { - // Now read the memory around the instruction pointer. - UntypedMDRVA ip_memory(&writer_); - if (!ip_memory.Allocate(ip_memory_d.memory.data_size)) - return false; - - if (dynamic_images_) { - // Out-of-process. - vector memory; - if (ReadTaskMemory(crashing_task_, - ip_memory_d.start_of_memory_range, - ip_memory_d.memory.data_size, - memory) != KERN_SUCCESS) { - return false; - } - - ip_memory.Copy(&memory[0], ip_memory_d.memory.data_size); - } else { - // In-process, just copy from local memory. - ip_memory.Copy( - reinterpret_cast(ip_memory_d.start_of_memory_range), - ip_memory_d.memory.data_size); - } - - ip_memory_d.memory = ip_memory.location(); - // Write this again now that the data location is filled in. - list.CopyIndexAfterObject(i - 1, &ip_memory_d, - sizeof(MDMemoryDescriptor)); - } - - return true; -} - -bool -MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) { - TypedMDRVA exception(&writer_); - - if (!exception.Allocate()) - return false; - - exception_stream->stream_type = MD_EXCEPTION_STREAM; - exception_stream->location = exception.location(); - MDRawExceptionStream *exception_ptr = exception.get(); - exception_ptr->thread_id = exception_thread_; - - // This naming is confusing, but it is the proper translation from - // mach naming to minidump naming. - exception_ptr->exception_record.exception_code = exception_type_; - exception_ptr->exception_record.exception_flags = exception_code_; - - breakpad_thread_state_data_t state; - mach_msg_type_number_t state_count - = static_cast(sizeof(state)); - - if (!GetThreadState(exception_thread_, state, &state_count)) - return false; - - if (!WriteContext(state, &exception_ptr->thread_context)) - return false; - - if (exception_type_ == EXC_BAD_ACCESS) - exception_ptr->exception_record.exception_address = exception_subcode_; - else - exception_ptr->exception_record.exception_address = CurrentPCForStack(state); - - return true; -} - -bool MinidumpGenerator::WriteSystemInfoStream( - MDRawDirectory *system_info_stream) { - TypedMDRVA info(&writer_); - - if (!info.Allocate()) - return false; - - system_info_stream->stream_type = MD_SYSTEM_INFO_STREAM; - system_info_stream->location = info.location(); - - // CPU Information - uint32_t number_of_processors; - size_t len = sizeof(number_of_processors); - sysctlbyname("hw.ncpu", &number_of_processors, &len, NULL, 0); - MDRawSystemInfo *info_ptr = info.get(); - - switch (cpu_type_) { -#ifdef HAS_ARM_SUPPORT - case CPU_TYPE_ARM: - info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM; - break; -#endif -#ifdef HAS_ARM64_SUPPORT - case CPU_TYPE_ARM64: - info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64; - break; -#endif -#ifdef HAS_PPC_SUPPORT - case CPU_TYPE_POWERPC: - case CPU_TYPE_POWERPC64: - info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_PPC; - break; -#endif -#ifdef HAS_X86_SUPPORT - case CPU_TYPE_I386: - case CPU_TYPE_X86_64: - if (cpu_type_ == CPU_TYPE_I386) - info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_X86; - else - info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_AMD64; -#ifdef __i386__ - // ebx is used for PIC code, so we need - // to preserve it. -#define cpuid(op,eax,ebx,ecx,edx) \ - asm ("pushl %%ebx \n\t" \ - "cpuid \n\t" \ - "movl %%ebx,%1 \n\t" \ - "popl %%ebx" \ - : "=a" (eax), \ - "=g" (ebx), \ - "=c" (ecx), \ - "=d" (edx) \ - : "0" (op)) -#elif defined(__x86_64__) - -#define cpuid(op,eax,ebx,ecx,edx) \ - asm ("cpuid \n\t" \ - : "=a" (eax), \ - "=b" (ebx), \ - "=c" (ecx), \ - "=d" (edx) \ - : "0" (op)) -#endif - -#if defined(__i386__) || defined(__x86_64__) - int unused, unused2; - // get vendor id - cpuid(0, unused, info_ptr->cpu.x86_cpu_info.vendor_id[0], - info_ptr->cpu.x86_cpu_info.vendor_id[2], - info_ptr->cpu.x86_cpu_info.vendor_id[1]); - // get version and feature info - cpuid(1, info_ptr->cpu.x86_cpu_info.version_information, unused, unused2, - info_ptr->cpu.x86_cpu_info.feature_information); - - // family - info_ptr->processor_level = - (info_ptr->cpu.x86_cpu_info.version_information & 0xF00) >> 8; - // 0xMMSS (Model, Stepping) - info_ptr->processor_revision = static_cast( - (info_ptr->cpu.x86_cpu_info.version_information & 0xF) | - ((info_ptr->cpu.x86_cpu_info.version_information & 0xF0) << 4)); - - // decode extended model info - if (info_ptr->processor_level == 0xF || - info_ptr->processor_level == 0x6) { - info_ptr->processor_revision |= - ((info_ptr->cpu.x86_cpu_info.version_information & 0xF0000) >> 4); - } - - // decode extended family info - if (info_ptr->processor_level == 0xF) { - info_ptr->processor_level += - ((info_ptr->cpu.x86_cpu_info.version_information & 0xFF00000) >> 20); - } - -#endif // __i386__ || __x86_64_ - break; -#endif // HAS_X86_SUPPORT - default: - info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_UNKNOWN; - break; - } - - info_ptr->number_of_processors = static_cast(number_of_processors); -#if TARGET_OS_IPHONE - info_ptr->platform_id = MD_OS_IOS; -#else - info_ptr->platform_id = MD_OS_MAC_OS_X; -#endif // TARGET_OS_IPHONE - - MDLocationDescriptor build_string_loc; - - if (!writer_.WriteString(build_string_, 0, - &build_string_loc)) - return false; - - info_ptr->csd_version_rva = build_string_loc.rva; - info_ptr->major_version = os_major_version_; - info_ptr->minor_version = os_minor_version_; - info_ptr->build_number = os_build_number_; - - return true; -} - -bool MinidumpGenerator::WriteModuleStream(unsigned int index, - MDRawModule *module) { - if (dynamic_images_) { - // we're in a different process than the crashed process - DynamicImage *image = dynamic_images_->GetImage(index); - - if (!image) - return false; - - memset(module, 0, sizeof(MDRawModule)); - - MDLocationDescriptor string_location; - - string name = image->GetFilePath(); - if (!writer_.WriteString(name.c_str(), 0, &string_location)) - return false; - - module->base_of_image = image->GetVMAddr() + image->GetVMAddrSlide(); - module->size_of_image = static_cast(image->GetVMSize()); - module->module_name_rva = string_location.rva; - - // We'll skip the executable module, because they don't have - // LC_ID_DYLIB load commands, and the crash processing server gets - // version information from the Plist file, anyway. - if (index != static_cast(FindExecutableModule())) { - module->version_info.signature = MD_VSFIXEDFILEINFO_SIGNATURE; - module->version_info.struct_version |= MD_VSFIXEDFILEINFO_VERSION; - // Convert MAC dylib version format, which is a 32 bit number, to the - // format used by minidump. The mac format is <16 bits>.<8 bits>.<8 bits> - // so it fits nicely into the windows version with some massaging - // The mapping is: - // 1) upper 16 bits of MAC version go to lower 16 bits of product HI - // 2) Next most significant 8 bits go to upper 16 bits of product LO - // 3) Least significant 8 bits go to lower 16 bits of product LO - uint32_t modVersion = image->GetVersion(); - module->version_info.file_version_hi = 0; - module->version_info.file_version_hi = modVersion >> 16; - module->version_info.file_version_lo |= (modVersion & 0xff00) << 8; - module->version_info.file_version_lo |= (modVersion & 0xff); - } - - if (!WriteCVRecord(module, image->GetCPUType(), name.c_str(), false)) { - return false; - } - } else { - // Getting module info in the crashed process - const breakpad_mach_header *header; - header = (breakpad_mach_header*)_dyld_get_image_header(index); - if (!header) - return false; - -#ifdef __LP64__ - assert(header->magic == MH_MAGIC_64); - - if(header->magic != MH_MAGIC_64) - return false; -#else - assert(header->magic == MH_MAGIC); - - if(header->magic != MH_MAGIC) - return false; -#endif - - int cpu_type = header->cputype; - unsigned long slide = _dyld_get_image_vmaddr_slide(index); - const char* name = _dyld_get_image_name(index); - const struct load_command *cmd = - reinterpret_cast(header + 1); - - memset(module, 0, sizeof(MDRawModule)); - - for (unsigned int i = 0; cmd && (i < header->ncmds); i++) { - if (cmd->cmd == LC_SEGMENT_ARCH) { - - const breakpad_mach_segment_command *seg = - reinterpret_cast(cmd); - - if (!strcmp(seg->segname, "__TEXT")) { - MDLocationDescriptor string_location; - - if (!writer_.WriteString(name, 0, &string_location)) - return false; - - module->base_of_image = seg->vmaddr + slide; - module->size_of_image = static_cast(seg->vmsize); - module->module_name_rva = string_location.rva; - - bool in_memory = false; -#if TARGET_OS_IPHONE - in_memory = true; -#endif - if (!WriteCVRecord(module, cpu_type, name, in_memory)) - return false; - - return true; - } - } - - cmd = reinterpret_cast((char *)cmd + cmd->cmdsize); - } - } - - return true; -} - -int MinidumpGenerator::FindExecutableModule() { - if (dynamic_images_) { - int index = dynamic_images_->GetExecutableImageIndex(); - - if (index >= 0) { - return index; - } - } else { - int image_count = _dyld_image_count(); - const struct mach_header *header; - - for (int index = 0; index < image_count; ++index) { - header = _dyld_get_image_header(index); - - if (header->filetype == MH_EXECUTE) - return index; - } - } - - // failed - just use the first image - return 0; -} - -bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type, - const char *module_path, bool in_memory) { - TypedMDRVA cv(&writer_); - - // Only return the last path component of the full module path - const char *module_name = strrchr(module_path, '/'); - - // Increment past the slash - if (module_name) - ++module_name; - else - module_name = ""; - - size_t module_name_length = strlen(module_name); - - if (!cv.AllocateObjectAndArray(module_name_length + 1, sizeof(uint8_t))) - return false; - - if (!cv.CopyIndexAfterObject(0, module_name, module_name_length)) - return false; - - module->cv_record = cv.location(); - MDCVInfoPDB70 *cv_ptr = cv.get(); - cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE; - cv_ptr->age = 0; - - // Get the module identifier - unsigned char identifier[16]; - bool result = false; - if (in_memory) { - MacFileUtilities::MachoID macho(module_path, - reinterpret_cast(module->base_of_image), - static_cast(module->size_of_image)); - result = macho.UUIDCommand(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier); - if (!result) - result = macho.MD5(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier); - } - - if (!result) { - FileID file_id(module_path); - result = file_id.MachoIdentifier(cpu_type, CPU_SUBTYPE_MULTIPLE, - identifier); - } - - if (result) { - cv_ptr->signature.data1 = - static_cast(identifier[0]) << 24 | - static_cast(identifier[1]) << 16 | - static_cast(identifier[2]) << 8 | - static_cast(identifier[3]); - cv_ptr->signature.data2 = - static_cast(identifier[4] << 8) | identifier[5]; - cv_ptr->signature.data3 = - static_cast(identifier[6] << 8) | identifier[7]; - cv_ptr->signature.data4[0] = identifier[8]; - cv_ptr->signature.data4[1] = identifier[9]; - cv_ptr->signature.data4[2] = identifier[10]; - cv_ptr->signature.data4[3] = identifier[11]; - cv_ptr->signature.data4[4] = identifier[12]; - cv_ptr->signature.data4[5] = identifier[13]; - cv_ptr->signature.data4[6] = identifier[14]; - cv_ptr->signature.data4[7] = identifier[15]; - } - - return true; -} - -bool MinidumpGenerator::WriteModuleListStream( - MDRawDirectory *module_list_stream) { - TypedMDRVA list(&writer_); - - uint32_t image_count = dynamic_images_ ? - dynamic_images_->GetImageCount() : - _dyld_image_count(); - - if (!list.AllocateObjectAndArray(image_count, MD_MODULE_SIZE)) - return false; - - module_list_stream->stream_type = MD_MODULE_LIST_STREAM; - module_list_stream->location = list.location(); - list.get()->number_of_modules = static_cast(image_count); - - // Write out the executable module as the first one - MDRawModule module; - uint32_t executableIndex = FindExecutableModule(); - - if (!WriteModuleStream(static_cast(executableIndex), &module)) { - return false; - } - - list.CopyIndexAfterObject(0, &module, MD_MODULE_SIZE); - int destinationIndex = 1; // Write all other modules after this one - - for (uint32_t i = 0; i < image_count; ++i) { - if (i != executableIndex) { - if (!WriteModuleStream(static_cast(i), &module)) { - return false; - } - - list.CopyIndexAfterObject(destinationIndex++, &module, MD_MODULE_SIZE); - } - } - - return true; -} - -bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) { - TypedMDRVA info(&writer_); - - if (!info.Allocate()) - return false; - - misc_info_stream->stream_type = MD_MISC_INFO_STREAM; - misc_info_stream->location = info.location(); - - MDRawMiscInfo *info_ptr = info.get(); - info_ptr->size_of_info = static_cast(sizeof(MDRawMiscInfo)); - info_ptr->flags1 = MD_MISCINFO_FLAGS1_PROCESS_ID | - MD_MISCINFO_FLAGS1_PROCESS_TIMES | - MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO; - - // Process ID - info_ptr->process_id = getpid(); - - // Times - struct rusage usage; - if (getrusage(RUSAGE_SELF, &usage) != -1) { - // Omit the fractional time since the MDRawMiscInfo only wants seconds - info_ptr->process_user_time = - static_cast(usage.ru_utime.tv_sec); - info_ptr->process_kernel_time = - static_cast(usage.ru_stime.tv_sec); - } - int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, - static_cast(info_ptr->process_id) }; - uint mibsize = static_cast(sizeof(mib) / sizeof(mib[0])); - struct kinfo_proc proc; - size_t size = sizeof(proc); - if (sysctl(mib, mibsize, &proc, &size, NULL, 0) == 0) { - info_ptr->process_create_time = - static_cast(proc.kp_proc.p_starttime.tv_sec); - } - - // Speed - uint64_t speed; - const uint64_t kOneMillion = 1000 * 1000; - size = sizeof(speed); - sysctlbyname("hw.cpufrequency_max", &speed, &size, NULL, 0); - info_ptr->processor_max_mhz = static_cast(speed / kOneMillion); - info_ptr->processor_mhz_limit = static_cast(speed / kOneMillion); - size = sizeof(speed); - sysctlbyname("hw.cpufrequency", &speed, &size, NULL, 0); - info_ptr->processor_current_mhz = static_cast(speed / kOneMillion); - - return true; -} - -bool MinidumpGenerator::WriteBreakpadInfoStream( - MDRawDirectory *breakpad_info_stream) { - TypedMDRVA info(&writer_); - - if (!info.Allocate()) - return false; - - breakpad_info_stream->stream_type = MD_BREAKPAD_INFO_STREAM; - breakpad_info_stream->location = info.location(); - MDRawBreakpadInfo *info_ptr = info.get(); - - if (exception_thread_ && exception_type_) { - info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID | - MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID; - info_ptr->dump_thread_id = handler_thread_; - info_ptr->requesting_thread_id = exception_thread_; - } else { - info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID; - info_ptr->dump_thread_id = handler_thread_; - info_ptr->requesting_thread_id = 0; - } - - return true; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h b/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h deleted file mode 100644 index 4e4b4a6848..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/minidump_generator.h +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// minidump_generator.h: Create a minidump of the current MacOS process. - -#ifndef CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__ -#define CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__ - -#include -#include - -#include - -#include "client/mac/handler/ucontext_compat.h" -#include "client/minidump_file_writer.h" -#include "common/memory.h" -#include "common/mac/macho_utilities.h" -#include "google_breakpad/common/minidump_format.h" - -#include "dynamic_images.h" -#include "mach_vm_compat.h" - -#if !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) - #define HAS_PPC_SUPPORT -#endif -#if defined(__arm__) -#define HAS_ARM_SUPPORT -#elif defined(__aarch64__) -#define HAS_ARM64_SUPPORT -#elif defined(__i386__) || defined(__x86_64__) - #define HAS_X86_SUPPORT -#endif - -namespace google_breakpad { - -using std::string; - -// Use the REGISTER_FROM_THREADSTATE to access a register name from the -// breakpad_thread_state_t structure. -#if __DARWIN_UNIX03 || TARGET_CPU_X86_64 || TARGET_CPU_PPC64 || TARGET_CPU_ARM -// In The 10.5 SDK Headers Apple prepended __ to the variable names in the -// i386_thread_state_t structure. There's no good way to tell what version of -// the SDK we're compiling against so we just toggle on the same preprocessor -// symbol Apple's headers use. -#define REGISTER_FROM_THREADSTATE(a, b) ((a)->__ ## b) -#else -#define REGISTER_FROM_THREADSTATE(a, b) (a->b) -#endif - -// Creates a minidump file of the current process. If there is exception data, -// use SetExceptionInformation() to add this to the minidump. The minidump -// file is generated by the Write() function. -// Usage: -// MinidumpGenerator minidump(); -// minidump.Write("/tmp/minidump"); -// -class MinidumpGenerator { - public: - MinidumpGenerator(); - MinidumpGenerator(mach_port_t crashing_task, mach_port_t handler_thread); - - virtual ~MinidumpGenerator(); - - // Return /.dmp - // Sets |unique_name| (if requested) to the unique name for the minidump - static string UniqueNameInDirectory(const string &dir, string *unique_name); - - // Write out the minidump into |path| - // All of the components of |path| must exist and be writable - // Return true if successful, false otherwise - bool Write(const char *path); - - // Specify some exception information, if applicable - void SetExceptionInformation(int type, int code, int subcode, - mach_port_t thread_name) { - exception_type_ = type; - exception_code_ = code; - exception_subcode_ = subcode; - exception_thread_ = thread_name; - } - - // Specify the task context. If |task_context| is not NULL, it will be used - // to retrieve the context of the current thread, instead of using - // |thread_get_state|. - void SetTaskContext(breakpad_ucontext_t *task_context); - - // Gather system information. This should be call at least once before using - // the MinidumpGenerator class. - static void GatherSystemInformation(); - - protected: - // Overridable Stream writers - virtual bool WriteExceptionStream(MDRawDirectory *exception_stream); - - // Overridable Helper - virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread); - - private: - typedef bool (MinidumpGenerator::*WriteStreamFN)(MDRawDirectory *); - - // Stream writers - bool WriteThreadListStream(MDRawDirectory *thread_list_stream); - bool WriteMemoryListStream(MDRawDirectory *memory_list_stream); - bool WriteSystemInfoStream(MDRawDirectory *system_info_stream); - bool WriteModuleListStream(MDRawDirectory *module_list_stream); - bool WriteMiscInfoStream(MDRawDirectory *misc_info_stream); - bool WriteBreakpadInfoStream(MDRawDirectory *breakpad_info_stream); - - // Helpers - uint64_t CurrentPCForStack(breakpad_thread_state_data_t state); - bool GetThreadState(thread_act_t target_thread, thread_state_t state, - mach_msg_type_number_t *count); - bool WriteStackFromStartAddress(mach_vm_address_t start_addr, - MDMemoryDescriptor *stack_location); - bool WriteStack(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContext(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - bool WriteCVRecord(MDRawModule *module, int cpu_type, - const char *module_path, bool in_memory); - bool WriteModuleStream(unsigned int index, MDRawModule *module); - size_t CalculateStackSize(mach_vm_address_t start_addr); - int FindExecutableModule(); - - // Per-CPU implementations of these methods -#ifdef HAS_ARM_SUPPORT - bool WriteStackARM(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContextARM(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - uint64_t CurrentPCForStackARM(breakpad_thread_state_data_t state); -#endif -#ifdef HAS_ARM64_SUPPORT - bool WriteStackARM64(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContextARM64(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - uint64_t CurrentPCForStackARM64(breakpad_thread_state_data_t state); -#endif -#ifdef HAS_PPC_SUPPORT - bool WriteStackPPC(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContextPPC(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - uint64_t CurrentPCForStackPPC(breakpad_thread_state_data_t state); - bool WriteStackPPC64(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContextPPC64(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - uint64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state); -#endif -#ifdef HAS_X86_SUPPORT - bool WriteStackX86(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContextX86(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - uint64_t CurrentPCForStackX86(breakpad_thread_state_data_t state); - bool WriteStackX86_64(breakpad_thread_state_data_t state, - MDMemoryDescriptor *stack_location); - bool WriteContextX86_64(breakpad_thread_state_data_t state, - MDLocationDescriptor *register_location); - uint64_t CurrentPCForStackX86_64(breakpad_thread_state_data_t state); -#endif - - // disallow copy ctor and operator= - explicit MinidumpGenerator(const MinidumpGenerator &); - void operator=(const MinidumpGenerator &); - - protected: - // Use this writer to put the data to disk - MinidumpFileWriter writer_; - - private: - // Exception information - int exception_type_; - int exception_code_; - int exception_subcode_; - mach_port_t exception_thread_; - mach_port_t crashing_task_; - mach_port_t handler_thread_; - - // CPU type of the task being dumped. - cpu_type_t cpu_type_; - - // System information - static char build_string_[16]; - static int os_major_version_; - static int os_minor_version_; - static int os_build_number_; - - // Context of the task to dump. - breakpad_ucontext_t *task_context_; - - // Information about dynamically loaded code - DynamicImages *dynamic_images_; - - // PageAllocator makes it possible to allocate memory - // directly from the system, even while handling an exception. - mutable PageAllocator allocator_; - - protected: - // Blocks of memory written to the dump. These are all currently - // written while writing the thread list stream, but saved here - // so a memory list stream can be written afterwards. - wasteful_vector memory_blocks_; -}; - -} // namespace google_breakpad - -#endif // CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__ diff --git a/Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h b/Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h deleted file mode 100644 index 1e4b752e51..0000000000 --- a/Telegram/ThirdParty/breakpad/client/mac/handler/ucontext_compat.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2013 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ -#define CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ - -#include - -// The purpose of this file is to work around the fact that ucontext_t's -// uc_mcontext member is an mcontext_t rather than an mcontext64_t on ARM64. -#if defined(__aarch64__) -// doesn't include the below file. -#include -typedef ucontext64_t breakpad_ucontext_t; -#define breakpad_uc_mcontext uc_mcontext64 -#else -typedef ucontext_t breakpad_ucontext_t; -#define breakpad_uc_mcontext uc_mcontext -#endif // defined(__aarch64__) - -#endif // CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h b/Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h deleted file mode 100644 index 0e12e00b69..0000000000 --- a/Telegram/ThirdParty/breakpad/client/minidump_file_writer-inl.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// minidump_file_writer-inl.h: Minidump file writer implementation. -// -// See minidump_file_writer.h for documentation. - -#ifndef CLIENT_MINIDUMP_FILE_WRITER_INL_H__ -#define CLIENT_MINIDUMP_FILE_WRITER_INL_H__ - -#include - -#include "client/minidump_file_writer.h" -#include "google_breakpad/common/minidump_size.h" - -namespace google_breakpad { - -template -inline bool TypedMDRVA::Allocate() { - allocation_state_ = SINGLE_OBJECT; - return UntypedMDRVA::Allocate(minidump_size::size()); -} - -template -inline bool TypedMDRVA::Allocate(size_t additional) { - allocation_state_ = SINGLE_OBJECT; - return UntypedMDRVA::Allocate(minidump_size::size() + additional); -} - -template -inline bool TypedMDRVA::AllocateArray(size_t count) { - assert(count); - allocation_state_ = ARRAY; - return UntypedMDRVA::Allocate(minidump_size::size() * count); -} - -template -inline bool TypedMDRVA::AllocateObjectAndArray(size_t count, - size_t length) { - assert(count && length); - allocation_state_ = SINGLE_OBJECT_WITH_ARRAY; - return UntypedMDRVA::Allocate(minidump_size::size() + count * length); -} - -template -inline bool TypedMDRVA::CopyIndex(unsigned int index, MDType *item) { - assert(allocation_state_ == ARRAY); - return writer_->Copy( - static_cast(position_ + index * minidump_size::size()), - item, minidump_size::size()); -} - -template -inline bool TypedMDRVA::CopyIndexAfterObject(unsigned int index, - const void *src, - size_t length) { - assert(allocation_state_ == SINGLE_OBJECT_WITH_ARRAY); - return writer_->Copy( - static_cast(position_ + minidump_size::size() - + index * length), - src, length); -} - -template -inline bool TypedMDRVA::Flush() { - return writer_->Copy(position_, &data_, minidump_size::size()); -} - -} // namespace google_breakpad - -#endif // CLIENT_MINIDUMP_FILE_WRITER_INL_H__ diff --git a/Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc b/Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc deleted file mode 100644 index a1957f324a..0000000000 --- a/Telegram/ThirdParty/breakpad/client/minidump_file_writer.cc +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// minidump_file_writer.cc: Minidump file writer implementation. -// -// See minidump_file_writer.h for documentation. - -#include -#include -#include -#include -#include - -#include "client/minidump_file_writer-inl.h" -#include "common/linux/linux_libc_support.h" -#include "common/string_conversion.h" -#if defined(__linux__) && __linux__ -#include "third_party/lss/linux_syscall_support.h" -#endif - -#if defined(__ANDROID__) -#include - -namespace { - -bool g_need_ftruncate_workaround = false; -bool g_checked_need_ftruncate_workaround = false; - -void CheckNeedsFTruncateWorkAround(int file) { - if (g_checked_need_ftruncate_workaround) { - return; - } - g_checked_need_ftruncate_workaround = true; - - // Attempt an idempotent truncate that chops off nothing and see if we - // run into any sort of errors. - off_t offset = sys_lseek(file, 0, SEEK_END); - if (offset == -1) { - // lseek failed. Don't apply work around. It's unlikely that we can write - // to a minidump with either method. - return; - } - - int result = ftruncate(file, offset); - if (result == -1 && errno == EACCES) { - // It very likely that we are running into the kernel bug in M devices. - // We are going to deploy the workaround for writing minidump files - // without uses of ftruncate(). This workaround should be fine even - // for kernels without the bug. - // See http://crbug.com/542840 for more details. - g_need_ftruncate_workaround = true; - } -} - -bool NeedsFTruncateWorkAround() { - return g_need_ftruncate_workaround; -} - -} // namespace -#endif // defined(__ANDROID__) - -namespace google_breakpad { - -const MDRVA MinidumpFileWriter::kInvalidMDRVA = static_cast(-1); - -MinidumpFileWriter::MinidumpFileWriter() - : file_(-1), - close_file_when_destroyed_(true), - position_(0), - size_(0) { -} - -MinidumpFileWriter::~MinidumpFileWriter() { - if (close_file_when_destroyed_) - Close(); -} - -bool MinidumpFileWriter::Open(const char *path) { - assert(file_ == -1); -#if defined(__linux__) && __linux__ - file_ = sys_open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); -#else - file_ = open(path, O_WRONLY | O_CREAT | O_EXCL, 0600); -#endif - - return file_ != -1; -} - -void MinidumpFileWriter::SetFile(const int file) { - assert(file_ == -1); - file_ = file; - close_file_when_destroyed_ = false; -#if defined(__ANDROID__) - CheckNeedsFTruncateWorkAround(file); -#endif -} - -bool MinidumpFileWriter::Close() { - bool result = true; - - if (file_ != -1) { -#if defined(__ANDROID__) - if (!NeedsFTruncateWorkAround() && ftruncate(file_, position_)) { - return false; - } -#else - if (ftruncate(file_, position_)) { - return false; - } -#endif -#if defined(__linux__) && __linux__ - result = (sys_close(file_) == 0); -#else - result = (close(file_) == 0); -#endif - file_ = -1; - } - - return result; -} - -bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str, - unsigned int length, - TypedMDRVA *mdstring) { - bool result = true; - if (sizeof(wchar_t) == sizeof(uint16_t)) { - // Shortcut if wchar_t is the same size as MDString's buffer - result = mdstring->Copy(str, mdstring->get()->length); - } else { - uint16_t out[2]; - int out_idx = 0; - - // Copy the string character by character - while (length && result) { - UTF32ToUTF16Char(*str, out); - if (!out[0]) - return false; - - // Process one character at a time - --length; - ++str; - - // Append the one or two UTF-16 characters. The first one will be non- - // zero, but the second one may be zero, depending on the conversion from - // UTF-32. - int out_count = out[1] ? 2 : 1; - size_t out_size = sizeof(uint16_t) * out_count; - result = mdstring->CopyIndexAfterObject(out_idx, out, out_size); - out_idx += out_count; - } - } - return result; -} - -bool MinidumpFileWriter::CopyStringToMDString(const char *str, - unsigned int length, - TypedMDRVA *mdstring) { - bool result = true; - uint16_t out[2]; - int out_idx = 0; - - // Copy the string character by character - while (length && result) { - int conversion_count = UTF8ToUTF16Char(str, length, out); - if (!conversion_count) - return false; - - // Move the pointer along based on the nubmer of converted characters - length -= conversion_count; - str += conversion_count; - - // Append the one or two UTF-16 characters - int out_count = out[1] ? 2 : 1; - size_t out_size = sizeof(uint16_t) * out_count; - result = mdstring->CopyIndexAfterObject(out_idx, out, out_size); - out_idx += out_count; - } - return result; -} - -template -bool MinidumpFileWriter::WriteStringCore(const CharType *str, - unsigned int length, - MDLocationDescriptor *location) { - assert(str); - assert(location); - // Calculate the mdstring length by either limiting to |length| as passed in - // or by finding the location of the NULL character. - unsigned int mdstring_length = 0; - if (!length) - length = INT_MAX; - for (; mdstring_length < length && str[mdstring_length]; ++mdstring_length) - ; - - // Allocate the string buffer - TypedMDRVA mdstring(this); - if (!mdstring.AllocateObjectAndArray(mdstring_length + 1, sizeof(uint16_t))) - return false; - - // Set length excluding the NULL and copy the string - mdstring.get()->length = - static_cast(mdstring_length * sizeof(uint16_t)); - bool result = CopyStringToMDString(str, mdstring_length, &mdstring); - - // NULL terminate - if (result) { - uint16_t ch = 0; - result = mdstring.CopyIndexAfterObject(mdstring_length, &ch, sizeof(ch)); - - if (result) - *location = mdstring.location(); - } - - return result; -} - -bool MinidumpFileWriter::WriteString(const wchar_t *str, unsigned int length, - MDLocationDescriptor *location) { - return WriteStringCore(str, length, location); -} - -bool MinidumpFileWriter::WriteString(const char *str, unsigned int length, - MDLocationDescriptor *location) { - return WriteStringCore(str, length, location); -} - -bool MinidumpFileWriter::WriteMemory(const void *src, size_t size, - MDMemoryDescriptor *output) { - assert(src); - assert(output); - UntypedMDRVA mem(this); - - if (!mem.Allocate(size)) - return false; - if (!mem.Copy(src, mem.size())) - return false; - - output->start_of_memory_range = reinterpret_cast(src); - output->memory = mem.location(); - - return true; -} - -MDRVA MinidumpFileWriter::Allocate(size_t size) { - assert(size); - assert(file_ != -1); -#if defined(__ANDROID__) - if (NeedsFTruncateWorkAround()) { - // If ftruncate() is not available. We simply increase the size beyond the - // current file size. sys_write() will expand the file when data is written - // to it. Because we did not over allocate to fit memory pages, we also - // do not need to ftruncate() the file once we are done. - size_ += size; - - // We don't need to seek since the file is unchanged. - MDRVA current_position = position_; - position_ += static_cast(size); - return current_position; - } -#endif - size_t aligned_size = (size + 7) & ~7; // 64-bit alignment - - if (position_ + aligned_size > size_) { - size_t growth = aligned_size; - size_t minimal_growth = getpagesize(); - - // Ensure that the file grows by at least the size of a memory page - if (growth < minimal_growth) - growth = minimal_growth; - - size_t new_size = size_ + growth; - if (ftruncate(file_, new_size) != 0) - return kInvalidMDRVA; - - size_ = new_size; - } - - MDRVA current_position = position_; - position_ += static_cast(aligned_size); - - return current_position; -} - -bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) { - assert(src); - assert(size); - assert(file_ != -1); - - // Ensure that the data will fit in the allocated space - if (static_cast(size + position) > size_) - return false; - - // Seek and write the data -#if defined(__linux__) && __linux__ - if (sys_lseek(file_, position, SEEK_SET) == static_cast(position)) { - if (sys_write(file_, src, size) == size) { - return true; - } - } -#else - if (lseek(file_, position, SEEK_SET) == static_cast(position)) { - if (write(file_, src, size) == size) { - return true; - } - } -#endif - return false; -} - -bool UntypedMDRVA::Allocate(size_t size) { - assert(size_ == 0); - size_ = size; - position_ = writer_->Allocate(size_); - return position_ != MinidumpFileWriter::kInvalidMDRVA; -} - -bool UntypedMDRVA::Copy(MDRVA pos, const void *src, size_t size) { - assert(src); - assert(size); - assert(pos + size <= position_ + size_); - return writer_->Copy(pos, src, size); -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/minidump_file_writer.h b/Telegram/ThirdParty/breakpad/client/minidump_file_writer.h deleted file mode 100644 index ce32b6d087..0000000000 --- a/Telegram/ThirdParty/breakpad/client/minidump_file_writer.h +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// minidump_file_writer.h: Implements file-based minidump generation. It's -// intended to be used with the Google Breakpad open source crash handling -// project. - -#ifndef CLIENT_MINIDUMP_FILE_WRITER_H__ -#define CLIENT_MINIDUMP_FILE_WRITER_H__ - -#include - -#include "google_breakpad/common/minidump_format.h" - -namespace google_breakpad { - -class UntypedMDRVA; -template class TypedMDRVA; - -// The user of this class can Open() a file and add minidump streams, data, and -// strings using the definitions in minidump_format.h. Since this class is -// expected to be used in a situation where the current process may be -// damaged, it will not allocate heap memory. -// Sample usage: -// MinidumpFileWriter writer; -// writer.Open("/tmp/minidump.dmp"); -// TypedMDRVA header(&writer_); -// header.Allocate(); -// header->get()->signature = MD_HEADER_SIGNATURE; -// : -// writer.Close(); -// -// An alternative is to use SetFile and provide a file descriptor: -// MinidumpFileWriter writer; -// writer.SetFile(minidump_fd); -// TypedMDRVA header(&writer_); -// header.Allocate(); -// header->get()->signature = MD_HEADER_SIGNATURE; -// : -// writer.Close(); - -class MinidumpFileWriter { -public: - // Invalid MDRVA (Minidump Relative Virtual Address) - // returned on failed allocation - static const MDRVA kInvalidMDRVA; - - MinidumpFileWriter(); - ~MinidumpFileWriter(); - - // Open |path| as the destination of the minidump data. If |path| already - // exists, then Open() will fail. - // Return true on success, or false on failure. - bool Open(const char *path); - - // Sets the file descriptor |file| as the destination of the minidump data. - // Can be used as an alternative to Open() when a file descriptor is - // available. - // Note that |fd| is not closed when the instance of MinidumpFileWriter is - // destroyed. - void SetFile(const int file); - - // Close the current file (that was either created when Open was called, or - // specified with SetFile). - // Return true on success, or false on failure. - bool Close(); - - // Copy the contents of |str| to a MDString and write it to the file. - // |str| is expected to be either UTF-16 or UTF-32 depending on the size - // of wchar_t. - // Maximum |length| of characters to copy from |str|, or specify 0 to use the - // entire NULL terminated string. Copying will stop at the first NULL. - // |location| the allocated location - // Return true on success, or false on failure - bool WriteString(const wchar_t *str, unsigned int length, - MDLocationDescriptor *location); - - // Same as above, except with |str| as a UTF-8 string - bool WriteString(const char *str, unsigned int length, - MDLocationDescriptor *location); - - // Write |size| bytes starting at |src| into the current position. - // Return true on success and set |output| to position, or false on failure - bool WriteMemory(const void *src, size_t size, MDMemoryDescriptor *output); - - // Copies |size| bytes from |src| to |position| - // Return true on success, or false on failure - bool Copy(MDRVA position, const void *src, ssize_t size); - - // Return the current position for writing to the minidump - inline MDRVA position() const { return position_; } - - private: - friend class UntypedMDRVA; - - // Allocates an area of |size| bytes. - // Returns the position of the allocation, or kInvalidMDRVA if it was - // unable to allocate the bytes. - MDRVA Allocate(size_t size); - - // The file descriptor for the output file. - int file_; - - // Whether |file_| should be closed when the instance is destroyed. - bool close_file_when_destroyed_; - - // Current position in buffer - MDRVA position_; - - // Current allocated size - size_t size_; - - // Copy |length| characters from |str| to |mdstring|. These are distinct - // because the underlying MDString is a UTF-16 based string. The wchar_t - // variant may need to create a MDString that has more characters than the - // source |str|, whereas the UTF-8 variant may coalesce characters to form - // a single UTF-16 character. - bool CopyStringToMDString(const wchar_t *str, unsigned int length, - TypedMDRVA *mdstring); - bool CopyStringToMDString(const char *str, unsigned int length, - TypedMDRVA *mdstring); - - // The common templated code for writing a string - template - bool WriteStringCore(const CharType *str, unsigned int length, - MDLocationDescriptor *location); -}; - -// Represents an untyped allocated chunk -class UntypedMDRVA { - public: - explicit UntypedMDRVA(MinidumpFileWriter *writer) - : writer_(writer), - position_(writer->position()), - size_(0) {} - - // Allocates |size| bytes. Must not call more than once. - // Return true on success, or false on failure - bool Allocate(size_t size); - - // Returns the current position or kInvalidMDRVA if allocation failed - inline MDRVA position() const { return position_; } - - // Number of bytes allocated - inline size_t size() const { return size_; } - - // Return size and position - inline MDLocationDescriptor location() const { - MDLocationDescriptor location = { static_cast(size_), - position_ }; - return location; - } - - // Copy |size| bytes starting at |src| into the minidump at |position| - // Return true on success, or false on failure - bool Copy(MDRVA position, const void *src, size_t size); - - // Copy |size| bytes from |src| to the current position - inline bool Copy(const void *src, size_t size) { - return Copy(position_, src, size); - } - - protected: - // Writer we associate with - MinidumpFileWriter *writer_; - - // Position of the start of the data - MDRVA position_; - - // Allocated size - size_t size_; -}; - -// Represents a Minidump object chunk. Additional memory can be allocated at -// the end of the object as a: -// - single allocation -// - Array of MDType objects -// - A MDType object followed by an array -template -class TypedMDRVA : public UntypedMDRVA { - public: - // Constructs an unallocated MDRVA - explicit TypedMDRVA(MinidumpFileWriter *writer) - : UntypedMDRVA(writer), - data_(), - allocation_state_(UNALLOCATED) {} - - inline ~TypedMDRVA() { - // Ensure that the data_ object is written out - if (allocation_state_ != ARRAY) - Flush(); - } - - // Address of object data_ of MDType. This is not declared const as the - // typical usage will be to access the underlying |data_| object as to - // alter its contents. - MDType *get() { return &data_; } - - // Allocates minidump_size::size() bytes. - // Must not call more than once. - // Return true on success, or false on failure - bool Allocate(); - - // Allocates minidump_size::size() + |additional| bytes. - // Must not call more than once. - // Return true on success, or false on failure - bool Allocate(size_t additional); - - // Allocate an array of |count| elements of MDType. - // Must not call more than once. - // Return true on success, or false on failure - bool AllocateArray(size_t count); - - // Allocate an array of |count| elements of |size| after object of MDType - // Must not call more than once. - // Return true on success, or false on failure - bool AllocateObjectAndArray(size_t count, size_t size); - - // Copy |item| to |index| - // Must have been allocated using AllocateArray(). - // Return true on success, or false on failure - bool CopyIndex(unsigned int index, MDType *item); - - // Copy |size| bytes starting at |str| to |index| - // Must have been allocated using AllocateObjectAndArray(). - // Return true on success, or false on failure - bool CopyIndexAfterObject(unsigned int index, const void *src, size_t size); - - // Write data_ - bool Flush(); - - private: - enum AllocationState { - UNALLOCATED = 0, - SINGLE_OBJECT, - ARRAY, - SINGLE_OBJECT_WITH_ARRAY - }; - - MDType data_; - AllocationState allocation_state_; -}; - -} // namespace google_breakpad - -#endif // CLIENT_MINIDUMP_FILE_WRITER_H__ diff --git a/Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h b/Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h deleted file mode 100644 index c74868198c..0000000000 --- a/Telegram/ThirdParty/breakpad/client/windows/common/ipc_protocol.h +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__ -#define CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__ - -#include -#include -#include -#include -#include "common/windows/string_utils-inl.h" -#include "google_breakpad/common/minidump_format.h" - -namespace google_breakpad { - -// Name/value pair for custom client information. -struct CustomInfoEntry { - // Maximum length for name and value for client custom info. - static const int kNameMaxLength = 64; - static const int kValueMaxLength = 64; - - CustomInfoEntry() { - // Putting name and value in initializer list makes VC++ show warning 4351. - set_name(NULL); - set_value(NULL); - } - - CustomInfoEntry(const wchar_t* name_arg, const wchar_t* value_arg) { - set_name(name_arg); - set_value(value_arg); - } - - void set_name(const wchar_t* name_arg) { - if (!name_arg) { - name[0] = L'\0'; - return; - } - WindowsStringUtils::safe_wcscpy(name, kNameMaxLength, name_arg); - } - - void set_value(const wchar_t* value_arg) { - if (!value_arg) { - value[0] = L'\0'; - return; - } - - WindowsStringUtils::safe_wcscpy(value, kValueMaxLength, value_arg); - } - - void set(const wchar_t* name_arg, const wchar_t* value_arg) { - set_name(name_arg); - set_value(value_arg); - } - - wchar_t name[kNameMaxLength]; - wchar_t value[kValueMaxLength]; -}; - -// Constants for the protocol between client and the server. - -// Tags sent with each message indicating the purpose of -// the message. -enum MessageTag { - MESSAGE_TAG_NONE = 0, - MESSAGE_TAG_REGISTRATION_REQUEST = 1, - MESSAGE_TAG_REGISTRATION_RESPONSE = 2, - MESSAGE_TAG_REGISTRATION_ACK = 3, - MESSAGE_TAG_UPLOAD_REQUEST = 4 -}; - -struct CustomClientInfo { - const CustomInfoEntry* entries; - size_t count; -}; - -// Message structure for IPC between crash client and crash server. -struct ProtocolMessage { - ProtocolMessage() - : tag(MESSAGE_TAG_NONE), - id(0), - dump_type(MiniDumpNormal), - thread_id(0), - exception_pointers(NULL), - assert_info(NULL), - custom_client_info(), - dump_request_handle(NULL), - dump_generated_handle(NULL), - server_alive_handle(NULL) { - } - - // Creates an instance with the given parameters. - ProtocolMessage(MessageTag arg_tag, - DWORD arg_id, - MINIDUMP_TYPE arg_dump_type, - DWORD* arg_thread_id, - EXCEPTION_POINTERS** arg_exception_pointers, - MDRawAssertionInfo* arg_assert_info, - const CustomClientInfo& custom_info, - HANDLE arg_dump_request_handle, - HANDLE arg_dump_generated_handle, - HANDLE arg_server_alive) - : tag(arg_tag), - id(arg_id), - dump_type(arg_dump_type), - thread_id(arg_thread_id), - exception_pointers(arg_exception_pointers), - assert_info(arg_assert_info), - custom_client_info(custom_info), - dump_request_handle(arg_dump_request_handle), - dump_generated_handle(arg_dump_generated_handle), - server_alive_handle(arg_server_alive) { - } - - // Tag in the message. - MessageTag tag; - - // The id for this message. This may be either a process id or a crash id - // depending on the type of message. - DWORD id; - - // Dump type requested. - MINIDUMP_TYPE dump_type; - - // Client thread id pointer. - DWORD* thread_id; - - // Exception information. - EXCEPTION_POINTERS** exception_pointers; - - // Assert information in case of an invalid parameter or - // pure call failure. - MDRawAssertionInfo* assert_info; - - // Custom client information. - CustomClientInfo custom_client_info; - - // Handle to signal the crash event. - HANDLE dump_request_handle; - - // Handle to check if server is done generating crash. - HANDLE dump_generated_handle; - - // Handle to a mutex that becomes signaled (WAIT_ABANDONED) - // if server process goes down. - HANDLE server_alive_handle; - - private: - // Disable copy ctor and operator=. - ProtocolMessage(const ProtocolMessage& msg); - ProtocolMessage& operator=(const ProtocolMessage& msg); -}; - -} // namespace google_breakpad - -#endif // CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__ diff --git a/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc b/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc deleted file mode 100644 index 3ba5d4e4fb..0000000000 --- a/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.cc +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "client/windows/crash_generation/crash_generation_client.h" -#include -#include -#include "client/windows/common/ipc_protocol.h" - -namespace google_breakpad { - -const int kPipeBusyWaitTimeoutMs = 2000; - -#ifdef _DEBUG -const DWORD kWaitForServerTimeoutMs = INFINITE; -#else -const DWORD kWaitForServerTimeoutMs = 15000; -#endif - -const int kPipeConnectMaxAttempts = 2; - -const DWORD kPipeDesiredAccess = FILE_READ_DATA | - FILE_WRITE_DATA | - FILE_WRITE_ATTRIBUTES; - -const DWORD kPipeFlagsAndAttributes = SECURITY_IDENTIFICATION | - SECURITY_SQOS_PRESENT; - -const DWORD kPipeMode = PIPE_READMODE_MESSAGE; - -const size_t kWaitEventCount = 2; - -// This function is orphan for production code. It can be used -// for debugging to help repro some scenarios like the client -// is slow in writing to the pipe after connecting, the client -// is slow in reading from the pipe after writing, etc. The parameter -// overlapped below is not used and it is present to match the signature -// of this function to TransactNamedPipe Win32 API. Uncomment if needed -// for debugging. -/** -static bool TransactNamedPipeDebugHelper(HANDLE pipe, - const void* in_buffer, - DWORD in_size, - void* out_buffer, - DWORD out_size, - DWORD* bytes_count, - LPOVERLAPPED) { - // Uncomment the next sleep to create a gap before writing - // to pipe. - // Sleep(5000); - - if (!WriteFile(pipe, - in_buffer, - in_size, - bytes_count, - NULL)) { - return false; - } - - // Uncomment the next sleep to create a gap between write - // and read. - // Sleep(5000); - - return ReadFile(pipe, out_buffer, out_size, bytes_count, NULL) != FALSE; -} -**/ - -CrashGenerationClient::CrashGenerationClient( - const wchar_t* pipe_name, - MINIDUMP_TYPE dump_type, - const CustomClientInfo* custom_info) - : pipe_name_(pipe_name), - pipe_handle_(NULL), - custom_info_(), - dump_type_(dump_type), - crash_event_(NULL), - crash_generated_(NULL), - server_alive_(NULL), - server_process_id_(0), - thread_id_(0), - exception_pointers_(NULL) { - memset(&assert_info_, 0, sizeof(assert_info_)); - if (custom_info) { - custom_info_ = *custom_info; - } -} - -CrashGenerationClient::CrashGenerationClient( - HANDLE pipe_handle, - MINIDUMP_TYPE dump_type, - const CustomClientInfo* custom_info) - : pipe_name_(), - pipe_handle_(pipe_handle), - custom_info_(), - dump_type_(dump_type), - crash_event_(NULL), - crash_generated_(NULL), - server_alive_(NULL), - server_process_id_(0), - thread_id_(0), - exception_pointers_(NULL) { - memset(&assert_info_, 0, sizeof(assert_info_)); - if (custom_info) { - custom_info_ = *custom_info; - } -} - -CrashGenerationClient::~CrashGenerationClient() { - if (crash_event_) { - CloseHandle(crash_event_); - } - - if (crash_generated_) { - CloseHandle(crash_generated_); - } - - if (server_alive_) { - CloseHandle(server_alive_); - } -} - -// Performs the registration step with the server process. -// The registration step involves communicating with the server -// via a named pipe. The client sends the following pieces of -// data to the server: -// -// * Message tag indicating the client is requesting registration. -// * Process id of the client process. -// * Address of a DWORD variable in the client address space -// that will contain the thread id of the client thread that -// caused the crash. -// * Address of a EXCEPTION_POINTERS* variable in the client -// address space that will point to an instance of EXCEPTION_POINTERS -// when the crash happens. -// * Address of an instance of MDRawAssertionInfo that will contain -// relevant information in case of non-exception crashes like assertion -// failures and pure calls. -// -// In return the client expects the following information from the server: -// -// * Message tag indicating successful registration. -// * Server process id. -// * Handle to an object that client can signal to request dump -// generation from the server. -// * Handle to an object that client can wait on after requesting -// dump generation for the server to finish dump generation. -// * Handle to a mutex object that client can wait on to make sure -// server is still alive. -// -// If any step of the expected behavior mentioned above fails, the -// registration step is not considered successful and hence out-of-process -// dump generation service is not available. -// -// Returns true if the registration is successful; false otherwise. -bool CrashGenerationClient::Register() { - if (IsRegistered()) { - return true; - } - - HANDLE pipe = ConnectToServer(); - if (!pipe) { - return false; - } - - bool success = RegisterClient(pipe); - CloseHandle(pipe); - return success; -} - -bool CrashGenerationClient::RequestUpload(DWORD crash_id) { - HANDLE pipe = ConnectToServer(); - if (!pipe) { - return false; - } - - CustomClientInfo custom_info = {NULL, 0}; - ProtocolMessage msg(MESSAGE_TAG_UPLOAD_REQUEST, crash_id, - static_cast(NULL), NULL, NULL, NULL, - custom_info, NULL, NULL, NULL); - DWORD bytes_count = 0; - bool success = WriteFile(pipe, &msg, sizeof(msg), &bytes_count, NULL) != 0; - - CloseHandle(pipe); - return success; -} - -HANDLE CrashGenerationClient::ConnectToServer() { - HANDLE pipe = ConnectToPipe(pipe_name_.c_str(), - kPipeDesiredAccess, - kPipeFlagsAndAttributes); - if (!pipe) { - return NULL; - } - - DWORD mode = kPipeMode; - if (!SetNamedPipeHandleState(pipe, &mode, NULL, NULL)) { - CloseHandle(pipe); - pipe = NULL; - } - - return pipe; -} - -bool CrashGenerationClient::RegisterClient(HANDLE pipe) { - ProtocolMessage msg(MESSAGE_TAG_REGISTRATION_REQUEST, - GetCurrentProcessId(), - dump_type_, - &thread_id_, - &exception_pointers_, - &assert_info_, - custom_info_, - NULL, - NULL, - NULL); - ProtocolMessage reply; - DWORD bytes_count = 0; - // The call to TransactNamedPipe below can be changed to a call - // to TransactNamedPipeDebugHelper to help repro some scenarios. - // For details see comments for TransactNamedPipeDebugHelper. - if (!TransactNamedPipe(pipe, - &msg, - sizeof(msg), - &reply, - sizeof(ProtocolMessage), - &bytes_count, - NULL)) { - return false; - } - - if (!ValidateResponse(reply)) { - return false; - } - - ProtocolMessage ack_msg; - ack_msg.tag = MESSAGE_TAG_REGISTRATION_ACK; - - if (!WriteFile(pipe, &ack_msg, sizeof(ack_msg), &bytes_count, NULL)) { - return false; - } - crash_event_ = reply.dump_request_handle; - crash_generated_ = reply.dump_generated_handle; - server_alive_ = reply.server_alive_handle; - server_process_id_ = reply.id; - - return true; -} - -HANDLE CrashGenerationClient::ConnectToPipe(const wchar_t* pipe_name, - DWORD pipe_access, - DWORD flags_attrs) { - if (pipe_handle_) { - HANDLE t = pipe_handle_; - pipe_handle_ = NULL; - return t; - } - - for (int i = 0; i < kPipeConnectMaxAttempts; ++i) { - HANDLE pipe = CreateFile(pipe_name, - pipe_access, - 0, - NULL, - OPEN_EXISTING, - flags_attrs, - NULL); - if (pipe != INVALID_HANDLE_VALUE) { - return pipe; - } - - // Cannot continue retrying if error is something other than - // ERROR_PIPE_BUSY. - if (GetLastError() != ERROR_PIPE_BUSY) { - break; - } - - // Cannot continue retrying if wait on pipe fails. - if (!WaitNamedPipe(pipe_name, kPipeBusyWaitTimeoutMs)) { - break; - } - } - - return NULL; -} - -bool CrashGenerationClient::ValidateResponse( - const ProtocolMessage& msg) const { - return (msg.tag == MESSAGE_TAG_REGISTRATION_RESPONSE) && - (msg.id != 0) && - (msg.dump_request_handle != NULL) && - (msg.dump_generated_handle != NULL) && - (msg.server_alive_handle != NULL); -} - -bool CrashGenerationClient::IsRegistered() const { - return crash_event_ != NULL; -} - -bool CrashGenerationClient::RequestDump(EXCEPTION_POINTERS* ex_info, - MDRawAssertionInfo* assert_info) { - if (!IsRegistered()) { - return false; - } - - exception_pointers_ = ex_info; - thread_id_ = GetCurrentThreadId(); - - if (assert_info) { - memcpy(&assert_info_, assert_info, sizeof(assert_info_)); - } else { - memset(&assert_info_, 0, sizeof(assert_info_)); - } - - return SignalCrashEventAndWait(); -} - -bool CrashGenerationClient::RequestDump(EXCEPTION_POINTERS* ex_info) { - return RequestDump(ex_info, NULL); -} - -bool CrashGenerationClient::RequestDump(MDRawAssertionInfo* assert_info) { - return RequestDump(NULL, assert_info); -} - -bool CrashGenerationClient::SignalCrashEventAndWait() { - assert(crash_event_); - assert(crash_generated_); - assert(server_alive_); - - // Reset the dump generated event before signaling the crash - // event so that the server can set the dump generated event - // once it is done generating the event. - if (!ResetEvent(crash_generated_)) { - return false; - } - - if (!SetEvent(crash_event_)) { - return false; - } - - HANDLE wait_handles[kWaitEventCount] = {crash_generated_, server_alive_}; - - DWORD result = WaitForMultipleObjects(kWaitEventCount, - wait_handles, - FALSE, - kWaitForServerTimeoutMs); - - // Crash dump was successfully generated only if the server - // signaled the crash generated event. - return result == WAIT_OBJECT_0; -} - -HANDLE CrashGenerationClient::DuplicatePipeToClientProcess(const wchar_t* pipe_name, - HANDLE hProcess) { - for (int i = 0; i < kPipeConnectMaxAttempts; ++i) { - HANDLE local_pipe = CreateFile(pipe_name, kPipeDesiredAccess, - 0, NULL, OPEN_EXISTING, - kPipeFlagsAndAttributes, NULL); - if (local_pipe != INVALID_HANDLE_VALUE) { - HANDLE remotePipe = INVALID_HANDLE_VALUE; - if (DuplicateHandle(GetCurrentProcess(), local_pipe, - hProcess, &remotePipe, 0, FALSE, - DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) { - return remotePipe; - } else { - return INVALID_HANDLE_VALUE; - } - } - - // Cannot continue retrying if the error wasn't a busy pipe. - if (GetLastError() != ERROR_PIPE_BUSY) { - return INVALID_HANDLE_VALUE; - } - - if (!WaitNamedPipe(pipe_name, kPipeBusyWaitTimeoutMs)) { - return INVALID_HANDLE_VALUE; - } - } - return INVALID_HANDLE_VALUE; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h b/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h deleted file mode 100644 index 457f731957..0000000000 --- a/Telegram/ThirdParty/breakpad/client/windows/crash_generation/crash_generation_client.h +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ -#define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ - -#include -#include -#include -#include -#include "client/windows/common/ipc_protocol.h" -#include "common/scoped_ptr.h" - -namespace google_breakpad { - -struct CustomClientInfo; - -// Abstraction of client-side implementation of out of process -// crash generation. -// -// The process that desires to have out-of-process crash dump -// generation service can use this class in the following way: -// -// * Create an instance. -// * Call Register method so that the client tries to register -// with the server process and check the return value. If -// registration is not successful, out-of-process crash dump -// generation will not be available -// * Request dump generation by calling either of the two -// overloaded RequestDump methods - one in case of exceptions -// and the other in case of assertion failures -// -// Note that it is the responsibility of the client code of -// this class to set the unhandled exception filter with the -// system by calling the SetUnhandledExceptionFilter function -// and the client code should explicitly request dump generation. -class CrashGenerationClient { - public: - CrashGenerationClient(const wchar_t* pipe_name, - MINIDUMP_TYPE dump_type, - const CustomClientInfo* custom_info); - - CrashGenerationClient(HANDLE pipe_handle, - MINIDUMP_TYPE dump_type, - const CustomClientInfo* custom_info); - - ~CrashGenerationClient(); - - // Registers the client process with the crash server. - // - // Returns true if the registration is successful; false otherwise. - bool Register(); - - // Requests the crash server to upload a previous dump with the - // given crash id. - bool RequestUpload(DWORD crash_id); - - bool RequestDump(EXCEPTION_POINTERS* ex_info, - MDRawAssertionInfo* assert_info); - - // Requests the crash server to generate a dump with the given - // exception information. - // - // Returns true if the dump was successful; false otherwise. Note that - // if the registration step was not performed or it was not successful, - // false will be returned. - bool RequestDump(EXCEPTION_POINTERS* ex_info); - - // Requests the crash server to generate a dump with the given - // assertion information. - // - // Returns true if the dump was successful; false otherwise. Note that - // if the registration step was not performed or it was not successful, - // false will be returned. - bool RequestDump(MDRawAssertionInfo* assert_info); - - // If the crash generation client is running in a sandbox that prevents it - // from opening the named pipe directly, the server process may open the - // handle and duplicate it into the client process with this helper method. - // Returns INVALID_HANDLE_VALUE on failure. The process must have been opened - // with the PROCESS_DUP_HANDLE access right. - static HANDLE DuplicatePipeToClientProcess(const wchar_t* pipe_name, - HANDLE hProcess); - - private: - // Connects to the appropriate pipe and sets the pipe handle state. - // - // Returns the pipe handle if everything goes well; otherwise Returns NULL. - HANDLE ConnectToServer(); - - // Performs a handshake with the server over the given pipe which should be - // already connected to the server. - // - // Returns true if handshake with the server was successful; false otherwise. - bool RegisterClient(HANDLE pipe); - - // Validates the given server response. - bool ValidateResponse(const ProtocolMessage& msg) const; - - // Returns true if the registration step succeeded; false otherwise. - bool IsRegistered() const; - - // Connects to the given named pipe with given parameters. - // - // Returns true if the connection is successful; false otherwise. - HANDLE ConnectToPipe(const wchar_t* pipe_name, - DWORD pipe_access, - DWORD flags_attrs); - - // Signals the crash event and wait for the server to generate crash. - bool SignalCrashEventAndWait(); - - // Pipe name to use to talk to server. - std::wstring pipe_name_; - - // Pipe handle duplicated from server process. Only valid before - // Register is called. - HANDLE pipe_handle_; - - // Custom client information - CustomClientInfo custom_info_; - - // Type of dump to generate. - MINIDUMP_TYPE dump_type_; - - // Event to signal in case of a crash. - HANDLE crash_event_; - - // Handle to wait on after signaling a crash for the server - // to finish generating crash dump. - HANDLE crash_generated_; - - // Handle to a mutex that will become signaled with WAIT_ABANDONED - // if the server process goes down. - HANDLE server_alive_; - - // Server process id. - DWORD server_process_id_; - - // Id of the thread that caused the crash. - DWORD thread_id_; - - // Exception pointers for an exception crash. - EXCEPTION_POINTERS* exception_pointers_; - - // Assertion info for an invalid parameter or pure call crash. - MDRawAssertionInfo assert_info_; - - // Disable copy ctor and operator=. - CrashGenerationClient(const CrashGenerationClient& crash_client); - CrashGenerationClient& operator=(const CrashGenerationClient& crash_client); -}; - -} // namespace google_breakpad - -#endif // CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_ diff --git a/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc b/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc deleted file mode 100644 index b78075dec5..0000000000 --- a/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.cc +++ /dev/null @@ -1,1073 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include - -#include "common/windows/string_utils-inl.h" - -#include "client/windows/common/ipc_protocol.h" -#include "client/windows/handler/exception_handler.h" -#include "common/windows/guid_string.h" - -namespace google_breakpad { - -static const int kWaitForHandlerThreadMs = 60000; -static const int kExceptionHandlerThreadInitialStackSize = 64 * 1024; - -// As documented on MSDN, on failure SuspendThread returns (DWORD) -1 -static const DWORD kFailedToSuspendThread = static_cast(-1); - -// This is passed as the context to the MinidumpWriteDump callback. -typedef struct { - AppMemoryList::const_iterator iter; - AppMemoryList::const_iterator end; -} MinidumpCallbackContext; - -vector* ExceptionHandler::handler_stack_ = NULL; -LONG ExceptionHandler::handler_stack_index_ = 0; -CRITICAL_SECTION ExceptionHandler::handler_stack_critical_section_; -volatile LONG ExceptionHandler::instance_count_ = 0; - -ExceptionHandler::ExceptionHandler(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - MINIDUMP_TYPE dump_type, - const wchar_t* pipe_name, - const CustomClientInfo* custom_info) { - Initialize(dump_path, - filter, - callback, - callback_context, - handler_types, - dump_type, - pipe_name, - NULL, // pipe_handle - NULL, // crash_generation_client - custom_info); -} - -ExceptionHandler::ExceptionHandler(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - MINIDUMP_TYPE dump_type, - HANDLE pipe_handle, - const CustomClientInfo* custom_info) { - Initialize(dump_path, - filter, - callback, - callback_context, - handler_types, - dump_type, - NULL, // pipe_name - pipe_handle, - NULL, // crash_generation_client - custom_info); -} - -ExceptionHandler::ExceptionHandler( - const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - CrashGenerationClient* crash_generation_client) { - // The dump_type, pipe_name and custom_info that are passed in to Initialize() - // are not used. The ones set in crash_generation_client are used instead. - Initialize(dump_path, - filter, - callback, - callback_context, - handler_types, - MiniDumpNormal, // dump_type - not used - NULL, // pipe_name - not used - NULL, // pipe_handle - crash_generation_client, - NULL); // custom_info - not used -} - -ExceptionHandler::ExceptionHandler(const wstring &dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types) { - Initialize(dump_path, - filter, - callback, - callback_context, - handler_types, - MiniDumpNormal, - NULL, // pipe_name - NULL, // pipe_handle - NULL, // crash_generation_client - NULL); // custom_info -} - -void ExceptionHandler::Initialize( - const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - MINIDUMP_TYPE dump_type, - const wchar_t* pipe_name, - HANDLE pipe_handle, - CrashGenerationClient* crash_generation_client, - const CustomClientInfo* custom_info) { - LONG instance_count = InterlockedIncrement(&instance_count_); - filter_ = filter; - callback_ = callback; - callback_context_ = callback_context; - dump_path_c_ = NULL; - next_minidump_id_c_ = NULL; - next_minidump_path_c_ = NULL; - dbghelp_module_ = NULL; - minidump_write_dump_ = NULL; - dump_type_ = dump_type; - rpcrt4_module_ = NULL; - uuid_create_ = NULL; - handler_types_ = handler_types; - previous_filter_ = NULL; -#if _MSC_VER >= 1400 // MSVC 2005/8 - previous_iph_ = NULL; -#endif // _MSC_VER >= 1400 - previous_pch_ = NULL; - handler_thread_ = NULL; - is_shutdown_ = false; - handler_start_semaphore_ = NULL; - handler_finish_semaphore_ = NULL; - requesting_thread_id_ = 0; - exception_info_ = NULL; - assertion_ = NULL; - handler_return_value_ = false; - handle_debug_exceptions_ = false; - consume_invalid_handle_exceptions_ = false; - - // Attempt to use out-of-process if user has specified a pipe or a - // crash generation client. - scoped_ptr client; - if (crash_generation_client) { - client.reset(crash_generation_client); - } else if (pipe_name) { - client.reset( - new CrashGenerationClient(pipe_name, dump_type_, custom_info)); - } else if (pipe_handle) { - client.reset( - new CrashGenerationClient(pipe_handle, dump_type_, custom_info)); - } - - if (client.get() != NULL) { - // If successful in registering with the monitoring process, - // there is no need to setup in-process crash generation. - if (client->Register()) { - crash_generation_client_.reset(client.release()); - } - } - - if (!IsOutOfProcess()) { - // Either client did not ask for out-of-process crash generation - // or registration with the server process failed. In either case, - // setup to do in-process crash generation. - - // Set synchronization primitives and the handler thread. Each - // ExceptionHandler object gets its own handler thread because that's the - // only way to reliably guarantee sufficient stack space in an exception, - // and it allows an easy way to get a snapshot of the requesting thread's - // context outside of an exception. - InitializeCriticalSection(&handler_critical_section_); - handler_start_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL); - assert(handler_start_semaphore_ != NULL); - - handler_finish_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL); - assert(handler_finish_semaphore_ != NULL); - - // Don't attempt to create the thread if we could not create the semaphores. - if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) { - DWORD thread_id; - handler_thread_ = CreateThread(NULL, // lpThreadAttributes - kExceptionHandlerThreadInitialStackSize, - ExceptionHandlerThreadMain, - this, // lpParameter - 0, // dwCreationFlags - &thread_id); - assert(handler_thread_ != NULL); - } - - dbghelp_module_ = LoadLibrary(L"dbghelp.dll"); - if (dbghelp_module_) { - minidump_write_dump_ = reinterpret_cast( - GetProcAddress(dbghelp_module_, "MiniDumpWriteDump")); - } - - // Load this library dynamically to not affect existing projects. Most - // projects don't link against this directly, it's usually dynamically - // loaded by dependent code. - rpcrt4_module_ = LoadLibrary(L"rpcrt4.dll"); - if (rpcrt4_module_) { - uuid_create_ = reinterpret_cast( - GetProcAddress(rpcrt4_module_, "UuidCreate")); - } - - // set_dump_path calls UpdateNextID. This sets up all of the path and id - // strings, and their equivalent c_str pointers. - set_dump_path(dump_path); - } - - // Reserve one element for the instruction memory - AppMemory instruction_memory; - instruction_memory.ptr = NULL; - instruction_memory.length = 0; - app_memory_info_.push_back(instruction_memory); - - // There is a race condition here. If the first instance has not yet - // initialized the critical section, the second (and later) instances may - // try to use uninitialized critical section object. The feature of multiple - // instances in one module is not used much, so leave it as is for now. - // One way to solve this in the current design (that is, keeping the static - // handler stack) is to use spin locks with volatile bools to synchronize - // the handler stack. This works only if the compiler guarantees to generate - // cache coherent code for volatile. - // TODO(munjal): Fix this in a better way by changing the design if possible. - - // Lazy initialization of the handler_stack_critical_section_ - if (instance_count == 1) { - InitializeCriticalSection(&handler_stack_critical_section_); - } - - if (handler_types != HANDLER_NONE) { - EnterCriticalSection(&handler_stack_critical_section_); - - // The first time an ExceptionHandler that installs a handler is - // created, set up the handler stack. - if (!handler_stack_) { - handler_stack_ = new vector(); - } - handler_stack_->push_back(this); - - if (handler_types & HANDLER_EXCEPTION) - previous_filter_ = SetUnhandledExceptionFilter(HandleException); - -#if _MSC_VER >= 1400 // MSVC 2005/8 - if (handler_types & HANDLER_INVALID_PARAMETER) - previous_iph_ = _set_invalid_parameter_handler(HandleInvalidParameter); -#endif // _MSC_VER >= 1400 - - if (handler_types & HANDLER_PURECALL) - previous_pch_ = _set_purecall_handler(HandlePureVirtualCall); - - LeaveCriticalSection(&handler_stack_critical_section_); - } -} - -ExceptionHandler::~ExceptionHandler() { - if (dbghelp_module_) { - FreeLibrary(dbghelp_module_); - } - - if (rpcrt4_module_) { - FreeLibrary(rpcrt4_module_); - } - - if (handler_types_ != HANDLER_NONE) { - EnterCriticalSection(&handler_stack_critical_section_); - - if (handler_types_ & HANDLER_EXCEPTION) - SetUnhandledExceptionFilter(previous_filter_); - -#if _MSC_VER >= 1400 // MSVC 2005/8 - if (handler_types_ & HANDLER_INVALID_PARAMETER) - _set_invalid_parameter_handler(previous_iph_); -#endif // _MSC_VER >= 1400 - - if (handler_types_ & HANDLER_PURECALL) - _set_purecall_handler(previous_pch_); - - if (handler_stack_->back() == this) { - handler_stack_->pop_back(); - } else { - // TODO(mmentovai): use advapi32!ReportEvent to log the warning to the - // system's application event log. - fprintf(stderr, "warning: removing Breakpad handler out of order\n"); - vector::iterator iterator = handler_stack_->begin(); - while (iterator != handler_stack_->end()) { - if (*iterator == this) { - iterator = handler_stack_->erase(iterator); - } else { - ++iterator; - } - } - } - - if (handler_stack_->empty()) { - // When destroying the last ExceptionHandler that installed a handler, - // clean up the handler stack. - delete handler_stack_; - handler_stack_ = NULL; - } - - LeaveCriticalSection(&handler_stack_critical_section_); - } - - // Some of the objects were only initialized if out of process - // registration was not done. - if (!IsOutOfProcess()) { -#ifdef BREAKPAD_NO_TERMINATE_THREAD - // Clean up the handler thread and synchronization primitives. The handler - // thread is either waiting on the semaphore to handle a crash or it is - // handling a crash. Coming out of the wait is fast but wait more in the - // eventuality a crash is handled. This compilation option results in a - // deadlock if the exception handler is destroyed while executing code - // inside DllMain. - is_shutdown_ = true; - ReleaseSemaphore(handler_start_semaphore_, 1, NULL); - WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs); -#else - TerminateThread(handler_thread_, 1); -#endif // BREAKPAD_NO_TERMINATE_THREAD - - CloseHandle(handler_thread_); - handler_thread_ = NULL; - DeleteCriticalSection(&handler_critical_section_); - CloseHandle(handler_start_semaphore_); - CloseHandle(handler_finish_semaphore_); - } - - // There is a race condition in the code below: if this instance is - // deleting the static critical section and a new instance of the class - // is created, then there is a possibility that the critical section be - // initialized while the same critical section is being deleted. Given the - // usage pattern for the code, this race condition is unlikely to hit, but it - // is a race condition nonetheless. - if (InterlockedDecrement(&instance_count_) == 0) { - DeleteCriticalSection(&handler_stack_critical_section_); - } -} - -bool ExceptionHandler::RequestUpload(DWORD crash_id) { - return crash_generation_client_->RequestUpload(crash_id); -} - -// static -DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) { - ExceptionHandler* self = reinterpret_cast(lpParameter); - assert(self); - assert(self->handler_start_semaphore_ != NULL); - assert(self->handler_finish_semaphore_ != NULL); - - while (true) { - if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) == - WAIT_OBJECT_0) { - // Perform the requested action. - if (self->is_shutdown_) { - // The instance of the exception handler is being destroyed. - break; - } else { - self->handler_return_value_ = - self->WriteMinidumpWithException(self->requesting_thread_id_, - self->exception_info_, - self->assertion_); - } - - // Allow the requesting thread to proceed. - ReleaseSemaphore(self->handler_finish_semaphore_, 1, NULL); - } - } - - // This statement is not reached when the thread is unconditionally - // terminated by the ExceptionHandler destructor. - return 0; -} - -// HandleException and HandleInvalidParameter must create an -// AutoExceptionHandler object to maintain static state and to determine which -// ExceptionHandler instance to use. The constructor locates the correct -// instance, and makes it available through get_handler(). The destructor -// restores the state in effect prior to allocating the AutoExceptionHandler. -class AutoExceptionHandler { - public: - AutoExceptionHandler() { - // Increment handler_stack_index_ so that if another Breakpad handler is - // registered using this same HandleException function, and it needs to be - // called while this handler is running (either because this handler - // declines to handle the exception, or an exception occurs during - // handling), HandleException will find the appropriate ExceptionHandler - // object in handler_stack_ to deliver the exception to. - // - // Because handler_stack_ is addressed in reverse (as |size - index|), - // preincrementing handler_stack_index_ avoids needing to subtract 1 from - // the argument to |at|. - // - // The index is maintained instead of popping elements off of the handler - // stack and pushing them at the end of this method. This avoids ruining - // the order of elements in the stack in the event that some other thread - // decides to manipulate the handler stack (such as creating a new - // ExceptionHandler object) while an exception is being handled. - EnterCriticalSection(&ExceptionHandler::handler_stack_critical_section_); - handler_ = ExceptionHandler::handler_stack_->at( - ExceptionHandler::handler_stack_->size() - - ++ExceptionHandler::handler_stack_index_); - - // In case another exception occurs while this handler is doing its thing, - // it should be delivered to the previous filter. - SetUnhandledExceptionFilter(handler_->previous_filter_); -#if _MSC_VER >= 1400 // MSVC 2005/8 - _set_invalid_parameter_handler(handler_->previous_iph_); -#endif // _MSC_VER >= 1400 - _set_purecall_handler(handler_->previous_pch_); - } - - ~AutoExceptionHandler() { - // Put things back the way they were before entering this handler. - SetUnhandledExceptionFilter(ExceptionHandler::HandleException); -#if _MSC_VER >= 1400 // MSVC 2005/8 - _set_invalid_parameter_handler(ExceptionHandler::HandleInvalidParameter); -#endif // _MSC_VER >= 1400 - _set_purecall_handler(ExceptionHandler::HandlePureVirtualCall); - - --ExceptionHandler::handler_stack_index_; - LeaveCriticalSection(&ExceptionHandler::handler_stack_critical_section_); - } - - ExceptionHandler* get_handler() const { return handler_; } - - private: - ExceptionHandler* handler_; -}; - -// static -LONG ExceptionHandler::HandleException(EXCEPTION_POINTERS* exinfo) { - AutoExceptionHandler auto_exception_handler; - ExceptionHandler* current_handler = auto_exception_handler.get_handler(); - - // Ignore EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP exceptions. This - // logic will short-circuit before calling WriteMinidumpOnHandlerThread, - // allowing something else to handle the breakpoint without incurring the - // overhead transitioning to and from the handler thread. This behavior - // can be overridden by calling ExceptionHandler::set_handle_debug_exceptions. - DWORD code = exinfo->ExceptionRecord->ExceptionCode; - LONG action; - bool is_debug_exception = (code == EXCEPTION_BREAKPOINT) || - (code == EXCEPTION_SINGLE_STEP); - - if (code == EXCEPTION_INVALID_HANDLE && - current_handler->consume_invalid_handle_exceptions_) { - return EXCEPTION_CONTINUE_EXECUTION; - } - - bool success = false; - - if (!is_debug_exception || - current_handler->get_handle_debug_exceptions()) { - // If out-of-proc crash handler client is available, we have to use that - // to generate dump and we cannot fall back on in-proc dump generation - // because we never prepared for an in-proc dump generation - - // In case of out-of-process dump generation, directly call - // WriteMinidumpWithException since there is no separate thread running. - if (current_handler->IsOutOfProcess()) { - success = current_handler->WriteMinidumpWithException( - GetCurrentThreadId(), - exinfo, - NULL); - } else { - success = current_handler->WriteMinidumpOnHandlerThread(exinfo, NULL); - } - } - - // The handler fully handled the exception. Returning - // EXCEPTION_EXECUTE_HANDLER indicates this to the system, and usually - // results in the application being terminated. - // - // Note: If the application was launched from within the Cygwin - // environment, returning EXCEPTION_EXECUTE_HANDLER seems to cause the - // application to be restarted. - if (success) { - action = EXCEPTION_EXECUTE_HANDLER; - } else { - // There was an exception, it was a breakpoint or something else ignored - // above, or it was passed to the handler, which decided not to handle it. - // This could be because the filter callback didn't want it, because - // minidump writing failed for some reason, or because the post-minidump - // callback function indicated failure. Give the previous handler a - // chance to do something with the exception. If there is no previous - // handler, return EXCEPTION_CONTINUE_SEARCH, which will allow a debugger - // or native "crashed" dialog to handle the exception. - if (current_handler->previous_filter_) { - action = current_handler->previous_filter_(exinfo); - } else { - action = EXCEPTION_CONTINUE_SEARCH; - } - } - - return action; -} - -#if _MSC_VER >= 1400 // MSVC 2005/8 -// static -void ExceptionHandler::HandleInvalidParameter(const wchar_t* expression, - const wchar_t* function, - const wchar_t* file, - unsigned int line, - uintptr_t reserved) { - // This is an invalid parameter, not an exception. It's safe to play with - // sprintf here. - AutoExceptionHandler auto_exception_handler; - ExceptionHandler* current_handler = auto_exception_handler.get_handler(); - - MDRawAssertionInfo assertion; - memset(&assertion, 0, sizeof(assertion)); - _snwprintf_s(reinterpret_cast(assertion.expression), - sizeof(assertion.expression) / sizeof(assertion.expression[0]), - _TRUNCATE, L"%s", expression); - _snwprintf_s(reinterpret_cast(assertion.function), - sizeof(assertion.function) / sizeof(assertion.function[0]), - _TRUNCATE, L"%s", function); - _snwprintf_s(reinterpret_cast(assertion.file), - sizeof(assertion.file) / sizeof(assertion.file[0]), - _TRUNCATE, L"%s", file); - assertion.line = line; - assertion.type = MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER; - - // Make up an exception record for the current thread and CPU context - // to make it possible for the crash processor to classify these - // as do regular crashes, and to make it humane for developers to - // analyze them. - EXCEPTION_RECORD exception_record = {}; - CONTEXT exception_context = {}; - EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context }; - - ::RtlCaptureContext(&exception_context); - - exception_record.ExceptionCode = STATUS_INVALID_PARAMETER; - - // We store pointers to the the expression and function strings, - // and the line as exception parameters to make them easy to - // access by the developer on the far side. - exception_record.NumberParameters = 3; - exception_record.ExceptionInformation[0] = - reinterpret_cast(&assertion.expression); - exception_record.ExceptionInformation[1] = - reinterpret_cast(&assertion.file); - exception_record.ExceptionInformation[2] = assertion.line; - - bool success = false; - // In case of out-of-process dump generation, directly call - // WriteMinidumpWithException since there is no separate thread running. - if (current_handler->IsOutOfProcess()) { - success = current_handler->WriteMinidumpWithException( - GetCurrentThreadId(), - &exception_ptrs, - &assertion); - } else { - success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs, - &assertion); - } - - if (!success) { - if (current_handler->previous_iph_) { - // The handler didn't fully handle the exception. Give it to the - // previous invalid parameter handler. - current_handler->previous_iph_(expression, - function, - file, - line, - reserved); - } else { - // If there's no previous handler, pass the exception back in to the - // invalid parameter handler's core. That's the routine that called this - // function, but now, since this function is no longer registered (and in - // fact, no function at all is registered), this will result in the - // default code path being taken: _CRT_DEBUGGER_HOOK and _invoke_watson. - // Use _invalid_parameter where it exists (in _DEBUG builds) as it passes - // more information through. In non-debug builds, it is not available, - // so fall back to using _invalid_parameter_noinfo. See invarg.c in the - // CRT source. -#ifdef _DEBUG - _invalid_parameter(expression, function, file, line, reserved); -#else // _DEBUG - _invalid_parameter_noinfo(); -#endif // _DEBUG - } - } - - // The handler either took care of the invalid parameter problem itself, - // or passed it on to another handler. "Swallow" it by exiting, paralleling - // the behavior of "swallowing" exceptions. - exit(0); -} -#endif // _MSC_VER >= 1400 - -// static -void ExceptionHandler::HandlePureVirtualCall() { - // This is an pure virtual function call, not an exception. It's safe to - // play with sprintf here. - AutoExceptionHandler auto_exception_handler; - ExceptionHandler* current_handler = auto_exception_handler.get_handler(); - - MDRawAssertionInfo assertion; - memset(&assertion, 0, sizeof(assertion)); - assertion.type = MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL; - - // Make up an exception record for the current thread and CPU context - // to make it possible for the crash processor to classify these - // as do regular crashes, and to make it humane for developers to - // analyze them. - EXCEPTION_RECORD exception_record = {}; - CONTEXT exception_context = {}; - EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context }; - - ::RtlCaptureContext(&exception_context); - - exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION; - - // We store pointers to the the expression and function strings, - // and the line as exception parameters to make them easy to - // access by the developer on the far side. - exception_record.NumberParameters = 3; - exception_record.ExceptionInformation[0] = - reinterpret_cast(&assertion.expression); - exception_record.ExceptionInformation[1] = - reinterpret_cast(&assertion.file); - exception_record.ExceptionInformation[2] = assertion.line; - - bool success = false; - // In case of out-of-process dump generation, directly call - // WriteMinidumpWithException since there is no separate thread running. - - if (current_handler->IsOutOfProcess()) { - success = current_handler->WriteMinidumpWithException( - GetCurrentThreadId(), - &exception_ptrs, - &assertion); - } else { - success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs, - &assertion); - } - - if (!success) { - if (current_handler->previous_pch_) { - // The handler didn't fully handle the exception. Give it to the - // previous purecall handler. - current_handler->previous_pch_(); - } else { - // If there's no previous handler, return and let _purecall handle it. - // This will just put up an assertion dialog. - return; - } - } - - // The handler either took care of the invalid parameter problem itself, - // or passed it on to another handler. "Swallow" it by exiting, paralleling - // the behavior of "swallowing" exceptions. - exit(0); -} - -bool ExceptionHandler::WriteMinidumpOnHandlerThread( - EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion) { - EnterCriticalSection(&handler_critical_section_); - - // There isn't much we can do if the handler thread - // was not successfully created. - if (handler_thread_ == NULL) { - LeaveCriticalSection(&handler_critical_section_); - return false; - } - - // The handler thread should only be created when the semaphores are valid. - assert(handler_start_semaphore_ != NULL); - assert(handler_finish_semaphore_ != NULL); - - // Set up data to be passed in to the handler thread. - requesting_thread_id_ = GetCurrentThreadId(); - exception_info_ = exinfo; - assertion_ = assertion; - - // This causes the handler thread to call WriteMinidumpWithException. - ReleaseSemaphore(handler_start_semaphore_, 1, NULL); - - // Wait until WriteMinidumpWithException is done and collect its return value. - WaitForSingleObject(handler_finish_semaphore_, INFINITE); - bool status = handler_return_value_; - - // Clean up. - requesting_thread_id_ = 0; - exception_info_ = NULL; - assertion_ = NULL; - - LeaveCriticalSection(&handler_critical_section_); - - return status; -} - -bool ExceptionHandler::WriteMinidump() { - // Make up an exception record for the current thread and CPU context - // to make it possible for the crash processor to classify these - // as do regular crashes, and to make it humane for developers to - // analyze them. - EXCEPTION_RECORD exception_record = {}; - CONTEXT exception_context = {}; - EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context }; - - ::RtlCaptureContext(&exception_context); - exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION; - - return WriteMinidumpForException(&exception_ptrs); -} - -bool ExceptionHandler::WriteMinidumpForException(EXCEPTION_POINTERS* exinfo) { - // In case of out-of-process dump generation, directly call - // WriteMinidumpWithException since there is no separate thread running. - if (IsOutOfProcess()) { - return WriteMinidumpWithException(GetCurrentThreadId(), - exinfo, - NULL); - } - - bool success = WriteMinidumpOnHandlerThread(exinfo, NULL); - UpdateNextID(); - return success; -} - -// static -bool ExceptionHandler::WriteMinidump(const wstring &dump_path, - MinidumpCallback callback, - void* callback_context) { - ExceptionHandler handler(dump_path, NULL, callback, callback_context, - HANDLER_NONE); - return handler.WriteMinidump(); -} - -// static -bool ExceptionHandler::WriteMinidumpForChild(HANDLE child, - DWORD child_blamed_thread, - const wstring& dump_path, - MinidumpCallback callback, - void* callback_context) { - EXCEPTION_RECORD ex; - CONTEXT ctx; - EXCEPTION_POINTERS exinfo = { NULL, NULL }; - DWORD last_suspend_count = kFailedToSuspendThread; - HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT | - THREAD_QUERY_INFORMATION | - THREAD_SUSPEND_RESUME, - FALSE, - child_blamed_thread); - // This thread may have died already, so not opening the handle is a - // non-fatal error. - if (child_thread_handle != NULL) { - last_suspend_count = SuspendThread(child_thread_handle); - if (last_suspend_count != kFailedToSuspendThread) { - ctx.ContextFlags = CONTEXT_ALL; - if (GetThreadContext(child_thread_handle, &ctx)) { - memset(&ex, 0, sizeof(ex)); - ex.ExceptionCode = EXCEPTION_BREAKPOINT; -#if defined(_M_IX86) - ex.ExceptionAddress = reinterpret_cast(ctx.Eip); -#elif defined(_M_X64) - ex.ExceptionAddress = reinterpret_cast(ctx.Rip); -#endif - exinfo.ExceptionRecord = &ex; - exinfo.ContextRecord = &ctx; - } - } - } - - ExceptionHandler handler(dump_path, NULL, callback, callback_context, - HANDLER_NONE); - bool success = handler.WriteMinidumpWithExceptionForProcess( - child_blamed_thread, - exinfo.ExceptionRecord ? &exinfo : NULL, - NULL, child, false); - - if (last_suspend_count != kFailedToSuspendThread) { - ResumeThread(child_thread_handle); - } - - CloseHandle(child_thread_handle); - - if (callback) { - success = callback(handler.dump_path_c_, handler.next_minidump_id_c_, - callback_context, NULL, NULL, success); - } - - return success; -} - -bool ExceptionHandler::WriteMinidumpWithException( - DWORD requesting_thread_id, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion) { - // Give user code a chance to approve or prevent writing a minidump. If the - // filter returns false, don't handle the exception at all. If this method - // was called as a result of an exception, returning false will cause - // HandleException to call any previous handler or return - // EXCEPTION_CONTINUE_SEARCH on the exception thread, allowing it to appear - // as though this handler were not present at all. - if (filter_ && !filter_(callback_context_, exinfo, assertion)) { - return false; - } - - bool success = false; - if (IsOutOfProcess()) { - success = crash_generation_client_->RequestDump(exinfo, assertion); - } else { - success = WriteMinidumpWithExceptionForProcess(requesting_thread_id, - exinfo, - assertion, - GetCurrentProcess(), - true); - } - - if (callback_) { - // TODO(munjal): In case of out-of-process dump generation, both - // dump_path_c_ and next_minidump_id_ will be NULL. For out-of-process - // scenario, the server process ends up creating the dump path and dump - // id so they are not known to the client. - success = callback_(dump_path_c_, next_minidump_id_c_, callback_context_, - exinfo, assertion, success); - } - - return success; -} - -// static -BOOL CALLBACK ExceptionHandler::MinidumpWriteDumpCallback( - PVOID context, - const PMINIDUMP_CALLBACK_INPUT callback_input, - PMINIDUMP_CALLBACK_OUTPUT callback_output) { - switch (callback_input->CallbackType) { - case MemoryCallback: { - MinidumpCallbackContext* callback_context = - reinterpret_cast(context); - if (callback_context->iter == callback_context->end) - return FALSE; - - // Include the specified memory region. - callback_output->MemoryBase = callback_context->iter->ptr; - callback_output->MemorySize = callback_context->iter->length; - callback_context->iter++; - return TRUE; - } - - // Include all modules. - case IncludeModuleCallback: - case ModuleCallback: - return TRUE; - - // Include all threads. - case IncludeThreadCallback: - case ThreadCallback: - return TRUE; - - // Stop receiving cancel callbacks. - case CancelCallback: - callback_output->CheckCancel = FALSE; - callback_output->Cancel = FALSE; - return TRUE; - } - // Ignore other callback types. - return FALSE; -} - -bool ExceptionHandler::WriteMinidumpWithExceptionForProcess( - DWORD requesting_thread_id, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion, - HANDLE process, - bool write_requester_stream) { - bool success = false; - if (minidump_write_dump_) { - HANDLE dump_file = CreateFile(next_minidump_path_c_, - GENERIC_WRITE, - 0, // no sharing - NULL, - CREATE_NEW, // fail if exists - FILE_ATTRIBUTE_NORMAL, - NULL); - if (dump_file != INVALID_HANDLE_VALUE) { - MINIDUMP_EXCEPTION_INFORMATION except_info; - except_info.ThreadId = requesting_thread_id; - except_info.ExceptionPointers = exinfo; - except_info.ClientPointers = FALSE; - - // Leave room in user_stream_array for possible breakpad and - // assertion info streams. - MINIDUMP_USER_STREAM user_stream_array[2]; - MINIDUMP_USER_STREAM_INFORMATION user_streams; - user_streams.UserStreamCount = 0; - user_streams.UserStreamArray = user_stream_array; - - if (write_requester_stream) { - // Add an MDRawBreakpadInfo stream to the minidump, to provide - // additional information about the exception handler to the Breakpad - // processor. The information will help the processor determine which - // threads are relevant. The Breakpad processor does not require this - // information but can function better with Breakpad-generated dumps - // when it is present. The native debugger is not harmed by the - // presence of this information. - MDRawBreakpadInfo breakpad_info; - breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID | - MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID; - breakpad_info.dump_thread_id = GetCurrentThreadId(); - breakpad_info.requesting_thread_id = requesting_thread_id; - - int index = user_streams.UserStreamCount; - user_stream_array[index].Type = MD_BREAKPAD_INFO_STREAM; - user_stream_array[index].BufferSize = sizeof(breakpad_info); - user_stream_array[index].Buffer = &breakpad_info; - ++user_streams.UserStreamCount; - } - - if (assertion) { - int index = user_streams.UserStreamCount; - user_stream_array[index].Type = MD_ASSERTION_INFO_STREAM; - user_stream_array[index].BufferSize = sizeof(MDRawAssertionInfo); - user_stream_array[index].Buffer = assertion; - ++user_streams.UserStreamCount; - } - - // Older versions of DbgHelp.dll don't correctly put the memory around - // the faulting instruction pointer into the minidump. This - // callback will ensure that it gets included. - if (exinfo) { - // Find a memory region of 256 bytes centered on the - // faulting instruction pointer. - const ULONG64 instruction_pointer = -#if defined(_M_IX86) - exinfo->ContextRecord->Eip; -#elif defined(_M_AMD64) - exinfo->ContextRecord->Rip; -#else -#error Unsupported platform -#endif - - MEMORY_BASIC_INFORMATION info; - if (VirtualQueryEx(process, - reinterpret_cast(instruction_pointer), - &info, - sizeof(MEMORY_BASIC_INFORMATION)) != 0 && - info.State == MEM_COMMIT) { - // Attempt to get 128 bytes before and after the instruction - // pointer, but settle for whatever's available up to the - // boundaries of the memory region. - const ULONG64 kIPMemorySize = 256; - ULONG64 base = - (std::max)(reinterpret_cast(info.BaseAddress), - instruction_pointer - (kIPMemorySize / 2)); - ULONG64 end_of_range = - (std::min)(instruction_pointer + (kIPMemorySize / 2), - reinterpret_cast(info.BaseAddress) - + info.RegionSize); - ULONG size = static_cast(end_of_range - base); - - AppMemory& elt = app_memory_info_.front(); - elt.ptr = base; - elt.length = size; - } - } - - MinidumpCallbackContext context; - context.iter = app_memory_info_.begin(); - context.end = app_memory_info_.end(); - - // Skip the reserved element if there was no instruction memory - if (context.iter->ptr == 0) { - context.iter++; - } - - MINIDUMP_CALLBACK_INFORMATION callback; - callback.CallbackRoutine = MinidumpWriteDumpCallback; - callback.CallbackParam = reinterpret_cast(&context); - - // The explicit comparison to TRUE avoids a warning (C4800). - success = (minidump_write_dump_(process, - GetProcessId(process), - dump_file, - dump_type_, - exinfo ? &except_info : NULL, - &user_streams, - &callback) == TRUE); - - CloseHandle(dump_file); - } - } - - return success; -} - -void ExceptionHandler::UpdateNextID() { - assert(uuid_create_); - UUID id = {0}; - if (uuid_create_) { - uuid_create_(&id); - } - next_minidump_id_ = GUIDString::GUIDToWString(&id); - next_minidump_id_c_ = next_minidump_id_.c_str(); - - wchar_t minidump_path[MAX_PATH]; - swprintf(minidump_path, MAX_PATH, L"%s\\%s.dmp", - dump_path_c_, next_minidump_id_c_); - - // remove when VC++7.1 is no longer supported - minidump_path[MAX_PATH - 1] = L'\0'; - - next_minidump_path_ = minidump_path; - next_minidump_path_c_ = next_minidump_path_.c_str(); -} - -void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) { - AppMemoryList::iterator iter = - std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr); - if (iter != app_memory_info_.end()) { - // Don't allow registering the same pointer twice. - return; - } - - AppMemory app_memory; - app_memory.ptr = reinterpret_cast(ptr); - app_memory.length = static_cast(length); - app_memory_info_.push_back(app_memory); -} - -void ExceptionHandler::UnregisterAppMemory(void* ptr) { - AppMemoryList::iterator iter = - std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr); - if (iter != app_memory_info_.end()) { - app_memory_info_.erase(iter); - } -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h b/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h deleted file mode 100644 index e3cd8146b3..0000000000 --- a/Telegram/ThirdParty/breakpad/client/windows/handler/exception_handler.h +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// ExceptionHandler can write a minidump file when an exception occurs, -// or when WriteMinidump() is called explicitly by your program. -// -// To have the exception handler write minidumps when an uncaught exception -// (crash) occurs, you should create an instance early in the execution -// of your program, and keep it around for the entire time you want to -// have crash handling active (typically, until shutdown). -// -// If you want to write minidumps without installing the exception handler, -// you can create an ExceptionHandler with install_handler set to false, -// then call WriteMinidump. You can also use this technique if you want to -// use different minidump callbacks for different call sites. -// -// In either case, a callback function is called when a minidump is written, -// which receives the unqiue id of the minidump. The caller can use this -// id to collect and write additional application state, and to launch an -// external crash-reporting application. -// -// It is important that creation and destruction of ExceptionHandler objects -// be nested cleanly, when using install_handler = true. -// Avoid the following pattern: -// ExceptionHandler *e = new ExceptionHandler(...); -// ExceptionHandler *f = new ExceptionHandler(...); -// delete e; -// This will put the exception filter stack into an inconsistent state. - -#ifndef CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__ -#define CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__ - -#include -#include -#include -#include - -#pragma warning(push) -// Disable exception handler warnings. -#pragma warning(disable:4530) - -#include -#include -#include - -#include "client/windows/common/ipc_protocol.h" -#include "client/windows/crash_generation/crash_generation_client.h" -#include "common/scoped_ptr.h" -#include "google_breakpad/common/minidump_format.h" - -namespace google_breakpad { - -using std::vector; -using std::wstring; - -// These entries store a list of memory regions that the client wants included -// in the minidump. -struct AppMemory { - ULONG64 ptr; - ULONG length; - - bool operator==(const struct AppMemory& other) const { - return ptr == other.ptr; - } - - bool operator==(const void* other) const { - return ptr == reinterpret_cast(other); - } -}; -typedef std::list AppMemoryList; - -class ExceptionHandler { - public: - // A callback function to run before Breakpad performs any substantial - // processing of an exception. A FilterCallback is called before writing - // a minidump. context is the parameter supplied by the user as - // callback_context when the handler was created. exinfo points to the - // exception record, if any; assertion points to assertion information, - // if any. - // - // If a FilterCallback returns true, Breakpad will continue processing, - // attempting to write a minidump. If a FilterCallback returns false, - // Breakpad will immediately report the exception as unhandled without - // writing a minidump, allowing another handler the opportunity to handle it. - typedef bool (*FilterCallback)(void* context, EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion); - - // A callback function to run after the minidump has been written. - // minidump_id is a unique id for the dump, so the minidump - // file is \.dmp. context is the parameter supplied - // by the user as callback_context when the handler was created. exinfo - // points to the exception record, or NULL if no exception occurred. - // succeeded indicates whether a minidump file was successfully written. - // assertion points to information about an assertion if the handler was - // invoked by an assertion. - // - // If an exception occurred and the callback returns true, Breakpad will treat - // the exception as fully-handled, suppressing any other handlers from being - // notified of the exception. If the callback returns false, Breakpad will - // treat the exception as unhandled, and allow another handler to handle it. - // If there are no other handlers, Breakpad will report the exception to the - // system as unhandled, allowing a debugger or native crash dialog the - // opportunity to handle the exception. Most callback implementations - // should normally return the value of |succeeded|, or when they wish to - // not report an exception of handled, false. Callbacks will rarely want to - // return true directly (unless |succeeded| is true). - // - // For out-of-process dump generation, dump path and minidump ID will always - // be NULL. In case of out-of-process dump generation, the dump path and - // minidump id are controlled by the server process and are not communicated - // back to the crashing process. - typedef bool (*MinidumpCallback)(const wchar_t* dump_path, - const wchar_t* minidump_id, - void* context, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion, - bool succeeded); - - // HandlerType specifies which types of handlers should be installed, if - // any. Use HANDLER_NONE for an ExceptionHandler that remains idle, - // without catching any failures on its own. This type of handler may - // still be triggered by calling WriteMinidump. Otherwise, use a - // combination of the other HANDLER_ values, or HANDLER_ALL to install - // all handlers. - enum HandlerType { - HANDLER_NONE = 0, - HANDLER_EXCEPTION = 1 << 0, // SetUnhandledExceptionFilter - HANDLER_INVALID_PARAMETER = 1 << 1, // _set_invalid_parameter_handler - HANDLER_PURECALL = 1 << 2, // _set_purecall_handler - HANDLER_ALL = HANDLER_EXCEPTION | - HANDLER_INVALID_PARAMETER | - HANDLER_PURECALL - }; - - // Creates a new ExceptionHandler instance to handle writing minidumps. - // Before writing a minidump, the optional filter callback will be called. - // Its return value determines whether or not Breakpad should write a - // minidump. Minidump files will be written to dump_path, and the optional - // callback is called after writing the dump file, as described above. - // handler_types specifies the types of handlers that should be installed. - ExceptionHandler(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types); - - // Creates a new ExceptionHandler instance that can attempt to perform - // out-of-process dump generation if pipe_name is not NULL. If pipe_name is - // NULL, or if out-of-process dump generation registration step fails, - // in-process dump generation will be used. This also allows specifying - // the dump type to generate. - ExceptionHandler(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - MINIDUMP_TYPE dump_type, - const wchar_t* pipe_name, - const CustomClientInfo* custom_info); - - // As above, creates a new ExceptionHandler instance to perform - // out-of-process dump generation if the given pipe_handle is not NULL. - ExceptionHandler(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - MINIDUMP_TYPE dump_type, - HANDLE pipe_handle, - const CustomClientInfo* custom_info); - - // ExceptionHandler that ENSURES out-of-process dump generation. Expects a - // crash generation client that is already registered with a crash generation - // server. Takes ownership of the passed-in crash_generation_client. - // - // Usage example: - // crash_generation_client = new CrashGenerationClient(..); - // if (crash_generation_client->Register()) { - // // Registration with the crash generation server succeeded. - // // Out-of-process dump generation is guaranteed. - // g_handler = new ExceptionHandler(.., crash_generation_client, ..); - // return true; - // } - ExceptionHandler(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - CrashGenerationClient* crash_generation_client); - - ~ExceptionHandler(); - - // Get and set the minidump path. - wstring dump_path() const { return dump_path_; } - void set_dump_path(const wstring &dump_path) { - dump_path_ = dump_path; - dump_path_c_ = dump_path_.c_str(); - UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_. - } - - // Requests that a previously reported crash be uploaded. - bool RequestUpload(DWORD crash_id); - - // Writes a minidump immediately. This can be used to capture the - // execution state independently of a crash. Returns true on success. - bool WriteMinidump(); - - // Writes a minidump immediately, with the user-supplied exception - // information. - bool WriteMinidumpForException(EXCEPTION_POINTERS* exinfo); - - // Convenience form of WriteMinidump which does not require an - // ExceptionHandler instance. - static bool WriteMinidump(const wstring &dump_path, - MinidumpCallback callback, void* callback_context); - - // Write a minidump of |child| immediately. This can be used to - // capture the execution state of |child| independently of a crash. - // Pass a meaningful |child_blamed_thread| to make that thread in - // the child process the one from which a crash signature is - // extracted. - static bool WriteMinidumpForChild(HANDLE child, - DWORD child_blamed_thread, - const wstring& dump_path, - MinidumpCallback callback, - void* callback_context); - - // Get the thread ID of the thread requesting the dump (either the exception - // thread or any other thread that called WriteMinidump directly). This - // may be useful if you want to include additional thread state in your - // dumps. - DWORD get_requesting_thread_id() const { return requesting_thread_id_; } - - // Controls behavior of EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP. - bool get_handle_debug_exceptions() const { return handle_debug_exceptions_; } - void set_handle_debug_exceptions(bool handle_debug_exceptions) { - handle_debug_exceptions_ = handle_debug_exceptions; - } - - // Controls behavior of EXCEPTION_INVALID_HANDLE. - bool get_consume_invalid_handle_exceptions() const { - return consume_invalid_handle_exceptions_; - } - void set_consume_invalid_handle_exceptions( - bool consume_invalid_handle_exceptions) { - consume_invalid_handle_exceptions_ = consume_invalid_handle_exceptions; - } - - // Returns whether out-of-process dump generation is used or not. - bool IsOutOfProcess() const { return crash_generation_client_.get() != NULL; } - - // Calling RegisterAppMemory(p, len) causes len bytes starting - // at address p to be copied to the minidump when a crash happens. - void RegisterAppMemory(void* ptr, size_t length); - void UnregisterAppMemory(void* ptr); - - private: - friend class AutoExceptionHandler; - - // Initializes the instance with given values. - void Initialize(const wstring& dump_path, - FilterCallback filter, - MinidumpCallback callback, - void* callback_context, - int handler_types, - MINIDUMP_TYPE dump_type, - const wchar_t* pipe_name, - HANDLE pipe_handle, - CrashGenerationClient* crash_generation_client, - const CustomClientInfo* custom_info); - - // Function pointer type for MiniDumpWriteDump, which is looked up - // dynamically. - typedef BOOL (WINAPI *MiniDumpWriteDump_type)( - HANDLE hProcess, - DWORD dwPid, - HANDLE hFile, - MINIDUMP_TYPE DumpType, - CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, - CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, - CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam); - - // Function pointer type for UuidCreate, which is looked up dynamically. - typedef RPC_STATUS (RPC_ENTRY *UuidCreate_type)(UUID* Uuid); - - // Runs the main loop for the exception handler thread. - static DWORD WINAPI ExceptionHandlerThreadMain(void* lpParameter); - - // Called on the exception thread when an unhandled exception occurs. - // Signals the exception handler thread to handle the exception. - static LONG WINAPI HandleException(EXCEPTION_POINTERS* exinfo); - -#if _MSC_VER >= 1400 // MSVC 2005/8 - // This function will be called by some CRT functions when they detect - // that they were passed an invalid parameter. Note that in _DEBUG builds, - // the CRT may display an assertion dialog before calling this function, - // and the function will not be called unless the assertion dialog is - // dismissed by clicking "Ignore." - static void HandleInvalidParameter(const wchar_t* expression, - const wchar_t* function, - const wchar_t* file, - unsigned int line, - uintptr_t reserved); -#endif // _MSC_VER >= 1400 - - // This function will be called by the CRT when a pure virtual - // function is called. - static void HandlePureVirtualCall(); - - // This is called on the exception thread or on another thread that - // the user wishes to produce a dump from. It calls - // WriteMinidumpWithException on the handler thread, avoiding stack - // overflows and inconsistent dumps due to writing the dump from - // the exception thread. If the dump is requested as a result of an - // exception, exinfo contains exception information, otherwise, it - // is NULL. If the dump is requested as a result of an assertion - // (such as an invalid parameter being passed to a CRT function), - // assertion contains data about the assertion, otherwise, it is NULL. - bool WriteMinidumpOnHandlerThread(EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion); - - // This function is called on the handler thread. It calls into - // WriteMinidumpWithExceptionForProcess() with a handle to the - // current process. requesting_thread_id is the ID of the thread - // that requested the dump. If the dump is requested as a result of - // an exception, exinfo contains exception information, otherwise, - // it is NULL. - bool WriteMinidumpWithException(DWORD requesting_thread_id, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion); - - // This function is used as a callback when calling MinidumpWriteDump, - // in order to add additional memory regions to the dump. - static BOOL CALLBACK MinidumpWriteDumpCallback( - PVOID context, - const PMINIDUMP_CALLBACK_INPUT callback_input, - PMINIDUMP_CALLBACK_OUTPUT callback_output); - - // This function does the actual writing of a minidump. It is - // called on the handler thread. requesting_thread_id is the ID of - // the thread that requested the dump, if that information is - // meaningful. If the dump is requested as a result of an - // exception, exinfo contains exception information, otherwise, it - // is NULL. process is the one that will be dumped. If - // requesting_thread_id is meaningful and should be added to the - // minidump, write_requester_stream is |true|. - bool WriteMinidumpWithExceptionForProcess(DWORD requesting_thread_id, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion, - HANDLE process, - bool write_requester_stream); - - // Generates a new ID and stores it in next_minidump_id_, and stores the - // path of the next minidump to be written in next_minidump_path_. - void UpdateNextID(); - - FilterCallback filter_; - MinidumpCallback callback_; - void* callback_context_; - - scoped_ptr crash_generation_client_; - - // The directory in which a minidump will be written, set by the dump_path - // argument to the constructor, or set_dump_path. - wstring dump_path_; - - // The basename of the next minidump to be written, without the extension. - wstring next_minidump_id_; - - // The full pathname of the next minidump to be written, including the file - // extension. - wstring next_minidump_path_; - - // Pointers to C-string representations of the above. These are set when - // the above wstring versions are set in order to avoid calling c_str during - // an exception, as c_str may attempt to allocate heap memory. These - // pointers are not owned by the ExceptionHandler object, but their lifetimes - // should be equivalent to the lifetimes of the associated wstring, provided - // that the wstrings are not altered. - const wchar_t* dump_path_c_; - const wchar_t* next_minidump_id_c_; - const wchar_t* next_minidump_path_c_; - - HMODULE dbghelp_module_; - MiniDumpWriteDump_type minidump_write_dump_; - MINIDUMP_TYPE dump_type_; - - HMODULE rpcrt4_module_; - UuidCreate_type uuid_create_; - - // Tracks the handler types that were installed according to the - // handler_types constructor argument. - int handler_types_; - - // When installed_handler_ is true, previous_filter_ is the unhandled - // exception filter that was set prior to installing ExceptionHandler as - // the unhandled exception filter and pointing it to |this|. NULL indicates - // that there is no previous unhandled exception filter. - LPTOP_LEVEL_EXCEPTION_FILTER previous_filter_; - -#if _MSC_VER >= 1400 // MSVC 2005/8 - // Beginning in VC 8, the CRT provides an invalid parameter handler that will - // be called when some CRT functions are passed invalid parameters. In - // earlier CRTs, the same conditions would cause unexpected behavior or - // crashes. - _invalid_parameter_handler previous_iph_; -#endif // _MSC_VER >= 1400 - - // The CRT allows you to override the default handler for pure - // virtual function calls. - _purecall_handler previous_pch_; - - // The exception handler thread. - HANDLE handler_thread_; - - // True if the exception handler is being destroyed. - // Starting with MSVC 2005, Visual C has stronger guarantees on volatile vars. - // It has release semantics on write and acquire semantics on reads. - // See the msdn documentation. - volatile bool is_shutdown_; - - // The critical section enforcing the requirement that only one exception be - // handled by a handler at a time. - CRITICAL_SECTION handler_critical_section_; - - // Semaphores used to move exception handling between the exception thread - // and the handler thread. handler_start_semaphore_ is signalled by the - // exception thread to wake up the handler thread when an exception occurs. - // handler_finish_semaphore_ is signalled by the handler thread to wake up - // the exception thread when handling is complete. - HANDLE handler_start_semaphore_; - HANDLE handler_finish_semaphore_; - - // The next 2 fields contain data passed from the requesting thread to - // the handler thread. - - // The thread ID of the thread requesting the dump (either the exception - // thread or any other thread that called WriteMinidump directly). - DWORD requesting_thread_id_; - - // The exception info passed to the exception handler on the exception - // thread, if an exception occurred. NULL for user-requested dumps. - EXCEPTION_POINTERS* exception_info_; - - // If the handler is invoked due to an assertion, this will contain a - // pointer to the assertion information. It is NULL at other times. - MDRawAssertionInfo* assertion_; - - // The return value of the handler, passed from the handler thread back to - // the requesting thread. - bool handler_return_value_; - - // If true, the handler will intercept EXCEPTION_BREAKPOINT and - // EXCEPTION_SINGLE_STEP exceptions. Leave this false (the default) - // to not interfere with debuggers. - bool handle_debug_exceptions_; - - // If true, the handler will consume any EXCEPTION_INVALID_HANDLE exceptions. - // Leave this false (the default) to handle these exceptions as normal. - bool consume_invalid_handle_exceptions_; - - // Callers can request additional memory regions to be included in - // the dump. - AppMemoryList app_memory_info_; - - // A stack of ExceptionHandler objects that have installed unhandled - // exception filters. This vector is used by HandleException to determine - // which ExceptionHandler object to route an exception to. When an - // ExceptionHandler is created with install_handler true, it will append - // itself to this list. - static vector* handler_stack_; - - // The index of the ExceptionHandler in handler_stack_ that will handle the - // next exception. Note that 0 means the last entry in handler_stack_, 1 - // means the next-to-last entry, and so on. This is used by HandleException - // to support multiple stacked Breakpad handlers. - static LONG handler_stack_index_; - - // handler_stack_critical_section_ guards operations on handler_stack_ and - // handler_stack_index_. The critical section is initialized by the - // first instance of the class and destroyed by the last instance of it. - static CRITICAL_SECTION handler_stack_critical_section_; - - // The number of instances of this class. - static volatile LONG instance_count_; - - // disallow copy ctor and operator= - explicit ExceptionHandler(const ExceptionHandler &); - void operator=(const ExceptionHandler &); -}; - -} // namespace google_breakpad - -#pragma warning(pop) - -#endif // CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__ diff --git a/Telegram/ThirdParty/breakpad/common/convert_UTF.c b/Telegram/ThirdParty/breakpad/common/convert_UTF.c deleted file mode 100644 index 12a3c89174..0000000000 --- a/Telegram/ThirdParty/breakpad/common/convert_UTF.c +++ /dev/null @@ -1,554 +0,0 @@ -/* - * Copyright © 1991-2015 Unicode, Inc. All rights reserved. - * Distributed under the Terms of Use in - * http://www.unicode.org/copyright.html. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of the Unicode data files and any associated documentation - * (the "Data Files") or Unicode software and any associated documentation - * (the "Software") to deal in the Data Files or Software - * without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, and/or sell copies of - * the Data Files or Software, and to permit persons to whom the Data Files - * or Software are furnished to do so, provided that - * (a) this copyright and permission notice appear with all copies - * of the Data Files or Software, - * (b) this copyright and permission notice appear in associated - * documentation, and - * (c) there is clear notice in each modified Data File or in the Software - * as well as in the documentation associated with the Data File(s) or - * Software that the data or software has been modified. - * - * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF - * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS - * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL - * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THE DATA FILES OR SOFTWARE. - * - * Except as contained in this notice, the name of a copyright holder - * shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in these Data Files or Software without prior - * written authorization of the copyright holder. - */ - -/* --------------------------------------------------------------------- - -Conversions between UTF32, UTF-16, and UTF-8. Source code file. -Author: Mark E. Davis, 1994. -Rev History: Rick McGowan, fixes & updates May 2001. -Sept 2001: fixed const & error conditions per -mods suggested by S. Parent & A. Lillich. -June 2002: Tim Dodd added detection and handling of incomplete -source sequences, enhanced error detection, added casts -to eliminate compiler warnings. -July 2003: slight mods to back out aggressive FFFE detection. -Jan 2004: updated switches in from-UTF8 conversions. -Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. - -See the header file "ConvertUTF.h" for complete documentation. - ------------------------------------------------------------------------- */ - - -#include "convert_UTF.h" -#ifdef CVTUTF_DEBUG -#include -#endif - -static const int halfShift = 10; /* used for shifting by 10 bits */ - -static const UTF32 halfBase = 0x0010000UL; -static const UTF32 halfMask = 0x3FFUL; - -#define UNI_SUR_HIGH_START (UTF32)0xD800 -#define UNI_SUR_HIGH_END (UTF32)0xDBFF -#define UNI_SUR_LOW_START (UTF32)0xDC00 -#define UNI_SUR_LOW_END (UTF32)0xDFFF - -#ifndef false -#define false 0 -#endif -#ifndef true -#define true 1 -#endif - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF32* source = *sourceStart; - UTF16* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - if (target >= targetEnd) { - result = targetExhausted; break; - } - ch = *source++; - if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ - /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = (UTF16)ch; /* normal case */ - } - } else if (ch > UNI_MAX_LEGAL_UTF32) { - if (flags == strictConversion) { - result = sourceIllegal; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - /* target is a character in range 0xFFFF - 0x10FFFF. */ - if (target + 1 >= targetEnd) { - --source; /* Back up source pointer! */ - result = targetExhausted; break; - } - ch -= halfBase; - *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); - *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); - } - } -*sourceStart = source; -*targetStart = target; -return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF16* source = *sourceStart; - UTF32* target = *targetStart; - UTF32 ch, ch2; - while (source < sourceEnd) { - const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ - ch = *source++; - /* If we have a surrogate pair, convert to UTF32 first. */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - /* If the 16 bits following the high surrogate are in the source buffer... */ - if (source < sourceEnd) { - ch2 = *source; - /* If it's a low surrogate, convert to UTF32. */ - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - ++source; - } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } else { /* We don't have the 16 bits following the high surrogate. */ - --source; /* return to the high surrogate */ - result = sourceExhausted; - break; - } - } else if (flags == strictConversion) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - if (target >= targetEnd) { - source = oldSource; /* Back up source pointer! */ - result = targetExhausted; break; - } - *target++ = ch; - } - *sourceStart = source; - *targetStart = target; -#ifdef CVTUTF_DEBUG - if (result == sourceIllegal) { - fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); - fflush(stderr); - } -#endif - return result; -} - -/* --------------------------------------------------------------------- */ - -/* - * Index into the table below with the first byte of a UTF-8 sequence to - * get the number of trailing bytes that are supposed to follow it. - * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is - * left as-is for anyone who may want to do such conversion, which was - * allowed in earlier algorithms. - */ -static const char trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -/* - * Magic values subtracted from a buffer value during UTF8 conversion. - * This table contains as many values as there might be trailing bytes - * in a UTF-8 sequence. - */ -static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, - 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; - -/* - * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed - * into the first byte, depending on how many bytes follow. There are - * as many entries in this table as there are UTF-8 sequence types. - * (I.e., one byte sequence, two byte... etc.). Remember that sequencs - * for *legal* UTF-8 will be 4 or fewer bytes total. - */ -static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - -/* --------------------------------------------------------------------- */ - -/* The interface converts a whole buffer to avoid function-call overhead. -* Constants have been gathered. Loops & conditionals have been removed as -* much as possible for efficiency, in favor of drop-through switches. -* (See "Note A" at the bottom of the file for equivalent code.) -* If your compiler supports it, the "isLegalUTF8" call can be turned -* into an inline function. -*/ - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF16* source = *sourceStart; - UTF8* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - unsigned short bytesToWrite = 0; - const UTF32 byteMask = 0xBF; - const UTF32 byteMark = 0x80; - const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ - ch = *source++; - /* If we have a surrogate pair, convert to UTF32 first. */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - /* If the 16 bits following the high surrogate are in the source buffer... */ - if (source < sourceEnd) { - UTF32 ch2 = *source; - /* If it's a low surrogate, convert to UTF32. */ - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - ++source; - } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } else { /* We don't have the 16 bits following the high surrogate. */ - --source; /* return to the high surrogate */ - result = sourceExhausted; - break; - } - } else if (flags == strictConversion) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - /* Figure out how many bytes the result will require */ - if (ch < (UTF32)0x80) { bytesToWrite = 1; - } else if (ch < (UTF32)0x800) { bytesToWrite = 2; - } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; - } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; - } else { bytesToWrite = 3; - ch = UNI_REPLACEMENT_CHAR; - } - - target += bytesToWrite; - if (target > targetEnd) { - source = oldSource; /* Back up source pointer! */ - target -= bytesToWrite; result = targetExhausted; break; - } - switch (bytesToWrite) { /* note: everything falls through. */ - case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } -*sourceStart = source; -*targetStart = target; -return result; -} - -/* --------------------------------------------------------------------- */ - -/* - * Utility routine to tell whether a sequence of bytes is legal UTF-8. - * This must be called with the length pre-determined by the first byte. - * If not calling this from ConvertUTF8to*, then the length can be set by: - * length = trailingBytesForUTF8[*source]+1; - * and the sequence is illegal right away if there aren't that many bytes - * available. - * If presented with a length > 4, this returns false. The Unicode - * definition of UTF-8 goes up to 4-byte sequences. - */ - -static Boolean isLegalUTF8(const UTF8 *source, int length) { - UTF8 a; - const UTF8 *srcptr = source+length; - switch (length) { - default: return false; - /* Everything else falls through when "true"... */ - case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 2: if ((a = (*--srcptr)) > 0xBF) return false; - - switch (*source) { - /* no fall-through in this inner switch */ - case 0xE0: if (a < 0xA0) return false; break; - case 0xED: if (a > 0x9F) return false; break; - case 0xF0: if (a < 0x90) return false; break; - case 0xF4: if (a > 0x8F) return false; break; - default: if (a < 0x80) return false; - } - - case 1: if (*source >= 0x80 && *source < 0xC2) return false; - } - if (*source > 0xF4) return false; - return true; -} - -/* --------------------------------------------------------------------- */ - -/* - * Exported function to return whether a UTF-8 sequence is legal or not. - * This is not used here; it's just exported. - */ -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { - int length = trailingBytesForUTF8[*source]+1; - if (source+length > sourceEnd) { - return false; - } - return isLegalUTF8(source, length); -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF8* source = *sourceStart; - UTF16* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; - if (source + extraBytesToRead >= sourceEnd) { - result = sourceExhausted; break; - } - /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead+1)) { - result = sourceIllegal; - break; - } - /* - * The cases all fall through. See "Note A" below. - */ - switch (extraBytesToRead) { - case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ - case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ - case 3: ch += *source++; ch <<= 6; - case 2: ch += *source++; ch <<= 6; - case 1: ch += *source++; ch <<= 6; - case 0: ch += *source++; - } - ch -= offsetsFromUTF8[extraBytesToRead]; - - if (target >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up source pointer! */ - result = targetExhausted; break; - } - if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - source -= (extraBytesToRead+1); /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = (UTF16)ch; /* normal case */ - } - } else if (ch > UNI_MAX_UTF16) { - if (flags == strictConversion) { - result = sourceIllegal; - source -= (extraBytesToRead+1); /* return to the start */ - break; /* Bail out; shouldn't continue */ - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - /* target is a character in range 0xFFFF - 0x10FFFF. */ - if (target + 1 >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up source pointer! */ - result = targetExhausted; break; - } - ch -= halfBase; - *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); - *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); - } - } -*sourceStart = source; -*targetStart = target; -return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF32* source = *sourceStart; - UTF8* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - unsigned short bytesToWrite = 0; - const UTF32 byteMask = 0xBF; - const UTF32 byteMark = 0x80; - ch = *source++; - if (flags == strictConversion ) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - /* - * Figure out how many bytes the result will require. Turn any - * illegally large UTF32 things (> Plane 17) into replacement chars. - */ - if (ch < (UTF32)0x80) { bytesToWrite = 1; - } else if (ch < (UTF32)0x800) { bytesToWrite = 2; - } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; - } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; - } else { bytesToWrite = 3; - ch = UNI_REPLACEMENT_CHAR; - result = sourceIllegal; - } - - target += bytesToWrite; - if (target > targetEnd) { - --source; /* Back up source pointer! */ - target -= bytesToWrite; result = targetExhausted; break; - } - switch (bytesToWrite) { /* note: everything falls through. */ - case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } -*sourceStart = source; -*targetStart = target; -return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF8* source = *sourceStart; - UTF32* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; - if (source + extraBytesToRead >= sourceEnd) { - result = sourceExhausted; break; - } - /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead+1)) { - result = sourceIllegal; - break; - } - /* - * The cases all fall through. See "Note A" below. - */ - switch (extraBytesToRead) { - case 5: ch += *source++; ch <<= 6; - case 4: ch += *source++; ch <<= 6; - case 3: ch += *source++; ch <<= 6; - case 2: ch += *source++; ch <<= 6; - case 1: ch += *source++; ch <<= 6; - case 0: ch += *source++; - } - ch -= offsetsFromUTF8[extraBytesToRead]; - - if (target >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up the source pointer! */ - result = targetExhausted; break; - } - if (ch <= UNI_MAX_LEGAL_UTF32) { - /* - * UTF-16 surrogate values are illegal in UTF-32, and anything - * over Plane 17 (> 0x10FFFF) is illegal. - */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - source -= (extraBytesToRead+1); /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = ch; - } - } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ - result = sourceIllegal; - *target++ = UNI_REPLACEMENT_CHAR; - } - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- - -Note A. -The fall-through switches in UTF-8 reading code save a -temp variable, some decrements & conditionals. The switches -are equivalent to the following loop: -{ - int tmpBytesToRead = extraBytesToRead+1; - do { - ch += *source++; - --tmpBytesToRead; - if (tmpBytesToRead) ch <<= 6; - } while (tmpBytesToRead > 0); -} -In UTF-8 writing code, the switches on "bytesToWrite" are -similarly unrolled loops. - ---------------------------------------------------------------------- */ diff --git a/Telegram/ThirdParty/breakpad/common/convert_UTF.h b/Telegram/ThirdParty/breakpad/common/convert_UTF.h deleted file mode 100644 index 644d099506..0000000000 --- a/Telegram/ThirdParty/breakpad/common/convert_UTF.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright © 1991-2015 Unicode, Inc. All rights reserved. - * Distributed under the Terms of Use in - * http://www.unicode.org/copyright.html. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of the Unicode data files and any associated documentation - * (the "Data Files") or Unicode software and any associated documentation - * (the "Software") to deal in the Data Files or Software - * without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, and/or sell copies of - * the Data Files or Software, and to permit persons to whom the Data Files - * or Software are furnished to do so, provided that - * (a) this copyright and permission notice appear with all copies - * of the Data Files or Software, - * (b) this copyright and permission notice appear in associated - * documentation, and - * (c) there is clear notice in each modified Data File or in the Software - * as well as in the documentation associated with the Data File(s) or - * Software that the data or software has been modified. - * - * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF - * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS - * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL - * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THE DATA FILES OR SOFTWARE. - * - * Except as contained in this notice, the name of a copyright holder - * shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in these Data Files or Software without prior - * written authorization of the copyright holder. - */ - -#ifndef COMMON_CONVERT_UTF_H_ -#define COMMON_CONVERT_UTF_H_ - -/* --------------------------------------------------------------------- - -Conversions between UTF32, UTF-16, and UTF-8. Header file. - -Several funtions are included here, forming a complete set of -conversions between the three formats. UTF-7 is not included -here, but is handled in a separate source file. - -Each of these routines takes pointers to input buffers and output -buffers. The input buffers are const. - -Each routine converts the text between *sourceStart and sourceEnd, -putting the result into the buffer between *targetStart and -targetEnd. Note: the end pointers are *after* the last item: e.g. -*(sourceEnd - 1) is the last item. - -The return result indicates whether the conversion was successful, -and if not, whether the problem was in the source or target buffers. -(Only the first encountered problem is indicated.) - -After the conversion, *sourceStart and *targetStart are both -updated to point to the end of last text successfully converted in -the respective buffers. - -Input parameters: -sourceStart - pointer to a pointer to the source buffer. -The contents of this are modified on return so that -it points at the next thing to be converted. -targetStart - similarly, pointer to pointer to the target buffer. -sourceEnd, targetEnd - respectively pointers to the ends of the -two buffers, for overflow checking only. - -These conversion functions take a ConversionFlags argument. When this -flag is set to strict, both irregular sequences and isolated surrogates -will cause an error. When the flag is set to lenient, both irregular -sequences and isolated surrogates are converted. - -Whether the flag is strict or lenient, all illegal sequences will cause -an error return. This includes sequences such as: , , -or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code -must check for illegal sequences. - -When the flag is set to lenient, characters over 0x10FFFF are converted -to the replacement character; otherwise (when the flag is set to strict) -they constitute an error. - -Output parameters: -The value "sourceIllegal" is returned from some routines if the input -sequence is malformed. When "sourceIllegal" is returned, the source -value will point to the illegal value that caused the problem. E.g., -in UTF-8 when a sequence is malformed, it points to the start of the -malformed sequence. - -Author: Mark E. Davis, 1994. -Rev History: Rick McGowan, fixes & updates May 2001. -Fixes & updates, Sept 2001. - ------------------------------------------------------------------------- */ - -/* --------------------------------------------------------------------- -The following 4 definitions are compiler-specific. -The C standard does not guarantee that wchar_t has at least -16 bits, so wchar_t is no less portable than unsigned short! -All should be unsigned values to avoid sign extension during -bit mask & shift operations. ------------------------------------------------------------------------- */ - -typedef unsigned long UTF32; /* at least 32 bits */ -typedef unsigned short UTF16; /* at least 16 bits */ -typedef unsigned char UTF8; /* typically 8 bits */ -typedef unsigned char Boolean; /* 0 or 1 */ - -/* Some fundamental constants */ -#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD -#define UNI_MAX_BMP (UTF32)0x0000FFFF -#define UNI_MAX_UTF16 (UTF32)0x0010FFFF -#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF -#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF - -typedef enum { - conversionOK, /* conversion successful */ - sourceExhausted, /* partial character in source, but hit end */ - targetExhausted, /* insuff. room in target for conversion */ - sourceIllegal /* source sequence is illegal/malformed */ -} ConversionResult; - -typedef enum { - strictConversion = 0, - lenientConversion -} ConversionFlags; - -/* This is for C++ and does no harm in C */ -#ifdef __cplusplus -extern "C" { -#endif - -ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); - -Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); - -#ifdef __cplusplus -} -#endif - -/* --------------------------------------------------------------------- */ - -#endif // COMMON_CONVERT_UTF_H_ diff --git a/Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h b/Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h deleted file mode 100644 index ec5a8d6b6b..0000000000 --- a/Telegram/ThirdParty/breakpad/common/linux/linux_libc_support.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This header provides replacements for libc functions that we need. We if -// call the libc functions directly we risk crashing in the dynamic linker as -// it tries to resolve uncached PLT entries. - -#ifndef CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_ -#define CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_ - -#include -#include -#include - -extern "C" { - -extern size_t my_strlen(const char* s); - -extern int my_strcmp(const char* a, const char* b); - -extern int my_strncmp(const char* a, const char* b, size_t len); - -// Parse a non-negative integer. -// result: (output) the resulting non-negative integer -// s: a NUL terminated string -// Return true iff successful. -extern bool my_strtoui(int* result, const char* s); - -// Return the length of the given unsigned integer when expressed in base 10. -extern unsigned my_uint_len(uintmax_t i); - -// Convert an unsigned integer to a string -// output: (output) the resulting string is written here. This buffer must be -// large enough to hold the resulting string. Call |my_uint_len| to get the -// required length. -// i: the unsigned integer to serialise. -// i_len: the length of the integer in base 10 (see |my_uint_len|). -extern void my_uitos(char* output, uintmax_t i, unsigned i_len); - -extern const char* my_strchr(const char* haystack, char needle); - -extern const char* my_strrchr(const char* haystack, char needle); - -// Read a hex value -// result: (output) the resulting value -// s: a string -// Returns a pointer to the first invalid charactor. -extern const char* my_read_hex_ptr(uintptr_t* result, const char* s); - -extern const char* my_read_decimal_ptr(uintptr_t* result, const char* s); - -extern void my_memset(void* ip, char c, size_t len); - -extern void* my_memchr(const void* src, int c, size_t len); - -// The following are considered safe to use in a compromised environment. -// Besides, this gives the compiler an opportunity to optimize their calls. -#define my_memcpy memcpy -#define my_memmove memmove -#define my_memcmp memcmp - -extern size_t my_strlcpy(char* s1, const char* s2, size_t len); - -extern size_t my_strlcat(char* s1, const char* s2, size_t len); - -extern int my_isspace(int ch); - -} // extern "C" - -#endif // CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/MachIPC.h b/Telegram/ThirdParty/breakpad/common/mac/MachIPC.h deleted file mode 100644 index 8df9165bb3..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/MachIPC.h +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// MachIPC.h -// -// Some helpful wrappers for using Mach IPC calls - -#ifndef MACH_IPC_H__ -#define MACH_IPC_H__ - -#import -#import -#import -#import - -#import - -//============================================================================== -// DISCUSSION: -// -// The three main classes of interest are -// -// MachMessage: a wrapper for a mach message of the following form -// mach_msg_header_t -// mach_msg_body_t -// optional descriptors -// optional extra message data -// -// MachReceiveMessage and MachSendMessage subclass MachMessage -// and are used instead of MachMessage which is an abstract base class -// -// ReceivePort: -// Represents a mach port for which we have receive rights -// -// MachPortSender: -// Represents a mach port for which we have send rights -// -// Here's an example to receive a message on a server port: -// -// // This creates our named server port -// ReceivePort receivePort("com.Google.MyService"); -// -// MachReceiveMessage message; -// kern_return_t result = receivePort.WaitForMessage(&message, 0); -// -// if (result == KERN_SUCCESS && message.GetMessageID() == 57) { -// mach_port_t task = message.GetTranslatedPort(0); -// mach_port_t thread = message.GetTranslatedPort(1); -// -// char *messageString = message.GetData(); -// -// printf("message string = %s\n", messageString); -// } -// -// Here is an example of using these classes to send a message to this port: -// -// // send to already named port -// MachPortSender sender("com.Google.MyService"); -// MachSendMessage message(57); // our message ID is 57 -// -// // add some ports to be translated for us -// message.AddDescriptor(mach_task_self()); // our task -// message.AddDescriptor(mach_thread_self()); // this thread -// -// char messageString[] = "Hello server!\n"; -// message.SetData(messageString, strlen(messageString)+1); -// -// kern_return_t result = sender.SendMessage(message, 1000); // timeout 1000ms -// - -namespace google_breakpad { -#define PRINT_MACH_RESULT(result_, message_) \ - printf(message_" %s (%d)\n", mach_error_string(result_), result_ ); - -//============================================================================== -// A wrapper class for mach_msg_port_descriptor_t (with same memory layout) -// with convenient constructors and accessors -class MachMsgPortDescriptor : public mach_msg_port_descriptor_t { - public: - // General-purpose constructor - MachMsgPortDescriptor(mach_port_t in_name, - mach_msg_type_name_t in_disposition) { - name = in_name; - pad1 = 0; - pad2 = 0; - disposition = in_disposition; - type = MACH_MSG_PORT_DESCRIPTOR; - } - - // For passing send rights to a port - MachMsgPortDescriptor(mach_port_t in_name) { - name = in_name; - pad1 = 0; - pad2 = 0; - disposition = MACH_MSG_TYPE_COPY_SEND; - type = MACH_MSG_PORT_DESCRIPTOR; - } - - // Copy constructor - MachMsgPortDescriptor(const MachMsgPortDescriptor& desc) { - name = desc.name; - pad1 = desc.pad1; - pad2 = desc.pad2; - disposition = desc.disposition; - type = desc.type; - } - - mach_port_t GetMachPort() const { - return name; - } - - mach_msg_type_name_t GetDisposition() const { - return disposition; - } - - // For convenience - operator mach_port_t() const { - return GetMachPort(); - } -}; - -//============================================================================== -// MachMessage: a wrapper for a mach message -// (mach_msg_header_t, mach_msg_body_t, extra data) -// -// This considerably simplifies the construction of a message for sending -// and the getting at relevant data and descriptors for the receiver. -// -// Currently the combined size of the descriptors plus data must be -// less than 1024. But as a benefit no memory allocation is necessary. -// -// TODO: could consider adding malloc() support for very large messages -// -// A MachMessage object is used by ReceivePort::WaitForMessage -// and MachPortSender::SendMessage -// -class MachMessage { - public: - - // The receiver of the message can retrieve the raw data this way - uint8_t *GetData() { - return GetDataLength() > 0 ? GetDataPacket()->data : NULL; - } - - uint32_t GetDataLength() { - return EndianU32_LtoN(GetDataPacket()->data_length); - } - - // The message ID may be used as a code identifying the type of message - void SetMessageID(int32_t message_id) { - GetDataPacket()->id = EndianU32_NtoL(message_id); - } - - int32_t GetMessageID() { return EndianU32_LtoN(GetDataPacket()->id); } - - // Adds a descriptor (typically a mach port) to be translated - // returns true if successful, otherwise not enough space - bool AddDescriptor(const MachMsgPortDescriptor &desc); - - int GetDescriptorCount() const { return body.msgh_descriptor_count; } - MachMsgPortDescriptor *GetDescriptor(int n); - - // Convenience method which gets the mach port described by the descriptor - mach_port_t GetTranslatedPort(int n); - - // A simple message is one with no descriptors - bool IsSimpleMessage() const { return GetDescriptorCount() == 0; } - - // Sets raw data for the message (returns false if not enough space) - bool SetData(void *data, int32_t data_length); - - protected: - // Consider this an abstract base class - must create an actual instance - // of MachReceiveMessage or MachSendMessage - - MachMessage() { - memset(this, 0, sizeof(MachMessage)); - } - - friend class ReceivePort; - friend class MachPortSender; - - // Represents raw data in our message - struct MessageDataPacket { - int32_t id; // little-endian - int32_t data_length; // little-endian - uint8_t data[1]; // actual size limited by sizeof(MachMessage) - }; - - MessageDataPacket* GetDataPacket(); - - void SetDescriptorCount(int n); - void SetDescriptor(int n, const MachMsgPortDescriptor &desc); - - // Returns total message size setting msgh_size in the header to this value - mach_msg_size_t CalculateSize(); - - mach_msg_header_t head; - mach_msg_body_t body; - uint8_t padding[1024]; // descriptors and data may be embedded here -}; - -//============================================================================== -// MachReceiveMessage and MachSendMessage are useful to separate the idea -// of a mach message being sent and being received, and adds increased type -// safety: -// ReceivePort::WaitForMessage() only accepts a MachReceiveMessage -// MachPortSender::SendMessage() only accepts a MachSendMessage - -//============================================================================== -class MachReceiveMessage : public MachMessage { - public: - MachReceiveMessage() : MachMessage() {}; -}; - -//============================================================================== -class MachSendMessage : public MachMessage { - public: - MachSendMessage(int32_t message_id); -}; - -//============================================================================== -// Represents a mach port for which we have receive rights -class ReceivePort { - public: - // Creates a new mach port for receiving messages and registers a name for it - explicit ReceivePort(const char *receive_port_name); - - // Given an already existing mach port, use it. We take ownership of the - // port and deallocate it in our destructor. - explicit ReceivePort(mach_port_t receive_port); - - // Create a new mach port for receiving messages - ReceivePort(); - - ~ReceivePort(); - - // Waits on the mach port until message received or timeout - kern_return_t WaitForMessage(MachReceiveMessage *out_message, - mach_msg_timeout_t timeout); - - // The underlying mach port that we wrap - mach_port_t GetPort() const { return port_; } - - private: - ReceivePort(const ReceivePort&); // disable copy c-tor - - mach_port_t port_; - kern_return_t init_result_; -}; - -//============================================================================== -// Represents a mach port for which we have send rights -class MachPortSender { - public: - // get a port with send rights corresponding to a named registered service - explicit MachPortSender(const char *receive_port_name); - - - // Given an already existing mach port, use it. - explicit MachPortSender(mach_port_t send_port); - - kern_return_t SendMessage(MachSendMessage &message, - mach_msg_timeout_t timeout); - - private: - MachPortSender(const MachPortSender&); // disable copy c-tor - - mach_port_t send_port_; - kern_return_t init_result_; -}; - -} // namespace google_breakpad - -#endif // MACH_IPC_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm b/Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm deleted file mode 100644 index dc9773f77a..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/MachIPC.mm +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// MachIPC.mm -// Wrapper for mach IPC calls - -#import -#import "MachIPC.h" -#include "common/mac/bootstrap_compat.h" - -namespace google_breakpad { -//============================================================================== -MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() { - head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0); - - // head.msgh_remote_port = ...; // filled out in MachPortSender::SendMessage() - head.msgh_local_port = MACH_PORT_NULL; - head.msgh_reserved = 0; - head.msgh_id = 0; - - SetDescriptorCount(0); // start out with no descriptors - - SetMessageID(message_id); - SetData(NULL, 0); // client may add data later -} - -//============================================================================== -// returns true if successful -bool MachMessage::SetData(void *data, - int32_t data_length) { - // first check to make sure we have enough space - size_t size = CalculateSize(); - size_t new_size = size + data_length; - - if (new_size > sizeof(MachMessage)) { - return false; // not enough space - } - - GetDataPacket()->data_length = EndianU32_NtoL(data_length); - if (data) memcpy(GetDataPacket()->data, data, data_length); - - CalculateSize(); - - return true; -} - -//============================================================================== -// calculates and returns the total size of the message -// Currently, the entire message MUST fit inside of the MachMessage -// messsage size <= sizeof(MachMessage) -mach_msg_size_t MachMessage::CalculateSize() { - size_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t); - - // add space for MessageDataPacket - int32_t alignedDataLength = (GetDataLength() + 3) & ~0x3; - size += 2*sizeof(int32_t) + alignedDataLength; - - // add space for descriptors - size += GetDescriptorCount() * sizeof(MachMsgPortDescriptor); - - head.msgh_size = static_cast(size); - - return head.msgh_size; -} - -//============================================================================== -MachMessage::MessageDataPacket *MachMessage::GetDataPacket() { - size_t desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount(); - MessageDataPacket *packet = - reinterpret_cast(padding + desc_size); - - return packet; -} - -//============================================================================== -void MachMessage::SetDescriptor(int n, - const MachMsgPortDescriptor &desc) { - MachMsgPortDescriptor *desc_array = - reinterpret_cast(padding); - desc_array[n] = desc; -} - -//============================================================================== -// returns true if successful otherwise there was not enough space -bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) { - // first check to make sure we have enough space - int size = CalculateSize(); - size_t new_size = size + sizeof(MachMsgPortDescriptor); - - if (new_size > sizeof(MachMessage)) { - return false; // not enough space - } - - // unfortunately, we need to move the data to allow space for the - // new descriptor - u_int8_t *p = reinterpret_cast(GetDataPacket()); - bcopy(p, p+sizeof(MachMsgPortDescriptor), GetDataLength()+2*sizeof(int32_t)); - - SetDescriptor(GetDescriptorCount(), desc); - SetDescriptorCount(GetDescriptorCount() + 1); - - CalculateSize(); - - return true; -} - -//============================================================================== -void MachMessage::SetDescriptorCount(int n) { - body.msgh_descriptor_count = n; - - if (n > 0) { - head.msgh_bits |= MACH_MSGH_BITS_COMPLEX; - } else { - head.msgh_bits &= ~MACH_MSGH_BITS_COMPLEX; - } -} - -//============================================================================== -MachMsgPortDescriptor *MachMessage::GetDescriptor(int n) { - if (n < GetDescriptorCount()) { - MachMsgPortDescriptor *desc = - reinterpret_cast(padding); - return desc + n; - } - - return nil; -} - -//============================================================================== -mach_port_t MachMessage::GetTranslatedPort(int n) { - if (n < GetDescriptorCount()) { - return GetDescriptor(n)->GetMachPort(); - } - return MACH_PORT_NULL; -} - -#pragma mark - - -//============================================================================== -// create a new mach port for receiving messages and register a name for it -ReceivePort::ReceivePort(const char *receive_port_name) { - mach_port_t current_task = mach_task_self(); - - init_result_ = mach_port_allocate(current_task, - MACH_PORT_RIGHT_RECEIVE, - &port_); - - if (init_result_ != KERN_SUCCESS) - return; - - init_result_ = mach_port_insert_right(current_task, - port_, - port_, - MACH_MSG_TYPE_MAKE_SEND); - - if (init_result_ != KERN_SUCCESS) - return; - - mach_port_t task_bootstrap_port = 0; - init_result_ = task_get_bootstrap_port(current_task, &task_bootstrap_port); - - if (init_result_ != KERN_SUCCESS) - return; - - init_result_ = breakpad::BootstrapRegister( - bootstrap_port, - const_cast(receive_port_name), - port_); -} - -//============================================================================== -// create a new mach port for receiving messages -ReceivePort::ReceivePort() { - mach_port_t current_task = mach_task_self(); - - init_result_ = mach_port_allocate(current_task, - MACH_PORT_RIGHT_RECEIVE, - &port_); - - if (init_result_ != KERN_SUCCESS) - return; - - init_result_ = mach_port_insert_right(current_task, - port_, - port_, - MACH_MSG_TYPE_MAKE_SEND); -} - -//============================================================================== -// Given an already existing mach port, use it. We take ownership of the -// port and deallocate it in our destructor. -ReceivePort::ReceivePort(mach_port_t receive_port) - : port_(receive_port), - init_result_(KERN_SUCCESS) { -} - -//============================================================================== -ReceivePort::~ReceivePort() { - if (init_result_ == KERN_SUCCESS) - mach_port_deallocate(mach_task_self(), port_); -} - -//============================================================================== -kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message, - mach_msg_timeout_t timeout) { - if (!out_message) { - return KERN_INVALID_ARGUMENT; - } - - // return any error condition encountered in constructor - if (init_result_ != KERN_SUCCESS) - return init_result_; - - out_message->head.msgh_bits = 0; - out_message->head.msgh_local_port = port_; - out_message->head.msgh_remote_port = MACH_PORT_NULL; - out_message->head.msgh_reserved = 0; - out_message->head.msgh_id = 0; - - mach_msg_option_t options = MACH_RCV_MSG; - if (timeout != MACH_MSG_TIMEOUT_NONE) - options |= MACH_RCV_TIMEOUT; - kern_return_t result = mach_msg(&out_message->head, - options, - 0, - sizeof(MachMessage), - port_, - timeout, // timeout in ms - MACH_PORT_NULL); - - return result; -} - -#pragma mark - - -//============================================================================== -// get a port with send rights corresponding to a named registered service -MachPortSender::MachPortSender(const char *receive_port_name) { - mach_port_t task_bootstrap_port = 0; - init_result_ = task_get_bootstrap_port(mach_task_self(), - &task_bootstrap_port); - - if (init_result_ != KERN_SUCCESS) - return; - - init_result_ = bootstrap_look_up(task_bootstrap_port, - const_cast(receive_port_name), - &send_port_); -} - -//============================================================================== -MachPortSender::MachPortSender(mach_port_t send_port) - : send_port_(send_port), - init_result_(KERN_SUCCESS) { -} - -//============================================================================== -kern_return_t MachPortSender::SendMessage(MachSendMessage &message, - mach_msg_timeout_t timeout) { - if (message.head.msgh_size == 0) { - return KERN_INVALID_VALUE; // just for safety -- never should occur - }; - - if (init_result_ != KERN_SUCCESS) - return init_result_; - - message.head.msgh_remote_port = send_port_; - - kern_return_t result = mach_msg(&message.head, - MACH_SEND_MSG | MACH_SEND_TIMEOUT, - message.head.msgh_size, - 0, - MACH_PORT_NULL, - timeout, // timeout in ms - MACH_PORT_NULL); - - return result; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc b/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc deleted file mode 100644 index d875d95b5f..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.cc +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "common/mac/bootstrap_compat.h" - -namespace breakpad { - -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -kern_return_t BootstrapRegister(mach_port_t bp, - name_t service_name, - mach_port_t sp) { - return bootstrap_register(bp, service_name, sp); -} -#pragma GCC diagnostic warning "-Wdeprecated-declarations" - -} // namesapce breakpad diff --git a/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h b/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h deleted file mode 100644 index 8ca7357c34..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/bootstrap_compat.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef COMMON_MAC_BOOTSTRAP_COMPAT_H_ -#define COMMON_MAC_BOOTSTRAP_COMPAT_H_ - -#include - -namespace breakpad { - -// Wrapper for bootstrap_register to avoid deprecation warnings. -// -// In 10.6, it's possible to call bootstrap_check_in as the one-stop-shop for -// handling what bootstrap_register is used for. In 10.5, bootstrap_check_in -// can't check in a service whose name has not yet been registered, despite -// bootstrap_register being marked as deprecated in that OS release. Breakpad -// needs to register new service names, and in 10.5, calling -// bootstrap_register is the only way to achieve that. Attempts to call -// bootstrap_check_in for a new service name on 10.5 will result in -// BOOTSTRAP_UNKNOWN_SERVICE being returned rather than registration of the -// new service name. -kern_return_t BootstrapRegister(mach_port_t bp, - name_t service_name, - mach_port_t sp); - -} // namespace breakpad - -#endif // COMMON_MAC_BOOTSTRAP_COMPAT_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/byteswap.h b/Telegram/ThirdParty/breakpad/common/mac/byteswap.h deleted file mode 100644 index b7bbc0b95b..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/byteswap.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- mode: c++ -*- - -// Copyright (c) 2010, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Original author: Jim Blandy - -// byteswap.h: Overloaded functions for conveniently byteswapping values. - -#ifndef COMMON_MAC_BYTESWAP_H_ -#define COMMON_MAC_BYTESWAP_H_ - -#ifdef __APPLE__ -#include - -static inline uint16_t ByteSwap(uint16_t v) { return OSSwapInt16(v); } -static inline uint32_t ByteSwap(uint32_t v) { return OSSwapInt32(v); } -static inline uint64_t ByteSwap(uint64_t v) { return OSSwapInt64(v); } -static inline int16_t ByteSwap(int16_t v) { return OSSwapInt16(v); } -static inline int32_t ByteSwap(int32_t v) { return OSSwapInt32(v); } -static inline int64_t ByteSwap(int64_t v) { return OSSwapInt64(v); } - -#elif defined(__linux__) -// For NXByteOrder -#include -#include -#include -#include_next - -static inline uint16_t ByteSwap(uint16_t v) { return bswap_16(v); } -static inline uint32_t ByteSwap(uint32_t v) { return bswap_32(v); } -static inline uint64_t ByteSwap(uint64_t v) { return bswap_64(v); } -static inline int16_t ByteSwap(int16_t v) { return bswap_16(v); } -static inline int32_t ByteSwap(int32_t v) { return bswap_32(v); } -static inline int64_t ByteSwap(int64_t v) { return bswap_64(v); } - -static inline NXByteOrder NXHostByteOrder() { -#ifdef __LITTLE_ENDIAN - return NX_LittleEndian; -#else - return NX_BigEndian; -#endif -} - -#endif // __APPLE__ - -#endif // COMMON_MAC_BYTESWAP_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/file_id.cc b/Telegram/ThirdParty/breakpad/common/mac/file_id.cc deleted file mode 100644 index 4661d5d625..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/file_id.cc +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// file_id.cc: Return a unique identifier for a file -// -// See file_id.h for documentation -// -// Author: Dan Waylonis - -#include -#include -#include -#include - -#include "common/mac/file_id.h" -#include "common/mac/macho_id.h" - -using MacFileUtilities::MachoID; - -namespace google_breakpad { - -FileID::FileID(const char *path) { - snprintf(path_, sizeof(path_), "%s", path); -} - -bool FileID::FileIdentifier(unsigned char identifier[16]) { - int fd = open(path_, O_RDONLY); - if (fd == -1) - return false; - - MD5Context md5; - MD5Init(&md5); - - // Read 4k x 2 bytes at a time. This is faster than just 4k bytes, but - // doesn't seem to be an unreasonable size for the stack. - unsigned char buffer[4096 * 2]; - size_t buffer_size = sizeof(buffer); - while ((buffer_size = read(fd, buffer, buffer_size) > 0)) { - MD5Update(&md5, buffer, static_cast(buffer_size)); - } - - close(fd); - MD5Final(identifier, &md5); - - return true; -} - -bool FileID::MachoIdentifier(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]) { - MachoID macho(path_); - - if (macho.UUIDCommand(cpu_type, cpu_subtype, identifier)) - return true; - - return macho.MD5(cpu_type, cpu_subtype, identifier); -} - -// static -void FileID::ConvertIdentifierToString(const unsigned char identifier[16], - char *buffer, int buffer_length) { - int buffer_idx = 0; - for (int idx = 0; (buffer_idx < buffer_length) && (idx < 16); ++idx) { - int hi = (identifier[idx] >> 4) & 0x0F; - int lo = (identifier[idx]) & 0x0F; - - if (idx == 4 || idx == 6 || idx == 8 || idx == 10) - buffer[buffer_idx++] = '-'; - - buffer[buffer_idx++] = - static_cast((hi >= 10) ? ('A' + hi - 10) : ('0' + hi)); - buffer[buffer_idx++] = - static_cast((lo >= 10) ? ('A' + lo - 10) : ('0' + lo)); - } - - // NULL terminate - buffer[(buffer_idx < buffer_length) ? buffer_idx : buffer_idx - 1] = 0; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/mac/file_id.h b/Telegram/ThirdParty/breakpad/common/mac/file_id.h deleted file mode 100644 index 1d6dfde1b0..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/file_id.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// file_id.h: Return a unique identifier for a file -// -// Author: Dan Waylonis - -#ifndef COMMON_MAC_FILE_ID_H__ -#define COMMON_MAC_FILE_ID_H__ - -#include -#include - -namespace google_breakpad { - -class FileID { - public: - FileID(const char *path); - ~FileID() {}; - - // Load the identifier for the file path specified in the constructor into - // |identifier|. Return false if the identifier could not be created for the - // file. - // The current implementation will return the MD5 hash of the file's bytes. - bool FileIdentifier(unsigned char identifier[16]); - - // Treat the file as a mach-o file that will contain one or more archicture. - // Accepted values for |cpu_type| and |cpu_subtype| (e.g., CPU_TYPE_X86 or - // CPU_TYPE_POWERPC) are listed in /usr/include/mach/machine.h. - // If |cpu_type| is 0, then the native cpu type is used. If |cpu_subtype| is - // CPU_SUBTYPE_MULTIPLE, the match is only done on |cpu_type|. - // Returns false if opening the file failed or if the |cpu_type|/|cpu_subtype| - // is not present in the file. - // Return the unique identifier in |identifier|. - // The current implementation will look for the (in order of priority): - // LC_UUID, LC_ID_DYLIB, or MD5 hash of the given |cpu_type|. - bool MachoIdentifier(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]); - - // Convert the |identifier| data to a NULL terminated string. The string will - // be formatted as a UUID (e.g., 22F065BB-FC9C-49F7-80FE-26A7CEBD7BCE). - // The |buffer| should be at least 37 bytes long to receive all of the data - // and termination. Shorter buffers will contain truncated data. - static void ConvertIdentifierToString(const unsigned char identifier[16], - char *buffer, int buffer_length); - - private: - // Storage for the path specified - char path_[PATH_MAX]; -}; - -} // namespace google_breakpad - -#endif // COMMON_MAC_FILE_ID_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_id.cc b/Telegram/ThirdParty/breakpad/common/mac/macho_id.cc deleted file mode 100644 index c396ad888d..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/macho_id.cc +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// macho_id.cc: Functions to gather identifying information from a macho file -// -// See macho_id.h for documentation -// -// Author: Dan Waylonis - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common/mac/macho_id.h" -#include "common/mac/macho_walker.h" -#include "common/mac/macho_utilities.h" - -namespace MacFileUtilities { - -using google_breakpad::MD5Init; -using google_breakpad::MD5Update; -using google_breakpad::MD5Final; - -MachoID::MachoID(const char *path) - : memory_(0), - memory_size_(0), - crc_(0), - md5_context_(), - update_function_(NULL) { - snprintf(path_, sizeof(path_), "%s", path); -} - -MachoID::MachoID(const char *path, void *memory, size_t size) - : memory_(memory), - memory_size_(size), - crc_(0), - md5_context_(), - update_function_(NULL) { - snprintf(path_, sizeof(path_), "%s", path); -} - -MachoID::~MachoID() { -} - -// The CRC info is from http://en.wikipedia.org/wiki/Adler-32 -// With optimizations from http://www.zlib.net/ - -// The largest prime smaller than 65536 -#define MOD_ADLER 65521 -// MAX_BLOCK is the largest n such that 255n(n+1)/2 + (n+1)(MAX_BLOCK-1) <= 2^32-1 -#define MAX_BLOCK 5552 - -void MachoID::UpdateCRC(unsigned char *bytes, size_t size) { -// Unrolled loops for summing -#define DO1(buf,i) {sum1 += (buf)[i]; sum2 += sum1;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - // Split up the crc - uint32_t sum1 = crc_ & 0xFFFF; - uint32_t sum2 = (crc_ >> 16) & 0xFFFF; - - // Do large blocks - while (size >= MAX_BLOCK) { - size -= MAX_BLOCK; - int block_count = MAX_BLOCK / 16; - do { - DO16(bytes); - bytes += 16; - } while (--block_count); - sum1 %= MOD_ADLER; - sum2 %= MOD_ADLER; - } - - // Do remaining bytes - if (size) { - while (size >= 16) { - size -= 16; - DO16(bytes); - bytes += 16; - } - while (size--) { - sum1 += *bytes++; - sum2 += sum1; - } - sum1 %= MOD_ADLER; - sum2 %= MOD_ADLER; - crc_ = (sum2 << 16) | sum1; - } -} - -void MachoID::UpdateMD5(unsigned char *bytes, size_t size) { - MD5Update(&md5_context_, bytes, static_cast(size)); -} - -void MachoID::Update(MachoWalker *walker, off_t offset, size_t size) { - if (!update_function_ || !size) - return; - - // Read up to 4k bytes at a time - unsigned char buffer[4096]; - size_t buffer_size; - off_t file_offset = offset; - while (size > 0) { - if (size > sizeof(buffer)) { - buffer_size = sizeof(buffer); - size -= buffer_size; - } else { - buffer_size = size; - size = 0; - } - - if (!walker->ReadBytes(buffer, buffer_size, file_offset)) - return; - - (this->*update_function_)(buffer, buffer_size); - file_offset += buffer_size; - } -} - -bool MachoID::UUIDCommand(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char bytes[16]) { - struct breakpad_uuid_command uuid_cmd; - uuid_cmd.cmd = 0; - if (!WalkHeader(cpu_type, cpu_subtype, UUIDWalkerCB, &uuid_cmd)) - return false; - - // If we found the command, we'll have initialized the uuid_command - // structure - if (uuid_cmd.cmd == LC_UUID) { - memcpy(bytes, uuid_cmd.uuid, sizeof(uuid_cmd.uuid)); - return true; - } - - return false; -} - -bool MachoID::IDCommand(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]) { - struct dylib_command dylib_cmd; - dylib_cmd.cmd = 0; - if (!WalkHeader(cpu_type, cpu_subtype, IDWalkerCB, &dylib_cmd)) - return false; - - // If we found the command, we'll have initialized the dylib_command - // structure - if (dylib_cmd.cmd == LC_ID_DYLIB) { - // Take the hashed filename, version, and compatability version bytes - // to form the first 12 bytes, pad the rest with zeros - - // create a crude hash of the filename to generate the first 4 bytes - identifier[0] = 0; - identifier[1] = 0; - identifier[2] = 0; - identifier[3] = 0; - - for (int j = 0, i = (int)strlen(path_)-1; i>=0 && path_[i]!='/'; ++j, --i) { - identifier[j%4] += path_[i]; - } - - identifier[4] = (dylib_cmd.dylib.current_version >> 24) & 0xFF; - identifier[5] = (dylib_cmd.dylib.current_version >> 16) & 0xFF; - identifier[6] = (dylib_cmd.dylib.current_version >> 8) & 0xFF; - identifier[7] = dylib_cmd.dylib.current_version & 0xFF; - identifier[8] = (dylib_cmd.dylib.compatibility_version >> 24) & 0xFF; - identifier[9] = (dylib_cmd.dylib.compatibility_version >> 16) & 0xFF; - identifier[10] = (dylib_cmd.dylib.compatibility_version >> 8) & 0xFF; - identifier[11] = dylib_cmd.dylib.compatibility_version & 0xFF; - identifier[12] = (cpu_type >> 24) & 0xFF; - identifier[13] = (cpu_type >> 16) & 0xFF; - identifier[14] = (cpu_type >> 8) & 0xFF; - identifier[15] = cpu_type & 0xFF; - - return true; - } - - return false; -} - -uint32_t MachoID::Adler32(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { - update_function_ = &MachoID::UpdateCRC; - crc_ = 0; - - if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) - return 0; - - return crc_; -} - -bool MachoID::MD5(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char identifier[16]) { - update_function_ = &MachoID::UpdateMD5; - - MD5Init(&md5_context_); - - if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this)) - return false; - - MD5Final(identifier, &md5_context_); - return true; -} - -bool MachoID::WalkHeader(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - MachoWalker::LoadCommandCallback callback, - void *context) { - if (memory_) { - MachoWalker walker(memory_, memory_size_, callback, context); - return walker.WalkHeader(cpu_type, cpu_subtype); - } else { - MachoWalker walker(path_, callback, context); - return walker.WalkHeader(cpu_type, cpu_subtype); - } -} - -// static -bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, - bool swap, void *context) { - MachoID *macho_id = (MachoID *)context; - - if (cmd->cmd == LC_SEGMENT) { - struct segment_command seg; - - if (!walker->ReadBytes(&seg, sizeof(seg), offset)) - return false; - - if (swap) - breakpad_swap_segment_command(&seg); - - struct mach_header_64 header; - off_t header_offset; - - if (!walker->CurrentHeader(&header, &header_offset)) - return false; - - // Process segments that have sections: - // (e.g., __TEXT, __DATA, __IMPORT, __OBJC) - offset += sizeof(struct segment_command); - struct section sec; - for (unsigned long i = 0; i < seg.nsects; ++i) { - if (!walker->ReadBytes(&sec, sizeof(sec), offset)) - return false; - - if (swap) - breakpad_swap_section(&sec, 1); - - // sections of type S_ZEROFILL are "virtual" and contain no data - // in the file itself - if ((sec.flags & SECTION_TYPE) != S_ZEROFILL && sec.offset != 0) - macho_id->Update(walker, header_offset + sec.offset, sec.size); - - offset += sizeof(struct section); - } - } else if (cmd->cmd == LC_SEGMENT_64) { - struct segment_command_64 seg64; - - if (!walker->ReadBytes(&seg64, sizeof(seg64), offset)) - return false; - - if (swap) - breakpad_swap_segment_command_64(&seg64); - - struct mach_header_64 header; - off_t header_offset; - - if (!walker->CurrentHeader(&header, &header_offset)) - return false; - - // Process segments that have sections: - // (e.g., __TEXT, __DATA, __IMPORT, __OBJC) - offset += sizeof(struct segment_command_64); - struct section_64 sec64; - for (unsigned long i = 0; i < seg64.nsects; ++i) { - if (!walker->ReadBytes(&sec64, sizeof(sec64), offset)) - return false; - - if (swap) - breakpad_swap_section_64(&sec64, 1); - - // sections of type S_ZEROFILL are "virtual" and contain no data - // in the file itself - if ((sec64.flags & SECTION_TYPE) != S_ZEROFILL && sec64.offset != 0) - macho_id->Update(walker, - header_offset + sec64.offset, - (size_t)sec64.size); - - offset += sizeof(struct section_64); - } - } - - // Continue processing - return true; -} - -// static -bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, - bool swap, void *context) { - if (cmd->cmd == LC_UUID) { - struct breakpad_uuid_command *uuid_cmd = - (struct breakpad_uuid_command *)context; - - if (!walker->ReadBytes(uuid_cmd, sizeof(struct breakpad_uuid_command), - offset)) - return false; - - if (swap) - breakpad_swap_uuid_command(uuid_cmd); - - return false; - } - - // Continue processing - return true; -} - -// static -bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, - bool swap, void *context) { - if (cmd->cmd == LC_ID_DYLIB) { - struct dylib_command *dylib_cmd = (struct dylib_command *)context; - - if (!walker->ReadBytes(dylib_cmd, sizeof(struct dylib_command), offset)) - return false; - - if (swap) - breakpad_swap_dylib_command(dylib_cmd); - - return false; - } - - // Continue processing - return true; -} - -} // namespace MacFileUtilities diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_id.h b/Telegram/ThirdParty/breakpad/common/mac/macho_id.h deleted file mode 100644 index 1037549124..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/macho_id.h +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// macho_id.h: Functions to gather identifying information from a macho file -// -// Author: Dan Waylonis - -#ifndef COMMON_MAC_MACHO_ID_H__ -#define COMMON_MAC_MACHO_ID_H__ - -#include -#include -#include - -#include "common/mac/macho_walker.h" -#include "common/md5.h" - -namespace MacFileUtilities { - -class MachoID { - public: - MachoID(const char *path); - MachoID(const char *path, void *memory, size_t size); - ~MachoID(); - - // For the given |cpu_type| and |cpu_subtype|, return a UUID from the LC_UUID - // command. - // Return false if there isn't a LC_UUID command. - bool UUIDCommand(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]); - - // For the given |cpu_type| and |cpu_subtype|, return a UUID from the - // LC_ID_DYLIB command. - // Return false if there isn't a LC_ID_DYLIB command. - bool IDCommand(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]); - - // For the given |cpu_type| and |cpu_subtype|, return the Adler32 CRC for the - // mach-o data segment(s). - // Return 0 on error (e.g., if the file is not a mach-o file) - uint32_t Adler32(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype); - - // For the given |cpu_type|, and |cpu_subtype| return the MD5 for the mach-o - // data segment(s). - // Return true on success, false otherwise - bool MD5(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - unsigned char identifier[16]); - - private: - // Signature of class member function to be called with data read from file - typedef void (MachoID::*UpdateFunction)(unsigned char *bytes, size_t size); - - // Update the CRC value by examining |size| |bytes| and applying the algorithm - // to each byte. - void UpdateCRC(unsigned char *bytes, size_t size); - - // Update the MD5 value by examining |size| |bytes| and applying the algorithm - // to each byte. - void UpdateMD5(unsigned char *bytes, size_t size); - - // Bottleneck for update routines - void Update(MachoWalker *walker, off_t offset, size_t size); - - // Factory for the MachoWalker - bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, - MachoWalker::LoadCommandCallback callback, void *context); - - // The callback from the MachoWalker for CRC and MD5 - static bool WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, - bool swap, void *context); - - // The callback from the MachoWalker for LC_UUID - static bool UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, - bool swap, void *context); - - // The callback from the MachoWalker for LC_ID_DYLIB - static bool IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset, - bool swap, void *context); - - // File path - char path_[PATH_MAX]; - - // Memory region to read from - void *memory_; - - // Size of the memory region - size_t memory_size_; - - // The current crc value - uint32_t crc_; - - // The MD5 context - google_breakpad::MD5Context md5_context_; - - // The current update to call from the Update callback - UpdateFunction update_function_; -}; - -} // namespace MacFileUtilities - -#endif // COMMON_MAC_MACHO_ID_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc b/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc deleted file mode 100644 index f56fe768c1..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.cc +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// macho_utilties.cc: Utilities for dealing with mach-o files -// -// Author: Dave Camp - -#include "common/mac/byteswap.h" -#include "common/mac/macho_utilities.h" - -#include -#include - -void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc) { - uc->cmd = ByteSwap(uc->cmd); - uc->cmdsize = ByteSwap(uc->cmdsize); -} - -void breakpad_swap_load_command(struct load_command *lc) { - lc->cmd = ByteSwap(lc->cmd); - lc->cmdsize = ByteSwap(lc->cmdsize); -} - -void breakpad_swap_dylib_command(struct dylib_command *dc) { - dc->cmd = ByteSwap(dc->cmd); - dc->cmdsize = ByteSwap(dc->cmdsize); - - dc->dylib.name.offset = ByteSwap(dc->dylib.name.offset); - dc->dylib.timestamp = ByteSwap(dc->dylib.timestamp); - dc->dylib.current_version = ByteSwap(dc->dylib.current_version); - dc->dylib.compatibility_version = ByteSwap(dc->dylib.compatibility_version); -} - -void breakpad_swap_segment_command(struct segment_command *sc) { - sc->cmd = ByteSwap(sc->cmd); - sc->cmdsize = ByteSwap(sc->cmdsize); - - sc->vmaddr = ByteSwap(sc->vmaddr); - sc->vmsize = ByteSwap(sc->vmsize); - sc->fileoff = ByteSwap(sc->fileoff); - sc->filesize = ByteSwap(sc->filesize); - sc->maxprot = ByteSwap(sc->maxprot); - sc->initprot = ByteSwap(sc->initprot); - sc->nsects = ByteSwap(sc->nsects); - sc->flags = ByteSwap(sc->flags); -} - -void breakpad_swap_segment_command_64(struct segment_command_64 *sg) { - sg->cmd = ByteSwap(sg->cmd); - sg->cmdsize = ByteSwap(sg->cmdsize); - - sg->vmaddr = ByteSwap(sg->vmaddr); - sg->vmsize = ByteSwap(sg->vmsize); - sg->fileoff = ByteSwap(sg->fileoff); - sg->filesize = ByteSwap(sg->filesize); - - sg->maxprot = ByteSwap(sg->maxprot); - sg->initprot = ByteSwap(sg->initprot); - sg->nsects = ByteSwap(sg->nsects); - sg->flags = ByteSwap(sg->flags); -} - -void breakpad_swap_fat_header(struct fat_header *fh) { - fh->magic = ByteSwap(fh->magic); - fh->nfat_arch = ByteSwap(fh->nfat_arch); -} - -void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs) { - for (uint32_t i = 0; i < narchs; ++i) { - fa[i].cputype = ByteSwap(fa[i].cputype); - fa[i].cpusubtype = ByteSwap(fa[i].cpusubtype); - fa[i].offset = ByteSwap(fa[i].offset); - fa[i].size = ByteSwap(fa[i].size); - fa[i].align = ByteSwap(fa[i].align); - } -} - -void breakpad_swap_mach_header(struct mach_header *mh) { - mh->magic = ByteSwap(mh->magic); - mh->cputype = ByteSwap(mh->cputype); - mh->cpusubtype = ByteSwap(mh->cpusubtype); - mh->filetype = ByteSwap(mh->filetype); - mh->ncmds = ByteSwap(mh->ncmds); - mh->sizeofcmds = ByteSwap(mh->sizeofcmds); - mh->flags = ByteSwap(mh->flags); -} - -void breakpad_swap_mach_header_64(struct mach_header_64 *mh) { - mh->magic = ByteSwap(mh->magic); - mh->cputype = ByteSwap(mh->cputype); - mh->cpusubtype = ByteSwap(mh->cpusubtype); - mh->filetype = ByteSwap(mh->filetype); - mh->ncmds = ByteSwap(mh->ncmds); - mh->sizeofcmds = ByteSwap(mh->sizeofcmds); - mh->flags = ByteSwap(mh->flags); - mh->reserved = ByteSwap(mh->reserved); -} - -void breakpad_swap_section(struct section *s, - uint32_t nsects) { - for (uint32_t i = 0; i < nsects; i++) { - s[i].addr = ByteSwap(s[i].addr); - s[i].size = ByteSwap(s[i].size); - - s[i].offset = ByteSwap(s[i].offset); - s[i].align = ByteSwap(s[i].align); - s[i].reloff = ByteSwap(s[i].reloff); - s[i].nreloc = ByteSwap(s[i].nreloc); - s[i].flags = ByteSwap(s[i].flags); - s[i].reserved1 = ByteSwap(s[i].reserved1); - s[i].reserved2 = ByteSwap(s[i].reserved2); - } -} - -void breakpad_swap_section_64(struct section_64 *s, - uint32_t nsects) { - for (uint32_t i = 0; i < nsects; i++) { - s[i].addr = ByteSwap(s[i].addr); - s[i].size = ByteSwap(s[i].size); - - s[i].offset = ByteSwap(s[i].offset); - s[i].align = ByteSwap(s[i].align); - s[i].reloff = ByteSwap(s[i].reloff); - s[i].nreloc = ByteSwap(s[i].nreloc); - s[i].flags = ByteSwap(s[i].flags); - s[i].reserved1 = ByteSwap(s[i].reserved1); - s[i].reserved2 = ByteSwap(s[i].reserved2); - } -} diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h b/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h deleted file mode 100644 index 00563a77c8..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/macho_utilities.h +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// macho_utilities.h: Utilities for dealing with mach-o files -// -// Author: Dave Camp - -#ifndef COMMON_MAC_MACHO_UTILITIES_H__ -#define COMMON_MAC_MACHO_UTILITIES_H__ - -#include -#include - -/* Some #defines and structs that aren't defined in older SDKs */ -#ifndef CPU_ARCH_ABI64 -# define CPU_ARCH_ABI64 0x01000000 -#endif - -#ifndef CPU_TYPE_X86 -# define CPU_TYPE_X86 CPU_TYPE_I386 -#endif - -#ifndef CPU_TYPE_POWERPC64 -# define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) -#endif - -#ifndef LC_UUID -# define LC_UUID 0x1b /* the uuid */ -#endif - -// The uuid_command struct/swap routines were added during the 10.4 series. -// Their presence isn't guaranteed. -struct breakpad_uuid_command { - uint32_t cmd; /* LC_UUID */ - uint32_t cmdsize; /* sizeof(struct uuid_command) */ - uint8_t uuid[16]; /* the 128-bit uuid */ -}; - -void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc); - -void breakpad_swap_load_command(struct load_command *lc); - -void breakpad_swap_dylib_command(struct dylib_command *dc); - -// Older SDKs defines thread_state_data_t as an int[] instead -// of the natural_t[] it should be. -typedef natural_t breakpad_thread_state_data_t[THREAD_STATE_MAX]; - -void breakpad_swap_segment_command(struct segment_command *sc); - -// The 64-bit swap routines were added during the 10.4 series, their -// presence isn't guaranteed. -void breakpad_swap_segment_command_64(struct segment_command_64 *sg); - -void breakpad_swap_fat_header(struct fat_header *fh); - -void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs); - -void breakpad_swap_mach_header(struct mach_header *mh); - -void breakpad_swap_mach_header_64(struct mach_header_64 *mh); - -void breakpad_swap_section(struct section *s, - uint32_t nsects); - -void breakpad_swap_section_64(struct section_64 *s, - uint32_t nsects); - -#endif diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc b/Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc deleted file mode 100644 index 1acd86656b..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/macho_walker.cc +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// macho_walker.cc: Iterate over the load commands in a mach-o file -// -// See macho_walker.h for documentation -// -// Author: Dan Waylonis - -#include -#include -#include -#include -#include -#include -#include - -#include "common/mac/byteswap.h" -#include "common/mac/macho_walker.h" -#include "common/mac/macho_utilities.h" - -namespace MacFileUtilities { - -MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback, - void *context) - : file_(-1), - memory_(NULL), - memory_size_(0), - callback_(callback), - callback_context_(context), - current_header_(NULL), - current_header_size_(0), - current_header_offset_(0) { - file_ = open(path, O_RDONLY); -} - -MachoWalker::MachoWalker(void *memory, size_t size, - LoadCommandCallback callback, void *context) - : file_(-1), - memory_(memory), - memory_size_(size), - callback_(callback), - callback_context_(context), - current_header_(NULL), - current_header_size_(0), - current_header_offset_(0) { -} - -MachoWalker::~MachoWalker() { - if (file_ != -1) - close(file_); -} - -bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) { - cpu_type_t valid_cpu_type = cpu_type; - cpu_subtype_t valid_cpu_subtype = cpu_subtype; - // if |cpu_type| is 0, use the native cpu type. - if (cpu_type == 0) { - const NXArchInfo *arch = NXGetLocalArchInfo(); - assert(arch); - valid_cpu_type = arch->cputype; - valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE; - } - off_t offset; - if (FindHeader(valid_cpu_type, valid_cpu_subtype, offset)) { - if (cpu_type & CPU_ARCH_ABI64) - return WalkHeader64AtOffset(offset); - - return WalkHeaderAtOffset(offset); - } - - return false; -} - -bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) { - if (memory_) { - if (offset < 0) - return false; - bool result = true; - if (offset + size > memory_size_) { - if (static_cast(offset) >= memory_size_) - return false; - size = memory_size_ - static_cast(offset); - result = false; - } - memcpy(buffer, static_cast(memory_) + offset, size); - return result; - } else { - return pread(file_, buffer, size, offset) == (ssize_t)size; - } -} - -bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) { - if (current_header_) { - memcpy(header, current_header_, sizeof(mach_header_64)); - *offset = current_header_offset_; - return true; - } - - return false; -} - -bool MachoWalker::FindHeader(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - off_t &offset) { - // Read the magic bytes that's common amongst all mach-o files - uint32_t magic; - if (!ReadBytes(&magic, sizeof(magic), 0)) - return false; - - offset = sizeof(magic); - - // Figure out what type of file we've got - bool is_fat = false; - if (magic == FAT_MAGIC || magic == FAT_CIGAM) { - is_fat = true; - } - else if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 && - magic != MH_CIGAM_64) { - return false; - } - - if (!is_fat) { - // If we don't have a fat header, check if the cpu type matches the single - // header - struct mach_header header; - if (!ReadBytes(&header, sizeof(header), 0)) - return false; - - if (magic == MH_CIGAM || magic == MH_CIGAM_64) - breakpad_swap_mach_header(&header); - - if (cpu_type != header.cputype || - (cpu_subtype != CPU_SUBTYPE_MULTIPLE && - cpu_subtype != header.cpusubtype)) { - return false; - } - - offset = 0; - return true; - } else { - // Read the fat header and find an appropriate architecture - offset = 0; - struct fat_header fat; - if (!ReadBytes(&fat, sizeof(fat), offset)) - return false; - - if (NXHostByteOrder() != NX_BigEndian) - breakpad_swap_fat_header(&fat); - - offset += sizeof(fat); - - // Search each architecture for the desired one - struct fat_arch arch; - for (uint32_t i = 0; i < fat.nfat_arch; ++i) { - if (!ReadBytes(&arch, sizeof(arch), offset)) - return false; - - if (NXHostByteOrder() != NX_BigEndian) - breakpad_swap_fat_arch(&arch, 1); - - if (arch.cputype == cpu_type && - (cpu_subtype == CPU_SUBTYPE_MULTIPLE || - arch.cpusubtype == cpu_subtype)) { - offset = arch.offset; - return true; - } - - offset += sizeof(arch); - } - } - - return false; -} - -bool MachoWalker::WalkHeaderAtOffset(off_t offset) { - struct mach_header header; - if (!ReadBytes(&header, sizeof(header), offset)) - return false; - - bool swap = (header.magic == MH_CIGAM); - if (swap) - breakpad_swap_mach_header(&header); - - // Copy the data into the mach_header_64 structure. Since the 32-bit and - // 64-bit only differ in the last field (reserved), this is safe to do. - struct mach_header_64 header64; - memcpy((void *)&header64, (const void *)&header, sizeof(header)); - header64.reserved = 0; - - current_header_ = &header64; - current_header_size_ = sizeof(header); // 32-bit, not 64-bit - current_header_offset_ = offset; - offset += current_header_size_; - bool result = WalkHeaderCore(offset, header.ncmds, swap); - current_header_ = NULL; - current_header_size_ = 0; - current_header_offset_ = 0; - return result; -} - -bool MachoWalker::WalkHeader64AtOffset(off_t offset) { - struct mach_header_64 header; - if (!ReadBytes(&header, sizeof(header), offset)) - return false; - - bool swap = (header.magic == MH_CIGAM_64); - if (swap) - breakpad_swap_mach_header_64(&header); - - current_header_ = &header; - current_header_size_ = sizeof(header); - current_header_offset_ = offset; - offset += current_header_size_; - bool result = WalkHeaderCore(offset, header.ncmds, swap); - current_header_ = NULL; - current_header_size_ = 0; - current_header_offset_ = 0; - return result; -} - -bool MachoWalker::WalkHeaderCore(off_t offset, uint32_t number_of_commands, - bool swap) { - for (uint32_t i = 0; i < number_of_commands; ++i) { - struct load_command cmd; - if (!ReadBytes(&cmd, sizeof(cmd), offset)) - return false; - - if (swap) - breakpad_swap_load_command(&cmd); - - // Call the user callback - if (callback_ && !callback_(this, &cmd, offset, swap, callback_context_)) - break; - - offset += cmd.cmdsize; - } - - return true; -} - -} // namespace MacFileUtilities diff --git a/Telegram/ThirdParty/breakpad/common/mac/macho_walker.h b/Telegram/ThirdParty/breakpad/common/mac/macho_walker.h deleted file mode 100644 index dd535814a1..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/macho_walker.h +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// macho_walker.h: Iterate over the load commands in a mach-o file -// -// Author: Dan Waylonis - -#ifndef COMMON_MAC_MACHO_WALKER_H__ -#define COMMON_MAC_MACHO_WALKER_H__ - -#include -#include -#include - -namespace MacFileUtilities { - -class MachoWalker { - public: - // A callback function executed when a new load command is read. If no - // further processing of load commands is desired, return false. Otherwise, - // return true. - // |cmd| is the current command, and |offset| is the location relative to the - // beginning of the file (not header) where the command was read. If |swap| - // is set, then any command data (other than the returned load_command) should - // be swapped when read - typedef bool (*LoadCommandCallback)(MachoWalker *walker, load_command *cmd, - off_t offset, bool swap, void *context); - - MachoWalker(const char *path, LoadCommandCallback callback, void *context); - MachoWalker(void *memory, size_t size, LoadCommandCallback callback, - void *context); - ~MachoWalker(); - - // Begin walking the header for |cpu_type| and |cpu_subtype|. If |cpu_type| - // is 0, then the native cpu type is used. Otherwise, accepted values are - // listed in /usr/include/mach/machine.h (e.g., CPU_TYPE_X86 or - // CPU_TYPE_POWERPC). If |cpu_subtype| is CPU_SUBTYPE_MULTIPLE, the match is - // only done on |cpu_type|. - // Returns false if opening the file failed or if the |cpu_type|/|cpu_subtype| - // is not present in the file. - bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype); - - // Read |size| bytes from the opened file at |offset| into |buffer| - bool ReadBytes(void *buffer, size_t size, off_t offset); - - // Return the current header and header offset - bool CurrentHeader(struct mach_header_64 *header, off_t *offset); - - private: - // Locate (if any) the header offset for |cpu_type| and return in |offset|. - // Return true if found, false otherwise. - bool FindHeader(cpu_type_t cpu_type, - cpu_subtype_t cpu_subtype, - off_t &offset); - - // Process an individual header starting at |offset| from the start of the - // file. Return true if successful, false otherwise. - bool WalkHeaderAtOffset(off_t offset); - bool WalkHeader64AtOffset(off_t offset); - - // Bottleneck for walking the load commands - bool WalkHeaderCore(off_t offset, uint32_t number_of_commands, bool swap); - - // File descriptor to the opened file - int file_; - - // Memory location to read from. - void *memory_; - - // Size of the memory segment we can read from. - size_t memory_size_; - - // User specified callback & context - LoadCommandCallback callback_; - void *callback_context_; - - // Current header, size, and offset. The mach_header_64 is used for both - // 32-bit and 64-bit headers because they only differ in their last field - // (reserved). By adding the |current_header_size_| and the - // |current_header_offset_|, you can determine the offset in the file just - // after the header. - struct mach_header_64 *current_header_; - unsigned long current_header_size_; - off_t current_header_offset_; - - private: - MachoWalker(const MachoWalker &); - MachoWalker &operator=(const MachoWalker &); -}; - -} // namespace MacFileUtilities - -#endif // COMMON_MAC_MACHO_WALKER_H__ diff --git a/Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h b/Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h deleted file mode 100644 index d6d1bef971..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/scoped_task_suspend-inl.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2010 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Inline implementation of ScopedTaskSuspend, which suspends a Mach -// task for the duration of its scope. - -#ifndef GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ -#define GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ - -#include - -namespace google_breakpad { - -class ScopedTaskSuspend { - public: - explicit ScopedTaskSuspend(mach_port_t target) : target_(target) { - task_suspend(target_); - } - - ~ScopedTaskSuspend() { - task_resume(target_); - } - - private: - mach_port_t target_; -}; - -} // namespace google_breakpad - -#endif // GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_ diff --git a/Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc b/Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc deleted file mode 100644 index 07c0f42680..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/string_utilities.cc +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "common/scoped_ptr.h" -#include "common/mac/string_utilities.h" - -namespace MacStringUtils { - -using google_breakpad::scoped_array; - -std::string ConvertToString(CFStringRef str) { - CFIndex length = CFStringGetLength(str); - std::string result; - - if (!length) - return result; - - CFIndex maxUTF8Length = - CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8); - scoped_array buffer(new UInt8[maxUTF8Length + 1]); - CFIndex actualUTF8Length; - CFStringGetBytes(str, CFRangeMake(0, length), kCFStringEncodingUTF8, 0, - false, buffer.get(), maxUTF8Length, &actualUTF8Length); - buffer[actualUTF8Length] = 0; - result.assign((const char *)buffer.get()); - - return result; -} - -unsigned int IntegerValueAtIndex(string &str, unsigned int idx) { - string digits("0123456789"), temp; - size_t start = 0; - size_t end; - size_t found = 0; - unsigned int result = 0; - - for (; found <= idx; ++found) { - end = str.find_first_not_of(digits, start); - - if (end == string::npos) - end = str.size(); - - temp = str.substr(start, end - start); - - if (found == idx) { - result = atoi(temp.c_str()); - } - - start = str.find_first_of(digits, end + 1); - - if (start == string::npos) - break; - } - - return result; -} - -} // namespace MacStringUtils diff --git a/Telegram/ThirdParty/breakpad/common/mac/string_utilities.h b/Telegram/ThirdParty/breakpad/common/mac/string_utilities.h deleted file mode 100644 index 6d89c834e7..0000000000 --- a/Telegram/ThirdParty/breakpad/common/mac/string_utilities.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// string_utilities.h: Utilities for strings for Mac platform - -#ifndef COMMON_MAC_STRING_UTILITIES_H__ -#define COMMON_MAC_STRING_UTILITIES_H__ - -#include - -#include - -namespace MacStringUtils { - -using std::string; - -// Convert a CoreFoundation string into a std::string -string ConvertToString(CFStringRef str); - -// Return the idx'th decimal integer in str, separated by non-decimal-digits -// E.g., str = 10.4.8, idx = 1 -> 4 -unsigned int IntegerValueAtIndex(string &str, unsigned int idx); - -} // namespace MacStringUtils - -#endif // COMMON_MAC_STRING_UTILITIES_H__ diff --git a/Telegram/ThirdParty/breakpad/common/md5.cc b/Telegram/ThirdParty/breakpad/common/md5.cc deleted file mode 100644 index a0d9a1bdd8..0000000000 --- a/Telegram/ThirdParty/breakpad/common/md5.cc +++ /dev/null @@ -1,251 +0,0 @@ -/* - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - */ - -#include - -#include "common/md5.h" - -namespace google_breakpad { - -#ifndef WORDS_BIGENDIAN -#define byteReverse(buf, len) /* Nothing */ -#else -/* - * Note: this code is harmless on little-endian machines. - */ -static void byteReverse(unsigned char *buf, unsigned longs) -{ - u32 t; - do { - t = (u32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | - ((unsigned) buf[1] << 8 | buf[0]); - *(u32 *) buf = t; - buf += 4; - } while (--longs); -} -#endif - -static void MD5Transform(u32 buf[4], u32 const in[16]); - -/* - * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious - * initialization constants. - */ -void MD5Init(struct MD5Context *ctx) -{ - ctx->buf[0] = 0x67452301; - ctx->buf[1] = 0xefcdab89; - ctx->buf[2] = 0x98badcfe; - ctx->buf[3] = 0x10325476; - - ctx->bits[0] = 0; - ctx->bits[1] = 0; -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len) -{ - u32 t; - - /* Update bitcount */ - - t = ctx->bits[0]; - if ((ctx->bits[0] = t + ((u32) len << 3)) < t) - ctx->bits[1]++; /* Carry from low to high */ - ctx->bits[1] += len >> 29; - - t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ - - /* Handle any leading odd-sized chunks */ - - if (t) { - unsigned char *p = (unsigned char *) ctx->in + t; - - t = 64 - t; - if (len < t) { - memcpy(p, buf, len); - return; - } - memcpy(p, buf, t); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (u32 *) ctx->in); - buf += t; - len -= t; - } - /* Process data in 64-byte chunks */ - - while (len >= 64) { - memcpy(ctx->in, buf, 64); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (u32 *) ctx->in); - buf += 64; - len -= 64; - } - - /* Handle any remaining bytes of data. */ - - memcpy(ctx->in, buf, len); -} - -/* - * Final wrapup - pad to 64-byte boundary with the bit pattern - * 1 0* (64-bit count of bits processed, MSB-first) - */ -void MD5Final(unsigned char digest[16], struct MD5Context *ctx) -{ - unsigned count; - unsigned char *p; - - /* Compute number of bytes mod 64 */ - count = (ctx->bits[0] >> 3) & 0x3F; - - /* Set the first char of padding to 0x80. This is safe since there is - always at least one byte free */ - p = ctx->in + count; - *p++ = 0x80; - - /* Bytes of padding needed to make 64 bytes */ - count = 64 - 1 - count; - - /* Pad out to 56 mod 64 */ - if (count < 8) { - /* Two lots of padding: Pad the first block to 64 bytes */ - memset(p, 0, count); - byteReverse(ctx->in, 16); - MD5Transform(ctx->buf, (u32 *) ctx->in); - - /* Now fill the next block with 56 bytes */ - memset(ctx->in, 0, 56); - } else { - /* Pad block to 56 bytes */ - memset(p, 0, count - 8); - } - byteReverse(ctx->in, 14); - - /* Append length in bits and transform */ - ((u32 *) ctx->in)[14] = ctx->bits[0]; - ((u32 *) ctx->in)[15] = ctx->bits[1]; - - MD5Transform(ctx->buf, (u32 *) ctx->in); - byteReverse((unsigned char *) ctx->buf, 4); - memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ -} - -/* The four core functions - F1 is optimized somewhat */ - -/* #define F1(x, y, z) (x & y | ~x & z) */ -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -/* This is the central step in the MD5 algorithm. */ -#define MD5STEP(f, w, x, y, z, data, s) \ - ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) - -/* - * The core of the MD5 algorithm, this alters an existing MD5 hash to - * reflect the addition of 16 longwords of new data. MD5Update blocks - * the data and converts bytes into longwords for this routine. - */ -static void MD5Transform(u32 buf[4], u32 const in[16]) -{ - u32 a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -} // namespace google_breakpad - diff --git a/Telegram/ThirdParty/breakpad/common/md5.h b/Telegram/ThirdParty/breakpad/common/md5.h deleted file mode 100644 index 2ab0ab95ae..0000000000 --- a/Telegram/ThirdParty/breakpad/common/md5.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2007 Google Inc. All Rights Reserved. -// Author: liuli@google.com (Liu Li) -#ifndef COMMON_MD5_H__ -#define COMMON_MD5_H__ - -#include - -namespace google_breakpad { - -typedef uint32_t u32; -typedef uint8_t u8; - -struct MD5Context { - u32 buf[4]; - u32 bits[2]; - u8 in[64]; -}; - -void MD5Init(struct MD5Context *ctx); - -void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len); - -void MD5Final(unsigned char digest[16], struct MD5Context *ctx); - -} // namespace google_breakpad - -#endif // COMMON_MD5_H__ diff --git a/Telegram/ThirdParty/breakpad/common/memory.h b/Telegram/ThirdParty/breakpad/common/memory.h deleted file mode 100644 index d6aa137d35..0000000000 --- a/Telegram/ThirdParty/breakpad/common/memory.h +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) 2009, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_ -#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_ - -#include -#include -#include -#include - -#include -#include - -#if defined(MEMORY_SANITIZER) -#include -#endif - -#ifdef __APPLE__ -#define sys_mmap mmap -#define sys_mmap2 mmap -#define sys_munmap munmap -#define MAP_ANONYMOUS MAP_ANON -#else -#include "third_party/lss/linux_syscall_support.h" -#endif - -namespace google_breakpad { - -// This is very simple allocator which fetches pages from the kernel directly. -// Thus, it can be used even when the heap may be corrupted. -// -// There is no free operation. The pages are only freed when the object is -// destroyed. -class PageAllocator { - public: - PageAllocator() - : page_size_(getpagesize()), - last_(NULL), - current_page_(NULL), - page_offset_(0) { - } - - ~PageAllocator() { - FreeAll(); - } - - void *Alloc(size_t bytes) { - if (!bytes) - return NULL; - - if (current_page_ && page_size_ - page_offset_ >= bytes) { - uint8_t *const ret = current_page_ + page_offset_; - page_offset_ += bytes; - if (page_offset_ == page_size_) { - page_offset_ = 0; - current_page_ = NULL; - } - - return ret; - } - - const size_t pages = - (bytes + sizeof(PageHeader) + page_size_ - 1) / page_size_; - uint8_t *const ret = GetNPages(pages); - if (!ret) - return NULL; - - page_offset_ = - (page_size_ - (page_size_ * pages - (bytes + sizeof(PageHeader)))) % - page_size_; - current_page_ = page_offset_ ? ret + page_size_ * (pages - 1) : NULL; - - return ret + sizeof(PageHeader); - } - - // Checks whether the page allocator owns the passed-in pointer. - // This method exists for testing pursposes only. - bool OwnsPointer(const void* p) { - for (PageHeader* header = last_; header; header = header->next) { - const char* current = reinterpret_cast(header); - if ((p >= current) && (p < current + header->num_pages * page_size_)) - return true; - } - - return false; - } - - private: - uint8_t *GetNPages(size_t num_pages) { -#if defined(__x86_64__) || defined(__aarch64__) || defined(__aarch64__) || \ - ((defined(__mips__) && _MIPS_SIM == _ABI64)) - void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -#else - void *a = sys_mmap2(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -#endif - if (a == MAP_FAILED) - return NULL; - -#if defined(MEMORY_SANITIZER) - // We need to indicate to MSan that memory allocated through sys_mmap is - // initialized, since linux_syscall_support.h doesn't have MSan hooks. - __msan_unpoison(a, page_size_ * num_pages); -#endif - - struct PageHeader *header = reinterpret_cast(a); - header->next = last_; - header->num_pages = num_pages; - last_ = header; - - return reinterpret_cast(a); - } - - void FreeAll() { - PageHeader *next; - - for (PageHeader *cur = last_; cur; cur = next) { - next = cur->next; - sys_munmap(cur, cur->num_pages * page_size_); - } - } - - struct PageHeader { - PageHeader *next; // pointer to the start of the next set of pages. - size_t num_pages; // the number of pages in this set. - }; - - const size_t page_size_; - PageHeader *last_; - uint8_t *current_page_; - size_t page_offset_; -}; - -// Wrapper to use with STL containers -template -struct PageStdAllocator : public std::allocator { - typedef typename std::allocator::pointer pointer; - typedef typename std::allocator::size_type size_type; - - explicit PageStdAllocator(PageAllocator& allocator): allocator_(allocator) {} - template PageStdAllocator(const PageStdAllocator& other) - : allocator_(other.allocator_) {} - - inline pointer allocate(size_type n, const void* = 0) { - return static_cast(allocator_.Alloc(sizeof(T) * n)); - } - - inline void deallocate(pointer, size_type) { - // The PageAllocator doesn't free. - } - - template struct rebind { - typedef PageStdAllocator other; - }; - - private: - // Silly workaround for the gcc from Android's ndk (gcc 4.6), which will - // otherwise complain that `other.allocator_` is private in the constructor - // code. - template friend struct PageStdAllocator; - - PageAllocator& allocator_; -}; - -// A wasteful vector is a std::vector, except that it allocates memory from a -// PageAllocator. It's wasteful because, when resizing, it always allocates a -// whole new array since the PageAllocator doesn't support realloc. -template -class wasteful_vector : public std::vector > { - public: - wasteful_vector(PageAllocator* allocator, unsigned size_hint = 16) - : std::vector >(PageStdAllocator(*allocator)) { - std::vector >::reserve(size_hint); - } -}; - -} // namespace google_breakpad - -inline void* operator new(size_t nbytes, - google_breakpad::PageAllocator& allocator) { - return allocator.Alloc(nbytes); -} - -#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_ diff --git a/Telegram/ThirdParty/breakpad/common/scoped_ptr.h b/Telegram/ThirdParty/breakpad/common/scoped_ptr.h deleted file mode 100644 index d137c18681..0000000000 --- a/Telegram/ThirdParty/breakpad/common/scoped_ptr.h +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright 2013 Google Inc. All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Scopers help you manage ownership of a pointer, helping you easily manage the -// a pointer within a scope, and automatically destroying the pointer at the -// end of a scope. There are two main classes you will use, which correspond -// to the operators new/delete and new[]/delete[]. -// -// Example usage (scoped_ptr): -// { -// scoped_ptr foo(new Foo("wee")); -// } // foo goes out of scope, releasing the pointer with it. -// -// { -// scoped_ptr foo; // No pointer managed. -// foo.reset(new Foo("wee")); // Now a pointer is managed. -// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed. -// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed. -// foo->Method(); // Foo::Method() called. -// foo.get()->Method(); // Foo::Method() called. -// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer -// // manages a pointer. -// foo.reset(new Foo("wee4")); // foo manages a pointer again. -// foo.reset(); // Foo("wee4") destroyed, foo no longer -// // manages a pointer. -// } // foo wasn't managing a pointer, so nothing was destroyed. -// -// Example usage (scoped_array): -// { -// scoped_array foo(new Foo[100]); -// foo.get()->Method(); // Foo::Method on the 0th element. -// foo[10].Method(); // Foo::Method on the 10th element. -// } - -#ifndef COMMON_SCOPED_PTR_H_ -#define COMMON_SCOPED_PTR_H_ - -// This is an implementation designed to match the anticipated future TR2 -// implementation of the scoped_ptr class, and its closely-related brethren, -// scoped_array, scoped_ptr_malloc. - -#include -#include -#include - -namespace google_breakpad { - -// A scoped_ptr is like a T*, except that the destructor of scoped_ptr -// automatically deletes the pointer it holds (if any). -// That is, scoped_ptr owns the T object that it points to. -// Like a T*, a scoped_ptr may hold either NULL or a pointer to a T object. -// Also like T*, scoped_ptr is thread-compatible, and once you -// dereference it, you get the threadsafety guarantees of T. -// -// The size of a scoped_ptr is small: -// sizeof(scoped_ptr) == sizeof(C*) -template -class scoped_ptr { - public: - - // The element type - typedef C element_type; - - // Constructor. Defaults to initializing with NULL. - // There is no way to create an uninitialized scoped_ptr. - // The input parameter must be allocated with new. - explicit scoped_ptr(C* p = NULL) : ptr_(p) { } - - // Destructor. If there is a C object, delete it. - // We don't need to test ptr_ == NULL because C++ does that for us. - ~scoped_ptr() { - enum { type_must_be_complete = sizeof(C) }; - delete ptr_; - } - - // Reset. Deletes the current owned object, if any. - // Then takes ownership of a new object, if given. - // this->reset(this->get()) works. - void reset(C* p = NULL) { - if (p != ptr_) { - enum { type_must_be_complete = sizeof(C) }; - delete ptr_; - ptr_ = p; - } - } - - // Accessors to get the owned object. - // operator* and operator-> will assert() if there is no current object. - C& operator*() const { - assert(ptr_ != NULL); - return *ptr_; - } - C* operator->() const { - assert(ptr_ != NULL); - return ptr_; - } - C* get() const { return ptr_; } - - // Comparison operators. - // These return whether two scoped_ptr refer to the same object, not just to - // two different but equal objects. - bool operator==(C* p) const { return ptr_ == p; } - bool operator!=(C* p) const { return ptr_ != p; } - - // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - C* tmp = ptr_; - ptr_ = p2.ptr_; - p2.ptr_ = tmp; - } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - C* release() { - C* retVal = ptr_; - ptr_ = NULL; - return retVal; - } - - private: - C* ptr_; - - // Forbid comparison of scoped_ptr types. If C2 != C, it totally doesn't - // make sense, and if C2 == C, it still doesn't make sense because you should - // never have the same object owned by two different scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; - - // Disallow evil constructors - scoped_ptr(const scoped_ptr&); - void operator=(const scoped_ptr&); -}; - -// Free functions -template -void swap(scoped_ptr& p1, scoped_ptr& p2) { - p1.swap(p2); -} - -template -bool operator==(C* p1, const scoped_ptr& p2) { - return p1 == p2.get(); -} - -template -bool operator!=(C* p1, const scoped_ptr& p2) { - return p1 != p2.get(); -} - -// scoped_array is like scoped_ptr, except that the caller must allocate -// with new [] and the destructor deletes objects with delete []. -// -// As with scoped_ptr, a scoped_array either points to an object -// or is NULL. A scoped_array owns the object that it points to. -// scoped_array is thread-compatible, and once you index into it, -// the returned objects have only the threadsafety guarantees of T. -// -// Size: sizeof(scoped_array) == sizeof(C*) -template -class scoped_array { - public: - - // The element type - typedef C element_type; - - // Constructor. Defaults to intializing with NULL. - // There is no way to create an uninitialized scoped_array. - // The input parameter must be allocated with new []. - explicit scoped_array(C* p = NULL) : array_(p) { } - - // Destructor. If there is a C object, delete it. - // We don't need to test ptr_ == NULL because C++ does that for us. - ~scoped_array() { - enum { type_must_be_complete = sizeof(C) }; - delete[] array_; - } - - // Reset. Deletes the current owned object, if any. - // Then takes ownership of a new object, if given. - // this->reset(this->get()) works. - void reset(C* p = NULL) { - if (p != array_) { - enum { type_must_be_complete = sizeof(C) }; - delete[] array_; - array_ = p; - } - } - - // Get one element of the current object. - // Will assert() if there is no current object, or index i is negative. - C& operator[](ptrdiff_t i) const { - assert(i >= 0); - assert(array_ != NULL); - return array_[i]; - } - - // Get a pointer to the zeroth element of the current object. - // If there is no current object, return NULL. - C* get() const { - return array_; - } - - // Comparison operators. - // These return whether two scoped_array refer to the same object, not just to - // two different but equal objects. - bool operator==(C* p) const { return array_ == p; } - bool operator!=(C* p) const { return array_ != p; } - - // Swap two scoped arrays. - void swap(scoped_array& p2) { - C* tmp = array_; - array_ = p2.array_; - p2.array_ = tmp; - } - - // Release an array. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - C* release() { - C* retVal = array_; - array_ = NULL; - return retVal; - } - - private: - C* array_; - - // Forbid comparison of different scoped_array types. - template bool operator==(scoped_array const& p2) const; - template bool operator!=(scoped_array const& p2) const; - - // Disallow evil constructors - scoped_array(const scoped_array&); - void operator=(const scoped_array&); -}; - -// Free functions -template -void swap(scoped_array& p1, scoped_array& p2) { - p1.swap(p2); -} - -template -bool operator==(C* p1, const scoped_array& p2) { - return p1 == p2.get(); -} - -template -bool operator!=(C* p1, const scoped_array& p2) { - return p1 != p2.get(); -} - -// This class wraps the c library function free() in a class that can be -// passed as a template argument to scoped_ptr_malloc below. -class ScopedPtrMallocFree { - public: - inline void operator()(void* x) const { - free(x); - } -}; - -// scoped_ptr_malloc<> is similar to scoped_ptr<>, but it accepts a -// second template argument, the functor used to free the object. - -template -class scoped_ptr_malloc { - public: - - // The element type - typedef C element_type; - - // Constructor. Defaults to initializing with NULL. - // There is no way to create an uninitialized scoped_ptr. - // The input parameter must be allocated with an allocator that matches the - // Free functor. For the default Free functor, this is malloc, calloc, or - // realloc. - explicit scoped_ptr_malloc(C* p = NULL): ptr_(p) {} - - // Destructor. If there is a C object, call the Free functor. - ~scoped_ptr_malloc() { - reset(); - } - - // Reset. Calls the Free functor on the current owned object, if any. - // Then takes ownership of a new object, if given. - // this->reset(this->get()) works. - void reset(C* p = NULL) { - if (ptr_ != p) { - FreeProc free_proc; - free_proc(ptr_); - ptr_ = p; - } - } - - // Get the current object. - // operator* and operator-> will cause an assert() failure if there is - // no current object. - C& operator*() const { - assert(ptr_ != NULL); - return *ptr_; - } - - C* operator->() const { - assert(ptr_ != NULL); - return ptr_; - } - - C* get() const { - return ptr_; - } - - // Comparison operators. - // These return whether a scoped_ptr_malloc and a plain pointer refer - // to the same object, not just to two different but equal objects. - // For compatibility with the boost-derived implementation, these - // take non-const arguments. - bool operator==(C* p) const { - return ptr_ == p; - } - - bool operator!=(C* p) const { - return ptr_ != p; - } - - // Swap two scoped pointers. - void swap(scoped_ptr_malloc & b) { - C* tmp = b.ptr_; - b.ptr_ = ptr_; - ptr_ = tmp; - } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - C* release() { - C* tmp = ptr_; - ptr_ = NULL; - return tmp; - } - - private: - C* ptr_; - - // no reason to use these: each scoped_ptr_malloc should have its own object - template - bool operator==(scoped_ptr_malloc const& p) const; - template - bool operator!=(scoped_ptr_malloc const& p) const; - - // Disallow evil constructors - scoped_ptr_malloc(const scoped_ptr_malloc&); - void operator=(const scoped_ptr_malloc&); -}; - -template inline -void swap(scoped_ptr_malloc& a, scoped_ptr_malloc& b) { - a.swap(b); -} - -template inline -bool operator==(C* p, const scoped_ptr_malloc& b) { - return p == b.get(); -} - -template inline -bool operator!=(C* p, const scoped_ptr_malloc& b) { - return p != b.get(); -} - -} // namespace google_breakpad - -#endif // COMMON_SCOPED_PTR_H_ diff --git a/Telegram/ThirdParty/breakpad/common/string_conversion.cc b/Telegram/ThirdParty/breakpad/common/string_conversion.cc deleted file mode 100644 index 9c0d623fc1..0000000000 --- a/Telegram/ThirdParty/breakpad/common/string_conversion.cc +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include "common/convert_UTF.h" -#include "common/scoped_ptr.h" -#include "common/string_conversion.h" -#include "common/using_std_string.h" - -namespace google_breakpad { - -using std::vector; - -void UTF8ToUTF16(const char *in, vector *out) { - size_t source_length = strlen(in); - const UTF8 *source_ptr = reinterpret_cast(in); - const UTF8 *source_end_ptr = source_ptr + source_length; - // Erase the contents and zero fill to the expected size - out->clear(); - out->insert(out->begin(), source_length, 0); - uint16_t *target_ptr = &(*out)[0]; - uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t); - ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr, - &target_ptr, target_end_ptr, - strictConversion); - - // Resize to be the size of the # of converted characters + NULL - out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0); -} - -int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]) { - const UTF8 *source_ptr = reinterpret_cast(in); - const UTF8 *source_end_ptr = source_ptr + sizeof(char); - uint16_t *target_ptr = out; - uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t); - out[0] = out[1] = 0; - - // Process one character at a time - while (1) { - ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr, - &target_ptr, target_end_ptr, - strictConversion); - - if (result == conversionOK) - return static_cast(source_ptr - reinterpret_cast(in)); - - // Add another character to the input stream and try again - source_ptr = reinterpret_cast(in); - ++source_end_ptr; - - if (source_end_ptr > reinterpret_cast(in) + in_length) - break; - } - - return 0; -} - -void UTF32ToUTF16(const wchar_t *in, vector *out) { - size_t source_length = wcslen(in); - const UTF32 *source_ptr = reinterpret_cast(in); - const UTF32 *source_end_ptr = source_ptr + source_length; - // Erase the contents and zero fill to the expected size - out->clear(); - out->insert(out->begin(), source_length, 0); - uint16_t *target_ptr = &(*out)[0]; - uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t); - ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr, - &target_ptr, target_end_ptr, - strictConversion); - - // Resize to be the size of the # of converted characters + NULL - out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0); -} - -void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]) { - const UTF32 *source_ptr = reinterpret_cast(&in); - const UTF32 *source_end_ptr = source_ptr + 1; - uint16_t *target_ptr = out; - uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t); - out[0] = out[1] = 0; - ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr, - &target_ptr, target_end_ptr, - strictConversion); - - if (result != conversionOK) { - out[0] = out[1] = 0; - } -} - -static inline uint16_t Swap(uint16_t value) { - return (value >> 8) | static_cast(value << 8); -} - -string UTF16ToUTF8(const vector &in, bool swap) { - const UTF16 *source_ptr = &in[0]; - scoped_array source_buffer; - - // If we're to swap, we need to make a local copy and swap each byte pair - if (swap) { - int idx = 0; - source_buffer.reset(new uint16_t[in.size()]); - UTF16 *source_buffer_ptr = source_buffer.get(); - for (vector::const_iterator it = in.begin(); - it != in.end(); ++it, ++idx) - source_buffer_ptr[idx] = Swap(*it); - - source_ptr = source_buffer.get(); - } - - // The maximum expansion would be 4x the size of the input string. - const UTF16 *source_end_ptr = source_ptr + in.size(); - size_t target_capacity = in.size() * 4; - scoped_array target_buffer(new UTF8[target_capacity]); - UTF8 *target_ptr = target_buffer.get(); - UTF8 *target_end_ptr = target_ptr + target_capacity; - ConversionResult result = ConvertUTF16toUTF8(&source_ptr, source_end_ptr, - &target_ptr, target_end_ptr, - strictConversion); - - if (result == conversionOK) { - const char *targetPtr = reinterpret_cast(target_buffer.get()); - return targetPtr; - } - - return ""; -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/string_conversion.h b/Telegram/ThirdParty/breakpad/common/string_conversion.h deleted file mode 100644 index b9ba96a2e1..0000000000 --- a/Telegram/ThirdParty/breakpad/common/string_conversion.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// string_conversion.h: Conversion between different UTF-8/16/32 encodings. - -#ifndef COMMON_STRING_CONVERSION_H__ -#define COMMON_STRING_CONVERSION_H__ - -#include -#include - -#include "common/using_std_string.h" -#include "google_breakpad/common/breakpad_types.h" - -namespace google_breakpad { - -using std::vector; - -// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the -// conversion failed, |out| will be zero length. -void UTF8ToUTF16(const char *in, vector *out); - -// Convert at least one character (up to a maximum of |in_length|) from |in| -// to UTF-16 into |out|. Return the number of characters consumed from |in|. -// Any unused characters in |out| will be initialized to 0. No memory will -// be allocated by this routine. -int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]); - -// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the -// conversion failed, |out| will be zero length. -void UTF32ToUTF16(const wchar_t *in, vector *out); - -// Convert |in| to UTF-16 into |out|. Any unused characters in |out| will be -// initialized to 0. No memory will be allocated by this routine. -void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]); - -// Convert |in| to UTF-8. If |swap| is true, swap bytes before converting. -string UTF16ToUTF8(const vector &in, bool swap); - -} // namespace google_breakpad - -#endif // COMMON_STRING_CONVERSION_H__ diff --git a/Telegram/ThirdParty/breakpad/common/using_std_string.h b/Telegram/ThirdParty/breakpad/common/using_std_string.h deleted file mode 100644 index 13c1da59cc..0000000000 --- a/Telegram/ThirdParty/breakpad/common/using_std_string.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- mode: C++ -*- - -// Copyright (c) 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Original author: Ivan Penkov - -// using_std_string.h: Allows building this code in environments where -// global string (::string) exists. -// -// The problem: -// ------------- -// Let's say you want to build this code in an environment where a global -// string type is defined (i.e. ::string). Now, let's suppose that ::string -// is different that std::string and you'd like to have the option to easily -// choose between the two string types. Ideally you'd like to control which -// string type is chosen by simply #defining an identifier. -// -// The solution: -// ------------- -// #define HAS_GLOBAL_STRING somewhere in a global header file and then -// globally replace std::string with string. Then include this header -// file everywhere where string is used. If you want to revert back to -// using std::string, simply remove the #define (HAS_GLOBAL_STRING). - -#ifndef THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_ -#define THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_ - -#ifdef HAS_GLOBAL_STRING - typedef ::string google_breakpad_string; -#else - using std::string; - typedef std::string google_breakpad_string; -#endif - -// Inicates that type google_breakpad_string is defined -#define HAS_GOOGLE_BREAKPAD_STRING - -#endif // THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_ diff --git a/Telegram/ThirdParty/breakpad/common/windows/guid_string.cc b/Telegram/ThirdParty/breakpad/common/windows/guid_string.cc deleted file mode 100644 index b7f877e66e..0000000000 --- a/Telegram/ThirdParty/breakpad/common/windows/guid_string.cc +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// guid_string.cc: Convert GUIDs to strings. -// -// See guid_string.h for documentation. - -#include - -#include "common/windows/string_utils-inl.h" - -#include "common/windows/guid_string.h" - -namespace google_breakpad { - -// static -wstring GUIDString::GUIDToWString(GUID *guid) { - wchar_t guid_string[37]; - swprintf( - guid_string, sizeof(guid_string) / sizeof(guid_string[0]), - L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], - guid->Data4[3], guid->Data4[4], guid->Data4[5], - guid->Data4[6], guid->Data4[7]); - - // remove when VC++7.1 is no longer supported - guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0'; - - return wstring(guid_string); -} - -// static -wstring GUIDString::GUIDToSymbolServerWString(GUID *guid) { - wchar_t guid_string[33]; - swprintf( - guid_string, sizeof(guid_string) / sizeof(guid_string[0]), - L"%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X", - guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], - guid->Data4[3], guid->Data4[4], guid->Data4[5], - guid->Data4[6], guid->Data4[7]); - - // remove when VC++7.1 is no longer supported - guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0'; - - return wstring(guid_string); -} - -} // namespace google_breakpad diff --git a/Telegram/ThirdParty/breakpad/common/windows/guid_string.h b/Telegram/ThirdParty/breakpad/common/windows/guid_string.h deleted file mode 100644 index 48a5c1d370..0000000000 --- a/Telegram/ThirdParty/breakpad/common/windows/guid_string.h +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// guid_string.cc: Convert GUIDs to strings. - -#ifndef COMMON_WINDOWS_GUID_STRING_H_ -#define COMMON_WINDOWS_GUID_STRING_H_ - -#include - -#include - -namespace google_breakpad { - -using std::wstring; - -class GUIDString { - public: - // Converts guid to a string in the format recommended by RFC 4122 and - // returns the string. - static wstring GUIDToWString(GUID *guid); - - // Converts guid to a string formatted as uppercase hexadecimal, with - // no separators, and returns the string. This is the format used for - // symbol server identifiers, although identifiers have an age tacked - // on to the string. - static wstring GUIDToSymbolServerWString(GUID *guid); -}; - -} // namespace google_breakpad - -#endif // COMMON_WINDOWS_GUID_STRING_H_ diff --git a/Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h b/Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h deleted file mode 100644 index 9b63607268..0000000000 --- a/Telegram/ThirdParty/breakpad/common/windows/string_utils-inl.h +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// string_utils-inl.h: Safer string manipulation on Windows, supporting -// pre-MSVC8 environments. - -#ifndef COMMON_WINDOWS_STRING_UTILS_INL_H_ -#define COMMON_WINDOWS_STRING_UTILS_INL_H_ - -#include -#include - -#include - -// The "ll" printf format size specifier corresponding to |long long| was -// intrudced in MSVC8. Earlier versions did not provide this size specifier, -// but "I64" can be used to print 64-bit types. Don't use "I64" where "ll" -// is available, in the event of oddball systems where |long long| is not -// 64 bits wide. -#if _MSC_VER >= 1400 // MSVC 2005/8 -#define WIN_STRING_FORMAT_LL "ll" -#else // MSC_VER >= 1400 -#define WIN_STRING_FORMAT_LL "I64" -#endif // MSC_VER >= 1400 - -// A nonconforming version of swprintf, without the length argument, was -// included with the CRT prior to MSVC8. Although a conforming version was -// also available via an overload, it is not reliably chosen. _snwprintf -// behaves as a standards-confirming swprintf should, so force the use of -// _snwprintf when using older CRTs. -#if _MSC_VER < 1400 // MSVC 2005/8 -#define swprintf _snwprintf -#else -// For MSVC8 and newer, swprintf_s is the recommended method. Conveniently, -// it takes the same argument list as swprintf. -#define swprintf swprintf_s -#endif // MSC_VER < 1400 - -namespace google_breakpad { - -using std::string; -using std::wstring; - -class WindowsStringUtils { - public: - // Roughly equivalent to MSVC8's wcscpy_s, except pre-MSVC8, this does - // not fail if source is longer than destination_size. The destination - // buffer is always 0-terminated. - static void safe_wcscpy(wchar_t *destination, size_t destination_size, - const wchar_t *source); - - // Roughly equivalent to MSVC8's wcsncpy_s, except that _TRUNCATE cannot - // be passed directly, and pre-MSVC8, this will not fail if source or count - // are longer than destination_size. The destination buffer is always - // 0-terminated. - static void safe_wcsncpy(wchar_t *destination, size_t destination_size, - const wchar_t *source, size_t count); - - // Performs multi-byte to wide character conversion on C++ strings, using - // mbstowcs_s (MSVC8) or mbstowcs (pre-MSVC8). Returns false on failure, - // without setting wcs. - static bool safe_mbstowcs(const string &mbs, wstring *wcs); - - // The inverse of safe_mbstowcs. - static bool safe_wcstombs(const wstring &wcs, string *mbs); - - // Returns the base name of a file, e.g. strips off the path. - static wstring GetBaseName(const wstring &filename); - - private: - // Disallow instantiation and other object-based operations. - WindowsStringUtils(); - WindowsStringUtils(const WindowsStringUtils&); - ~WindowsStringUtils(); - void operator=(const WindowsStringUtils&); -}; - -// static -inline void WindowsStringUtils::safe_wcscpy(wchar_t *destination, - size_t destination_size, - const wchar_t *source) { -#if _MSC_VER >= 1400 // MSVC 2005/8 - wcscpy_s(destination, destination_size, source); -#else // _MSC_VER >= 1400 - // Pre-MSVC 2005/8 doesn't have wcscpy_s. Simulate it with wcsncpy. - // wcsncpy doesn't 0-terminate the destination buffer if the source string - // is longer than size. Ensure that the destination is 0-terminated. - wcsncpy(destination, source, destination_size); - if (destination && destination_size) - destination[destination_size - 1] = 0; -#endif // _MSC_VER >= 1400 -} - -// static -inline void WindowsStringUtils::safe_wcsncpy(wchar_t *destination, - size_t destination_size, - const wchar_t *source, - size_t count) { -#if _MSC_VER >= 1400 // MSVC 2005/8 - wcsncpy_s(destination, destination_size, source, count); -#else // _MSC_VER >= 1400 - // Pre-MSVC 2005/8 doesn't have wcsncpy_s. Simulate it with wcsncpy. - // wcsncpy doesn't 0-terminate the destination buffer if the source string - // is longer than size. Ensure that the destination is 0-terminated. - if (destination_size < count) - count = destination_size; - - wcsncpy(destination, source, count); - if (destination && count) - destination[count - 1] = 0; -#endif // _MSC_VER >= 1400 -} - -} // namespace google_breakpad - -#endif // COMMON_WINDOWS_STRING_UTILS_INL_H_ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h deleted file mode 100644 index d8828043ff..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/breakpad_types.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* breakpad_types.h: Precise-width types - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file ensures that types uintN_t are defined for N = 8, 16, 32, and - * 64. Types of precise widths are crucial to the task of writing data - * structures on one platform and reading them on another. - * - * Author: Mark Mentovai */ - -#ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ -#define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ - -#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && \ - !defined(__STDC_FORMAT_MACROS) -#error "inttypes.h has already been included before this header file, but " -#error "without __STDC_FORMAT_MACROS defined." -#endif - -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif /* __STDC_FORMAT_MACROS */ -#include - -typedef struct { - uint64_t high; - uint64_t low; -} uint128_struct; - -typedef uint64_t breakpad_time_t; - -/* Try to get PRIx64 from inttypes.h, but if it's not defined, fall back to - * llx, which is the format string for "long long" - this is a 64-bit - * integral type on many systems. */ -#ifndef PRIx64 -#define PRIx64 "llx" -#endif /* !PRIx64 */ - -#endif /* GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h deleted file mode 100644 index 4256706d77..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_amd64.h +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on amd64. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by ensuring - * ensuring that all members are aligned on their natural boundaries. In - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * These definitions may be extended to support handling minidump files - * for other CPUs and other operating systems. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably in terms of interoperability with minidumps - * produced by DbgHelp on Windows, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. DbgHelp - * on Windows is assumed to be the reference implementation; this file - * seeks to provide a cross-platform compatible implementation. To avoid - * collisions with the types and values defined and used by DbgHelp in the - * event that this implementation is used on Windows, each type and value - * defined here is given a new name, beginning with "MD". Names of the - * equivalent types and values in the Windows Platform SDK are given in - * comments. - * - * Author: Mark Mentovai - * Change to split into its own file: Neal Sidhwaney */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ - - -/* - * AMD64 support, see WINNT.H - */ - -typedef struct { - uint16_t control_word; - uint16_t status_word; - uint8_t tag_word; - uint8_t reserved1; - uint16_t error_opcode; - uint32_t error_offset; - uint16_t error_selector; - uint16_t reserved2; - uint32_t data_offset; - uint16_t data_selector; - uint16_t reserved3; - uint32_t mx_csr; - uint32_t mx_csr_mask; - uint128_struct float_registers[8]; - uint128_struct xmm_registers[16]; - uint8_t reserved4[96]; -} MDXmmSaveArea32AMD64; /* XMM_SAVE_AREA32 */ - -#define MD_CONTEXT_AMD64_VR_COUNT 26 - -typedef struct { - /* - * Register parameter home addresses. - */ - uint64_t p1_home; - uint64_t p2_home; - uint64_t p3_home; - uint64_t p4_home; - uint64_t p5_home; - uint64_t p6_home; - - /* The next field determines the layout of the structure, and which parts - * of it are populated */ - uint32_t context_flags; - uint32_t mx_csr; - - /* The next register is included with MD_CONTEXT_AMD64_CONTROL */ - uint16_t cs; - - /* The next 4 registers are included with MD_CONTEXT_AMD64_SEGMENTS */ - uint16_t ds; - uint16_t es; - uint16_t fs; - uint16_t gs; - - /* The next 2 registers are included with MD_CONTEXT_AMD64_CONTROL */ - uint16_t ss; - uint32_t eflags; - - /* The next 6 registers are included with MD_CONTEXT_AMD64_DEBUG_REGISTERS */ - uint64_t dr0; - uint64_t dr1; - uint64_t dr2; - uint64_t dr3; - uint64_t dr6; - uint64_t dr7; - - /* The next 4 registers are included with MD_CONTEXT_AMD64_INTEGER */ - uint64_t rax; - uint64_t rcx; - uint64_t rdx; - uint64_t rbx; - - /* The next register is included with MD_CONTEXT_AMD64_CONTROL */ - uint64_t rsp; - - /* The next 11 registers are included with MD_CONTEXT_AMD64_INTEGER */ - uint64_t rbp; - uint64_t rsi; - uint64_t rdi; - uint64_t r8; - uint64_t r9; - uint64_t r10; - uint64_t r11; - uint64_t r12; - uint64_t r13; - uint64_t r14; - uint64_t r15; - - /* The next register is included with MD_CONTEXT_AMD64_CONTROL */ - uint64_t rip; - - /* The next set of registers are included with - * MD_CONTEXT_AMD64_FLOATING_POINT - */ - union { - MDXmmSaveArea32AMD64 flt_save; - struct { - uint128_struct header[2]; - uint128_struct legacy[8]; - uint128_struct xmm0; - uint128_struct xmm1; - uint128_struct xmm2; - uint128_struct xmm3; - uint128_struct xmm4; - uint128_struct xmm5; - uint128_struct xmm6; - uint128_struct xmm7; - uint128_struct xmm8; - uint128_struct xmm9; - uint128_struct xmm10; - uint128_struct xmm11; - uint128_struct xmm12; - uint128_struct xmm13; - uint128_struct xmm14; - uint128_struct xmm15; - } sse_registers; - }; - - uint128_struct vector_register[MD_CONTEXT_AMD64_VR_COUNT]; - uint64_t vector_control; - - /* The next 5 registers are included with MD_CONTEXT_AMD64_DEBUG_REGISTERS */ - uint64_t debug_control; - uint64_t last_branch_to_rip; - uint64_t last_branch_from_rip; - uint64_t last_exception_to_rip; - uint64_t last_exception_from_rip; - -} MDRawContextAMD64; /* CONTEXT */ - -/* For (MDRawContextAMD64).context_flags. These values indicate the type of - * context stored in the structure. The high 24 bits identify the CPU, the - * low 8 bits identify the type of context saved. */ -#define MD_CONTEXT_AMD64 0x00100000 /* CONTEXT_AMD64 */ -#define MD_CONTEXT_AMD64_CONTROL (MD_CONTEXT_AMD64 | 0x00000001) - /* CONTEXT_CONTROL */ -#define MD_CONTEXT_AMD64_INTEGER (MD_CONTEXT_AMD64 | 0x00000002) - /* CONTEXT_INTEGER */ -#define MD_CONTEXT_AMD64_SEGMENTS (MD_CONTEXT_AMD64 | 0x00000004) - /* CONTEXT_SEGMENTS */ -#define MD_CONTEXT_AMD64_FLOATING_POINT (MD_CONTEXT_AMD64 | 0x00000008) - /* CONTEXT_FLOATING_POINT */ -#define MD_CONTEXT_AMD64_DEBUG_REGISTERS (MD_CONTEXT_AMD64 | 0x00000010) - /* CONTEXT_DEBUG_REGISTERS */ -#define MD_CONTEXT_AMD64_XSTATE (MD_CONTEXT_AMD64 | 0x00000040) - /* CONTEXT_XSTATE */ - -/* WinNT.h refers to CONTEXT_MMX_REGISTERS but doesn't appear to define it - * I think it really means CONTEXT_FLOATING_POINT. - */ - -#define MD_CONTEXT_AMD64_FULL (MD_CONTEXT_AMD64_CONTROL | \ - MD_CONTEXT_AMD64_INTEGER | \ - MD_CONTEXT_AMD64_FLOATING_POINT) - /* CONTEXT_FULL */ - -#define MD_CONTEXT_AMD64_ALL (MD_CONTEXT_AMD64_FULL | \ - MD_CONTEXT_AMD64_SEGMENTS | \ - MD_CONTEXT_X86_DEBUG_REGISTERS) - /* CONTEXT_ALL */ - - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h deleted file mode 100644 index 6a71138337..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm.h +++ /dev/null @@ -1,151 +0,0 @@ -/* Copyright (c) 2009, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on ARM. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by - * ensuring that all members are aligned on their natural boundaries. - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. - * - * Author: Julian Seward - */ - -/* - * ARM support - */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ - -#define MD_FLOATINGSAVEAREA_ARM_FPR_COUNT 32 -#define MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT 8 - -/* - * Note that these structures *do not* map directly to the CONTEXT - * structure defined in WinNT.h in the Windows Mobile SDK. That structure - * does not accomodate VFPv3, and I'm unsure if it was ever used in the - * wild anyway, as Windows CE only seems to produce "cedumps" which - * are not exactly minidumps. - */ -typedef struct { - uint64_t fpscr; /* FPU status register */ - - /* 32 64-bit floating point registers, d0 .. d31. */ - uint64_t regs[MD_FLOATINGSAVEAREA_ARM_FPR_COUNT]; - - /* Miscellaneous control words */ - uint32_t extra[MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT]; -} MDFloatingSaveAreaARM; - -#define MD_CONTEXT_ARM_GPR_COUNT 16 - -typedef struct { - /* The next field determines the layout of the structure, and which parts - * of it are populated - */ - uint32_t context_flags; - - /* 16 32-bit integer registers, r0 .. r15 - * Note the following fixed uses: - * r13 is the stack pointer - * r14 is the link register - * r15 is the program counter - */ - uint32_t iregs[MD_CONTEXT_ARM_GPR_COUNT]; - - /* CPSR (flags, basically): 32 bits: - bit 31 - N (negative) - bit 30 - Z (zero) - bit 29 - C (carry) - bit 28 - V (overflow) - bit 27 - Q (saturation flag, sticky) - All other fields -- ignore */ - uint32_t cpsr; - - /* The next field is included with MD_CONTEXT_ARM_FLOATING_POINT */ - MDFloatingSaveAreaARM float_save; - -} MDRawContextARM; - -/* Indices into iregs for registers with a dedicated or conventional - * purpose. - */ -enum MDARMRegisterNumbers { - MD_CONTEXT_ARM_REG_IOS_FP = 7, - MD_CONTEXT_ARM_REG_FP = 11, - MD_CONTEXT_ARM_REG_SP = 13, - MD_CONTEXT_ARM_REG_LR = 14, - MD_CONTEXT_ARM_REG_PC = 15 -}; - -/* For (MDRawContextARM).context_flags. These values indicate the type of - * context stored in the structure. */ -/* CONTEXT_ARM from the Windows CE 5.0 SDK. This value isn't correct - * because this bit can be used for flags. Presumably this value was - * never actually used in minidumps, but only in "CEDumps" which - * are a whole parallel minidump file format for Windows CE. - * Therefore, Breakpad defines its own value for ARM CPUs. - */ -#define MD_CONTEXT_ARM_OLD 0x00000040 -/* This value was chosen to avoid likely conflicts with MD_CONTEXT_* - * for other CPUs. */ -#define MD_CONTEXT_ARM 0x40000000 -#define MD_CONTEXT_ARM_INTEGER (MD_CONTEXT_ARM | 0x00000002) -#define MD_CONTEXT_ARM_FLOATING_POINT (MD_CONTEXT_ARM | 0x00000004) - -#define MD_CONTEXT_ARM_FULL (MD_CONTEXT_ARM_INTEGER | \ - MD_CONTEXT_ARM_FLOATING_POINT) - -#define MD_CONTEXT_ARM_ALL (MD_CONTEXT_ARM_INTEGER | \ - MD_CONTEXT_ARM_FLOATING_POINT) - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h deleted file mode 100644 index 5ace0d9de4..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_arm64.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright 2013 Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on ARM. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by - * ensuring that all members are aligned on their natural boundaries. - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. - * - * Author: Colin Blundell - */ - -/* - * ARM64 support - */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ - -#define MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT 32 - -typedef struct { - uint32_t fpsr; /* FPU status register */ - uint32_t fpcr; /* FPU control register */ - - /* 32 128-bit floating point registers, d0 .. d31. */ - uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT]; -} MDFloatingSaveAreaARM64; - -#define MD_CONTEXT_ARM64_GPR_COUNT 33 - -/* Use the same 32-bit alignment when accessing this structure from 64-bit code - * as is used natively in 32-bit code. */ -#pragma pack(push, 4) - -typedef struct { - /* The next field determines the layout of the structure, and which parts - * of it are populated - */ - uint64_t context_flags; - - /* 33 64-bit integer registers, x0 .. x31 + the PC - * Note the following fixed uses: - * x29 is the frame pointer - * x30 is the link register - * x31 is the stack pointer - * The PC is effectively x32. - */ - uint64_t iregs[MD_CONTEXT_ARM64_GPR_COUNT]; - - /* CPSR (flags, basically): 32 bits: - bit 31 - N (negative) - bit 30 - Z (zero) - bit 29 - C (carry) - bit 28 - V (overflow) - bit 27 - Q (saturation flag, sticky) - All other fields -- ignore */ - uint32_t cpsr; - - /* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */ - MDFloatingSaveAreaARM64 float_save; - -} MDRawContextARM64; - -#pragma pack(pop) - -/* Indices into iregs for registers with a dedicated or conventional - * purpose. - */ -enum MDARM64RegisterNumbers { - MD_CONTEXT_ARM64_REG_FP = 29, - MD_CONTEXT_ARM64_REG_LR = 30, - MD_CONTEXT_ARM64_REG_SP = 31, - MD_CONTEXT_ARM64_REG_PC = 32 -}; - -/* For (MDRawContextARM64).context_flags. These values indicate the type of - * context stored in the structure. MD_CONTEXT_ARM64 is Breakpad-defined. - * This value was chosen to avoid likely conflicts with MD_CONTEXT_* - * for other CPUs. */ -#define MD_CONTEXT_ARM64 0x80000000 -#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002) -#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004) - -#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_INTEGER | \ - MD_CONTEXT_ARM64_FLOATING_POINT) - -#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_INTEGER | \ - MD_CONTEXT_ARM64_FLOATING_POINT) - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h deleted file mode 100644 index 6cbe3023f9..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_mips.h +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) 2013, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on MIPS. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by - * ensuring that all members are aligned on their natural boundaries. - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. - * - * Author: Chris Dearman - */ - -/* - * MIPS support - */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__ - -#define MD_CONTEXT_MIPS_GPR_COUNT 32 -#define MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT 32 -#define MD_CONTEXT_MIPS_DSP_COUNT 3 - -/* - * Note that these structures *do not* map directly to the CONTEXT - * structure defined in WinNT.h in the Windows Mobile SDK. That structure - * does not accomodate VFPv3, and I'm unsure if it was ever used in the - * wild anyway, as Windows CE only seems to produce "cedumps" which - * are not exactly minidumps. - */ -typedef struct { - /* 32 64-bit floating point registers, f0..f31 */ - uint64_t regs[MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT]; - - uint32_t fpcsr; /* FPU status register. */ - uint32_t fir; /* FPU implementation register. */ -} MDFloatingSaveAreaMIPS; - -typedef struct { - /* The next field determines the layout of the structure, and which parts - * of it are populated. - */ - uint32_t context_flags; - uint32_t _pad0; - - /* 32 64-bit integer registers, r0..r31. - * Note the following fixed uses: - * r29 is the stack pointer. - * r31 is the return address. - */ - uint64_t iregs[MD_CONTEXT_MIPS_GPR_COUNT]; - - /* multiply/divide result. */ - uint64_t mdhi, mdlo; - - /* DSP accumulators. */ - uint32_t hi[MD_CONTEXT_MIPS_DSP_COUNT]; - uint32_t lo[MD_CONTEXT_MIPS_DSP_COUNT]; - uint32_t dsp_control; - uint32_t _pad1; - - uint64_t epc; - uint64_t badvaddr; - uint32_t status; - uint32_t cause; - - /* The next field is included with MD_CONTEXT_MIPS_FLOATING_POINT. */ - MDFloatingSaveAreaMIPS float_save; - -} MDRawContextMIPS; - -/* Indices into iregs for registers with a dedicated or conventional - * purpose. - */ -enum MDMIPSRegisterNumbers { - MD_CONTEXT_MIPS_REG_S0 = 16, - MD_CONTEXT_MIPS_REG_S1 = 17, - MD_CONTEXT_MIPS_REG_S2 = 18, - MD_CONTEXT_MIPS_REG_S3 = 19, - MD_CONTEXT_MIPS_REG_S4 = 20, - MD_CONTEXT_MIPS_REG_S5 = 21, - MD_CONTEXT_MIPS_REG_S6 = 22, - MD_CONTEXT_MIPS_REG_S7 = 23, - MD_CONTEXT_MIPS_REG_GP = 28, - MD_CONTEXT_MIPS_REG_SP = 29, - MD_CONTEXT_MIPS_REG_FP = 30, - MD_CONTEXT_MIPS_REG_RA = 31, -}; - -/* For (MDRawContextMIPS).context_flags. These values indicate the type of - * context stored in the structure. */ -/* CONTEXT_MIPS from the Windows CE 5.0 SDK. This value isn't correct - * because this bit can be used for flags. Presumably this value was - * never actually used in minidumps, but only in "CEDumps" which - * are a whole parallel minidump file format for Windows CE. - * Therefore, Breakpad defines its own value for MIPS CPUs. - */ -#define MD_CONTEXT_MIPS 0x00040000 -#define MD_CONTEXT_MIPS_INTEGER (MD_CONTEXT_MIPS | 0x00000002) -#define MD_CONTEXT_MIPS_FLOATING_POINT (MD_CONTEXT_MIPS | 0x00000004) -#define MD_CONTEXT_MIPS_DSP (MD_CONTEXT_MIPS | 0x00000008) - -#define MD_CONTEXT_MIPS_FULL (MD_CONTEXT_MIPS_INTEGER | \ - MD_CONTEXT_MIPS_FLOATING_POINT | \ - MD_CONTEXT_MIPS_DSP) - -#define MD_CONTEXT_MIPS_ALL (MD_CONTEXT_MIPS_INTEGER | \ - MD_CONTEXT_MIPS_FLOATING_POINT \ - MD_CONTEXT_MIPS_DSP) - -#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h deleted file mode 100644 index b24cc42438..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc.h +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on ppc. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by ensuring - * ensuring that all members are aligned on their natural boundaries. In - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * These definitions may be extended to support handling minidump files - * for other CPUs and other operating systems. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably in terms of interoperability with minidumps - * produced by DbgHelp on Windows, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. DbgHelp - * on Windows is assumed to be the reference implementation; this file - * seeks to provide a cross-platform compatible implementation. To avoid - * collisions with the types and values defined and used by DbgHelp in the - * event that this implementation is used on Windows, each type and value - * defined here is given a new name, beginning with "MD". Names of the - * equivalent types and values in the Windows Platform SDK are given in - * comments. - * - * Author: Mark Mentovai - * Change to split into its own file: Neal Sidhwaney */ - -/* - * Breakpad minidump extension for PowerPC support. Based on Darwin/Mac OS X' - * mach/ppc/_types.h - */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ - -#define MD_FLOATINGSAVEAREA_PPC_FPR_COUNT 32 - -typedef struct { - /* fpregs is a double[32] in mach/ppc/_types.h, but a uint64_t is used - * here for precise sizing. */ - uint64_t fpregs[MD_FLOATINGSAVEAREA_PPC_FPR_COUNT]; - uint32_t fpscr_pad; - uint32_t fpscr; /* Status/control */ -} MDFloatingSaveAreaPPC; /* Based on ppc_float_state */ - - -#define MD_VECTORSAVEAREA_PPC_VR_COUNT 32 - -typedef struct { - /* Vector registers (including vscr) are 128 bits, but mach/ppc/_types.h - * exposes them as four 32-bit quantities. */ - uint128_struct save_vr[MD_VECTORSAVEAREA_PPC_VR_COUNT]; - uint128_struct save_vscr; /* Status/control */ - uint32_t save_pad5[4]; - uint32_t save_vrvalid; /* Indicates which vector registers are saved */ - uint32_t save_pad6[7]; -} MDVectorSaveAreaPPC; /* ppc_vector_state */ - - -#define MD_CONTEXT_PPC_GPR_COUNT 32 - -/* Use the same 32-bit alignment when accessing this structure from 64-bit code - * as is used natively in 32-bit code. #pragma pack is a MSVC extension - * supported by gcc. */ -#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) -#pragma pack(4) -#else -#pragma pack(push, 4) -#endif - -typedef struct { - /* context_flags is not present in ppc_thread_state, but it aids - * identification of MDRawContextPPC among other raw context types, - * and it guarantees alignment when we get to float_save. */ - uint32_t context_flags; - - uint32_t srr0; /* Machine status save/restore: stores pc - * (instruction) */ - uint32_t srr1; /* Machine status save/restore: stores msr - * (ps, program/machine state) */ - /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is - * used for brevity. */ - uint32_t gpr[MD_CONTEXT_PPC_GPR_COUNT]; - uint32_t cr; /* Condition */ - uint32_t xer; /* Integer (fiXed-point) exception */ - uint32_t lr; /* Link */ - uint32_t ctr; /* Count */ - uint32_t mq; /* Multiply/Quotient (PPC 601, POWER only) */ - uint32_t vrsave; /* Vector save */ - - /* float_save and vector_save aren't present in ppc_thread_state, but - * are represented in separate structures that still define a thread's - * context. */ - MDFloatingSaveAreaPPC float_save; - MDVectorSaveAreaPPC vector_save; -} MDRawContextPPC; /* Based on ppc_thread_state */ - -/* Indices into gpr for registers with a dedicated or conventional purpose. */ -enum MDPPCRegisterNumbers { - MD_CONTEXT_PPC_REG_SP = 1 -}; - -#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) -#pragma pack(0) -#else -#pragma pack(pop) -#endif - -/* For (MDRawContextPPC).context_flags. These values indicate the type of - * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its - * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other - * CPUs. */ -#define MD_CONTEXT_PPC 0x20000000 -#define MD_CONTEXT_PPC_BASE (MD_CONTEXT_PPC | 0x00000001) -#define MD_CONTEXT_PPC_FLOATING_POINT (MD_CONTEXT_PPC | 0x00000008) -#define MD_CONTEXT_PPC_VECTOR (MD_CONTEXT_PPC | 0x00000020) - -#define MD_CONTEXT_PPC_FULL MD_CONTEXT_PPC_BASE -#define MD_CONTEXT_PPC_ALL (MD_CONTEXT_PPC_FULL | \ - MD_CONTEXT_PPC_FLOATING_POINT | \ - MD_CONTEXT_PPC_VECTOR) - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h deleted file mode 100644 index 61f4193865..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_ppc64.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) 2008, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on ppc64. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by ensuring - * ensuring that all members are aligned on their natural boundaries. In - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * These definitions may be extended to support handling minidump files - * for other CPUs and other operating systems. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably in terms of interoperability with minidumps - * produced by DbgHelp on Windows, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. DbgHelp - * on Windows is assumed to be the reference implementation; this file - * seeks to provide a cross-platform compatible implementation. To avoid - * collisions with the types and values defined and used by DbgHelp in the - * event that this implementation is used on Windows, each type and value - * defined here is given a new name, beginning with "MD". Names of the - * equivalent types and values in the Windows Platform SDK are given in - * comments. - * - * Author: Neal Sidhwaney */ - - -/* - * Breakpad minidump extension for PPC64 support. Based on Darwin/Mac OS X' - * mach/ppc/_types.h - */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ - -#include "minidump_cpu_ppc.h" - -// these types are the same in ppc64 & ppc -typedef MDFloatingSaveAreaPPC MDFloatingSaveAreaPPC64; -typedef MDVectorSaveAreaPPC MDVectorSaveAreaPPC64; - -#define MD_CONTEXT_PPC64_GPR_COUNT MD_CONTEXT_PPC_GPR_COUNT - -typedef struct { - /* context_flags is not present in ppc_thread_state, but it aids - * identification of MDRawContextPPC among other raw context types, - * and it guarantees alignment when we get to float_save. */ - uint64_t context_flags; - - uint64_t srr0; /* Machine status save/restore: stores pc - * (instruction) */ - uint64_t srr1; /* Machine status save/restore: stores msr - * (ps, program/machine state) */ - /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is - * used for brevity. */ - uint64_t gpr[MD_CONTEXT_PPC64_GPR_COUNT]; - uint64_t cr; /* Condition */ - uint64_t xer; /* Integer (fiXed-point) exception */ - uint64_t lr; /* Link */ - uint64_t ctr; /* Count */ - uint64_t vrsave; /* Vector save */ - - /* float_save and vector_save aren't present in ppc_thread_state, but - * are represented in separate structures that still define a thread's - * context. */ - MDFloatingSaveAreaPPC float_save; - MDVectorSaveAreaPPC vector_save; -} MDRawContextPPC64; /* Based on ppc_thread_state */ - -/* Indices into gpr for registers with a dedicated or conventional purpose. */ -enum MDPPC64RegisterNumbers { - MD_CONTEXT_PPC64_REG_SP = 1 -}; - -/* For (MDRawContextPPC).context_flags. These values indicate the type of - * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its - * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other - * CPUs. */ -#define MD_CONTEXT_PPC64 0x01000000 -#define MD_CONTEXT_PPC64_BASE (MD_CONTEXT_PPC64 | 0x00000001) -#define MD_CONTEXT_PPC64_FLOATING_POINT (MD_CONTEXT_PPC64 | 0x00000008) -#define MD_CONTEXT_PPC64_VECTOR (MD_CONTEXT_PPC64 | 0x00000020) - -#define MD_CONTEXT_PPC64_FULL MD_CONTEXT_PPC64_BASE -#define MD_CONTEXT_PPC64_ALL (MD_CONTEXT_PPC64_FULL | \ - MD_CONTEXT_PPC64_FLOATING_POINT | \ - MD_CONTEXT_PPC64_VECTOR) - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h deleted file mode 100644 index 95c08b1743..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_sparc.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on sparc. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by ensuring - * ensuring that all members are aligned on their natural boundaries. In - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * These definitions may be extended to support handling minidump files - * for other CPUs and other operating systems. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably in terms of interoperability with minidumps - * produced by DbgHelp on Windows, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. DbgHelp - * on Windows is assumed to be the reference implementation; this file - * seeks to provide a cross-platform compatible implementation. To avoid - * collisions with the types and values defined and used by DbgHelp in the - * event that this implementation is used on Windows, each type and value - * defined here is given a new name, beginning with "MD". Names of the - * equivalent types and values in the Windows Platform SDK are given in - * comments. - * - * Author: Mark Mentovai - * Change to split into its own file: Neal Sidhwaney */ - -/* - * SPARC support, see (solaris)sys/procfs_isa.h also - */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ - -#define MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT 32 - -typedef struct { - - /* FPU floating point regs */ - uint64_t regs[MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT]; - - uint64_t filler; - uint64_t fsr; /* FPU status register */ -} MDFloatingSaveAreaSPARC; /* FLOATING_SAVE_AREA */ - -#define MD_CONTEXT_SPARC_GPR_COUNT 32 - -typedef struct { - /* The next field determines the layout of the structure, and which parts - * of it are populated - */ - uint32_t context_flags; - uint32_t flag_pad; - /* - * General register access (SPARC). - * Don't confuse definitions here with definitions in . - * Registers are 32 bits for ILP32, 64 bits for LP64. - * SPARC V7/V8 is for 32bit, SPARC V9 is for 64bit - */ - - /* 32 Integer working registers */ - - /* g_r[0-7] global registers(g0-g7) - * g_r[8-15] out registers(o0-o7) - * g_r[16-23] local registers(l0-l7) - * g_r[24-31] in registers(i0-i7) - */ - uint64_t g_r[MD_CONTEXT_SPARC_GPR_COUNT]; - - /* several control registers */ - - /* Processor State register(PSR) for SPARC V7/V8 - * Condition Code register (CCR) for SPARC V9 - */ - uint64_t ccr; - - uint64_t pc; /* Program Counter register (PC) */ - uint64_t npc; /* Next Program Counter register (nPC) */ - uint64_t y; /* Y register (Y) */ - - /* Address Space Identifier register (ASI) for SPARC V9 - * WIM for SPARC V7/V8 - */ - uint64_t asi; - - /* Floating-Point Registers State register (FPRS) for SPARC V9 - * TBR for for SPARC V7/V8 - */ - uint64_t fprs; - - /* The next field is included with MD_CONTEXT_SPARC_FLOATING_POINT */ - MDFloatingSaveAreaSPARC float_save; - -} MDRawContextSPARC; /* CONTEXT_SPARC */ - -/* Indices into g_r for registers with a dedicated or conventional purpose. */ -enum MDSPARCRegisterNumbers { - MD_CONTEXT_SPARC_REG_SP = 14 -}; - -/* For (MDRawContextSPARC).context_flags. These values indicate the type of - * context stored in the structure. MD_CONTEXT_SPARC is Breakpad-defined. Its - * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other - * CPUs. */ -#define MD_CONTEXT_SPARC 0x10000000 -#define MD_CONTEXT_SPARC_CONTROL (MD_CONTEXT_SPARC | 0x00000001) -#define MD_CONTEXT_SPARC_INTEGER (MD_CONTEXT_SPARC | 0x00000002) -#define MD_CONTEXT_SAPARC_FLOATING_POINT (MD_CONTEXT_SPARC | 0x00000004) -#define MD_CONTEXT_SAPARC_EXTRA (MD_CONTEXT_SPARC | 0x00000008) - -#define MD_CONTEXT_SPARC_FULL (MD_CONTEXT_SPARC_CONTROL | \ - MD_CONTEXT_SPARC_INTEGER) - -#define MD_CONTEXT_SPARC_ALL (MD_CONTEXT_SPARC_FULL | \ - MD_CONTEXT_SAPARC_FLOATING_POINT | \ - MD_CONTEXT_SAPARC_EXTRA) - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h deleted file mode 100644 index e09cb7cb52..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_cpu_x86.h +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * This file contains the necessary definitions to read minidump files - * produced on x86. These files may be read on any platform provided - * that the alignments of these structures on the processing system are - * identical to the alignments of these structures on the producing system. - * For this reason, precise-sized types are used. The structures defined - * by this file have been laid out to minimize alignment problems by ensuring - * ensuring that all members are aligned on their natural boundaries. In - * In some cases, tail-padding may be significant when different ABIs specify - * different tail-padding behaviors. To avoid problems when reading or - * writing affected structures, MD_*_SIZE macros are provided where needed, - * containing the useful size of the structures without padding. - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * These definitions may be extended to support handling minidump files - * for other CPUs and other operating systems. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably in terms of interoperability with minidumps - * produced by DbgHelp on Windows, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. DbgHelp - * on Windows is assumed to be the reference implementation; this file - * seeks to provide a cross-platform compatible implementation. To avoid - * collisions with the types and values defined and used by DbgHelp in the - * event that this implementation is used on Windows, each type and value - * defined here is given a new name, beginning with "MD". Names of the - * equivalent types and values in the Windows Platform SDK are given in - * comments. - * - * Author: Mark Mentovai */ - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ - -#define MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE 80 - /* SIZE_OF_80387_REGISTERS */ - -typedef struct { - uint32_t control_word; - uint32_t status_word; - uint32_t tag_word; - uint32_t error_offset; - uint32_t error_selector; - uint32_t data_offset; - uint32_t data_selector; - - /* register_area contains eight 80-bit (x87 "long double") quantities for - * floating-point registers %st0 (%mm0) through %st7 (%mm7). */ - uint8_t register_area[MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE]; - uint32_t cr0_npx_state; -} MDFloatingSaveAreaX86; /* FLOATING_SAVE_AREA */ - - -#define MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE 512 - /* MAXIMUM_SUPPORTED_EXTENSION */ - -typedef struct { - /* The next field determines the layout of the structure, and which parts - * of it are populated */ - uint32_t context_flags; - - /* The next 6 registers are included with MD_CONTEXT_X86_DEBUG_REGISTERS */ - uint32_t dr0; - uint32_t dr1; - uint32_t dr2; - uint32_t dr3; - uint32_t dr6; - uint32_t dr7; - - /* The next field is included with MD_CONTEXT_X86_FLOATING_POINT */ - MDFloatingSaveAreaX86 float_save; - - /* The next 4 registers are included with MD_CONTEXT_X86_SEGMENTS */ - uint32_t gs; - uint32_t fs; - uint32_t es; - uint32_t ds; - /* The next 6 registers are included with MD_CONTEXT_X86_INTEGER */ - uint32_t edi; - uint32_t esi; - uint32_t ebx; - uint32_t edx; - uint32_t ecx; - uint32_t eax; - - /* The next 6 registers are included with MD_CONTEXT_X86_CONTROL */ - uint32_t ebp; - uint32_t eip; - uint32_t cs; /* WinNT.h says "must be sanitized" */ - uint32_t eflags; /* WinNT.h says "must be sanitized" */ - uint32_t esp; - uint32_t ss; - - /* The next field is included with MD_CONTEXT_X86_EXTENDED_REGISTERS. - * It contains vector (MMX/SSE) registers. It it laid out in the - * format used by the fxsave and fsrstor instructions, so it includes - * a copy of the x87 floating-point registers as well. See FXSAVE in - * "Intel Architecture Software Developer's Manual, Volume 2." */ - uint8_t extended_registers[ - MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE]; -} MDRawContextX86; /* CONTEXT */ - -/* For (MDRawContextX86).context_flags. These values indicate the type of - * context stored in the structure. The high 24 bits identify the CPU, the - * low 8 bits identify the type of context saved. */ -#define MD_CONTEXT_X86 0x00010000 - /* CONTEXT_i386, CONTEXT_i486: identifies CPU */ -#define MD_CONTEXT_X86_CONTROL (MD_CONTEXT_X86 | 0x00000001) - /* CONTEXT_CONTROL */ -#define MD_CONTEXT_X86_INTEGER (MD_CONTEXT_X86 | 0x00000002) - /* CONTEXT_INTEGER */ -#define MD_CONTEXT_X86_SEGMENTS (MD_CONTEXT_X86 | 0x00000004) - /* CONTEXT_SEGMENTS */ -#define MD_CONTEXT_X86_FLOATING_POINT (MD_CONTEXT_X86 | 0x00000008) - /* CONTEXT_FLOATING_POINT */ -#define MD_CONTEXT_X86_DEBUG_REGISTERS (MD_CONTEXT_X86 | 0x00000010) - /* CONTEXT_DEBUG_REGISTERS */ -#define MD_CONTEXT_X86_EXTENDED_REGISTERS (MD_CONTEXT_X86 | 0x00000020) - /* CONTEXT_EXTENDED_REGISTERS */ -#define MD_CONTEXT_X86_XSTATE (MD_CONTEXT_X86 | 0x00000040) - /* CONTEXT_XSTATE */ - -#define MD_CONTEXT_X86_FULL (MD_CONTEXT_X86_CONTROL | \ - MD_CONTEXT_X86_INTEGER | \ - MD_CONTEXT_X86_SEGMENTS) - /* CONTEXT_FULL */ - -#define MD_CONTEXT_X86_ALL (MD_CONTEXT_X86_FULL | \ - MD_CONTEXT_X86_FLOATING_POINT | \ - MD_CONTEXT_X86_DEBUG_REGISTERS | \ - MD_CONTEXT_X86_EXTENDED_REGISTERS) - /* CONTEXT_ALL */ - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h deleted file mode 100644 index 9e7e4f1e12..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_linux.h +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_exception_linux.h: A definition of exception codes for - * Linux - * - * (This is C99 source, please don't corrupt it with C++.) - * - * Author: Mark Mentovai - * Split into its own file: Neal Sidhwaney */ - - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ - -#include - -#include "google_breakpad/common/breakpad_types.h" - - -/* For (MDException).exception_code. These values come from bits/signum.h. - */ -typedef enum { - MD_EXCEPTION_CODE_LIN_SIGHUP = 1, /* Hangup (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGINT = 2, /* Interrupt (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGQUIT = 3, /* Quit (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGILL = 4, /* Illegal instruction (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGTRAP = 5, /* Trace trap (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGABRT = 6, /* Abort (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGBUS = 7, /* BUS error (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGFPE = 8, /* Floating-point exception (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGKILL = 9, /* Kill, unblockable (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGUSR1 = 10, /* User-defined signal 1 (POSIX). */ - MD_EXCEPTION_CODE_LIN_SIGSEGV = 11, /* Segmentation violation (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGUSR2 = 12, /* User-defined signal 2 (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGPIPE = 13, /* Broken pipe (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGALRM = 14, /* Alarm clock (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTERM = 15, /* Termination (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGSTKFLT = 16, /* Stack faultd */ - MD_EXCEPTION_CODE_LIN_SIGCHLD = 17, /* Child status has changed (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGCONT = 18, /* Continue (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGSTOP = 19, /* Stop, unblockable (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTSTP = 20, /* Keyboard stop (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTTIN = 21, /* Background read from tty (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTTOU = 22, /* Background write to tty (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGURG = 23, - /* Urgent condition on socket (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGXCPU = 24, /* CPU limit exceeded (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGXFSZ = 25, - /* File size limit exceeded (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGVTALRM = 26, /* Virtual alarm clock (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGPROF = 27, /* Profiling alarm clock (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGWINCH = 28, /* Window size change (4.3 BSD, Sun) */ - MD_EXCEPTION_CODE_LIN_SIGIO = 29, /* I/O now possible (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGPWR = 30, /* Power failure restart (System V) */ - MD_EXCEPTION_CODE_LIN_SIGSYS = 31, /* Bad system call */ - MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception, - dump requested. */ -} MDExceptionCodeLinux; - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h deleted file mode 100644 index 91c1c09746..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_mac.h +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_exception_mac.h: A definition of exception codes for Mac - * OS X - * - * (This is C99 source, please don't corrupt it with C++.) - * - * Author: Mark Mentovai - * Split into its own file: Neal Sidhwaney */ - - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__ - -#include - -#include "google_breakpad/common/breakpad_types.h" - -/* For (MDException).exception_code. Breakpad minidump extension for Mac OS X - * support. Based on Darwin/Mac OS X' mach/exception_types.h. This is - * what Mac OS X calls an "exception", not a "code". */ -typedef enum { - /* Exception code. The high 16 bits of exception_code contains one of - * these values. */ - MD_EXCEPTION_MAC_BAD_ACCESS = 1, /* code can be a kern_return_t */ - /* EXC_BAD_ACCESS */ - MD_EXCEPTION_MAC_BAD_INSTRUCTION = 2, /* code is CPU-specific */ - /* EXC_BAD_INSTRUCTION */ - MD_EXCEPTION_MAC_ARITHMETIC = 3, /* code is CPU-specific */ - /* EXC_ARITHMETIC */ - MD_EXCEPTION_MAC_EMULATION = 4, /* code is CPU-specific */ - /* EXC_EMULATION */ - MD_EXCEPTION_MAC_SOFTWARE = 5, - /* EXC_SOFTWARE */ - MD_EXCEPTION_MAC_BREAKPOINT = 6, /* code is CPU-specific */ - /* EXC_BREAKPOINT */ - MD_EXCEPTION_MAC_SYSCALL = 7, - /* EXC_SYSCALL */ - MD_EXCEPTION_MAC_MACH_SYSCALL = 8, - /* EXC_MACH_SYSCALL */ - MD_EXCEPTION_MAC_RPC_ALERT = 9 - /* EXC_RPC_ALERT */ -} MDExceptionMac; - -/* For (MDException).exception_flags. Breakpad minidump extension for Mac OS X - * support. Based on Darwin/Mac OS X' mach/ppc/exception.h and - * mach/i386/exception.h. This is what Mac OS X calls a "code". */ -typedef enum { - /* With MD_EXCEPTION_BAD_ACCESS. These are relevant kern_return_t values - * from mach/kern_return.h. */ - MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS = 1, - /* KERN_INVALID_ADDRESS */ - MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE = 2, - /* KERN_PROTECTION_FAILURE */ - MD_EXCEPTION_CODE_MAC_NO_ACCESS = 8, - /* KERN_NO_ACCESS */ - MD_EXCEPTION_CODE_MAC_MEMORY_FAILURE = 9, - /* KERN_MEMORY_FAILURE */ - MD_EXCEPTION_CODE_MAC_MEMORY_ERROR = 10, - /* KERN_MEMORY_ERROR */ - - /* With MD_EXCEPTION_SOFTWARE */ - MD_EXCEPTION_CODE_MAC_BAD_SYSCALL = 0x00010000, /* Mach SIGSYS */ - MD_EXCEPTION_CODE_MAC_BAD_PIPE = 0x00010001, /* Mach SIGPIPE */ - MD_EXCEPTION_CODE_MAC_ABORT = 0x00010002, /* Mach SIGABRT */ - /* Custom values */ - MD_EXCEPTION_CODE_MAC_NS_EXCEPTION = 0xDEADC0DE, /* uncaught NSException */ - - /* With MD_EXCEPTION_MAC_BAD_ACCESS on arm */ - MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN = 0x0101, /* EXC_ARM_DA_ALIGN */ - MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG = 0x0102, /* EXC_ARM_DA_DEBUG */ - - /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on arm */ - MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED = 1, /* EXC_ARM_UNDEFINED */ - - /* With MD_EXCEPTION_MAC_BREAKPOINT on arm */ - MD_EXCEPTION_CODE_MAC_ARM_BREAKPOINT = 1, /* EXC_ARM_BREAKPOINT */ - - /* With MD_EXCEPTION_MAC_BAD_ACCESS on ppc */ - MD_EXCEPTION_CODE_MAC_PPC_VM_PROT_READ = 0x0101, - /* EXC_PPC_VM_PROT_READ */ - MD_EXCEPTION_CODE_MAC_PPC_BADSPACE = 0x0102, - /* EXC_PPC_BADSPACE */ - MD_EXCEPTION_CODE_MAC_PPC_UNALIGNED = 0x0103, - /* EXC_PPC_UNALIGNED */ - - /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on ppc */ - MD_EXCEPTION_CODE_MAC_PPC_INVALID_SYSCALL = 1, - /* EXC_PPC_INVALID_SYSCALL */ - MD_EXCEPTION_CODE_MAC_PPC_UNIMPLEMENTED_INSTRUCTION = 2, - /* EXC_PPC_UNIPL_INST */ - MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_INSTRUCTION = 3, - /* EXC_PPC_PRIVINST */ - MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_REGISTER = 4, - /* EXC_PPC_PRIVREG */ - MD_EXCEPTION_CODE_MAC_PPC_TRACE = 5, - /* EXC_PPC_TRACE */ - MD_EXCEPTION_CODE_MAC_PPC_PERFORMANCE_MONITOR = 6, - /* EXC_PPC_PERFMON */ - - /* With MD_EXCEPTION_MAC_ARITHMETIC on ppc */ - MD_EXCEPTION_CODE_MAC_PPC_OVERFLOW = 1, - /* EXC_PPC_OVERFLOW */ - MD_EXCEPTION_CODE_MAC_PPC_ZERO_DIVIDE = 2, - /* EXC_PPC_ZERO_DIVIDE */ - MD_EXCEPTION_CODE_MAC_PPC_FLOAT_INEXACT = 3, - /* EXC_FLT_INEXACT */ - MD_EXCEPTION_CODE_MAC_PPC_FLOAT_ZERO_DIVIDE = 4, - /* EXC_PPC_FLT_ZERO_DIVIDE */ - MD_EXCEPTION_CODE_MAC_PPC_FLOAT_UNDERFLOW = 5, - /* EXC_PPC_FLT_UNDERFLOW */ - MD_EXCEPTION_CODE_MAC_PPC_FLOAT_OVERFLOW = 6, - /* EXC_PPC_FLT_OVERFLOW */ - MD_EXCEPTION_CODE_MAC_PPC_FLOAT_NOT_A_NUMBER = 7, - /* EXC_PPC_FLT_NOT_A_NUMBER */ - - /* With MD_EXCEPTION_MAC_EMULATION on ppc */ - MD_EXCEPTION_CODE_MAC_PPC_NO_EMULATION = 8, - /* EXC_PPC_NOEMULATION */ - MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST = 9, - /* EXC_PPC_ALTIVECASSIST */ - - /* With MD_EXCEPTION_MAC_SOFTWARE on ppc */ - MD_EXCEPTION_CODE_MAC_PPC_TRAP = 0x00000001, /* EXC_PPC_TRAP */ - MD_EXCEPTION_CODE_MAC_PPC_MIGRATE = 0x00010100, /* EXC_PPC_MIGRATE */ - - /* With MD_EXCEPTION_MAC_BREAKPOINT on ppc */ - MD_EXCEPTION_CODE_MAC_PPC_BREAKPOINT = 1, /* EXC_PPC_BREAKPOINT */ - - /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86, see also x86 interrupt - * values below. */ - MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION = 1, /* EXC_I386_INVOP */ - - /* With MD_EXCEPTION_MAC_ARITHMETIC on x86 */ - MD_EXCEPTION_CODE_MAC_X86_DIV = 1, /* EXC_I386_DIV */ - MD_EXCEPTION_CODE_MAC_X86_INTO = 2, /* EXC_I386_INTO */ - MD_EXCEPTION_CODE_MAC_X86_NOEXT = 3, /* EXC_I386_NOEXT */ - MD_EXCEPTION_CODE_MAC_X86_EXTOVR = 4, /* EXC_I386_EXTOVR */ - MD_EXCEPTION_CODE_MAC_X86_EXTERR = 5, /* EXC_I386_EXTERR */ - MD_EXCEPTION_CODE_MAC_X86_EMERR = 6, /* EXC_I386_EMERR */ - MD_EXCEPTION_CODE_MAC_X86_BOUND = 7, /* EXC_I386_BOUND */ - MD_EXCEPTION_CODE_MAC_X86_SSEEXTERR = 8, /* EXC_I386_SSEEXTERR */ - - /* With MD_EXCEPTION_MAC_BREAKPOINT on x86 */ - MD_EXCEPTION_CODE_MAC_X86_SGL = 1, /* EXC_I386_SGL */ - MD_EXCEPTION_CODE_MAC_X86_BPT = 2, /* EXC_I386_BPT */ - - /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86. These are the raw - * x86 interrupt codes. Most of these are mapped to other Mach - * exceptions and codes, are handled, or should not occur in user space. - * A few of these will do occur with MD_EXCEPTION_MAC_BAD_INSTRUCTION. */ - /* EXC_I386_DIVERR = 0: mapped to EXC_ARITHMETIC/EXC_I386_DIV */ - /* EXC_I386_SGLSTP = 1: mapped to EXC_BREAKPOINT/EXC_I386_SGL */ - /* EXC_I386_NMIFLT = 2: should not occur in user space */ - /* EXC_I386_BPTFLT = 3: mapped to EXC_BREAKPOINT/EXC_I386_BPT */ - /* EXC_I386_INTOFLT = 4: mapped to EXC_ARITHMETIC/EXC_I386_INTO */ - /* EXC_I386_BOUNDFLT = 5: mapped to EXC_ARITHMETIC/EXC_I386_BOUND */ - /* EXC_I386_INVOPFLT = 6: mapped to EXC_BAD_INSTRUCTION/EXC_I386_INVOP */ - /* EXC_I386_NOEXTFLT = 7: should be handled by the kernel */ - /* EXC_I386_DBLFLT = 8: should be handled (if possible) by the kernel */ - /* EXC_I386_EXTOVRFLT = 9: mapped to EXC_BAD_ACCESS/(PROT_READ|PROT_EXEC) */ - MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT = 10, - /* EXC_INVTSSFLT */ - MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT = 11, - /* EXC_SEGNPFLT */ - MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT = 12, - /* EXC_STKFLT */ - MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT = 13, - /* EXC_GPFLT */ - /* EXC_I386_PGFLT = 14: should not occur in user space */ - /* EXC_I386_EXTERRFLT = 16: mapped to EXC_ARITHMETIC/EXC_I386_EXTERR */ - MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT = 17 - /* EXC_ALIGNFLT (for vector operations) */ - /* EXC_I386_ENOEXTFLT = 32: should be handled by the kernel */ - /* EXC_I386_ENDPERR = 33: should not occur */ -} MDExceptionCodeMac; - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_OSX_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h deleted file mode 100644 index adff5a6bbc..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_ps3.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2013, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_exception_ps3.h: A definition of exception codes for - * PS3 */ - - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ - -#include - -#include "google_breakpad/common/breakpad_types.h" - -typedef enum { - MD_EXCEPTION_CODE_PS3_UNKNOWN = 0, - MD_EXCEPTION_CODE_PS3_TRAP_EXCEP = 1, - MD_EXCEPTION_CODE_PS3_PRIV_INSTR = 2, - MD_EXCEPTION_CODE_PS3_ILLEGAL_INSTR = 3, - MD_EXCEPTION_CODE_PS3_INSTR_STORAGE = 4, - MD_EXCEPTION_CODE_PS3_INSTR_SEGMENT = 5, - MD_EXCEPTION_CODE_PS3_DATA_STORAGE = 6, - MD_EXCEPTION_CODE_PS3_DATA_SEGMENT = 7, - MD_EXCEPTION_CODE_PS3_FLOAT_POINT = 8, - MD_EXCEPTION_CODE_PS3_DABR_MATCH = 9, - MD_EXCEPTION_CODE_PS3_ALIGN_EXCEP = 10, - MD_EXCEPTION_CODE_PS3_MEMORY_ACCESS = 11, - MD_EXCEPTION_CODE_PS3_COPRO_ALIGN = 12, - MD_EXCEPTION_CODE_PS3_COPRO_INVALID_COM = 13, - MD_EXCEPTION_CODE_PS3_COPRO_ERR = 14, - MD_EXCEPTION_CODE_PS3_COPRO_FIR = 15, - MD_EXCEPTION_CODE_PS3_COPRO_DATA_SEGMENT = 16, - MD_EXCEPTION_CODE_PS3_COPRO_DATA_STORAGE = 17, - MD_EXCEPTION_CODE_PS3_COPRO_STOP_INSTR = 18, - MD_EXCEPTION_CODE_PS3_COPRO_HALT_INSTR = 19, - MD_EXCEPTION_CODE_PS3_COPRO_HALTINST_UNKNOWN = 20, - MD_EXCEPTION_CODE_PS3_COPRO_MEMORY_ACCESS = 21, - MD_EXCEPTION_CODE_PS3_GRAPHIC = 22 -} MDExceptionCodePS3; - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h deleted file mode 100644 index f18ddf4247..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_solaris.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_exception_solaris.h: A definition of exception codes for - * Solaris - * - * (This is C99 source, please don't corrupt it with C++.) - * - * Author: Mark Mentovai - * Split into its own file: Neal Sidhwaney */ - - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ - -#include - -#include "google_breakpad/common/breakpad_types.h" - -/* For (MDException).exception_code. These values come from sys/iso/signal_iso.h - */ -typedef enum { - MD_EXCEPTION_CODE_SOL_SIGHUP = 1, /* Hangup */ - MD_EXCEPTION_CODE_SOL_SIGINT = 2, /* interrupt (rubout) */ - MD_EXCEPTION_CODE_SOL_SIGQUIT = 3, /* quit (ASCII FS) */ - MD_EXCEPTION_CODE_SOL_SIGILL = 4, /* illegal instruction (not reset when caught) */ - MD_EXCEPTION_CODE_SOL_SIGTRAP = 5, /* trace trap (not reset when caught) */ - MD_EXCEPTION_CODE_SOL_SIGIOT = 6, /* IOT instruction */ - MD_EXCEPTION_CODE_SOL_SIGABRT = 6, /* used by abort, replace SIGIOT in the future */ - MD_EXCEPTION_CODE_SOL_SIGEMT = 7, /* EMT instruction */ - MD_EXCEPTION_CODE_SOL_SIGFPE = 8, /* floating point exception */ - MD_EXCEPTION_CODE_SOL_SIGKILL = 9, /* kill (cannot be caught or ignored) */ - MD_EXCEPTION_CODE_SOL_SIGBUS = 10, /* bus error */ - MD_EXCEPTION_CODE_SOL_SIGSEGV = 11, /* segmentation violation */ - MD_EXCEPTION_CODE_SOL_SIGSYS = 12, /* bad argument to system call */ - MD_EXCEPTION_CODE_SOL_SIGPIPE = 13, /* write on a pipe with no one to read it */ - MD_EXCEPTION_CODE_SOL_SIGALRM = 14, /* alarm clock */ - MD_EXCEPTION_CODE_SOL_SIGTERM = 15, /* software termination signal from kill */ - MD_EXCEPTION_CODE_SOL_SIGUSR1 = 16, /* user defined signal 1 */ - MD_EXCEPTION_CODE_SOL_SIGUSR2 = 17, /* user defined signal 2 */ - MD_EXCEPTION_CODE_SOL_SIGCLD = 18, /* child status change */ - MD_EXCEPTION_CODE_SOL_SIGCHLD = 18, /* child status change alias (POSIX) */ - MD_EXCEPTION_CODE_SOL_SIGPWR = 19, /* power-fail restart */ - MD_EXCEPTION_CODE_SOL_SIGWINCH = 20, /* window size change */ - MD_EXCEPTION_CODE_SOL_SIGURG = 21, /* urgent socket condition */ - MD_EXCEPTION_CODE_SOL_SIGPOLL = 22, /* pollable event occurred */ - MD_EXCEPTION_CODE_SOL_SIGIO = 22, /* socket I/O possible (SIGPOLL alias) */ - MD_EXCEPTION_CODE_SOL_SIGSTOP = 23, /* stop (cannot be caught or ignored) */ - MD_EXCEPTION_CODE_SOL_SIGTSTP = 24, /* user stop requested from tty */ - MD_EXCEPTION_CODE_SOL_SIGCONT = 25, /* stopped process has been continued */ - MD_EXCEPTION_CODE_SOL_SIGTTIN = 26, /* background tty read attempted */ - MD_EXCEPTION_CODE_SOL_SIGTTOU = 27, /* background tty write attempted */ - MD_EXCEPTION_CODE_SOL_SIGVTALRM = 28, /* virtual timer expired */ - MD_EXCEPTION_CODE_SOL_SIGPROF = 29, /* profiling timer expired */ - MD_EXCEPTION_CODE_SOL_SIGXCPU = 30, /* exceeded cpu limit */ - MD_EXCEPTION_CODE_SOL_SIGXFSZ = 31, /* exceeded file size limit */ - MD_EXCEPTION_CODE_SOL_SIGWAITING = 32, /* reserved signal no longer used by threading code */ - MD_EXCEPTION_CODE_SOL_SIGLWP = 33, /* reserved signal no longer used by threading code */ - MD_EXCEPTION_CODE_SOL_SIGFREEZE = 34, /* special signal used by CPR */ - MD_EXCEPTION_CODE_SOL_SIGTHAW = 35, /* special signal used by CPR */ - MD_EXCEPTION_CODE_SOL_SIGCANCEL = 36, /* reserved signal for thread cancellation */ - MD_EXCEPTION_CODE_SOL_SIGLOST = 37, /* resource lost (eg, record-lock lost) */ - MD_EXCEPTION_CODE_SOL_SIGXRES = 38, /* resource control exceeded */ - MD_EXCEPTION_CODE_SOL_SIGJVM1 = 39, /* reserved signal for Java Virtual Machine */ - MD_EXCEPTION_CODE_SOL_SIGJVM2 = 40 /* reserved signal for Java Virtual Machine */ -} MDExceptionCodeSolaris; - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h deleted file mode 100644 index e4cd59edd5..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_exception_win32.h +++ /dev/null @@ -1,2261 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_exception_win32.h: Definitions of exception codes for - * Win32 platform - * - * (This is C99 source, please don't corrupt it with C++.) - * - * Author: Mark Mentovai - * Split into its own file: Neal Sidhwaney */ - - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ - -#include - -#include "google_breakpad/common/breakpad_types.h" - - -/* For (MDException).exception_code. These values come from WinBase.h - * and WinNT.h (names beginning with EXCEPTION_ are in WinBase.h, - * they are STATUS_ in WinNT.h). */ -typedef enum { - MD_EXCEPTION_CODE_WIN_CONTROL_C = 0x40010005, - /* DBG_CONTROL_C */ - MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION = 0x80000001, - /* EXCEPTION_GUARD_PAGE */ - MD_EXCEPTION_CODE_WIN_DATATYPE_MISALIGNMENT = 0x80000002, - /* EXCEPTION_DATATYPE_MISALIGNMENT */ - MD_EXCEPTION_CODE_WIN_BREAKPOINT = 0x80000003, - /* EXCEPTION_BREAKPOINT */ - MD_EXCEPTION_CODE_WIN_SINGLE_STEP = 0x80000004, - /* EXCEPTION_SINGLE_STEP */ - MD_EXCEPTION_CODE_WIN_ACCESS_VIOLATION = 0xc0000005, - /* EXCEPTION_ACCESS_VIOLATION */ - MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR = 0xc0000006, - /* EXCEPTION_IN_PAGE_ERROR */ - MD_EXCEPTION_CODE_WIN_INVALID_HANDLE = 0xc0000008, - /* EXCEPTION_INVALID_HANDLE */ - MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION = 0xc000001d, - /* EXCEPTION_ILLEGAL_INSTRUCTION */ - MD_EXCEPTION_CODE_WIN_NONCONTINUABLE_EXCEPTION = 0xc0000025, - /* EXCEPTION_NONCONTINUABLE_EXCEPTION */ - MD_EXCEPTION_CODE_WIN_INVALID_DISPOSITION = 0xc0000026, - /* EXCEPTION_INVALID_DISPOSITION */ - MD_EXCEPTION_CODE_WIN_ARRAY_BOUNDS_EXCEEDED = 0xc000008c, - /* EXCEPTION_BOUNDS_EXCEEDED */ - MD_EXCEPTION_CODE_WIN_FLOAT_DENORMAL_OPERAND = 0xc000008d, - /* EXCEPTION_FLT_DENORMAL_OPERAND */ - MD_EXCEPTION_CODE_WIN_FLOAT_DIVIDE_BY_ZERO = 0xc000008e, - /* EXCEPTION_FLT_DIVIDE_BY_ZERO */ - MD_EXCEPTION_CODE_WIN_FLOAT_INEXACT_RESULT = 0xc000008f, - /* EXCEPTION_FLT_INEXACT_RESULT */ - MD_EXCEPTION_CODE_WIN_FLOAT_INVALID_OPERATION = 0xc0000090, - /* EXCEPTION_FLT_INVALID_OPERATION */ - MD_EXCEPTION_CODE_WIN_FLOAT_OVERFLOW = 0xc0000091, - /* EXCEPTION_FLT_OVERFLOW */ - MD_EXCEPTION_CODE_WIN_FLOAT_STACK_CHECK = 0xc0000092, - /* EXCEPTION_FLT_STACK_CHECK */ - MD_EXCEPTION_CODE_WIN_FLOAT_UNDERFLOW = 0xc0000093, - /* EXCEPTION_FLT_UNDERFLOW */ - MD_EXCEPTION_CODE_WIN_INTEGER_DIVIDE_BY_ZERO = 0xc0000094, - /* EXCEPTION_INT_DIVIDE_BY_ZERO */ - MD_EXCEPTION_CODE_WIN_INTEGER_OVERFLOW = 0xc0000095, - /* EXCEPTION_INT_OVERFLOW */ - MD_EXCEPTION_CODE_WIN_PRIVILEGED_INSTRUCTION = 0xc0000096, - /* EXCEPTION_PRIV_INSTRUCTION */ - MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW = 0xc00000fd, - /* EXCEPTION_STACK_OVERFLOW */ - MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK = 0xc0000194, - /* EXCEPTION_POSSIBLE_DEADLOCK */ - MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN = 0xc0000409, - /* STATUS_STACK_BUFFER_OVERRUN */ - MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION = 0xc0000374, - /* STATUS_HEAP_CORRUPTION */ - MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION = 0xe06d7363 - /* Per http://support.microsoft.com/kb/185294, - generated by Visual C++ compiler */ -} MDExceptionCodeWin; - - -/* For (MDException).exception_information[2], when (MDException).exception_code - * is MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR. This describes the underlying reason - * for the error. These values come from ntstatus.h. - * - * The content of this enum was created from ntstatus.h in the 8.1 SDK with - * - * egrep '#define [A-Z_0-9]+\s+\(\(NTSTATUS\)0xC[0-9A-F]+L\)' ntstatus.h - * | tr -d '\r' - * | sed -r 's@#define ([A-Z_0-9]+)\s+\(\(NTSTATUS\)(0xC[0-9A-F]+)L\).*@\2 \1@' - * | sort - * | sed -r 's@(0xC[0-9A-F]+) ([A-Z_0-9]+)@ MD_NTSTATUS_WIN_\2 = \1,@' - * - * With easy copy to clipboard with - * | xclip -selection c # on linux - * | clip # on windows - * | pbcopy # on mac - * - * and then the last comma manually removed. */ -typedef enum { - MD_NTSTATUS_WIN_STATUS_UNSUCCESSFUL = 0xC0000001, - MD_NTSTATUS_WIN_STATUS_NOT_IMPLEMENTED = 0xC0000002, - MD_NTSTATUS_WIN_STATUS_INVALID_INFO_CLASS = 0xC0000003, - MD_NTSTATUS_WIN_STATUS_INFO_LENGTH_MISMATCH = 0xC0000004, - MD_NTSTATUS_WIN_STATUS_ACCESS_VIOLATION = 0xC0000005, - MD_NTSTATUS_WIN_STATUS_IN_PAGE_ERROR = 0xC0000006, - MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA = 0xC0000007, - MD_NTSTATUS_WIN_STATUS_INVALID_HANDLE = 0xC0000008, - MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_STACK = 0xC0000009, - MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_PC = 0xC000000A, - MD_NTSTATUS_WIN_STATUS_INVALID_CID = 0xC000000B, - MD_NTSTATUS_WIN_STATUS_TIMER_NOT_CANCELED = 0xC000000C, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER = 0xC000000D, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_DEVICE = 0xC000000E, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_FILE = 0xC000000F, - MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_REQUEST = 0xC0000010, - MD_NTSTATUS_WIN_STATUS_END_OF_FILE = 0xC0000011, - MD_NTSTATUS_WIN_STATUS_WRONG_VOLUME = 0xC0000012, - MD_NTSTATUS_WIN_STATUS_NO_MEDIA_IN_DEVICE = 0xC0000013, - MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_MEDIA = 0xC0000014, - MD_NTSTATUS_WIN_STATUS_NONEXISTENT_SECTOR = 0xC0000015, - MD_NTSTATUS_WIN_STATUS_MORE_PROCESSING_REQUIRED = 0xC0000016, - MD_NTSTATUS_WIN_STATUS_NO_MEMORY = 0xC0000017, - MD_NTSTATUS_WIN_STATUS_CONFLICTING_ADDRESSES = 0xC0000018, - MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_VIEW = 0xC0000019, - MD_NTSTATUS_WIN_STATUS_UNABLE_TO_FREE_VM = 0xC000001A, - MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DELETE_SECTION = 0xC000001B, - MD_NTSTATUS_WIN_STATUS_INVALID_SYSTEM_SERVICE = 0xC000001C, - MD_NTSTATUS_WIN_STATUS_ILLEGAL_INSTRUCTION = 0xC000001D, - MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_SEQUENCE = 0xC000001E, - MD_NTSTATUS_WIN_STATUS_INVALID_VIEW_SIZE = 0xC000001F, - MD_NTSTATUS_WIN_STATUS_INVALID_FILE_FOR_SECTION = 0xC0000020, - MD_NTSTATUS_WIN_STATUS_ALREADY_COMMITTED = 0xC0000021, - MD_NTSTATUS_WIN_STATUS_ACCESS_DENIED = 0xC0000022, - MD_NTSTATUS_WIN_STATUS_BUFFER_TOO_SMALL = 0xC0000023, - MD_NTSTATUS_WIN_STATUS_OBJECT_TYPE_MISMATCH = 0xC0000024, - MD_NTSTATUS_WIN_STATUS_NONCONTINUABLE_EXCEPTION = 0xC0000025, - MD_NTSTATUS_WIN_STATUS_INVALID_DISPOSITION = 0xC0000026, - MD_NTSTATUS_WIN_STATUS_UNWIND = 0xC0000027, - MD_NTSTATUS_WIN_STATUS_BAD_STACK = 0xC0000028, - MD_NTSTATUS_WIN_STATUS_INVALID_UNWIND_TARGET = 0xC0000029, - MD_NTSTATUS_WIN_STATUS_NOT_LOCKED = 0xC000002A, - MD_NTSTATUS_WIN_STATUS_PARITY_ERROR = 0xC000002B, - MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DECOMMIT_VM = 0xC000002C, - MD_NTSTATUS_WIN_STATUS_NOT_COMMITTED = 0xC000002D, - MD_NTSTATUS_WIN_STATUS_INVALID_PORT_ATTRIBUTES = 0xC000002E, - MD_NTSTATUS_WIN_STATUS_PORT_MESSAGE_TOO_LONG = 0xC000002F, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_MIX = 0xC0000030, - MD_NTSTATUS_WIN_STATUS_INVALID_QUOTA_LOWER = 0xC0000031, - MD_NTSTATUS_WIN_STATUS_DISK_CORRUPT_ERROR = 0xC0000032, - MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_INVALID = 0xC0000033, - MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_NOT_FOUND = 0xC0000034, - MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_COLLISION = 0xC0000035, - MD_NTSTATUS_WIN_STATUS_PORT_DISCONNECTED = 0xC0000037, - MD_NTSTATUS_WIN_STATUS_DEVICE_ALREADY_ATTACHED = 0xC0000038, - MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_INVALID = 0xC0000039, - MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_NOT_FOUND = 0xC000003A, - MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_SYNTAX_BAD = 0xC000003B, - MD_NTSTATUS_WIN_STATUS_DATA_OVERRUN = 0xC000003C, - MD_NTSTATUS_WIN_STATUS_DATA_LATE_ERROR = 0xC000003D, - MD_NTSTATUS_WIN_STATUS_DATA_ERROR = 0xC000003E, - MD_NTSTATUS_WIN_STATUS_CRC_ERROR = 0xC000003F, - MD_NTSTATUS_WIN_STATUS_SECTION_TOO_BIG = 0xC0000040, - MD_NTSTATUS_WIN_STATUS_PORT_CONNECTION_REFUSED = 0xC0000041, - MD_NTSTATUS_WIN_STATUS_INVALID_PORT_HANDLE = 0xC0000042, - MD_NTSTATUS_WIN_STATUS_SHARING_VIOLATION = 0xC0000043, - MD_NTSTATUS_WIN_STATUS_QUOTA_EXCEEDED = 0xC0000044, - MD_NTSTATUS_WIN_STATUS_INVALID_PAGE_PROTECTION = 0xC0000045, - MD_NTSTATUS_WIN_STATUS_MUTANT_NOT_OWNED = 0xC0000046, - MD_NTSTATUS_WIN_STATUS_SEMAPHORE_LIMIT_EXCEEDED = 0xC0000047, - MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_SET = 0xC0000048, - MD_NTSTATUS_WIN_STATUS_SECTION_NOT_IMAGE = 0xC0000049, - MD_NTSTATUS_WIN_STATUS_SUSPEND_COUNT_EXCEEDED = 0xC000004A, - MD_NTSTATUS_WIN_STATUS_THREAD_IS_TERMINATING = 0xC000004B, - MD_NTSTATUS_WIN_STATUS_BAD_WORKING_SET_LIMIT = 0xC000004C, - MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_FILE_MAP = 0xC000004D, - MD_NTSTATUS_WIN_STATUS_SECTION_PROTECTION = 0xC000004E, - MD_NTSTATUS_WIN_STATUS_EAS_NOT_SUPPORTED = 0xC000004F, - MD_NTSTATUS_WIN_STATUS_EA_TOO_LARGE = 0xC0000050, - MD_NTSTATUS_WIN_STATUS_NONEXISTENT_EA_ENTRY = 0xC0000051, - MD_NTSTATUS_WIN_STATUS_NO_EAS_ON_FILE = 0xC0000052, - MD_NTSTATUS_WIN_STATUS_EA_CORRUPT_ERROR = 0xC0000053, - MD_NTSTATUS_WIN_STATUS_FILE_LOCK_CONFLICT = 0xC0000054, - MD_NTSTATUS_WIN_STATUS_LOCK_NOT_GRANTED = 0xC0000055, - MD_NTSTATUS_WIN_STATUS_DELETE_PENDING = 0xC0000056, - MD_NTSTATUS_WIN_STATUS_CTL_FILE_NOT_SUPPORTED = 0xC0000057, - MD_NTSTATUS_WIN_STATUS_UNKNOWN_REVISION = 0xC0000058, - MD_NTSTATUS_WIN_STATUS_REVISION_MISMATCH = 0xC0000059, - MD_NTSTATUS_WIN_STATUS_INVALID_OWNER = 0xC000005A, - MD_NTSTATUS_WIN_STATUS_INVALID_PRIMARY_GROUP = 0xC000005B, - MD_NTSTATUS_WIN_STATUS_NO_IMPERSONATION_TOKEN = 0xC000005C, - MD_NTSTATUS_WIN_STATUS_CANT_DISABLE_MANDATORY = 0xC000005D, - MD_NTSTATUS_WIN_STATUS_NO_LOGON_SERVERS = 0xC000005E, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_LOGON_SESSION = 0xC000005F, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_PRIVILEGE = 0xC0000060, - MD_NTSTATUS_WIN_STATUS_PRIVILEGE_NOT_HELD = 0xC0000061, - MD_NTSTATUS_WIN_STATUS_INVALID_ACCOUNT_NAME = 0xC0000062, - MD_NTSTATUS_WIN_STATUS_USER_EXISTS = 0xC0000063, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_USER = 0xC0000064, - MD_NTSTATUS_WIN_STATUS_GROUP_EXISTS = 0xC0000065, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_GROUP = 0xC0000066, - MD_NTSTATUS_WIN_STATUS_MEMBER_IN_GROUP = 0xC0000067, - MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_GROUP = 0xC0000068, - MD_NTSTATUS_WIN_STATUS_LAST_ADMIN = 0xC0000069, - MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD = 0xC000006A, - MD_NTSTATUS_WIN_STATUS_ILL_FORMED_PASSWORD = 0xC000006B, - MD_NTSTATUS_WIN_STATUS_PASSWORD_RESTRICTION = 0xC000006C, - MD_NTSTATUS_WIN_STATUS_LOGON_FAILURE = 0xC000006D, - MD_NTSTATUS_WIN_STATUS_ACCOUNT_RESTRICTION = 0xC000006E, - MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_HOURS = 0xC000006F, - MD_NTSTATUS_WIN_STATUS_INVALID_WORKSTATION = 0xC0000070, - MD_NTSTATUS_WIN_STATUS_PASSWORD_EXPIRED = 0xC0000071, - MD_NTSTATUS_WIN_STATUS_ACCOUNT_DISABLED = 0xC0000072, - MD_NTSTATUS_WIN_STATUS_NONE_MAPPED = 0xC0000073, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_LUIDS_REQUESTED = 0xC0000074, - MD_NTSTATUS_WIN_STATUS_LUIDS_EXHAUSTED = 0xC0000075, - MD_NTSTATUS_WIN_STATUS_INVALID_SUB_AUTHORITY = 0xC0000076, - MD_NTSTATUS_WIN_STATUS_INVALID_ACL = 0xC0000077, - MD_NTSTATUS_WIN_STATUS_INVALID_SID = 0xC0000078, - MD_NTSTATUS_WIN_STATUS_INVALID_SECURITY_DESCR = 0xC0000079, - MD_NTSTATUS_WIN_STATUS_PROCEDURE_NOT_FOUND = 0xC000007A, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_FORMAT = 0xC000007B, - MD_NTSTATUS_WIN_STATUS_NO_TOKEN = 0xC000007C, - MD_NTSTATUS_WIN_STATUS_BAD_INHERITANCE_ACL = 0xC000007D, - MD_NTSTATUS_WIN_STATUS_RANGE_NOT_LOCKED = 0xC000007E, - MD_NTSTATUS_WIN_STATUS_DISK_FULL = 0xC000007F, - MD_NTSTATUS_WIN_STATUS_SERVER_DISABLED = 0xC0000080, - MD_NTSTATUS_WIN_STATUS_SERVER_NOT_DISABLED = 0xC0000081, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_GUIDS_REQUESTED = 0xC0000082, - MD_NTSTATUS_WIN_STATUS_GUIDS_EXHAUSTED = 0xC0000083, - MD_NTSTATUS_WIN_STATUS_INVALID_ID_AUTHORITY = 0xC0000084, - MD_NTSTATUS_WIN_STATUS_AGENTS_EXHAUSTED = 0xC0000085, - MD_NTSTATUS_WIN_STATUS_INVALID_VOLUME_LABEL = 0xC0000086, - MD_NTSTATUS_WIN_STATUS_SECTION_NOT_EXTENDED = 0xC0000087, - MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_DATA = 0xC0000088, - MD_NTSTATUS_WIN_STATUS_RESOURCE_DATA_NOT_FOUND = 0xC0000089, - MD_NTSTATUS_WIN_STATUS_RESOURCE_TYPE_NOT_FOUND = 0xC000008A, - MD_NTSTATUS_WIN_STATUS_RESOURCE_NAME_NOT_FOUND = 0xC000008B, - MD_NTSTATUS_WIN_STATUS_ARRAY_BOUNDS_EXCEEDED = 0xC000008C, - MD_NTSTATUS_WIN_STATUS_FLOAT_DENORMAL_OPERAND = 0xC000008D, - MD_NTSTATUS_WIN_STATUS_FLOAT_DIVIDE_BY_ZERO = 0xC000008E, - MD_NTSTATUS_WIN_STATUS_FLOAT_INEXACT_RESULT = 0xC000008F, - MD_NTSTATUS_WIN_STATUS_FLOAT_INVALID_OPERATION = 0xC0000090, - MD_NTSTATUS_WIN_STATUS_FLOAT_OVERFLOW = 0xC0000091, - MD_NTSTATUS_WIN_STATUS_FLOAT_STACK_CHECK = 0xC0000092, - MD_NTSTATUS_WIN_STATUS_FLOAT_UNDERFLOW = 0xC0000093, - MD_NTSTATUS_WIN_STATUS_INTEGER_DIVIDE_BY_ZERO = 0xC0000094, - MD_NTSTATUS_WIN_STATUS_INTEGER_OVERFLOW = 0xC0000095, - MD_NTSTATUS_WIN_STATUS_PRIVILEGED_INSTRUCTION = 0xC0000096, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_PAGING_FILES = 0xC0000097, - MD_NTSTATUS_WIN_STATUS_FILE_INVALID = 0xC0000098, - MD_NTSTATUS_WIN_STATUS_ALLOTTED_SPACE_EXCEEDED = 0xC0000099, - MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCES = 0xC000009A, - MD_NTSTATUS_WIN_STATUS_DFS_EXIT_PATH_FOUND = 0xC000009B, - MD_NTSTATUS_WIN_STATUS_DEVICE_DATA_ERROR = 0xC000009C, - MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_CONNECTED = 0xC000009D, - MD_NTSTATUS_WIN_STATUS_DEVICE_POWER_FAILURE = 0xC000009E, - MD_NTSTATUS_WIN_STATUS_FREE_VM_NOT_AT_BASE = 0xC000009F, - MD_NTSTATUS_WIN_STATUS_MEMORY_NOT_ALLOCATED = 0xC00000A0, - MD_NTSTATUS_WIN_STATUS_WORKING_SET_QUOTA = 0xC00000A1, - MD_NTSTATUS_WIN_STATUS_MEDIA_WRITE_PROTECTED = 0xC00000A2, - MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_READY = 0xC00000A3, - MD_NTSTATUS_WIN_STATUS_INVALID_GROUP_ATTRIBUTES = 0xC00000A4, - MD_NTSTATUS_WIN_STATUS_BAD_IMPERSONATION_LEVEL = 0xC00000A5, - MD_NTSTATUS_WIN_STATUS_CANT_OPEN_ANONYMOUS = 0xC00000A6, - MD_NTSTATUS_WIN_STATUS_BAD_VALIDATION_CLASS = 0xC00000A7, - MD_NTSTATUS_WIN_STATUS_BAD_TOKEN_TYPE = 0xC00000A8, - MD_NTSTATUS_WIN_STATUS_BAD_MASTER_BOOT_RECORD = 0xC00000A9, - MD_NTSTATUS_WIN_STATUS_INSTRUCTION_MISALIGNMENT = 0xC00000AA, - MD_NTSTATUS_WIN_STATUS_INSTANCE_NOT_AVAILABLE = 0xC00000AB, - MD_NTSTATUS_WIN_STATUS_PIPE_NOT_AVAILABLE = 0xC00000AC, - MD_NTSTATUS_WIN_STATUS_INVALID_PIPE_STATE = 0xC00000AD, - MD_NTSTATUS_WIN_STATUS_PIPE_BUSY = 0xC00000AE, - MD_NTSTATUS_WIN_STATUS_ILLEGAL_FUNCTION = 0xC00000AF, - MD_NTSTATUS_WIN_STATUS_PIPE_DISCONNECTED = 0xC00000B0, - MD_NTSTATUS_WIN_STATUS_PIPE_CLOSING = 0xC00000B1, - MD_NTSTATUS_WIN_STATUS_PIPE_CONNECTED = 0xC00000B2, - MD_NTSTATUS_WIN_STATUS_PIPE_LISTENING = 0xC00000B3, - MD_NTSTATUS_WIN_STATUS_INVALID_READ_MODE = 0xC00000B4, - MD_NTSTATUS_WIN_STATUS_IO_TIMEOUT = 0xC00000B5, - MD_NTSTATUS_WIN_STATUS_FILE_FORCED_CLOSED = 0xC00000B6, - MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STARTED = 0xC00000B7, - MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STOPPED = 0xC00000B8, - MD_NTSTATUS_WIN_STATUS_COULD_NOT_INTERPRET = 0xC00000B9, - MD_NTSTATUS_WIN_STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA, - MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED = 0xC00000BB, - MD_NTSTATUS_WIN_STATUS_REMOTE_NOT_LISTENING = 0xC00000BC, - MD_NTSTATUS_WIN_STATUS_DUPLICATE_NAME = 0xC00000BD, - MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_PATH = 0xC00000BE, - MD_NTSTATUS_WIN_STATUS_NETWORK_BUSY = 0xC00000BF, - MD_NTSTATUS_WIN_STATUS_DEVICE_DOES_NOT_EXIST = 0xC00000C0, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_COMMANDS = 0xC00000C1, - MD_NTSTATUS_WIN_STATUS_ADAPTER_HARDWARE_ERROR = 0xC00000C2, - MD_NTSTATUS_WIN_STATUS_INVALID_NETWORK_RESPONSE = 0xC00000C3, - MD_NTSTATUS_WIN_STATUS_UNEXPECTED_NETWORK_ERROR = 0xC00000C4, - MD_NTSTATUS_WIN_STATUS_BAD_REMOTE_ADAPTER = 0xC00000C5, - MD_NTSTATUS_WIN_STATUS_PRINT_QUEUE_FULL = 0xC00000C6, - MD_NTSTATUS_WIN_STATUS_NO_SPOOL_SPACE = 0xC00000C7, - MD_NTSTATUS_WIN_STATUS_PRINT_CANCELLED = 0xC00000C8, - MD_NTSTATUS_WIN_STATUS_NETWORK_NAME_DELETED = 0xC00000C9, - MD_NTSTATUS_WIN_STATUS_NETWORK_ACCESS_DENIED = 0xC00000CA, - MD_NTSTATUS_WIN_STATUS_BAD_DEVICE_TYPE = 0xC00000CB, - MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_NAME = 0xC00000CC, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_NAMES = 0xC00000CD, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_SESSIONS = 0xC00000CE, - MD_NTSTATUS_WIN_STATUS_SHARING_PAUSED = 0xC00000CF, - MD_NTSTATUS_WIN_STATUS_REQUEST_NOT_ACCEPTED = 0xC00000D0, - MD_NTSTATUS_WIN_STATUS_REDIRECTOR_PAUSED = 0xC00000D1, - MD_NTSTATUS_WIN_STATUS_NET_WRITE_FAULT = 0xC00000D2, - MD_NTSTATUS_WIN_STATUS_PROFILING_AT_LIMIT = 0xC00000D3, - MD_NTSTATUS_WIN_STATUS_NOT_SAME_DEVICE = 0xC00000D4, - MD_NTSTATUS_WIN_STATUS_FILE_RENAMED = 0xC00000D5, - MD_NTSTATUS_WIN_STATUS_VIRTUAL_CIRCUIT_CLOSED = 0xC00000D6, - MD_NTSTATUS_WIN_STATUS_NO_SECURITY_ON_OBJECT = 0xC00000D7, - MD_NTSTATUS_WIN_STATUS_CANT_WAIT = 0xC00000D8, - MD_NTSTATUS_WIN_STATUS_PIPE_EMPTY = 0xC00000D9, - MD_NTSTATUS_WIN_STATUS_CANT_ACCESS_DOMAIN_INFO = 0xC00000DA, - MD_NTSTATUS_WIN_STATUS_CANT_TERMINATE_SELF = 0xC00000DB, - MD_NTSTATUS_WIN_STATUS_INVALID_SERVER_STATE = 0xC00000DC, - MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_STATE = 0xC00000DD, - MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_ROLE = 0xC00000DE, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_DOMAIN = 0xC00000DF, - MD_NTSTATUS_WIN_STATUS_DOMAIN_EXISTS = 0xC00000E0, - MD_NTSTATUS_WIN_STATUS_DOMAIN_LIMIT_EXCEEDED = 0xC00000E1, - MD_NTSTATUS_WIN_STATUS_OPLOCK_NOT_GRANTED = 0xC00000E2, - MD_NTSTATUS_WIN_STATUS_INVALID_OPLOCK_PROTOCOL = 0xC00000E3, - MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_CORRUPTION = 0xC00000E4, - MD_NTSTATUS_WIN_STATUS_INTERNAL_ERROR = 0xC00000E5, - MD_NTSTATUS_WIN_STATUS_GENERIC_NOT_MAPPED = 0xC00000E6, - MD_NTSTATUS_WIN_STATUS_BAD_DESCRIPTOR_FORMAT = 0xC00000E7, - MD_NTSTATUS_WIN_STATUS_INVALID_USER_BUFFER = 0xC00000E8, - MD_NTSTATUS_WIN_STATUS_UNEXPECTED_IO_ERROR = 0xC00000E9, - MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_CREATE_ERR = 0xC00000EA, - MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_MAP_ERROR = 0xC00000EB, - MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_EXTEND_ERR = 0xC00000EC, - MD_NTSTATUS_WIN_STATUS_NOT_LOGON_PROCESS = 0xC00000ED, - MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_EXISTS = 0xC00000EE, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_1 = 0xC00000EF, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_2 = 0xC00000F0, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_3 = 0xC00000F1, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_4 = 0xC00000F2, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_5 = 0xC00000F3, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_6 = 0xC00000F4, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_7 = 0xC00000F5, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_8 = 0xC00000F6, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_9 = 0xC00000F7, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_10 = 0xC00000F8, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_11 = 0xC00000F9, - MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_12 = 0xC00000FA, - MD_NTSTATUS_WIN_STATUS_REDIRECTOR_NOT_STARTED = 0xC00000FB, - MD_NTSTATUS_WIN_STATUS_REDIRECTOR_STARTED = 0xC00000FC, - MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW = 0xC00000FD, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_PACKAGE = 0xC00000FE, - MD_NTSTATUS_WIN_STATUS_BAD_FUNCTION_TABLE = 0xC00000FF, - MD_NTSTATUS_WIN_STATUS_VARIABLE_NOT_FOUND = 0xC0000100, - MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_EMPTY = 0xC0000101, - MD_NTSTATUS_WIN_STATUS_FILE_CORRUPT_ERROR = 0xC0000102, - MD_NTSTATUS_WIN_STATUS_NOT_A_DIRECTORY = 0xC0000103, - MD_NTSTATUS_WIN_STATUS_BAD_LOGON_SESSION_STATE = 0xC0000104, - MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_COLLISION = 0xC0000105, - MD_NTSTATUS_WIN_STATUS_NAME_TOO_LONG = 0xC0000106, - MD_NTSTATUS_WIN_STATUS_FILES_OPEN = 0xC0000107, - MD_NTSTATUS_WIN_STATUS_CONNECTION_IN_USE = 0xC0000108, - MD_NTSTATUS_WIN_STATUS_MESSAGE_NOT_FOUND = 0xC0000109, - MD_NTSTATUS_WIN_STATUS_PROCESS_IS_TERMINATING = 0xC000010A, - MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_TYPE = 0xC000010B, - MD_NTSTATUS_WIN_STATUS_NO_GUID_TRANSLATION = 0xC000010C, - MD_NTSTATUS_WIN_STATUS_CANNOT_IMPERSONATE = 0xC000010D, - MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED = 0xC000010E, - MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_PRESENT = 0xC000010F, - MD_NTSTATUS_WIN_STATUS_ABIOS_LID_NOT_EXIST = 0xC0000110, - MD_NTSTATUS_WIN_STATUS_ABIOS_LID_ALREADY_OWNED = 0xC0000111, - MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_LID_OWNER = 0xC0000112, - MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_COMMAND = 0xC0000113, - MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_LID = 0xC0000114, - MD_NTSTATUS_WIN_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE = 0xC0000115, - MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_SELECTOR = 0xC0000116, - MD_NTSTATUS_WIN_STATUS_NO_LDT = 0xC0000117, - MD_NTSTATUS_WIN_STATUS_INVALID_LDT_SIZE = 0xC0000118, - MD_NTSTATUS_WIN_STATUS_INVALID_LDT_OFFSET = 0xC0000119, - MD_NTSTATUS_WIN_STATUS_INVALID_LDT_DESCRIPTOR = 0xC000011A, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NE_FORMAT = 0xC000011B, - MD_NTSTATUS_WIN_STATUS_RXACT_INVALID_STATE = 0xC000011C, - MD_NTSTATUS_WIN_STATUS_RXACT_COMMIT_FAILURE = 0xC000011D, - MD_NTSTATUS_WIN_STATUS_MAPPED_FILE_SIZE_ZERO = 0xC000011E, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_OPENED_FILES = 0xC000011F, - MD_NTSTATUS_WIN_STATUS_CANCELLED = 0xC0000120, - MD_NTSTATUS_WIN_STATUS_CANNOT_DELETE = 0xC0000121, - MD_NTSTATUS_WIN_STATUS_INVALID_COMPUTER_NAME = 0xC0000122, - MD_NTSTATUS_WIN_STATUS_FILE_DELETED = 0xC0000123, - MD_NTSTATUS_WIN_STATUS_SPECIAL_ACCOUNT = 0xC0000124, - MD_NTSTATUS_WIN_STATUS_SPECIAL_GROUP = 0xC0000125, - MD_NTSTATUS_WIN_STATUS_SPECIAL_USER = 0xC0000126, - MD_NTSTATUS_WIN_STATUS_MEMBERS_PRIMARY_GROUP = 0xC0000127, - MD_NTSTATUS_WIN_STATUS_FILE_CLOSED = 0xC0000128, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_THREADS = 0xC0000129, - MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_PROCESS = 0xC000012A, - MD_NTSTATUS_WIN_STATUS_TOKEN_ALREADY_IN_USE = 0xC000012B, - MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA_EXCEEDED = 0xC000012C, - MD_NTSTATUS_WIN_STATUS_COMMITMENT_LIMIT = 0xC000012D, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_LE_FORMAT = 0xC000012E, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NOT_MZ = 0xC000012F, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_PROTECT = 0xC0000130, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_16 = 0xC0000131, - MD_NTSTATUS_WIN_STATUS_LOGON_SERVER_CONFLICT = 0xC0000132, - MD_NTSTATUS_WIN_STATUS_TIME_DIFFERENCE_AT_DC = 0xC0000133, - MD_NTSTATUS_WIN_STATUS_SYNCHRONIZATION_REQUIRED = 0xC0000134, - MD_NTSTATUS_WIN_STATUS_DLL_NOT_FOUND = 0xC0000135, - MD_NTSTATUS_WIN_STATUS_OPEN_FAILED = 0xC0000136, - MD_NTSTATUS_WIN_STATUS_IO_PRIVILEGE_FAILED = 0xC0000137, - MD_NTSTATUS_WIN_STATUS_ORDINAL_NOT_FOUND = 0xC0000138, - MD_NTSTATUS_WIN_STATUS_ENTRYPOINT_NOT_FOUND = 0xC0000139, - MD_NTSTATUS_WIN_STATUS_CONTROL_C_EXIT = 0xC000013A, - MD_NTSTATUS_WIN_STATUS_LOCAL_DISCONNECT = 0xC000013B, - MD_NTSTATUS_WIN_STATUS_REMOTE_DISCONNECT = 0xC000013C, - MD_NTSTATUS_WIN_STATUS_REMOTE_RESOURCES = 0xC000013D, - MD_NTSTATUS_WIN_STATUS_LINK_FAILED = 0xC000013E, - MD_NTSTATUS_WIN_STATUS_LINK_TIMEOUT = 0xC000013F, - MD_NTSTATUS_WIN_STATUS_INVALID_CONNECTION = 0xC0000140, - MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS = 0xC0000141, - MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED = 0xC0000142, - MD_NTSTATUS_WIN_STATUS_MISSING_SYSTEMFILE = 0xC0000143, - MD_NTSTATUS_WIN_STATUS_UNHANDLED_EXCEPTION = 0xC0000144, - MD_NTSTATUS_WIN_STATUS_APP_INIT_FAILURE = 0xC0000145, - MD_NTSTATUS_WIN_STATUS_PAGEFILE_CREATE_FAILED = 0xC0000146, - MD_NTSTATUS_WIN_STATUS_NO_PAGEFILE = 0xC0000147, - MD_NTSTATUS_WIN_STATUS_INVALID_LEVEL = 0xC0000148, - MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD_CORE = 0xC0000149, - MD_NTSTATUS_WIN_STATUS_ILLEGAL_FLOAT_CONTEXT = 0xC000014A, - MD_NTSTATUS_WIN_STATUS_PIPE_BROKEN = 0xC000014B, - MD_NTSTATUS_WIN_STATUS_REGISTRY_CORRUPT = 0xC000014C, - MD_NTSTATUS_WIN_STATUS_REGISTRY_IO_FAILED = 0xC000014D, - MD_NTSTATUS_WIN_STATUS_NO_EVENT_PAIR = 0xC000014E, - MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_VOLUME = 0xC000014F, - MD_NTSTATUS_WIN_STATUS_SERIAL_NO_DEVICE_INITED = 0xC0000150, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_ALIAS = 0xC0000151, - MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_ALIAS = 0xC0000152, - MD_NTSTATUS_WIN_STATUS_MEMBER_IN_ALIAS = 0xC0000153, - MD_NTSTATUS_WIN_STATUS_ALIAS_EXISTS = 0xC0000154, - MD_NTSTATUS_WIN_STATUS_LOGON_NOT_GRANTED = 0xC0000155, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_SECRETS = 0xC0000156, - MD_NTSTATUS_WIN_STATUS_SECRET_TOO_LONG = 0xC0000157, - MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_ERROR = 0xC0000158, - MD_NTSTATUS_WIN_STATUS_FULLSCREEN_MODE = 0xC0000159, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_CONTEXT_IDS = 0xC000015A, - MD_NTSTATUS_WIN_STATUS_LOGON_TYPE_NOT_GRANTED = 0xC000015B, - MD_NTSTATUS_WIN_STATUS_NOT_REGISTRY_FILE = 0xC000015C, - MD_NTSTATUS_WIN_STATUS_NT_CROSS_ENCRYPTION_REQUIRED = 0xC000015D, - MD_NTSTATUS_WIN_STATUS_DOMAIN_CTRLR_CONFIG_ERROR = 0xC000015E, - MD_NTSTATUS_WIN_STATUS_FT_MISSING_MEMBER = 0xC000015F, - MD_NTSTATUS_WIN_STATUS_ILL_FORMED_SERVICE_ENTRY = 0xC0000160, - MD_NTSTATUS_WIN_STATUS_ILLEGAL_CHARACTER = 0xC0000161, - MD_NTSTATUS_WIN_STATUS_UNMAPPABLE_CHARACTER = 0xC0000162, - MD_NTSTATUS_WIN_STATUS_UNDEFINED_CHARACTER = 0xC0000163, - MD_NTSTATUS_WIN_STATUS_FLOPPY_VOLUME = 0xC0000164, - MD_NTSTATUS_WIN_STATUS_FLOPPY_ID_MARK_NOT_FOUND = 0xC0000165, - MD_NTSTATUS_WIN_STATUS_FLOPPY_WRONG_CYLINDER = 0xC0000166, - MD_NTSTATUS_WIN_STATUS_FLOPPY_UNKNOWN_ERROR = 0xC0000167, - MD_NTSTATUS_WIN_STATUS_FLOPPY_BAD_REGISTERS = 0xC0000168, - MD_NTSTATUS_WIN_STATUS_DISK_RECALIBRATE_FAILED = 0xC0000169, - MD_NTSTATUS_WIN_STATUS_DISK_OPERATION_FAILED = 0xC000016A, - MD_NTSTATUS_WIN_STATUS_DISK_RESET_FAILED = 0xC000016B, - MD_NTSTATUS_WIN_STATUS_SHARED_IRQ_BUSY = 0xC000016C, - MD_NTSTATUS_WIN_STATUS_FT_ORPHANING = 0xC000016D, - MD_NTSTATUS_WIN_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT = 0xC000016E, - MD_NTSTATUS_WIN_STATUS_PARTITION_FAILURE = 0xC0000172, - MD_NTSTATUS_WIN_STATUS_INVALID_BLOCK_LENGTH = 0xC0000173, - MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_PARTITIONED = 0xC0000174, - MD_NTSTATUS_WIN_STATUS_UNABLE_TO_LOCK_MEDIA = 0xC0000175, - MD_NTSTATUS_WIN_STATUS_UNABLE_TO_UNLOAD_MEDIA = 0xC0000176, - MD_NTSTATUS_WIN_STATUS_EOM_OVERFLOW = 0xC0000177, - MD_NTSTATUS_WIN_STATUS_NO_MEDIA = 0xC0000178, - MD_NTSTATUS_WIN_STATUS_NO_SUCH_MEMBER = 0xC000017A, - MD_NTSTATUS_WIN_STATUS_INVALID_MEMBER = 0xC000017B, - MD_NTSTATUS_WIN_STATUS_KEY_DELETED = 0xC000017C, - MD_NTSTATUS_WIN_STATUS_NO_LOG_SPACE = 0xC000017D, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_SIDS = 0xC000017E, - MD_NTSTATUS_WIN_STATUS_LM_CROSS_ENCRYPTION_REQUIRED = 0xC000017F, - MD_NTSTATUS_WIN_STATUS_KEY_HAS_CHILDREN = 0xC0000180, - MD_NTSTATUS_WIN_STATUS_CHILD_MUST_BE_VOLATILE = 0xC0000181, - MD_NTSTATUS_WIN_STATUS_DEVICE_CONFIGURATION_ERROR = 0xC0000182, - MD_NTSTATUS_WIN_STATUS_DRIVER_INTERNAL_ERROR = 0xC0000183, - MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_STATE = 0xC0000184, - MD_NTSTATUS_WIN_STATUS_IO_DEVICE_ERROR = 0xC0000185, - MD_NTSTATUS_WIN_STATUS_DEVICE_PROTOCOL_ERROR = 0xC0000186, - MD_NTSTATUS_WIN_STATUS_BACKUP_CONTROLLER = 0xC0000187, - MD_NTSTATUS_WIN_STATUS_LOG_FILE_FULL = 0xC0000188, - MD_NTSTATUS_WIN_STATUS_TOO_LATE = 0xC0000189, - MD_NTSTATUS_WIN_STATUS_NO_TRUST_LSA_SECRET = 0xC000018A, - MD_NTSTATUS_WIN_STATUS_NO_TRUST_SAM_ACCOUNT = 0xC000018B, - MD_NTSTATUS_WIN_STATUS_TRUSTED_DOMAIN_FAILURE = 0xC000018C, - MD_NTSTATUS_WIN_STATUS_TRUSTED_RELATIONSHIP_FAILURE = 0xC000018D, - MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CORRUPT = 0xC000018E, - MD_NTSTATUS_WIN_STATUS_EVENTLOG_CANT_START = 0xC000018F, - MD_NTSTATUS_WIN_STATUS_TRUST_FAILURE = 0xC0000190, - MD_NTSTATUS_WIN_STATUS_MUTANT_LIMIT_EXCEEDED = 0xC0000191, - MD_NTSTATUS_WIN_STATUS_NETLOGON_NOT_STARTED = 0xC0000192, - MD_NTSTATUS_WIN_STATUS_ACCOUNT_EXPIRED = 0xC0000193, - MD_NTSTATUS_WIN_STATUS_POSSIBLE_DEADLOCK = 0xC0000194, - MD_NTSTATUS_WIN_STATUS_NETWORK_CREDENTIAL_CONFLICT = 0xC0000195, - MD_NTSTATUS_WIN_STATUS_REMOTE_SESSION_LIMIT = 0xC0000196, - MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CHANGED = 0xC0000197, - MD_NTSTATUS_WIN_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 0xC0000198, - MD_NTSTATUS_WIN_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 0xC0000199, - MD_NTSTATUS_WIN_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT = 0xC000019A, - MD_NTSTATUS_WIN_STATUS_DOMAIN_TRUST_INCONSISTENT = 0xC000019B, - MD_NTSTATUS_WIN_STATUS_FS_DRIVER_REQUIRED = 0xC000019C, - MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED_AS_DLL = 0xC000019D, - MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 0xC000019E, - MD_NTSTATUS_WIN_STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 0xC000019F, - MD_NTSTATUS_WIN_STATUS_SECURITY_STREAM_IS_INCONSISTENT = 0xC00001A0, - MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_RANGE = 0xC00001A1, - MD_NTSTATUS_WIN_STATUS_INVALID_ACE_CONDITION = 0xC00001A2, - MD_NTSTATUS_WIN_STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT = 0xC00001A3, - MD_NTSTATUS_WIN_STATUS_NOTIFICATION_GUID_ALREADY_DEFINED = 0xC00001A4, - MD_NTSTATUS_WIN_STATUS_INVALID_EXCEPTION_HANDLER = 0xC00001A5, - MD_NTSTATUS_WIN_STATUS_DUPLICATE_PRIVILEGES = 0xC00001A6, - MD_NTSTATUS_WIN_STATUS_NOT_ALLOWED_ON_SYSTEM_FILE = 0xC00001A7, - MD_NTSTATUS_WIN_STATUS_REPAIR_NEEDED = 0xC00001A8, - MD_NTSTATUS_WIN_STATUS_QUOTA_NOT_ENABLED = 0xC00001A9, - MD_NTSTATUS_WIN_STATUS_NO_APPLICATION_PACKAGE = 0xC00001AA, - MD_NTSTATUS_WIN_STATUS_NETWORK_OPEN_RESTRICTION = 0xC0000201, - MD_NTSTATUS_WIN_STATUS_NO_USER_SESSION_KEY = 0xC0000202, - MD_NTSTATUS_WIN_STATUS_USER_SESSION_DELETED = 0xC0000203, - MD_NTSTATUS_WIN_STATUS_RESOURCE_LANG_NOT_FOUND = 0xC0000204, - MD_NTSTATUS_WIN_STATUS_INSUFF_SERVER_RESOURCES = 0xC0000205, - MD_NTSTATUS_WIN_STATUS_INVALID_BUFFER_SIZE = 0xC0000206, - MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_COMPONENT = 0xC0000207, - MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_WILDCARD = 0xC0000208, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_ADDRESSES = 0xC0000209, - MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_EXISTS = 0xC000020A, - MD_NTSTATUS_WIN_STATUS_ADDRESS_CLOSED = 0xC000020B, - MD_NTSTATUS_WIN_STATUS_CONNECTION_DISCONNECTED = 0xC000020C, - MD_NTSTATUS_WIN_STATUS_CONNECTION_RESET = 0xC000020D, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_NODES = 0xC000020E, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_ABORTED = 0xC000020F, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_TIMED_OUT = 0xC0000210, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_RELEASE = 0xC0000211, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_MATCH = 0xC0000212, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONDED = 0xC0000213, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_ID = 0xC0000214, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_TYPE = 0xC0000215, - MD_NTSTATUS_WIN_STATUS_NOT_SERVER_SESSION = 0xC0000216, - MD_NTSTATUS_WIN_STATUS_NOT_CLIENT_SESSION = 0xC0000217, - MD_NTSTATUS_WIN_STATUS_CANNOT_LOAD_REGISTRY_FILE = 0xC0000218, - MD_NTSTATUS_WIN_STATUS_DEBUG_ATTACH_FAILED = 0xC0000219, - MD_NTSTATUS_WIN_STATUS_SYSTEM_PROCESS_TERMINATED = 0xC000021A, - MD_NTSTATUS_WIN_STATUS_DATA_NOT_ACCEPTED = 0xC000021B, - MD_NTSTATUS_WIN_STATUS_NO_BROWSER_SERVERS_FOUND = 0xC000021C, - MD_NTSTATUS_WIN_STATUS_VDM_HARD_ERROR = 0xC000021D, - MD_NTSTATUS_WIN_STATUS_DRIVER_CANCEL_TIMEOUT = 0xC000021E, - MD_NTSTATUS_WIN_STATUS_REPLY_MESSAGE_MISMATCH = 0xC000021F, - MD_NTSTATUS_WIN_STATUS_MAPPED_ALIGNMENT = 0xC0000220, - MD_NTSTATUS_WIN_STATUS_IMAGE_CHECKSUM_MISMATCH = 0xC0000221, - MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA = 0xC0000222, - MD_NTSTATUS_WIN_STATUS_CLIENT_SERVER_PARAMETERS_INVALID = 0xC0000223, - MD_NTSTATUS_WIN_STATUS_PASSWORD_MUST_CHANGE = 0xC0000224, - MD_NTSTATUS_WIN_STATUS_NOT_FOUND = 0xC0000225, - MD_NTSTATUS_WIN_STATUS_NOT_TINY_STREAM = 0xC0000226, - MD_NTSTATUS_WIN_STATUS_RECOVERY_FAILURE = 0xC0000227, - MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW_READ = 0xC0000228, - MD_NTSTATUS_WIN_STATUS_FAIL_CHECK = 0xC0000229, - MD_NTSTATUS_WIN_STATUS_DUPLICATE_OBJECTID = 0xC000022A, - MD_NTSTATUS_WIN_STATUS_OBJECTID_EXISTS = 0xC000022B, - MD_NTSTATUS_WIN_STATUS_CONVERT_TO_LARGE = 0xC000022C, - MD_NTSTATUS_WIN_STATUS_RETRY = 0xC000022D, - MD_NTSTATUS_WIN_STATUS_FOUND_OUT_OF_SCOPE = 0xC000022E, - MD_NTSTATUS_WIN_STATUS_ALLOCATE_BUCKET = 0xC000022F, - MD_NTSTATUS_WIN_STATUS_PROPSET_NOT_FOUND = 0xC0000230, - MD_NTSTATUS_WIN_STATUS_MARSHALL_OVERFLOW = 0xC0000231, - MD_NTSTATUS_WIN_STATUS_INVALID_VARIANT = 0xC0000232, - MD_NTSTATUS_WIN_STATUS_DOMAIN_CONTROLLER_NOT_FOUND = 0xC0000233, - MD_NTSTATUS_WIN_STATUS_ACCOUNT_LOCKED_OUT = 0xC0000234, - MD_NTSTATUS_WIN_STATUS_HANDLE_NOT_CLOSABLE = 0xC0000235, - MD_NTSTATUS_WIN_STATUS_CONNECTION_REFUSED = 0xC0000236, - MD_NTSTATUS_WIN_STATUS_GRACEFUL_DISCONNECT = 0xC0000237, - MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_ASSOCIATED = 0xC0000238, - MD_NTSTATUS_WIN_STATUS_ADDRESS_NOT_ASSOCIATED = 0xC0000239, - MD_NTSTATUS_WIN_STATUS_CONNECTION_INVALID = 0xC000023A, - MD_NTSTATUS_WIN_STATUS_CONNECTION_ACTIVE = 0xC000023B, - MD_NTSTATUS_WIN_STATUS_NETWORK_UNREACHABLE = 0xC000023C, - MD_NTSTATUS_WIN_STATUS_HOST_UNREACHABLE = 0xC000023D, - MD_NTSTATUS_WIN_STATUS_PROTOCOL_UNREACHABLE = 0xC000023E, - MD_NTSTATUS_WIN_STATUS_PORT_UNREACHABLE = 0xC000023F, - MD_NTSTATUS_WIN_STATUS_REQUEST_ABORTED = 0xC0000240, - MD_NTSTATUS_WIN_STATUS_CONNECTION_ABORTED = 0xC0000241, - MD_NTSTATUS_WIN_STATUS_BAD_COMPRESSION_BUFFER = 0xC0000242, - MD_NTSTATUS_WIN_STATUS_USER_MAPPED_FILE = 0xC0000243, - MD_NTSTATUS_WIN_STATUS_AUDIT_FAILED = 0xC0000244, - MD_NTSTATUS_WIN_STATUS_TIMER_RESOLUTION_NOT_SET = 0xC0000245, - MD_NTSTATUS_WIN_STATUS_CONNECTION_COUNT_LIMIT = 0xC0000246, - MD_NTSTATUS_WIN_STATUS_LOGIN_TIME_RESTRICTION = 0xC0000247, - MD_NTSTATUS_WIN_STATUS_LOGIN_WKSTA_RESTRICTION = 0xC0000248, - MD_NTSTATUS_WIN_STATUS_IMAGE_MP_UP_MISMATCH = 0xC0000249, - MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_LOGON_INFO = 0xC0000250, - MD_NTSTATUS_WIN_STATUS_BAD_DLL_ENTRYPOINT = 0xC0000251, - MD_NTSTATUS_WIN_STATUS_BAD_SERVICE_ENTRYPOINT = 0xC0000252, - MD_NTSTATUS_WIN_STATUS_LPC_REPLY_LOST = 0xC0000253, - MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT1 = 0xC0000254, - MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT2 = 0xC0000255, - MD_NTSTATUS_WIN_STATUS_REGISTRY_QUOTA_LIMIT = 0xC0000256, - MD_NTSTATUS_WIN_STATUS_PATH_NOT_COVERED = 0xC0000257, - MD_NTSTATUS_WIN_STATUS_NO_CALLBACK_ACTIVE = 0xC0000258, - MD_NTSTATUS_WIN_STATUS_LICENSE_QUOTA_EXCEEDED = 0xC0000259, - MD_NTSTATUS_WIN_STATUS_PWD_TOO_SHORT = 0xC000025A, - MD_NTSTATUS_WIN_STATUS_PWD_TOO_RECENT = 0xC000025B, - MD_NTSTATUS_WIN_STATUS_PWD_HISTORY_CONFLICT = 0xC000025C, - MD_NTSTATUS_WIN_STATUS_PLUGPLAY_NO_DEVICE = 0xC000025E, - MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_COMPRESSION = 0xC000025F, - MD_NTSTATUS_WIN_STATUS_INVALID_HW_PROFILE = 0xC0000260, - MD_NTSTATUS_WIN_STATUS_INVALID_PLUGPLAY_DEVICE_PATH = 0xC0000261, - MD_NTSTATUS_WIN_STATUS_DRIVER_ORDINAL_NOT_FOUND = 0xC0000262, - MD_NTSTATUS_WIN_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND = 0xC0000263, - MD_NTSTATUS_WIN_STATUS_RESOURCE_NOT_OWNED = 0xC0000264, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_LINKS = 0xC0000265, - MD_NTSTATUS_WIN_STATUS_QUOTA_LIST_INCONSISTENT = 0xC0000266, - MD_NTSTATUS_WIN_STATUS_FILE_IS_OFFLINE = 0xC0000267, - MD_NTSTATUS_WIN_STATUS_EVALUATION_EXPIRATION = 0xC0000268, - MD_NTSTATUS_WIN_STATUS_ILLEGAL_DLL_RELOCATION = 0xC0000269, - MD_NTSTATUS_WIN_STATUS_LICENSE_VIOLATION = 0xC000026A, - MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED_LOGOFF = 0xC000026B, - MD_NTSTATUS_WIN_STATUS_DRIVER_UNABLE_TO_LOAD = 0xC000026C, - MD_NTSTATUS_WIN_STATUS_DFS_UNAVAILABLE = 0xC000026D, - MD_NTSTATUS_WIN_STATUS_VOLUME_DISMOUNTED = 0xC000026E, - MD_NTSTATUS_WIN_STATUS_WX86_INTERNAL_ERROR = 0xC000026F, - MD_NTSTATUS_WIN_STATUS_WX86_FLOAT_STACK_CHECK = 0xC0000270, - MD_NTSTATUS_WIN_STATUS_VALIDATE_CONTINUE = 0xC0000271, - MD_NTSTATUS_WIN_STATUS_NO_MATCH = 0xC0000272, - MD_NTSTATUS_WIN_STATUS_NO_MORE_MATCHES = 0xC0000273, - MD_NTSTATUS_WIN_STATUS_NOT_A_REPARSE_POINT = 0xC0000275, - MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_INVALID = 0xC0000276, - MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_MISMATCH = 0xC0000277, - MD_NTSTATUS_WIN_STATUS_IO_REPARSE_DATA_INVALID = 0xC0000278, - MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_NOT_HANDLED = 0xC0000279, - MD_NTSTATUS_WIN_STATUS_PWD_TOO_LONG = 0xC000027A, - MD_NTSTATUS_WIN_STATUS_STOWED_EXCEPTION = 0xC000027B, - MD_NTSTATUS_WIN_STATUS_REPARSE_POINT_NOT_RESOLVED = 0xC0000280, - MD_NTSTATUS_WIN_STATUS_DIRECTORY_IS_A_REPARSE_POINT = 0xC0000281, - MD_NTSTATUS_WIN_STATUS_RANGE_LIST_CONFLICT = 0xC0000282, - MD_NTSTATUS_WIN_STATUS_SOURCE_ELEMENT_EMPTY = 0xC0000283, - MD_NTSTATUS_WIN_STATUS_DESTINATION_ELEMENT_FULL = 0xC0000284, - MD_NTSTATUS_WIN_STATUS_ILLEGAL_ELEMENT_ADDRESS = 0xC0000285, - MD_NTSTATUS_WIN_STATUS_MAGAZINE_NOT_PRESENT = 0xC0000286, - MD_NTSTATUS_WIN_STATUS_REINITIALIZATION_NEEDED = 0xC0000287, - MD_NTSTATUS_WIN_STATUS_ENCRYPTION_FAILED = 0xC000028A, - MD_NTSTATUS_WIN_STATUS_DECRYPTION_FAILED = 0xC000028B, - MD_NTSTATUS_WIN_STATUS_RANGE_NOT_FOUND = 0xC000028C, - MD_NTSTATUS_WIN_STATUS_NO_RECOVERY_POLICY = 0xC000028D, - MD_NTSTATUS_WIN_STATUS_NO_EFS = 0xC000028E, - MD_NTSTATUS_WIN_STATUS_WRONG_EFS = 0xC000028F, - MD_NTSTATUS_WIN_STATUS_NO_USER_KEYS = 0xC0000290, - MD_NTSTATUS_WIN_STATUS_FILE_NOT_ENCRYPTED = 0xC0000291, - MD_NTSTATUS_WIN_STATUS_NOT_EXPORT_FORMAT = 0xC0000292, - MD_NTSTATUS_WIN_STATUS_FILE_ENCRYPTED = 0xC0000293, - MD_NTSTATUS_WIN_STATUS_WMI_GUID_NOT_FOUND = 0xC0000295, - MD_NTSTATUS_WIN_STATUS_WMI_INSTANCE_NOT_FOUND = 0xC0000296, - MD_NTSTATUS_WIN_STATUS_WMI_ITEMID_NOT_FOUND = 0xC0000297, - MD_NTSTATUS_WIN_STATUS_WMI_TRY_AGAIN = 0xC0000298, - MD_NTSTATUS_WIN_STATUS_SHARED_POLICY = 0xC0000299, - MD_NTSTATUS_WIN_STATUS_POLICY_OBJECT_NOT_FOUND = 0xC000029A, - MD_NTSTATUS_WIN_STATUS_POLICY_ONLY_IN_DS = 0xC000029B, - MD_NTSTATUS_WIN_STATUS_VOLUME_NOT_UPGRADED = 0xC000029C, - MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_NOT_ACTIVE = 0xC000029D, - MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_MEDIA_ERROR = 0xC000029E, - MD_NTSTATUS_WIN_STATUS_NO_TRACKING_SERVICE = 0xC000029F, - MD_NTSTATUS_WIN_STATUS_SERVER_SID_MISMATCH = 0xC00002A0, - MD_NTSTATUS_WIN_STATUS_DS_NO_ATTRIBUTE_OR_VALUE = 0xC00002A1, - MD_NTSTATUS_WIN_STATUS_DS_INVALID_ATTRIBUTE_SYNTAX = 0xC00002A2, - MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED = 0xC00002A3, - MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS = 0xC00002A4, - MD_NTSTATUS_WIN_STATUS_DS_BUSY = 0xC00002A5, - MD_NTSTATUS_WIN_STATUS_DS_UNAVAILABLE = 0xC00002A6, - MD_NTSTATUS_WIN_STATUS_DS_NO_RIDS_ALLOCATED = 0xC00002A7, - MD_NTSTATUS_WIN_STATUS_DS_NO_MORE_RIDS = 0xC00002A8, - MD_NTSTATUS_WIN_STATUS_DS_INCORRECT_ROLE_OWNER = 0xC00002A9, - MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_INIT_ERROR = 0xC00002AA, - MD_NTSTATUS_WIN_STATUS_DS_OBJ_CLASS_VIOLATION = 0xC00002AB, - MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_NON_LEAF = 0xC00002AC, - MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_RDN = 0xC00002AD, - MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_OBJ_CLASS = 0xC00002AE, - MD_NTSTATUS_WIN_STATUS_DS_CROSS_DOM_MOVE_FAILED = 0xC00002AF, - MD_NTSTATUS_WIN_STATUS_DS_GC_NOT_AVAILABLE = 0xC00002B0, - MD_NTSTATUS_WIN_STATUS_DIRECTORY_SERVICE_REQUIRED = 0xC00002B1, - MD_NTSTATUS_WIN_STATUS_REPARSE_ATTRIBUTE_CONFLICT = 0xC00002B2, - MD_NTSTATUS_WIN_STATUS_CANT_ENABLE_DENY_ONLY = 0xC00002B3, - MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_FAULTS = 0xC00002B4, - MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_TRAPS = 0xC00002B5, - MD_NTSTATUS_WIN_STATUS_DEVICE_REMOVED = 0xC00002B6, - MD_NTSTATUS_WIN_STATUS_JOURNAL_DELETE_IN_PROGRESS = 0xC00002B7, - MD_NTSTATUS_WIN_STATUS_JOURNAL_NOT_ACTIVE = 0xC00002B8, - MD_NTSTATUS_WIN_STATUS_NOINTERFACE = 0xC00002B9, - MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_DISABLED = 0xC00002BA, - MD_NTSTATUS_WIN_STATUS_DS_ADMIN_LIMIT_EXCEEDED = 0xC00002C1, - MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_SLEEP = 0xC00002C2, - MD_NTSTATUS_WIN_STATUS_MUTUAL_AUTHENTICATION_FAILED = 0xC00002C3, - MD_NTSTATUS_WIN_STATUS_CORRUPT_SYSTEM_FILE = 0xC00002C4, - MD_NTSTATUS_WIN_STATUS_DATATYPE_MISALIGNMENT_ERROR = 0xC00002C5, - MD_NTSTATUS_WIN_STATUS_WMI_READ_ONLY = 0xC00002C6, - MD_NTSTATUS_WIN_STATUS_WMI_SET_FAILURE = 0xC00002C7, - MD_NTSTATUS_WIN_STATUS_COMMITMENT_MINIMUM = 0xC00002C8, - MD_NTSTATUS_WIN_STATUS_REG_NAT_CONSUMPTION = 0xC00002C9, - MD_NTSTATUS_WIN_STATUS_TRANSPORT_FULL = 0xC00002CA, - MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE = 0xC00002CB, - MD_NTSTATUS_WIN_STATUS_ONLY_IF_CONNECTED = 0xC00002CC, - MD_NTSTATUS_WIN_STATUS_DS_SENSITIVE_GROUP_VIOLATION = 0xC00002CD, - MD_NTSTATUS_WIN_STATUS_PNP_RESTART_ENUMERATION = 0xC00002CE, - MD_NTSTATUS_WIN_STATUS_JOURNAL_ENTRY_DELETED = 0xC00002CF, - MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_PRIMARYGROUPID = 0xC00002D0, - MD_NTSTATUS_WIN_STATUS_SYSTEM_IMAGE_BAD_SIGNATURE = 0xC00002D1, - MD_NTSTATUS_WIN_STATUS_PNP_REBOOT_REQUIRED = 0xC00002D2, - MD_NTSTATUS_WIN_STATUS_POWER_STATE_INVALID = 0xC00002D3, - MD_NTSTATUS_WIN_STATUS_DS_INVALID_GROUP_TYPE = 0xC00002D4, - MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = 0xC00002D5, - MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = 0xC00002D6, - MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = 0xC00002D7, - MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER = 0xC00002D8, - MD_NTSTATUS_WIN_STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = 0xC00002D9, - MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = 0xC00002DA, - MD_NTSTATUS_WIN_STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = 0xC00002DB, - MD_NTSTATUS_WIN_STATUS_DS_HAVE_PRIMARY_MEMBERS = 0xC00002DC, - MD_NTSTATUS_WIN_STATUS_WMI_NOT_SUPPORTED = 0xC00002DD, - MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_POWER = 0xC00002DE, - MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_PASSWORD = 0xC00002DF, - MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_FLOPPY = 0xC00002E0, - MD_NTSTATUS_WIN_STATUS_DS_CANT_START = 0xC00002E1, - MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE = 0xC00002E2, - MD_NTSTATUS_WIN_STATUS_SAM_INIT_FAILURE = 0xC00002E3, - MD_NTSTATUS_WIN_STATUS_DS_GC_REQUIRED = 0xC00002E4, - MD_NTSTATUS_WIN_STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = 0xC00002E5, - MD_NTSTATUS_WIN_STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS = 0xC00002E6, - MD_NTSTATUS_WIN_STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = 0xC00002E7, - MD_NTSTATUS_WIN_STATUS_MULTIPLE_FAULT_VIOLATION = 0xC00002E8, - MD_NTSTATUS_WIN_STATUS_CURRENT_DOMAIN_NOT_ALLOWED = 0xC00002E9, - MD_NTSTATUS_WIN_STATUS_CANNOT_MAKE = 0xC00002EA, - MD_NTSTATUS_WIN_STATUS_SYSTEM_SHUTDOWN = 0xC00002EB, - MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE_CONSOLE = 0xC00002EC, - MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE_CONSOLE = 0xC00002ED, - MD_NTSTATUS_WIN_STATUS_UNFINISHED_CONTEXT_DELETED = 0xC00002EE, - MD_NTSTATUS_WIN_STATUS_NO_TGT_REPLY = 0xC00002EF, - MD_NTSTATUS_WIN_STATUS_OBJECTID_NOT_FOUND = 0xC00002F0, - MD_NTSTATUS_WIN_STATUS_NO_IP_ADDRESSES = 0xC00002F1, - MD_NTSTATUS_WIN_STATUS_WRONG_CREDENTIAL_HANDLE = 0xC00002F2, - MD_NTSTATUS_WIN_STATUS_CRYPTO_SYSTEM_INVALID = 0xC00002F3, - MD_NTSTATUS_WIN_STATUS_MAX_REFERRALS_EXCEEDED = 0xC00002F4, - MD_NTSTATUS_WIN_STATUS_MUST_BE_KDC = 0xC00002F5, - MD_NTSTATUS_WIN_STATUS_STRONG_CRYPTO_NOT_SUPPORTED = 0xC00002F6, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_PRINCIPALS = 0xC00002F7, - MD_NTSTATUS_WIN_STATUS_NO_PA_DATA = 0xC00002F8, - MD_NTSTATUS_WIN_STATUS_PKINIT_NAME_MISMATCH = 0xC00002F9, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_LOGON_REQUIRED = 0xC00002FA, - MD_NTSTATUS_WIN_STATUS_KDC_INVALID_REQUEST = 0xC00002FB, - MD_NTSTATUS_WIN_STATUS_KDC_UNABLE_TO_REFER = 0xC00002FC, - MD_NTSTATUS_WIN_STATUS_KDC_UNKNOWN_ETYPE = 0xC00002FD, - MD_NTSTATUS_WIN_STATUS_SHUTDOWN_IN_PROGRESS = 0xC00002FE, - MD_NTSTATUS_WIN_STATUS_SERVER_SHUTDOWN_IN_PROGRESS = 0xC00002FF, - MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_ON_SBS = 0xC0000300, - MD_NTSTATUS_WIN_STATUS_WMI_GUID_DISCONNECTED = 0xC0000301, - MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_DISABLED = 0xC0000302, - MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_ENABLED = 0xC0000303, - MD_NTSTATUS_WIN_STATUS_MFT_TOO_FRAGMENTED = 0xC0000304, - MD_NTSTATUS_WIN_STATUS_COPY_PROTECTION_FAILURE = 0xC0000305, - MD_NTSTATUS_WIN_STATUS_CSS_AUTHENTICATION_FAILURE = 0xC0000306, - MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_PRESENT = 0xC0000307, - MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_ESTABLISHED = 0xC0000308, - MD_NTSTATUS_WIN_STATUS_CSS_SCRAMBLED_SECTOR = 0xC0000309, - MD_NTSTATUS_WIN_STATUS_CSS_REGION_MISMATCH = 0xC000030A, - MD_NTSTATUS_WIN_STATUS_CSS_RESETS_EXHAUSTED = 0xC000030B, - MD_NTSTATUS_WIN_STATUS_PASSWORD_CHANGE_REQUIRED = 0xC000030C, - MD_NTSTATUS_WIN_STATUS_PKINIT_FAILURE = 0xC0000320, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_SUBSYSTEM_FAILURE = 0xC0000321, - MD_NTSTATUS_WIN_STATUS_NO_KERB_KEY = 0xC0000322, - MD_NTSTATUS_WIN_STATUS_HOST_DOWN = 0xC0000350, - MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_PREAUTH = 0xC0000351, - MD_NTSTATUS_WIN_STATUS_EFS_ALG_BLOB_TOO_BIG = 0xC0000352, - MD_NTSTATUS_WIN_STATUS_PORT_NOT_SET = 0xC0000353, - MD_NTSTATUS_WIN_STATUS_DEBUGGER_INACTIVE = 0xC0000354, - MD_NTSTATUS_WIN_STATUS_DS_VERSION_CHECK_FAILURE = 0xC0000355, - MD_NTSTATUS_WIN_STATUS_AUDITING_DISABLED = 0xC0000356, - MD_NTSTATUS_WIN_STATUS_PRENT4_MACHINE_ACCOUNT = 0xC0000357, - MD_NTSTATUS_WIN_STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER = 0xC0000358, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_32 = 0xC0000359, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_64 = 0xC000035A, - MD_NTSTATUS_WIN_STATUS_BAD_BINDINGS = 0xC000035B, - MD_NTSTATUS_WIN_STATUS_NETWORK_SESSION_EXPIRED = 0xC000035C, - MD_NTSTATUS_WIN_STATUS_APPHELP_BLOCK = 0xC000035D, - MD_NTSTATUS_WIN_STATUS_ALL_SIDS_FILTERED = 0xC000035E, - MD_NTSTATUS_WIN_STATUS_NOT_SAFE_MODE_DRIVER = 0xC000035F, - MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT = 0xC0000361, - MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PATH = 0xC0000362, - MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER = 0xC0000363, - MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_OTHER = 0xC0000364, - MD_NTSTATUS_WIN_STATUS_FAILED_DRIVER_ENTRY = 0xC0000365, - MD_NTSTATUS_WIN_STATUS_DEVICE_ENUMERATION_ERROR = 0xC0000366, - MD_NTSTATUS_WIN_STATUS_MOUNT_POINT_NOT_RESOLVED = 0xC0000368, - MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_OBJECT_PARAMETER = 0xC0000369, - MD_NTSTATUS_WIN_STATUS_MCA_OCCURED = 0xC000036A, - MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED_CRITICAL = 0xC000036B, - MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED = 0xC000036C, - MD_NTSTATUS_WIN_STATUS_DRIVER_DATABASE_ERROR = 0xC000036D, - MD_NTSTATUS_WIN_STATUS_SYSTEM_HIVE_TOO_LARGE = 0xC000036E, - MD_NTSTATUS_WIN_STATUS_INVALID_IMPORT_OF_NON_DLL = 0xC000036F, - MD_NTSTATUS_WIN_STATUS_NO_SECRETS = 0xC0000371, - MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY = 0xC0000372, - MD_NTSTATUS_WIN_STATUS_FAILED_STACK_SWITCH = 0xC0000373, - MD_NTSTATUS_WIN_STATUS_HEAP_CORRUPTION = 0xC0000374, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_WRONG_PIN = 0xC0000380, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_BLOCKED = 0xC0000381, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED = 0xC0000382, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CARD = 0xC0000383, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEY_CONTAINER = 0xC0000384, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CERTIFICATE = 0xC0000385, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEYSET = 0xC0000386, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_IO_ERROR = 0xC0000387, - MD_NTSTATUS_WIN_STATUS_DOWNGRADE_DETECTED = 0xC0000388, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_REVOKED = 0xC0000389, - MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED = 0xC000038A, - MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_C = 0xC000038B, - MD_NTSTATUS_WIN_STATUS_PKINIT_CLIENT_FAILURE = 0xC000038C, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_EXPIRED = 0xC000038D, - MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_PRIOR_UNLOAD = 0xC000038E, - MD_NTSTATUS_WIN_STATUS_SMARTCARD_SILENT_CONTEXT = 0xC000038F, - MD_NTSTATUS_WIN_STATUS_PER_USER_TRUST_QUOTA_EXCEEDED = 0xC0000401, - MD_NTSTATUS_WIN_STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED = 0xC0000402, - MD_NTSTATUS_WIN_STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED = 0xC0000403, - MD_NTSTATUS_WIN_STATUS_DS_NAME_NOT_UNIQUE = 0xC0000404, - MD_NTSTATUS_WIN_STATUS_DS_DUPLICATE_ID_FOUND = 0xC0000405, - MD_NTSTATUS_WIN_STATUS_DS_GROUP_CONVERSION_ERROR = 0xC0000406, - MD_NTSTATUS_WIN_STATUS_VOLSNAP_PREPARE_HIBERNATE = 0xC0000407, - MD_NTSTATUS_WIN_STATUS_USER2USER_REQUIRED = 0xC0000408, - MD_NTSTATUS_WIN_STATUS_STACK_BUFFER_OVERRUN = 0xC0000409, - MD_NTSTATUS_WIN_STATUS_NO_S4U_PROT_SUPPORT = 0xC000040A, - MD_NTSTATUS_WIN_STATUS_CROSSREALM_DELEGATION_FAILURE = 0xC000040B, - MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_KDC = 0xC000040C, - MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED_KDC = 0xC000040D, - MD_NTSTATUS_WIN_STATUS_KDC_CERT_EXPIRED = 0xC000040E, - MD_NTSTATUS_WIN_STATUS_KDC_CERT_REVOKED = 0xC000040F, - MD_NTSTATUS_WIN_STATUS_PARAMETER_QUOTA_EXCEEDED = 0xC0000410, - MD_NTSTATUS_WIN_STATUS_HIBERNATION_FAILURE = 0xC0000411, - MD_NTSTATUS_WIN_STATUS_DELAY_LOAD_FAILED = 0xC0000412, - MD_NTSTATUS_WIN_STATUS_AUTHENTICATION_FIREWALL_FAILED = 0xC0000413, - MD_NTSTATUS_WIN_STATUS_VDM_DISALLOWED = 0xC0000414, - MD_NTSTATUS_WIN_STATUS_HUNG_DISPLAY_DRIVER_THREAD = 0xC0000415, - MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE = 0xC0000416, - MD_NTSTATUS_WIN_STATUS_INVALID_CRUNTIME_PARAMETER = 0xC0000417, - MD_NTSTATUS_WIN_STATUS_NTLM_BLOCKED = 0xC0000418, - MD_NTSTATUS_WIN_STATUS_DS_SRC_SID_EXISTS_IN_FOREST = 0xC0000419, - MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST = 0xC000041A, - MD_NTSTATUS_WIN_STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST = 0xC000041B, - MD_NTSTATUS_WIN_STATUS_INVALID_USER_PRINCIPAL_NAME = 0xC000041C, - MD_NTSTATUS_WIN_STATUS_FATAL_USER_CALLBACK_EXCEPTION = 0xC000041D, - MD_NTSTATUS_WIN_STATUS_ASSERTION_FAILURE = 0xC0000420, - MD_NTSTATUS_WIN_STATUS_VERIFIER_STOP = 0xC0000421, - MD_NTSTATUS_WIN_STATUS_CALLBACK_POP_STACK = 0xC0000423, - MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_DRIVER_BLOCKED = 0xC0000424, - MD_NTSTATUS_WIN_STATUS_HIVE_UNLOADED = 0xC0000425, - MD_NTSTATUS_WIN_STATUS_COMPRESSION_DISABLED = 0xC0000426, - MD_NTSTATUS_WIN_STATUS_FILE_SYSTEM_LIMITATION = 0xC0000427, - MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_HASH = 0xC0000428, - MD_NTSTATUS_WIN_STATUS_NOT_CAPABLE = 0xC0000429, - MD_NTSTATUS_WIN_STATUS_REQUEST_OUT_OF_SEQUENCE = 0xC000042A, - MD_NTSTATUS_WIN_STATUS_IMPLEMENTATION_LIMIT = 0xC000042B, - MD_NTSTATUS_WIN_STATUS_ELEVATION_REQUIRED = 0xC000042C, - MD_NTSTATUS_WIN_STATUS_NO_SECURITY_CONTEXT = 0xC000042D, - MD_NTSTATUS_WIN_STATUS_PKU2U_CERT_FAILURE = 0xC000042F, - MD_NTSTATUS_WIN_STATUS_BEYOND_VDL = 0xC0000432, - MD_NTSTATUS_WIN_STATUS_ENCOUNTERED_WRITE_IN_PROGRESS = 0xC0000433, - MD_NTSTATUS_WIN_STATUS_PTE_CHANGED = 0xC0000434, - MD_NTSTATUS_WIN_STATUS_PURGE_FAILED = 0xC0000435, - MD_NTSTATUS_WIN_STATUS_CRED_REQUIRES_CONFIRMATION = 0xC0000440, - MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE = 0xC0000441, - MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER = 0xC0000442, - MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE = 0xC0000443, - MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE = 0xC0000444, - MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_FILE_NOT_CSE = 0xC0000445, - MD_NTSTATUS_WIN_STATUS_INVALID_LABEL = 0xC0000446, - MD_NTSTATUS_WIN_STATUS_DRIVER_PROCESS_TERMINATED = 0xC0000450, - MD_NTSTATUS_WIN_STATUS_AMBIGUOUS_SYSTEM_DEVICE = 0xC0000451, - MD_NTSTATUS_WIN_STATUS_SYSTEM_DEVICE_NOT_FOUND = 0xC0000452, - MD_NTSTATUS_WIN_STATUS_RESTART_BOOT_APPLICATION = 0xC0000453, - MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_NVRAM_RESOURCES = 0xC0000454, - MD_NTSTATUS_WIN_STATUS_INVALID_SESSION = 0xC0000455, - MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_SESSION = 0xC0000456, - MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_SESSION = 0xC0000457, - MD_NTSTATUS_WIN_STATUS_INVALID_WEIGHT = 0xC0000458, - MD_NTSTATUS_WIN_STATUS_REQUEST_PAUSED = 0xC0000459, - MD_NTSTATUS_WIN_STATUS_NO_RANGES_PROCESSED = 0xC0000460, - MD_NTSTATUS_WIN_STATUS_DISK_RESOURCES_EXHAUSTED = 0xC0000461, - MD_NTSTATUS_WIN_STATUS_NEEDS_REMEDIATION = 0xC0000462, - MD_NTSTATUS_WIN_STATUS_DEVICE_FEATURE_NOT_SUPPORTED = 0xC0000463, - MD_NTSTATUS_WIN_STATUS_DEVICE_UNREACHABLE = 0xC0000464, - MD_NTSTATUS_WIN_STATUS_INVALID_TOKEN = 0xC0000465, - MD_NTSTATUS_WIN_STATUS_SERVER_UNAVAILABLE = 0xC0000466, - MD_NTSTATUS_WIN_STATUS_FILE_NOT_AVAILABLE = 0xC0000467, - MD_NTSTATUS_WIN_STATUS_DEVICE_INSUFFICIENT_RESOURCES = 0xC0000468, - MD_NTSTATUS_WIN_STATUS_PACKAGE_UPDATING = 0xC0000469, - MD_NTSTATUS_WIN_STATUS_NOT_READ_FROM_COPY = 0xC000046A, - MD_NTSTATUS_WIN_STATUS_FT_WRITE_FAILURE = 0xC000046B, - MD_NTSTATUS_WIN_STATUS_FT_DI_SCAN_REQUIRED = 0xC000046C, - MD_NTSTATUS_WIN_STATUS_OBJECT_NOT_EXTERNALLY_BACKED = 0xC000046D, - MD_NTSTATUS_WIN_STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN = 0xC000046E, - MD_NTSTATUS_WIN_STATUS_DATA_CHECKSUM_ERROR = 0xC0000470, - MD_NTSTATUS_WIN_STATUS_INTERMIXED_KERNEL_EA_OPERATION = 0xC0000471, - MD_NTSTATUS_WIN_STATUS_TRIM_READ_ZERO_NOT_SUPPORTED = 0xC0000472, - MD_NTSTATUS_WIN_STATUS_TOO_MANY_SEGMENT_DESCRIPTORS = 0xC0000473, - MD_NTSTATUS_WIN_STATUS_INVALID_OFFSET_ALIGNMENT = 0xC0000474, - MD_NTSTATUS_WIN_STATUS_INVALID_FIELD_IN_PARAMETER_LIST = 0xC0000475, - MD_NTSTATUS_WIN_STATUS_OPERATION_IN_PROGRESS = 0xC0000476, - MD_NTSTATUS_WIN_STATUS_INVALID_INITIATOR_TARGET_PATH = 0xC0000477, - MD_NTSTATUS_WIN_STATUS_SCRUB_DATA_DISABLED = 0xC0000478, - MD_NTSTATUS_WIN_STATUS_NOT_REDUNDANT_STORAGE = 0xC0000479, - MD_NTSTATUS_WIN_STATUS_RESIDENT_FILE_NOT_SUPPORTED = 0xC000047A, - MD_NTSTATUS_WIN_STATUS_COMPRESSED_FILE_NOT_SUPPORTED = 0xC000047B, - MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_SUPPORTED = 0xC000047C, - MD_NTSTATUS_WIN_STATUS_IO_OPERATION_TIMEOUT = 0xC000047D, - MD_NTSTATUS_WIN_STATUS_SYSTEM_NEEDS_REMEDIATION = 0xC000047E, - MD_NTSTATUS_WIN_STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN = 0xC000047F, - MD_NTSTATUS_WIN_STATUS_SHARE_UNAVAILABLE = 0xC0000480, - MD_NTSTATUS_WIN_STATUS_APISET_NOT_HOSTED = 0xC0000481, - MD_NTSTATUS_WIN_STATUS_APISET_NOT_PRESENT = 0xC0000482, - MD_NTSTATUS_WIN_STATUS_DEVICE_HARDWARE_ERROR = 0xC0000483, - MD_NTSTATUS_WIN_STATUS_INVALID_TASK_NAME = 0xC0000500, - MD_NTSTATUS_WIN_STATUS_INVALID_TASK_INDEX = 0xC0000501, - MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_TASK = 0xC0000502, - MD_NTSTATUS_WIN_STATUS_CALLBACK_BYPASS = 0xC0000503, - MD_NTSTATUS_WIN_STATUS_UNDEFINED_SCOPE = 0xC0000504, - MD_NTSTATUS_WIN_STATUS_INVALID_CAP = 0xC0000505, - MD_NTSTATUS_WIN_STATUS_NOT_GUI_PROCESS = 0xC0000506, - MD_NTSTATUS_WIN_STATUS_FAIL_FAST_EXCEPTION = 0xC0000602, - MD_NTSTATUS_WIN_STATUS_IMAGE_CERT_REVOKED = 0xC0000603, - MD_NTSTATUS_WIN_STATUS_DYNAMIC_CODE_BLOCKED = 0xC0000604, - MD_NTSTATUS_WIN_STATUS_PORT_CLOSED = 0xC0000700, - MD_NTSTATUS_WIN_STATUS_MESSAGE_LOST = 0xC0000701, - MD_NTSTATUS_WIN_STATUS_INVALID_MESSAGE = 0xC0000702, - MD_NTSTATUS_WIN_STATUS_REQUEST_CANCELED = 0xC0000703, - MD_NTSTATUS_WIN_STATUS_RECURSIVE_DISPATCH = 0xC0000704, - MD_NTSTATUS_WIN_STATUS_LPC_RECEIVE_BUFFER_EXPECTED = 0xC0000705, - MD_NTSTATUS_WIN_STATUS_LPC_INVALID_CONNECTION_USAGE = 0xC0000706, - MD_NTSTATUS_WIN_STATUS_LPC_REQUESTS_NOT_ALLOWED = 0xC0000707, - MD_NTSTATUS_WIN_STATUS_RESOURCE_IN_USE = 0xC0000708, - MD_NTSTATUS_WIN_STATUS_HARDWARE_MEMORY_ERROR = 0xC0000709, - MD_NTSTATUS_WIN_STATUS_THREADPOOL_HANDLE_EXCEPTION = 0xC000070A, - MD_NTSTATUS_WIN_STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED = 0xC000070B, - MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED = 0xC000070C, - MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED = 0xC000070D, - MD_NTSTATUS_WIN_STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED = 0xC000070E, - MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASED_DURING_OPERATION = 0xC000070F, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING = 0xC0000710, - MD_NTSTATUS_WIN_STATUS_APC_RETURNED_WHILE_IMPERSONATING = 0xC0000711, - MD_NTSTATUS_WIN_STATUS_PROCESS_IS_PROTECTED = 0xC0000712, - MD_NTSTATUS_WIN_STATUS_MCA_EXCEPTION = 0xC0000713, - MD_NTSTATUS_WIN_STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE = 0xC0000714, - MD_NTSTATUS_WIN_STATUS_SYMLINK_CLASS_DISABLED = 0xC0000715, - MD_NTSTATUS_WIN_STATUS_INVALID_IDN_NORMALIZATION = 0xC0000716, - MD_NTSTATUS_WIN_STATUS_NO_UNICODE_TRANSLATION = 0xC0000717, - MD_NTSTATUS_WIN_STATUS_ALREADY_REGISTERED = 0xC0000718, - MD_NTSTATUS_WIN_STATUS_CONTEXT_MISMATCH = 0xC0000719, - MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_HAS_COMPLETION_LIST = 0xC000071A, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_PRIORITY = 0xC000071B, - MD_NTSTATUS_WIN_STATUS_INVALID_THREAD = 0xC000071C, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_TRANSACTION = 0xC000071D, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LDR_LOCK = 0xC000071E, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LANG = 0xC000071F, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_PRI_BACK = 0xC0000720, - MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_AFFINITY = 0xC0000721, - MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_DISABLED = 0xC0000800, - MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_RENAME_IN_PROGRESS = 0xC0000801, - MD_NTSTATUS_WIN_STATUS_DISK_QUOTA_EXCEEDED = 0xC0000802, - MD_NTSTATUS_WIN_STATUS_CONTENT_BLOCKED = 0xC0000804, - MD_NTSTATUS_WIN_STATUS_BAD_CLUSTERS = 0xC0000805, - MD_NTSTATUS_WIN_STATUS_VOLUME_DIRTY = 0xC0000806, - MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_UNSUCCESSFUL = 0xC0000808, - MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_OVERFULL = 0xC0000809, - MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CORRUPTED = 0xC000080A, - MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UNAVAILABLE = 0xC000080B, - MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_DELETED_FULL = 0xC000080C, - MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CLEARED = 0xC000080D, - MD_NTSTATUS_WIN_STATUS_ORPHAN_NAME_EXHAUSTED = 0xC000080E, - MD_NTSTATUS_WIN_STATUS_PROACTIVE_SCAN_IN_PROGRESS = 0xC000080F, - MD_NTSTATUS_WIN_STATUS_ENCRYPTED_IO_NOT_POSSIBLE = 0xC0000810, - MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UPLEVEL_RECORDS = 0xC0000811, - MD_NTSTATUS_WIN_STATUS_FILE_CHECKED_OUT = 0xC0000901, - MD_NTSTATUS_WIN_STATUS_CHECKOUT_REQUIRED = 0xC0000902, - MD_NTSTATUS_WIN_STATUS_BAD_FILE_TYPE = 0xC0000903, - MD_NTSTATUS_WIN_STATUS_FILE_TOO_LARGE = 0xC0000904, - MD_NTSTATUS_WIN_STATUS_FORMS_AUTH_REQUIRED = 0xC0000905, - MD_NTSTATUS_WIN_STATUS_VIRUS_INFECTED = 0xC0000906, - MD_NTSTATUS_WIN_STATUS_VIRUS_DELETED = 0xC0000907, - MD_NTSTATUS_WIN_STATUS_BAD_MCFG_TABLE = 0xC0000908, - MD_NTSTATUS_WIN_STATUS_CANNOT_BREAK_OPLOCK = 0xC0000909, - MD_NTSTATUS_WIN_STATUS_BAD_KEY = 0xC000090A, - MD_NTSTATUS_WIN_STATUS_BAD_DATA = 0xC000090B, - MD_NTSTATUS_WIN_STATUS_NO_KEY = 0xC000090C, - MD_NTSTATUS_WIN_STATUS_FILE_HANDLE_REVOKED = 0xC0000910, - MD_NTSTATUS_WIN_STATUS_WOW_ASSERTION = 0xC0009898, - MD_NTSTATUS_WIN_STATUS_INVALID_SIGNATURE = 0xC000A000, - MD_NTSTATUS_WIN_STATUS_HMAC_NOT_SUPPORTED = 0xC000A001, - MD_NTSTATUS_WIN_STATUS_AUTH_TAG_MISMATCH = 0xC000A002, - MD_NTSTATUS_WIN_STATUS_INVALID_STATE_TRANSITION = 0xC000A003, - MD_NTSTATUS_WIN_STATUS_INVALID_KERNEL_INFO_VERSION = 0xC000A004, - MD_NTSTATUS_WIN_STATUS_INVALID_PEP_INFO_VERSION = 0xC000A005, - MD_NTSTATUS_WIN_STATUS_IPSEC_QUEUE_OVERFLOW = 0xC000A010, - MD_NTSTATUS_WIN_STATUS_ND_QUEUE_OVERFLOW = 0xC000A011, - MD_NTSTATUS_WIN_STATUS_HOPLIMIT_EXCEEDED = 0xC000A012, - MD_NTSTATUS_WIN_STATUS_PROTOCOL_NOT_SUPPORTED = 0xC000A013, - MD_NTSTATUS_WIN_STATUS_FASTPATH_REJECTED = 0xC000A014, - MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED = 0xC000A080, - MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR = 0xC000A081, - MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR = 0xC000A082, - MD_NTSTATUS_WIN_STATUS_XML_PARSE_ERROR = 0xC000A083, - MD_NTSTATUS_WIN_STATUS_XMLDSIG_ERROR = 0xC000A084, - MD_NTSTATUS_WIN_STATUS_WRONG_COMPARTMENT = 0xC000A085, - MD_NTSTATUS_WIN_STATUS_AUTHIP_FAILURE = 0xC000A086, - MD_NTSTATUS_WIN_STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS = 0xC000A087, - MD_NTSTATUS_WIN_STATUS_DS_OID_NOT_FOUND = 0xC000A088, - MD_NTSTATUS_WIN_STATUS_INCORRECT_ACCOUNT_TYPE = 0xC000A089, - MD_NTSTATUS_WIN_STATUS_HASH_NOT_SUPPORTED = 0xC000A100, - MD_NTSTATUS_WIN_STATUS_HASH_NOT_PRESENT = 0xC000A101, - MD_NTSTATUS_WIN_STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED = 0xC000A121, - MD_NTSTATUS_WIN_STATUS_GPIO_CLIENT_INFORMATION_INVALID = 0xC000A122, - MD_NTSTATUS_WIN_STATUS_GPIO_VERSION_NOT_SUPPORTED = 0xC000A123, - MD_NTSTATUS_WIN_STATUS_GPIO_INVALID_REGISTRATION_PACKET = 0xC000A124, - MD_NTSTATUS_WIN_STATUS_GPIO_OPERATION_DENIED = 0xC000A125, - MD_NTSTATUS_WIN_STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE = 0xC000A126, - MD_NTSTATUS_WIN_STATUS_CANNOT_SWITCH_RUNLEVEL = 0xC000A141, - MD_NTSTATUS_WIN_STATUS_INVALID_RUNLEVEL_SETTING = 0xC000A142, - MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_TIMEOUT = 0xC000A143, - MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT = 0xC000A145, - MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_IN_PROGRESS = 0xC000A146, - MD_NTSTATUS_WIN_STATUS_NOT_APPCONTAINER = 0xC000A200, - MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_IN_APPCONTAINER = 0xC000A201, - MD_NTSTATUS_WIN_STATUS_INVALID_PACKAGE_SID_LENGTH = 0xC000A202, - MD_NTSTATUS_WIN_STATUS_APP_DATA_NOT_FOUND = 0xC000A281, - MD_NTSTATUS_WIN_STATUS_APP_DATA_EXPIRED = 0xC000A282, - MD_NTSTATUS_WIN_STATUS_APP_DATA_CORRUPT = 0xC000A283, - MD_NTSTATUS_WIN_STATUS_APP_DATA_LIMIT_EXCEEDED = 0xC000A284, - MD_NTSTATUS_WIN_STATUS_APP_DATA_REBOOT_REQUIRED = 0xC000A285, - MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED = 0xC000A2A1, - MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED = 0xC000A2A2, - MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED = 0xC000A2A3, - MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED = 0xC000A2A4, - MD_NTSTATUS_WIN_DBG_NO_STATE_CHANGE = 0xC0010001, - MD_NTSTATUS_WIN_DBG_APP_NOT_IDLE = 0xC0010002, - MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_BINDING = 0xC0020001, - MD_NTSTATUS_WIN_RPC_NT_WRONG_KIND_OF_BINDING = 0xC0020002, - MD_NTSTATUS_WIN_RPC_NT_INVALID_BINDING = 0xC0020003, - MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_SUPPORTED = 0xC0020004, - MD_NTSTATUS_WIN_RPC_NT_INVALID_RPC_PROTSEQ = 0xC0020005, - MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_UUID = 0xC0020006, - MD_NTSTATUS_WIN_RPC_NT_INVALID_ENDPOINT_FORMAT = 0xC0020007, - MD_NTSTATUS_WIN_RPC_NT_INVALID_NET_ADDR = 0xC0020008, - MD_NTSTATUS_WIN_RPC_NT_NO_ENDPOINT_FOUND = 0xC0020009, - MD_NTSTATUS_WIN_RPC_NT_INVALID_TIMEOUT = 0xC002000A, - MD_NTSTATUS_WIN_RPC_NT_OBJECT_NOT_FOUND = 0xC002000B, - MD_NTSTATUS_WIN_RPC_NT_ALREADY_REGISTERED = 0xC002000C, - MD_NTSTATUS_WIN_RPC_NT_TYPE_ALREADY_REGISTERED = 0xC002000D, - MD_NTSTATUS_WIN_RPC_NT_ALREADY_LISTENING = 0xC002000E, - MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS_REGISTERED = 0xC002000F, - MD_NTSTATUS_WIN_RPC_NT_NOT_LISTENING = 0xC0020010, - MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_MGR_TYPE = 0xC0020011, - MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_IF = 0xC0020012, - MD_NTSTATUS_WIN_RPC_NT_NO_BINDINGS = 0xC0020013, - MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS = 0xC0020014, - MD_NTSTATUS_WIN_RPC_NT_CANT_CREATE_ENDPOINT = 0xC0020015, - MD_NTSTATUS_WIN_RPC_NT_OUT_OF_RESOURCES = 0xC0020016, - MD_NTSTATUS_WIN_RPC_NT_SERVER_UNAVAILABLE = 0xC0020017, - MD_NTSTATUS_WIN_RPC_NT_SERVER_TOO_BUSY = 0xC0020018, - MD_NTSTATUS_WIN_RPC_NT_INVALID_NETWORK_OPTIONS = 0xC0020019, - MD_NTSTATUS_WIN_RPC_NT_NO_CALL_ACTIVE = 0xC002001A, - MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED = 0xC002001B, - MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED_DNE = 0xC002001C, - MD_NTSTATUS_WIN_RPC_NT_PROTOCOL_ERROR = 0xC002001D, - MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TRANS_SYN = 0xC002001F, - MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TYPE = 0xC0020021, - MD_NTSTATUS_WIN_RPC_NT_INVALID_TAG = 0xC0020022, - MD_NTSTATUS_WIN_RPC_NT_INVALID_BOUND = 0xC0020023, - MD_NTSTATUS_WIN_RPC_NT_NO_ENTRY_NAME = 0xC0020024, - MD_NTSTATUS_WIN_RPC_NT_INVALID_NAME_SYNTAX = 0xC0020025, - MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_NAME_SYNTAX = 0xC0020026, - MD_NTSTATUS_WIN_RPC_NT_UUID_NO_ADDRESS = 0xC0020028, - MD_NTSTATUS_WIN_RPC_NT_DUPLICATE_ENDPOINT = 0xC0020029, - MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_TYPE = 0xC002002A, - MD_NTSTATUS_WIN_RPC_NT_MAX_CALLS_TOO_SMALL = 0xC002002B, - MD_NTSTATUS_WIN_RPC_NT_STRING_TOO_LONG = 0xC002002C, - MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_FOUND = 0xC002002D, - MD_NTSTATUS_WIN_RPC_NT_PROCNUM_OUT_OF_RANGE = 0xC002002E, - MD_NTSTATUS_WIN_RPC_NT_BINDING_HAS_NO_AUTH = 0xC002002F, - MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_SERVICE = 0xC0020030, - MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_LEVEL = 0xC0020031, - MD_NTSTATUS_WIN_RPC_NT_INVALID_AUTH_IDENTITY = 0xC0020032, - MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHZ_SERVICE = 0xC0020033, - MD_NTSTATUS_WIN_EPT_NT_INVALID_ENTRY = 0xC0020034, - MD_NTSTATUS_WIN_EPT_NT_CANT_PERFORM_OP = 0xC0020035, - MD_NTSTATUS_WIN_EPT_NT_NOT_REGISTERED = 0xC0020036, - MD_NTSTATUS_WIN_RPC_NT_NOTHING_TO_EXPORT = 0xC0020037, - MD_NTSTATUS_WIN_RPC_NT_INCOMPLETE_NAME = 0xC0020038, - MD_NTSTATUS_WIN_RPC_NT_INVALID_VERS_OPTION = 0xC0020039, - MD_NTSTATUS_WIN_RPC_NT_NO_MORE_MEMBERS = 0xC002003A, - MD_NTSTATUS_WIN_RPC_NT_NOT_ALL_OBJS_UNEXPORTED = 0xC002003B, - MD_NTSTATUS_WIN_RPC_NT_INTERFACE_NOT_FOUND = 0xC002003C, - MD_NTSTATUS_WIN_RPC_NT_ENTRY_ALREADY_EXISTS = 0xC002003D, - MD_NTSTATUS_WIN_RPC_NT_ENTRY_NOT_FOUND = 0xC002003E, - MD_NTSTATUS_WIN_RPC_NT_NAME_SERVICE_UNAVAILABLE = 0xC002003F, - MD_NTSTATUS_WIN_RPC_NT_INVALID_NAF_ID = 0xC0020040, - MD_NTSTATUS_WIN_RPC_NT_CANNOT_SUPPORT = 0xC0020041, - MD_NTSTATUS_WIN_RPC_NT_NO_CONTEXT_AVAILABLE = 0xC0020042, - MD_NTSTATUS_WIN_RPC_NT_INTERNAL_ERROR = 0xC0020043, - MD_NTSTATUS_WIN_RPC_NT_ZERO_DIVIDE = 0xC0020044, - MD_NTSTATUS_WIN_RPC_NT_ADDRESS_ERROR = 0xC0020045, - MD_NTSTATUS_WIN_RPC_NT_FP_DIV_ZERO = 0xC0020046, - MD_NTSTATUS_WIN_RPC_NT_FP_UNDERFLOW = 0xC0020047, - MD_NTSTATUS_WIN_RPC_NT_FP_OVERFLOW = 0xC0020048, - MD_NTSTATUS_WIN_RPC_NT_CALL_IN_PROGRESS = 0xC0020049, - MD_NTSTATUS_WIN_RPC_NT_NO_MORE_BINDINGS = 0xC002004A, - MD_NTSTATUS_WIN_RPC_NT_GROUP_MEMBER_NOT_FOUND = 0xC002004B, - MD_NTSTATUS_WIN_EPT_NT_CANT_CREATE = 0xC002004C, - MD_NTSTATUS_WIN_RPC_NT_INVALID_OBJECT = 0xC002004D, - MD_NTSTATUS_WIN_RPC_NT_NO_INTERFACES = 0xC002004F, - MD_NTSTATUS_WIN_RPC_NT_CALL_CANCELLED = 0xC0020050, - MD_NTSTATUS_WIN_RPC_NT_BINDING_INCOMPLETE = 0xC0020051, - MD_NTSTATUS_WIN_RPC_NT_COMM_FAILURE = 0xC0020052, - MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_AUTHN_LEVEL = 0xC0020053, - MD_NTSTATUS_WIN_RPC_NT_NO_PRINC_NAME = 0xC0020054, - MD_NTSTATUS_WIN_RPC_NT_NOT_RPC_ERROR = 0xC0020055, - MD_NTSTATUS_WIN_RPC_NT_SEC_PKG_ERROR = 0xC0020057, - MD_NTSTATUS_WIN_RPC_NT_NOT_CANCELLED = 0xC0020058, - MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_HANDLE = 0xC0020062, - MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_CALL = 0xC0020063, - MD_NTSTATUS_WIN_RPC_NT_PROXY_ACCESS_DENIED = 0xC0020064, - MD_NTSTATUS_WIN_RPC_NT_COOKIE_AUTH_FAILED = 0xC0020065, - MD_NTSTATUS_WIN_RPC_NT_NO_MORE_ENTRIES = 0xC0030001, - MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_OPEN_FAIL = 0xC0030002, - MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_SHORT_FILE = 0xC0030003, - MD_NTSTATUS_WIN_RPC_NT_SS_IN_NULL_CONTEXT = 0xC0030004, - MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_MISMATCH = 0xC0030005, - MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_DAMAGED = 0xC0030006, - MD_NTSTATUS_WIN_RPC_NT_SS_HANDLES_MISMATCH = 0xC0030007, - MD_NTSTATUS_WIN_RPC_NT_SS_CANNOT_GET_CALL_HANDLE = 0xC0030008, - MD_NTSTATUS_WIN_RPC_NT_NULL_REF_POINTER = 0xC0030009, - MD_NTSTATUS_WIN_RPC_NT_ENUM_VALUE_OUT_OF_RANGE = 0xC003000A, - MD_NTSTATUS_WIN_RPC_NT_BYTE_COUNT_TOO_SMALL = 0xC003000B, - MD_NTSTATUS_WIN_RPC_NT_BAD_STUB_DATA = 0xC003000C, - MD_NTSTATUS_WIN_RPC_NT_INVALID_ES_ACTION = 0xC0030059, - MD_NTSTATUS_WIN_RPC_NT_WRONG_ES_VERSION = 0xC003005A, - MD_NTSTATUS_WIN_RPC_NT_WRONG_STUB_VERSION = 0xC003005B, - MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OBJECT = 0xC003005C, - MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OPERATION = 0xC003005D, - MD_NTSTATUS_WIN_RPC_NT_WRONG_PIPE_VERSION = 0xC003005E, - MD_NTSTATUS_WIN_RPC_NT_PIPE_CLOSED = 0xC003005F, - MD_NTSTATUS_WIN_RPC_NT_PIPE_DISCIPLINE_ERROR = 0xC0030060, - MD_NTSTATUS_WIN_RPC_NT_PIPE_EMPTY = 0xC0030061, - MD_NTSTATUS_WIN_STATUS_PNP_BAD_MPS_TABLE = 0xC0040035, - MD_NTSTATUS_WIN_STATUS_PNP_TRANSLATION_FAILED = 0xC0040036, - MD_NTSTATUS_WIN_STATUS_PNP_IRQ_TRANSLATION_FAILED = 0xC0040037, - MD_NTSTATUS_WIN_STATUS_PNP_INVALID_ID = 0xC0040038, - MD_NTSTATUS_WIN_STATUS_IO_REISSUE_AS_CACHED = 0xC0040039, - MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_INVALID = 0xC00A0001, - MD_NTSTATUS_WIN_STATUS_CTX_INVALID_PD = 0xC00A0002, - MD_NTSTATUS_WIN_STATUS_CTX_PD_NOT_FOUND = 0xC00A0003, - MD_NTSTATUS_WIN_STATUS_CTX_CLOSE_PENDING = 0xC00A0006, - MD_NTSTATUS_WIN_STATUS_CTX_NO_OUTBUF = 0xC00A0007, - MD_NTSTATUS_WIN_STATUS_CTX_MODEM_INF_NOT_FOUND = 0xC00A0008, - MD_NTSTATUS_WIN_STATUS_CTX_INVALID_MODEMNAME = 0xC00A0009, - MD_NTSTATUS_WIN_STATUS_CTX_RESPONSE_ERROR = 0xC00A000A, - MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_TIMEOUT = 0xC00A000B, - MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_CARRIER = 0xC00A000C, - MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE = 0xC00A000D, - MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_BUSY = 0xC00A000E, - MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_VOICE = 0xC00A000F, - MD_NTSTATUS_WIN_STATUS_CTX_TD_ERROR = 0xC00A0010, - MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_CLIENT_INVALID = 0xC00A0012, - MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_NOT_AVAILABLE = 0xC00A0013, - MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_EXPIRED = 0xC00A0014, - MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NOT_FOUND = 0xC00A0015, - MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_COLLISION = 0xC00A0016, - MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_BUSY = 0xC00A0017, - MD_NTSTATUS_WIN_STATUS_CTX_BAD_VIDEO_MODE = 0xC00A0018, - MD_NTSTATUS_WIN_STATUS_CTX_GRAPHICS_INVALID = 0xC00A0022, - MD_NTSTATUS_WIN_STATUS_CTX_NOT_CONSOLE = 0xC00A0024, - MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_QUERY_TIMEOUT = 0xC00A0026, - MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_DISCONNECT = 0xC00A0027, - MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_CONNECT = 0xC00A0028, - MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DENIED = 0xC00A002A, - MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_ACCESS_DENIED = 0xC00A002B, - MD_NTSTATUS_WIN_STATUS_CTX_INVALID_WD = 0xC00A002E, - MD_NTSTATUS_WIN_STATUS_CTX_WD_NOT_FOUND = 0xC00A002F, - MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_INVALID = 0xC00A0030, - MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DISABLED = 0xC00A0031, - MD_NTSTATUS_WIN_STATUS_RDP_PROTOCOL_ERROR = 0xC00A0032, - MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_NOT_SET = 0xC00A0033, - MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_IN_USE = 0xC00A0034, - MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE = 0xC00A0035, - MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_NOT_RUNNING = 0xC00A0036, - MD_NTSTATUS_WIN_STATUS_CTX_LOGON_DISABLED = 0xC00A0037, - MD_NTSTATUS_WIN_STATUS_CTX_SECURITY_LAYER_ERROR = 0xC00A0038, - MD_NTSTATUS_WIN_STATUS_TS_INCOMPATIBLE_SESSIONS = 0xC00A0039, - MD_NTSTATUS_WIN_STATUS_TS_VIDEO_SUBSYSTEM_ERROR = 0xC00A003A, - MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_FOUND = 0xC00B0001, - MD_NTSTATUS_WIN_STATUS_MUI_INVALID_FILE = 0xC00B0002, - MD_NTSTATUS_WIN_STATUS_MUI_INVALID_RC_CONFIG = 0xC00B0003, - MD_NTSTATUS_WIN_STATUS_MUI_INVALID_LOCALE_NAME = 0xC00B0004, - MD_NTSTATUS_WIN_STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME = 0xC00B0005, - MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_LOADED = 0xC00B0006, - MD_NTSTATUS_WIN_STATUS_RESOURCE_ENUM_USER_STOP = 0xC00B0007, - MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NODE = 0xC0130001, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_EXISTS = 0xC0130002, - MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_IN_PROGRESS = 0xC0130003, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_FOUND = 0xC0130004, - MD_NTSTATUS_WIN_STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND = 0xC0130005, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_EXISTS = 0xC0130006, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_FOUND = 0xC0130007, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_EXISTS = 0xC0130008, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_NOT_FOUND = 0xC0130009, - MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_REQUEST = 0xC013000A, - MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK_PROVIDER = 0xC013000B, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_DOWN = 0xC013000C, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UNREACHABLE = 0xC013000D, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_MEMBER = 0xC013000E, - MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS = 0xC013000F, - MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK = 0xC0130010, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_NET_ADAPTERS = 0xC0130011, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UP = 0xC0130012, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_PAUSED = 0xC0130013, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_PAUSED = 0xC0130014, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_SECURITY_CONTEXT = 0xC0130015, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_INTERNAL = 0xC0130016, - MD_NTSTATUS_WIN_STATUS_CLUSTER_POISONED = 0xC0130017, - MD_NTSTATUS_WIN_STATUS_CLUSTER_NON_CSV_PATH = 0xC0130018, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL = 0xC0130019, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS = 0xC0130020, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR = 0xC0130021, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_REDIRECTED = 0xC0130022, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_NOT_REDIRECTED = 0xC0130023, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING = 0xC0130024, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS = 0xC0130025, - MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL = 0xC0130026, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OPCODE = 0xC0140001, - MD_NTSTATUS_WIN_STATUS_ACPI_STACK_OVERFLOW = 0xC0140002, - MD_NTSTATUS_WIN_STATUS_ACPI_ASSERT_FAILED = 0xC0140003, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_INDEX = 0xC0140004, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGUMENT = 0xC0140005, - MD_NTSTATUS_WIN_STATUS_ACPI_FATAL = 0xC0140006, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_SUPERNAME = 0xC0140007, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGTYPE = 0xC0140008, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OBJTYPE = 0xC0140009, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TARGETTYPE = 0xC014000A, - MD_NTSTATUS_WIN_STATUS_ACPI_INCORRECT_ARGUMENT_COUNT = 0xC014000B, - MD_NTSTATUS_WIN_STATUS_ACPI_ADDRESS_NOT_MAPPED = 0xC014000C, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_EVENTTYPE = 0xC014000D, - MD_NTSTATUS_WIN_STATUS_ACPI_HANDLER_COLLISION = 0xC014000E, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_DATA = 0xC014000F, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_REGION = 0xC0140010, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ACCESS_SIZE = 0xC0140011, - MD_NTSTATUS_WIN_STATUS_ACPI_ACQUIRE_GLOBAL_LOCK = 0xC0140012, - MD_NTSTATUS_WIN_STATUS_ACPI_ALREADY_INITIALIZED = 0xC0140013, - MD_NTSTATUS_WIN_STATUS_ACPI_NOT_INITIALIZED = 0xC0140014, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_MUTEX_LEVEL = 0xC0140015, - MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNED = 0xC0140016, - MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNER = 0xC0140017, - MD_NTSTATUS_WIN_STATUS_ACPI_RS_ACCESS = 0xC0140018, - MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TABLE = 0xC0140019, - MD_NTSTATUS_WIN_STATUS_ACPI_REG_HANDLER_FAILED = 0xC0140020, - MD_NTSTATUS_WIN_STATUS_ACPI_POWER_REQUEST_FAILED = 0xC0140021, - MD_NTSTATUS_WIN_STATUS_SXS_SECTION_NOT_FOUND = 0xC0150001, - MD_NTSTATUS_WIN_STATUS_SXS_CANT_GEN_ACTCTX = 0xC0150002, - MD_NTSTATUS_WIN_STATUS_SXS_INVALID_ACTCTXDATA_FORMAT = 0xC0150003, - MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_NOT_FOUND = 0xC0150004, - MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_FORMAT_ERROR = 0xC0150005, - MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_PARSE_ERROR = 0xC0150006, - MD_NTSTATUS_WIN_STATUS_SXS_ACTIVATION_CONTEXT_DISABLED = 0xC0150007, - MD_NTSTATUS_WIN_STATUS_SXS_KEY_NOT_FOUND = 0xC0150008, - MD_NTSTATUS_WIN_STATUS_SXS_VERSION_CONFLICT = 0xC0150009, - MD_NTSTATUS_WIN_STATUS_SXS_WRONG_SECTION_TYPE = 0xC015000A, - MD_NTSTATUS_WIN_STATUS_SXS_THREAD_QUERIES_DISABLED = 0xC015000B, - MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_MISSING = 0xC015000C, - MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET = 0xC015000E, - MD_NTSTATUS_WIN_STATUS_SXS_EARLY_DEACTIVATION = 0xC015000F, - MD_NTSTATUS_WIN_STATUS_SXS_INVALID_DEACTIVATION = 0xC0150010, - MD_NTSTATUS_WIN_STATUS_SXS_MULTIPLE_DEACTIVATION = 0xC0150011, - MD_NTSTATUS_WIN_STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY = 0xC0150012, - MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_TERMINATION_REQUESTED = 0xC0150013, - MD_NTSTATUS_WIN_STATUS_SXS_CORRUPT_ACTIVATION_STACK = 0xC0150014, - MD_NTSTATUS_WIN_STATUS_SXS_CORRUPTION = 0xC0150015, - MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE = 0xC0150016, - MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME = 0xC0150017, - MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE = 0xC0150018, - MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_PARSE_ERROR = 0xC0150019, - MD_NTSTATUS_WIN_STATUS_SXS_COMPONENT_STORE_CORRUPT = 0xC015001A, - MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISMATCH = 0xC015001B, - MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT = 0xC015001C, - MD_NTSTATUS_WIN_STATUS_SXS_IDENTITIES_DIFFERENT = 0xC015001D, - MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT = 0xC015001E, - MD_NTSTATUS_WIN_STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY = 0xC015001F, - MD_NTSTATUS_WIN_STATUS_ADVANCED_INSTALLER_FAILED = 0xC0150020, - MD_NTSTATUS_WIN_STATUS_XML_ENCODING_MISMATCH = 0xC0150021, - MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_TOO_BIG = 0xC0150022, - MD_NTSTATUS_WIN_STATUS_SXS_SETTING_NOT_REGISTERED = 0xC0150023, - MD_NTSTATUS_WIN_STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE = 0xC0150024, - MD_NTSTATUS_WIN_STATUS_SMI_PRIMITIVE_INSTALLER_FAILED = 0xC0150025, - MD_NTSTATUS_WIN_STATUS_GENERIC_COMMAND_FAILED = 0xC0150026, - MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISSING = 0xC0150027, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_CONFLICT = 0xC0190001, - MD_NTSTATUS_WIN_STATUS_INVALID_TRANSACTION = 0xC0190002, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ACTIVE = 0xC0190003, - MD_NTSTATUS_WIN_STATUS_TM_INITIALIZATION_FAILED = 0xC0190004, - MD_NTSTATUS_WIN_STATUS_RM_NOT_ACTIVE = 0xC0190005, - MD_NTSTATUS_WIN_STATUS_RM_METADATA_CORRUPT = 0xC0190006, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_JOINED = 0xC0190007, - MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_RM = 0xC0190008, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE = 0xC019000A, - MD_NTSTATUS_WIN_STATUS_LOG_RESIZE_INVALID_SIZE = 0xC019000B, - MD_NTSTATUS_WIN_STATUS_REMOTE_FILE_VERSION_MISMATCH = 0xC019000C, - MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_ALREADY_EXISTS = 0xC019000F, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_PROPAGATION_FAILED = 0xC0190010, - MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_NOT_FOUND = 0xC0190011, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_SUPERIOR_EXISTS = 0xC0190012, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUEST_NOT_VALID = 0xC0190013, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_REQUESTED = 0xC0190014, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_ABORTED = 0xC0190015, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_COMMITTED = 0xC0190016, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER = 0xC0190017, - MD_NTSTATUS_WIN_STATUS_CURRENT_TRANSACTION_NOT_VALID = 0xC0190018, - MD_NTSTATUS_WIN_STATUS_LOG_GROWTH_FAILED = 0xC0190019, - MD_NTSTATUS_WIN_STATUS_OBJECT_NO_LONGER_EXISTS = 0xC0190021, - MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_FOUND = 0xC0190022, - MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_VALID = 0xC0190023, - MD_NTSTATUS_WIN_STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION = 0xC0190024, - MD_NTSTATUS_WIN_STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT = 0xC0190025, - MD_NTSTATUS_WIN_STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS = 0xC0190026, - MD_NTSTATUS_WIN_STATUS_HANDLE_NO_LONGER_VALID = 0xC0190028, - MD_NTSTATUS_WIN_STATUS_LOG_CORRUPTION_DETECTED = 0xC0190030, - MD_NTSTATUS_WIN_STATUS_RM_DISCONNECTED = 0xC0190032, - MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_SUPERIOR = 0xC0190033, - MD_NTSTATUS_WIN_STATUS_FILE_IDENTITY_NOT_PERSISTENT = 0xC0190036, - MD_NTSTATUS_WIN_STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY = 0xC0190037, - MD_NTSTATUS_WIN_STATUS_CANT_CROSS_RM_BOUNDARY = 0xC0190038, - MD_NTSTATUS_WIN_STATUS_TXF_DIR_NOT_EMPTY = 0xC0190039, - MD_NTSTATUS_WIN_STATUS_INDOUBT_TRANSACTIONS_EXIST = 0xC019003A, - MD_NTSTATUS_WIN_STATUS_TM_VOLATILE = 0xC019003B, - MD_NTSTATUS_WIN_STATUS_ROLLBACK_TIMER_EXPIRED = 0xC019003C, - MD_NTSTATUS_WIN_STATUS_TXF_ATTRIBUTE_CORRUPT = 0xC019003D, - MD_NTSTATUS_WIN_STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION = 0xC019003E, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED = 0xC019003F, - MD_NTSTATUS_WIN_STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE = 0xC0190040, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUIRED_PROMOTION = 0xC0190043, - MD_NTSTATUS_WIN_STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION = 0xC0190044, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_NOT_FROZEN = 0xC0190045, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_FREEZE_IN_PROGRESS = 0xC0190046, - MD_NTSTATUS_WIN_STATUS_NOT_SNAPSHOT_VOLUME = 0xC0190047, - MD_NTSTATUS_WIN_STATUS_NO_SAVEPOINT_WITH_OPEN_FILES = 0xC0190048, - MD_NTSTATUS_WIN_STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION = 0xC0190049, - MD_NTSTATUS_WIN_STATUS_TM_IDENTITY_MISMATCH = 0xC019004A, - MD_NTSTATUS_WIN_STATUS_FLOATED_SECTION = 0xC019004B, - MD_NTSTATUS_WIN_STATUS_CANNOT_ACCEPT_TRANSACTED_WORK = 0xC019004C, - MD_NTSTATUS_WIN_STATUS_CANNOT_ABORT_TRANSACTIONS = 0xC019004D, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_FOUND = 0xC019004E, - MD_NTSTATUS_WIN_STATUS_RESOURCEMANAGER_NOT_FOUND = 0xC019004F, - MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_FOUND = 0xC0190050, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_FOUND = 0xC0190051, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_ONLINE = 0xC0190052, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION = 0xC0190053, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ROOT = 0xC0190054, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_OBJECT_EXPIRED = 0xC0190055, - MD_NTSTATUS_WIN_STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION = 0xC0190056, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED = 0xC0190057, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_RECORD_TOO_LONG = 0xC0190058, - MD_NTSTATUS_WIN_STATUS_NO_LINK_TRACKING_IN_TRANSACTION = 0xC0190059, - MD_NTSTATUS_WIN_STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION = 0xC019005A, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_INTEGRITY_VIOLATED = 0xC019005B, - MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH = 0xC019005C, - MD_NTSTATUS_WIN_STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT = 0xC019005D, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_MUST_WRITETHROUGH = 0xC019005E, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_SUPERIOR = 0xC019005F, - MD_NTSTATUS_WIN_STATUS_EXPIRED_HANDLE = 0xC0190060, - MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ENLISTED = 0xC0190061, - MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_INVALID = 0xC01A0001, - MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_PARITY_INVALID = 0xC01A0002, - MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_REMAPPED = 0xC01A0003, - MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INCOMPLETE = 0xC01A0004, - MD_NTSTATUS_WIN_STATUS_LOG_INVALID_RANGE = 0xC01A0005, - MD_NTSTATUS_WIN_STATUS_LOG_BLOCKS_EXHAUSTED = 0xC01A0006, - MD_NTSTATUS_WIN_STATUS_LOG_READ_CONTEXT_INVALID = 0xC01A0007, - MD_NTSTATUS_WIN_STATUS_LOG_RESTART_INVALID = 0xC01A0008, - MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_VERSION = 0xC01A0009, - MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INVALID = 0xC01A000A, - MD_NTSTATUS_WIN_STATUS_LOG_READ_MODE_INVALID = 0xC01A000B, - MD_NTSTATUS_WIN_STATUS_LOG_METADATA_CORRUPT = 0xC01A000D, - MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INVALID = 0xC01A000E, - MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INCONSISTENT = 0xC01A000F, - MD_NTSTATUS_WIN_STATUS_LOG_RESERVATION_INVALID = 0xC01A0010, - MD_NTSTATUS_WIN_STATUS_LOG_CANT_DELETE = 0xC01A0011, - MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_LIMIT_EXCEEDED = 0xC01A0012, - MD_NTSTATUS_WIN_STATUS_LOG_START_OF_LOG = 0xC01A0013, - MD_NTSTATUS_WIN_STATUS_LOG_POLICY_ALREADY_INSTALLED = 0xC01A0014, - MD_NTSTATUS_WIN_STATUS_LOG_POLICY_NOT_INSTALLED = 0xC01A0015, - MD_NTSTATUS_WIN_STATUS_LOG_POLICY_INVALID = 0xC01A0016, - MD_NTSTATUS_WIN_STATUS_LOG_POLICY_CONFLICT = 0xC01A0017, - MD_NTSTATUS_WIN_STATUS_LOG_PINNED_ARCHIVE_TAIL = 0xC01A0018, - MD_NTSTATUS_WIN_STATUS_LOG_RECORD_NONEXISTENT = 0xC01A0019, - MD_NTSTATUS_WIN_STATUS_LOG_RECORDS_RESERVED_INVALID = 0xC01A001A, - MD_NTSTATUS_WIN_STATUS_LOG_SPACE_RESERVED_INVALID = 0xC01A001B, - MD_NTSTATUS_WIN_STATUS_LOG_TAIL_INVALID = 0xC01A001C, - MD_NTSTATUS_WIN_STATUS_LOG_FULL = 0xC01A001D, - MD_NTSTATUS_WIN_STATUS_LOG_MULTIPLEXED = 0xC01A001E, - MD_NTSTATUS_WIN_STATUS_LOG_DEDICATED = 0xC01A001F, - MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS = 0xC01A0020, - MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_IN_PROGRESS = 0xC01A0021, - MD_NTSTATUS_WIN_STATUS_LOG_EPHEMERAL = 0xC01A0022, - MD_NTSTATUS_WIN_STATUS_LOG_NOT_ENOUGH_CONTAINERS = 0xC01A0023, - MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_ALREADY_REGISTERED = 0xC01A0024, - MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_NOT_REGISTERED = 0xC01A0025, - MD_NTSTATUS_WIN_STATUS_LOG_FULL_HANDLER_IN_PROGRESS = 0xC01A0026, - MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_READ_FAILED = 0xC01A0027, - MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_WRITE_FAILED = 0xC01A0028, - MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_OPEN_FAILED = 0xC01A0029, - MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_STATE_INVALID = 0xC01A002A, - MD_NTSTATUS_WIN_STATUS_LOG_STATE_INVALID = 0xC01A002B, - MD_NTSTATUS_WIN_STATUS_LOG_PINNED = 0xC01A002C, - MD_NTSTATUS_WIN_STATUS_LOG_METADATA_FLUSH_FAILED = 0xC01A002D, - MD_NTSTATUS_WIN_STATUS_LOG_INCONSISTENT_SECURITY = 0xC01A002E, - MD_NTSTATUS_WIN_STATUS_LOG_APPENDED_FLUSH_FAILED = 0xC01A002F, - MD_NTSTATUS_WIN_STATUS_LOG_PINNED_RESERVATION = 0xC01A0030, - MD_NTSTATUS_WIN_STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD = 0xC01B00EA, - MD_NTSTATUS_WIN_STATUS_FLT_NO_HANDLER_DEFINED = 0xC01C0001, - MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_DEFINED = 0xC01C0002, - MD_NTSTATUS_WIN_STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST = 0xC01C0003, - MD_NTSTATUS_WIN_STATUS_FLT_DISALLOW_FAST_IO = 0xC01C0004, - MD_NTSTATUS_WIN_STATUS_FLT_INVALID_NAME_REQUEST = 0xC01C0005, - MD_NTSTATUS_WIN_STATUS_FLT_NOT_SAFE_TO_POST_OPERATION = 0xC01C0006, - MD_NTSTATUS_WIN_STATUS_FLT_NOT_INITIALIZED = 0xC01C0007, - MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_READY = 0xC01C0008, - MD_NTSTATUS_WIN_STATUS_FLT_POST_OPERATION_CLEANUP = 0xC01C0009, - MD_NTSTATUS_WIN_STATUS_FLT_INTERNAL_ERROR = 0xC01C000A, - MD_NTSTATUS_WIN_STATUS_FLT_DELETING_OBJECT = 0xC01C000B, - MD_NTSTATUS_WIN_STATUS_FLT_MUST_BE_NONPAGED_POOL = 0xC01C000C, - MD_NTSTATUS_WIN_STATUS_FLT_DUPLICATE_ENTRY = 0xC01C000D, - MD_NTSTATUS_WIN_STATUS_FLT_CBDQ_DISABLED = 0xC01C000E, - MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_ATTACH = 0xC01C000F, - MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_DETACH = 0xC01C0010, - MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_ALTITUDE_COLLISION = 0xC01C0011, - MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NAME_COLLISION = 0xC01C0012, - MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_FOUND = 0xC01C0013, - MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_NOT_FOUND = 0xC01C0014, - MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NOT_FOUND = 0xC01C0015, - MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND = 0xC01C0016, - MD_NTSTATUS_WIN_STATUS_FLT_INVALID_CONTEXT_REGISTRATION = 0xC01C0017, - MD_NTSTATUS_WIN_STATUS_FLT_NAME_CACHE_MISS = 0xC01C0018, - MD_NTSTATUS_WIN_STATUS_FLT_NO_DEVICE_OBJECT = 0xC01C0019, - MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_ALREADY_MOUNTED = 0xC01C001A, - MD_NTSTATUS_WIN_STATUS_FLT_ALREADY_ENLISTED = 0xC01C001B, - MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_LINKED = 0xC01C001C, - MD_NTSTATUS_WIN_STATUS_FLT_NO_WAITER_FOR_REPLY = 0xC01C0020, - MD_NTSTATUS_WIN_STATUS_FLT_REGISTRATION_BUSY = 0xC01C0023, - MD_NTSTATUS_WIN_STATUS_MONITOR_NO_DESCRIPTOR = 0xC01D0001, - MD_NTSTATUS_WIN_STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT = 0xC01D0002, - MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM = 0xC01D0003, - MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK = 0xC01D0004, - MD_NTSTATUS_WIN_STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED = 0xC01D0005, - MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK = 0xC01D0006, - MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK = 0xC01D0007, - MD_NTSTATUS_WIN_STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA = 0xC01D0008, - MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK = 0xC01D0009, - MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_MANUFACTURE_DATE = 0xC01D000A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER = 0xC01E0000, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER = 0xC01E0001, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER = 0xC01E0002, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_WAS_RESET = 0xC01E0003, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DRIVER_MODEL = 0xC01E0004, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_MODE_CHANGED = 0xC01E0005, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_OCCLUDED = 0xC01E0006, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_DENIED = 0xC01E0007, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANNOTCOLORCONVERT = 0xC01E0008, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DRIVER_MISMATCH = 0xC01E0009, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED = 0xC01E000B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_UNOCCLUDED = 0xC01E000C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE = 0xC01E000D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED = 0xC01E000E, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDEO_MEMORY = 0xC01E0100, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_LOCK_MEMORY = 0xC01E0101, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_BUSY = 0xC01E0102, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOO_MANY_REFERENCES = 0xC01E0103, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_LATER = 0xC01E0104, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_NOW = 0xC01E0105, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_INVALID = 0xC01E0106, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE = 0xC01E0107, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED = 0xC01E0108, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION = 0xC01E0109, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE = 0xC01E0110, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION = 0xC01E0111, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CLOSED = 0xC01E0112, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE = 0xC01E0113, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE = 0xC01E0114, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE = 0xC01E0115, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST = 0xC01E0116, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE = 0xC01E0200, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY = 0xC01E0300, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED = 0xC01E0301, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED = 0xC01E0302, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN = 0xC01E0303, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE = 0xC01E0304, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET = 0xC01E0305, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED = 0xC01E0306, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET = 0xC01E0308, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET = 0xC01E0309, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_FREQUENCY = 0xC01E030A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ACTIVE_REGION = 0xC01E030B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_TOTAL_REGION = 0xC01E030C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE = 0xC01E0310, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE = 0xC01E0311, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET = 0xC01E0312, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY = 0xC01E0313, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET = 0xC01E0314, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET = 0xC01E0315, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET = 0xC01E0316, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET = 0xC01E0317, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ALREADY_IN_SET = 0xC01E0318, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH = 0xC01E0319, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY = 0xC01E031A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET = 0xC01E031B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE = 0xC01E031C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET = 0xC01E031D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET = 0xC01E031F, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_MODESET = 0xC01E0320, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET = 0xC01E0321, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE = 0xC01E0322, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN = 0xC01E0323, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE = 0xC01E0324, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION = 0xC01E0325, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES = 0xC01E0326, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY = 0xC01E0327, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE = 0xC01E0328, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET = 0xC01E0329, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET = 0xC01E032A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR = 0xC01E032B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET = 0xC01E032C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET = 0xC01E032D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE = 0xC01E032E, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE = 0xC01E032F, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_RESOURCES_NOT_RELATED = 0xC01E0330, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE = 0xC01E0331, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE = 0xC01E0332, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET = 0xC01E0333, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER = 0xC01E0334, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDPNMGR = 0xC01E0335, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_ACTIVE_VIDPN = 0xC01E0336, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY = 0xC01E0337, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NOT_CONNECTED = 0xC01E0338, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY = 0xC01E0339, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE = 0xC01E033A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE = 0xC01E033B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_STRIDE = 0xC01E033C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELFORMAT = 0xC01E033D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COLORBASIS = 0xC01E033E, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE = 0xC01E033F, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY = 0xC01E0340, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT = 0xC01E0341, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE = 0xC01E0342, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN = 0xC01E0343, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL = 0xC01E0344, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION = 0xC01E0345, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED = 0xC01E0346, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_GAMMA_RAMP = 0xC01E0347, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED = 0xC01E0348, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED = 0xC01E0349, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_NOT_IN_MODESET = 0xC01E034A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON = 0xC01E034D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE = 0xC01E034E, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE = 0xC01E034F, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS = 0xC01E0350, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING = 0xC01E0352, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED = 0xC01E0353, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS = 0xC01E0354, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT = 0xC01E0355, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM = 0xC01E0356, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN = 0xC01E0357, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT = 0xC01E0358, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED = 0xC01E0359, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION = 0xC01E035A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_CLIENT_TYPE = 0xC01E035B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET = 0xC01E035C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED = 0xC01E0400, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED = 0xC01E0401, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER = 0xC01E0430, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED = 0xC01E0431, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED = 0xC01E0432, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY = 0xC01E0433, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED = 0xC01E0434, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON = 0xC01E0435, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE = 0xC01E0436, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER = 0xC01E0438, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED = 0xC01E043B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NOT_SUPPORTED = 0xC01E0500, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_COPP_NOT_SUPPORTED = 0xC01E0501, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_UAB_NOT_SUPPORTED = 0xC01E0502, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS = 0xC01E0503, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST = 0xC01E0505, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INTERNAL_ERROR = 0xC01E050B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_HANDLE = 0xC01E050C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH = 0xC01E050E, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED = 0xC01E050F, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED = 0xC01E0510, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_HFS_FAILED = 0xC01E0511, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_SRM = 0xC01E0512, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP = 0xC01E0513, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP = 0xC01E0514, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA = 0xC01E0515, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET = 0xC01E0516, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH = 0xC01E0517, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE = 0xC01E0518, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS = 0xC01E051A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS = 0xC01E051C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST = 0xC01E051D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR = 0xC01E051E, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS = 0xC01E051F, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED = 0xC01E0520, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST = 0xC01E0521, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_NOT_SUPPORTED = 0xC01E0580, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST = 0xC01E0581, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA = 0xC01E0582, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA = 0xC01E0583, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED = 0xC01E0584, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_DATA = 0xC01E0585, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE = 0xC01E0586, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING = 0xC01E0587, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MCA_INTERNAL_ERROR = 0xC01E0588, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND = 0xC01E0589, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH = 0xC01E058A, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM = 0xC01E058B, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE = 0xC01E058C, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS = 0xC01E058D, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED = 0xC01E05E0, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME = 0xC01E05E1, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP = 0xC01E05E2, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED = 0xC01E05E3, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_POINTER = 0xC01E05E4, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE = 0xC01E05E5, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL = 0xC01E05E6, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_INTERNAL_ERROR = 0xC01E05E7, - MD_NTSTATUS_WIN_STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS = 0xC01E05E8, - MD_NTSTATUS_WIN_STATUS_FVE_LOCKED_VOLUME = 0xC0210000, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_ENCRYPTED = 0xC0210001, - MD_NTSTATUS_WIN_STATUS_FVE_BAD_INFORMATION = 0xC0210002, - MD_NTSTATUS_WIN_STATUS_FVE_TOO_SMALL = 0xC0210003, - MD_NTSTATUS_WIN_STATUS_FVE_FAILED_WRONG_FS = 0xC0210004, - MD_NTSTATUS_WIN_STATUS_FVE_BAD_PARTITION_SIZE = 0xC0210005, - MD_NTSTATUS_WIN_STATUS_FVE_FS_NOT_EXTENDED = 0xC0210006, - MD_NTSTATUS_WIN_STATUS_FVE_FS_MOUNTED = 0xC0210007, - MD_NTSTATUS_WIN_STATUS_FVE_NO_LICENSE = 0xC0210008, - MD_NTSTATUS_WIN_STATUS_FVE_ACTION_NOT_ALLOWED = 0xC0210009, - MD_NTSTATUS_WIN_STATUS_FVE_BAD_DATA = 0xC021000A, - MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_NOT_BOUND = 0xC021000B, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_DATA_VOLUME = 0xC021000C, - MD_NTSTATUS_WIN_STATUS_FVE_CONV_READ_ERROR = 0xC021000D, - MD_NTSTATUS_WIN_STATUS_FVE_CONV_WRITE_ERROR = 0xC021000E, - MD_NTSTATUS_WIN_STATUS_FVE_OVERLAPPED_UPDATE = 0xC021000F, - MD_NTSTATUS_WIN_STATUS_FVE_FAILED_SECTOR_SIZE = 0xC0210010, - MD_NTSTATUS_WIN_STATUS_FVE_FAILED_AUTHENTICATION = 0xC0210011, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_OS_VOLUME = 0xC0210012, - MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NOT_FOUND = 0xC0210013, - MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_INVALID = 0xC0210014, - MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NO_VMK = 0xC0210015, - MD_NTSTATUS_WIN_STATUS_FVE_TPM_DISABLED = 0xC0210016, - MD_NTSTATUS_WIN_STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO = 0xC0210017, - MD_NTSTATUS_WIN_STATUS_FVE_TPM_INVALID_PCR = 0xC0210018, - MD_NTSTATUS_WIN_STATUS_FVE_TPM_NO_VMK = 0xC0210019, - MD_NTSTATUS_WIN_STATUS_FVE_PIN_INVALID = 0xC021001A, - MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_APPLICATION = 0xC021001B, - MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_CONFIG = 0xC021001C, - MD_NTSTATUS_WIN_STATUS_FVE_DEBUGGER_ENABLED = 0xC021001D, - MD_NTSTATUS_WIN_STATUS_FVE_DRY_RUN_FAILED = 0xC021001E, - MD_NTSTATUS_WIN_STATUS_FVE_BAD_METADATA_POINTER = 0xC021001F, - MD_NTSTATUS_WIN_STATUS_FVE_OLD_METADATA_COPY = 0xC0210020, - MD_NTSTATUS_WIN_STATUS_FVE_REBOOT_REQUIRED = 0xC0210021, - MD_NTSTATUS_WIN_STATUS_FVE_RAW_ACCESS = 0xC0210022, - MD_NTSTATUS_WIN_STATUS_FVE_RAW_BLOCKED = 0xC0210023, - MD_NTSTATUS_WIN_STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY = 0xC0210024, - MD_NTSTATUS_WIN_STATUS_FVE_MOR_FAILED = 0xC0210025, - MD_NTSTATUS_WIN_STATUS_FVE_NO_FEATURE_LICENSE = 0xC0210026, - MD_NTSTATUS_WIN_STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED = 0xC0210027, - MD_NTSTATUS_WIN_STATUS_FVE_CONV_RECOVERY_FAILED = 0xC0210028, - MD_NTSTATUS_WIN_STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG = 0xC0210029, - MD_NTSTATUS_WIN_STATUS_FVE_INVALID_DATUM_TYPE = 0xC021002A, - MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_TOO_SMALL = 0xC0210030, - MD_NTSTATUS_WIN_STATUS_FVE_ENH_PIN_INVALID = 0xC0210031, - MD_NTSTATUS_WIN_STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE = 0xC0210032, - MD_NTSTATUS_WIN_STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE = 0xC0210033, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK = 0xC0210034, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CLUSTER = 0xC0210035, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING = 0xC0210036, - MD_NTSTATUS_WIN_STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE = 0xC0210037, - MD_NTSTATUS_WIN_STATUS_FVE_EDRIVE_DRY_RUN_FAILED = 0xC0210038, - MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_DISABLED = 0xC0210039, - MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_CONFIG_CHANGE = 0xC021003A, - MD_NTSTATUS_WIN_STATUS_FVE_DEVICE_LOCKEDOUT = 0xC021003B, - MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT = 0xC021003C, - MD_NTSTATUS_WIN_STATUS_FVE_NOT_DE_VOLUME = 0xC021003D, - MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_DISABLED = 0xC021003E, - MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED = 0xC021003F, - MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOT_FOUND = 0xC0220001, - MD_NTSTATUS_WIN_STATUS_FWP_CONDITION_NOT_FOUND = 0xC0220002, - MD_NTSTATUS_WIN_STATUS_FWP_FILTER_NOT_FOUND = 0xC0220003, - MD_NTSTATUS_WIN_STATUS_FWP_LAYER_NOT_FOUND = 0xC0220004, - MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_NOT_FOUND = 0xC0220005, - MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND = 0xC0220006, - MD_NTSTATUS_WIN_STATUS_FWP_SUBLAYER_NOT_FOUND = 0xC0220007, - MD_NTSTATUS_WIN_STATUS_FWP_NOT_FOUND = 0xC0220008, - MD_NTSTATUS_WIN_STATUS_FWP_ALREADY_EXISTS = 0xC0220009, - MD_NTSTATUS_WIN_STATUS_FWP_IN_USE = 0xC022000A, - MD_NTSTATUS_WIN_STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS = 0xC022000B, - MD_NTSTATUS_WIN_STATUS_FWP_WRONG_SESSION = 0xC022000C, - MD_NTSTATUS_WIN_STATUS_FWP_NO_TXN_IN_PROGRESS = 0xC022000D, - MD_NTSTATUS_WIN_STATUS_FWP_TXN_IN_PROGRESS = 0xC022000E, - MD_NTSTATUS_WIN_STATUS_FWP_TXN_ABORTED = 0xC022000F, - MD_NTSTATUS_WIN_STATUS_FWP_SESSION_ABORTED = 0xC0220010, - MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_TXN = 0xC0220011, - MD_NTSTATUS_WIN_STATUS_FWP_TIMEOUT = 0xC0220012, - MD_NTSTATUS_WIN_STATUS_FWP_NET_EVENTS_DISABLED = 0xC0220013, - MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_LAYER = 0xC0220014, - MD_NTSTATUS_WIN_STATUS_FWP_KM_CLIENTS_ONLY = 0xC0220015, - MD_NTSTATUS_WIN_STATUS_FWP_LIFETIME_MISMATCH = 0xC0220016, - MD_NTSTATUS_WIN_STATUS_FWP_BUILTIN_OBJECT = 0xC0220017, - MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_CALLOUTS = 0xC0220018, - MD_NTSTATUS_WIN_STATUS_FWP_NOTIFICATION_DROPPED = 0xC0220019, - MD_NTSTATUS_WIN_STATUS_FWP_TRAFFIC_MISMATCH = 0xC022001A, - MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_SA_STATE = 0xC022001B, - MD_NTSTATUS_WIN_STATUS_FWP_NULL_POINTER = 0xC022001C, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ENUMERATOR = 0xC022001D, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_FLAGS = 0xC022001E, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_NET_MASK = 0xC022001F, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_RANGE = 0xC0220020, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_INTERVAL = 0xC0220021, - MD_NTSTATUS_WIN_STATUS_FWP_ZERO_LENGTH_ARRAY = 0xC0220022, - MD_NTSTATUS_WIN_STATUS_FWP_NULL_DISPLAY_NAME = 0xC0220023, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ACTION_TYPE = 0xC0220024, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_WEIGHT = 0xC0220025, - MD_NTSTATUS_WIN_STATUS_FWP_MATCH_TYPE_MISMATCH = 0xC0220026, - MD_NTSTATUS_WIN_STATUS_FWP_TYPE_MISMATCH = 0xC0220027, - MD_NTSTATUS_WIN_STATUS_FWP_OUT_OF_BOUNDS = 0xC0220028, - MD_NTSTATUS_WIN_STATUS_FWP_RESERVED = 0xC0220029, - MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_CONDITION = 0xC022002A, - MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_KEYMOD = 0xC022002B, - MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER = 0xC022002C, - MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER = 0xC022002D, - MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER = 0xC022002E, - MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT = 0xC022002F, - MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_AUTH_METHOD = 0xC0220030, - MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_DH_GROUP = 0xC0220031, - MD_NTSTATUS_WIN_STATUS_FWP_EM_NOT_SUPPORTED = 0xC0220032, - MD_NTSTATUS_WIN_STATUS_FWP_NEVER_MATCH = 0xC0220033, - MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_MISMATCH = 0xC0220034, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_PARAMETER = 0xC0220035, - MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_SUBLAYERS = 0xC0220036, - MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOTIFICATION_FAILED = 0xC0220037, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_AUTH_TRANSFORM = 0xC0220038, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_CIPHER_TRANSFORM = 0xC0220039, - MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM = 0xC022003A, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TRANSFORM_COMBINATION = 0xC022003B, - MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_AUTH_METHOD = 0xC022003C, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TUNNEL_ENDPOINT = 0xC022003D, - MD_NTSTATUS_WIN_STATUS_FWP_L2_DRIVER_NOT_READY = 0xC022003E, - MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED = 0xC022003F, - MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL = 0xC0220040, - MD_NTSTATUS_WIN_STATUS_FWP_CONNECTIONS_DISABLED = 0xC0220041, - MD_NTSTATUS_WIN_STATUS_FWP_INVALID_DNS_NAME = 0xC0220042, - MD_NTSTATUS_WIN_STATUS_FWP_STILL_ON = 0xC0220043, - MD_NTSTATUS_WIN_STATUS_FWP_IKEEXT_NOT_RUNNING = 0xC0220044, - MD_NTSTATUS_WIN_STATUS_FWP_TCPIP_NOT_READY = 0xC0220100, - MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_CLOSING = 0xC0220101, - MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_STALE = 0xC0220102, - MD_NTSTATUS_WIN_STATUS_FWP_CANNOT_PEND = 0xC0220103, - MD_NTSTATUS_WIN_STATUS_FWP_DROP_NOICMP = 0xC0220104, - MD_NTSTATUS_WIN_STATUS_NDIS_CLOSING = 0xC0230002, - MD_NTSTATUS_WIN_STATUS_NDIS_BAD_VERSION = 0xC0230004, - MD_NTSTATUS_WIN_STATUS_NDIS_BAD_CHARACTERISTICS = 0xC0230005, - MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_FOUND = 0xC0230006, - MD_NTSTATUS_WIN_STATUS_NDIS_OPEN_FAILED = 0xC0230007, - MD_NTSTATUS_WIN_STATUS_NDIS_DEVICE_FAILED = 0xC0230008, - MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_FULL = 0xC0230009, - MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_EXISTS = 0xC023000A, - MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_NOT_FOUND = 0xC023000B, - MD_NTSTATUS_WIN_STATUS_NDIS_REQUEST_ABORTED = 0xC023000C, - MD_NTSTATUS_WIN_STATUS_NDIS_RESET_IN_PROGRESS = 0xC023000D, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PACKET = 0xC023000F, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DEVICE_REQUEST = 0xC0230010, - MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_READY = 0xC0230011, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_LENGTH = 0xC0230014, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DATA = 0xC0230015, - MD_NTSTATUS_WIN_STATUS_NDIS_BUFFER_TOO_SHORT = 0xC0230016, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_OID = 0xC0230017, - MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_REMOVED = 0xC0230018, - MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_MEDIA = 0xC0230019, - MD_NTSTATUS_WIN_STATUS_NDIS_GROUP_ADDRESS_IN_USE = 0xC023001A, - MD_NTSTATUS_WIN_STATUS_NDIS_FILE_NOT_FOUND = 0xC023001B, - MD_NTSTATUS_WIN_STATUS_NDIS_ERROR_READING_FILE = 0xC023001C, - MD_NTSTATUS_WIN_STATUS_NDIS_ALREADY_MAPPED = 0xC023001D, - MD_NTSTATUS_WIN_STATUS_NDIS_RESOURCE_CONFLICT = 0xC023001E, - MD_NTSTATUS_WIN_STATUS_NDIS_MEDIA_DISCONNECTED = 0xC023001F, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_ADDRESS = 0xC0230022, - MD_NTSTATUS_WIN_STATUS_NDIS_PAUSED = 0xC023002A, - MD_NTSTATUS_WIN_STATUS_NDIS_INTERFACE_NOT_FOUND = 0xC023002B, - MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_REVISION = 0xC023002C, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT = 0xC023002D, - MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT_STATE = 0xC023002E, - MD_NTSTATUS_WIN_STATUS_NDIS_LOW_POWER_STATE = 0xC023002F, - MD_NTSTATUS_WIN_STATUS_NDIS_REINIT_REQUIRED = 0xC0230030, - MD_NTSTATUS_WIN_STATUS_NDIS_NOT_SUPPORTED = 0xC02300BB, - MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_POLICY = 0xC023100F, - MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED = 0xC0231012, - MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_PATH_REJECTED = 0xC0231013, - MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED = 0xC0232000, - MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_MEDIA_IN_USE = 0xC0232001, - MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_POWER_STATE_INVALID = 0xC0232002, - MD_NTSTATUS_WIN_STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL = 0xC0232003, - MD_NTSTATUS_WIN_STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL = 0xC0232004, - MD_NTSTATUS_WIN_STATUS_TPM_ERROR_MASK = 0xC0290000, - MD_NTSTATUS_WIN_STATUS_TPM_AUTHFAIL = 0xC0290001, - MD_NTSTATUS_WIN_STATUS_TPM_BADINDEX = 0xC0290002, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAMETER = 0xC0290003, - MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAILURE = 0xC0290004, - MD_NTSTATUS_WIN_STATUS_TPM_CLEAR_DISABLED = 0xC0290005, - MD_NTSTATUS_WIN_STATUS_TPM_DEACTIVATED = 0xC0290006, - MD_NTSTATUS_WIN_STATUS_TPM_DISABLED = 0xC0290007, - MD_NTSTATUS_WIN_STATUS_TPM_DISABLED_CMD = 0xC0290008, - MD_NTSTATUS_WIN_STATUS_TPM_FAIL = 0xC0290009, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_ORDINAL = 0xC029000A, - MD_NTSTATUS_WIN_STATUS_TPM_INSTALL_DISABLED = 0xC029000B, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYHANDLE = 0xC029000C, - MD_NTSTATUS_WIN_STATUS_TPM_KEYNOTFOUND = 0xC029000D, - MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_ENC = 0xC029000E, - MD_NTSTATUS_WIN_STATUS_TPM_MIGRATEFAIL = 0xC029000F, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_PCR_INFO = 0xC0290010, - MD_NTSTATUS_WIN_STATUS_TPM_NOSPACE = 0xC0290011, - MD_NTSTATUS_WIN_STATUS_TPM_NOSRK = 0xC0290012, - MD_NTSTATUS_WIN_STATUS_TPM_NOTSEALED_BLOB = 0xC0290013, - MD_NTSTATUS_WIN_STATUS_TPM_OWNER_SET = 0xC0290014, - MD_NTSTATUS_WIN_STATUS_TPM_RESOURCES = 0xC0290015, - MD_NTSTATUS_WIN_STATUS_TPM_SHORTRANDOM = 0xC0290016, - MD_NTSTATUS_WIN_STATUS_TPM_SIZE = 0xC0290017, - MD_NTSTATUS_WIN_STATUS_TPM_WRONGPCRVAL = 0xC0290018, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAM_SIZE = 0xC0290019, - MD_NTSTATUS_WIN_STATUS_TPM_SHA_THREAD = 0xC029001A, - MD_NTSTATUS_WIN_STATUS_TPM_SHA_ERROR = 0xC029001B, - MD_NTSTATUS_WIN_STATUS_TPM_FAILEDSELFTEST = 0xC029001C, - MD_NTSTATUS_WIN_STATUS_TPM_AUTH2FAIL = 0xC029001D, - MD_NTSTATUS_WIN_STATUS_TPM_BADTAG = 0xC029001E, - MD_NTSTATUS_WIN_STATUS_TPM_IOERROR = 0xC029001F, - MD_NTSTATUS_WIN_STATUS_TPM_ENCRYPT_ERROR = 0xC0290020, - MD_NTSTATUS_WIN_STATUS_TPM_DECRYPT_ERROR = 0xC0290021, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_AUTHHANDLE = 0xC0290022, - MD_NTSTATUS_WIN_STATUS_TPM_NO_ENDORSEMENT = 0xC0290023, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYUSAGE = 0xC0290024, - MD_NTSTATUS_WIN_STATUS_TPM_WRONG_ENTITYTYPE = 0xC0290025, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_POSTINIT = 0xC0290026, - MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_SIG = 0xC0290027, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_KEY_PROPERTY = 0xC0290028, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_MIGRATION = 0xC0290029, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_SCHEME = 0xC029002A, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_DATASIZE = 0xC029002B, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_MODE = 0xC029002C, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_PRESENCE = 0xC029002D, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_VERSION = 0xC029002E, - MD_NTSTATUS_WIN_STATUS_TPM_NO_WRAP_TRANSPORT = 0xC029002F, - MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_UNSUCCESSFUL = 0xC0290030, - MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_SUCCESSFUL = 0xC0290031, - MD_NTSTATUS_WIN_STATUS_TPM_NOTRESETABLE = 0xC0290032, - MD_NTSTATUS_WIN_STATUS_TPM_NOTLOCAL = 0xC0290033, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_TYPE = 0xC0290034, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_RESOURCE = 0xC0290035, - MD_NTSTATUS_WIN_STATUS_TPM_NOTFIPS = 0xC0290036, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_FAMILY = 0xC0290037, - MD_NTSTATUS_WIN_STATUS_TPM_NO_NV_PERMISSION = 0xC0290038, - MD_NTSTATUS_WIN_STATUS_TPM_REQUIRES_SIGN = 0xC0290039, - MD_NTSTATUS_WIN_STATUS_TPM_KEY_NOTSUPPORTED = 0xC029003A, - MD_NTSTATUS_WIN_STATUS_TPM_AUTH_CONFLICT = 0xC029003B, - MD_NTSTATUS_WIN_STATUS_TPM_AREA_LOCKED = 0xC029003C, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_LOCALITY = 0xC029003D, - MD_NTSTATUS_WIN_STATUS_TPM_READ_ONLY = 0xC029003E, - MD_NTSTATUS_WIN_STATUS_TPM_PER_NOWRITE = 0xC029003F, - MD_NTSTATUS_WIN_STATUS_TPM_FAMILYCOUNT = 0xC0290040, - MD_NTSTATUS_WIN_STATUS_TPM_WRITE_LOCKED = 0xC0290041, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_ATTRIBUTES = 0xC0290042, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_STRUCTURE = 0xC0290043, - MD_NTSTATUS_WIN_STATUS_TPM_KEY_OWNER_CONTROL = 0xC0290044, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_COUNTER = 0xC0290045, - MD_NTSTATUS_WIN_STATUS_TPM_NOT_FULLWRITE = 0xC0290046, - MD_NTSTATUS_WIN_STATUS_TPM_CONTEXT_GAP = 0xC0290047, - MD_NTSTATUS_WIN_STATUS_TPM_MAXNVWRITES = 0xC0290048, - MD_NTSTATUS_WIN_STATUS_TPM_NOOPERATOR = 0xC0290049, - MD_NTSTATUS_WIN_STATUS_TPM_RESOURCEMISSING = 0xC029004A, - MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_LOCK = 0xC029004B, - MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_FAMILY = 0xC029004C, - MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_ADMIN = 0xC029004D, - MD_NTSTATUS_WIN_STATUS_TPM_TRANSPORT_NOTEXCLUSIVE = 0xC029004E, - MD_NTSTATUS_WIN_STATUS_TPM_OWNER_CONTROL = 0xC029004F, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_RESOURCES = 0xC0290050, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA0 = 0xC0290051, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA1 = 0xC0290052, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_SETTINGS = 0xC0290053, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_TPM_SETTINGS = 0xC0290054, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_STAGE = 0xC0290055, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_VALIDITY = 0xC0290056, - MD_NTSTATUS_WIN_STATUS_TPM_DAA_WRONG_W = 0xC0290057, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_HANDLE = 0xC0290058, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_DELEGATE = 0xC0290059, - MD_NTSTATUS_WIN_STATUS_TPM_BADCONTEXT = 0xC029005A, - MD_NTSTATUS_WIN_STATUS_TPM_TOOMANYCONTEXTS = 0xC029005B, - MD_NTSTATUS_WIN_STATUS_TPM_MA_TICKET_SIGNATURE = 0xC029005C, - MD_NTSTATUS_WIN_STATUS_TPM_MA_DESTINATION = 0xC029005D, - MD_NTSTATUS_WIN_STATUS_TPM_MA_SOURCE = 0xC029005E, - MD_NTSTATUS_WIN_STATUS_TPM_MA_AUTHORITY = 0xC029005F, - MD_NTSTATUS_WIN_STATUS_TPM_PERMANENTEK = 0xC0290061, - MD_NTSTATUS_WIN_STATUS_TPM_BAD_SIGNATURE = 0xC0290062, - MD_NTSTATUS_WIN_STATUS_TPM_NOCONTEXTSPACE = 0xC0290063, - MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_BLOCKED = 0xC0290400, - MD_NTSTATUS_WIN_STATUS_TPM_INVALID_HANDLE = 0xC0290401, - MD_NTSTATUS_WIN_STATUS_TPM_DUPLICATE_VHANDLE = 0xC0290402, - MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_BLOCKED = 0xC0290403, - MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED = 0xC0290404, - MD_NTSTATUS_WIN_STATUS_TPM_RETRY = 0xC0290800, - MD_NTSTATUS_WIN_STATUS_TPM_NEEDS_SELFTEST = 0xC0290801, - MD_NTSTATUS_WIN_STATUS_TPM_DOING_SELFTEST = 0xC0290802, - MD_NTSTATUS_WIN_STATUS_TPM_DEFEND_LOCK_RUNNING = 0xC0290803, - MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_CANCELED = 0xC0291001, - MD_NTSTATUS_WIN_STATUS_TPM_TOO_MANY_CONTEXTS = 0xC0291002, - MD_NTSTATUS_WIN_STATUS_TPM_NOT_FOUND = 0xC0291003, - MD_NTSTATUS_WIN_STATUS_TPM_ACCESS_DENIED = 0xC0291004, - MD_NTSTATUS_WIN_STATUS_TPM_INSUFFICIENT_BUFFER = 0xC0291005, - MD_NTSTATUS_WIN_STATUS_TPM_PPI_FUNCTION_UNSUPPORTED = 0xC0291006, - MD_NTSTATUS_WIN_STATUS_PCP_ERROR_MASK = 0xC0292000, - MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_READY = 0xC0292001, - MD_NTSTATUS_WIN_STATUS_PCP_INVALID_HANDLE = 0xC0292002, - MD_NTSTATUS_WIN_STATUS_PCP_INVALID_PARAMETER = 0xC0292003, - MD_NTSTATUS_WIN_STATUS_PCP_FLAG_NOT_SUPPORTED = 0xC0292004, - MD_NTSTATUS_WIN_STATUS_PCP_NOT_SUPPORTED = 0xC0292005, - MD_NTSTATUS_WIN_STATUS_PCP_BUFFER_TOO_SMALL = 0xC0292006, - MD_NTSTATUS_WIN_STATUS_PCP_INTERNAL_ERROR = 0xC0292007, - MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_FAILED = 0xC0292008, - MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_IGNORED = 0xC0292009, - MD_NTSTATUS_WIN_STATUS_PCP_POLICY_NOT_FOUND = 0xC029200A, - MD_NTSTATUS_WIN_STATUS_PCP_PROFILE_NOT_FOUND = 0xC029200B, - MD_NTSTATUS_WIN_STATUS_PCP_VALIDATION_FAILED = 0xC029200C, - MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_FOUND = 0xC029200D, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_CODE = 0xC0350002, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_INPUT = 0xC0350003, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_ALIGNMENT = 0xC0350004, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARAMETER = 0xC0350005, - MD_NTSTATUS_WIN_STATUS_HV_ACCESS_DENIED = 0xC0350006, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_STATE = 0xC0350007, - MD_NTSTATUS_WIN_STATUS_HV_OPERATION_DENIED = 0xC0350008, - MD_NTSTATUS_WIN_STATUS_HV_UNKNOWN_PROPERTY = 0xC0350009, - MD_NTSTATUS_WIN_STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE = 0xC035000A, - MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_MEMORY = 0xC035000B, - MD_NTSTATUS_WIN_STATUS_HV_PARTITION_TOO_DEEP = 0xC035000C, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_ID = 0xC035000D, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_VP_INDEX = 0xC035000E, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_PORT_ID = 0xC0350011, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_CONNECTION_ID = 0xC0350012, - MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFERS = 0xC0350013, - MD_NTSTATUS_WIN_STATUS_HV_NOT_ACKNOWLEDGED = 0xC0350014, - MD_NTSTATUS_WIN_STATUS_HV_ACKNOWLEDGED = 0xC0350016, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_SAVE_RESTORE_STATE = 0xC0350017, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_SYNIC_STATE = 0xC0350018, - MD_NTSTATUS_WIN_STATUS_HV_OBJECT_IN_USE = 0xC0350019, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO = 0xC035001A, - MD_NTSTATUS_WIN_STATUS_HV_NO_DATA = 0xC035001B, - MD_NTSTATUS_WIN_STATUS_HV_INACTIVE = 0xC035001C, - MD_NTSTATUS_WIN_STATUS_HV_NO_RESOURCES = 0xC035001D, - MD_NTSTATUS_WIN_STATUS_HV_FEATURE_UNAVAILABLE = 0xC035001E, - MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFER = 0xC0350033, - MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS = 0xC0350038, - MD_NTSTATUS_WIN_STATUS_HV_INVALID_LP_INDEX = 0xC0350041, - MD_NTSTATUS_WIN_STATUS_HV_NOT_PRESENT = 0xC0351000, - MD_NTSTATUS_WIN_STATUS_IPSEC_BAD_SPI = 0xC0360001, - MD_NTSTATUS_WIN_STATUS_IPSEC_SA_LIFETIME_EXPIRED = 0xC0360002, - MD_NTSTATUS_WIN_STATUS_IPSEC_WRONG_SA = 0xC0360003, - MD_NTSTATUS_WIN_STATUS_IPSEC_REPLAY_CHECK_FAILED = 0xC0360004, - MD_NTSTATUS_WIN_STATUS_IPSEC_INVALID_PACKET = 0xC0360005, - MD_NTSTATUS_WIN_STATUS_IPSEC_INTEGRITY_CHECK_FAILED = 0xC0360006, - MD_NTSTATUS_WIN_STATUS_IPSEC_CLEAR_TEXT_DROP = 0xC0360007, - MD_NTSTATUS_WIN_STATUS_IPSEC_AUTH_FIREWALL_DROP = 0xC0360008, - MD_NTSTATUS_WIN_STATUS_IPSEC_THROTTLE_DROP = 0xC0360009, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_BLOCK = 0xC0368000, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_RECEIVED_MULTICAST = 0xC0368001, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_INVALID_PACKET = 0xC0368002, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED = 0xC0368003, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_ENTRIES = 0xC0368004, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED = 0xC0368005, - MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES = 0xC0368006, - MD_NTSTATUS_WIN_STATUS_VID_DUPLICATE_HANDLER = 0xC0370001, - MD_NTSTATUS_WIN_STATUS_VID_TOO_MANY_HANDLERS = 0xC0370002, - MD_NTSTATUS_WIN_STATUS_VID_QUEUE_FULL = 0xC0370003, - MD_NTSTATUS_WIN_STATUS_VID_HANDLER_NOT_PRESENT = 0xC0370004, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_OBJECT_NAME = 0xC0370005, - MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_TOO_LONG = 0xC0370006, - MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG = 0xC0370007, - MD_NTSTATUS_WIN_STATUS_VID_PARTITION_ALREADY_EXISTS = 0xC0370008, - MD_NTSTATUS_WIN_STATUS_VID_PARTITION_DOES_NOT_EXIST = 0xC0370009, - MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_NOT_FOUND = 0xC037000A, - MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS = 0xC037000B, - MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT = 0xC037000C, - MD_NTSTATUS_WIN_STATUS_VID_MB_STILL_REFERENCED = 0xC037000D, - MD_NTSTATUS_WIN_STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED = 0xC037000E, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_SETTINGS = 0xC037000F, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_NODE_INDEX = 0xC0370010, - MD_NTSTATUS_WIN_STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED = 0xC0370011, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE = 0xC0370012, - MD_NTSTATUS_WIN_STATUS_VID_PAGE_RANGE_OVERFLOW = 0xC0370013, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE = 0xC0370014, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_GPA_RANGE_HANDLE = 0xC0370015, - MD_NTSTATUS_WIN_STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE = 0xC0370016, - MD_NTSTATUS_WIN_STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED = 0xC0370017, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_PPM_HANDLE = 0xC0370018, - MD_NTSTATUS_WIN_STATUS_VID_MBPS_ARE_LOCKED = 0xC0370019, - MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_CLOSED = 0xC037001A, - MD_NTSTATUS_WIN_STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED = 0xC037001B, - MD_NTSTATUS_WIN_STATUS_VID_STOP_PENDING = 0xC037001C, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_PROCESSOR_STATE = 0xC037001D, - MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT = 0xC037001E, - MD_NTSTATUS_WIN_STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED = 0xC037001F, - MD_NTSTATUS_WIN_STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET = 0xC0370020, - MD_NTSTATUS_WIN_STATUS_VID_MMIO_RANGE_DESTROYED = 0xC0370021, - MD_NTSTATUS_WIN_STATUS_VID_INVALID_CHILD_GPA_PAGE_SET = 0xC0370022, - MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED = 0xC0370023, - MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL = 0xC0370024, - MD_NTSTATUS_WIN_STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE = 0xC0370025, - MD_NTSTATUS_WIN_STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT = 0xC0370026, - MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_CORRUPT = 0xC0370027, - MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM = 0xC0370028, - MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_INCOMPATIBLE = 0xC0370029, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DATABASE_FULL = 0xC0380001, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED = 0xC0380002, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC = 0xC0380003, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED = 0xC0380004, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME = 0xC0380005, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DUPLICATE = 0xC0380006, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DYNAMIC = 0xC0380007, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_ID_INVALID = 0xC0380008, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_INVALID = 0xC0380009, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAST_VOTER = 0xC038000A, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_INVALID = 0xC038000B, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS = 0xC038000C, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED = 0xC038000D, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL = 0xC038000E, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS = 0xC038000F, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS = 0xC0380010, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_MISSING = 0xC0380011, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_EMPTY = 0xC0380012, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE = 0xC0380013, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_REVECTORING_FAILED = 0xC0380014, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID = 0xC0380015, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SET_NOT_CONTAINED = 0xC0380016, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS = 0xC0380017, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES = 0xC0380018, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED = 0xC0380019, - MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_ALREADY_USED = 0xC038001A, - MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS = 0xC038001B, - MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION = 0xC038001C, - MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED = 0xC038001D, - MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION = 0xC038001E, - MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH = 0xC038001F, - MD_NTSTATUS_WIN_STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED = 0xC0380020, - MD_NTSTATUS_WIN_STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID = 0xC0380021, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS = 0xC0380022, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_IN_SYNC = 0xC0380023, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE = 0xC0380024, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_INVALID = 0xC0380025, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_MISSING = 0xC0380026, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_NOT_DETACHED = 0xC0380027, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_REGENERATING = 0xC0380028, - MD_NTSTATUS_WIN_STATUS_VOLMGR_ALL_DISKS_FAILED = 0xC0380029, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_REGISTERED_USERS = 0xC038002A, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_SUCH_USER = 0xC038002B, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NOTIFICATION_RESET = 0xC038002C, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID = 0xC038002D, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID = 0xC038002E, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_DUPLICATE = 0xC038002F, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_ID_INVALID = 0xC0380030, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_INVALID = 0xC0380031, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_NAME_INVALID = 0xC0380032, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_OFFLINE = 0xC0380033, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_HAS_QUORUM = 0xC0380034, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_WITHOUT_QUORUM = 0xC0380035, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_STYLE_INVALID = 0xC0380036, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_UPDATE_FAILED = 0xC0380037, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_IN_SYNC = 0xC0380038, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_DUPLICATE = 0xC0380039, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_INVALID = 0xC038003A, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_LAST_ACTIVE = 0xC038003B, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_MISSING = 0xC038003C, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_REGENERATING = 0xC038003D, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_TYPE_INVALID = 0xC038003E, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_RAID5 = 0xC038003F, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE = 0xC0380040, - MD_NTSTATUS_WIN_STATUS_VOLMGR_STRUCTURE_SIZE_INVALID = 0xC0380041, - MD_NTSTATUS_WIN_STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS = 0xC0380042, - MD_NTSTATUS_WIN_STATUS_VOLMGR_TRANSACTION_IN_PROGRESS = 0xC0380043, - MD_NTSTATUS_WIN_STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE = 0xC0380044, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK = 0xC0380045, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_ID_INVALID = 0xC0380046, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_INVALID = 0xC0380047, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE = 0xC0380048, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_MIRRORED = 0xC0380049, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_RETAINED = 0xC038004A, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_OFFLINE = 0xC038004B, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_RETAINED = 0xC038004C, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID = 0xC038004D, - MD_NTSTATUS_WIN_STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE = 0xC038004E, - MD_NTSTATUS_WIN_STATUS_VOLMGR_BAD_BOOT_DISK = 0xC038004F, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_OFFLINE = 0xC0380050, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_ONLINE = 0xC0380051, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NOT_PRIMARY_PACK = 0xC0380052, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED = 0xC0380053, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID = 0xC0380054, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID = 0xC0380055, - MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_MIRRORED = 0xC0380056, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED = 0xC0380057, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_VALID_LOG_COPIES = 0xC0380058, - MD_NTSTATUS_WIN_STATUS_VOLMGR_PRIMARY_PACK_PRESENT = 0xC0380059, - MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID = 0xC038005A, - MD_NTSTATUS_WIN_STATUS_VOLMGR_MIRROR_NOT_SUPPORTED = 0xC038005B, - MD_NTSTATUS_WIN_STATUS_VOLMGR_RAID5_NOT_SUPPORTED = 0xC038005C, - MD_NTSTATUS_WIN_STATUS_BCD_TOO_MANY_ELEMENTS = 0xC0390002, - MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_MISSING = 0xC03A0001, - MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH = 0xC03A0002, - MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CORRUPT = 0xC03A0003, - MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNKNOWN = 0xC03A0004, - MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNSUPPORTED_VERSION = 0xC03A0005, - MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH = 0xC03A0006, - MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION = 0xC03A0007, - MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CORRUPT = 0xC03A0008, - MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_FAILURE = 0xC03A0009, - MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT = 0xC03A000A, - MD_NTSTATUS_WIN_STATUS_VHD_INVALID_BLOCK_SIZE = 0xC03A000B, - MD_NTSTATUS_WIN_STATUS_VHD_BITMAP_MISMATCH = 0xC03A000C, - MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_NOT_FOUND = 0xC03A000D, - MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_ID_MISMATCH = 0xC03A000E, - MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH = 0xC03A000F, - MD_NTSTATUS_WIN_STATUS_VHD_METADATA_READ_FAILURE = 0xC03A0010, - MD_NTSTATUS_WIN_STATUS_VHD_METADATA_WRITE_FAILURE = 0xC03A0011, - MD_NTSTATUS_WIN_STATUS_VHD_INVALID_SIZE = 0xC03A0012, - MD_NTSTATUS_WIN_STATUS_VHD_INVALID_FILE_SIZE = 0xC03A0013, - MD_NTSTATUS_WIN_STATUS_VIRTDISK_PROVIDER_NOT_FOUND = 0xC03A0014, - MD_NTSTATUS_WIN_STATUS_VIRTDISK_NOT_VIRTUAL_DISK = 0xC03A0015, - MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_ACCESS_DENIED = 0xC03A0016, - MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH = 0xC03A0017, - MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED = 0xC03A0018, - MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT = 0xC03A0019, - MD_NTSTATUS_WIN_STATUS_VIRTUAL_DISK_LIMITATION = 0xC03A001A, - MD_NTSTATUS_WIN_STATUS_VHD_INVALID_TYPE = 0xC03A001B, - MD_NTSTATUS_WIN_STATUS_VHD_INVALID_STATE = 0xC03A001C, - MD_NTSTATUS_WIN_STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE = 0xC03A001D, - MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ALREADY_OWNED = 0xC03A001E, - MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE = 0xC03A001F, - MD_NTSTATUS_WIN_STATUS_CTLOG_TRACKING_NOT_INITIALIZED = 0xC03A0020, - MD_NTSTATUS_WIN_STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE = 0xC03A0021, - MD_NTSTATUS_WIN_STATUS_CTLOG_VHD_CHANGED_OFFLINE = 0xC03A0022, - MD_NTSTATUS_WIN_STATUS_CTLOG_INVALID_TRACKING_STATE = 0xC03A0023, - MD_NTSTATUS_WIN_STATUS_CTLOG_INCONSISTENT_TRACKING_FILE = 0xC03A0024, - MD_NTSTATUS_WIN_STATUS_VHD_METADATA_FULL = 0xC03A0028, - MD_NTSTATUS_WIN_STATUS_RKF_KEY_NOT_FOUND = 0xC0400001, - MD_NTSTATUS_WIN_STATUS_RKF_DUPLICATE_KEY = 0xC0400002, - MD_NTSTATUS_WIN_STATUS_RKF_BLOB_FULL = 0xC0400003, - MD_NTSTATUS_WIN_STATUS_RKF_STORE_FULL = 0xC0400004, - MD_NTSTATUS_WIN_STATUS_RKF_FILE_BLOCKED = 0xC0400005, - MD_NTSTATUS_WIN_STATUS_RKF_ACTIVE_KEY = 0xC0400006, - MD_NTSTATUS_WIN_STATUS_RDBSS_RESTART_OPERATION = 0xC0410001, - MD_NTSTATUS_WIN_STATUS_RDBSS_CONTINUE_OPERATION = 0xC0410002, - MD_NTSTATUS_WIN_STATUS_RDBSS_POST_OPERATION = 0xC0410003, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_HANDLE = 0xC0420001, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_READ_NOT_PERMITTED = 0xC0420002, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_WRITE_NOT_PERMITTED = 0xC0420003, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_PDU = 0xC0420004, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION = 0xC0420005, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED = 0xC0420006, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_OFFSET = 0xC0420007, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION = 0xC0420008, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_PREPARE_QUEUE_FULL = 0xC0420009, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND = 0xC042000A, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG = 0xC042000B, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0xC042000C, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH = 0xC042000D, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNLIKELY = 0xC042000E, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION = 0xC042000F, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE = 0xC0420010, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_RESOURCES = 0xC0420011, - MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNKNOWN_ERROR = 0xC0421000, - MD_NTSTATUS_WIN_STATUS_SECUREBOOT_ROLLBACK_DETECTED = 0xC0430001, - MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_VIOLATION = 0xC0430002, - MD_NTSTATUS_WIN_STATUS_SECUREBOOT_INVALID_POLICY = 0xC0430003, - MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND = 0xC0430004, - MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_NOT_SIGNED = 0xC0430005, - MD_NTSTATUS_WIN_STATUS_SECUREBOOT_FILE_REPLACED = 0xC0430007, - MD_NTSTATUS_WIN_STATUS_AUDIO_ENGINE_NODE_NOT_FOUND = 0xC0440001, - MD_NTSTATUS_WIN_STATUS_HDAUDIO_EMPTY_CONNECTION_LIST = 0xC0440002, - MD_NTSTATUS_WIN_STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED = 0xC0440003, - MD_NTSTATUS_WIN_STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED = 0xC0440004, - MD_NTSTATUS_WIN_STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY = 0xC0440005, - MD_NTSTATUS_WIN_STATUS_VOLSNAP_BOOTFILE_NOT_VALID = 0xC0500003, - MD_NTSTATUS_WIN_STATUS_IO_PREEMPTED = 0xC0510001, - MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_STORED = 0xC05C0000, - MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_NOT_AVAILABLE = 0xC05CFF00, - MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE = 0xC05CFF01, - MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED = 0xC05CFF02, - MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED = 0xC05CFF03, - MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED = 0xC05CFF04, - MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED = 0xC05CFF05, - MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED = 0xC05CFF06, - MD_NTSTATUS_WIN_STATUS_SVHDX_RESERVATION_CONFLICT = 0xC05CFF07, - MD_NTSTATUS_WIN_STATUS_SVHDX_WRONG_FILE_TYPE = 0xC05CFF08, - MD_NTSTATUS_WIN_STATUS_SVHDX_VERSION_MISMATCH = 0xC05CFF09, - MD_NTSTATUS_WIN_STATUS_VHD_SHARED = 0xC05CFF0A, - MD_NTSTATUS_WIN_STATUS_SPACES_RESILIENCY_TYPE_INVALID = 0xC0E70003, - MD_NTSTATUS_WIN_STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID = 0xC0E70004, - MD_NTSTATUS_WIN_STATUS_SPACES_INTERLEAVE_LENGTH_INVALID = 0xC0E70009, - MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID = 0xC0E7000A, - MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES = 0xC0E7000B -} MDNTStatusCodeWin; - -// These constants are defined in the MSDN documentation of -// the EXCEPTION_RECORD structure. -typedef enum { - MD_ACCESS_VIOLATION_WIN_READ = 0, - MD_ACCESS_VIOLATION_WIN_WRITE = 1, - MD_ACCESS_VIOLATION_WIN_EXEC = 8 -} MDAccessViolationTypeWin; - -// These constants are defined in the MSDN documentation of -// the EXCEPTION_RECORD structure. -typedef enum { - MD_IN_PAGE_ERROR_WIN_READ = 0, - MD_IN_PAGE_ERROR_WIN_WRITE = 1, - MD_IN_PAGE_ERROR_WIN_EXEC = 8 -} MDInPageErrorTypeWin; - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h deleted file mode 100644 index 17a5abba33..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_format.h +++ /dev/null @@ -1,972 +0,0 @@ -/* Copyright (c) 2006, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* minidump_format.h: A cross-platform reimplementation of minidump-related - * portions of DbgHelp.h from the Windows Platform SDK. - * - * (This is C99 source, please don't corrupt it with C++.) - * - * Structures that are defined by Microsoft to contain a zero-length array - * are instead defined here to contain an array with one element, as - * zero-length arrays are forbidden by standard C and C++. In these cases, - * *_minsize constants are provided to be used in place of sizeof. For a - * cleaner interface to these sizes when using C++, see minidump_size.h. - * - * These structures are also sufficient to populate minidump files. - * - * These definitions may be extended to support handling minidump files - * for other CPUs and other operating systems. - * - * Because precise data type sizes are crucial for this implementation to - * function properly and portably in terms of interoperability with minidumps - * produced by DbgHelp on Windows, a set of primitive types with known sizes - * are used as the basis of each structure defined by this file. DbgHelp - * on Windows is assumed to be the reference implementation; this file - * seeks to provide a cross-platform compatible implementation. To avoid - * collisions with the types and values defined and used by DbgHelp in the - * event that this implementation is used on Windows, each type and value - * defined here is given a new name, beginning with "MD". Names of the - * equivalent types and values in the Windows Platform SDK are given in - * comments. - * - * Author: Mark Mentovai */ - - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ - -#include - -#include "google_breakpad/common/breakpad_types.h" - - -#if defined(_MSC_VER) -/* Disable "zero-sized array in struct/union" warnings when compiling in - * MSVC. DbgHelp.h does this too. */ -#pragma warning(push) -#pragma warning(disable:4200) -#endif /* _MSC_VER */ - - -/* - * guiddef.h - */ - -typedef struct { - uint32_t data1; - uint16_t data2; - uint16_t data3; - uint8_t data4[8]; -} MDGUID; /* GUID */ - - -/* - * WinNT.h - */ - -/* Non-x86 CPU identifiers found in the high 24 bits of - * (MDRawContext*).context_flags. These aren't used by Breakpad, but are - * defined here for reference, to avoid assigning values that conflict - * (although some values already conflict). */ -#define MD_CONTEXT_IA64 0x00080000 /* CONTEXT_IA64 */ -/* Additional values from winnt.h in the Windows CE 5.0 SDK: */ -#define MD_CONTEXT_SHX 0x000000c0 /* CONTEXT_SH4 (Super-H, includes SH3) */ -#define MD_CONTEXT_ALPHA 0x00020000 /* CONTEXT_ALPHA */ - -/* As of Windows 7 SP1, the number of flag bits has increased to - * include 0x40 (CONTEXT_XSTATE): - * http://msdn.microsoft.com/en-us/library/hh134238%28v=vs.85%29.aspx */ -#define MD_CONTEXT_CPU_MASK 0xffffff00 - - -/* This is a base type for MDRawContextX86 and MDRawContextPPC. This - * structure should never be allocated directly. The actual structure type - * can be determined by examining the context_flags field. */ -typedef struct { - uint32_t context_flags; -} MDRawContextBase; - -#include "minidump_cpu_amd64.h" -#include "minidump_cpu_arm.h" -#include "minidump_cpu_arm64.h" -#include "minidump_cpu_mips.h" -#include "minidump_cpu_ppc.h" -#include "minidump_cpu_ppc64.h" -#include "minidump_cpu_sparc.h" -#include "minidump_cpu_x86.h" - -/* - * WinVer.h - */ - - -typedef struct { - uint32_t signature; - uint32_t struct_version; - uint32_t file_version_hi; - uint32_t file_version_lo; - uint32_t product_version_hi; - uint32_t product_version_lo; - uint32_t file_flags_mask; /* Identifies valid bits in fileFlags */ - uint32_t file_flags; - uint32_t file_os; - uint32_t file_type; - uint32_t file_subtype; - uint32_t file_date_hi; - uint32_t file_date_lo; -} MDVSFixedFileInfo; /* VS_FIXEDFILEINFO */ - -/* For (MDVSFixedFileInfo).signature */ -#define MD_VSFIXEDFILEINFO_SIGNATURE 0xfeef04bd - /* VS_FFI_SIGNATURE */ - -/* For (MDVSFixedFileInfo).version */ -#define MD_VSFIXEDFILEINFO_VERSION 0x00010000 - /* VS_FFI_STRUCVERSION */ - -/* For (MDVSFixedFileInfo).file_flags_mask and - * (MDVSFixedFileInfo).file_flags */ -#define MD_VSFIXEDFILEINFO_FILE_FLAGS_DEBUG 0x00000001 - /* VS_FF_DEBUG */ -#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PRERELEASE 0x00000002 - /* VS_FF_PRERELEASE */ -#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PATCHED 0x00000004 - /* VS_FF_PATCHED */ -#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PRIVATEBUILD 0x00000008 - /* VS_FF_PRIVATEBUILD */ -#define MD_VSFIXEDFILEINFO_FILE_FLAGS_INFOINFERRED 0x00000010 - /* VS_FF_INFOINFERRED */ -#define MD_VSFIXEDFILEINFO_FILE_FLAGS_SPECIALBUILD 0x00000020 - /* VS_FF_SPECIALBUILD */ - -/* For (MDVSFixedFileInfo).file_os: high 16 bits */ -#define MD_VSFIXEDFILEINFO_FILE_OS_UNKNOWN 0 /* VOS_UNKNOWN */ -#define MD_VSFIXEDFILEINFO_FILE_OS_DOS (1 << 16) /* VOS_DOS */ -#define MD_VSFIXEDFILEINFO_FILE_OS_OS216 (2 << 16) /* VOS_OS216 */ -#define MD_VSFIXEDFILEINFO_FILE_OS_OS232 (3 << 16) /* VOS_OS232 */ -#define MD_VSFIXEDFILEINFO_FILE_OS_NT (4 << 16) /* VOS_NT */ -#define MD_VSFIXEDFILEINFO_FILE_OS_WINCE (5 << 16) /* VOS_WINCE */ -/* Low 16 bits */ -#define MD_VSFIXEDFILEINFO_FILE_OS__BASE 0 /* VOS__BASE */ -#define MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS16 1 /* VOS__WINDOWS16 */ -#define MD_VSFIXEDFILEINFO_FILE_OS__PM16 2 /* VOS__PM16 */ -#define MD_VSFIXEDFILEINFO_FILE_OS__PM32 3 /* VOS__PM32 */ -#define MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS32 4 /* VOS__WINDOWS32 */ - -/* For (MDVSFixedFileInfo).file_type */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_UNKNOWN 0 /* VFT_UNKNOWN */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_APP 1 /* VFT_APP */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_DLL 2 /* VFT_DLL */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_DRV 3 /* VFT_DLL */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_FONT 4 /* VFT_FONT */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_VXD 5 /* VFT_VXD */ -#define MD_VSFIXEDFILEINFO_FILE_TYPE_STATIC_LIB 7 /* VFT_STATIC_LIB */ - -/* For (MDVSFixedFileInfo).file_subtype */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_UNKNOWN 0 - /* VFT2_UNKNOWN */ -/* with file_type = MD_VSFIXEDFILEINFO_FILETYPE_DRV */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_PRINTER 1 - /* VFT2_DRV_PRINTER */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_KEYBOARD 2 - /* VFT2_DRV_KEYBOARD */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_LANGUAGE 3 - /* VFT2_DRV_LANGUAGE */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_DISPLAY 4 - /* VFT2_DRV_DISPLAY */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_MOUSE 5 - /* VFT2_DRV_MOUSE */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_NETWORK 6 - /* VFT2_DRV_NETWORK */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_SYSTEM 7 - /* VFT2_DRV_SYSTEM */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_INSTALLABLE 8 - /* VFT2_DRV_INSTALLABLE */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_SOUND 9 - /* VFT2_DRV_SOUND */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_COMM 10 - /* VFT2_DRV_COMM */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_INPUTMETHOD 11 - /* VFT2_DRV_INPUTMETHOD */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_VERSIONED_PRINTER 12 - /* VFT2_DRV_VERSIONED_PRINTER */ -/* with file_type = MD_VSFIXEDFILEINFO_FILETYPE_FONT */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_RASTER 1 - /* VFT2_FONT_RASTER */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_VECTOR 2 - /* VFT2_FONT_VECTOR */ -#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_TRUETYPE 3 - /* VFT2_FONT_TRUETYPE */ - - -/* - * DbgHelp.h - */ - - -/* An MDRVA is an offset into the minidump file. The beginning of the - * MDRawHeader is at offset 0. */ -typedef uint32_t MDRVA; /* RVA */ - -typedef struct { - uint32_t data_size; - MDRVA rva; -} MDLocationDescriptor; /* MINIDUMP_LOCATION_DESCRIPTOR */ - - -typedef struct { - /* The base address of the memory range on the host that produced the - * minidump. */ - uint64_t start_of_memory_range; - - MDLocationDescriptor memory; -} MDMemoryDescriptor; /* MINIDUMP_MEMORY_DESCRIPTOR */ - - -typedef struct { - uint32_t signature; - uint32_t version; - uint32_t stream_count; - MDRVA stream_directory_rva; /* A |stream_count|-sized array of - * MDRawDirectory structures. */ - uint32_t checksum; /* Can be 0. In fact, that's all that's - * been found in minidump files. */ - uint32_t time_date_stamp; /* time_t */ - uint64_t flags; -} MDRawHeader; /* MINIDUMP_HEADER */ - -/* For (MDRawHeader).signature and (MDRawHeader).version. Note that only the - * low 16 bits of (MDRawHeader).version are MD_HEADER_VERSION. Per the - * documentation, the high 16 bits are implementation-specific. */ -#define MD_HEADER_SIGNATURE 0x504d444d /* 'PMDM' */ - /* MINIDUMP_SIGNATURE */ -#define MD_HEADER_VERSION 0x0000a793 /* 42899 */ - /* MINIDUMP_VERSION */ - -/* For (MDRawHeader).flags: */ -typedef enum { - /* MD_NORMAL is the standard type of minidump. It includes full - * streams for the thread list, module list, exception, system info, - * and miscellaneous info. A memory list stream is also present, - * pointing to the same stack memory contained in the thread list, - * as well as a 256-byte region around the instruction address that - * was executing when the exception occurred. Stack memory is from - * 4 bytes below a thread's stack pointer up to the top of the - * memory region encompassing the stack. */ - MD_NORMAL = 0x00000000, - MD_WITH_DATA_SEGS = 0x00000001, - MD_WITH_FULL_MEMORY = 0x00000002, - MD_WITH_HANDLE_DATA = 0x00000004, - MD_FILTER_MEMORY = 0x00000008, - MD_SCAN_MEMORY = 0x00000010, - MD_WITH_UNLOADED_MODULES = 0x00000020, - MD_WITH_INDIRECTLY_REFERENCED_MEMORY = 0x00000040, - MD_FILTER_MODULE_PATHS = 0x00000080, - MD_WITH_PROCESS_THREAD_DATA = 0x00000100, - MD_WITH_PRIVATE_READ_WRITE_MEMORY = 0x00000200, - MD_WITHOUT_OPTIONAL_DATA = 0x00000400, - MD_WITH_FULL_MEMORY_INFO = 0x00000800, - MD_WITH_THREAD_INFO = 0x00001000, - MD_WITH_CODE_SEGS = 0x00002000, - MD_WITHOUT_AUXILLIARY_SEGS = 0x00004000, - MD_WITH_FULL_AUXILLIARY_STATE = 0x00008000, - MD_WITH_PRIVATE_WRITE_COPY_MEMORY = 0x00010000, - MD_IGNORE_INACCESSIBLE_MEMORY = 0x00020000, - MD_WITH_TOKEN_INFORMATION = 0x00040000 -} MDType; /* MINIDUMP_TYPE */ - - -typedef struct { - uint32_t stream_type; - MDLocationDescriptor location; -} MDRawDirectory; /* MINIDUMP_DIRECTORY */ - -/* For (MDRawDirectory).stream_type */ -typedef enum { - MD_UNUSED_STREAM = 0, - MD_RESERVED_STREAM_0 = 1, - MD_RESERVED_STREAM_1 = 2, - MD_THREAD_LIST_STREAM = 3, /* MDRawThreadList */ - MD_MODULE_LIST_STREAM = 4, /* MDRawModuleList */ - MD_MEMORY_LIST_STREAM = 5, /* MDRawMemoryList */ - MD_EXCEPTION_STREAM = 6, /* MDRawExceptionStream */ - MD_SYSTEM_INFO_STREAM = 7, /* MDRawSystemInfo */ - MD_THREAD_EX_LIST_STREAM = 8, - MD_MEMORY_64_LIST_STREAM = 9, - MD_COMMENT_STREAM_A = 10, - MD_COMMENT_STREAM_W = 11, - MD_HANDLE_DATA_STREAM = 12, - MD_FUNCTION_TABLE_STREAM = 13, - MD_UNLOADED_MODULE_LIST_STREAM = 14, - MD_MISC_INFO_STREAM = 15, /* MDRawMiscInfo */ - MD_MEMORY_INFO_LIST_STREAM = 16, /* MDRawMemoryInfoList */ - MD_THREAD_INFO_LIST_STREAM = 17, - MD_HANDLE_OPERATION_LIST_STREAM = 18, - MD_LAST_RESERVED_STREAM = 0x0000ffff, - - /* Breakpad extension types. 0x4767 = "Gg" */ - MD_BREAKPAD_INFO_STREAM = 0x47670001, /* MDRawBreakpadInfo */ - MD_ASSERTION_INFO_STREAM = 0x47670002, /* MDRawAssertionInfo */ - /* These are additional minidump stream values which are specific to - * the linux breakpad implementation. */ - MD_LINUX_CPU_INFO = 0x47670003, /* /proc/cpuinfo */ - MD_LINUX_PROC_STATUS = 0x47670004, /* /proc/$x/status */ - MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */ - MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */ - MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */ - MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */ - MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */ - MD_LINUX_DSO_DEBUG = 0x4767000A /* MDRawDebug{32,64} */ -} MDStreamType; /* MINIDUMP_STREAM_TYPE */ - - -typedef struct { - uint32_t length; /* Length of buffer in bytes (not characters), - * excluding 0-terminator */ - uint16_t buffer[1]; /* UTF-16-encoded, 0-terminated */ -} MDString; /* MINIDUMP_STRING */ - -static const size_t MDString_minsize = offsetof(MDString, buffer[0]); - - -typedef struct { - uint32_t thread_id; - uint32_t suspend_count; - uint32_t priority_class; - uint32_t priority; - uint64_t teb; /* Thread environment block */ - MDMemoryDescriptor stack; - MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ -} MDRawThread; /* MINIDUMP_THREAD */ - - -typedef struct { - uint32_t number_of_threads; - MDRawThread threads[1]; -} MDRawThreadList; /* MINIDUMP_THREAD_LIST */ - -static const size_t MDRawThreadList_minsize = offsetof(MDRawThreadList, - threads[0]); - - -typedef struct { - uint64_t base_of_image; - uint32_t size_of_image; - uint32_t checksum; /* 0 if unknown */ - uint32_t time_date_stamp; /* time_t */ - MDRVA module_name_rva; /* MDString, pathname or filename */ - MDVSFixedFileInfo version_info; - - /* The next field stores a CodeView record and is populated when a module's - * debug information resides in a PDB file. It identifies the PDB file. */ - MDLocationDescriptor cv_record; - - /* The next field is populated when a module's debug information resides - * in a DBG file. It identifies the DBG file. This field is effectively - * obsolete with modules built by recent toolchains. */ - MDLocationDescriptor misc_record; - - /* Alignment problem: reserved0 and reserved1 are defined by the platform - * SDK as 64-bit quantities. However, that results in a structure whose - * alignment is unpredictable on different CPUs and ABIs. If the ABI - * specifies full alignment of 64-bit quantities in structures (as ppc - * does), there will be padding between miscRecord and reserved0. If - * 64-bit quantities can be aligned on 32-bit boundaries (as on x86), - * this padding will not exist. (Note that the structure up to this point - * contains 1 64-bit member followed by 21 32-bit members.) - * As a workaround, reserved0 and reserved1 are instead defined here as - * four 32-bit quantities. This should be harmless, as there are - * currently no known uses for these fields. */ - uint32_t reserved0[2]; - uint32_t reserved1[2]; -} MDRawModule; /* MINIDUMP_MODULE */ - -/* The inclusion of a 64-bit type in MINIDUMP_MODULE forces the struct to - * be tail-padded out to a multiple of 64 bits under some ABIs (such as PPC). - * This doesn't occur on systems that don't tail-pad in this manner. Define - * this macro to be the usable size of the MDRawModule struct, and use it in - * place of sizeof(MDRawModule). */ -#define MD_MODULE_SIZE 108 - - -/* (MDRawModule).cv_record can reference MDCVInfoPDB20 or MDCVInfoPDB70. - * Ref.: http://www.debuginfo.com/articles/debuginfomatch.html - * MDCVInfoPDB70 is the expected structure type with recent toolchains. */ - -typedef struct { - uint32_t signature; - uint32_t offset; /* Offset to debug data (expect 0 in minidump) */ -} MDCVHeader; - -typedef struct { - MDCVHeader cv_header; - uint32_t signature; /* time_t debug information created */ - uint32_t age; /* revision of PDB file */ - uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file */ -} MDCVInfoPDB20; - -static const size_t MDCVInfoPDB20_minsize = offsetof(MDCVInfoPDB20, - pdb_file_name[0]); - -#define MD_CVINFOPDB20_SIGNATURE 0x3031424e /* cvHeader.signature = '01BN' */ - -typedef struct { - uint32_t cv_signature; - MDGUID signature; /* GUID, identifies PDB file */ - uint32_t age; /* Identifies incremental changes to PDB file */ - uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file, - * 0-terminated 8-bit character data (UTF-8?) */ -} MDCVInfoPDB70; - -static const size_t MDCVInfoPDB70_minsize = offsetof(MDCVInfoPDB70, - pdb_file_name[0]); - -#define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */ - -typedef struct { - uint32_t data1[2]; - uint32_t data2; - uint32_t data3; - uint32_t data4; - uint32_t data5[3]; - uint8_t extra[2]; -} MDCVInfoELF; - -/* In addition to the two CodeView record formats above, used for linking - * to external pdb files, it is possible for debugging data to be carried - * directly in the CodeView record itself. These signature values will - * be found in the first 4 bytes of the CodeView record. Additional values - * not commonly experienced in the wild are given by "Microsoft Symbol and - * Type Information", http://www.x86.org/ftp/manuals/tools/sym.pdf, section - * 7.2. An in-depth description of the CodeView 4.1 format is given by - * "Undocumented Windows 2000 Secrets", Windows 2000 Debugging Support/ - * Microsoft Symbol File Internals/CodeView Subsections, - * http://www.rawol.com/features/undocumented/sbs-w2k-1-windows-2000-debugging-support.pdf - */ -#define MD_CVINFOCV41_SIGNATURE 0x3930424e /* '90BN', CodeView 4.10. */ -#define MD_CVINFOCV50_SIGNATURE 0x3131424e /* '11BN', CodeView 5.0, - * MS C7-format (/Z7). */ - -#define MD_CVINFOUNKNOWN_SIGNATURE 0xffffffff /* An unlikely value. */ - -/* (MDRawModule).miscRecord can reference MDImageDebugMisc. The Windows - * structure is actually defined in WinNT.h. This structure is effectively - * obsolete with modules built by recent toolchains. */ - -typedef struct { - uint32_t data_type; /* IMAGE_DEBUG_TYPE_*, not defined here because - * this debug record type is mostly obsolete. */ - uint32_t length; /* Length of entire MDImageDebugMisc structure */ - uint8_t unicode; /* True if data is multibyte */ - uint8_t reserved[3]; - uint8_t data[1]; -} MDImageDebugMisc; /* IMAGE_DEBUG_MISC */ - -static const size_t MDImageDebugMisc_minsize = offsetof(MDImageDebugMisc, - data[0]); - - -typedef struct { - uint32_t number_of_modules; - MDRawModule modules[1]; -} MDRawModuleList; /* MINIDUMP_MODULE_LIST */ - -static const size_t MDRawModuleList_minsize = offsetof(MDRawModuleList, - modules[0]); - - -typedef struct { - uint32_t number_of_memory_ranges; - MDMemoryDescriptor memory_ranges[1]; -} MDRawMemoryList; /* MINIDUMP_MEMORY_LIST */ - -static const size_t MDRawMemoryList_minsize = offsetof(MDRawMemoryList, - memory_ranges[0]); - - -#define MD_EXCEPTION_MAXIMUM_PARAMETERS 15 - -typedef struct { - uint32_t exception_code; /* Windows: MDExceptionCodeWin, - * Mac OS X: MDExceptionMac, - * Linux: MDExceptionCodeLinux. */ - uint32_t exception_flags; /* Windows: 1 if noncontinuable, - Mac OS X: MDExceptionCodeMac. */ - uint64_t exception_record; /* Address (in the minidump-producing host's - * memory) of another MDException, for - * nested exceptions. */ - uint64_t exception_address; /* The address that caused the exception. - * Mac OS X: exception subcode (which is - * typically the address). */ - uint32_t number_parameters; /* Number of valid elements in - * exception_information. */ - uint32_t __align; - uint64_t exception_information[MD_EXCEPTION_MAXIMUM_PARAMETERS]; -} MDException; /* MINIDUMP_EXCEPTION */ - -#include "minidump_exception_linux.h" -#include "minidump_exception_mac.h" -#include "minidump_exception_ps3.h" -#include "minidump_exception_solaris.h" -#include "minidump_exception_win32.h" - -typedef struct { - uint32_t thread_id; /* Thread in which the exception - * occurred. Corresponds to - * (MDRawThread).thread_id. */ - uint32_t __align; - MDException exception_record; - MDLocationDescriptor thread_context; /* MDRawContext[CPU] */ -} MDRawExceptionStream; /* MINIDUMP_EXCEPTION_STREAM */ - - -typedef union { - struct { - uint32_t vendor_id[3]; /* cpuid 0: ebx, edx, ecx */ - uint32_t version_information; /* cpuid 1: eax */ - uint32_t feature_information; /* cpuid 1: edx */ - uint32_t amd_extended_cpu_features; /* cpuid 0x80000001, ebx */ - } x86_cpu_info; - struct { - uint32_t cpuid; - uint32_t elf_hwcaps; /* linux specific, 0 otherwise */ - } arm_cpu_info; - struct { - uint64_t processor_features[2]; - } other_cpu_info; -} MDCPUInformation; /* CPU_INFORMATION */ - -/* For (MDCPUInformation).arm_cpu_info.elf_hwcaps. - * This matches the Linux kernel definitions from */ -typedef enum { - MD_CPU_ARM_ELF_HWCAP_SWP = (1 << 0), - MD_CPU_ARM_ELF_HWCAP_HALF = (1 << 1), - MD_CPU_ARM_ELF_HWCAP_THUMB = (1 << 2), - MD_CPU_ARM_ELF_HWCAP_26BIT = (1 << 3), - MD_CPU_ARM_ELF_HWCAP_FAST_MULT = (1 << 4), - MD_CPU_ARM_ELF_HWCAP_FPA = (1 << 5), - MD_CPU_ARM_ELF_HWCAP_VFP = (1 << 6), - MD_CPU_ARM_ELF_HWCAP_EDSP = (1 << 7), - MD_CPU_ARM_ELF_HWCAP_JAVA = (1 << 8), - MD_CPU_ARM_ELF_HWCAP_IWMMXT = (1 << 9), - MD_CPU_ARM_ELF_HWCAP_CRUNCH = (1 << 10), - MD_CPU_ARM_ELF_HWCAP_THUMBEE = (1 << 11), - MD_CPU_ARM_ELF_HWCAP_NEON = (1 << 12), - MD_CPU_ARM_ELF_HWCAP_VFPv3 = (1 << 13), - MD_CPU_ARM_ELF_HWCAP_VFPv3D16 = (1 << 14), - MD_CPU_ARM_ELF_HWCAP_TLS = (1 << 15), - MD_CPU_ARM_ELF_HWCAP_VFPv4 = (1 << 16), - MD_CPU_ARM_ELF_HWCAP_IDIVA = (1 << 17), - MD_CPU_ARM_ELF_HWCAP_IDIVT = (1 << 18), -} MDCPUInformationARMElfHwCaps; - -typedef struct { - /* The next 3 fields and numberOfProcessors are from the SYSTEM_INFO - * structure as returned by GetSystemInfo */ - uint16_t processor_architecture; - uint16_t processor_level; /* x86: 5 = 586, 6 = 686, ... */ - /* ARM: 6 = ARMv6, 7 = ARMv7 ... */ - uint16_t processor_revision; /* x86: 0xMMSS, where MM=model, - * SS=stepping */ - /* ARM: 0 */ - - uint8_t number_of_processors; - uint8_t product_type; /* Windows: VER_NT_* from WinNT.h */ - - /* The next 5 fields are from the OSVERSIONINFO structure as returned - * by GetVersionEx */ - uint32_t major_version; - uint32_t minor_version; - uint32_t build_number; - uint32_t platform_id; - MDRVA csd_version_rva; /* MDString further identifying the - * host OS. - * Windows: name of the installed OS - * service pack. - * Mac OS X: the Apple OS build number - * (sw_vers -buildVersion). - * Linux: uname -srvmo */ - - uint16_t suite_mask; /* Windows: VER_SUITE_* from WinNT.h */ - uint16_t reserved2; - - MDCPUInformation cpu; -} MDRawSystemInfo; /* MINIDUMP_SYSTEM_INFO */ - -/* For (MDRawSystemInfo).processor_architecture: */ -typedef enum { - MD_CPU_ARCHITECTURE_X86 = 0, /* PROCESSOR_ARCHITECTURE_INTEL */ - MD_CPU_ARCHITECTURE_MIPS = 1, /* PROCESSOR_ARCHITECTURE_MIPS */ - MD_CPU_ARCHITECTURE_ALPHA = 2, /* PROCESSOR_ARCHITECTURE_ALPHA */ - MD_CPU_ARCHITECTURE_PPC = 3, /* PROCESSOR_ARCHITECTURE_PPC */ - MD_CPU_ARCHITECTURE_SHX = 4, /* PROCESSOR_ARCHITECTURE_SHX - * (Super-H) */ - MD_CPU_ARCHITECTURE_ARM = 5, /* PROCESSOR_ARCHITECTURE_ARM */ - MD_CPU_ARCHITECTURE_IA64 = 6, /* PROCESSOR_ARCHITECTURE_IA64 */ - MD_CPU_ARCHITECTURE_ALPHA64 = 7, /* PROCESSOR_ARCHITECTURE_ALPHA64 */ - MD_CPU_ARCHITECTURE_MSIL = 8, /* PROCESSOR_ARCHITECTURE_MSIL - * (Microsoft Intermediate Language) */ - MD_CPU_ARCHITECTURE_AMD64 = 9, /* PROCESSOR_ARCHITECTURE_AMD64 */ - MD_CPU_ARCHITECTURE_X86_WIN64 = 10, - /* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */ - MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */ - MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */ - MD_CPU_ARCHITECTURE_ARM64 = 0x8003, /* Breakpad-defined value for ARM64 */ - MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */ -} MDCPUArchitecture; - -/* For (MDRawSystemInfo).platform_id: */ -typedef enum { - MD_OS_WIN32S = 0, /* VER_PLATFORM_WIN32s (Windows 3.1) */ - MD_OS_WIN32_WINDOWS = 1, /* VER_PLATFORM_WIN32_WINDOWS (Windows 95-98-Me) */ - MD_OS_WIN32_NT = 2, /* VER_PLATFORM_WIN32_NT (Windows NT, 2000+) */ - MD_OS_WIN32_CE = 3, /* VER_PLATFORM_WIN32_CE, VER_PLATFORM_WIN32_HH - * (Windows CE, Windows Mobile, "Handheld") */ - - /* The following values are Breakpad-defined. */ - MD_OS_UNIX = 0x8000, /* Generic Unix-ish */ - MD_OS_MAC_OS_X = 0x8101, /* Mac OS X/Darwin */ - MD_OS_IOS = 0x8102, /* iOS */ - MD_OS_LINUX = 0x8201, /* Linux */ - MD_OS_SOLARIS = 0x8202, /* Solaris */ - MD_OS_ANDROID = 0x8203, /* Android */ - MD_OS_PS3 = 0x8204, /* PS3 */ - MD_OS_NACL = 0x8205 /* Native Client (NaCl) */ -} MDOSPlatform; - -typedef struct { - uint16_t year; - uint16_t month; - uint16_t day_of_week; - uint16_t day; - uint16_t hour; - uint16_t minute; - uint16_t second; - uint16_t milliseconds; -} MDSystemTime; /* SYSTEMTIME */ - -typedef struct { - /* Required field. The bias is the difference, in minutes, between - * Coordinated Universal Time (UTC) and local time. - * Formula: UTC = local time + bias */ - int32_t bias; - /* A description for standard time. For example, "EST" could indicate Eastern - * Standard Time. In practice this contains the full time zone names. This - * string can be empty. */ - uint16_t standard_name[32]; /* UTF-16-encoded, 0-terminated */ - /* A MDSystemTime structure that contains a date and local time when the - * transition from daylight saving time to standard time occurs on this - * operating system. If the time zone does not support daylight saving time, - * the month member in the MDSystemTime structure is zero. */ - MDSystemTime standard_date; - /* The bias value to be used during local time translations that occur during - * standard time. */ - int32_t standard_bias; - /* A description for daylight saving time. For example, "PDT" could indicate - * Pacific Daylight Time. In practice this contains the full time zone names. - * This string can be empty. */ - uint16_t daylight_name[32]; /* UTF-16-encoded, 0-terminated */ - /* A MDSystemTime structure that contains a date and local time when the - * transition from standard time to daylight saving time occurs on this - * operating system. If the time zone does not support daylight saving time, - * the month member in the MDSystemTime structure is zero.*/ - MDSystemTime daylight_date; - /* The bias value to be used during local time translations that occur during - * daylight saving time. */ - int32_t daylight_bias; -} MDTimeZoneInformation; /* TIME_ZONE_INFORMATION */ - -/* MAX_PATH from windef.h */ -#define MD_MAX_PATH 260 - -/* The miscellaneous information stream contains a variety - * of small pieces of information. A member is valid if - * it's within the available size and its corresponding - * bit is set. */ -typedef struct { - uint32_t size_of_info; /* Length of entire MDRawMiscInfo structure. */ - uint32_t flags1; - - /* The next field is only valid if flags1 contains - * MD_MISCINFO_FLAGS1_PROCESS_ID. */ - uint32_t process_id; - - /* The next 3 fields are only valid if flags1 contains - * MD_MISCINFO_FLAGS1_PROCESS_TIMES. */ - uint32_t process_create_time; /* time_t process started */ - uint32_t process_user_time; /* seconds of user CPU time */ - uint32_t process_kernel_time; /* seconds of kernel CPU time */ - - /* The following fields are not present in MINIDUMP_MISC_INFO but are - * in MINIDUMP_MISC_INFO_2. When this struct is populated, these values - * may not be set. Use flags1 and size_of_info to determine whether these - * values are present. These are only valid when flags1 contains - * MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO. */ - uint32_t processor_max_mhz; - uint32_t processor_current_mhz; - uint32_t processor_mhz_limit; - uint32_t processor_max_idle_state; - uint32_t processor_current_idle_state; - - /* The following fields are not present in MINIDUMP_MISC_INFO_2 but are - * in MINIDUMP_MISC_INFO_3. When this struct is populated, these values - * may not be set. Use flags1 and size_of_info to determine whether these - * values are present. */ - - /* The following field is only valid if flags1 contains - * MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY. */ - uint32_t process_integrity_level; - - /* The following field is only valid if flags1 contains - * MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS. */ - uint32_t process_execute_flags; - - /* The following field is only valid if flags1 contains - * MD_MISCINFO_FLAGS1_PROTECTED_PROCESS. */ - uint32_t protected_process; - - /* The following 2 fields are only valid if flags1 contains - * MD_MISCINFO_FLAGS1_TIMEZONE. */ - uint32_t time_zone_id; - MDTimeZoneInformation time_zone; - - /* The following fields are not present in MINIDUMP_MISC_INFO_3 but are - * in MINIDUMP_MISC_INFO_4. When this struct is populated, these values - * may not be set. Use flags1 and size_of_info to determine whether these - * values are present. */ - - /* The following 2 fields are only valid if flags1 contains - * MD_MISCINFO_FLAGS1_BUILDSTRING. */ - uint16_t build_string[MD_MAX_PATH]; /* UTF-16-encoded, 0-terminated */ - uint16_t dbg_bld_str[40]; /* UTF-16-encoded, 0-terminated */ -} MDRawMiscInfo; /* MINIDUMP_MISC_INFO, MINIDUMP_MISC_INFO_2, - * MINIDUMP_MISC_INFO_3, MINIDUMP_MISC_INFO_4, - * MINIDUMP_MISC_INFO_N */ - -static const size_t MD_MISCINFO_SIZE = - offsetof(MDRawMiscInfo, processor_max_mhz); -static const size_t MD_MISCINFO2_SIZE = - offsetof(MDRawMiscInfo, process_integrity_level); -static const size_t MD_MISCINFO3_SIZE = - offsetof(MDRawMiscInfo, build_string[0]); -static const size_t MD_MISCINFO4_SIZE = sizeof(MDRawMiscInfo); - -/* For (MDRawMiscInfo).flags1. These values indicate which fields in the - * MDRawMiscInfoStructure are valid. */ -typedef enum { - MD_MISCINFO_FLAGS1_PROCESS_ID = 0x00000001, - /* MINIDUMP_MISC1_PROCESS_ID */ - MD_MISCINFO_FLAGS1_PROCESS_TIMES = 0x00000002, - /* MINIDUMP_MISC1_PROCESS_TIMES */ - MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO = 0x00000004, - /* MINIDUMP_MISC1_PROCESSOR_POWER_INFO */ - MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY = 0x00000010, - /* MINIDUMP_MISC3_PROCESS_INTEGRITY */ - MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS = 0x00000020, - /* MINIDUMP_MISC3_PROCESS_EXECUTE_FLAGS */ - MD_MISCINFO_FLAGS1_TIMEZONE = 0x00000040, - /* MINIDUMP_MISC3_TIMEZONE */ - MD_MISCINFO_FLAGS1_PROTECTED_PROCESS = 0x00000080, - /* MINIDUMP_MISC3_PROTECTED_PROCESS */ - MD_MISCINFO_FLAGS1_BUILDSTRING = 0x00000100, - /* MINIDUMP_MISC4_BUILDSTRING */ -} MDMiscInfoFlags1; - -/* - * Around DbgHelp version 6.0, the style of new LIST structures changed - * from including an array of length 1 at the end of the struct to - * represent the variable-length data to including explicit - * "size of header", "size of entry" and "number of entries" fields - * in the header, presumably to allow backwards-compatibly-extending - * the structures in the future. The actual list entries follow the - * header data directly in this case. - */ - -typedef struct { - uint32_t size_of_header; /* sizeof(MDRawMemoryInfoList) */ - uint32_t size_of_entry; /* sizeof(MDRawMemoryInfo) */ - uint64_t number_of_entries; -} MDRawMemoryInfoList; /* MINIDUMP_MEMORY_INFO_LIST */ - -typedef struct { - uint64_t base_address; /* Base address of a region of pages */ - uint64_t allocation_base; /* Base address of a range of pages - * within this region. */ - uint32_t allocation_protection; /* Memory protection when this region - * was originally allocated: - * MDMemoryProtection */ - uint32_t __alignment1; - uint64_t region_size; - uint32_t state; /* MDMemoryState */ - uint32_t protection; /* MDMemoryProtection */ - uint32_t type; /* MDMemoryType */ - uint32_t __alignment2; -} MDRawMemoryInfo; /* MINIDUMP_MEMORY_INFO */ - -/* For (MDRawMemoryInfo).state */ -typedef enum { - MD_MEMORY_STATE_COMMIT = 0x1000, /* physical storage has been allocated */ - MD_MEMORY_STATE_RESERVE = 0x2000, /* reserved, but no physical storage */ - MD_MEMORY_STATE_FREE = 0x10000 /* available to be allocated */ -} MDMemoryState; - -/* For (MDRawMemoryInfo).allocation_protection and .protection */ -typedef enum { - MD_MEMORY_PROTECT_NOACCESS = 0x01, /* PAGE_NOACCESS */ - MD_MEMORY_PROTECT_READONLY = 0x02, /* PAGE_READONLY */ - MD_MEMORY_PROTECT_READWRITE = 0x04, /* PAGE_READWRITE */ - MD_MEMORY_PROTECT_WRITECOPY = 0x08, /* PAGE_WRITECOPY */ - MD_MEMORY_PROTECT_EXECUTE = 0x10, /* PAGE_EXECUTE */ - MD_MEMORY_PROTECT_EXECUTE_READ = 0x20, /* PAGE_EXECUTE_READ */ - MD_MEMORY_PROTECT_EXECUTE_READWRITE = 0x40, /* PAGE_EXECUTE_READWRITE */ - MD_MEMORY_PROTECT_EXECUTE_WRITECOPY = 0x80, /* PAGE_EXECUTE_WRITECOPY */ - /* These options can be combined with the previous flags. */ - MD_MEMORY_PROTECT_GUARD = 0x100, /* PAGE_GUARD */ - MD_MEMORY_PROTECT_NOCACHE = 0x200, /* PAGE_NOCACHE */ - MD_MEMORY_PROTECT_WRITECOMBINE = 0x400, /* PAGE_WRITECOMBINE */ -} MDMemoryProtection; - -/* Used to mask the mutually exclusive options from the combinable flags. */ -const uint32_t MD_MEMORY_PROTECTION_ACCESS_MASK = 0xFF; - -/* For (MDRawMemoryInfo).type */ -typedef enum { - MD_MEMORY_TYPE_PRIVATE = 0x20000, /* not shared by other processes */ - MD_MEMORY_TYPE_MAPPED = 0x40000, /* mapped into the view of a section */ - MD_MEMORY_TYPE_IMAGE = 0x1000000 /* mapped into the view of an image */ -} MDMemoryType; - -/* - * Breakpad extension types - */ - - -typedef struct { - /* validity is a bitmask with values from MDBreakpadInfoValidity, indicating - * which of the other fields in the structure are valid. */ - uint32_t validity; - - /* Thread ID of the handler thread. dump_thread_id should correspond to - * the thread_id of an MDRawThread in the minidump's MDRawThreadList if - * a dedicated thread in that list was used to produce the minidump. If - * the MDRawThreadList does not contain a dedicated thread used to produce - * the minidump, this field should be set to 0 and the validity field - * must not contain MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID. */ - uint32_t dump_thread_id; - - /* Thread ID of the thread that requested the minidump be produced. As - * with dump_thread_id, requesting_thread_id should correspond to the - * thread_id of an MDRawThread in the minidump's MDRawThreadList. For - * minidumps produced as a result of an exception, requesting_thread_id - * will be the same as the MDRawExceptionStream's thread_id field. For - * minidumps produced "manually" at the program's request, - * requesting_thread_id will indicate which thread caused the dump to be - * written. If the minidump was produced at the request of something - * other than a thread in the MDRawThreadList, this field should be set - * to 0 and the validity field must not contain - * MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID. */ - uint32_t requesting_thread_id; -} MDRawBreakpadInfo; - -/* For (MDRawBreakpadInfo).validity: */ -typedef enum { - /* When set, the dump_thread_id field is valid. */ - MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID = 1 << 0, - - /* When set, the requesting_thread_id field is valid. */ - MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID = 1 << 1 -} MDBreakpadInfoValidity; - -typedef struct { - /* expression, function, and file are 0-terminated UTF-16 strings. They - * may be truncated if necessary, but should always be 0-terminated when - * written to a file. - * Fixed-length strings are used because MiniDumpWriteDump doesn't offer - * a way for user streams to point to arbitrary RVAs for strings. */ - uint16_t expression[128]; /* Assertion that failed... */ - uint16_t function[128]; /* ...within this function... */ - uint16_t file[128]; /* ...in this file... */ - uint32_t line; /* ...at this line. */ - uint32_t type; -} MDRawAssertionInfo; - -/* For (MDRawAssertionInfo).type: */ -typedef enum { - MD_ASSERTION_INFO_TYPE_UNKNOWN = 0, - - /* Used for assertions that would be raised by the MSVC CRT but are - * directed to an invalid parameter handler instead. */ - MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER, - - /* Used for assertions that would be raised by the MSVC CRT but are - * directed to a pure virtual call handler instead. */ - MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL -} MDAssertionInfoData; - -/* These structs are used to store the DSO debug data in Linux minidumps, - * which is necessary for converting minidumps to usable coredumps. - * Because of a historical accident, several fields are variably encoded - * according to client word size, so tools potentially need to support both. */ - -typedef struct { - uint32_t addr; - MDRVA name; - uint32_t ld; -} MDRawLinkMap32; - -typedef struct { - uint32_t version; - MDRVA map; /* array of MDRawLinkMap32 */ - uint32_t dso_count; - uint32_t brk; - uint32_t ldbase; - uint32_t dynamic; -} MDRawDebug32; - -typedef struct { - uint64_t addr; - MDRVA name; - uint64_t ld; -} MDRawLinkMap64; - -typedef struct { - uint32_t version; - MDRVA map; /* array of MDRawLinkMap64 */ - uint32_t dso_count; - uint64_t brk; - uint64_t ldbase; - uint64_t dynamic; -} MDRawDebug64; - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - - -#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ */ diff --git a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h b/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h deleted file mode 100644 index 918544b662..0000000000 --- a/Telegram/ThirdParty/breakpad/google_breakpad/common/minidump_size.h +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -// minidump_size.h: Provides a C++ template for programmatic access to -// the sizes of various types defined in minidump_format.h. -// -// Author: Mark Mentovai - -#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__ -#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__ - -#include - -#include "google_breakpad/common/minidump_format.h" - -namespace google_breakpad { - -template -class minidump_size { - public: - static size_t size() { return sizeof(T); } -}; - -// Explicit specializations for variable-length types. The size returned -// for these should be the size for an object without its variable-length -// section. - -template<> -class minidump_size { - public: - static size_t size() { return MDString_minsize; } -}; - -template<> -class minidump_size { - public: - static size_t size() { return MDRawThreadList_minsize; } -}; - -template<> -class minidump_size { - public: - static size_t size() { return MDCVInfoPDB20_minsize; } -}; - -template<> -class minidump_size { - public: - static size_t size() { return MDCVInfoPDB70_minsize; } -}; - -template<> -class minidump_size { - public: - static size_t size() { return MDImageDebugMisc_minsize; } -}; - -template<> -class minidump_size { - public: - static size_t size() { return MDRawModuleList_minsize; } -}; - -template<> -class minidump_size { - public: - static size_t size() { return MDRawMemoryList_minsize; } -}; - -// Explicit specialization for MDRawModule, for which sizeof may include -// tail-padding on some architectures but not others. - -template<> -class minidump_size { - public: - static size_t size() { return MD_MODULE_SIZE; } -}; - -} // namespace google_breakpad - -#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__ From 759ede3c5770a6abf896e7acc8e95be590c3d069 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 17:32:19 +0300 Subject: [PATCH 056/316] fixed linux launch with static linking --- README.md | 15 -- Telegram/FixMake.sh | 4 +- Telegram/SourceFiles/app.cpp | 3 +- Telegram/SourceFiles/pspecific_linux.cpp | 295 +++++++++++------------ Telegram/Telegram.pro | 2 +- 5 files changed, 143 insertions(+), 176 deletions(-) diff --git a/README.md b/README.md index df84d73516..be9a159774 100644 --- a/README.md +++ b/README.md @@ -48,21 +48,6 @@ The source code is published under GPLv3 with OpenSSL exception, the license is Compiles given files to single update file, compresses it with lzma and signs with a private key. It is not built in **Debug** and **Release** configurations of Telegram solution, because private key is inaccessible. -* ### Prepare - - Prepares a release for deployment, puts all current files to deploy/{version} folder. - - **Windows**: - * tsetup{version}.exe installer - * Telegram.exe - * Telegram.pdb (debug info for crash minidumps view) - * tupdate{updversion} binary lzma update archive - - **Mac**: - * tsetup{version}.dmg - * Telegram.app - * tmacupd{updversion} binary lzma update archive - * ### MetaEmoji Creates four sprites and text2emoji replace code diff --git a/Telegram/FixMake.sh b/Telegram/FixMake.sh index 21abada2b2..b2b180b135 100755 --- a/Telegram/FixMake.sh +++ b/Telegram/FixMake.sh @@ -11,11 +11,9 @@ Replace () { } Replace '\-llzma' '\/usr\/lib\/x86_64\-linux\-gnu\/liblzma\.a' -Replace '\-lz' '\/usr\/lib\/x86_64\-linux\-gnu\/libz\.a' Replace '\-lssl' '\/usr\/lib\/x86_64\-linux\-gnu\/libssl\.a' Replace '\-lcrypto' '\/usr\/lib\/x86_64\-linux\-gnu\/libcrypto\.a' -Replace '\-lexif' '\/usr\/lib\/x86_64\-linux\-gnu\/libexif\.a' -Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' +#Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' Replace '\-lXi' '\/usr\/lib\/x86_64\-linux\-gnu\/libXi\.a' Replace '\-lSM' '\/usr\/lib\/x86_64\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/x86_64\-linux\-gnu\/libICE\.a' diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 3a992e7065..fae83e4597 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -25,8 +25,9 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "application.h" #include "fileuploader.h" #include "mainwidget.h" +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include - +#endif #include "localstorage.h" #include "numbers.h" diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 47429e862e..6eec662957 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -346,156 +346,141 @@ namespace { return FALSE; } - class _PsInitializer { - public: - _PsInitializer() { - static bool inited = false; - if (inited) return; - inited = true; - - QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower(); - noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome")); - tryAppIndicator = (cdesktop == qstr("xfce")); - noTryUnity = (cdesktop != qstr("unity")); - - if (noQtTrayIcon) cSetSupportTray(false); - - DEBUG_LOG(("Loading libraries")); - setupGtk(); - setupUnity(); + bool loadLibrary(QLibrary &lib, const char *name, int version) { + DEBUG_LOG(("Loading '%1' with version %2..").arg(QLatin1String(name)).arg(version)); + lib.setFileNameAndVersion(QLatin1String(name), version); + if (lib.load()) { + DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); + return true; } - - bool loadLibrary(QLibrary &lib, const char *name, int version) { - DEBUG_LOG(("Loading '%1' with version %2..").arg(QLatin1String(name)).arg(version)); - lib.setFileNameAndVersion(QLatin1String(name), version); - if (lib.load()) { - DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); - return true; - } - lib.setFileNameAndVersion(QLatin1String(name), QString()); - if (lib.load()) { - DEBUG_LOG(("Loaded '%1' without version!").arg(QLatin1String(name))); - return true; - } - LOG(("Could not load '%1' with version %2 :(").arg(QLatin1String(name)).arg(version)); - return false; + lib.setFileNameAndVersion(QLatin1String(name), QString()); + if (lib.load()) { + DEBUG_LOG(("Loaded '%1' without version!").arg(QLatin1String(name))); + return true; } + LOG(("Could not load '%1' with version %2 :(").arg(QLatin1String(name)).arg(version)); + return false; + } - void setupGtkBase(QLibrary &lib_gtk) { - if (!loadFunction(lib_gtk, "gtk_init_check", ps_gtk_init_check)) return; - if (!loadFunction(lib_gtk, "gtk_menu_new", ps_gtk_menu_new)) return; - if (!loadFunction(lib_gtk, "gtk_menu_get_type", ps_gtk_menu_get_type)) return; + void setupGtkBase(QLibrary &lib_gtk) { + if (!loadFunction(lib_gtk, "gtk_init_check", ps_gtk_init_check)) return; + if (!loadFunction(lib_gtk, "gtk_menu_new", ps_gtk_menu_new)) return; + if (!loadFunction(lib_gtk, "gtk_menu_get_type", ps_gtk_menu_get_type)) return; - if (!loadFunction(lib_gtk, "gtk_menu_item_new_with_label", ps_gtk_menu_item_new_with_label)) return; - if (!loadFunction(lib_gtk, "gtk_menu_item_set_label", ps_gtk_menu_item_set_label)) return; - if (!loadFunction(lib_gtk, "gtk_menu_shell_append", ps_gtk_menu_shell_append)) return; - if (!loadFunction(lib_gtk, "gtk_menu_shell_get_type", ps_gtk_menu_shell_get_type)) return; - if (!loadFunction(lib_gtk, "gtk_widget_show", ps_gtk_widget_show)) return; - if (!loadFunction(lib_gtk, "gtk_widget_get_toplevel", ps_gtk_widget_get_toplevel)) return; - if (!loadFunction(lib_gtk, "gtk_widget_get_visible", ps_gtk_widget_get_visible)) return; - if (!loadFunction(lib_gtk, "gtk_widget_set_sensitive", ps_gtk_widget_set_sensitive)) return; + if (!loadFunction(lib_gtk, "gtk_menu_item_new_with_label", ps_gtk_menu_item_new_with_label)) return; + if (!loadFunction(lib_gtk, "gtk_menu_item_set_label", ps_gtk_menu_item_set_label)) return; + if (!loadFunction(lib_gtk, "gtk_menu_shell_append", ps_gtk_menu_shell_append)) return; + if (!loadFunction(lib_gtk, "gtk_menu_shell_get_type", ps_gtk_menu_shell_get_type)) return; + if (!loadFunction(lib_gtk, "gtk_widget_show", ps_gtk_widget_show)) return; + if (!loadFunction(lib_gtk, "gtk_widget_get_toplevel", ps_gtk_widget_get_toplevel)) return; + if (!loadFunction(lib_gtk, "gtk_widget_get_visible", ps_gtk_widget_get_visible)) return; + if (!loadFunction(lib_gtk, "gtk_widget_set_sensitive", ps_gtk_widget_set_sensitive)) return; - if (!loadFunction(lib_gtk, "g_type_check_instance_cast", ps_g_type_check_instance_cast)) return; - if (!loadFunction(lib_gtk, "g_signal_connect_data", ps_g_signal_connect_data)) return; + if (!loadFunction(lib_gtk, "g_type_check_instance_cast", ps_g_type_check_instance_cast)) return; + if (!loadFunction(lib_gtk, "g_signal_connect_data", ps_g_signal_connect_data)) return; - if (!loadFunction(lib_gtk, "g_object_ref_sink", ps_g_object_ref_sink)) return; - if (!loadFunction(lib_gtk, "g_object_unref", ps_g_object_unref)) return; + if (!loadFunction(lib_gtk, "g_object_ref_sink", ps_g_object_ref_sink)) return; + if (!loadFunction(lib_gtk, "g_object_unref", ps_g_object_unref)) return; + DEBUG_LOG(("Library gtk functions loaded!")); + if (ps_gtk_init_check(0, 0)) { + DEBUG_LOG(("Checked gtk with gtk_init_check!")); useGtkBase = true; - DEBUG_LOG(("Library gtk functions loaded!")); + } else { + DEBUG_LOG(("Failed to gtk_init_check(0, 0)!")); } + } - void setupAppIndicator(QLibrary &lib_indicator) { - if (!loadFunction(lib_indicator, "app_indicator_new", ps_app_indicator_new)) return; - if (!loadFunction(lib_indicator, "app_indicator_set_status", ps_app_indicator_set_status)) return; - if (!loadFunction(lib_indicator, "app_indicator_set_menu", ps_app_indicator_set_menu)) return; - if (!loadFunction(lib_indicator, "app_indicator_set_icon_full", ps_app_indicator_set_icon_full)) return; - useAppIndicator = true; - DEBUG_LOG(("Library appindicator functions loaded!")); - } + void setupAppIndicator(QLibrary &lib_indicator) { + if (!loadFunction(lib_indicator, "app_indicator_new", ps_app_indicator_new)) return; + if (!loadFunction(lib_indicator, "app_indicator_set_status", ps_app_indicator_set_status)) return; + if (!loadFunction(lib_indicator, "app_indicator_set_menu", ps_app_indicator_set_menu)) return; + if (!loadFunction(lib_indicator, "app_indicator_set_icon_full", ps_app_indicator_set_icon_full)) return; + useAppIndicator = true; + DEBUG_LOG(("Library appindicator functions loaded!")); + } - void setupGtk() { - QLibrary lib_gtk, lib_indicator; - if (!noQtTrayIcon && !tryAppIndicator) { - if (!noTryUnity) { - if (loadLibrary(lib_gtk, "gtk-3", 0)) { + void setupGtk() { + QLibrary lib_gtk, lib_indicator; + if (!noQtTrayIcon && !tryAppIndicator) { + if (!noTryUnity) { + if (loadLibrary(lib_gtk, "gtk-3", 0)) { + setupGtkBase(lib_gtk); + } + if (!useGtkBase) { + if (loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { setupGtkBase(lib_gtk); } - if (!useGtkBase) { - if (loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { - setupGtkBase(lib_gtk); - } - } - if (!useGtkBase) { - noTryUnity = true; - } } - return; + if (!useGtkBase) { + noTryUnity = true; + } } + return; + } - if (loadLibrary(lib_indicator, "appindicator3", 1)) { - if (loadLibrary(lib_gtk, "gtk-3", 0)) { + if (loadLibrary(lib_indicator, "appindicator3", 1)) { + if (loadLibrary(lib_gtk, "gtk-3", 0)) { + setupGtkBase(lib_gtk); + setupAppIndicator(lib_indicator); + } + } + if (!useGtkBase || !useAppIndicator) { + if (loadLibrary(lib_indicator, "appindicator", 1)) { + if (loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { + useGtkBase = useAppIndicator = false; setupGtkBase(lib_gtk); setupAppIndicator(lib_indicator); } } - if (!useGtkBase || !useAppIndicator) { - if (loadLibrary(lib_indicator, "appindicator", 1)) { - if (loadLibrary(lib_gtk, "gtk-x11-2.0", 0)) { - useGtkBase = useAppIndicator = false; - setupGtkBase(lib_gtk); - setupAppIndicator(lib_indicator); - } - } - } - if (tryAppIndicator) { - if (useGtkBase && useAppIndicator) { - noQtTrayIcon = true; - cSetSupportTray(false); - } - return; - } - - if (!useGtkBase && lib_gtk.isLoaded()) { - LOG(("Could not load appindicator, trying to load gtk..")); - setupGtkBase(lib_gtk); - } - if (!useGtkBase) { - useAppIndicator = false; - LOG(("Could not load gtk-x11-2.0!")); - return; - } - - if (!loadFunction(lib_gtk, "gdk_init_check", ps_gdk_init_check)) return; - if (!loadFunction(lib_gtk, "gdk_pixbuf_new_from_data", ps_gdk_pixbuf_new_from_data)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_new_from_pixbuf", ps_gtk_status_icon_new_from_pixbuf)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_set_from_pixbuf", ps_gtk_status_icon_set_from_pixbuf)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_set_title", ps_gtk_status_icon_set_title)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_set_tooltip_text", ps_gtk_status_icon_set_tooltip_text)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_set_visible", ps_gtk_status_icon_set_visible)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_is_embedded", ps_gtk_status_icon_is_embedded)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_get_geometry", ps_gtk_status_icon_get_geometry)) return; - if (!loadFunction(lib_gtk, "gtk_status_icon_position_menu", ps_gtk_status_icon_position_menu)) return; - if (!loadFunction(lib_gtk, "gtk_menu_popup", ps_gtk_menu_popup)) return; - if (!loadFunction(lib_gtk, "gtk_get_current_event_time", ps_gtk_get_current_event_time)) return; - if (!loadFunction(lib_gtk, "g_idle_add", ps_g_idle_add)) return; - useStatusIcon = true; - DEBUG_LOG(("Status icon api loaded!")); - } - - void setupUnity() { - if (noTryUnity) return; - - QLibrary lib_unity(qstr("unity"), 9, 0); - if (!loadLibrary(lib_unity, "unity", 9)) return; - - if (!loadFunction(lib_unity, "unity_launcher_entry_get_for_desktop_id", ps_unity_launcher_entry_get_for_desktop_id)) return; - if (!loadFunction(lib_unity, "unity_launcher_entry_set_count", ps_unity_launcher_entry_set_count)) return; - if (!loadFunction(lib_unity, "unity_launcher_entry_set_count_visible", ps_unity_launcher_entry_set_count_visible)) return; - useUnityCount = true; - DEBUG_LOG(("Unity count api loaded!")); } - }; + if (tryAppIndicator) { + if (useGtkBase && useAppIndicator) { + noQtTrayIcon = true; + cSetSupportTray(false); + } + return; + } + + if (!useGtkBase && lib_gtk.isLoaded()) { + LOG(("Could not load appindicator, trying to load gtk..")); + setupGtkBase(lib_gtk); + } + if (!useGtkBase) { + useAppIndicator = false; + LOG(("Could not load gtk-x11-2.0!")); + return; + } + + if (!loadFunction(lib_gtk, "gdk_init_check", ps_gdk_init_check)) return; + if (!loadFunction(lib_gtk, "gdk_pixbuf_new_from_data", ps_gdk_pixbuf_new_from_data)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_new_from_pixbuf", ps_gtk_status_icon_new_from_pixbuf)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_set_from_pixbuf", ps_gtk_status_icon_set_from_pixbuf)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_set_title", ps_gtk_status_icon_set_title)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_set_tooltip_text", ps_gtk_status_icon_set_tooltip_text)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_set_visible", ps_gtk_status_icon_set_visible)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_is_embedded", ps_gtk_status_icon_is_embedded)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_get_geometry", ps_gtk_status_icon_get_geometry)) return; + if (!loadFunction(lib_gtk, "gtk_status_icon_position_menu", ps_gtk_status_icon_position_menu)) return; + if (!loadFunction(lib_gtk, "gtk_menu_popup", ps_gtk_menu_popup)) return; + if (!loadFunction(lib_gtk, "gtk_get_current_event_time", ps_gtk_get_current_event_time)) return; + if (!loadFunction(lib_gtk, "g_idle_add", ps_g_idle_add)) return; + useStatusIcon = true; + DEBUG_LOG(("Status icon api loaded!")); + } + + void setupUnity() { + if (noTryUnity) return; + + QLibrary lib_unity(qstr("unity"), 9, 0); + if (!loadLibrary(lib_unity, "unity", 9)) return; + + if (!loadFunction(lib_unity, "unity_launcher_entry_get_for_desktop_id", ps_unity_launcher_entry_get_for_desktop_id)) return; + if (!loadFunction(lib_unity, "unity_launcher_entry_set_count", ps_unity_launcher_entry_set_count)) return; + if (!loadFunction(lib_unity, "unity_launcher_entry_set_count_visible", ps_unity_launcher_entry_set_count_visible)) return; + useUnityCount = true; + DEBUG_LOG(("Unity count api loaded!")); + } class _PsEventFilter : public QAbstractNativeEventFilter { public: @@ -516,8 +501,6 @@ namespace { PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(icon256), wndIcon(QIcon::fromTheme("telegram", QIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)))), _psCheckStatusIconLeft(100), _psLastIndicatorUpdate(0) { - _PsInitializer initializer; - connect(&_psCheckStatusIconTimer, SIGNAL(timeout()), this, SLOT(psStatusIconCheck())); _psCheckStatusIconTimer.setSingleShot(false); @@ -770,41 +753,31 @@ void PsMainWindow::psCreateTrayIcon() { if (!noQtTrayIcon) { cSetSupportTray(QSystemTrayIcon::isSystemTrayAvailable()); if (!noTryUnity) { - if (ps_gtk_init_check(0, 0)) { - DEBUG_LOG(("Checked gtk with gtk_init_check!")); - } else { - DEBUG_LOG(("Failed to gtk_init_check(0, 0)!")); - useUnityCount = false; - } + useUnityCount = false; } return; } if (useAppIndicator) { DEBUG_LOG(("Trying to create AppIndicator")); - if (ps_gtk_init_check(0, 0)) { - DEBUG_LOG(("Checked gtk with gtk_init_check!")); - _trayMenu = ps_gtk_menu_new(); - if (_trayMenu) { - DEBUG_LOG(("Created gtk menu for appindicator!")); - QFileInfo f(_trayIconImageFile()); - if (f.exists()) { - QByteArray path = QFile::encodeName(f.absoluteFilePath()); - _trayIndicator = ps_app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS); - if (_trayIndicator) { - DEBUG_LOG(("Created appindicator!")); - } else { - DEBUG_LOG(("Failed to app_indicator_new()!")); - } + _trayMenu = ps_gtk_menu_new(); + if (_trayMenu) { + DEBUG_LOG(("Created gtk menu for appindicator!")); + QFileInfo f(_trayIconImageFile()); + if (f.exists()) { + QByteArray path = QFile::encodeName(f.absoluteFilePath()); + _trayIndicator = ps_app_indicator_new("Telegram Desktop", path.constData(), APP_INDICATOR_CATEGORY_APPLICATION_STATUS); + if (_trayIndicator) { + DEBUG_LOG(("Created appindicator!")); } else { - useAppIndicator = false; - DEBUG_LOG(("Failed to create image file!")); + DEBUG_LOG(("Failed to app_indicator_new()!")); } } else { - DEBUG_LOG(("Failed to gtk_menu_new()!")); + useAppIndicator = false; + DEBUG_LOG(("Failed to create image file!")); } } else { - DEBUG_LOG(("Failed to gtk_init_check(0, 0)!")); + DEBUG_LOG(("Failed to gtk_menu_new()!")); } if (_trayMenu && _trayIndicator) { ps_app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_ACTIVE); @@ -816,7 +789,7 @@ void PsMainWindow::psCreateTrayIcon() { } } if (useStatusIcon) { - if (ps_gtk_init_check(0, 0) && ps_gdk_init_check(0, 0)) { + if (ps_gdk_init_check(0, 0)) { if (!_trayMenu) _trayMenu = ps_gtk_menu_new(); if (_trayMenu) { loadPixbuf(_trayIconImageGen()); @@ -1269,6 +1242,16 @@ void psShowInFolder(const QString &name) { namespace PlatformSpecific { Initializer::Initializer() { + QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower(); + noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome")); + tryAppIndicator = (cdesktop == qstr("xfce")); + noTryUnity = (cdesktop != qstr("unity")); + + if (noQtTrayIcon) cSetSupportTray(false); + + DEBUG_LOG(("Loading libraries")); + setupGtk(); + setupUnity(); } Initializer::~Initializer() { diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index b0ea1e9d8c..1ba6d852ec 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -318,7 +318,7 @@ INCLUDEPATH += "/usr/include/atk-1.0" INCLUDEPATH += "/usr/include/dee-1.0" INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4" -LIBS += -lcrypto -lssl -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva +LIBS += -lcrypto -lssl -ldl -llzma -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a From 2b8ef0e9b28a62190e8832f2f211ba8444693e75 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 18:58:51 +0300 Subject: [PATCH 057/316] fixed linux build for 9019001 beta --- Telegram/FixMake.sh | 2 +- Telegram/Telegram.pro | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/FixMake.sh b/Telegram/FixMake.sh index b2b180b135..e03c47d215 100755 --- a/Telegram/FixMake.sh +++ b/Telegram/FixMake.sh @@ -13,7 +13,7 @@ Replace () { Replace '\-llzma' '\/usr\/lib\/x86_64\-linux\-gnu\/liblzma\.a' Replace '\-lssl' '\/usr\/lib\/x86_64\-linux\-gnu\/libssl\.a' Replace '\-lcrypto' '\/usr\/lib\/x86_64\-linux\-gnu\/libcrypto\.a' -#Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' +Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' Replace '\-lXi' '\/usr\/lib\/x86_64\-linux\-gnu\/libXi\.a' Replace '\-lSM' '\/usr\/lib\/x86_64\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/x86_64\-linux\-gnu\/libICE\.a' diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 1ba6d852ec..859fb8d013 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -288,10 +288,10 @@ CONFIG(release, debug|release) { QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE += -Ofast -flto -fno-strict-aliasing -g QMAKE_LFLAGS_RELEASE -= -O1 - QMAKE_LFLAGS_RELEASE += -Ofast -flto -rdynamic -g + QMAKE_LFLAGS_RELEASE += -Ofast -flto -g } CONFIG(debug, debug|release) { - QMAKE_LFLAGS_DEBUG += -rdynamic -g + QMAKE_LFLAGS_DEBUG += -g } INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\ From c240295a7469cd5b86fcfec33a8bd8d5b71186b3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 22:53:01 +0300 Subject: [PATCH 058/316] retina settings fixed for os x tray icon --- Telegram/SourceFiles/application.cpp | 45 +++++++++++++++++----------- Telegram/SourceFiles/application.h | 5 +++- Telegram/SourceFiles/window.cpp | 2 +- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 051d171f84..f5d565abd8 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -281,7 +281,7 @@ void Application::singleInstanceChecked() { } else if (status == SignalHandlers::LastCrashed) { new LastCrashedWindow(); } else { - new AppClass(); + Sandboxer::startSandbox(); } } } @@ -636,13 +636,38 @@ namespace Sandboxer { } } +#endif + void connect(const char *signal, QObject *object, const char *method) { if (Application *a = application()) { a->connect(a, signal, object, method); } } -#endif + void startSandbox() { + t_assert(application() != 0); + + float64 dpi = Application::primaryScreen()->logicalDotsPerInch(); + if (dpi <= 108) { // 0-96-108 + cSetScreenScale(dbisOne); + } else if (dpi <= 132) { // 108-120-132 + cSetScreenScale(dbisOneAndQuarter); + } else if (dpi <= 168) { // 132-144-168 + cSetScreenScale(dbisOneAndHalf); + } else { // 168-192-inf + cSetScreenScale(dbisTwo); + } + + if (application()->devicePixelRatio() > 1) { + cSetRetina(true); + cSetRetinaFactor(application()->devicePixelRatio()); + cSetIntRetinaFactor(int32(cRetinaFactor())); + cSetConfigScale(dbisOne); + cSetRealScale(dbisOne); + } + + new AppClass(); + } } @@ -667,21 +692,7 @@ AppClass::AppClass() : QObject() application()->installEventFilter(new EventFilterForKeys(this)); - float64 dpi = QApplication::primaryScreen()->logicalDotsPerInch(); - if (dpi <= 108) { // 0-96-108 - cSetScreenScale(dbisOne); - } else if (dpi <= 132) { // 108-120-132 - cSetScreenScale(dbisOneAndQuarter); - } else if (dpi <= 168) { // 132-144-168 - cSetScreenScale(dbisOneAndHalf); - } else { // 168-192-inf - cSetScreenScale(dbisTwo); - } - - if (application()->devicePixelRatio() > 1) { - cSetRetina(true); - cSetRetinaFactor(application()->devicePixelRatio()); - cSetIntRetinaFactor(int32(cRetinaFactor())); + if (cRetina()) { cSetConfigScale(dbisOne); cSetRealScale(dbisOne); } diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index 26b443955f..d1a0f857c7 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -128,10 +128,13 @@ namespace Sandboxer { void updateProgress(qint64 ready, qint64 total); void updateFailed(); void updateReady(); - void connect(const char *signal, QObject *object, const char *method); #endif + void connect(const char *signal, QObject *object, const char *method); + + void startSandbox(); + } class MainWidget; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 43c2b25a8d..9c52725536 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2692,7 +2692,7 @@ void LastCrashedWindow::onContinue() { if (SignalHandlers::restart() == SignalHandlers::CantOpen) { new NotStartedWindow(); } else { - new AppClass(); + Sandboxer::startSandbox(); } close(); } From db9f47c6f27f79989f4652f9cba124d0b6101a12 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 22:56:42 +0300 Subject: [PATCH 059/316] fixed version in crash reporting for betas, fixed global app event filter install --- Telegram/SourceFiles/window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 9c52725536..2e1bc196ba 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -435,7 +435,7 @@ void Window::init() { psInitFrameless(); setWindowIcon(wndIcon); - App::app()->installEventFilter(this); + Application::instance()->installEventFilter(this); connect(windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState))); connect(windowHandle(), SIGNAL(activeChanged()), this, SLOT(checkHistoryActivation()), Qt::QueuedConnection); @@ -2156,7 +2156,7 @@ QString LastCrashedWindow::getReportField(const QLatin1String &name, const QLati if (name == qstr("version")) { if (data.endsWith(qstr(" beta"))) { - data = QString::number(-data.replace(QRegularExpression(qsl("[^\\d]")), "").mid(0, data.size() - 5).toLongLong()); + data = QString::number(-data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong()); } else { data = QString::number(data.replace(QRegularExpression(qsl("[^\\d]")), "").toLongLong()); } From dd0c79ee5642695a39d5ff9d0e58e2f2b9f27534 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 7 Feb 2016 13:10:35 +0300 Subject: [PATCH 060/316] qt patch updated, os x tray icon fixed --- Telegram/_qtbase_5_5_1_patch.diff | 40 ++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/Telegram/_qtbase_5_5_1_patch.diff b/Telegram/_qtbase_5_5_1_patch.diff index e8057f0b10..8447f44c48 100644 --- a/Telegram/_qtbase_5_5_1_patch.diff +++ b/Telegram/_qtbase_5_5_1_patch.diff @@ -282,7 +282,7 @@ index 112bb8e..45be6c6 100644 + } + } + } -+ ++ + families << family; } populateFromPattern(pattern); @@ -1149,7 +1149,7 @@ new file mode 100644 index 0000000..b47d332 --- /dev/null +++ b/src/plugins/platforminputcontexts/fcitx/fcitxqtinputcontextproxy.cpp -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -N -p fcitxqtinputcontextproxy -c FcitxQtInputContextProxy interfaces/org.fcitx.Fcitx.InputContext.xml -i fcitxqtformattedpreedit.h -i fcitxqt_export.h @@ -1175,6 +1175,7 @@ index 0000000..b47d332 +FcitxQtInputContextProxy::~FcitxQtInputContextProxy() +{ +} ++ diff --git a/src/plugins/platforminputcontexts/fcitx/fcitxqtinputcontextproxy.h b/src/plugins/platforminputcontexts/fcitx/fcitxqtinputcontextproxy.h new file mode 100644 index 0000000..19874dc @@ -1493,7 +1494,7 @@ new file mode 100644 index 0000000..068f4c2 --- /dev/null +++ b/src/plugins/platforminputcontexts/fcitx/fcitxqtinputmethodproxy.cpp -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -N -p fcitxqtinputmethodproxy -c FcitxQtInputMethodProxy interfaces/org.fcitx.Fcitx.InputMethod.xml -i fcitxqtinputmethoditem.h -i fcitxqt_export.h @@ -1519,6 +1520,7 @@ index 0000000..068f4c2 +FcitxQtInputMethodProxy::~FcitxQtInputMethodProxy() +{ +} ++ diff --git a/src/plugins/platforminputcontexts/fcitx/fcitxqtinputmethodproxy.h b/src/plugins/platforminputcontexts/fcitx/fcitxqtinputmethodproxy.h new file mode 100644 index 0000000..7aa37e2 @@ -1917,7 +1919,7 @@ new file mode 100644 index 0000000..7523a92 --- /dev/null +++ b/src/plugins/platforminputcontexts/fcitx/fcitxqtkeyboardproxy.cpp -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.8 + * Command line was: qdbusxml2cpp -N -p fcitxqtkeyboardproxy -c FcitxQtKeyboardProxy interfaces/org.fcitx.Fcitx.Keyboard.xml -i fcitxqtkeyboardlayout.h -i fcitxqt_export.h @@ -1943,6 +1945,7 @@ index 0000000..7523a92 +FcitxQtKeyboardProxy::~FcitxQtKeyboardProxy() +{ +} ++ diff --git a/src/plugins/platforminputcontexts/fcitx/fcitxqtkeyboardproxy.h b/src/plugins/platforminputcontexts/fcitx/fcitxqtkeyboardproxy.h new file mode 100644 index 0000000..42a6561 @@ -11201,7 +11204,7 @@ index ca92103..f681b08 100644 p.setCompositionMode(QPainter::CompositionMode_Source); const QVector rects = region.rects(); diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm -index 713758c..9a509b2 100755 +index 713758c..9b23ca2 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -94,6 +94,8 @@ QT_USE_NAMESPACE @@ -11213,17 +11216,22 @@ index 713758c..9a509b2 100755 QIcon icon; QT_MANGLE_NAMESPACE(QNSImageView) *imageCell; } -@@ -197,7 +199,8 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon) +@@ -197,8 +199,12 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon) // (device independent pixels). The menu height on past and // current OS X versions is 22 points. Provide some future-proofing // by deriving the icon height from the menu height. - const int padding = 4; +- const int menuHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; + // create a good os x tray icon + const int padding = 0; - const int menuHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; ++ int menuHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; ++ if (menuHeight <= 0) { ++ menuHeight = 22; ++ } const int maxImageHeight = menuHeight - padding; -@@ -207,8 +210,11 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon) + // Select pixmap based on the device pixel height. Ideally we would use +@@ -207,8 +213,11 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon) // devicePixelRatio for the "best" screen on the system. qreal devicePixelRatio = qApp->devicePixelRatio(); const int maxPixmapHeight = maxImageHeight * devicePixelRatio; @@ -11236,7 +11244,7 @@ index 713758c..9a509b2 100755 // Select a pixmap based on the height. We want the largest pixmap // with a height smaller or equal to maxPixmapHeight. The pixmap // may rectangular; assume it has a reasonable size. If there is -@@ -224,9 +230,11 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon) +@@ -224,9 +233,11 @@ void QCocoaSystemTrayIcon::updateIcon(const QIcon &icon) // Handle SVG icons, which do not return anything for availableSizes(). if (!selectedSize.isValid()) @@ -11250,7 +11258,7 @@ index 713758c..9a509b2 100755 // Draw a low-resolution icon if there is not enough pixels for a retina // icon. This prevents showing a small icon on retina displays. -@@ -373,6 +381,11 @@ QT_END_NAMESPACE +@@ -373,6 +384,11 @@ QT_END_NAMESPACE Q_UNUSED(notification); down = NO; @@ -11262,7 +11270,7 @@ index 713758c..9a509b2 100755 [self setNeedsDisplay:YES]; } -@@ -382,6 +395,10 @@ QT_END_NAMESPACE +@@ -382,6 +398,10 @@ QT_END_NAMESPACE int clickCount = [mouseEvent clickCount]; [self setNeedsDisplay:YES]; @@ -11273,7 +11281,7 @@ index 713758c..9a509b2 100755 if (clickCount == 2) { [self menuTrackingDone:nil]; [parent doubleClickSelector:self]; -@@ -398,6 +415,11 @@ QT_END_NAMESPACE +@@ -398,6 +418,11 @@ QT_END_NAMESPACE -(void)mouseUp:(NSEvent *)mouseEvent { Q_UNUSED(mouseEvent); @@ -11285,7 +11293,7 @@ index 713758c..9a509b2 100755 [self menuTrackingDone:nil]; } -@@ -409,6 +431,11 @@ QT_END_NAMESPACE +@@ -409,6 +434,11 @@ QT_END_NAMESPACE -(void)rightMouseUp:(NSEvent *)mouseEvent { Q_UNUSED(mouseEvent); @@ -11297,7 +11305,7 @@ index 713758c..9a509b2 100755 [self menuTrackingDone:nil]; } -@@ -424,7 +451,8 @@ QT_END_NAMESPACE +@@ -424,7 +454,8 @@ QT_END_NAMESPACE } -(void)drawRect:(NSRect)rect { @@ -11307,7 +11315,7 @@ index 713758c..9a509b2 100755 [super drawRect:rect]; } @end -@@ -436,7 +464,9 @@ QT_END_NAMESPACE +@@ -436,7 +467,9 @@ QT_END_NAMESPACE self = [super init]; if (self) { item = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain]; @@ -11317,7 +11325,7 @@ index 713758c..9a509b2 100755 systray = sys; imageCell = [[QNSImageView alloc] initWithParent:self]; [item setView: imageCell]; -@@ -481,6 +511,8 @@ QT_END_NAMESPACE +@@ -481,6 +514,8 @@ QT_END_NAMESPACE selector:@selector(menuTrackingDone:) name:NSMenuDidEndTrackingNotification object:m]; From 0b4ddb045eb053cdd5d4a6e633f276dfdcfe87ea Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 7 Feb 2016 18:38:49 +0300 Subject: [PATCH 061/316] max history width limited, custom tooltips replace QToolTip, keys with modifiers are not passed to MentionsDropdown --- Telegram/Resources/style.txt | 17 ++++ Telegram/Resources/style_classes.txt | 14 +++ Telegram/SourceFiles/application.cpp | 23 ++++- Telegram/SourceFiles/application.h | 2 + Telegram/SourceFiles/dropdown.cpp | 11 ++- Telegram/SourceFiles/gui/popupmenu.cpp | 123 ++++++++++++++++++++++++ Telegram/SourceFiles/gui/popupmenu.h | 37 +++++++ Telegram/SourceFiles/gui/text.cpp | 108 +++++++++++++++++++++ Telegram/SourceFiles/gui/text.h | 1 + Telegram/SourceFiles/history.cpp | 13 ++- Telegram/SourceFiles/history.h | 2 +- Telegram/SourceFiles/historywidget.cpp | 19 ++-- Telegram/SourceFiles/logs.cpp | 5 + Telegram/SourceFiles/overviewwidget.cpp | 13 +-- Telegram/SourceFiles/pspecific_wnd.cpp | 4 + Telegram/SourceFiles/window.cpp | 2 +- 16 files changed, 363 insertions(+), 31 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index a1f7a785cd..3e4eee98ec 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -269,6 +269,21 @@ defaultPopupMenu: PopupMenu { widthMin: 180px; widthMax: 300px; } + +defaultTooltip: Tooltip { + textBg: #eef2f5; + textFg: #5d6c80; + textFont: normalFont; + textBorder: #c9d1db; + textPadding: margins(5px, 2px, 5px, 2px); + + shift: point(-20px, 20px); + skip: 10px; + + widthMax: 800px; + linesMax: 12; +} + almostTransparent: #ffffff0d; boxScroll: flatScroll(solidScroll) { width: 18px; @@ -999,6 +1014,8 @@ historyToEndSkip: 10px; activeFadeInDuration: 500; activeFadeOutDuration: 3000; +historyMaxWidth: 640px; + msgRadius: 3px; msgMaxWidth: 430px; diff --git a/Telegram/Resources/style_classes.txt b/Telegram/Resources/style_classes.txt index 611b367a41..0610af6bb4 100644 --- a/Telegram/Resources/style_classes.txt +++ b/Telegram/Resources/style_classes.txt @@ -272,6 +272,20 @@ PopupMenu { widthMax: number; } +Tooltip { + textBg: color; + textFg: color; + textFont: font; + textBorder: color; + textPadding: margins; + + shift: point; + skip: number; + + widthMax: number; + linesMax: number; +} + botKeyboardButton { margin: number; padding: number; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f5d565abd8..8d23bd2189 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -70,6 +70,13 @@ namespace { App::wnd()->setWindowState(Qt::WindowMinimized); return true; } + } else { + if ((ev->key() == Qt::Key_W || ev->key() == Qt::Key_F4) && (ev->modifiers() & Qt::ControlModifier)) { + if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { + App::wnd()->minimizeToTray(); + return true; + } + } } if (ev->key() == Qt::Key_MediaPlay) { if (App::main()) App::main()->player()->playPressed(); @@ -279,7 +286,15 @@ void Application::singleInstanceChecked() { if (status == SignalHandlers::CantOpen) { new NotStartedWindow(); } else if (status == SignalHandlers::LastCrashed) { - new LastCrashedWindow(); + if (Global::LastCrashDump().isEmpty()) { // don't handle bad closing for now + if (SignalHandlers::restart() == SignalHandlers::CantOpen) { + new NotStartedWindow(); + } else { + Sandboxer::startSandbox(); + } + } else { + new LastCrashedWindow(); + } } else { Sandboxer::startSandbox(); } @@ -560,6 +575,12 @@ namespace Sandboxer { return false; } + void installEventFilter(QObject *filter) { + if (Application *a = application()) { + a->installEventFilter(filter); + } + } + void execExternal(const QString &cmd) { DEBUG_LOG(("Application Info: executing external command '%1'").arg(cmd)); if (cmd == "show") { diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index d1a0f857c7..2cfe56b5d8 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -112,6 +112,8 @@ namespace Sandboxer { void setActiveWindow(QWidget *window); bool isSavingSession(); + void installEventFilter(QObject *filter); + void execExternal(const QString &cmd); #ifndef TDESKTOP_DISABLE_AUTOUPDATE diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 129ec45cc0..62cd0b5009 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4064,6 +4064,7 @@ bool MentionsInner::select() { if (!_srows->isEmpty()) { if (_sel >= 0 && _sel < _srows->size()) { emit selected(_srows->at(_sel)); + return true; } } else { QString sel = getSelected(); @@ -4636,10 +4637,12 @@ bool MentionsDropdown::eventFilter(QObject *obj, QEvent *e) { if (isHidden()) return QWidget::eventFilter(obj, e); if (e->type() == QEvent::KeyPress) { QKeyEvent *ev = static_cast(e); - if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down || (!_srows.isEmpty() && (ev->key() == Qt::Key_Left || ev->key() == Qt::Key_Right))) { - return _inner.moveSel(ev->key()); - } else if (ev->key() == Qt::Key_Enter || ev->key() == Qt::Key_Return) { - return _inner.select(); + if (!(ev->modifiers() & (Qt::AltModifier | Qt::ControlModifier | Qt::ShiftModifier | Qt::MetaModifier))) { + if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down || (!_srows.isEmpty() && (ev->key() == Qt::Key_Left || ev->key() == Qt::Key_Right))) { + return _inner.moveSel(ev->key()); + } else if (ev->key() == Qt::Key_Enter || ev->key() == Qt::Key_Return) { + return _inner.select(); + } } } return QWidget::eventFilter(obj, e); diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 349fec1af3..a2adda19af 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -520,3 +520,126 @@ PopupMenu::~PopupMenu() { } #endif } + +PopupTooltip *PopupTooltipInstance = 0; + +PopupTooltip::PopupTooltip(const QPoint &p, const QString &text, const style::Tooltip &st) : TWidget(0) +, _st(0) { + if (PopupTooltip *instance = PopupTooltipInstance) { + hide(); + deleteLater(); + } else { + PopupTooltipInstance = this; + Sandboxer::installEventFilter(this); + _hideByLeaveTimer.setSingleShot(true); + connect(&_hideByLeaveTimer, SIGNAL(timeout()), this, SLOT(onHideByLeave())); + } + + setWindowFlags(Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::ToolTip | Qt::NoDropShadowWindowHint); + setAttribute(Qt::WA_NoSystemBackground, true); + + PopupTooltipInstance->popup(p, text, &st); +} + +bool PopupTooltip::eventFilter(QObject *o, QEvent *e) { + if (e->type() == QEvent::Leave) { + _hideByLeaveTimer.start(10); + } else if (e->type() == QEvent::Enter) { + _hideByLeaveTimer.stop(); + } else if (e->type() == QEvent::MouseMove) { + if ((QCursor::pos() - _point).manhattanLength() > QApplication::startDragDistance()) { + Hide(); + } + } + return TWidget::eventFilter(o, e); +} + +void PopupTooltip::onHideByLeave() { + Hide(); +} + +PopupTooltip::~PopupTooltip() { + if (PopupTooltipInstance == this) { + PopupTooltipInstance = 0; + } +} + +void PopupTooltip::popup(const QPoint &m, const QString &text, const style::Tooltip *st) { + _point = m; + _st = st; + _text = Text(_st->textFont, text, _textPlainOptions, _st->widthMax, true); + + int32 addw = 2 * st::lineWidth + _st->textPadding.left() + _st->textPadding.right(); + int32 addh = 2 * st::lineWidth + _st->textPadding.top() + _st->textPadding.bottom(); + + // count tooltip size + QSize s(addw + _text.maxWidth(), addh + _text.minHeight()); + if (s.width() > _st->widthMax) { + s.setWidth(addw + _text.countWidth(_st->widthMax - addw)); + s.setHeight(addh + _text.countHeight(s.width() - addw)); + } + int32 maxh = addh + (_st->linesMax * _st->textFont->height); + if (s.height() > maxh) { + s.setHeight(maxh); + } + + // count tooltip position + QPoint p(m + _st->shift); + if (rtl()) { + p.setX(m.x() - s.width() - _st->shift.x()); + } + if (s.width() < 2 * _st->shift.x()) { + p.setX(m.x() - (s.width() / 2)); + } + + // adjust tooltip position + QRect r(QApplication::desktop()->screenGeometry(m)); + if (r.x() + r.width() - _st->skip < p.x() + s.width() && p.x() + s.width() > m.x()) { + p.setX(qMax(r.x() + r.width() - int32(_st->skip) - s.width(), m.x() - s.width())); + } + if (r.x() + _st->skip > p.x() && p.x() < m.x()) { + p.setX(qMin(m.x(), r.x() + int32(_st->skip))); + } + if (r.y() + r.height() - _st->skip < p.y() + s.height()) { + p.setY(m.y() - s.height() - _st->skip); + } + if (r.y() > p.x()) { + p.setY(qMin(m.y() + _st->shift.y(), r.y() + r.height() - s.height())); + } + + setGeometry(QRect(p, s)); + + _hideByLeaveTimer.stop(); + show(); +} + +void PopupTooltip::paintEvent(QPaintEvent *e) { + Painter p(this); + + p.fillRect(rect(), _st->textBg); + + p.fillRect(QRect(0, 0, width(), st::lineWidth), _st->textBorder); + p.fillRect(QRect(0, height() - st::lineWidth, width(), st::lineWidth), _st->textBorder); + p.fillRect(QRect(0, st::lineWidth, st::lineWidth, height() - 2 * st::lineWidth), _st->textBorder); + p.fillRect(QRect(width() - st::lineWidth, st::lineWidth, st::lineWidth, height() - 2 * st::lineWidth), _st->textBorder); + + int32 lines = qFloor((height() - 2 * st::lineWidth - _st->textPadding.top() - _st->textPadding.bottom()) / _st->textFont->height); + + p.setPen(_st->textFg); + _text.drawElided(p, st::lineWidth + _st->textPadding.left(), st::lineWidth + _st->textPadding.top(), width() - 2 * st::lineWidth - _st->textPadding.left() - _st->textPadding.right(), lines); +} + +void PopupTooltip::hideEvent(QHideEvent *e) { + if (PopupTooltipInstance == this) { + PopupTooltipInstance = 0; + deleteLater(); + } +} + +void PopupTooltip::Hide() { + if (PopupTooltip *instance = PopupTooltipInstance) { + PopupTooltipInstance = 0; + instance->hide(); + instance->deleteLater(); + } +} diff --git a/Telegram/SourceFiles/gui/popupmenu.h b/Telegram/SourceFiles/gui/popupmenu.h index 121984e830..354bf445b1 100644 --- a/Telegram/SourceFiles/gui/popupmenu.h +++ b/Telegram/SourceFiles/gui/popupmenu.h @@ -17,6 +17,8 @@ */ #pragma once +#include "text.h" + class PopupMenu : public TWidget { Q_OBJECT @@ -105,3 +107,38 @@ private: bool _deleteOnHide, _triggering, _deleteLater; }; + +class PopupTooltip : public TWidget { + Q_OBJECT + +public: + + PopupTooltip(const QPoint &p, const QString &text, const style::Tooltip &st = st::defaultTooltip); + + bool eventFilter(QObject *o, QEvent *e); + + static void Hide(); + + ~PopupTooltip(); + +public slots: + + void onHideByLeave(); + +protected: + + void paintEvent(QPaintEvent *e); + void hideEvent(QHideEvent *e); + +private: + + void popup(const QPoint &p, const QString &text, const style::Tooltip *st); + + Text _text; + QPoint _point; + + const style::Tooltip *_st; + + QTimer _hideByLeaveTimer; + +}; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 9fe984d736..cab543cede 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -886,6 +886,8 @@ namespace { void TextLink::onClick(Qt::MouseButton button) const { if (button == Qt::LeftButton || button == Qt::MiddleButton) { + PopupTooltip::Hide(); + QString url = TextLink::encoded(); QRegularExpressionMatch telegramMeUser = QRegularExpression(qsl("^https?://telegram\\.me/([a-zA-Z0-9\\.\\_]+)/?(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); QRegularExpressionMatch telegramMeGroup = QRegularExpression(qsl("^https?://telegram\\.me/joinchat/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); @@ -912,6 +914,7 @@ void TextLink::onClick(Qt::MouseButton button) const { void EmailLink::onClick(Qt::MouseButton button) const { if (button == Qt::LeftButton || button == Qt::MiddleButton) { + PopupTooltip::Hide(); QUrl url(qstr("mailto:") + _email); if (!QDesktopServices::openUrl(url)) { psOpenFile(url.toString(QUrl::FullyEncoded), true); @@ -2713,6 +2716,111 @@ void Text::removeSkipBlock() { } } +int32 Text::countWidth(int32 w) const { + QFixed width = w; + if (width < _minResizeWidth) width = _minResizeWidth; + if (width >= _maxWidth) { + return _maxWidth.ceil().toInt(); + } + + QFixed minWidthLeft = width, widthLeft = width, last_rBearing = 0, last_rPadding = 0; + bool longWordLine = true; + for (TextBlocks::const_iterator i = _blocks.cbegin(), e = _blocks.cend(); i != e; ++i) { + ITextBlock *b = *i; + TextBlockType _btype = b->type(); + int32 blockHeight = _blockHeight(b, _font); + QFixed _rb = _blockRBearing(b); + + if (_btype == TextBlockTNewline) { + last_rBearing = _rb; + last_rPadding = b->f_rpadding(); + if (widthLeft < minWidthLeft) { + minWidthLeft = widthLeft; + } + widthLeft = width - (b->f_width() - last_rBearing); + + longWordLine = true; + continue; + } + QFixed lpadding = b->f_lpadding(); + QFixed newWidthLeft = widthLeft - lpadding - last_rBearing - (last_rPadding + b->f_width() - _rb); + if (newWidthLeft >= 0) { + last_rBearing = _rb; + last_rPadding = b->f_rpadding(); + widthLeft = newWidthLeft; + + longWordLine = false; + continue; + } + + if (_btype == TextBlockTText) { + TextBlock *t = static_cast(b); + if (t->_words.isEmpty()) { // no words in this block, spaces only => layout this block in the same line + last_rPadding += lpadding; + + longWordLine = false; + continue; + } + + QFixed f_wLeft = widthLeft; + for (TextBlock::TextWords::const_iterator j = t->_words.cbegin(), e = t->_words.cend(), f = j; j != e; ++j) { + bool wordEndsHere = (j->width >= 0); + QFixed j_width = wordEndsHere ? j->width : -j->width; + + QFixed newWidthLeft = widthLeft - lpadding - last_rBearing - (last_rPadding + j_width - j->f_rbearing()); + lpadding = 0; + if (newWidthLeft >= 0) { + last_rBearing = j->f_rbearing(); + last_rPadding = j->rpadding; + widthLeft = newWidthLeft; + + if (wordEndsHere) { + longWordLine = false; + } + if (wordEndsHere || longWordLine) { + f_wLeft = widthLeft; + f = j + 1; + } + continue; + } + + if (f != j) { + j = f; + widthLeft = f_wLeft; + j_width = (j->width >= 0) ? j->width : -j->width; + } + + last_rBearing = j->f_rbearing(); + last_rPadding = j->rpadding; + if (widthLeft < minWidthLeft) { + minWidthLeft = widthLeft; + } + widthLeft = width - (j_width - last_rBearing); + + longWordLine = true; + f = j + 1; + f_wLeft = widthLeft; + } + continue; + } + + last_rBearing = _rb; + last_rPadding = b->f_rpadding(); + if (widthLeft < minWidthLeft) { + minWidthLeft = widthLeft; + } + widthLeft = width - (b->f_width() - last_rBearing); + + longWordLine = true; + continue; + } + if (widthLeft < minWidthLeft) { + minWidthLeft = widthLeft; + } + + return (width - minWidthLeft).ceil().toInt(); +} + int32 Text::countHeight(int32 w) const { QFixed width = w; if (width < _minResizeWidth) width = _minResizeWidth; diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index bd95be3163..b742b41d8e 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -549,6 +549,7 @@ public: Text(const Text &other); Text &operator=(const Text &other); + int32 countWidth(int32 width) const; int32 countHeight(int32 width) const; void setText(style::font font, const QString &text, const TextParseOptions &options = _defaultOptions); void setRichText(style::font font, const QString &text, TextParseOptions options = _defaultOptions, const TextCustomTagsMap &custom = TextCustomTagsMap()); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index c2c9e79649..f25a464b9e 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4604,7 +4604,7 @@ void HistoryGif::draw(Painter &p, const HistoryItem *parent, const QRect &r, boo if (!_caption.isEmpty()) { p.setPen(st::black); _caption.draw(p, st::msgPadding.left(), skipy + height + st::mediaPadding.bottom() + st::mediaCaptionSkip, captionw); - } else if (parent->getMedia() == this) { + } else if (parent->getMedia() == this && (_data->uploading() || App::hoveredItem() == parent)) { int32 fullRight = skipx + width, fullBottom = skipy + height; parent->drawInfo(p, fullRight, fullBottom, 2 * skipx + width, selected, InfoDisplayOverImage); } @@ -6209,17 +6209,22 @@ void HistoryMessage::initDimensions() { } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { - int32 mwidth = qMin(int(st::msgMaxWidth), _maxw); + int32 mwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width; if (_media && _media->currentWidth() < mwidth) { mwidth = qMax(_media->currentWidth(), qMin(mwidth, plainMaxWidth())); } - left = (!fromChannel() && out()) ? st::msgMargin.right() : st::msgMargin.left(); + left = 0; + if (hwidth > st::historyMaxWidth) { + left = (hwidth - st::historyMaxWidth) / 2; + hwidth = st::historyMaxWidth; + } + left += (!fromChannel() && out()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { left += st::msgPhotoSkip; } - width = _history->width - st::msgMargin.left() - st::msgMargin.right(); + width = hwidth - st::msgMargin.left() - st::msgMargin.right(); if (width > mwidth) { if (!fromChannel() && out()) { left += width - mwidth; diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 360d2cedc7..0cdd33cda9 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -2010,7 +2010,7 @@ public: return drawBubble(); } bool displayFromName() const { - return hasFromName() && (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || viaBot() || !_media->hideFromName()); + return hasFromName() && (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || toHistoryForwarded() || viaBot() || !_media->hideFromName()); } bool uploading() const { return _media && _media->uploading(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 95830b4e86..21c119671e 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -458,6 +458,7 @@ void HistoryInner::touchScrollUpdated(const QPoint &screenPos) { QPoint HistoryInner::mapMouseToItem(QPoint p, HistoryItem *item) { int32 msgy = itemTop(item); if (msgy < 0) return QPoint(0, 0); + p.setY(p.y() - msgy); return p; } @@ -1616,7 +1617,7 @@ void HistoryInner::onUpdateSelected() { } } textlnkOver(lnk); - QToolTip::hideText(); + PopupTooltip::Hide(); App::hoveredLinkItem((lnk && !lnkInDesc) ? item : 0); if (textlnkOver()) { if (HistoryItem *item = App::hoveredLinkItem()) { @@ -1631,7 +1632,7 @@ void HistoryInner::onUpdateSelected() { _tooltipTimer.start(1000); } if (_dragCursorState == HistoryInDateCursorState && cursorState != HistoryInDateCursorState) { - QToolTip::hideText(); + PopupTooltip::Hide(); } if (_dragAction == NoDrag) { @@ -1870,14 +1871,11 @@ void HistoryInner::applyDragSelection(SelectedItems *toItems) const { void HistoryInner::showLinkTip() { TextLinkPtr lnk = textlnkOver(); - int32 dd = QApplication::startDragDistance(); - QPoint dp(mapFromGlobal(_dragPos)); - QRect r(dp.x() - dd, dp.y() - dd, 2 * dd, 2 * dd); if (lnk && !lnk->fullDisplayed()) { - QToolTip::showText(_dragPos, lnk->readable(), this, r); + new PopupTooltip(_dragPos, lnk->readable()); } else if (_dragCursorState == HistoryInDateCursorState && _dragAction == NoDrag) { if (App::hoveredItem()) { - QToolTip::showText(_dragPos, App::hoveredItem()->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)), this, r); + new PopupTooltip(_dragPos, App::hoveredItem()->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat))); } } } @@ -2265,10 +2263,7 @@ void BotKeyboard::showCommandTip() { if (_sel >= 0) { int row = (_sel / MatrixRowShift), col = _sel % MatrixRowShift; if (!_btns.at(row).at(col).full) { - int32 dd = QApplication::startDragDistance(); - QPoint dp(mapFromGlobal(_lastMousePos)); - QRect r(dp.x() - dd, dp.y() - dd, 2 * dd, 2 * dd); - QToolTip::showText(_lastMousePos, _btns.at(row).at(col).cmd, this, r); + new PopupTooltip(_lastMousePos, _btns.at(row).at(col).cmd); } } } @@ -2294,7 +2289,7 @@ void BotKeyboard::updateSelected() { if (newSel >= 0) break; } if (newSel != _sel) { - QToolTip::hideText(); + PopupTooltip::Hide(); if (newSel < 0) { setCursor(style::cur_default); } else if (_sel < 0) { diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index c987c70c62..f5b6ac4c66 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -24,7 +24,12 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org // see https://blog.inventic.eu/2012/08/qt-and-google-breakpad/ #ifdef Q_OS_WIN + +#pragma warning(push) +#pragma warning(disable:4091) #include "client/windows/handler/exception_handler.h" +#pragma warning(pop) + #elif defined Q_OS_MAC #ifdef MAC_USE_BREAKPAD diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 4c13164d4a..8eefed34f1 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1000,7 +1000,7 @@ void OverviewInner::onUpdateSelected() { } } textlnkOver(lnk); - QToolTip::hideText(); + PopupTooltip::Hide(); App::hoveredLinkItem(lnk ? item : 0); if (textlnkOver()) { if (item && index >= 0) { @@ -1015,10 +1015,10 @@ void OverviewInner::onUpdateSelected() { lnkChanged = true; if (oldMousedItem) repaintItem(oldMousedItem, oldMousedItemIndex); if (item) repaintItem(item); - QToolTip::hideText(); + PopupTooltip::Hide(); } if (_cursorState == HistoryInDateCursorState && cursorState != HistoryInDateCursorState) { - QToolTip::hideText(); + PopupTooltip::Hide(); } if (cursorState != _cursorState) { _cursorState = cursorState; @@ -1142,14 +1142,11 @@ void OverviewInner::onUpdateSelected() { void OverviewInner::showLinkTip() { TextLinkPtr lnk = textlnkOver(); - int32 dd = QApplication::startDragDistance(); - QPoint dp(mapFromGlobal(_dragPos)); - QRect r(dp.x() - dd, dp.y() - dd, 2 * dd, 2 * dd); if (lnk && !lnk->fullDisplayed()) { - QToolTip::showText(_dragPos, lnk->readable(), this, r); + new PopupTooltip(_dragPos, lnk->readable()); } else if (_cursorState == HistoryInDateCursorState && _dragAction == NoDrag && _mousedItem) { if (HistoryItem *item = App::histItemById(itemChannel(_mousedItem), itemMsgId(_mousedItem))) { - QToolTip::showText(_dragPos, item->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)), this, r); + new PopupTooltip(_dragPos, item->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat))); } } } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index d871085c59..4ff51a0cb0 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -37,7 +37,11 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include #include +#pragma warning(push) +#pragma warning(disable:4091) #include +#pragma warning(pop) + #include #include #include diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 2e1bc196ba..e799961a43 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2005,7 +2005,7 @@ LastCrashedWindow::LastCrashedWindow() , _reportText(QString::fromUtf8(Global::LastCrashDump())) , _reportShown(false) , _reportSaved(false) -, _sendingState(Global::LastCrashDump().isEmpty() ? SendingNoReport : SendingUpdateCheck) +, _sendingState(((!cDevVersion() && !cBetaVersion()) || Global::LastCrashDump().isEmpty()) ? SendingNoReport : SendingUpdateCheck) , _updating(this) , _sendingProgress(0) , _sendingTotal(0) From 47ead0392529245dd5896120d37b746cf74d711b Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 7 Feb 2016 21:58:42 +0300 Subject: [PATCH 062/316] moved Interfaces to types.h, tooltip hiding fixed --- Telegram/SourceFiles/facades.cpp | 11 +- Telegram/SourceFiles/facades.h | 5 +- Telegram/SourceFiles/gui/popupmenu.cpp | 57 ++++++-- Telegram/SourceFiles/gui/popupmenu.h | 20 ++- Telegram/SourceFiles/historywidget.cpp | 33 +++-- Telegram/SourceFiles/historywidget.h | 18 +-- Telegram/SourceFiles/overviewwidget.cpp | 14 +- Telegram/SourceFiles/overviewwidget.h | 7 +- Telegram/SourceFiles/structs.cpp | 31 ----- Telegram/SourceFiles/structs.h | 168 ------------------------ Telegram/SourceFiles/types.cpp | 31 +++++ Telegram/SourceFiles/types.h | 168 ++++++++++++++++++++++++ 12 files changed, 312 insertions(+), 251 deletions(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 4cb9c62023..00edb26460 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -315,15 +315,16 @@ namespace Sandbox { t_assert_full(SandboxData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ return SandboxData->Name; \ } -#define DefineSandbox(Type, Name) DefineSandboxReadOnly(Type, Name) \ -void Set##Name(const Type &Name) { \ - t_assert_full(SandboxData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ - SandboxData->Name = Name; \ -} \ +#define DefineSandboxRef(Type, Name) DefineSandboxReadOnly(Type, Name) \ Type &Ref##Name() { \ t_assert_full(SandboxData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ return SandboxData->Name; \ } +#define DefineSandbox(Type, Name) DefineSandboxRef(Type, Name) \ +void Set##Name(const Type &Name) { \ + t_assert_full(SandboxData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ + SandboxData->Name = Name; \ +} DefineSandboxReadOnly(uint64, LaunchId); diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 9797a95f3d..5b14292521 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -123,9 +123,10 @@ namespace Sandbox { void finish(); #define DeclareSandboxReadOnly(Type, Name) const Type &Name(); -#define DeclareSandbox(Type, Name) DeclareSandboxReadOnly(Type, Name) \ - void Set##Name(const Type &Name); \ +#define DeclareSandboxRef(Type, Name) DeclareSandboxReadOnly(Type, Name) \ Type &Ref##Name(); +#define DeclareSandbox(Type, Name) DeclareSandboxRef(Type, Name) \ + void Set##Name(const Type &Name); DeclareSandboxReadOnly(uint64, LaunchId); diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index a2adda19af..e64fe2feb0 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -523,22 +523,33 @@ PopupMenu::~PopupMenu() { PopupTooltip *PopupTooltipInstance = 0; -PopupTooltip::PopupTooltip(const QPoint &p, const QString &text, const style::Tooltip &st) : TWidget(0) -, _st(0) { - if (PopupTooltip *instance = PopupTooltipInstance) { - hide(); - deleteLater(); - } else { - PopupTooltipInstance = this; - Sandboxer::installEventFilter(this); - _hideByLeaveTimer.setSingleShot(true); - connect(&_hideByLeaveTimer, SIGNAL(timeout()), this, SLOT(onHideByLeave())); +AbstractTooltipShower::~AbstractTooltipShower() { + if (PopupTooltipInstance && PopupTooltipInstance->_shower == this) { + PopupTooltipInstance->_shower = 0; } +} + +PopupTooltip::PopupTooltip() : TWidget(0) +, _shower(0) +, _st(0) { + PopupTooltipInstance = this; setWindowFlags(Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::ToolTip | Qt::NoDropShadowWindowHint); setAttribute(Qt::WA_NoSystemBackground, true); - PopupTooltipInstance->popup(p, text, &st); + _showTimer.setSingleShot(true); + connect(&_showTimer, SIGNAL(timeout()), this, SLOT(onShow())); +} + +void PopupTooltip::onShow() { + if (_shower) { + QString text = _shower->tooltipText(); + if (text.isEmpty()) { + Hide(); + } else { + PopupTooltipInstance->popup(_shower->tooltipPos(), text, _shower->tooltipSt()); + } + } } bool PopupTooltip::eventFilter(QObject *o, QEvent *e) { @@ -565,6 +576,13 @@ PopupTooltip::~PopupTooltip() { } void PopupTooltip::popup(const QPoint &m, const QString &text, const style::Tooltip *st) { + if (!_hideByLeaveTimer.isSingleShot()) { + _hideByLeaveTimer.setSingleShot(true); + connect(&_hideByLeaveTimer, SIGNAL(timeout()), this, SLOT(onHideByLeave())); + + Sandboxer::installEventFilter(this); + } + _point = m; _st = st; _text = Text(_st->textFont, text, _textPlainOptions, _st->widthMax, true); @@ -631,14 +649,27 @@ void PopupTooltip::paintEvent(QPaintEvent *e) { void PopupTooltip::hideEvent(QHideEvent *e) { if (PopupTooltipInstance == this) { - PopupTooltipInstance = 0; - deleteLater(); + Hide(); + } +} + +void PopupTooltip::Show(int32 delay, const AbstractTooltipShower *shower) { + if (!PopupTooltipInstance) { + new PopupTooltip(); + } + PopupTooltipInstance->_shower = shower; + if (delay >= 0) { + PopupTooltipInstance->_showTimer.start(delay); + } else { + PopupTooltipInstance->onShow(); } } void PopupTooltip::Hide() { if (PopupTooltip *instance = PopupTooltipInstance) { PopupTooltipInstance = 0; + instance->_showTimer.stop(); + instance->_hideByLeaveTimer.stop(); instance->hide(); instance->deleteLater(); } diff --git a/Telegram/SourceFiles/gui/popupmenu.h b/Telegram/SourceFiles/gui/popupmenu.h index 354bf445b1..b0ae5b2dde 100644 --- a/Telegram/SourceFiles/gui/popupmenu.h +++ b/Telegram/SourceFiles/gui/popupmenu.h @@ -108,21 +108,31 @@ private: }; +class AbstractTooltipShower { +public: + virtual QString tooltipText() const = 0; + virtual QPoint tooltipPos() const = 0; + virtual const style::Tooltip *tooltipSt() const { + return &st::defaultTooltip; + } + virtual ~AbstractTooltipShower(); +}; + class PopupTooltip : public TWidget { Q_OBJECT public: - PopupTooltip(const QPoint &p, const QString &text, const style::Tooltip &st = st::defaultTooltip); - bool eventFilter(QObject *o, QEvent *e); + static void Show(int32 delay, const AbstractTooltipShower *shower); static void Hide(); ~PopupTooltip(); public slots: + void onShow(); void onHideByLeave(); protected: @@ -132,8 +142,14 @@ protected: private: + PopupTooltip(); + void popup(const QPoint &p, const QString &text, const style::Tooltip *st); + friend class AbstractTooltipShower; + const AbstractTooltipShower *_shower; + QTimer _showTimer; + Text _text; QPoint _point; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 21c119671e..85b7e90420 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -75,8 +75,6 @@ HistoryInner::HistoryInner(HistoryWidget *historyWidget, ScrollArea *scroll, His , _menu(0) { connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); - _tooltipTimer.setSingleShot(true); - connect(&_tooltipTimer, SIGNAL(timeout()), this, SLOT(showLinkTip())); _touchSelectTimer.setSingleShot(true); connect(&_touchSelectTimer, SIGNAL(timeout()), this, SLOT(onTouchSelect())); @@ -1628,12 +1626,12 @@ void HistoryInner::onUpdateSelected() { } } } - if (lnk || cursorState == HistoryInDateCursorState) { - _tooltipTimer.start(1000); - } if (_dragCursorState == HistoryInDateCursorState && cursorState != HistoryInDateCursorState) { PopupTooltip::Hide(); } + if (lnk || cursorState == HistoryInDateCursorState) { + PopupTooltip::Show(1000, this); + } if (_dragAction == NoDrag) { _dragCursorState = cursorState; @@ -1869,15 +1867,20 @@ void HistoryInner::applyDragSelection(SelectedItems *toItems) const { } } -void HistoryInner::showLinkTip() { +QString HistoryInner::tooltipText() const { TextLinkPtr lnk = textlnkOver(); if (lnk && !lnk->fullDisplayed()) { - new PopupTooltip(_dragPos, lnk->readable()); + return lnk->readable(); } else if (_dragCursorState == HistoryInDateCursorState && _dragAction == NoDrag) { if (App::hoveredItem()) { - new PopupTooltip(_dragPos, App::hoveredItem()->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat))); + return App::hoveredItem()->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)); } } + return QString(); +} + +QPoint HistoryInner::tooltipPos() const { + return _dragPos; } void HistoryInner::onParentGeometryChanged() { @@ -2017,9 +2020,6 @@ BotKeyboard::BotKeyboard() : TWidget() setGeometry(0, 0, _st->margin, _st->margin); _height = _st->margin; setMouseTracking(true); - - _cmdTipTimer.setSingleShot(true); - connect(&_cmdTipTimer, SIGNAL(timeout()), this, SLOT(showCommandTip())); } void BotKeyboard::paintEvent(QPaintEvent *e) { @@ -2259,17 +2259,22 @@ void BotKeyboard::clearSelection() { } } -void BotKeyboard::showCommandTip() { +QPoint BotKeyboard::tooltipPos() const { + return _lastMousePos; +} + +QString BotKeyboard::tooltipText() const { if (_sel >= 0) { int row = (_sel / MatrixRowShift), col = _sel % MatrixRowShift; if (!_btns.at(row).at(col).full) { - new PopupTooltip(_lastMousePos, _btns.at(row).at(col).cmd); + return _btns.at(row).at(col).cmd; } } + return QString(); } void BotKeyboard::updateSelected() { - _cmdTipTimer.start(1000); + PopupTooltip::Show(1000, this); if (_down >= 0) return; diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 6aae8e548e..94c5ad30da 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -33,7 +33,7 @@ enum DragState { }; class HistoryWidget; -class HistoryInner : public TWidget { +class HistoryInner : public TWidget, public AbstractTooltipShower { Q_OBJECT public: @@ -97,6 +97,10 @@ public: void notifyIsBotChanged(); void notifyMigrateUpdated(); + // AbstractTooltipShower + virtual QString tooltipText() const; + virtual QPoint tooltipPos() const; + ~HistoryInner(); public slots: @@ -104,8 +108,6 @@ public slots: void onUpdateSelected(); void onParentGeometryChanged(); - void showLinkTip(); - void openContextUrl(); void copyContextUrl(); void saveContextImage(); @@ -150,8 +152,6 @@ private: bool _firstLoading; - QTimer _tooltipTimer; - Qt::CursorShape _cursor; typedef QMap SelectedItems; SelectedItems _selected; @@ -249,7 +249,7 @@ private: }; -class BotKeyboard : public TWidget { +class BotKeyboard : public TWidget, public AbstractTooltipShower { Q_OBJECT public: @@ -277,9 +277,12 @@ public: return _wasForMsgId; } + // AbstractTooltipShower + virtual QString tooltipText() const; + virtual QPoint tooltipPos() const; + public slots: - void showCommandTip(); void updateSelected(); private: @@ -290,7 +293,6 @@ private: FullMsgId _wasForMsgId; int32 _height, _maxOuterHeight; bool _maximizeSize, _singleUse, _forceReply; - QTimer _cmdTipTimer; QPoint _lastMousePos; struct Button { diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 8eefed34f1..2ddf41cb03 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -91,8 +91,6 @@ OverviewInner::OverviewInner(OverviewWidget *overview, ScrollArea *scroll, PeerD App::contextItem(0); - _linkTipTimer.setSingleShot(true); - connect(&_linkTipTimer, SIGNAL(timeout()), this, SLOT(showLinkTip())); _touchSelectTimer.setSingleShot(true); connect(&_touchSelectTimer, SIGNAL(timeout()), this, SLOT(onTouchSelect())); @@ -1024,7 +1022,7 @@ void OverviewInner::onUpdateSelected() { _cursorState = cursorState; } if (lnk || cursorState == HistoryInDateCursorState) { - _linkTipTimer.start(1000); + PopupTooltip::Show(1000, this); } fixItemIndex(_dragItemIndex, _dragItem); @@ -1139,16 +1137,20 @@ void OverviewInner::onUpdateSelected() { } } +QPoint OverviewInner::tooltipPos() const { + return _dragPos; +} -void OverviewInner::showLinkTip() { +QString OverviewInner::tooltipText() const { TextLinkPtr lnk = textlnkOver(); if (lnk && !lnk->fullDisplayed()) { - new PopupTooltip(_dragPos, lnk->readable()); + return lnk->readable(); } else if (_cursorState == HistoryInDateCursorState && _dragAction == NoDrag && _mousedItem) { if (HistoryItem *item = App::histItemById(itemChannel(_mousedItem), itemMsgId(_mousedItem))) { - new PopupTooltip(_dragPos, item->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat))); + return item->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)); } } + return QString(); } void OverviewInner::updateDragSelection(MsgId dragSelFrom, int32 dragSelFromIndex, MsgId dragSelTo, int32 dragSelToIndex, bool dragSelecting) { diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index 62ea9d915e..d2740e0441 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -21,7 +21,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #pragma once class OverviewWidget; -class OverviewInner : public QWidget, public RPCSender { +class OverviewInner : public QWidget, public AbstractTooltipShower, public RPCSender { Q_OBJECT public: @@ -76,12 +76,15 @@ public: void clearSelectedItems(bool onlyTextSelection = false); void fillSelectedItems(SelectedItemSet &sel, bool forDelete = true); + // AbstractTooltipShower + virtual QString tooltipText() const; + virtual QPoint tooltipPos() const; + ~OverviewInner(); public slots: void onUpdateSelected(); - void showLinkTip(); void openContextUrl(); void copyContextUrl(); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 81c7e8568b..34bd47fba4 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -34,37 +34,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #include "audio.h" #include "localstorage.h" -class InterfacesMetadatasMap : public QMap { -public: - ~InterfacesMetadatasMap() { - for (const_iterator i = cbegin(), e = cend(); i != e; ++i) { - delete i.value(); - } - } -}; - -const InterfacesMetadata *GetInterfacesMetadata(uint64 mask) { - typedef QMap InterfacesMetadatasMap; - static InterfacesMetadatasMap InterfacesMetadatas; - static QMutex InterfacesMetadatasMutex; - - QMutexLocker lock(&InterfacesMetadatasMutex); - InterfacesMetadatasMap::const_iterator i = InterfacesMetadatas.constFind(mask); - if (i == InterfacesMetadatas.cend()) { - InterfacesMetadata *meta = new InterfacesMetadata(mask); - if (!meta) { // terminate if we can't allocate memory - throw "Can't allocate memory!"; - } - - i = InterfacesMetadatas.insert(mask, meta); - } - return i.value(); -} - -InterfaceWrapStruct InterfaceWraps[64]; - -QAtomicInt InterfaceIndexLast(0); - namespace { int32 peerColorIndex(const PeerId &peer) { int32 myId(MTP::authedId()), peerId(peerToBareInt(peer)); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 5655fafa54..8de9bf0c5d 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -20,174 +20,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org */ #pragma once -class Interfaces; -typedef void(*InterfaceConstruct)(void *location, Interfaces *interfaces); -typedef void(*InterfaceDestruct)(void *location); - -struct InterfaceWrapStruct { - InterfaceWrapStruct() : Size(0), Construct(0), Destruct(0) { - } - InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct) - : Size(size) - , Construct(construct) - , Destruct(destruct) { - } - int Size; - InterfaceConstruct Construct; - InterfaceDestruct Destruct; -}; - -template -struct CeilDivideMinimumOne { - static const int Result = ((Value / Denominator) + ((!Value || (Value % Denominator)) ? 1 : 0)); -}; - -template -struct InterfaceWrapTemplate { - static const int Size = CeilDivideMinimumOne::Result * sizeof(uint64); - static void Construct(void *location, Interfaces *interfaces) { - new (location) Type(interfaces); - } - static void Destruct(void *location) { - ((Type*)location)->~Type(); - } -}; - -extern InterfaceWrapStruct InterfaceWraps[64]; -extern QAtomicInt InterfaceIndexLast; - -template -class BasicInterface { -public: - static int Index() { - static QAtomicInt _index(0); - if (int index = _index.loadAcquire()) { - return index - 1; - } - while (true) { - int last = InterfaceIndexLast.loadAcquire(); - 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); - } - break; - } - } - return _index.loadAcquire() - 1; - } - static uint64 Bit() { - return (1 << Index()); - } - -}; - -template -class BasicInterfaceWithPointer : public BasicInterface { -public: - BasicInterfaceWithPointer(Interfaces *interfaces) : interfaces(interfaces) { - } - Interfaces *interfaces = 0; -}; - -class InterfacesMetadata { -public: - - InterfacesMetadata(uint64 mask) : size(0), last(64), _mask(mask) { - for (int i = 0; i < 64; ++i) { - uint64 m = (1 << i); - if (_mask & m) { - int s = InterfaceWraps[i].Size; - if (s) { - offsets[i] = size; - size += s; - } else { - offsets[i] = -1; - } - } else if (_mask < m) { - last = i; - for (; i < 64; ++i) { - offsets[i] = -1; - } - } else { - offsets[i] = -1; - } - } - } - - int size, last; - int offsets[64]; - -private: - uint64 _mask; - -}; - -const InterfacesMetadata *GetInterfacesMetadata(uint64 mask); - -class Interfaces { -public: - - Interfaces(uint64 mask = 0) : _meta(GetInterfacesMetadata(mask)), _data(0) { - if (_meta->size) { - _data = malloc(_meta->size); - if (!_data) { // terminate if we can't allocate memory - throw "Can't allocate memory!"; - } - - for (int i = 0; i < _meta->last; ++i) { - int offset = _meta->offsets[i]; - if (offset >= 0) { - try { - InterfaceWraps[i].Construct(_dataptrunsafe(offset), this); - } catch (...) { - while (i > 0) { - --i; - offset = _meta->offsets[--i]; - if (offset >= 0) { - InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); - } - } - throw; - } - } - } - } - } - ~Interfaces() { - if (_data) { - for (int i = 0; i < _meta->last; ++i) { - int offset = _meta->offsets[i]; - if (offset >= 0) { - InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); - } - } - free(_data); - } - } - - template - Type *Get() { - return (Type*)_dataptr(_meta->offsets[Type::Index()]); - } - template - const Type *Get() const { - return (const Type*)_dataptr(_meta->offsets[Type::Index()]); - } - -private: - - void *_dataptrunsafe(int skip) const { - return (char*)_data + skip; - } - void *_dataptr(int skip) const { - return (skip >= 0) ? _dataptrunsafe(skip) : 0; - } - const InterfacesMetadata *_meta; - void *_data; - -}; - typedef int32 ChannelId; static const ChannelId NoChannel = 0; diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 18ffcc395a..15039a9b3c 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -1016,3 +1016,34 @@ MimeType mimeTypeForData(const QByteArray &data) { } return MimeType(QMimeDatabase().mimeTypeForData(data)); } + +class InterfacesMetadatasMap : public QMap { +public: + ~InterfacesMetadatasMap() { + for (const_iterator i = cbegin(), e = cend(); i != e; ++i) { + delete i.value(); + } + } +}; + +const InterfacesMetadata *GetInterfacesMetadata(uint64 mask) { + typedef QMap InterfacesMetadatasMap; + static InterfacesMetadatasMap InterfacesMetadatas; + static QMutex InterfacesMetadatasMutex; + + QMutexLocker lock(&InterfacesMetadatasMutex); + InterfacesMetadatasMap::const_iterator i = InterfacesMetadatas.constFind(mask); + if (i == InterfacesMetadatas.cend()) { + InterfacesMetadata *meta = new InterfacesMetadata(mask); + if (!meta) { // terminate if we can't allocate memory + throw "Can't allocate memory!"; + } + + i = InterfacesMetadatas.insert(mask, meta); + } + return i.value(); +} + +InterfaceWrapStruct InterfaceWraps[64]; + +QAtomicInt InterfaceIndexLast(0); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index d7043d70bb..7c47cca8fd 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -529,6 +529,174 @@ inline void destroyImplementation(I *&ptr) { deleteAndMark(ptr); } +class Interfaces; +typedef void(*InterfaceConstruct)(void *location, Interfaces *interfaces); +typedef void(*InterfaceDestruct)(void *location); + +struct InterfaceWrapStruct { + InterfaceWrapStruct() : Size(0), Construct(0), Destruct(0) { + } + InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct) + : Size(size) + , Construct(construct) + , Destruct(destruct) { + } + int Size; + InterfaceConstruct Construct; + InterfaceDestruct Destruct; +}; + +template +struct CeilDivideMinimumOne { + static const int Result = ((Value / Denominator) + ((!Value || (Value % Denominator)) ? 1 : 0)); +}; + +template +struct InterfaceWrapTemplate { + static const int Size = CeilDivideMinimumOne::Result * sizeof(uint64); + static void Construct(void *location, Interfaces *interfaces) { + new (location) Type(interfaces); + } + static void Destruct(void *location) { + ((Type*)location)->~Type(); + } +}; + +extern InterfaceWrapStruct InterfaceWraps[64]; +extern QAtomicInt InterfaceIndexLast; + +template +class BasicInterface { +public: + static int Index() { + static QAtomicInt _index(0); + if (int index = _index.loadAcquire()) { + return index - 1; + } + while (true) { + int last = InterfaceIndexLast.loadAcquire(); + 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); + } + break; + } + } + return _index.loadAcquire() - 1; + } + static uint64 Bit() { + return (1 << Index()); + } + +}; + +template +class BasicInterfaceWithPointer : public BasicInterface { +public: + BasicInterfaceWithPointer(Interfaces *interfaces) : interfaces(interfaces) { + } + Interfaces *interfaces = 0; +}; + +class InterfacesMetadata { +public: + + InterfacesMetadata(uint64 mask) : size(0), last(64), _mask(mask) { + for (int i = 0; i < 64; ++i) { + uint64 m = (1 << i); + if (_mask & m) { + int s = InterfaceWraps[i].Size; + if (s) { + offsets[i] = size; + size += s; + } else { + offsets[i] = -1; + } + } else if (_mask < m) { + last = i; + for (; i < 64; ++i) { + offsets[i] = -1; + } + } else { + offsets[i] = -1; + } + } + } + + int size, last; + int offsets[64]; + +private: + uint64 _mask; + +}; + +const InterfacesMetadata *GetInterfacesMetadata(uint64 mask); + +class Interfaces { +public: + + Interfaces(uint64 mask = 0) : _meta(GetInterfacesMetadata(mask)), _data(0) { + if (_meta->size) { + _data = malloc(_meta->size); + if (!_data) { // terminate if we can't allocate memory + throw "Can't allocate memory!"; + } + + for (int i = 0; i < _meta->last; ++i) { + int offset = _meta->offsets[i]; + if (offset >= 0) { + try { + InterfaceWraps[i].Construct(_dataptrunsafe(offset), this); + } catch (...) { + while (i > 0) { + --i; + offset = _meta->offsets[--i]; + if (offset >= 0) { + InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); + } + } + throw; + } + } + } + } + } + ~Interfaces() { + if (_data) { + for (int i = 0; i < _meta->last; ++i) { + int offset = _meta->offsets[i]; + if (offset >= 0) { + InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); + } + } + free(_data); + } + } + + template + Type *Get() { + return (Type*)_dataptr(_meta->offsets[Type::Index()]); + } + template + const Type *Get() const { + return (const Type*)_dataptr(_meta->offsets[Type::Index()]); + } + +private: + + void *_dataptrunsafe(int skip) const { + return (char*)_data + skip; + } + void *_dataptr(int skip) const { + return (skip >= 0) ? _dataptrunsafe(skip) : 0; + } + const InterfacesMetadata *_meta; + void *_data; + +}; + template class FunctionImplementation { public: From 520d82b0ff9b0c31877bc6a785bee9bacb50ec51 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 7 Feb 2016 22:08:18 +0300 Subject: [PATCH 063/316] beta version 9019002 --- Telegram/SourceFiles/config.h | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Version | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 716414b06a..c8d75c9fbe 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9019; static const wchar_t *AppVersionStr = L"0.9.19"; static const bool DevVersion = true; -#define BETA_VERSION (9019001ULL) // just comment this line to build public version +#define BETA_VERSION (9019002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 7b4720543a..d9254c7431 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,19,1 - PRODUCTVERSION 0,9,19,1 + FILEVERSION 0,9,19,2 + PRODUCTVERSION 0,9,19,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.19.1" + VALUE "FileVersion", "0.9.19.2" VALUE "LegalCopyright", "Copyright (C) 2013" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.19.1" + VALUE "ProductVersion", "0.9.19.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index fba09052d8..83bc292728 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.19 AppVersionStr 0.9.19 DevChannel 1 -BetaVersion 9019001 +BetaVersion 9019002 From b3da86bf08fbdbdbabc3477aec9b58acb4181b6d Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Feb 2016 13:50:56 +0300 Subject: [PATCH 064/316] closing logs and working file before relaunching Telegram --- Telegram/SourceFiles/logs.cpp | 20 +++++++++++++++++++- Telegram/SourceFiles/logs.h | 2 ++ Telegram/SourceFiles/pspecific_linux.cpp | 2 ++ Telegram/SourceFiles/pspecific_mac_p.mm | 4 +++- Telegram/SourceFiles/pspecific_wnd.cpp | 2 ++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index f5b6ac4c66..2dfea02f2a 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -98,6 +98,14 @@ public: return reopen(LogDataMain, 0, qsl("start")); } + void closeMain() { + QMutexLocker lock(_logsMutex(LogDataMain)); + if (files[LogDataMain]) { + streams[LogDataMain].setDevice(0); + files[LogDataMain]->close(); + } + } + bool instanceChecked() { return reopen(LogDataMain, 0, QString()); } @@ -433,6 +441,13 @@ namespace Logs { LogsBeforeSingleInstanceChecked.clear(); } + void closeMain() { + LOG(("Explicitly closing main log and finishing crash handlers.")); + if (LogsData) { + LogsData->closeMain(); + } + } + void writeMain(const QString &v) { time_t t = time(NULL); struct tm tm; @@ -490,7 +505,7 @@ namespace Logs { return LogsBeforeSingleInstanceChecked; } - int32 size = 0; + int32 size = LogsBeforeSingleInstanceChecked.size(); for (LogsInMemoryList::const_iterator i = LogsInMemory->cbegin(), e = LogsInMemory->cend(); i != e; ++i) { if (i->first == LogDataMain) { size += i->second.size(); @@ -498,6 +513,9 @@ namespace Logs { } QString result; result.reserve(size); + if (!LogsBeforeSingleInstanceChecked.isEmpty()) { + result.append(LogsBeforeSingleInstanceChecked); + } for (LogsInMemoryList::const_iterator i = LogsInMemory->cbegin(), e = LogsInMemory->cend(); i != e; ++i) { if (i->first == LogDataMain) { result += i->second; diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index e8e2c99984..09d4567eac 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -32,6 +32,8 @@ namespace Logs { bool instanceChecked(); void multipleInstances(); + void closeMain(); + void writeMain(const QString &v); void writeDebug(const char *file, int32 line, const QString &v); diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 6eec662957..4117a5f265 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -1411,6 +1411,8 @@ bool _execUpdater(bool update = true, const QString &crashreport = QString()) { } } + Logs::closeMain(); + SignalHandlers::finish(); pid_t pid = fork(); switch (pid) { case -1: return false; diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index ca7db5d832..4c2acf1693 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -978,8 +978,10 @@ BOOL _execUpdater(BOOL update = YES, const QString &crashreport = QString()) { } DEBUG_LOG(("Application Info: executing %1 %2").arg(objcString(path)).arg(objcString([args componentsJoinedByString:@" "]))); + Logs::closeMain(); + SignalHandlers::finish(); if (![NSTask launchedTaskWithLaunchPath:path arguments:args]) { - LOG(("Task not launched while executing %1 %2").arg(objcString(path)).arg(objcString([args componentsJoinedByString:@" "]))); + DEBUG_LOG(("Task not launched while executing %1 %2").arg(objcString(path)).arg(objcString([args componentsJoinedByString:@" "]))); return NO; } } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 4ff51a0cb0..84c165c800 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2284,6 +2284,8 @@ void psExecTelegram(const QString &crashreport) { 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))); From 0b8523d58e76bcd50e59777fc0091f502d0f5a47 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Feb 2016 13:56:18 +0300 Subject: [PATCH 065/316] added year 2016 to copyright --- Telegram/Resources/lang.strings | 2 +- Telegram/Resources/style.txt | 2 +- Telegram/Resources/style_classes.txt | 2 +- Telegram/SourceFiles/_other/genemoji.cpp | 4 ++-- Telegram/SourceFiles/_other/genemoji.h | 2 +- Telegram/SourceFiles/_other/genlang.cpp | 6 +++--- Telegram/SourceFiles/_other/genlang.h | 2 +- Telegram/SourceFiles/_other/genstyles.cpp | 10 +++++----- Telegram/SourceFiles/_other/genstyles.h | 2 +- Telegram/SourceFiles/_other/memain.cpp | 2 +- Telegram/SourceFiles/_other/memain.h | 2 +- Telegram/SourceFiles/_other/mlmain.cpp | 2 +- Telegram/SourceFiles/_other/mlmain.h | 2 +- Telegram/SourceFiles/_other/msmain.cpp | 2 +- Telegram/SourceFiles/_other/msmain.h | 2 +- Telegram/SourceFiles/_other/packer.cpp | 2 +- Telegram/SourceFiles/_other/packer.h | 2 +- Telegram/SourceFiles/_other/updater.cpp | 4 +--- Telegram/SourceFiles/_other/updater.h | 8 +++++++- Telegram/SourceFiles/_other/updater_linux.cpp | 2 +- Telegram/SourceFiles/_other/updater_osx.m | 2 +- Telegram/SourceFiles/apiwrap.cpp | 2 +- Telegram/SourceFiles/apiwrap.h | 2 +- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/app.h | 2 +- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/application.h | 2 +- Telegram/SourceFiles/audio.cpp | 2 +- Telegram/SourceFiles/audio.h | 2 +- Telegram/SourceFiles/autoupdater.cpp | 2 +- Telegram/SourceFiles/autoupdater.h | 2 +- Telegram/SourceFiles/boxes/aboutbox.cpp | 2 +- Telegram/SourceFiles/boxes/aboutbox.h | 2 +- Telegram/SourceFiles/boxes/abstractbox.cpp | 2 +- Telegram/SourceFiles/boxes/abstractbox.h | 2 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 2 +- Telegram/SourceFiles/boxes/addcontactbox.h | 2 +- Telegram/SourceFiles/boxes/autolockbox.cpp | 2 +- Telegram/SourceFiles/boxes/autolockbox.h | 2 +- Telegram/SourceFiles/boxes/backgroundbox.cpp | 2 +- Telegram/SourceFiles/boxes/backgroundbox.h | 2 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- Telegram/SourceFiles/boxes/confirmbox.h | 2 +- Telegram/SourceFiles/boxes/connectionbox.cpp | 2 +- Telegram/SourceFiles/boxes/connectionbox.h | 2 +- Telegram/SourceFiles/boxes/contactsbox.cpp | 2 +- Telegram/SourceFiles/boxes/contactsbox.h | 2 +- Telegram/SourceFiles/boxes/downloadpathbox.cpp | 2 +- Telegram/SourceFiles/boxes/downloadpathbox.h | 2 +- Telegram/SourceFiles/boxes/emojibox.cpp | 2 +- Telegram/SourceFiles/boxes/emojibox.h | 2 +- Telegram/SourceFiles/boxes/languagebox.cpp | 2 +- Telegram/SourceFiles/boxes/languagebox.h | 2 +- Telegram/SourceFiles/boxes/passcodebox.cpp | 2 +- Telegram/SourceFiles/boxes/passcodebox.h | 2 +- Telegram/SourceFiles/boxes/photocropbox.cpp | 2 +- Telegram/SourceFiles/boxes/photocropbox.h | 2 +- Telegram/SourceFiles/boxes/photosendbox.cpp | 2 +- Telegram/SourceFiles/boxes/photosendbox.h | 2 +- Telegram/SourceFiles/boxes/sessionsbox.cpp | 2 +- Telegram/SourceFiles/boxes/sessionsbox.h | 2 +- Telegram/SourceFiles/boxes/stickersetbox.cpp | 2 +- Telegram/SourceFiles/boxes/stickersetbox.h | 2 +- Telegram/SourceFiles/boxes/usernamebox.cpp | 2 +- Telegram/SourceFiles/boxes/usernamebox.h | 2 +- Telegram/SourceFiles/config.h | 2 +- Telegram/SourceFiles/countries.h | 2 +- Telegram/SourceFiles/dialogswidget.cpp | 2 +- Telegram/SourceFiles/dialogswidget.h | 2 +- Telegram/SourceFiles/dropdown.cpp | 2 +- Telegram/SourceFiles/dropdown.h | 2 +- Telegram/SourceFiles/facades.cpp | 2 +- Telegram/SourceFiles/facades.h | 2 +- Telegram/SourceFiles/fileuploader.cpp | 2 +- Telegram/SourceFiles/fileuploader.h | 2 +- Telegram/SourceFiles/gui/animation.cpp | 2 +- Telegram/SourceFiles/gui/animation.h | 2 +- Telegram/SourceFiles/gui/boxshadow.cpp | 2 +- Telegram/SourceFiles/gui/boxshadow.h | 2 +- Telegram/SourceFiles/gui/button.cpp | 2 +- Telegram/SourceFiles/gui/button.h | 2 +- Telegram/SourceFiles/gui/countryinput.cpp | 2 +- Telegram/SourceFiles/gui/countryinput.h | 2 +- Telegram/SourceFiles/gui/emoji_config.cpp | 2 +- Telegram/SourceFiles/gui/emoji_config.h | 2 +- Telegram/SourceFiles/gui/filedialog.cpp | 2 +- Telegram/SourceFiles/gui/filedialog.h | 2 +- Telegram/SourceFiles/gui/flatbutton.cpp | 2 +- Telegram/SourceFiles/gui/flatbutton.h | 2 +- Telegram/SourceFiles/gui/flatcheckbox.cpp | 2 +- Telegram/SourceFiles/gui/flatcheckbox.h | 2 +- Telegram/SourceFiles/gui/flatinput.cpp | 2 +- Telegram/SourceFiles/gui/flatinput.h | 2 +- Telegram/SourceFiles/gui/flatlabel.cpp | 2 +- Telegram/SourceFiles/gui/flatlabel.h | 2 +- Telegram/SourceFiles/gui/flattextarea.cpp | 2 +- Telegram/SourceFiles/gui/flattextarea.h | 2 +- Telegram/SourceFiles/gui/images.cpp | 2 +- Telegram/SourceFiles/gui/images.h | 2 +- Telegram/SourceFiles/gui/popupmenu.cpp | 2 +- Telegram/SourceFiles/gui/popupmenu.h | 2 +- Telegram/SourceFiles/gui/scrollarea.cpp | 2 +- Telegram/SourceFiles/gui/scrollarea.h | 2 +- Telegram/SourceFiles/gui/style_core.cpp | 2 +- Telegram/SourceFiles/gui/style_core.h | 2 +- Telegram/SourceFiles/gui/text.cpp | 2 +- Telegram/SourceFiles/gui/text.h | 2 +- Telegram/SourceFiles/gui/twidget.cpp | 2 +- Telegram/SourceFiles/gui/twidget.h | 2 +- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/history.h | 2 +- Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/historywidget.h | 2 +- Telegram/SourceFiles/intro/intro.cpp | 2 +- Telegram/SourceFiles/intro/intro.h | 2 +- Telegram/SourceFiles/intro/introcode.cpp | 2 +- Telegram/SourceFiles/intro/introcode.h | 2 +- Telegram/SourceFiles/intro/introphone.cpp | 2 +- Telegram/SourceFiles/intro/introphone.h | 2 +- Telegram/SourceFiles/intro/intropwdcheck.cpp | 2 +- Telegram/SourceFiles/intro/intropwdcheck.h | 2 +- Telegram/SourceFiles/intro/introsignup.cpp | 2 +- Telegram/SourceFiles/intro/introsignup.h | 2 +- Telegram/SourceFiles/intro/introsteps.cpp | 2 +- Telegram/SourceFiles/intro/introsteps.h | 2 +- Telegram/SourceFiles/lang.cpp | 2 +- Telegram/SourceFiles/lang.h | 2 +- Telegram/SourceFiles/langloaderplain.cpp | 2 +- Telegram/SourceFiles/langloaderplain.h | 2 +- Telegram/SourceFiles/langs/lang_de.strings | 2 +- Telegram/SourceFiles/langs/lang_es.strings | 2 +- Telegram/SourceFiles/langs/lang_it.strings | 2 +- Telegram/SourceFiles/langs/lang_ko.strings | 2 +- Telegram/SourceFiles/langs/lang_nl.strings | 2 +- Telegram/SourceFiles/langs/lang_pt_BR.strings | 2 +- Telegram/SourceFiles/layerwidget.cpp | 2 +- Telegram/SourceFiles/layerwidget.h | 2 +- Telegram/SourceFiles/layout.cpp | 2 +- Telegram/SourceFiles/layout.h | 2 +- Telegram/SourceFiles/localimageloader.cpp | 2 +- Telegram/SourceFiles/localimageloader.h | 2 +- Telegram/SourceFiles/localstorage.cpp | 2 +- Telegram/SourceFiles/localstorage.h | 2 +- Telegram/SourceFiles/logs.cpp | 2 +- Telegram/SourceFiles/logs.h | 2 +- Telegram/SourceFiles/main.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/mainwidget.h | 2 +- Telegram/SourceFiles/mediaview.cpp | 2 +- Telegram/SourceFiles/mediaview.h | 2 +- Telegram/SourceFiles/mtproto/mtp.cpp | 2 +- Telegram/SourceFiles/mtproto/mtp.h | 2 +- Telegram/SourceFiles/mtproto/mtpAuthKey.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpAuthKey.h | 2 +- Telegram/SourceFiles/mtproto/mtpConnection.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpConnection.h | 2 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpDC.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpDC.h | 2 +- Telegram/SourceFiles/mtproto/mtpFileLoader.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpFileLoader.h | 2 +- Telegram/SourceFiles/mtproto/mtpPublicRSA.h | 2 +- Telegram/SourceFiles/mtproto/mtpRPC.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpRPC.h | 2 +- Telegram/SourceFiles/mtproto/mtpSession.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpSession.h | 2 +- Telegram/SourceFiles/mtproto/mtpSessionImpl.h | 2 +- Telegram/SourceFiles/numbers.h | 2 +- Telegram/SourceFiles/overviewwidget.cpp | 2 +- Telegram/SourceFiles/overviewwidget.h | 2 +- Telegram/SourceFiles/passcodewidget.cpp | 2 +- Telegram/SourceFiles/passcodewidget.h | 2 +- Telegram/SourceFiles/playerwidget.cpp | 2 +- Telegram/SourceFiles/playerwidget.h | 2 +- Telegram/SourceFiles/profilewidget.cpp | 2 +- Telegram/SourceFiles/profilewidget.h | 2 +- Telegram/SourceFiles/pspecific.h | 2 +- Telegram/SourceFiles/pspecific_linux.cpp | 2 +- Telegram/SourceFiles/pspecific_linux.h | 2 +- Telegram/SourceFiles/pspecific_mac.cpp | 2 +- Telegram/SourceFiles/pspecific_mac.h | 2 +- Telegram/SourceFiles/pspecific_mac_p.h | 2 +- Telegram/SourceFiles/pspecific_mac_p.mm | 2 +- Telegram/SourceFiles/pspecific_wnd.cpp | 4 ++-- Telegram/SourceFiles/pspecific_wnd.h | 2 +- Telegram/SourceFiles/settings.cpp | 2 +- Telegram/SourceFiles/settings.h | 2 +- Telegram/SourceFiles/settingswidget.cpp | 2 +- Telegram/SourceFiles/settingswidget.h | 2 +- Telegram/SourceFiles/stdafx.cpp | 2 +- Telegram/SourceFiles/stdafx.h | 2 +- Telegram/SourceFiles/structs.cpp | 2 +- Telegram/SourceFiles/structs.h | 2 +- Telegram/SourceFiles/style.h | 2 +- Telegram/SourceFiles/sysbuttons.cpp | 2 +- Telegram/SourceFiles/sysbuttons.h | 2 +- Telegram/SourceFiles/title.cpp | 2 +- Telegram/SourceFiles/title.h | 2 +- Telegram/SourceFiles/types.cpp | 2 +- Telegram/SourceFiles/types.h | 2 +- Telegram/SourceFiles/window.cpp | 2 +- Telegram/SourceFiles/window.h | 2 +- Telegram/Telegram.rc | 2 +- 204 files changed, 218 insertions(+), 214 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 79aee3ad76..57da8554cc 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "English"; "lng_switch_to_this" = "Switch to English"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 3e4eee98ec..71c0598a94 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ defaultFontFamily: 'Open Sans'; semibold: 'Open Sans Semibold'; diff --git a/Telegram/Resources/style_classes.txt b/Telegram/Resources/style_classes.txt index 0610af6bb4..229b3398bb 100644 --- a/Telegram/Resources/style_classes.txt +++ b/Telegram/Resources/style_classes.txt @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ textStyle { linkFlags: font; diff --git a/Telegram/SourceFiles/_other/genemoji.cpp b/Telegram/SourceFiles/_other/genemoji.cpp index 5e6fce4bf5..22e3fd1bd3 100644 --- a/Telegram/SourceFiles/_other/genemoji.cpp +++ b/Telegram/SourceFiles/_other/genemoji.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "genemoji.h" @@ -1942,7 +1942,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; tcpp << "#include \"stdafx.h\"\n#include \"gui/emoji_config.h\"\n\n"; diff --git a/Telegram/SourceFiles/_other/genemoji.h b/Telegram/SourceFiles/_other/genemoji.h index 61c0e3e767..ecf35ef48e 100644 --- a/Telegram/SourceFiles/_other/genemoji.h +++ b/Telegram/SourceFiles/_other/genemoji.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include #include diff --git a/Telegram/SourceFiles/_other/genlang.cpp b/Telegram/SourceFiles/_other/genlang.cpp index 60e77ec79d..2050bfcbf3 100644 --- a/Telegram/SourceFiles/_other/genlang.cpp +++ b/Telegram/SourceFiles/_other/genlang.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "genlang.h" @@ -412,7 +412,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; th << "#pragma once\n\n"; @@ -496,7 +496,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; tcpp << "#include \"stdafx.h\"\n#include \"lang.h\"\n\n"; tcpp << "namespace {\n"; diff --git a/Telegram/SourceFiles/_other/genlang.h b/Telegram/SourceFiles/_other/genlang.h index dadeb8c09b..b88f6d0306 100644 --- a/Telegram/SourceFiles/_other/genlang.h +++ b/Telegram/SourceFiles/_other/genlang.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include #include diff --git a/Telegram/SourceFiles/_other/genstyles.cpp b/Telegram/SourceFiles/_other/genstyles.cpp index 709117d522..67f58191f9 100644 --- a/Telegram/SourceFiles/_other/genstyles.cpp +++ b/Telegram/SourceFiles/_other/genstyles.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "genstyles.h" @@ -381,7 +381,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; tout << "#pragma once\n\n#include \"style.h\"\n\nnamespace style {\n"; for (int i = 0, l = byIndex.size(); i < l; ++i) { @@ -1542,7 +1542,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; tout << "#pragma once\n\n#include \"style.h\"\n\nnamespace st {\n"; tcpp << "\ @@ -1568,7 +1568,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; tcpp << "#include \"stdafx.h\"\n#include \"style_auto.h\"\n\nnamespace {\n"; for (int i = 0, l = scalars.size(); i < l; ++i) { @@ -1945,7 +1945,7 @@ In addition, as a special exception, the copyright holders give permission\n\ to link the code of portions of this program with the OpenSSL library.\n\ \n\ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n\ -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org\n\ +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ */\n"; tnum << "#include \"stdafx.h\"\n#include \"numbers.h\"\n\n"; tnum << "QVector phoneNumberParse(const QString &number) {\n"; diff --git a/Telegram/SourceFiles/_other/genstyles.h b/Telegram/SourceFiles/_other/genstyles.h index 40a6d6ce67..05fa8c333e 100644 --- a/Telegram/SourceFiles/_other/genstyles.h +++ b/Telegram/SourceFiles/_other/genstyles.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include #include diff --git a/Telegram/SourceFiles/_other/memain.cpp b/Telegram/SourceFiles/_other/memain.cpp index 6daade312c..aaf5b63415 100644 --- a/Telegram/SourceFiles/_other/memain.cpp +++ b/Telegram/SourceFiles/_other/memain.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "memain.h" diff --git a/Telegram/SourceFiles/_other/memain.h b/Telegram/SourceFiles/_other/memain.h index c2faceb850..c3293a73c8 100644 --- a/Telegram/SourceFiles/_other/memain.h +++ b/Telegram/SourceFiles/_other/memain.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include diff --git a/Telegram/SourceFiles/_other/mlmain.cpp b/Telegram/SourceFiles/_other/mlmain.cpp index 490ce50efe..42c01b0d28 100644 --- a/Telegram/SourceFiles/_other/mlmain.cpp +++ b/Telegram/SourceFiles/_other/mlmain.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "mlmain.h" diff --git a/Telegram/SourceFiles/_other/mlmain.h b/Telegram/SourceFiles/_other/mlmain.h index a909bb5025..6516c86b25 100644 --- a/Telegram/SourceFiles/_other/mlmain.h +++ b/Telegram/SourceFiles/_other/mlmain.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include diff --git a/Telegram/SourceFiles/_other/msmain.cpp b/Telegram/SourceFiles/_other/msmain.cpp index cd31683884..ac85f52e41 100644 --- a/Telegram/SourceFiles/_other/msmain.cpp +++ b/Telegram/SourceFiles/_other/msmain.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "msmain.h" #include diff --git a/Telegram/SourceFiles/_other/msmain.h b/Telegram/SourceFiles/_other/msmain.h index f0e13771a2..4db6725527 100644 --- a/Telegram/SourceFiles/_other/msmain.h +++ b/Telegram/SourceFiles/_other/msmain.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include diff --git a/Telegram/SourceFiles/_other/packer.cpp b/Telegram/SourceFiles/_other/packer.cpp index 7cf2da9552..e2a6f128af 100644 --- a/Telegram/SourceFiles/_other/packer.cpp +++ b/Telegram/SourceFiles/_other/packer.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "packer.h" diff --git a/Telegram/SourceFiles/_other/packer.h b/Telegram/SourceFiles/_other/packer.h index b82ccd71c2..ccdff11cf8 100644 --- a/Telegram/SourceFiles/_other/packer.h +++ b/Telegram/SourceFiles/_other/packer.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index a1dd35aa01..9dea213aa9 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "updater.h" @@ -328,8 +328,6 @@ void updateRegistry() { } } -#include - int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdParamarg, int cmdShow) { openLog(); diff --git a/Telegram/SourceFiles/_other/updater.h b/Telegram/SourceFiles/_other/updater.h index b7f8fd8c0b..8b2709c272 100644 --- a/Telegram/SourceFiles/_other/updater.h +++ b/Telegram/SourceFiles/_other/updater.h @@ -16,13 +16,19 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once #include #include + +#pragma warning(push) +#pragma warning(disable:4091) #include +#include +#pragma warning(pop) + #include #include diff --git a/Telegram/SourceFiles/_other/updater_linux.cpp b/Telegram/SourceFiles/_other/updater_linux.cpp index f65ad09448..3a3b778105 100644 --- a/Telegram/SourceFiles/_other/updater_linux.cpp +++ b/Telegram/SourceFiles/_other/updater_linux.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include #include diff --git a/Telegram/SourceFiles/_other/updater_osx.m b/Telegram/SourceFiles/_other/updater_osx.m index ea34527f43..ef13dfc065 100644 --- a/Telegram/SourceFiles/_other/updater_osx.m +++ b/Telegram/SourceFiles/_other/updater_osx.m @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #import diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 69366c14ce..ac90340590 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index 5daabcf74f..521bb05b2b 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index fae83e4597..f68b037366 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 4e55647340..2b224e07ca 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 8d23bd2189..4938588524 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "application.h" diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index 2cfe56b5d8..48bf3e80f6 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 57bf5f9f6b..db981b3aa2 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "audio.h" diff --git a/Telegram/SourceFiles/audio.h b/Telegram/SourceFiles/audio.h index 9413233501..e21c273f78 100644 --- a/Telegram/SourceFiles/audio.h +++ b/Telegram/SourceFiles/audio.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index 17528d79f0..36cb2c8777 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/autoupdater.h b/Telegram/SourceFiles/autoupdater.h index 7394035ddd..3687a405dc 100644 --- a/Telegram/SourceFiles/autoupdater.h +++ b/Telegram/SourceFiles/autoupdater.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/aboutbox.cpp b/Telegram/SourceFiles/boxes/aboutbox.cpp index e593541d93..913465e84b 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.cpp +++ b/Telegram/SourceFiles/boxes/aboutbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/aboutbox.h b/Telegram/SourceFiles/boxes/aboutbox.h index 6be8c2ed4c..ceccef089f 100644 --- a/Telegram/SourceFiles/boxes/aboutbox.h +++ b/Telegram/SourceFiles/boxes/aboutbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/abstractbox.cpp b/Telegram/SourceFiles/boxes/abstractbox.cpp index e61b40fcee..ca02a614a7 100644 --- a/Telegram/SourceFiles/boxes/abstractbox.cpp +++ b/Telegram/SourceFiles/boxes/abstractbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/abstractbox.h b/Telegram/SourceFiles/boxes/abstractbox.h index 4920cebd13..14c3f3d741 100644 --- a/Telegram/SourceFiles/boxes/abstractbox.h +++ b/Telegram/SourceFiles/boxes/abstractbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index c2d94321a0..d236862a30 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/addcontactbox.h b/Telegram/SourceFiles/boxes/addcontactbox.h index b50c715deb..0289bc3d53 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.h +++ b/Telegram/SourceFiles/boxes/addcontactbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/autolockbox.cpp b/Telegram/SourceFiles/boxes/autolockbox.cpp index 93675868c5..3af3b2615e 100644 --- a/Telegram/SourceFiles/boxes/autolockbox.cpp +++ b/Telegram/SourceFiles/boxes/autolockbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/autolockbox.h b/Telegram/SourceFiles/boxes/autolockbox.h index 827e103654..db7035972c 100644 --- a/Telegram/SourceFiles/boxes/autolockbox.h +++ b/Telegram/SourceFiles/boxes/autolockbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/backgroundbox.cpp b/Telegram/SourceFiles/boxes/backgroundbox.cpp index 098b301c2a..e35eb32c96 100644 --- a/Telegram/SourceFiles/boxes/backgroundbox.cpp +++ b/Telegram/SourceFiles/boxes/backgroundbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/backgroundbox.h b/Telegram/SourceFiles/boxes/backgroundbox.h index e2a6e5a820..4d3b5bfef2 100644 --- a/Telegram/SourceFiles/boxes/backgroundbox.h +++ b/Telegram/SourceFiles/boxes/backgroundbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index b619af2657..b114ffa18b 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/confirmbox.h b/Telegram/SourceFiles/boxes/confirmbox.h index ba439eb957..6cfd601991 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.h +++ b/Telegram/SourceFiles/boxes/confirmbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/connectionbox.cpp b/Telegram/SourceFiles/boxes/connectionbox.cpp index f2c24a9e38..a94fdd44db 100644 --- a/Telegram/SourceFiles/boxes/connectionbox.cpp +++ b/Telegram/SourceFiles/boxes/connectionbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/connectionbox.h b/Telegram/SourceFiles/boxes/connectionbox.h index 79a43f378f..34a2770be7 100644 --- a/Telegram/SourceFiles/boxes/connectionbox.h +++ b/Telegram/SourceFiles/boxes/connectionbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 4ac079ff9f..e295611fe8 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/contactsbox.h b/Telegram/SourceFiles/boxes/contactsbox.h index 540f35b40c..6f9eed12d1 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.h +++ b/Telegram/SourceFiles/boxes/contactsbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/downloadpathbox.cpp b/Telegram/SourceFiles/boxes/downloadpathbox.cpp index b5d7f5d589..00c7a71588 100644 --- a/Telegram/SourceFiles/boxes/downloadpathbox.cpp +++ b/Telegram/SourceFiles/boxes/downloadpathbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/downloadpathbox.h b/Telegram/SourceFiles/boxes/downloadpathbox.h index c4a335e304..8f6e923b83 100644 --- a/Telegram/SourceFiles/boxes/downloadpathbox.h +++ b/Telegram/SourceFiles/boxes/downloadpathbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/emojibox.cpp b/Telegram/SourceFiles/boxes/emojibox.cpp index a5b4837475..9bd637bed3 100644 --- a/Telegram/SourceFiles/boxes/emojibox.cpp +++ b/Telegram/SourceFiles/boxes/emojibox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/emojibox.h b/Telegram/SourceFiles/boxes/emojibox.h index 405fd127b0..8fb3baac76 100644 --- a/Telegram/SourceFiles/boxes/emojibox.h +++ b/Telegram/SourceFiles/boxes/emojibox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/languagebox.cpp b/Telegram/SourceFiles/boxes/languagebox.cpp index 3ec7ea7eac..115123b91c 100644 --- a/Telegram/SourceFiles/boxes/languagebox.cpp +++ b/Telegram/SourceFiles/boxes/languagebox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/languagebox.h b/Telegram/SourceFiles/boxes/languagebox.h index ce37f417c9..68b7c65ce7 100644 --- a/Telegram/SourceFiles/boxes/languagebox.h +++ b/Telegram/SourceFiles/boxes/languagebox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/passcodebox.cpp b/Telegram/SourceFiles/boxes/passcodebox.cpp index 45055b2cf4..b0815abb21 100644 --- a/Telegram/SourceFiles/boxes/passcodebox.cpp +++ b/Telegram/SourceFiles/boxes/passcodebox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/passcodebox.h b/Telegram/SourceFiles/boxes/passcodebox.h index f280af9a07..be908ae1a0 100644 --- a/Telegram/SourceFiles/boxes/passcodebox.h +++ b/Telegram/SourceFiles/boxes/passcodebox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/photocropbox.cpp b/Telegram/SourceFiles/boxes/photocropbox.cpp index e76410712b..d7de86d98a 100644 --- a/Telegram/SourceFiles/boxes/photocropbox.cpp +++ b/Telegram/SourceFiles/boxes/photocropbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/boxes/photocropbox.h b/Telegram/SourceFiles/boxes/photocropbox.h index 347d240647..e7c63fd025 100644 --- a/Telegram/SourceFiles/boxes/photocropbox.h +++ b/Telegram/SourceFiles/boxes/photocropbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index d9d933e30b..1a25dd55ec 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/boxes/photosendbox.h b/Telegram/SourceFiles/boxes/photosendbox.h index 2c955dfd00..1cd4bbf00e 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.h +++ b/Telegram/SourceFiles/boxes/photosendbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/sessionsbox.cpp b/Telegram/SourceFiles/boxes/sessionsbox.cpp index 6cc62071db..be56624faf 100644 --- a/Telegram/SourceFiles/boxes/sessionsbox.cpp +++ b/Telegram/SourceFiles/boxes/sessionsbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/sessionsbox.h b/Telegram/SourceFiles/boxes/sessionsbox.h index 3c84bc65d6..e7d60fba9b 100644 --- a/Telegram/SourceFiles/boxes/sessionsbox.h +++ b/Telegram/SourceFiles/boxes/sessionsbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index 4424755959..8b756c4ee4 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/stickersetbox.h b/Telegram/SourceFiles/boxes/stickersetbox.h index 7fbd2b9720..d2fd4749ee 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.h +++ b/Telegram/SourceFiles/boxes/stickersetbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/boxes/usernamebox.cpp b/Telegram/SourceFiles/boxes/usernamebox.cpp index b0f11ba746..13786841f4 100644 --- a/Telegram/SourceFiles/boxes/usernamebox.cpp +++ b/Telegram/SourceFiles/boxes/usernamebox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/boxes/usernamebox.h b/Telegram/SourceFiles/boxes/usernamebox.h index c48af468f9..d2dfe0b6e1 100644 --- a/Telegram/SourceFiles/boxes/usernamebox.h +++ b/Telegram/SourceFiles/boxes/usernamebox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index c8d75c9fbe..97c252ffaa 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/countries.h b/Telegram/SourceFiles/countries.h index 6255464ef3..135d03b9e4 100644 --- a/Telegram/SourceFiles/countries.h +++ b/Telegram/SourceFiles/countries.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index ef5247c88e..690805a253 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/dialogswidget.h b/Telegram/SourceFiles/dialogswidget.h index 60cb877b93..a535d2fa15 100644 --- a/Telegram/SourceFiles/dialogswidget.h +++ b/Telegram/SourceFiles/dialogswidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 62cd0b5009..3fba9d150f 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/dropdown.h b/Telegram/SourceFiles/dropdown.h index 36146697b4..5ff587a236 100644 --- a/Telegram/SourceFiles/dropdown.h +++ b/Telegram/SourceFiles/dropdown.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 00edb26460..12796df2bd 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 5b14292521..4c528c4e7c 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/fileuploader.cpp b/Telegram/SourceFiles/fileuploader.cpp index 2c5f30adc7..607a2e91cc 100644 --- a/Telegram/SourceFiles/fileuploader.cpp +++ b/Telegram/SourceFiles/fileuploader.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "fileuploader.h" diff --git a/Telegram/SourceFiles/fileuploader.h b/Telegram/SourceFiles/fileuploader.h index 460f8e1702..895e7c677a 100644 --- a/Telegram/SourceFiles/fileuploader.h +++ b/Telegram/SourceFiles/fileuploader.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index f5d59a9381..045dbb2739 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/gui/animation.h b/Telegram/SourceFiles/gui/animation.h index b3aa52afa0..d5d8253d2d 100644 --- a/Telegram/SourceFiles/gui/animation.h +++ b/Telegram/SourceFiles/gui/animation.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/boxshadow.cpp b/Telegram/SourceFiles/gui/boxshadow.cpp index 415978d7bc..c2df882146 100644 --- a/Telegram/SourceFiles/gui/boxshadow.cpp +++ b/Telegram/SourceFiles/gui/boxshadow.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/gui/boxshadow.h b/Telegram/SourceFiles/gui/boxshadow.h index 2d2b903ae7..bd4bb77650 100644 --- a/Telegram/SourceFiles/gui/boxshadow.h +++ b/Telegram/SourceFiles/gui/boxshadow.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/button.cpp b/Telegram/SourceFiles/gui/button.cpp index 05217d585e..767bac6254 100644 --- a/Telegram/SourceFiles/gui/button.cpp +++ b/Telegram/SourceFiles/gui/button.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "button.h" diff --git a/Telegram/SourceFiles/gui/button.h b/Telegram/SourceFiles/gui/button.h index 652fea137d..34577ade84 100644 --- a/Telegram/SourceFiles/gui/button.h +++ b/Telegram/SourceFiles/gui/button.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/countryinput.cpp b/Telegram/SourceFiles/gui/countryinput.cpp index 5405737503..cca5695984 100644 --- a/Telegram/SourceFiles/gui/countryinput.cpp +++ b/Telegram/SourceFiles/gui/countryinput.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/gui/countryinput.h b/Telegram/SourceFiles/gui/countryinput.h index 457c177e44..83d5e5040c 100644 --- a/Telegram/SourceFiles/gui/countryinput.h +++ b/Telegram/SourceFiles/gui/countryinput.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/emoji_config.cpp b/Telegram/SourceFiles/gui/emoji_config.cpp index 32e28e62b9..cf84ad2d9e 100644 --- a/Telegram/SourceFiles/gui/emoji_config.cpp +++ b/Telegram/SourceFiles/gui/emoji_config.cpp @@ -20,7 +20,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "gui/emoji_config.h" diff --git a/Telegram/SourceFiles/gui/emoji_config.h b/Telegram/SourceFiles/gui/emoji_config.h index 1734d3d827..9f4fefb61b 100644 --- a/Telegram/SourceFiles/gui/emoji_config.h +++ b/Telegram/SourceFiles/gui/emoji_config.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/filedialog.cpp b/Telegram/SourceFiles/gui/filedialog.cpp index 4727f81c79..b606613d0a 100644 --- a/Telegram/SourceFiles/gui/filedialog.cpp +++ b/Telegram/SourceFiles/gui/filedialog.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "gui/filedialog.h" diff --git a/Telegram/SourceFiles/gui/filedialog.h b/Telegram/SourceFiles/gui/filedialog.h index 58791f512c..33f3f13918 100644 --- a/Telegram/SourceFiles/gui/filedialog.h +++ b/Telegram/SourceFiles/gui/filedialog.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/flatbutton.cpp b/Telegram/SourceFiles/gui/flatbutton.cpp index 1df0ac6642..e29de5f44f 100644 --- a/Telegram/SourceFiles/gui/flatbutton.cpp +++ b/Telegram/SourceFiles/gui/flatbutton.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "gui/flatbutton.h" diff --git a/Telegram/SourceFiles/gui/flatbutton.h b/Telegram/SourceFiles/gui/flatbutton.h index f07b0c4a25..e8f0a77db5 100644 --- a/Telegram/SourceFiles/gui/flatbutton.h +++ b/Telegram/SourceFiles/gui/flatbutton.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/flatcheckbox.cpp b/Telegram/SourceFiles/gui/flatcheckbox.cpp index bace80fc7c..d162439069 100644 --- a/Telegram/SourceFiles/gui/flatcheckbox.cpp +++ b/Telegram/SourceFiles/gui/flatcheckbox.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/gui/flatcheckbox.h b/Telegram/SourceFiles/gui/flatcheckbox.h index 560045fdfe..6e209e3e21 100644 --- a/Telegram/SourceFiles/gui/flatcheckbox.h +++ b/Telegram/SourceFiles/gui/flatcheckbox.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/flatinput.cpp b/Telegram/SourceFiles/gui/flatinput.cpp index a7f4241a02..f2a893e7ce 100644 --- a/Telegram/SourceFiles/gui/flatinput.cpp +++ b/Telegram/SourceFiles/gui/flatinput.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/gui/flatinput.h b/Telegram/SourceFiles/gui/flatinput.h index 98b8d3be19..cfac9d9428 100644 --- a/Telegram/SourceFiles/gui/flatinput.h +++ b/Telegram/SourceFiles/gui/flatinput.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/flatlabel.cpp b/Telegram/SourceFiles/gui/flatlabel.cpp index 42860323e4..34ea575852 100644 --- a/Telegram/SourceFiles/gui/flatlabel.cpp +++ b/Telegram/SourceFiles/gui/flatlabel.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/gui/flatlabel.h b/Telegram/SourceFiles/gui/flatlabel.h index 28acee067c..43e9ebd63d 100644 --- a/Telegram/SourceFiles/gui/flatlabel.h +++ b/Telegram/SourceFiles/gui/flatlabel.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/flattextarea.cpp b/Telegram/SourceFiles/gui/flattextarea.cpp index 3340bb1ab5..87573907e5 100644 --- a/Telegram/SourceFiles/gui/flattextarea.cpp +++ b/Telegram/SourceFiles/gui/flattextarea.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/gui/flattextarea.h b/Telegram/SourceFiles/gui/flattextarea.h index 14b9fa10dc..ef1a2cb92e 100644 --- a/Telegram/SourceFiles/gui/flattextarea.h +++ b/Telegram/SourceFiles/gui/flattextarea.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/images.cpp b/Telegram/SourceFiles/gui/images.cpp index 7f97ef7d49..8bebc9ddf0 100644 --- a/Telegram/SourceFiles/gui/images.cpp +++ b/Telegram/SourceFiles/gui/images.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "gui/images.h" diff --git a/Telegram/SourceFiles/gui/images.h b/Telegram/SourceFiles/gui/images.h index a79890f5c6..63c7713793 100644 --- a/Telegram/SourceFiles/gui/images.h +++ b/Telegram/SourceFiles/gui/images.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index e64fe2feb0..46af26b768 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -13,7 +13,7 @@ GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE - Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org + Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/gui/popupmenu.h b/Telegram/SourceFiles/gui/popupmenu.h index b0ae5b2dde..caf65492df 100644 --- a/Telegram/SourceFiles/gui/popupmenu.h +++ b/Telegram/SourceFiles/gui/popupmenu.h @@ -13,7 +13,7 @@ GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE - Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org + Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/scrollarea.cpp b/Telegram/SourceFiles/gui/scrollarea.cpp index 9fdc86a76f..a71fac9547 100644 --- a/Telegram/SourceFiles/gui/scrollarea.cpp +++ b/Telegram/SourceFiles/gui/scrollarea.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/gui/scrollarea.h b/Telegram/SourceFiles/gui/scrollarea.h index 76add3f2ba..7343d749bb 100644 --- a/Telegram/SourceFiles/gui/scrollarea.h +++ b/Telegram/SourceFiles/gui/scrollarea.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/style_core.cpp b/Telegram/SourceFiles/gui/style_core.cpp index 3537f1e92c..d7c99ccd4b 100644 --- a/Telegram/SourceFiles/gui/style_core.cpp +++ b/Telegram/SourceFiles/gui/style_core.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/gui/style_core.h b/Telegram/SourceFiles/gui/style_core.h index 8642a701ac..b36cfe5a90 100644 --- a/Telegram/SourceFiles/gui/style_core.h +++ b/Telegram/SourceFiles/gui/style_core.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index cab543cede..0837eaeb8a 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "text.h" diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index b742b41d8e..1312bc759f 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/gui/twidget.cpp b/Telegram/SourceFiles/gui/twidget.cpp index 8606aece7c..6631a1fa58 100644 --- a/Telegram/SourceFiles/gui/twidget.cpp +++ b/Telegram/SourceFiles/gui/twidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/gui/twidget.h b/Telegram/SourceFiles/gui/twidget.h index d1eaeb1478..f627ad349b 100644 --- a/Telegram/SourceFiles/gui/twidget.h +++ b/Telegram/SourceFiles/gui/twidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f25a464b9e..8ac2eb7fe5 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 0cdd33cda9..dfeb4d2b94 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 85b7e90420..e68ae11835 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 94c5ad30da..b0c454eb7a 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/intro/intro.cpp b/Telegram/SourceFiles/intro/intro.cpp index b921672f4f..71eb5dad83 100644 --- a/Telegram/SourceFiles/intro/intro.cpp +++ b/Telegram/SourceFiles/intro/intro.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/intro/intro.h b/Telegram/SourceFiles/intro/intro.h index ba21c7dab0..5697c1bee0 100644 --- a/Telegram/SourceFiles/intro/intro.h +++ b/Telegram/SourceFiles/intro/intro.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/intro/introcode.cpp b/Telegram/SourceFiles/intro/introcode.cpp index 71cd2bd949..35f2540ea8 100644 --- a/Telegram/SourceFiles/intro/introcode.cpp +++ b/Telegram/SourceFiles/intro/introcode.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/intro/introcode.h b/Telegram/SourceFiles/intro/introcode.h index 2ba90769d6..174cb7c2b1 100644 --- a/Telegram/SourceFiles/intro/introcode.h +++ b/Telegram/SourceFiles/intro/introcode.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index ccd5f227ee..bb2372d7b8 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/intro/introphone.h b/Telegram/SourceFiles/intro/introphone.h index 8baa29d447..3a4357112c 100644 --- a/Telegram/SourceFiles/intro/introphone.h +++ b/Telegram/SourceFiles/intro/introphone.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/intro/intropwdcheck.cpp b/Telegram/SourceFiles/intro/intropwdcheck.cpp index 2aa13f5734..9e4ba5acdc 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.cpp +++ b/Telegram/SourceFiles/intro/intropwdcheck.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/intro/intropwdcheck.h b/Telegram/SourceFiles/intro/intropwdcheck.h index 71081358a3..5f29c9b3c5 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.h +++ b/Telegram/SourceFiles/intro/intropwdcheck.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/intro/introsignup.cpp b/Telegram/SourceFiles/intro/introsignup.cpp index 42fbde07b6..78d01ffb64 100644 --- a/Telegram/SourceFiles/intro/introsignup.cpp +++ b/Telegram/SourceFiles/intro/introsignup.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/intro/introsignup.h b/Telegram/SourceFiles/intro/introsignup.h index b183f7fc62..4a9f7df3e3 100644 --- a/Telegram/SourceFiles/intro/introsignup.h +++ b/Telegram/SourceFiles/intro/introsignup.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/intro/introsteps.cpp b/Telegram/SourceFiles/intro/introsteps.cpp index eb33f2a3d9..87359c9a89 100644 --- a/Telegram/SourceFiles/intro/introsteps.cpp +++ b/Telegram/SourceFiles/intro/introsteps.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/intro/introsteps.h b/Telegram/SourceFiles/intro/introsteps.h index dc8dc3ed3c..4522f46622 100644 --- a/Telegram/SourceFiles/intro/introsteps.h +++ b/Telegram/SourceFiles/intro/introsteps.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/lang.cpp b/Telegram/SourceFiles/lang.cpp index 015b934af5..b9bf2e9bde 100644 --- a/Telegram/SourceFiles/lang.cpp +++ b/Telegram/SourceFiles/lang.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/lang.h b/Telegram/SourceFiles/lang.h index 08193e3ef6..fd8ef7dced 100644 --- a/Telegram/SourceFiles/lang.h +++ b/Telegram/SourceFiles/lang.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/langloaderplain.cpp b/Telegram/SourceFiles/langloaderplain.cpp index 3760077b69..f07a54e8e9 100644 --- a/Telegram/SourceFiles/langloaderplain.cpp +++ b/Telegram/SourceFiles/langloaderplain.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "langloaderplain.h" diff --git a/Telegram/SourceFiles/langloaderplain.h b/Telegram/SourceFiles/langloaderplain.h index ad25438c5c..c31451482a 100644 --- a/Telegram/SourceFiles/langloaderplain.h +++ b/Telegram/SourceFiles/langloaderplain.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index fc48c7322e..98f775bac2 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "Deutsch"; "lng_switch_to_this" = "Auf Deutsch zurücksetzen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index ecb880634f..fb3020bfaf 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "Español"; "lng_switch_to_this" = "Cambiar a español"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index b68200cac0..441b872c8a 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "Italiano"; "lng_switch_to_this" = "Passa all'italiano"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 2c7022c509..17bfe72f9d 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "한국어"; "lng_switch_to_this" = "한국어로 변경"; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index b1993615f1..4a6b48ee17 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "Nederlands"; "lng_switch_to_this" = "Overschakelen naar Nederlands"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index 26d2c98b35..e4a7a676cd 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ "lng_language_name" = "Português (Brasil)"; "lng_switch_to_this" = "Trocar para Português (Brasil)"; diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp index eda4dc89fc..e419334a22 100644 --- a/Telegram/SourceFiles/layerwidget.cpp +++ b/Telegram/SourceFiles/layerwidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/layerwidget.h b/Telegram/SourceFiles/layerwidget.h index 151597edee..8729dc7c6b 100644 --- a/Telegram/SourceFiles/layerwidget.h +++ b/Telegram/SourceFiles/layerwidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 6ae5e52858..a82d91700e 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index f4bead1ec0..39f9ecd149 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/localimageloader.cpp b/Telegram/SourceFiles/localimageloader.cpp index 3b1f8d797a..d8137a8324 100644 --- a/Telegram/SourceFiles/localimageloader.cpp +++ b/Telegram/SourceFiles/localimageloader.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "localimageloader.h" diff --git a/Telegram/SourceFiles/localimageloader.h b/Telegram/SourceFiles/localimageloader.h index 47ef7441fa..6078820afe 100644 --- a/Telegram/SourceFiles/localimageloader.h +++ b/Telegram/SourceFiles/localimageloader.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index e37284d513..915bd35352 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "localstorage.h" diff --git a/Telegram/SourceFiles/localstorage.h b/Telegram/SourceFiles/localstorage.h index 30ed83b629..7bc16304bf 100644 --- a/Telegram/SourceFiles/localstorage.h +++ b/Telegram/SourceFiles/localstorage.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 2dfea02f2a..c8061a4f9b 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 09d4567eac..451fb81795 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index fc5d802991..508fb9052e 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "application.h" diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index e27a7cfab4..f21e981dd4 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 3d8c6efa39..4470adaf00 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 18a4fec497..94d00c2e3f 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/mediaview.h b/Telegram/SourceFiles/mediaview.h index 4a8c0e86cd..3007e574eb 100644 --- a/Telegram/SourceFiles/mediaview.h +++ b/Telegram/SourceFiles/mediaview.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 6b9b26cb0d..fdd03e1229 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "mtp.h" diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index 295cc5ca51..2e830ae69f 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp b/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp index 7e54022193..7e2470e7ac 100644 --- a/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp +++ b/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/mtproto/mtpAuthKey.h b/Telegram/SourceFiles/mtproto/mtpAuthKey.h index aff25083df..9bd994461e 100644 --- a/Telegram/SourceFiles/mtproto/mtpAuthKey.h +++ b/Telegram/SourceFiles/mtproto/mtpAuthKey.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 9ae550360a..b1bfac554c 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 7e03ee6166..74d281ae4c 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp index dd0a82ae4e..858394a319 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "mtpCoreTypes.h" diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index abdb10eb29..60d05a96aa 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpDC.cpp b/Telegram/SourceFiles/mtproto/mtpDC.cpp index ee5a079ad4..1a9bf11d76 100644 --- a/Telegram/SourceFiles/mtproto/mtpDC.cpp +++ b/Telegram/SourceFiles/mtproto/mtpDC.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "mtpDC.h" diff --git a/Telegram/SourceFiles/mtproto/mtpDC.h b/Telegram/SourceFiles/mtproto/mtpDC.h index 1ed240ff8c..bc8a6e7877 100644 --- a/Telegram/SourceFiles/mtproto/mtpDC.h +++ b/Telegram/SourceFiles/mtproto/mtpDC.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index 3d3f8fec01..e7c7f20c97 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.h b/Telegram/SourceFiles/mtproto/mtpFileLoader.h index d2d55d2ab0..d9f06aec1b 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.h +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpPublicRSA.h b/Telegram/SourceFiles/mtproto/mtpPublicRSA.h index fd8b39f113..0827ebfac5 100644 --- a/Telegram/SourceFiles/mtproto/mtpPublicRSA.h +++ b/Telegram/SourceFiles/mtproto/mtpPublicRSA.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpRPC.cpp b/Telegram/SourceFiles/mtproto/mtpRPC.cpp index 2f8daa3b41..c0c861750b 100644 --- a/Telegram/SourceFiles/mtproto/mtpRPC.cpp +++ b/Telegram/SourceFiles/mtproto/mtpRPC.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "mtproto/mtpRPC.h" diff --git a/Telegram/SourceFiles/mtproto/mtpRPC.h b/Telegram/SourceFiles/mtproto/mtpRPC.h index 1093b04b39..c12f4c3f59 100644 --- a/Telegram/SourceFiles/mtproto/mtpRPC.h +++ b/Telegram/SourceFiles/mtproto/mtpRPC.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpSession.cpp b/Telegram/SourceFiles/mtproto/mtpSession.cpp index ee49811a8c..54ed49cb91 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.cpp +++ b/Telegram/SourceFiles/mtproto/mtpSession.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include diff --git a/Telegram/SourceFiles/mtproto/mtpSession.h b/Telegram/SourceFiles/mtproto/mtpSession.h index d50914ece1..23db4fba38 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.h +++ b/Telegram/SourceFiles/mtproto/mtpSession.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/mtproto/mtpSessionImpl.h b/Telegram/SourceFiles/mtproto/mtpSessionImpl.h index b2772c43c8..465a2f7f81 100644 --- a/Telegram/SourceFiles/mtproto/mtpSessionImpl.h +++ b/Telegram/SourceFiles/mtproto/mtpSessionImpl.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/numbers.h b/Telegram/SourceFiles/numbers.h index c9b734ca56..bbbf125e6b 100644 --- a/Telegram/SourceFiles/numbers.h +++ b/Telegram/SourceFiles/numbers.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 2ddf41cb03..dd53bfa50e 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index d2740e0441..b6c63428c5 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/passcodewidget.cpp b/Telegram/SourceFiles/passcodewidget.cpp index bb7bea235d..e37ecdfac3 100644 --- a/Telegram/SourceFiles/passcodewidget.cpp +++ b/Telegram/SourceFiles/passcodewidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/passcodewidget.h b/Telegram/SourceFiles/passcodewidget.h index 9fe8cbb547..effd6c68f5 100644 --- a/Telegram/SourceFiles/passcodewidget.h +++ b/Telegram/SourceFiles/passcodewidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/playerwidget.cpp b/Telegram/SourceFiles/playerwidget.cpp index f55b0d9f42..3ced88806c 100644 --- a/Telegram/SourceFiles/playerwidget.cpp +++ b/Telegram/SourceFiles/playerwidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/playerwidget.h b/Telegram/SourceFiles/playerwidget.h index e854ffee79..2dacfcad99 100644 --- a/Telegram/SourceFiles/playerwidget.h +++ b/Telegram/SourceFiles/playerwidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index c17b1c0e1c..0c69c8421c 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 611f8a7a99..66523d65d0 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/pspecific.h b/Telegram/SourceFiles/pspecific.h index 0b1442ad63..98c8411466 100644 --- a/Telegram/SourceFiles/pspecific.h +++ b/Telegram/SourceFiles/pspecific.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 4117a5f265..397cac5305 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "pspecific.h" diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index b4380165b5..8a527b1f73 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 2b51f85b88..84349d6160 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "pspecific.h" diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index 154fee8f68..70ca3ade6d 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/pspecific_mac_p.h b/Telegram/SourceFiles/pspecific_mac_p.h index 9b0d3aaeeb..174aae7b62 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.h +++ b/Telegram/SourceFiles/pspecific_mac_p.h @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index 4c2acf1693..21e641e1a1 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE -Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "pspecific_mac_p.h" diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 84c165c800..6d40abeabe 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "pspecific.h" @@ -40,11 +40,11 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org #pragma warning(push) #pragma warning(disable:4091) #include +#include #pragma warning(pop) #include #include -#include #include #include diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index 2f6d14af03..ce46b80cc9 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -17,7 +17,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index e17e7f0eaa..316567c0d3 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "pspecific.h" diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 42554b7440..28cc53382f 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 8b5e3bf0b9..af03d71853 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index c8a9c841f0..c3a8449be3 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/stdafx.cpp b/Telegram/SourceFiles/stdafx.cpp index 01ddf641e5..53a464500f 100644 --- a/Telegram/SourceFiles/stdafx.cpp +++ b/Telegram/SourceFiles/stdafx.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 8a97b226ec..fa83246785 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #define __HUGE #define PSAPI_VERSION 1 // fix WinXP diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 34bd47fba4..274b34f29b 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 8de9bf0c5d..78e899e56e 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/style.h b/Telegram/SourceFiles/style.h index bcbbb5c08b..f9fcf062a0 100644 --- a/Telegram/SourceFiles/style.h +++ b/Telegram/SourceFiles/style.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/sysbuttons.cpp b/Telegram/SourceFiles/sysbuttons.cpp index 8b618dfd75..ec81716c78 100644 --- a/Telegram/SourceFiles/sysbuttons.cpp +++ b/Telegram/SourceFiles/sysbuttons.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/sysbuttons.h b/Telegram/SourceFiles/sysbuttons.h index de7c3f93f1..db6e2ed897 100644 --- a/Telegram/SourceFiles/sysbuttons.h +++ b/Telegram/SourceFiles/sysbuttons.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/title.cpp b/Telegram/SourceFiles/title.cpp index 081c05f5ad..9c6e389976 100644 --- a/Telegram/SourceFiles/title.cpp +++ b/Telegram/SourceFiles/title.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "lang.h" diff --git a/Telegram/SourceFiles/title.h b/Telegram/SourceFiles/title.h index ff85f2528d..7e3b60fd8b 100644 --- a/Telegram/SourceFiles/title.h +++ b/Telegram/SourceFiles/title.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 15039a9b3c..b3fb139f2b 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 7c47cca8fd..4647bada86 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index e799961a43..d1a0ff1171 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" #include "style.h" diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index ef715b2375..ae6b9fcb06 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -16,7 +16,7 @@ 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-2015 John Preston, https://desktop.telegram.org +Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index d9254c7431..dce43cd4d6 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -52,7 +52,7 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileVersion", "0.9.19.2" - VALUE "LegalCopyright", "Copyright (C) 2013" + VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" VALUE "ProductVersion", "0.9.19.2" END From 53202859432dd395563ea9e886d1655f61472667 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Feb 2016 15:32:17 +0300 Subject: [PATCH 066/316] added google breakpad/crashpad to build instructions --- MSVC.md | 27 ++++++++++++++++++++++- QTCREATOR.md | 11 ++++++++++ XCODE.md | 61 ++++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 82 insertions(+), 17 deletions(-) diff --git a/MSVC.md b/MSVC.md index a9f3453094..644839a307 100644 --- a/MSVC.md +++ b/MSVC.md @@ -170,7 +170,6 @@ and run cd qtbase && git apply ../../../tdesktop/Telegram/_qtbase_5_5_1_patch.diff && cd .. - #####Install Windows SDKs If you didn't install Windows SDKs before, you need to install them now. To install the SDKs just open Telegram solution at **D:\TBuild\tdesktop\Telegram.sln** and on startup Visual Studio 2015 will popup dialog box and ask to download and install extra components (including Windows 7 SDK). @@ -191,6 +190,32 @@ https://visualstudiogallery.msdn.microsoft.com/c89ff880-8509-47a4-a262-e4fa07168 Download, close all VS2015 instances and install for VS2015 +####Google Breakpad + +* Install Python 2.7.11 from https://www.python.org/downloads/release/python-2711/ > [**Windows x86 MSI installer**](https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi) +* Open **VS2015 x86 Native Tools Command Prompt.bat** (should be in **Start Menu > Programs > Visual Studio 2015** menu folder) + +There go to Libraries directory + + D: + cd TBuild\Libraries + +and run + + git clone https://chromium.googlesource.com/breakpad/breakpad + git clone https://chromium.googlesource.com/external/gyp + set PATH=C:\Python27;%PATH% + cd breakpad/src/client/windows + ..\..\..\..\gyp\gyp --no-circular-check + +#####Building library + +* Open in VS2015 **D:\TBuild\Libraries\breakpad\src\client\windows\breakpad_client.sln** +* Change "Treat WChar_t As Built in Type" to "No" in all projects & configurations +* Change "Treat Warnings As Errors" to "No" in all projects & configurations +* Build Debug configuration +* Build Release configuration + ###Building Telegram Desktop * Launch VS2015 for configuring Qt5Package diff --git a/QTCREATOR.md b/QTCREATOR.md index e4c584b74a..9576e30dd5 100644 --- a/QTCREATOR.md +++ b/QTCREATOR.md @@ -142,6 +142,17 @@ In Terminal go to **/home/user/TBuild/Libraries/QtStatic** and there run building (**make** command) will take really long time. +####Google Breakpad + +In Terminal go to **/home/user/TBuild/Libraries** and run + + git clone https://chromium.googlesource.com/breakpad/breakpad + git clone https://chromium.googlesource.com/linux-syscall-support breakpad/src/third_party/lss + cd breakpad + ./configure + make + sudo make install + ###Building Telegram Desktop * Launch Qt Creator, all projects will be taken from **/home/user/TBuild/tdesktop/Telegram** diff --git a/XCODE.md b/XCODE.md index 00a0dfbd76..cdc229f7d4 100644 --- a/XCODE.md +++ b/XCODE.md @@ -2,11 +2,11 @@ ###Prepare folder -Choose a folder for the future build, for example **/Users/user/TBuild** - +Choose a folder for the future build, for example **/Users/user/TBuild** + There you will have two folders, **Libraries** for third-party libs and **tdesktop** (or **tdesktop-master**) for the app. -**You will need this hierarchy to be able to follow this README !** +**You will need this hierarchy to be able to follow this README !** ###Clone source code @@ -15,8 +15,8 @@ By git – in Terminal go to **/Users/user/TBuild** and run: git clone https://github.com/telegramdesktop/tdesktop.git or: -* download in ZIP and extract to **/Users/user/TBuild** -* rename **tdesktop-master** to **tdesktop**. +* download in ZIP and extract to **/Users/user/TBuild** +* rename **tdesktop-master** to **tdesktop**. The path to Telegram.xcodeproj should now be: **/Users/user/TBuild/tdesktop/Telegram/Telegram.xcodeproj** @@ -44,19 +44,19 @@ In Terminal go to **/Users/user/TBuild/Libraries/zlib-1.2.8** and run: ####OpenSSL 1.0.1g -#####Get openssl-xcode project file +#####Get openssl-xcode project file From https://github.com/telegramdesktop/openssl-xcode with git in Terminal: * go to **/Users/user/TBuild/Libraries * run: - + git clone https://github.com/telegramdesktop/openssl-xcode.git or: -* download in ZIP and extract to **/Users/user/TBuild/Libraries**, -* rename **openssl-xcode-master** to **openssl-xcode** +* download in ZIP and extract to **/Users/user/TBuild/Libraries**, +* rename **openssl-xcode-master** to **openssl-xcode** The path to openssl.xcodeproj should now be: **/Users/user/TBuild/Libraries/openssl-xcode/openssl.xcodeproj** @@ -64,8 +64,8 @@ The path to openssl.xcodeproj should now be: **/Users/user/TBuild/Libraries/open Download [**openssl-1.0.1h.tar.gz**](http://www.openssl.org/source/openssl-1.0.1h.tar.gz) (4.3 Mb) -* Extract openssl-1.0.1h.tar.gz -* Copy everything from **openssl-1.0.1h** to **/Users/user/TBuild/Libraries/openssl-xcode** +* Extract openssl-1.0.1h.tar.gz +* Copy everything from **openssl-1.0.1h** to **/Users/user/TBuild/Libraries/openssl-xcode** The folder include of openssl should be: **/Users/user/TBuild/Libraries/openssl-xcode/include** @@ -106,9 +106,9 @@ From https://github.com/telegramdesktop/libexif-0.6.20 with git in Terminal: or: -* download in ZIP +* download in ZIP * extract to **/Users/user/TBuild/Libraries** -* rename **libexif-0.6.20-master** to **libexif-0.6.20** +* rename **libexif-0.6.20-master** to **libexif-0.6.20** The folder configure should have this path: **/Users/user/TBuild/Libraries/libexif-0.6.20/configure** @@ -140,8 +140,8 @@ In Terminal go to **/Users/user/TBuild/Libraries/openal-soft/build** and there r ####Opus codec #####Get the source code -* Download sources [opus-1.1.tar.gz](http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz) from http://www.opus-codec.org/downloads/ -* Extract them to **/Users/user/TBuild/Libraries** +* Download sources [opus-1.1.tar.gz](http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz) from http://www.opus-codec.org/downloads/ +* Extract them to **/Users/user/TBuild/Libraries** * Rename opus-1.1 to opus to have **/Users/user/TBuild/Libraries/opus/configure** #####Building library @@ -210,11 +210,13 @@ In Terminal go to **/Users/user/TBuild/Libraries** and run: cd qtbase && git checkout v5.5.1 && cd .. #####Apply the patch -From **/Users/user/TBuild/Libraries/QtStatic/qtbase**, run: + +From **/Users/user/TBuild/Libraries/QtStatic/qtbase**, run: git apply ../../../tdesktop/Telegram/_qtbase_5_5_1_patch.diff #####Building library + Go to **/Users/user/TBuild/Libraries/QtStatic** and run: ./configure -debug-and-release -opensource -confirm-license -static -opengl desktop -no-openssl -securetransport -nomake examples -nomake tests -platform macx-clang @@ -223,6 +225,33 @@ Go to **/Users/user/TBuild/Libraries/QtStatic** and run: Building (**make** command) will take a really long time. +####Google Crashpad + +#####Install gyp + +In Terminal go to **/Users/user/TBuild/Libraries** and run: + + git clone https://chromium.googlesource.com/external/gyp + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + cd gyp + ./setup.py build + sudo setup.py install + cd .. + +#####Build crashpad + +In Terminal go to **/Users/user/TBuild/Libraries** and run: + + export PATH=/Users/user/TBuild/Libraries/depot_tools:$PATH:/Users/user/TBuild/Libraries/gyp + mkdir crashpad + cd crashpad + fetch crashpad + cd crashpad/third_party/mini_chromium/mini_chromium + git apply ../../../../../../tdesktop/Telegram/_mini_chromium_patch.diff + cd ../../../ + build/gyp_crashpad.py -Dmac_deployment_target=10.8 + ninja -C out/Release + ###Building Telegram Desktop * Launch Xcode, all projects will be taken from **/Users/user/TBuild/tdesktop/Telegram** From 80ba0259dd81db6648599d25353908037eef1ae7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Feb 2016 17:54:55 +0300 Subject: [PATCH 067/316] some namespaces reorganized, author photo display added to wide mode (where messages are centered), version 0.9.20.dev --- Telegram/Resources/style.txt | 5 +- Telegram/SourceFiles/app.cpp | 4 +- Telegram/SourceFiles/application.cpp | 35 +++-- Telegram/SourceFiles/application.h | 4 +- Telegram/SourceFiles/autoupdater.cpp | 10 +- Telegram/SourceFiles/config.h | 6 +- Telegram/SourceFiles/dialogswidget.cpp | 8 +- Telegram/SourceFiles/dropdown.cpp | 4 +- Telegram/SourceFiles/facades.cpp | 116 +++++++-------- Telegram/SourceFiles/facades.h | 52 ++++--- Telegram/SourceFiles/gui/popupmenu.cpp | 4 +- Telegram/SourceFiles/history.cpp | 38 +++-- Telegram/SourceFiles/history.h | 4 +- Telegram/SourceFiles/historywidget.cpp | 40 +++--- Telegram/SourceFiles/historywidget.h | 4 +- Telegram/SourceFiles/intro/intro.cpp | 9 +- Telegram/SourceFiles/intro/intro.h | 8 +- Telegram/SourceFiles/intro/introphone.cpp | 4 +- Telegram/SourceFiles/intro/introsteps.cpp | 2 +- Telegram/SourceFiles/layerwidget.cpp | 3 +- Telegram/SourceFiles/layerwidget.h | 2 +- Telegram/SourceFiles/logs.cpp | 6 +- Telegram/SourceFiles/mainwidget.cpp | 148 ++++++++++---------- Telegram/SourceFiles/mainwidget.h | 6 +- Telegram/SourceFiles/mediaview.cpp | 8 +- Telegram/SourceFiles/overviewwidget.cpp | 14 +- Telegram/SourceFiles/overviewwidget.h | 4 +- Telegram/SourceFiles/playerwidget.cpp | 8 +- Telegram/SourceFiles/playerwidget.h | 2 +- Telegram/SourceFiles/profilewidget.cpp | 12 +- Telegram/SourceFiles/profilewidget.h | 4 +- Telegram/SourceFiles/pspecific_mac_p.mm | 8 +- Telegram/SourceFiles/pspecific_wnd.cpp | 4 +- Telegram/SourceFiles/settings.cpp | 2 - Telegram/SourceFiles/settings.h | 2 - Telegram/SourceFiles/settingswidget.cpp | 36 ++--- Telegram/SourceFiles/settingswidget.h | 2 +- Telegram/SourceFiles/sysbuttons.cpp | 2 +- Telegram/SourceFiles/title.cpp | 44 +++--- Telegram/SourceFiles/title.h | 2 +- Telegram/SourceFiles/window.cpp | 73 +++++----- Telegram/SourceFiles/window.h | 2 +- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 +- Telegram/Telegram.xcodeproj/project.pbxproj | 12 +- Telegram/Version | 8 +- 46 files changed, 400 insertions(+), 381 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 71c0598a94..0cb9e073e3 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -51,7 +51,10 @@ color7: #2996ad; // sea color8: #ce671b; // orange wndMinWidth: 380px; -wideModeWidth: 640px; + +adaptiveNormalWidth: 640px; +adaptiveWideWidth: 1120px; + wndMinHeight: 480px; wndDefWidth: 800px; wndDefHeight: 600px; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index f68b037366..d36731ff79 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2612,10 +2612,10 @@ namespace App { QNetworkProxy getHttpProxySettings() { const ConnectionProxy *proxy = 0; - if (Sandbox::started()) { + if (Global::started()) { proxy = (cConnectionType() == dbictHttpProxy) ? (&cConnectionProxy()) : 0; } else { - proxy = Global::PreLaunchProxy().host.isEmpty() ? 0 : (&Global::PreLaunchProxy()); + proxy = Sandbox::PreLaunchProxy().host.isEmpty() ? 0 : (&Sandbox::PreLaunchProxy()); } if (proxy) { return QNetworkProxy(QNetworkProxy::HttpProxy, proxy->host, proxy->port, proxy->user, proxy->password); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 4938588524..3e7742c85b 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -75,6 +75,9 @@ namespace { if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { App::wnd()->minimizeToTray(); return true; + } else { + App::wnd()->close(); + return true; } } } @@ -178,7 +181,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) Application::~Application() { App::setQuiting(); - Global::finish(); + Sandbox::finish(); delete AppObject; @@ -277,7 +280,7 @@ void Application::singleInstanceChecked() { Logs::multipleInstances(); } - Global::start(); + Sandbox::start(); if (!Logs::started() || (!cManyInstance() && !Logs::instanceChecked())) { new NotStartedWindow(); @@ -286,17 +289,17 @@ void Application::singleInstanceChecked() { if (status == SignalHandlers::CantOpen) { new NotStartedWindow(); } else if (status == SignalHandlers::LastCrashed) { - if (Global::LastCrashDump().isEmpty()) { // don't handle bad closing for now + if (Sandbox::LastCrashDump().isEmpty()) { // don't handle bad closing for now if (SignalHandlers::restart() == SignalHandlers::CantOpen) { new NotStartedWindow(); } else { - Sandboxer::startSandbox(); + Sandbox::launch(); } } else { new LastCrashedWindow(); } } else { - Sandboxer::startSandbox(); + Sandbox::launch(); } } } @@ -328,7 +331,7 @@ void Application::readClients() { for (int32 to = cmds.indexOf(QChar(';'), from); to >= from; to = (from < l) ? cmds.indexOf(QChar(';'), from) : -1) { QStringRef cmd(&cmds, from, to - from); if (cmd.startsWith(qsl("CMD:"))) { - Sandboxer::execExternal(cmds.mid(from + 4, to - from - 4)); + Sandbox::execExternal(cmds.mid(from + 4, to - from - 4)); QByteArray response(qsl("RES:%1;").arg(QCoreApplication::applicationPid()).toLatin1()); i->first->write(response.data(), response.size()); } else if (cmd.startsWith(qsl("SEND:"))) { @@ -546,7 +549,7 @@ inline Application *application() { return qobject_cast(QApplication::instance()); } -namespace Sandboxer { +namespace Sandbox { QRect availableGeometry() { if (Application *a = application()) { @@ -665,7 +668,7 @@ namespace Sandboxer { } } - void startSandbox() { + void launch() { t_assert(application() != 0); float64 dpi = Application::primaryScreen()->logicalDotsPerInch(); @@ -699,7 +702,7 @@ AppClass::AppClass() : QObject() Fonts::start(); ThirdParty::start(); - Sandbox::start(); + Global::start(); Local::start(); if (Local::oldSettingsVersion() < AppVersion) { psNewVersion(); @@ -719,7 +722,7 @@ AppClass::AppClass() : QObject() } if (cLang() < languageTest) { - cSetLang(Global::LangSystem()); + cSetLang(Sandbox::LangSystem()); } if (cLang() == languageTest) { if (QFileInfo(cLangFile()).exists()) { @@ -752,7 +755,7 @@ AppClass::AppClass() : QObject() application()->installNativeEventFilter(psNativeEventFilter()); - Sandboxer::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); + Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause())); @@ -1048,8 +1051,12 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if (cDevVersion() && Local::oldMapVersion() < 9019) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Choose an emoticon and see the suggested stickers\n\xe2\x80\x94 Bug fixes in minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + if (cDevVersion() && Local::oldMapVersion() < 9020) { + if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + } else { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Ctrl+W or Ctrl+F4 closes Telegram window\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + } } else if (Local::oldMapVersion() < 9016) { versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); } else { @@ -1087,7 +1094,7 @@ AppClass::~AppClass() { style::stopManager(); Local::finish(); - Sandbox::finish(); + Global::finish(); ThirdParty::finish(); } diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index 48bf3e80f6..c5a11080f1 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -105,7 +105,7 @@ private: #endif }; -namespace Sandboxer { +namespace Sandbox { QRect availableGeometry(); QRect screenGeometry(const QPoint &p); @@ -135,7 +135,7 @@ namespace Sandboxer { void connect(const char *signal, QObject *object, const char *method); - void startSandbox(); + void launch(); } diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index 36cb2c8777..7471dde590 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -127,7 +127,7 @@ void UpdateChecker::partMetaGot() { full = m.captured(1).toInt(); } - Sandboxer::updateProgress(already, full); + Sandbox::updateProgress(already, full); } } } @@ -180,7 +180,7 @@ void UpdateChecker::partFinished(qint64 got, qint64 total) { outputFile.close(); unpackUpdate(); } else { - Sandboxer::updateProgress(already, full); + Sandbox::updateProgress(already, full); } } @@ -199,12 +199,12 @@ void UpdateChecker::partFailed(QNetworkReply::NetworkError e) { } } LOG(("Update Error: failed to download part starting from %1, error %2").arg(already).arg(e)); - Sandboxer::updateFailed(); + Sandbox::updateFailed(); } void UpdateChecker::fatalFail() { clearAll(); - Sandboxer::updateFailed(); + Sandbox::updateFailed(); } void UpdateChecker::clearAll() { @@ -466,7 +466,7 @@ void UpdateChecker::unpackUpdate() { } outputFile.remove(); - Sandboxer::updateReady(); + Sandbox::updateReady(); } UpdateChecker::~UpdateChecker() { diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 97c252ffaa..ef2a395159 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,10 +20,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9019; -static const wchar_t *AppVersionStr = L"0.9.19"; +static const int32 AppVersion = 9020; +static const wchar_t *AppVersionStr = L"0.9.20"; static const bool DevVersion = true; -#define BETA_VERSION (9019002ULL) // just comment this line to build public version +//#define BETA_VERSION (9019002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 690805a253..ca7b364e03 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -2268,7 +2268,7 @@ void DialogsWidget::dragEnterEvent(QDragEnterEvent *e) { _dragForward = e->mimeData()->hasFormat(qsl("application/x-td-forward-selected")); if (!_dragForward) _dragForward = e->mimeData()->hasFormat(qsl("application/x-td-forward-pressed-link")); if (!_dragForward) _dragForward = e->mimeData()->hasFormat(qsl("application/x-td-forward-pressed")); - if (_dragForward && !cWideMode()) _dragForward = false; + if (_dragForward && Adaptive::OneColumn()) _dragForward = false; if (_dragForward) { e->setDropAction(Qt::CopyAction); e->accept(); @@ -2540,7 +2540,7 @@ bool DialogsWidget::onCancelSearch() { _searchRequest = 0; } if (_searchInPeer && !clearing) { - if (!cWideMode()) { + if (Adaptive::OneColumn()) { Ui::showPeerHistory(_searchInPeer, ShowAtUnreadMsgId); } _searchInPeer = _searchInMigrated = 0; @@ -2560,7 +2560,7 @@ void DialogsWidget::onCancelSearchInPeer() { _searchRequest = 0; } if (_searchInPeer) { - if (!cWideMode() && !App::main()->selectingPeer()) { + if (Adaptive::OneColumn() && !App::main()->selectingPeer()) { Ui::showPeerHistory(_searchInPeer, ShowAtUnreadMsgId); } _searchInPeer = _searchInMigrated = 0; @@ -2570,7 +2570,7 @@ void DialogsWidget::onCancelSearchInPeer() { _filter.clear(); _filter.updatePlaceholder(); onFilterUpdate(); - if (cWideMode() && !App::main()->selectingPeer()) { + if (!Adaptive::OneColumn() && !App::main()->selectingPeer()) { emit cancelled(); } } diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 3fba9d150f..f4b9ac2a58 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4013,9 +4013,9 @@ void MentionsInner::paintEvent(QPaintEvent *e) { } } } - p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerBottom() - st::lineWidth, width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); + p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerBottom() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b); } - p.fillRect(cWideMode() ? st::lineWidth : 0, _parent->innerTop(), width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); + p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerTop(), width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b); } void MentionsInner::resizeEvent(QResizeEvent *e) { diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 12796df2bd..1013d65098 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -176,16 +176,31 @@ namespace Notify { } -struct GlobalDataStruct { +#define DefineReadOnlyVar(Namespace, Type, Name) const Type &Name() { \ + t_assert_full(Namespace##Data != 0, #Namespace "Data is null in " #Namespace "::" #Name, __FILE__, __LINE__); \ + return Namespace##Data->Name; \ +} +#define DefineRefVar(Namespace, Type, Name) DefineReadOnlyVar(Namespace, Type, Name) \ +Type &Ref##Name() { \ + t_assert_full(Namespace##Data != 0, #Namespace "Data is null in Global::Ref" #Name, __FILE__, __LINE__); \ + return Namespace##Data->Name; \ +} +#define DefineVar(Namespace, Type, Name) DefineRefVar(Namespace, Type, Name) \ +void Set##Name(const Type &Name) { \ + t_assert_full(Namespace##Data != 0, #Namespace "Data is null in Global::Set" #Name, __FILE__, __LINE__); \ + Namespace##Data->Name = Name; \ +} + +struct SandboxDataStruct { QString LangSystemISO; int32 LangSystem = languageDefault; QByteArray LastCrashDump; ConnectionProxy PreLaunchProxy; }; -GlobalDataStruct *GlobalData = 0; +SandboxDataStruct *SandboxData = 0; -namespace Global { +namespace Sandbox { bool CheckBetaVersionDir() { QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta")); @@ -248,14 +263,14 @@ namespace Global { } void start() { - GlobalData = new GlobalDataStruct(); + SandboxData = new SandboxDataStruct(); - GlobalData->LangSystemISO = psCurrentLanguage(); - if (GlobalData->LangSystemISO.isEmpty()) GlobalData->LangSystemISO = qstr("en"); + SandboxData->LangSystemISO = psCurrentLanguage(); + if (SandboxData->LangSystemISO.isEmpty()) SandboxData->LangSystemISO = qstr("en"); QByteArray l = LangSystemISO().toLatin1(); for (int32 i = 0; i < languageCount; ++i) { if (l.at(0) == LanguageCodes[i][0] && l.at(1) == LanguageCodes[i][1]) { - GlobalData->LangSystem = i; + SandboxData->LangSystem = i; break; } } @@ -263,69 +278,42 @@ namespace Global { srand((int32)time(NULL)); } - void finish() { - delete GlobalData; - GlobalData = 0; - } - -#define DefineGlobalReadOnly(Type, Name) const Type &Name() { \ - t_assert_full(GlobalData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ - return GlobalData->Name; \ -} -#define DefineGlobal(Type, Name) DefineGlobalReadOnly(Type, Name) \ -void Set##Name(const Type &Name) { \ - t_assert_full(GlobalData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ - GlobalData->Name = Name; \ -} \ -Type &Ref##Name() { \ - t_assert_full(GlobalData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ - return GlobalData->Name; \ -} - - DefineGlobalReadOnly(QString, LangSystemISO); - DefineGlobalReadOnly(int32, LangSystem); - DefineGlobal(QByteArray, LastCrashDump); - DefineGlobal(ConnectionProxy, PreLaunchProxy); - -} - -struct SandboxDataStruct { - uint64 LaunchId = 0; -}; -SandboxDataStruct *SandboxData = 0; - -namespace Sandbox { - - bool started() { - return SandboxData != 0; - } - - void start() { - SandboxData = new SandboxDataStruct(); - - memset_rand(&SandboxData->LaunchId, sizeof(SandboxData->LaunchId)); - } - void finish() { delete SandboxData; SandboxData = 0; } -#define DefineSandboxReadOnly(Type, Name) const Type &Name() { \ - t_assert_full(SandboxData != 0, "_data is null in Global::" #Name, __FILE__, __LINE__); \ - return SandboxData->Name; \ -} -#define DefineSandboxRef(Type, Name) DefineSandboxReadOnly(Type, Name) \ -Type &Ref##Name() { \ - t_assert_full(SandboxData != 0, "_data is null in Global::Ref" #Name, __FILE__, __LINE__); \ - return SandboxData->Name; \ -} -#define DefineSandbox(Type, Name) DefineSandboxRef(Type, Name) \ -void Set##Name(const Type &Name) { \ - t_assert_full(SandboxData != 0, "_data is null in Global::Set" #Name, __FILE__, __LINE__); \ - SandboxData->Name = Name; \ + DefineReadOnlyVar(Sandbox, QString, LangSystemISO); + DefineReadOnlyVar(Sandbox, int32, LangSystem); + DefineVar(Sandbox, QByteArray, LastCrashDump); + DefineVar(Sandbox, ConnectionProxy, PreLaunchProxy); + } - DefineSandboxReadOnly(uint64, LaunchId); +struct GlobalDataStruct { + uint64 LaunchId = 0; + Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; +}; +GlobalDataStruct *GlobalData = 0; + +namespace Global { + + bool started() { + return GlobalData != 0; + } + + void start() { + GlobalData = new GlobalDataStruct(); + + memset_rand(&GlobalData->LaunchId, sizeof(GlobalData->LaunchId)); + } + + void finish() { + delete GlobalData; + GlobalData = 0; + } + + DefineReadOnlyVar(Global, uint64, LaunchId); + DefineVar(Global, Adaptive::Layout, AdaptiveLayout); }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 4c528c4e7c..ca390d2c3c 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -96,7 +96,13 @@ namespace Notify { }; -namespace Global { +#define DeclareReadOnlyVar(Type, Name) const Type &Name(); +#define DeclareRefVar(Type, Name) DeclareReadOnlyVar(Type, Name) \ + Type &Ref##Name(); +#define DeclareVar(Type, Name) DeclareRefVar(Type, Name) \ + void Set##Name(const Type &Name); + +namespace Sandbox { bool CheckBetaVersionDir(); void WorkingDirReady(); @@ -104,30 +110,40 @@ namespace Global { void start(); void finish(); -#define DeclareGlobalReadOnly(Type, Name) const Type &Name(); -#define DeclareGlobal(Type, Name) DeclareGlobalReadOnly(Type, Name) \ - void Set##Name(const Type &Name); \ - Type &Ref##Name(); - - DeclareGlobalReadOnly(QString, LangSystemISO); - DeclareGlobalReadOnly(int32, LangSystem); - DeclareGlobal(QByteArray, LastCrashDump); - DeclareGlobal(ConnectionProxy, PreLaunchProxy); + DeclareReadOnlyVar(QString, LangSystemISO); + DeclareReadOnlyVar(int32, LangSystem); + DeclareVar(QByteArray, LastCrashDump); + DeclareVar(ConnectionProxy, PreLaunchProxy); } -namespace Sandbox { +namespace Adaptive { + enum Layout { + OneColumnLayout, + NormalLayout, + WideLayout, + }; +}; + +namespace Global { bool started(); void start(); void finish(); -#define DeclareSandboxReadOnly(Type, Name) const Type &Name(); -#define DeclareSandboxRef(Type, Name) DeclareSandboxReadOnly(Type, Name) \ - Type &Ref##Name(); -#define DeclareSandbox(Type, Name) DeclareSandboxRef(Type, Name) \ - void Set##Name(const Type &Name); - - DeclareSandboxReadOnly(uint64, LaunchId); + DeclareReadOnlyVar(uint64, LaunchId); + DeclareVar(Adaptive::Layout, AdaptiveLayout); }; + +namespace Adaptive { + inline bool OneColumn() { + return Global::AdaptiveLayout() == OneColumnLayout; + } + inline bool Normal() { + return Global::AdaptiveLayout() == NormalLayout; + } + inline bool Wide() { + return Global::AdaptiveLayout() == WideLayout; + } +} diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 46af26b768..f116dce00c 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -464,7 +464,7 @@ void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, PressSource source) _parent = parent; QPoint w = p - QPoint(0, _padding.top()); - QRect r = Sandboxer::screenGeometry(p); + QRect r = Sandbox::screenGeometry(p); if (rtl()) { if (w.x() - width() < r.x() - _padding.left()) { if (_parent && w.x() + _parent->width() - _padding.left() - _padding.right() + width() - _padding.right() <= r.x() + r.width()) { @@ -580,7 +580,7 @@ void PopupTooltip::popup(const QPoint &m, const QString &text, const style::Tool _hideByLeaveTimer.setSingleShot(true); connect(&_hideByLeaveTimer, SIGNAL(timeout()), this, SLOT(onHideByLeave())); - Sandboxer::installEventFilter(this); + Sandbox::installEventFilter(this); } _point = m; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8ac2eb7fe5..2f122ebf65 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2923,6 +2923,10 @@ void HistoryItem::setId(MsgId newId) { id = newId; } +bool HistoryItem::displayFromPhoto() const { + return Adaptive::Wide() || (!out() && !history()->peer->isUser() && !fromChannel()); +} + void HistoryItem::clipCallback(ClipReaderNotification notification) { HistoryMedia *media = getMedia(); if (!media) return; @@ -6209,27 +6213,27 @@ void HistoryMessage::initDimensions() { } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { - int32 mwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width; - if (_media && _media->currentWidth() < mwidth) { - mwidth = qMax(_media->currentWidth(), qMin(mwidth, plainMaxWidth())); + int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width, hmaxwidth = st::historyMaxWidth + (Adaptive::Wide() ? (2 * st::msgPhotoSkip) : 0); + if (_media && _media->currentWidth() < maxwidth) { + maxwidth = qMax(_media->currentWidth(), qMin(maxwidth, plainMaxWidth())); } left = 0; - if (hwidth > st::historyMaxWidth) { - left = (hwidth - st::historyMaxWidth) / 2; - hwidth = st::historyMaxWidth; + if (hwidth > hmaxwidth) { + left = (hwidth - hmaxwidth) / 2; + hwidth = hmaxwidth; } left += (!fromChannel() && out()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { - left += st::msgPhotoSkip; + left += (!fromChannel() && out()) ? -st::msgPhotoSkip : st::msgPhotoSkip; } width = hwidth - st::msgMargin.left() - st::msgMargin.right(); - if (width > mwidth) { + if (width > maxwidth) { if (!fromChannel() && out()) { - left += width - mwidth; + left += width - maxwidth; } - width = mwidth; + width = maxwidth; } } @@ -6480,7 +6484,8 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m } if (displayFromPhoto()) { - p.drawPixmap(left - st::msgPhotoSkip, _height - st::msgMargin.bottom() - st::msgPhotoSize, _from->photo->pixRounded(st::msgPhotoSize)); + int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + p.drawPixmap(photoleft, _height - st::msgMargin.bottom() - st::msgPhotoSize, _from->photo->pixRounded(st::msgPhotoSize)); } if (width < 1) return; @@ -6647,7 +6652,8 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - if (x >= left - st::msgPhotoSkip && x < left - st::msgPhotoSkip + st::msgPhotoSize && y >= _height - st::msgMargin.bottom() - st::msgPhotoSize && y < _height - st::msgMargin.bottom()) { + int32 photoleft = left + ((!fromChannel() && out()) ? (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()) { lnk = _from->lnk; return; } @@ -6911,7 +6917,8 @@ void HistoryForwarded::getState(TextLinkPtr &lnk, HistoryCursorState &state, int int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - if (x >= left - st::msgPhotoSkip && x < left - st::msgPhotoSkip + st::msgPhotoSize) { + int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + if (x >= photoleft && x < photoleft + st::msgPhotoSize) { return HistoryMessage::getState(lnk, state, x, y); } } @@ -7230,8 +7237,9 @@ void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x if (drawBubble()) { int32 left = 0, width = 0; countPositionAndSize(left, width); - if (displayFromPhoto()) { // from user left photo - if (x >= left - st::msgPhotoSkip && x < left - st::msgPhotoSkip + st::msgPhotoSize) { + if (displayFromPhoto()) { + int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + if (x >= photoleft && x < photoleft + st::msgPhotoSize) { return HistoryMessage::getState(lnk, state, x, y); } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index dfeb4d2b94..b1a321eb3b 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1020,9 +1020,7 @@ public: bool hasFromName() const { return (!out() || fromChannel()) && !history()->peer->isUser(); } - bool displayFromPhoto() const { - return !out() && !history()->peer->isUser() && !fromChannel(); - } + bool displayFromPhoto() const; void clipCallback(ClipReaderNotification notification); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e68ae11835..e8af2e8972 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -630,7 +630,7 @@ void HistoryInner::onDragExec() { mimeData->setText(sel); if (!urls.isEmpty()) mimeData->setUrls(urls); - if (uponSelected && !_selected.isEmpty() && _selected.cbegin().value() == FullSelection && cWideMode()) { + if (uponSelected && !_selected.isEmpty() && _selected.cbegin().value() == FullSelection && !Adaptive::OneColumn()) { mimeData->setData(qsl("application/x-td-forward-selected"), "1"); } drag->setMimeData(mimeData); @@ -1987,7 +1987,7 @@ void ReportSpamPanel::resizeEvent(QResizeEvent *e) { void ReportSpamPanel::paintEvent(QPaintEvent *e) { Painter p(this); p.fillRect(QRect(0, 0, width(), height() - st::lineWidth), st::reportSpamBg->b); - p.fillRect(cWideMode() ? st::lineWidth : 0, height() - st::lineWidth, width() - (cWideMode() ? st::lineWidth : 0), st::lineWidth, st::shadowColor->b); + p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, height() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowColor->b); if (!_clear.isHidden()) { p.setPen(st::black->p); p.setFont(st::msgFont->f); @@ -2473,15 +2473,15 @@ void HistoryHider::mousePressEvent(QMouseEvent *e) { void HistoryHider::startHide() { if (hiding) return; hiding = true; - if (cWideMode()) { + if (Adaptive::OneColumn()) { + QTimer::singleShot(0, this, SLOT(deleteLater())); + } else { if (offered) cacheForAnim = myGrab(this, box); if (_forwardRequest) MTP::cancel(_forwardRequest); a_opacity.start(0); _send.hide(); _cancel.hide(); _a_appearance.start(); - } else { - QTimer::singleShot(0, this, SLOT(deleteLater())); } } @@ -2801,7 +2801,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) _attachDragPhoto.hide(); _topShadow.hide(); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); connect(&_attachDragDocument, SIGNAL(dropped(const QMimeData*)), this, SLOT(onDocumentDrop(const QMimeData*))); connect(&_attachDragPhoto, SIGNAL(dropped(const QMimeData*)), this, SLOT(onPhotoDrop(const QMimeData*))); @@ -4671,7 +4671,7 @@ void HistoryWidget::step_show(float64 ms, bool timer) { float64 dt = ms / st::slideDuration; if (dt >= 1) { _a_show.stop(); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _topShadow.setVisible(_peer ? true : false); a_coordUnder.finish(); @@ -4705,14 +4705,14 @@ void HistoryWidget::doneShow() { } } -void HistoryWidget::updateWideMode() { - _sideShadow.setVisible(cWideMode()); +void HistoryWidget::updateAdaptiveLayout() { + _sideShadow.setVisible(!Adaptive::OneColumn()); } void HistoryWidget::animStop() { if (!_a_show.animating()) return; _a_show.stop(); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _topShadow.setVisible(_peer ? true : false); } @@ -5301,7 +5301,7 @@ void HistoryWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) if (!_history) return; - int32 increaseLeft = cWideMode() ? 0 : (st::topBarForwardPadding.right() - st::topBarForwardPadding.left()); + int32 increaseLeft = Adaptive::OneColumn() ? (st::topBarForwardPadding.right() - st::topBarForwardPadding.left()) : 0; decreaseWidth += increaseLeft; QRect rectForName(st::topBarForwardPadding.left() + increaseLeft, st::topBarForwardPadding.top(), width() - decreaseWidth - st::topBarForwardPadding.left() - st::topBarForwardPadding.right(), st::msgNameFont->height); p.setFont(st::dlgHistFont->f); @@ -5316,20 +5316,20 @@ void HistoryWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) p.setPen(st::dlgNameColor->p); _peer->dialogName().drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); - if (cWideMode()) { - p.setOpacity(st::topBarForwardAlpha + (1 - st::topBarForwardAlpha) * over); - p.drawPixmap(QPoint(width() - (st::topBarForwardPadding.right() + st::topBarForwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarForwardImg.pxHeight()) / 2), App::sprite(), st::topBarForwardImg); - } else { + if (Adaptive::OneColumn()) { p.setOpacity(st::topBarForwardAlpha + (1 - st::topBarForwardAlpha) * over); p.drawPixmap(QPoint((st::topBarForwardPadding.right() - st::topBarBackwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarBackwardImg.pxHeight()) / 2), App::sprite(), st::topBarBackwardImg); + } else { + p.setOpacity(st::topBarForwardAlpha + (1 - st::topBarForwardAlpha) * over); + p.drawPixmap(QPoint(width() - (st::topBarForwardPadding.right() + st::topBarForwardImg.pxWidth()) / 2, (st::topBarHeight - st::topBarForwardImg.pxHeight()) / 2), App::sprite(), st::topBarForwardImg); } } void HistoryWidget::topBarClick() { - if (cWideMode()) { - if (_history) App::main()->showPeerProfile(_peer); - } else { + if (Adaptive::OneColumn()) { Ui::showChatsList(); + } else { + if (_history) App::main()->showPeerProfile(_peer); } } @@ -5973,8 +5973,8 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { break; } - _topShadow.resize(width() - ((cWideMode() && !_inGrab) ? st::lineWidth : 0), st::lineWidth); - _topShadow.moveToLeft((cWideMode() && !_inGrab) ? st::lineWidth : 0, 0); + _topShadow.resize(width() - ((!Adaptive::OneColumn() && !_inGrab) ? st::lineWidth : 0), st::lineWidth); + _topShadow.moveToLeft((!Adaptive::OneColumn() && !_inGrab) ? st::lineWidth : 0, 0); _sideShadow.resize(st::lineWidth, height()); _sideShadow.moveToLeft(0, 0); } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index b0c454eb7a..eda8743a12 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -486,7 +486,7 @@ public: void step_show(float64 ms, bool timer); void animStop(); - void updateWideMode(); + void updateAdaptiveLayout(); void doneShow(); QPoint clampMousePosition(QPoint point); @@ -562,7 +562,7 @@ public: resizeEvent(0); } void grabFinish() { - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _inGrab = false; resizeEvent(0); } diff --git a/Telegram/SourceFiles/intro/intro.cpp b/Telegram/SourceFiles/intro/intro.cpp index 71eb5dad83..c62b8d55cb 100644 --- a/Telegram/SourceFiles/intro/intro.cpp +++ b/Telegram/SourceFiles/intro/intro.cpp @@ -46,9 +46,9 @@ namespace { countryForReg = nearest.vcountry.c_string().v.c_str(); emit signalEmitOn->countryChanged(); } - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - Sandboxer::startUpdateCheck(); - #endif +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + Sandbox::startUpdateCheck(); +#endif } } @@ -425,8 +425,7 @@ void IntroWidget::keyPressEvent(QKeyEvent *e) { } } -void IntroWidget::updateWideMode() { - +void IntroWidget::updateAdaptiveLayout() { } void IntroWidget::rpcInvalidate() { diff --git a/Telegram/SourceFiles/intro/intro.h b/Telegram/SourceFiles/intro/intro.h index 5697c1bee0..7ce176f0ca 100644 --- a/Telegram/SourceFiles/intro/intro.h +++ b/Telegram/SourceFiles/intro/intro.h @@ -40,13 +40,13 @@ public: void resizeEvent(QResizeEvent *e); void mousePressEvent(QMouseEvent *e); void keyPressEvent(QKeyEvent *e); - - void updateWideMode(); + + void updateAdaptiveLayout(); void animShow(const QPixmap &bgAnimCache, bool back = false); void step_show(float64 ms, bool timer); void stop_show(); - + void step_stage(float64 ms, bool timer); QRect innerRect() const; @@ -150,7 +150,7 @@ public: } protected: - + IntroWidget *intro() { return qobject_cast(parent()); } diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index bb2372d7b8..482e478111 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -230,7 +230,7 @@ void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) { checkRequest.start(1000); - sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(5), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Global::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(5), 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); @@ -260,7 +260,7 @@ void IntroPhone::toSignUp() { checkRequest.start(1000); - sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(0), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Global::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(0), 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/intro/introsteps.cpp b/Telegram/SourceFiles/intro/introsteps.cpp index 87359c9a89..d55c7ccad8 100644 --- a/Telegram/SourceFiles/intro/introsteps.cpp +++ b/Telegram/SourceFiles/intro/introsteps.cpp @@ -36,7 +36,7 @@ _next(this, lang(lng_start_msgs), st::btnIntroNext) { _changeLang.hide(); if (cLang() == languageDefault) { - int32 l = Global::LangSystem(); + int32 l = Sandbox::LangSystem(); if (l != languageDefault) { LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[l] + qsl(".strings"), LangLoaderRequest(lng_switch_to_this)); QString text = loader.found().value(lng_switch_to_this); diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp index e419334a22..63a1c0ec68 100644 --- a/Telegram/SourceFiles/layerwidget.cpp +++ b/Telegram/SourceFiles/layerwidget.cpp @@ -125,8 +125,7 @@ void BackgroundWidget::resizeEvent(QResizeEvent *e) { w->parentResized(); } -void BackgroundWidget::updateWideMode() { - +void BackgroundWidget::updateAdaptiveLayout() { } void BackgroundWidget::replaceInner(LayeredWidget *n) { diff --git a/Telegram/SourceFiles/layerwidget.h b/Telegram/SourceFiles/layerwidget.h index 8729dc7c6b..6ec55cd245 100644 --- a/Telegram/SourceFiles/layerwidget.h +++ b/Telegram/SourceFiles/layerwidget.h @@ -71,7 +71,7 @@ public: void mousePressEvent(QMouseEvent *e); void resizeEvent(QResizeEvent *e); - void updateWideMode(); + void updateAdaptiveLayout(); void replaceInner(LayeredWidget *n); void showLayerLast(LayeredWidget *n); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index c8061a4f9b..1f3e02b547 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -295,7 +295,7 @@ namespace Logs { Initializer::Initializer() { t_assert(LogsData == 0); - if (!Global::CheckBetaVersionDir()) { + if (!Sandbox::CheckBetaVersionDir()) { return; } bool workingDirChosen = cBetaVersion(); @@ -336,7 +336,7 @@ namespace Logs { QDir().setCurrent(cWorkingDir()); QDir().mkpath(cWorkingDir() + qstr("tdata")); - Global::WorkingDirReady(); + Sandbox::WorkingDirReady(); SignalHandlers::StartBreakpad(); if (!LogsData->openMain()) { @@ -940,7 +940,7 @@ namespace SignalHandlers { } fclose(f); - Global::SetLastCrashDump(lastdump); + Sandbox::SetLastCrashDump(lastdump); LOG(("Opened '%1' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: %2").arg(QString::fromUtf8(CrashDumpPath)).arg(lastdump.size())); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index f21e981dd4..e91ac44112 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -282,7 +282,7 @@ void TopBarWidget::startAnim() { void TopBarWidget::stopAnim() { _animating = false; - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); showAll(); } @@ -346,13 +346,13 @@ void TopBarWidget::showAll() { _mediaType.hide(); } } - if (App::main() && App::main()->historyPeer() && !o && !p && _clearSelection.isHidden() && !cWideMode()) { + if (App::main() && App::main()->historyPeer() && !o && !p && _clearSelection.isHidden() && Adaptive::OneColumn()) { _info.show(); } else { _info.hide(); } } - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); resizeEvent(0); } @@ -367,7 +367,7 @@ void TopBarWidget::showSelected(uint32 selCount, bool canDelete) { showAll(); } -void TopBarWidget::updateWideMode() { +void TopBarWidget::updateAdaptiveLayout() { showAll(); } @@ -453,10 +453,10 @@ MainWidget::MainWidget(Window *window) : TWidget(window) connect(&_cacheBackgroundTimer, SIGNAL(timeout()), this, SLOT(onCacheBackground())); dialogs.show(); - if (cWideMode()) { - history.show(); - } else { + if (Adaptive::OneColumn()) { history.hide(); + } else { + history.show(); } App::wnd()->getTitle()->updateBackButton(); _topBar.hide(); @@ -715,7 +715,7 @@ QPixmap MainWidget::grabInner() { return myGrab(overview); } else if (profile && !profile->isHidden()) { return myGrab(profile); - } else if (!cWideMode() && history.isHidden()) { + } else if (Adaptive::OneColumn() && history.isHidden()) { return myGrab(&dialogs, QRect(0, st::topBarHeight, dialogs.width(), dialogs.height() - st::topBarHeight)); } else if (history.peer()) { return myGrab(&history); @@ -734,7 +734,7 @@ bool MainWidget::isItemVisible(HistoryItem *item) { QPixmap MainWidget::grabTopBar() { if (!_topBar.isHidden()) { return myGrab(&_topBar); - } else if (!cWideMode() && history.isHidden()) { + } else if (Adaptive::OneColumn() && history.isHidden()) { return myGrab(&dialogs, QRect(0, 0, dialogs.width(), st::topBarHeight)); } else { return myGrab(&history, QRect(0, 0, history.width(), st::topBarHeight)); @@ -838,12 +838,7 @@ void MainWidget::notify_historyItemResized(const HistoryItem *item, bool scrollT void MainWidget::noHider(HistoryHider *destroyed) { if (_hider == destroyed) { _hider = 0; - if (cWideMode()) { - if (_forwardConfirm) { - _forwardConfirm->deleteLater(); - _forwardConfirm = 0; - } - } else { + if (Adaptive::OneColumn()) { if (_forwardConfirm) { _forwardConfirm->startHide(); _forwardConfirm = 0; @@ -864,6 +859,11 @@ void MainWidget::noHider(HistoryHider *destroyed) { } } App::wnd()->getTitle()->updateBackButton(); + } else { + if (_forwardConfirm) { + _forwardConfirm->deleteLater(); + _forwardConfirm = 0; + } } } } @@ -876,11 +876,7 @@ void MainWidget::hiderLayer(HistoryHider *h) { _hider = h; connect(_hider, SIGNAL(forwarded()), &dialogs, SLOT(onCancelSearch())); - if (cWideMode()) { - _hider->show(); - resizeEvent(0); - dialogs.activate(); - } else { + if (Adaptive::OneColumn()) { dialogsToUp(); _hider->hide(); @@ -898,6 +894,10 @@ void MainWidget::hiderLayer(HistoryHider *h) { resizeEvent(0); dialogs.animShow(animCache); App::wnd()->getTitle()->updateBackButton(); + } else { + _hider->show(); + resizeEvent(0); + dialogs.activate(); } } @@ -937,7 +937,7 @@ bool MainWidget::selectingPeer(bool withConfirm) { void MainWidget::offerPeer(PeerId peer) { Ui::hideLayer(); - if (_hider->offerPeer(peer) && !cWideMode()) { + if (_hider->offerPeer(peer) && Adaptive::OneColumn()) { _forwardConfirm = new ConfirmBox(_hider->offeredText(), lang(lng_forward_send)); connect(_forwardConfirm, SIGNAL(confirmed()), _hider, SLOT(forward())); connect(_forwardConfirm, SIGNAL(cancelled()), this, SLOT(onForwardCancel())); @@ -1402,7 +1402,7 @@ bool MainWidget::insertBotCommand(const QString &cmd, bool specialGif) { void MainWidget::searchMessages(const QString &query, PeerData *inPeer) { App::wnd()->hideMediaview(); dialogs.searchMessages(query, inPeer); - if (!cWideMode()) { + if (Adaptive::OneColumn()) { Ui::showChatsList(); } else { dialogs.activate(); @@ -2286,15 +2286,15 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool bac } QPixmap animCache, animTopBarCache; - if (!_a_show.animating() && ((history.isHidden() && (profile || overview)) || (!cWideMode() && (history.isHidden() || !peerId)))) { + if (!_a_show.animating() && ((history.isHidden() && (profile || overview)) || (Adaptive::OneColumn() && (history.isHidden() || !peerId)))) { if (peerId) { animCache = grabInner(); - } else if (cWideMode()) { - animCache = myGrab(this, QRect(_dialogsWidth, _playerHeight, width() - _dialogsWidth, height() - _playerHeight)); - } else { + } else if (Adaptive::OneColumn()) { animCache = myGrab(this, QRect(0, _playerHeight, _dialogsWidth, height() - _playerHeight)); + } else { + animCache = myGrab(this, QRect(_dialogsWidth, _playerHeight, width() - _dialogsWidth, height() - _playerHeight)); } - if (peerId || cWideMode()) { + if (peerId || !Adaptive::OneColumn()) { animTopBarCache = grabTopBar(); } history.show(); @@ -2302,7 +2302,7 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool bac if (history.peer() && history.peer()->id != peerId) clearBotStartToken(history.peer()); history.showHistory(peerId, showAtMsgId); - bool noPeer = (!history.peer() || !history.peer()->id), onlyDialogs = noPeer && !cWideMode(); + bool noPeer = (!history.peer() || !history.peer()->id), onlyDialogs = noPeer && Adaptive::OneColumn(); if (profile || overview) { if (profile) { profile->hide(); @@ -2343,7 +2343,7 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool bac } _viewsIncremented.remove(activePeer()); } - if (!cWideMode() && !dialogs.isHidden()) dialogs.hide(); + if (Adaptive::OneColumn() && !dialogs.isHidden()) dialogs.hide(); if (!_a_show.animating()) { if (history.isHidden()) history.show(); if (!animCache.isNull()) { @@ -2437,7 +2437,7 @@ void MainWidget::showMediaOverview(PeerData *peer, MediaOverviewType type, bool QRect topBarRect = QRect(_topBar.x(), _topBar.y(), _topBar.width(), st::topBarHeight); QRect historyRect = QRect(history.x(), topBarRect.y() + topBarRect.height(), history.width(), history.y() + history.height() - topBarRect.y() - topBarRect.height()); QPixmap animCache, animTopBarCache; - if (!_a_show.animating() && (!cWideMode() || profile || overview || history.peer())) { + if (!_a_show.animating() && (Adaptive::OneColumn() || profile || overview || history.peer())) { animCache = grabInner(); animTopBarCache = grabTopBar(); } @@ -2481,7 +2481,7 @@ void MainWidget::showMediaOverview(PeerData *peer, MediaOverviewType type, bool if (back) clearBotStartToken(history.peer()); history.showHistory(0, 0); history.hide(); - if (!cWideMode()) dialogs.hide(); + if (Adaptive::OneColumn()) dialogs.hide(); orderWidgets(); @@ -2531,7 +2531,7 @@ void MainWidget::showPeerProfile(PeerData *peer, bool back, int32 lastScrollTop) if (back) clearBotStartToken(history.peer()); history.showHistory(0, 0); history.hide(); - if (!cWideMode()) dialogs.hide(); + if (Adaptive::OneColumn()) dialogs.hide(); orderWidgets(); @@ -2728,27 +2728,7 @@ void MainWidget::showAll() { cSetPasswordRecovered(false); Ui::showLayer(new InformBox(lang(lng_signin_password_removed))); } - if (cWideMode()) { - if (_hider) { - _hider->show(); - if (_forwardConfirm) { - Ui::hideLayer(true); - _forwardConfirm = 0; - } - } - dialogs.show(); - if (overview) { - overview->show(); - } else if (profile) { - profile->show(); - } else { - history.show(); - history.resizeEvent(0); - } - if (profile || overview || history.peer()) { - _topBar.show(); - } - } else { + if (Adaptive::OneColumn()) { if (_hider) { _hider->hide(); if (!_forwardConfirm && _hider->wasOffered()) { @@ -2779,6 +2759,26 @@ void MainWidget::showAll() { _topBar.show(); dialogs.hide(); } + } else { + if (_hider) { + _hider->show(); + if (_forwardConfirm) { + Ui::hideLayer(true); + _forwardConfirm = 0; + } + } + dialogs.show(); + if (overview) { + overview->show(); + } else if (profile) { + profile->show(); + } else { + history.show(); + history.resizeEvent(0); + } + if (profile || overview || history.peer()) { + _topBar.show(); + } } if (audioPlayer()) { SongMsgId playing; @@ -2802,7 +2802,14 @@ void MainWidget::showAll() { void MainWidget::resizeEvent(QResizeEvent *e) { int32 tbh = _topBar.isHidden() ? 0 : st::topBarHeight; - if (cWideMode()) { + if (Adaptive::OneColumn()) { + _dialogsWidth = width(); + _player.setGeometry(0, 0, _dialogsWidth, _player.height()); + dialogs.setGeometry(0, _playerHeight, _dialogsWidth, height() - _playerHeight); + _topBar.setGeometry(0, _playerHeight, _dialogsWidth, st::topBarHeight); + history.setGeometry(0, _playerHeight + tbh, _dialogsWidth, height() - _playerHeight - tbh); + if (_hider) _hider->setGeometry(0, 0, _dialogsWidth, height()); + } else { _dialogsWidth = snap((width() * 5) / 14, st::dlgMinWidth, st::dlgMaxWidth); dialogs.resize(_dialogsWidth, height()); dialogs.moveToLeft(0, 0); @@ -2816,13 +2823,6 @@ void MainWidget::resizeEvent(QResizeEvent *e) { _hider->resize(width() - _dialogsWidth, height()); _hider->moveToLeft(_dialogsWidth, 0); } - } else { - _dialogsWidth = width(); - _player.setGeometry(0, 0, _dialogsWidth, _player.height()); - dialogs.setGeometry(0, _playerHeight, _dialogsWidth, height() - _playerHeight); - _topBar.setGeometry(0, _playerHeight, _dialogsWidth, st::topBarHeight); - history.setGeometry(0, _playerHeight + tbh, _dialogsWidth, height() - _playerHeight - tbh); - if (_hider) _hider->setGeometry(0, 0, _dialogsWidth, height()); } _mediaType.moveToLeft(width() - _mediaType.width(), _playerHeight + st::topBarHeight); if (profile) profile->setGeometry(history.geometry()); @@ -2838,13 +2838,13 @@ int32 MainWidget::contentScrollAddToY() const { void MainWidget::keyPressEvent(QKeyEvent *e) { } -void MainWidget::updateWideMode() { +void MainWidget::updateAdaptiveLayout() { showAll(); - _topBar.updateWideMode(); - history.updateWideMode(); - if (overview) overview->updateWideMode(); - if (profile) profile->updateWideMode(); - _player.updateWideMode(); + _topBar.updateAdaptiveLayout(); + history.updateAdaptiveLayout(); + if (overview) overview->updateAdaptiveLayout(); + if (profile) profile->updateAdaptiveLayout(); + _player.updateAdaptiveLayout(); } bool MainWidget::needBackButton() { @@ -2910,7 +2910,7 @@ void MainWidget::onTopBarClick() { } void MainWidget::onHistoryShown(History *history, MsgId atMsgId) { - if ((cWideMode() || !selectingPeer()) && (profile || overview || history)) { + if ((!Adaptive::OneColumn() || !selectingPeer()) && (profile || overview || history)) { _topBar.show(); } else { _topBar.hide(); @@ -2925,11 +2925,11 @@ void MainWidget::onHistoryShown(History *history, MsgId atMsgId) { void MainWidget::searchInPeer(PeerData *peer) { dialogs.searchInPeer(peer); - if (cWideMode()) { - dialogs.activate(); - } else { + if (Adaptive::OneColumn()) { dialogsToUp(); Ui::showChatsList(); + } else { + dialogs.activate(); } } @@ -3458,9 +3458,9 @@ void MainWidget::start(const MTPUser &user) { cSetOtherOnline(0); App::feedUsers(MTP_vector(1, user)); - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - Sandboxer::startUpdateCheck(); - #endif +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + Sandbox::startUpdateCheck(); +#endif MTP::send(MTPupdates_GetState(), rpcDone(&MainWidget::gotState)); update(); if (!cStartUrl().isEmpty()) { diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 4470adaf00..44e9e2accb 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -55,7 +55,7 @@ public: void showAll(); void showSelected(uint32 selCount, bool canDelete = false); - void updateWideMode(); + void updateAdaptiveLayout(); FlatButton *mediaTypeButton(); @@ -63,7 +63,7 @@ public: _sideShadow.hide(); } void grabFinish() { - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); } public slots: @@ -192,7 +192,7 @@ public: void resizeEvent(QResizeEvent *e); void keyPressEvent(QKeyEvent *e); - void updateWideMode(); + void updateAdaptiveLayout(); bool needBackButton(); void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth); diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 94d00c2e3f..84af93dba5 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -179,7 +179,7 @@ void MediaView::moveToScreen() { } QPoint wndCenter(App::wnd()->x() + App::wnd()->width() / 2, App::wnd()->y() + App::wnd()->height() / 2); - QRect avail = Sandboxer::screenGeometry(wndCenter); + QRect avail = Sandbox::screenGeometry(wndCenter); if (avail != geometry()) { setGeometry(avail); } @@ -586,7 +586,7 @@ void MediaView::onSaveAs() { } } activateWindow(); - Sandboxer::setActiveWindow(this); + Sandbox::setActiveWindow(this); setFocus(); } @@ -1074,7 +1074,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty show(); psShowOverAll(this); activateWindow(); - Sandboxer::setActiveWindow(this); + Sandbox::setActiveWindow(this); setFocus(); } } @@ -1990,7 +1990,7 @@ void MediaView::onCheckActive() { if (App::wnd() && isVisible()) { if (App::wnd()->isActiveWindow() && App::wnd()->hasFocus()) { activateWindow(); - Sandboxer::setActiveWindow(this); + Sandbox::setActiveWindow(this); setFocus(); } } diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index dd53bfa50e..0c9c0698ba 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -623,7 +623,7 @@ void OverviewInner::onDragExec() { QList urls; bool forwardSelected = false; if (uponSelected) { - forwardSelected = !_selected.isEmpty() && _selected.cbegin().value() == FullSelection && cWideMode(); + forwardSelected = !_selected.isEmpty() && _selected.cbegin().value() == FullSelection && !Adaptive::OneColumn(); } else if (textlnkDown()) { sel = textlnkDown()->encoded(); if (!sel.isEmpty() && sel.at(0) != '/' && sel.at(0) != '@' && sel.at(0) != '#') { @@ -2007,7 +2007,7 @@ OverviewWidget::OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewTyp _scroll.move(0, 0); _inner.move(0, 0); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); updateScrollColors(); @@ -2058,8 +2058,8 @@ void OverviewWidget::resizeEvent(QResizeEvent *e) { } _noDropResizeIndex = false; - _topShadow.resize(width() - ((cWideMode() && !_inGrab) ? st::lineWidth : 0), st::lineWidth); - _topShadow.moveToLeft((cWideMode() && !_inGrab) ? st::lineWidth : 0, 0); + _topShadow.resize(width() - ((!Adaptive::OneColumn() && !_inGrab) ? st::lineWidth : 0), st::lineWidth); + _topShadow.moveToLeft((!Adaptive::OneColumn() && !_inGrab) ? st::lineWidth : 0, 0); _sideShadow.resize(st::lineWidth, height()); _sideShadow.moveToLeft(0, 0); } @@ -2240,7 +2240,7 @@ void OverviewWidget::step_show(float64 ms, bool timer) { float64 dt = ms / st::slideDuration; if (dt >= 1) { _a_show.stop(); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _topShadow.show(); a_coordUnder.finish(); @@ -2263,8 +2263,8 @@ void OverviewWidget::step_show(float64 ms, bool timer) { } } -void OverviewWidget::updateWideMode() { - _sideShadow.setVisible(cWideMode()); +void OverviewWidget::updateAdaptiveLayout() { + _sideShadow.setVisible(!Adaptive::OneColumn()); } void OverviewWidget::doneShow() { diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index b6c63428c5..58d1efbd54 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -271,7 +271,7 @@ public: void animShow(const QPixmap &oldAnimCache, const QPixmap &bgAnimTopBarCache, bool back = false, int32 lastScrollTop = -1); void step_show(float64 ms, bool timer); - void updateWideMode(); + void updateAdaptiveLayout(); void doneShow(); void mediaOverviewUpdated(PeerData *peer, MediaOverviewType type); @@ -297,7 +297,7 @@ public: resizeEvent(0); } void grabFinish() { - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _inGrab = false; resizeEvent(0); } diff --git a/Telegram/SourceFiles/playerwidget.cpp b/Telegram/SourceFiles/playerwidget.cpp index 3ced88806c..7fdaa1b6dd 100644 --- a/Telegram/SourceFiles/playerwidget.cpp +++ b/Telegram/SourceFiles/playerwidget.cpp @@ -59,7 +59,7 @@ PlayerWidget::PlayerWidget(QWidget *parent) : TWidget(parent) resize(st::wndMinWidth, st::playerHeight); setMouseTracking(true); memset(_stateHovers, 0, sizeof(_stateHovers)); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); } void PlayerWidget::paintEvent(QPaintEvent *e) { @@ -364,8 +364,8 @@ void PlayerWidget::mediaOverviewUpdated(PeerData *peer, MediaOverviewType type) } } -void PlayerWidget::updateWideMode() { - _sideShadow.setVisible(cWideMode()); +void PlayerWidget::updateAdaptiveLayout() { + _sideShadow.setVisible(!Adaptive::OneColumn()); } bool PlayerWidget::seekingSong(const SongMsgId &song) const { @@ -551,7 +551,7 @@ void PlayerWidget::stopPressed() { void PlayerWidget::resizeEvent(QResizeEvent *e) { int32 availh = (height() - st::playerLineHeight); int32 ch = st::playerPlay.pxHeight() + st::playerSkip, ct = (availh - ch) / 2; - _playbackRect = QRect(cWideMode() ? st::lineWidth : 0, height() - st::playerMoverSize.height(), width() - (cWideMode() ? st::lineWidth : 0), st::playerMoverSize.height()); + _playbackRect = QRect(Adaptive::OneColumn() ? 0 : st::lineWidth, height() - st::playerMoverSize.height(), width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::playerMoverSize.height()); _prevRect = _fullAvailable ? QRect(st::playerSkip / 2, ct, st::playerPrev.pxWidth() + st::playerSkip, ch) : QRect(); _playRect = QRect(_fullAvailable ? (_prevRect.x() + _prevRect.width()) : (st::playerSkip / 2), ct, st::playerPlay.pxWidth() + st::playerSkip, ch); _nextRect = _fullAvailable ? QRect(_playRect.x() + _playRect.width(), ct, st::playerNext.pxWidth() + st::playerSkip, ch) : QRect(); diff --git a/Telegram/SourceFiles/playerwidget.h b/Telegram/SourceFiles/playerwidget.h index 2dacfcad99..3c5cffbd3a 100644 --- a/Telegram/SourceFiles/playerwidget.h +++ b/Telegram/SourceFiles/playerwidget.h @@ -51,7 +51,7 @@ public: void clearSelection(); void mediaOverviewUpdated(PeerData *peer, MediaOverviewType type); - void updateWideMode(); + void updateAdaptiveLayout(); bool seekingSong(const SongMsgId &song) const; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 0c69c8421c..a98dee9507 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1731,7 +1731,7 @@ ProfileWidget::ProfileWidget(QWidget *parent, PeerData *peer) : TWidget(parent) _inner.move(0, 0); _scroll.show(); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); connect(&_scroll, SIGNAL(scrolled()), &_inner, SLOT(updateSelected())); connect(&_scroll, SIGNAL(scrolled()), this, SLOT(onScroll())); @@ -1763,8 +1763,8 @@ void ProfileWidget::resizeEvent(QResizeEvent *e) { } } - _topShadow.resize(width() - ((cWideMode() && !_inGrab) ? st::lineWidth : 0), st::lineWidth); - _topShadow.moveToLeft((cWideMode() && !_inGrab) ? st::lineWidth : 0, 0); + _topShadow.resize(width() - ((!Adaptive::OneColumn() && !_inGrab) ? st::lineWidth : 0), st::lineWidth); + _topShadow.moveToLeft((!Adaptive::OneColumn() && !_inGrab) ? st::lineWidth : 0, 0); _sideShadow.resize(st::lineWidth, height()); _sideShadow.moveToLeft(0, 0); } @@ -1862,7 +1862,7 @@ void ProfileWidget::step_show(float64 ms, bool timer) { float64 dt = ms / st::slideDuration; if (dt >= 1) { _a_show.stop(); - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _topShadow.show(); a_coordUnder.finish(); @@ -1914,8 +1914,8 @@ void ProfileWidget::mediaOverviewUpdated(PeerData *peer, MediaOverviewType type) } } -void ProfileWidget::updateWideMode() { - _sideShadow.setVisible(cWideMode()); +void ProfileWidget::updateAdaptiveLayout() { + _sideShadow.setVisible(!Adaptive::OneColumn()); } void ProfileWidget::clear() { diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 66523d65d0..73fcf2f241 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -245,7 +245,7 @@ public: void updateNotifySettings(); void mediaOverviewUpdated(PeerData *peer, MediaOverviewType type); - void updateWideMode(); + void updateAdaptiveLayout(); void grabStart() { _sideShadow.hide(); @@ -253,7 +253,7 @@ public: resizeEvent(0); } void grabFinish() { - _sideShadow.setVisible(cWideMode()); + _sideShadow.setVisible(!Adaptive::OneColumn()); _inGrab = false; resizeEvent(0); } diff --git a/Telegram/SourceFiles/pspecific_mac_p.mm b/Telegram/SourceFiles/pspecific_mac_p.mm index 21e641e1a1..9bacdd112b 100644 --- a/Telegram/SourceFiles/pspecific_mac_p.mm +++ b/Telegram/SourceFiles/pspecific_mac_p.mm @@ -211,7 +211,7 @@ public: NSNumber *instObj = [[notification userInfo] objectForKey:@"launch"]; unsigned long long instLong = instObj ? [instObj unsignedLongLongValue] : 0; DEBUG_LOG(("Received notification with instance %1").arg(instLong)); - if (instLong != Sandbox::LaunchId()) { // other app instance notification + if (instLong != Global::LaunchId()) { // other app instance notification return; } if (notification.activationType == NSUserNotificationActivationTypeReplied) { @@ -283,8 +283,8 @@ void PsMacWindowPrivate::showNotify(uint64 peer, int32 msgId, const QPixmap &pix NSUserNotification *notification = [[NSUserNotification alloc] init]; NSImage *img = qt_mac_create_nsimage(pix); - DEBUG_LOG(("Sending notification with userinfo: peer %1, msgId %2 and instance %3").arg(peer).arg(msgId).arg(Sandbox::LaunchId())); - [notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:Sandbox::LaunchId()],@"launch",nil]]; + DEBUG_LOG(("Sending notification with userinfo: peer %1, msgId %2 and instance %3").arg(peer).arg(msgId).arg(Global::LaunchId())); + [notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:Global::LaunchId()],@"launch",nil]]; [notification setTitle:QNSString(title).s()]; [notification setSubtitle:QNSString(subtitle).s()]; @@ -352,7 +352,7 @@ void PsMacWindowPrivate::clearNotifies(unsigned long long peer) { NSArray *notifies = [center deliveredNotifications]; for (id notify in notifies) { NSDictionary *dict = [notify userInfo]; - if ([[dict objectForKey:@"peer"] unsignedLongLongValue] == peer && [[dict objectForKey:@"launch"] unsignedLongLongValue] == Sandbox::LaunchId()) { + if ([[dict objectForKey:@"peer"] unsignedLongLongValue] == peer && [[dict objectForKey:@"launch"] unsignedLongLongValue] == Global::LaunchId()) { [center removeDeliveredNotification:notify]; } } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 6d40abeabe..b29ff4c1f8 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -271,7 +271,7 @@ namespace { return false; } - QRect avail(Sandboxer::availableGeometry()); + QRect avail(Sandbox::availableGeometry()); max_w = avail.width(); if (max_w < st::wndMinWidth) max_w = st::wndMinWidth; max_h = avail.height(); @@ -1194,7 +1194,7 @@ void PsMainWindow::psInitSize() { setMinimumHeight(st::wndMinHeight); TWindowPos pos(cWindowPos()); - QRect avail(Sandboxer::availableGeometry()); + 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) { diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 316567c0d3..bd6578eb76 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -155,8 +155,6 @@ bool gIsElCapitan = false; bool gContactsReceived = false; bool gDialogsReceived = false; -bool gWideMode = true; - int gOnlineUpdatePeriod = 120000; int gOfflineBlurTimeout = 5000; int gOfflineIdleTimeout = 30000; diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 28cc53382f..dc4adaaa64 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -324,8 +324,6 @@ DeclareReadSetting(QUrl, UpdateURL); DeclareSetting(bool, ContactsReceived); DeclareSetting(bool, DialogsReceived); -DeclareSetting(bool, WideMode); - DeclareSetting(int, OnlineUpdatePeriod); DeclareSetting(int, OfflineBlurTimeout); DeclareSetting(int, OfflineIdleTimeout); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index af03d71853..36c4fa1df0 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -221,7 +221,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) connect(App::main(), SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(peerUpdated(PeerData *))); connect(App::main(), SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(peerUpdated(PeerData *))); - Sandboxer::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onReloadPassword(Qt::ApplicationState))); + Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onReloadPassword(Qt::ApplicationState))); } // profile @@ -269,11 +269,11 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) _newVersionWidth = st::linkFont->width(_newVersionText); #ifndef TDESKTOP_DISABLE_AUTOUPDATE - Sandboxer::connect(SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); - Sandboxer::connect(SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); - Sandboxer::connect(SIGNAL(updateProgress(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); - Sandboxer::connect(SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); - Sandboxer::connect(SIGNAL(updateReady()), this, SLOT(onUpdateReady())); + Sandbox::connect(SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); + Sandbox::connect(SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); + Sandbox::connect(SIGNAL(updateProgress(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); + Sandbox::connect(SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); + Sandbox::connect(SIGNAL(updateReady()), this, SLOT(onUpdateReady())); #endif // chat options @@ -330,10 +330,10 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) updateOnlineDisplay(); #ifndef TDESKTOP_DISABLE_AUTOUPDATE - switch (Sandboxer::updatingState()) { + switch (Sandbox::updatingState()) { case Application::UpdatingDownload: setUpdatingState(UpdatingDownload, true); - setDownloadProgress(Sandboxer::updatingReady(), Sandboxer::updatingSize()); + setDownloadProgress(Sandbox::updatingReady(), Sandbox::updatingSize()); break; case Application::UpdatingReady: setUpdatingState(UpdatingReady, true); break; default: setUpdatingState(UpdatingNone, true); break; @@ -1261,14 +1261,14 @@ void SettingsInner::onAutoUpdate() { Local::writeSettings(); resizeEvent(0); if (cAutoUpdate()) { - Sandboxer::startUpdateCheck(); + Sandbox::startUpdateCheck(); if (_updatingState == UpdatingNone) { _checkNow.show(); } else if (_updatingState == UpdatingReady) { _restartNow.show(); } } else { - Sandboxer::stopUpdate(); + Sandbox::stopUpdate(); _restartNow.hide(); _checkNow.hide(); } @@ -1279,7 +1279,7 @@ void SettingsInner::onCheckNow() { if (!cAutoUpdate()) return; cSetLastUpdateCheck(0); - Sandboxer::startUpdateCheck(); + Sandbox::startUpdateCheck(); } #endif @@ -1867,10 +1867,10 @@ void SettingsWidget::showAll() { _scroll.show(); _inner.show(); _inner.showAll(); - if (cWideMode()) { - _close.show(); - } else { + if (Adaptive::OneColumn()) { _close.hide(); + } else { + _close.show(); } } @@ -1892,11 +1892,11 @@ void SettingsWidget::dragEnterEvent(QDragEnterEvent *e) { void SettingsWidget::dropEvent(QDropEvent *e) { } -void SettingsWidget::updateWideMode() { - if (cWideMode()) { - _close.show(); - } else { +void SettingsWidget::updateAdaptiveLayout() { + if (Adaptive::OneColumn()) { _close.hide(); + } else { + _close.show(); } } diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index c3a8449be3..08499ca60d 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -316,7 +316,7 @@ public: void dragEnterEvent(QDragEnterEvent *e); void dropEvent(QDropEvent *e); - void updateWideMode(); + void updateAdaptiveLayout(); void animShow(const QPixmap &bgAnimCache, bool back = false); void step_show(float64 ms, bool timer); diff --git a/Telegram/SourceFiles/sysbuttons.cpp b/Telegram/SourceFiles/sysbuttons.cpp index ec81716c78..44fd04ef59 100644 --- a/Telegram/SourceFiles/sysbuttons.cpp +++ b/Telegram/SourceFiles/sysbuttons.cpp @@ -150,7 +150,7 @@ UpdateBtn::UpdateBtn(QWidget *parent, Window *window, const QString &text) : Sys void UpdateBtn::onClick() { #ifndef TDESKTOP_DISABLE_AUTOUPDATE checkReadyUpdate(); - if (Sandboxer::updatingState() == Application::UpdatingReady) { + if (Sandbox::updatingState() == Application::UpdatingReady) { cSetRestartingUpdate(true); } else #endif diff --git a/Telegram/SourceFiles/title.cpp b/Telegram/SourceFiles/title.cpp index 9c6e389976..2bc52abc63 100644 --- a/Telegram/SourceFiles/title.cpp +++ b/Telegram/SourceFiles/title.cpp @@ -75,7 +75,7 @@ TitleWidget::TitleWidget(Window *window) : TWidget(window) _back.hide(); if ( #ifndef TDESKTOP_DISABLE_AUTOUPDATE - Sandboxer::updatingState() == Application::UpdatingReady || + Sandbox::updatingState() == Application::UpdatingReady || #endif cHasPasscode() ) { @@ -91,7 +91,7 @@ TitleWidget::TitleWidget(Window *window) : TWidget(window) connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState))); #ifndef TDESKTOP_DISABLE_AUTOUPDATE - Sandboxer::connect(SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); + Sandbox::connect(SIGNAL(updateReady()), this, SLOT(showUpdateBtn())); #endif if (cPlatform() != dbipWindows) { @@ -111,7 +111,7 @@ void TitleWidget::paintEvent(QPaintEvent *e) { p.drawText(st::titleMenuOffset - st::titleTextButton.width / 2, st::titleTextButton.textTop + st::titleTextButton.font->ascent, lang(lng_forward_choose)); } p.drawPixmap(st::titleIconPos, App::sprite(), st::titleIconImg); - if (!cWideMode() && !_counter.isNull() && App::main()) { + if (Adaptive::OneColumn() && !_counter.isNull() && App::main()) { p.drawPixmap(st::titleIconPos.x() + st::titleIconImg.pxWidth() - (_counter.width() / cIntRetinaFactor()), st::titleIconPos.y() + st::titleIconImg.pxHeight() - (_counter.height() / cIntRetinaFactor()), _counter); } } @@ -130,10 +130,10 @@ void TitleWidget::setHideLevel(float64 level) { hider = new TitleHider(this); hider->move(0, 0); hider->resize(size()); - if (cWideMode()) { - hider->show(); - } else { + if (Adaptive::OneColumn()) { hider->hide(); + } else { + hider->show(); } } hider->setLevel(hideLevel); @@ -216,7 +216,7 @@ void TitleWidget::updateBackButton() { _lock.setSysBtnStyle(st::sysUnlock); } else { _lock.setSysBtnStyle(st::sysLock); - if (!cWideMode() && App::main() && App::main()->selectingPeer()) { + if (Adaptive::OneColumn() && App::main() && App::main()->selectingPeer()) { _cancel.show(); if (!_back.isHidden()) _back.hide(); if (!_settings.isHidden()) _settings.hide(); @@ -225,12 +225,7 @@ void TitleWidget::updateBackButton() { } else { if (!_cancel.isHidden()) _cancel.hide(); bool authed = (MTP::authedId() > 0); - if (cWideMode()) { - if (!_back.isHidden()) _back.hide(); - if (_settings.isHidden()) _settings.show(); - if (authed && _contacts.isHidden()) _contacts.show(); - if (_about.isHidden()) _about.show(); - } else { + if (Adaptive::OneColumn()) { if (App::wnd()->needBackButton()) { if (_back.isHidden()) _back.show(); if (!_settings.isHidden()) _settings.hide(); @@ -242,6 +237,11 @@ void TitleWidget::updateBackButton() { if (authed && _contacts.isHidden()) _contacts.show(); if (_about.isHidden()) _about.show(); } + } else { + if (!_back.isHidden()) _back.hide(); + if (_settings.isHidden()) _settings.show(); + if (authed && _contacts.isHidden()) _contacts.show(); + if (_about.isHidden()) _about.show(); } } } @@ -249,22 +249,22 @@ void TitleWidget::updateBackButton() { update(); } -void TitleWidget::updateWideMode() { +void TitleWidget::updateAdaptiveLayout() { updateBackButton(); - if (!cWideMode()) { + if (Adaptive::OneColumn()) { updateCounter(); } if (hider) { - if (cWideMode()) { - hider->show(); - } else { + if (Adaptive::OneColumn()) { hider->hide(); + } else { + hider->show(); } } } void TitleWidget::updateCounter() { - if (cWideMode() || !MTP::authedId()) return; + if (!Adaptive::OneColumn() || !MTP::authedId()) return; int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; @@ -313,7 +313,7 @@ void TitleWidget::stateChanged(Qt::WindowState state) { } void TitleWidget::showUpdateBtn() { - if (!cWideMode() && App::main() && App::main()->selectingPeer()) { + if (Adaptive::OneColumn() && App::main() && App::main()->selectingPeer()) { _cancel.show(); _lock.hide(); _update.hide(); @@ -329,7 +329,7 @@ void TitleWidget::showUpdateBtn() { _lock.hide(); } #ifndef TDESKTOP_DISABLE_AUTOUPDATE - bool updateReady = (Sandboxer::updatingState() == Application::UpdatingReady); + bool updateReady = (Sandbox::updatingState() == Application::UpdatingReady); #else bool updateReady = false; #endif @@ -377,7 +377,7 @@ HitTestType TitleWidget::hitTest(const QPoint &p) { if (App::wnd() && Ui::isLayerShown()) return HitTestNone; int x(p.x()), y(p.y()), w(width()), h(height()); - if (cWideMode() && hider && x >= App::main()->dlgsWidth()) return HitTestNone; + if (!Adaptive::OneColumn() && hider && x >= App::main()->dlgsWidth()) return HitTestNone; if (x >= st::titleIconPos.x() && y >= st::titleIconPos.y() && x < st::titleIconPos.x() + st::titleIconImg.pxWidth() && y < st::titleIconPos.y() + st::titleIconImg.pxHeight()) { return HitTestIcon; diff --git a/Telegram/SourceFiles/title.h b/Telegram/SourceFiles/title.h index 7e3b60fd8b..018695890a 100644 --- a/Telegram/SourceFiles/title.h +++ b/Telegram/SourceFiles/title.h @@ -49,7 +49,7 @@ public: void resizeEvent(QResizeEvent *e); void updateBackButton(); - void updateWideMode(); + void updateAdaptiveLayout(); void updateCounter(); void mousePressEvent(QMouseEvent *e); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index d1a0ff1171..e42a5a4927 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1214,7 +1214,7 @@ void Window::toggleDisplayNotifyFromTray() { } void Window::closeEvent(QCloseEvent *e) { - if (MTP::authedId() && !Sandboxer::isSavingSession() && minimizeToTray()) { + if (MTP::authedId() && !Sandbox::isSavingSession() && minimizeToTray()) { e->ignore(); } else { App::quit(); @@ -1228,10 +1228,15 @@ TitleWidget *Window::getTitle() { void Window::resizeEvent(QResizeEvent *e) { if (!title) return; - bool wideMode = (width() >= st::wideModeWidth); - if (wideMode != cWideMode()) { - cSetWideMode(wideMode); - updateWideMode(); + Adaptive::Layout layout = Adaptive::OneColumnLayout; + if (width() >= st::adaptiveWideWidth) { + layout = Adaptive::WideLayout; + } else if (width() >= st::adaptiveNormalWidth) { + layout = Adaptive::NormalLayout; + } + if (layout != Global::AdaptiveLayout()) { + Global::SetAdaptiveLayout(layout); + updateAdaptiveLayout(); } title->setGeometry(0, 0, width(), st::titleHeight); if (layerBg) layerBg->resize(width(), height()); @@ -1239,12 +1244,12 @@ void Window::resizeEvent(QResizeEvent *e) { emit resized(QSize(width(), height() - st::titleHeight)); } -void Window::updateWideMode() { - title->updateWideMode(); - if (main) main->updateWideMode(); - if (settings) settings->updateWideMode(); - if (intro) intro->updateWideMode(); - if (layerBg) layerBg->updateWideMode(); +void Window::updateAdaptiveLayout() { + title->updateAdaptiveLayout(); + if (main) main->updateAdaptiveLayout(); + if (settings) settings->updateAdaptiveLayout(); + if (intro) intro->updateAdaptiveLayout(); + if (layerBg) layerBg->updateAdaptiveLayout(); } bool Window::needBackButton() { @@ -2002,10 +2007,10 @@ LastCrashedWindow::LastCrashedWindow() , _showReport(this) , _saveReport(this) , _getApp(this) -, _reportText(QString::fromUtf8(Global::LastCrashDump())) +, _reportText(QString::fromUtf8(Sandbox::LastCrashDump())) , _reportShown(false) , _reportSaved(false) -, _sendingState(((!cDevVersion() && !cBetaVersion()) || Global::LastCrashDump().isEmpty()) ? SendingNoReport : SendingUpdateCheck) +, _sendingState(((!cDevVersion() && !cBetaVersion()) || Sandbox::LastCrashDump().isEmpty()) ? SendingNoReport : SendingUpdateCheck) , _updating(this) , _sendingProgress(0) , _sendingTotal(0) @@ -2078,23 +2083,23 @@ LastCrashedWindow::LastCrashedWindow() _updatingSkip.setText(qsl("SKIP")); connect(&_updatingSkip, SIGNAL(clicked()), this, SLOT(onUpdateSkip())); - Sandboxer::connect(SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); - Sandboxer::connect(SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); - Sandboxer::connect(SIGNAL(updateProgress(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); - Sandboxer::connect(SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); - Sandboxer::connect(SIGNAL(updateReady()), this, SLOT(onUpdateReady())); + Sandbox::connect(SIGNAL(updateChecking()), this, SLOT(onUpdateChecking())); + Sandbox::connect(SIGNAL(updateLatest()), this, SLOT(onUpdateLatest())); + Sandbox::connect(SIGNAL(updateProgress(qint64,qint64)), this, SLOT(onUpdateDownloading(qint64,qint64))); + Sandbox::connect(SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); + Sandbox::connect(SIGNAL(updateReady()), this, SLOT(onUpdateReady())); - switch (Sandboxer::updatingState()) { + switch (Sandbox::updatingState()) { case Application::UpdatingDownload: setUpdatingState(UpdatingDownload, true); - setDownloadProgress(Sandboxer::updatingReady(), Sandboxer::updatingSize()); + setDownloadProgress(Sandbox::updatingReady(), Sandbox::updatingSize()); break; case Application::UpdatingReady: setUpdatingState(UpdatingReady, true); break; default: setUpdatingState(UpdatingCheck, true); break; } cSetLastUpdateCheck(0); - Sandboxer::startUpdateCheck(); + Sandbox::startUpdateCheck(); #else _updating.setText(qsl("Please check if there is a new version available.")); if (_sendingState != SendingNoReport) { @@ -2137,7 +2142,7 @@ void LastCrashedWindow::onSaveReport() { if (!to.isEmpty()) { QFile file(to); if (file.open(QIODevice::WriteOnly)) { - file.write(Global::LastCrashDump()); + file.write(Sandbox::LastCrashDump()); _reportSaved = true; updateControls(); } @@ -2321,7 +2326,7 @@ void LastCrashedWindow::onCheckingFinished() { QHttpPart reportPart; reportPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream")); reportPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"report\"; filename=\"report.telegramcrash\"")); - reportPart.setBody(Global::LastCrashDump()); + reportPart.setBody(Sandbox::LastCrashDump()); multipart->append(reportPart); QFileInfo dmpFile(_minidumpFull); @@ -2578,22 +2583,22 @@ void LastCrashedWindow::updateControls() { } void LastCrashedWindow::onNetworkSettings() { - const ConnectionProxy &p(Global::PreLaunchProxy()); + const ConnectionProxy &p(Sandbox::PreLaunchProxy()); NetworkSettingsWindow *box = new NetworkSettingsWindow(this, p.host, p.port ? p.port : 80, p.user, p.password); connect(box, SIGNAL(saved(QString, quint32, QString, QString)), this, SLOT(onNetworkSettingsSaved(QString, quint32, QString, QString))); box->show(); } void LastCrashedWindow::onNetworkSettingsSaved(QString host, quint32 port, QString username, QString password) { - Global::RefPreLaunchProxy().host = host; - Global::RefPreLaunchProxy().port = port ? port : 80; - Global::RefPreLaunchProxy().user = username; - Global::RefPreLaunchProxy().password = password; + Sandbox::RefPreLaunchProxy().host = host; + Sandbox::RefPreLaunchProxy().port = port ? port : 80; + Sandbox::RefPreLaunchProxy().user = username; + Sandbox::RefPreLaunchProxy().password = password; #ifndef TDESKTOP_DISABLE_AUTOUPDATE if ((_updatingState == UpdatingFail && (_sendingState == SendingNoReport || _sendingState == SendingUpdateCheck)) || (_updatingState == UpdatingCheck)) { - Sandboxer::stopUpdate(); + Sandbox::stopUpdate(); cSetLastUpdateCheck(0); - Sandboxer::startUpdateCheck(); + Sandbox::startUpdateCheck(); } else #endif if (_sendingState == SendingFail || _sendingState == SendingProgress) { @@ -2650,7 +2655,7 @@ void LastCrashedWindow::setDownloadProgress(qint64 ready, qint64 total) { void LastCrashedWindow::onUpdateRetry() { cSetLastUpdateCheck(0); - Sandboxer::startUpdateCheck(); + Sandbox::startUpdateCheck(); } void LastCrashedWindow::onUpdateSkip() { @@ -2658,7 +2663,7 @@ void LastCrashedWindow::onUpdateSkip() { onContinue(); } else { if (_updatingState == UpdatingCheck || _updatingState == UpdatingDownload) { - Sandboxer::stopUpdate(); + Sandbox::stopUpdate(); setUpdatingState(UpdatingFail); } _sendingState = SendingNone; @@ -2692,7 +2697,7 @@ void LastCrashedWindow::onContinue() { if (SignalHandlers::restart() == SignalHandlers::CantOpen) { new NotStartedWindow(); } else { - Sandboxer::startSandbox(); + Sandbox::launch(); } close(); } @@ -2909,7 +2914,7 @@ int showCrashReportWindow(const QString &crashdump) { text = qsl("ERROR: could not read crash dump file '%1'").arg(QFileInfo(crashdump).absoluteFilePath()); } - if (Sandbox::started()) { + if (Global::started()) { ShowCrashReportWindow *wnd = new ShowCrashReportWindow(text); return 0; } diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index ae6b9fcb06..c96913b515 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -146,7 +146,7 @@ public: void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); - void updateWideMode(); + void updateAdaptiveLayout(); bool needBackButton(); void setupPasscode(bool anim); diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 77a056a54b..33c4e28b21 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.19 + 0.9.20 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index dce43cd4d6..8a1df05a6e 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,19,2 - PRODUCTVERSION 0,9,19,2 + FILEVERSION 0,9,20,0 + PRODUCTVERSION 0,9,20,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.19.2" + VALUE "FileVersion", "0.9.20.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.19.2" + VALUE "ProductVersion", "0.9.20.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 22ede49fcf..f55516422f 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.19; + CURRENT_PROJECT_VERSION = 0.9.20; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.19; + CURRENT_PROJECT_VERSION = 0.9.20; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.19; + CURRENT_PROJECT_VERSION = 0.9.20; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.19; + DYLIB_CURRENT_VERSION = 0.9.20; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.19; + CURRENT_PROJECT_VERSION = 0.9.20; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.19; + DYLIB_CURRENT_VERSION = 0.9.20; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 83bc292728..d2437c9552 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9019 +AppVersion 9020 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.19 -AppVersionStr 0.9.19 +AppVersionStrSmall 0.9.20 +AppVersionStr 0.9.20 DevChannel 1 -BetaVersion 9019002 +BetaVersion 0 9019002 From d6f549fef6bd6ac4e8387d2d7142594602249854 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Feb 2016 19:04:44 +0300 Subject: [PATCH 068/316] no lag in changing normal to wide adaptive mode, files overview ext display improved, no inline bot progress while resolving username, version 0.9.20.dev --- Telegram/Resources/style.txt | 6 +++--- Telegram/SourceFiles/history.cpp | 13 ++++++++++++- Telegram/SourceFiles/history.h | 1 + Telegram/SourceFiles/historywidget.cpp | 8 ++++---- Telegram/SourceFiles/layout.cpp | 12 ++++++------ 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 0cb9e073e3..944fd83aed 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1285,9 +1285,6 @@ msgFileBlue: sprite(60px, 425px, 20px, 20px); msgFileOverDuration: 200; msgFileRadialLine: 3px; -msgFileExtPadding: 8px; -msgFileExtTop: 30px; - msgVideoSize: size(320px, 240px); sendPadding: 9px; @@ -2200,6 +2197,9 @@ overviewFileStatusTop: 27px; overviewFileDateTop: 49px; overviewFileChecked: #2fa9e2; overviewFileCheck: #00000066; +overviewFileExtPadding: 5px; +overviewFileExtTop: 24px; +overviewFileExtFont: font(18px semibold); // Mac specific diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2f122ebf65..e039dd1b54 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2927,6 +2927,10 @@ bool HistoryItem::displayFromPhoto() const { return Adaptive::Wide() || (!out() && !history()->peer->isUser() && !fromChannel()); } +bool HistoryItem::shiftFromPhoto() const { + return Adaptive::Wide() && !out() && !history()->peer->isUser() && !fromChannel(); +} + void HistoryItem::clipCallback(ClipReaderNotification notification) { HistoryMedia *media = getMedia(); if (!media) return; @@ -6225,7 +6229,14 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { } left += (!fromChannel() && out()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { - left += (!fromChannel() && out()) ? -st::msgPhotoSkip : st::msgPhotoSkip; + if (!fromChannel() && out()) { + left -= st::msgPhotoSkip; + } else { + left += st::msgPhotoSkip; + if (shiftFromPhoto()) { + left += st::msgPhotoSkip; + } + } } width = hwidth - st::msgMargin.left() - st::msgMargin.right(); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index b1a321eb3b..8f801be89f 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1021,6 +1021,7 @@ public: return (!out() || fromChannel()) && !history()->peer->isUser(); } bool displayFromPhoto() const; + bool shiftFromPhoto() const; void clipCallback(ClipReaderNotification notification); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e8af2e8972..05c757ee77 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2838,12 +2838,12 @@ void HistoryWidget::updateInlineBotQuery() { QString query = _field.getInlineBotQuery(_inlineBot, _inlineBotUsername); if (inlineBotUsername != _inlineBotUsername) { if (_inlineBotResolveRequestId) { - Notify::inlineBotRequesting(false); +// Notify::inlineBotRequesting(false); MTP::cancel(_inlineBotResolveRequestId); _inlineBotResolveRequestId = 0; } if (_inlineBot == InlineBotLookingUpData) { - Notify::inlineBotRequesting(true); +// Notify::inlineBotRequesting(true); _inlineBotResolveRequestId = MTP::send(MTPcontacts_ResolveUsername(MTP_string(_inlineBotUsername)), rpcDone(&HistoryWidget::inlineBotResolveDone), rpcFail(&HistoryWidget::inlineBotResolveFail, _inlineBotUsername)); return; } @@ -5066,7 +5066,7 @@ bool HistoryWidget::hasBroadcastToggle() const { void HistoryWidget::inlineBotResolveDone(const MTPcontacts_ResolvedPeer &result) { _inlineBotResolveRequestId = 0; - Notify::inlineBotRequesting(false); +// Notify::inlineBotRequesting(false); _inlineBotUsername = QString(); if (result.type() == mtpc_contacts_resolvedPeer) { const MTPDcontacts_resolvedPeer &d(result.c_contacts_resolvedPeer()); @@ -5080,7 +5080,7 @@ bool HistoryWidget::inlineBotResolveFail(QString name, const RPCError &error) { if (mtpIsFlood(error)) return false; _inlineBotResolveRequestId = 0; - Notify::inlineBotRequesting(false); +// Notify::inlineBotRequesting(false); if (name == _inlineBotUsername) { _inlineBot = 0; onCheckMentionDropdown(); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index a82d91700e..cf3c71c76a 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -764,10 +764,10 @@ LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryIt _thumbw = 0; } - _extw = st::semiboldFont->width(_ext); - if (_extw > st::overviewFileSize - st::msgFileExtPadding * 2) { - _ext = st::semiboldFont->elided(_ext, st::overviewFileSize - st::msgFileExtPadding * 2, Qt::ElideMiddle); - _extw = st::semiboldFont->width(_ext); + _extw = st::overviewFileExtFont->width(_ext); + if (_extw > st::overviewFileSize - st::overviewFileExtPadding * 2) { + _ext = st::overviewFileExtFont->elided(_ext, st::overviewFileSize - st::overviewFileExtPadding * 2, Qt::ElideMiddle); + _extw = st::overviewFileExtFont->width(_ext); } } @@ -872,9 +872,9 @@ void LayoutOverviewDocument::paint(Painter &p, const QRect &clip, uint32 selecti } else { p.fillRect(rthumb, documentColor(_colorIndex)); if (!radial && loaded && !_ext.isEmpty()) { - p.setFont(st::semiboldFont); + p.setFont(st::overviewFileExtFont); p.setPen(st::white); - p.drawText(rthumb.left() + (rthumb.width() - _extw) / 2, rthumb.top() + st::msgFileExtTop + st::semiboldFont->ascent, _ext); + p.drawText(rthumb.left() + (rthumb.width() - _extw) / 2, rthumb.top() + st::overviewFileExtTop + st::overviewFileExtFont->ascent, _ext); } } if (selected) { From 3336b26eeab2cb5a08d3ba3136fafab3c0ef2150 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 8 Feb 2016 22:55:09 +0300 Subject: [PATCH 069/316] improved build for linux, 0.9.20.dev version --- Telegram/FixMake32.sh | 2 -- Telegram/Telegram.pro | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Telegram/FixMake32.sh b/Telegram/FixMake32.sh index 833bca6c6d..b3a601925c 100755 --- a/Telegram/FixMake32.sh +++ b/Telegram/FixMake32.sh @@ -11,10 +11,8 @@ Replace () { } Replace '\-llzma' '\/usr\/lib\/i386\-linux\-gnu\/liblzma\.a' -Replace '\-lz' '\/usr\/lib\/i386\-linux\-gnu\/libz\.a' Replace '\-lssl' '\/usr\/lib\/i386\-linux\-gnu\/libssl\.a' Replace '\-lcrypto' '\/usr\/lib\/i386\-linux\-gnu\/libcrypto\.a' -Replace '\-lexif' '\/usr\/lib\/i386\-linux\-gnu\/libexif\.a' Replace '\-lgobject\-2\.0' '\/usr\/lib\/i386\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/i386\-linux\-gnu\/libffi\.a' Replace '\-lXi' '\/usr\/lib\/i386\-linux\-gnu\/libXi\.a' Replace '\-lSM' '\/usr\/lib\/i386\-linux\-gnu\/libSM\.a' diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 859fb8d013..408bd81904 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -297,6 +297,7 @@ CONFIG(debug, debug|release) { INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\ ./../../Libraries/QtStatic/qtbase/include/QtCore/5.5.1/QtCore\ ./../../Libraries/QtStatic/qtbase/include\ + /usr/local/include\ /usr/local/include/opus\ ./SourceFiles\ ./GeneratedFiles\ From 001f2e1fe745a99bb6223330f521c6ea50490fef Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 9 Feb 2016 17:42:36 +0300 Subject: [PATCH 070/316] moved from utf8 to QFile::encode/decodeName --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/gui/flatlabel.cpp | 1 - Telegram/SourceFiles/logs.cpp | 8 ++-- Telegram/SourceFiles/pspecific_linux.cpp | 49 ++++++++++++------------ Telegram/SourceFiles/window.cpp | 2 +- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 3e7742c85b..0499b2cbf9 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -149,7 +149,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) , _updateChecker(0) #endif { - QByteArray d(QDir(cWorkingDir()).absolutePath().toUtf8()); + QByteArray d(QFile::encodeName(QDir(cWorkingDir()).absolutePath())); char h[33] = { 0 }; hashMd5Hex(d.constData(), d.size(), h); _localServerName = psServerPrefix() + h + '-' + cGUIDStr(); diff --git a/Telegram/SourceFiles/gui/flatlabel.cpp b/Telegram/SourceFiles/gui/flatlabel.cpp index 34ea575852..429b96b58a 100644 --- a/Telegram/SourceFiles/gui/flatlabel.cpp +++ b/Telegram/SourceFiles/gui/flatlabel.cpp @@ -46,7 +46,6 @@ void FlatLabel::setText(const QString &text) { void FlatLabel::setRichText(const QString &text) { textstyleSet(&_tst); - const char *t = text.toUtf8().constData(); _text.setRichText(_st.font, text, _labelOptions); int32 w = _st.width ? _st.width : _text.maxWidth(), h = _text.countHeight(w); textstyleRestore(); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 1f3e02b547..204a3d4588 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -885,7 +885,7 @@ namespace SignalHandlers { #ifdef MAC_USE_BREAKPAD #ifndef _DEBUG BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( - dumpspath.toUtf8().toStdString(), + QFile::encodeName(dumpspath).toStdString(), /*FilterCallback*/ 0, DumpCallback, /*context*/ 0, @@ -897,7 +897,7 @@ namespace SignalHandlers { #else crashpad::CrashpadClient crashpad_client; std::string handler = (cExeDir() + cExeName() + qsl("/Contents/Helpers/crashpad_handler")).toUtf8().constData(); - std::string database = dumpspath.toUtf8().constData(); + std::string database = QFile::encodeName(dumpspath).constData(); if (crashpad_client.StartHandler(base::FilePath(handler), base::FilePath(database), std::string(), @@ -909,7 +909,7 @@ namespace SignalHandlers { #endif #elif defined Q_OS_LINUX64 || defined Q_OS_LINUX32 BreakpadExceptionHandler = new google_breakpad::ExceptionHandler( - google_breakpad::MinidumpDescriptor(dumpspath.toUtf8().toStdString()), + google_breakpad::MinidumpDescriptor(QFile::encodeName(dumpspath).toStdString()), /*FilterCallback*/ 0, DumpCallback, /*context*/ 0, @@ -930,7 +930,7 @@ namespace SignalHandlers { } Status start() { - CrashDumpPath = (cWorkingDir() + qsl("tdata/working")).toUtf8(); + CrashDumpPath = QFile::encodeName(cWorkingDir() + qsl("tdata/working")); if (FILE *f = fopen(CrashDumpPath.constData(), "rb")) { QByteArray lastdump; char buffer[64 * 1024] = { 0 }; diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 397cac5305..6b1e982da9 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -43,10 +43,10 @@ extern "C" { #include namespace { - QString escapeShell(const QString &str) { - QString result; - const QChar *b = str.constData(), *e = str.constEnd(); - for (const QChar *ch = b; ch != e; ++ch) { + QByteArray escapeShell(const QByteArray &str) { + QByteArray result; + const char *b = str.constData(), *e = str.constEnd(); + for (const char *ch = b; ch != e; ++ch) { if (*ch == ' ' || *ch == '"' || *ch == '\'' || *ch == '\\') { if (result.isEmpty()) { result.reserve(str.size() * 2); @@ -974,13 +974,12 @@ QStringList addr2linestr(uint64 *addresses, int count) { if (!count) return result; result.reserve(count); - QString cmdstr = "addr2line -e " + escapeShell(cExeDir() + cExeName()); + QByteArray cmd = "addr2line -e " + escapeShell(QFile::encodeName(cExeDir() + cExeName())); for (int i = 0; i < count; ++i) { if (addresses[i]) { - cmdstr += qsl(" 0x%1").arg(addresses[i], 0, 16); + cmd += qsl(" 0x%1").arg(addresses[i], 0, 16).toUtf8(); } } - QByteArray cmd = cmdstr.toUtf8(); FILE *f = popen(cmd.constData(), "r"); QStringList addr2lineResult; @@ -1165,7 +1164,7 @@ QString psCurrentLanguage() { namespace { QString _psHomeDir() { struct passwd *pw = getpwuid(getuid()); - return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (fromUtf8Safe(pw->pw_dir) + '/') : QString(); + return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (QFile::decodeName(pw->pw_dir) + '/') : QString(); } } @@ -1179,7 +1178,7 @@ QString psDownloadPath() { } QString psCurrentExeDirectory(int argc, char *argv[]) { - QString first = argc ? fromUtf8Safe(argv[0]) : QString(); + QString first = argc ? QFile::decodeName(argv[0]) : QString(); if (!first.isEmpty()) { QFileInfo info(first); if (info.isSymLink()) { @@ -1193,7 +1192,7 @@ QString psCurrentExeDirectory(int argc, char *argv[]) { } QString psCurrentExeName(int argc, char *argv[]) { - QString first = argc ? fromUtf8Safe(argv[0]) : QString(); + QString first = argc ? QFile::decodeName(argv[0]) : QString(); if (!first.isEmpty()) { QFileInfo info(first); if (info.isSymLink()) { @@ -1236,7 +1235,7 @@ void psOpenFile(const QString &name, bool openWith) { void psShowInFolder(const QString &name) { Ui::hideLayer(true); - system((qsl("xdg-open ") + escapeShell(QFileInfo(name).absoluteDir().absolutePath())).toUtf8().constData()); + system(("xdg-open " + escapeShell(QFile::encodeName(QFileInfo(name).absoluteDir().absolutePath()))).constData()); } namespace PlatformSpecific { @@ -1262,13 +1261,13 @@ namespace PlatformSpecific { } namespace { - bool _psRunCommand(const QString &command) { - int result = system(command.toUtf8().constData()); + bool _psRunCommand(const QByteArray &command) { + int result = system(command.constData()); if (result) { - DEBUG_LOG(("App Error: command failed, code: %1, command (in utf8): %2").arg(result).arg(command)); + DEBUG_LOG(("App Error: command failed, code: %1, command (in utf8): %2").arg(result).arg(command.constData())); return false; } - DEBUG_LOG(("App Info: command succeeded, command (in utf8): %1").arg(command)); + DEBUG_LOG(("App Info: command succeeded, command (in utf8): %1").arg(command.constData())); return true; } } @@ -1304,7 +1303,7 @@ void psRegisterCustomScheme() { s << "Version=1.0\n"; s << "Name=Telegram Desktop\n"; s << "Comment=Official desktop version of Telegram messaging app\n"; - s << "Exec=" << escapeShell(cExeDir() + cExeName()) << " -- %u\n"; + s << "Exec=" << escapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n"; s << "Icon=telegram\n"; s << "Terminal=false\n"; s << "StartupWMClass=Telegram\n"; @@ -1313,12 +1312,12 @@ void psRegisterCustomScheme() { s << "MimeType=application/x-xdg-protocol-tg;x-scheme-handler/tg;\n"; f.close(); - if (_psRunCommand(qsl("desktop-file-install --dir=%1 --delete-original %2").arg(escapeShell(home + qsl(".local/share/applications"))).arg(escapeShell(file)))) { + if (_psRunCommand("desktop-file-install --dir=" + escapeShell(QFile::encodeName(home + qsl(".local/share/applications"))) + " --delete-original " + escapeShell(QFile::encodeName(file)))) { DEBUG_LOG(("App Info: removing old .desktop file")); QFile(qsl("%1.local/share/applications/telegram.desktop").arg(home)).remove(); - _psRunCommand(qsl("update-desktop-database %1").arg(escapeShell(home + qsl(".local/share/applications")))); - _psRunCommand(qsl("xdg-mime default telegramdesktop.desktop x-scheme-handler/tg")); + _psRunCommand("update-desktop-database " + escapeShell(QFile::encodeName(home + qsl(".local/share/applications")))); + _psRunCommand("xdg-mime default telegramdesktop.desktop x-scheme-handler/tg"); } } else { LOG(("App Error: Could not open '%1' for write").arg(file)); @@ -1326,9 +1325,9 @@ void psRegisterCustomScheme() { } DEBUG_LOG(("App Info: registerting for Gnome")); - if (_psRunCommand(qsl("gconftool-2 -t string -s /desktop/gnome/url-handlers/tg/command %1").arg(escapeShell(qsl("%1 -- %s").arg(escapeShell(cExeDir() + cExeName())))))) { - _psRunCommand(qsl("gconftool-2 -t bool -s /desktop/gnome/url-handlers/tg/needs_terminal false")); - _psRunCommand(qsl("gconftool-2 -t bool -s /desktop/gnome/url-handlers/tg/enabled true")); + if (_psRunCommand("gconftool-2 -t string -s /desktop/gnome/url-handlers/tg/command " + escapeShell(escapeShell(QFile::encodeName(cExeDir() + cExeName())) + " -- %s"))) { + _psRunCommand("gconftool-2 -t bool -s /desktop/gnome/url-handlers/tg/needs_terminal false"); + _psRunCommand("gconftool-2 -t bool -s /desktop/gnome/url-handlers/tg/enabled true"); } DEBUG_LOG(("App Info: placing .protocol file")); @@ -1347,7 +1346,7 @@ void psRegisterCustomScheme() { QTextStream s(&f); s.setCodec("UTF-8"); s << "[Protocol]\n"; - s << "exec=" << escapeShell(cExeDir() + cExeName()) << " -- %u\n"; + s << "exec=" << QFile::decodeName(escapeShell(QFile::encodeName(cExeDir() + cExeName()))) << " -- %u\n"; s << "protocol=tg\n"; s << "input=none\n"; s << "output=none\n"; @@ -1396,14 +1395,14 @@ bool _execUpdater(bool update = true, const QString &crashreport = QString()) { args[argIndex++] = p_datafile; } } - QByteArray pathf = cWorkingDir().toUtf8(); + QByteArray pathf = QFile::encodeName(cWorkingDir()); if (pathf.size() < MaxLen) { memcpy(p_pathbuf, pathf.constData(), pathf.size()); args[argIndex++] = p_path; args[argIndex++] = p_pathbuf; } if (!crashreport.isEmpty()) { - QByteArray crashreportf = crashreport.toUtf8(); + QByteArray crashreportf = QFile::encodeName(crashreport); if (crashreportf.size() < MaxLen) { memcpy(p_crashreportbuf, crashreportf.constData(), crashreportf.size()); args[argIndex++] = p_crashreport; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index e42a5a4927..397d879af6 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2919,7 +2919,7 @@ int showCrashReportWindow(const QString &crashdump) { return 0; } - QByteArray args[] = { QDir::toNativeSeparators(cExeDir() + cExeName()).toUtf8() }; + QByteArray args[] = { QFile::encodeName(QDir::toNativeSeparators(cExeDir() + cExeName())) }; int a_argc = 1; char *a_argv[1] = { args[0].data() }; QApplication app(a_argc, a_argv); From 7b855a661a05f691c954271f79522857d69e4e41 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 9 Feb 2016 19:05:08 +0300 Subject: [PATCH 071/316] new wide layout, build script and some bugs fixed --- Telegram/Build.bat | 8 ++-- Telegram/Resources/style.txt | 1 - Telegram/SourceFiles/gui/animation.cpp | 1 - Telegram/SourceFiles/history.cpp | 52 ++++++++++++------------- Telegram/SourceFiles/history.h | 3 +- Telegram/SourceFiles/logs.cpp | 26 +++++++++---- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/mainwidget.h | 4 ++ Telegram/SourceFiles/window.cpp | 54 ++++++++++++++------------ Telegram/SourceFiles/window.h | 1 + 10 files changed, 87 insertions(+), 65 deletions(-) diff --git a/Telegram/Build.bat b/Telegram/Build.bat index d6c274cb38..6f83a43f27 100644 --- a/Telegram/Build.bat +++ b/Telegram/Build.bat @@ -124,10 +124,10 @@ for /f ^"usebackq^ eol^=^ :symbolslinedone FOR /F "tokens=1,2,3,4* delims= " %%i in ("%SymbolsHashLine%") do set "SymbolsHash=%%l" -echo Copying %BinaryName%.sym to %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% -if not exist %DropboxSymbolsPath%\%BinaryName% mkdir %DropboxSymbolsPath%\%BinaryName% -if not exist %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% mkdir %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash% -xcopy %ReleasePath%\%BinaryName%.sym %DropboxSymbolsPath%\%BinaryName%\%SymbolsHash%\ +echo Copying %BinaryName%.sym to %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% +if not exist %DropboxSymbolsPath%\%BinaryName%.pdb mkdir %DropboxSymbolsPath%\%BinaryName%.pdb +if not exist %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% mkdir %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash% +xcopy %ReleasePath%\%BinaryName%.sym %DropboxSymbolsPath%\%BinaryName%.pdb\%SymbolsHash%\ echo Done! if not exist %ReleasePath%\deploy mkdir %ReleasePath%\deploy diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 944fd83aed..9168bdd43b 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -53,7 +53,6 @@ color8: #ce671b; // orange wndMinWidth: 380px; adaptiveNormalWidth: 640px; -adaptiveWideWidth: 1120px; wndMinHeight: 480px; wndDefWidth: 800px; diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index 045dbb2739..98d756bb07 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -425,7 +425,6 @@ void ClipReader::stop() { } void ClipReader::error() { - _private = 0; _state = ClipError; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e039dd1b54..869ad41142 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2924,11 +2924,7 @@ void HistoryItem::setId(MsgId newId) { } bool HistoryItem::displayFromPhoto() const { - return Adaptive::Wide() || (!out() && !history()->peer->isUser() && !fromChannel()); -} - -bool HistoryItem::shiftFromPhoto() const { - return Adaptive::Wide() && !out() && !history()->peer->isUser() && !fromChannel(); + return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !fromChannel(); } void HistoryItem::clipCallback(ClipReaderNotification notification) { @@ -6217,31 +6213,25 @@ void HistoryMessage::initDimensions() { } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { - int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width, hmaxwidth = st::historyMaxWidth + (Adaptive::Wide() ? (2 * st::msgPhotoSkip) : 0); + int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width, hmaxwidth = st::historyMaxWidth; if (_media && _media->currentWidth() < maxwidth) { maxwidth = qMax(_media->currentWidth(), qMin(maxwidth, plainMaxWidth())); } left = 0; - if (hwidth > hmaxwidth) { - left = (hwidth - hmaxwidth) / 2; + if (Adaptive::Wide()) { hwidth = hmaxwidth; } - left += (!fromChannel() && out()) ? st::msgMargin.right() : st::msgMargin.left(); + left += (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { - if (!fromChannel() && out()) { - left -= st::msgPhotoSkip; - } else { - left += st::msgPhotoSkip; - if (shiftFromPhoto()) { - left += st::msgPhotoSkip; - } - } + left += st::msgPhotoSkip; + } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { + left += st::msgPhotoSkip - (hmaxwidth - hwidth); } width = hwidth - st::msgMargin.left() - st::msgMargin.right(); if (width > maxwidth) { - if (!fromChannel() && out()) { + if (!fromChannel() && out() && !Adaptive::Wide()) { left += width - maxwidth; } width = maxwidth; @@ -6495,7 +6485,7 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m } if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + int32 photoleft = left + ((!fromChannel() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); p.drawPixmap(photoleft, _height - st::msgMargin.bottom() - st::msgPhotoSize, _from->photo->pixRounded(st::msgPhotoSize)); } if (width < 1) return; @@ -6663,7 +6653,7 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + int32 photoleft = left + ((!fromChannel() && 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()) { lnk = _from->lnk; return; @@ -6928,7 +6918,7 @@ void HistoryForwarded::getState(TextLinkPtr &lnk, HistoryCursorState &state, int int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + int32 photoleft = left + ((!fromChannel() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); if (x >= photoleft && x < photoleft + st::msgPhotoSize) { return HistoryMessage::getState(lnk, state, x, y); } @@ -7488,6 +7478,11 @@ void HistoryServiceMsg::initDimensions() { if (_media) _media->initDimensions(this); } +void HistoryServiceMsg::countPositionAndSize(int32 &left, int32 &width) const { + left = st::msgServiceMargin.left(); + width = qMin(_history->width, int(st::msgMaxWidth + 2 * st::msgPhotoSkip)) - st::msgServiceMargin.left() - st::msgServiceMargin.left(); +} + QString HistoryServiceMsg::selectedText(uint32 selection) const { uint16 selectedFrom = (selection == FullSelection) ? 0 : (selection >> 16) & 0xFFFF; uint16 selectedTo = (selection == FullSelection) ? 0xFFFF : (selection & 0xFFFF); @@ -7528,7 +7523,8 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 textstyleSet(&st::serviceTextStyle); - int32 left = st::msgServiceMargin.left(), width = _history->width - st::msgServiceMargin.left() - st::msgServiceMargin.left(), height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + 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) { @@ -7581,7 +7577,8 @@ int32 HistoryServiceMsg::resize(int32 width) { } bool HistoryServiceMsg::hasPoint(int32 x, int32 y) const { - int32 left = st::msgServiceMargin.left(), width = _history->width - st::msgServiceMargin.left() - st::msgServiceMargin.left(), height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + int32 left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + countPositionAndSize(left, width); if (width < 1) return false; if (_media) { @@ -7594,7 +7591,8 @@ void HistoryServiceMsg::getState(TextLinkPtr &lnk, HistoryCursorState &state, in lnk = TextLinkPtr(); state = HistoryDefaultCursorState; - int32 left = st::msgServiceMargin.left(), width = _history->width - st::msgServiceMargin.left() - st::msgServiceMargin.left(), height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + 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) { @@ -7617,7 +7615,8 @@ void HistoryServiceMsg::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 after = false; upon = false; - int32 left = st::msgServiceMargin.left(), width = _history->width - st::msgServiceMargin.left() - st::msgServiceMargin.left(), height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + 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) { @@ -7682,7 +7681,8 @@ void HistoryGroup::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x lnk = TextLinkPtr(); state = HistoryDefaultCursorState; - int32 left = st::msgServiceMargin.left(), width = _history->width - st::msgServiceMargin.left() - st::msgServiceMargin.left(), height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + int32 left = 0, width = 0, height = _height - st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); // two small margins + countPositionAndSize(left, width); if (width < 1) return; QRect trect(QRect(left, st::msgServiceMargin.top(), width, height).marginsAdded(-st::msgServicePadding)); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 8f801be89f..9557904364 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1021,7 +1021,6 @@ public: return (!out() || fromChannel()) && !history()->peer->isUser(); } bool displayFromPhoto() const; - bool shiftFromPhoto() const; void clipCallback(ClipReaderNotification notification); @@ -2249,6 +2248,8 @@ public: void initDimensions(); + void countPositionAndSize(int32 &left, int32 &width) const; + void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; int32 resize(int32 width); bool hasPoint(int32 x, int32 y) const; diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 204a3d4588..502644d7a1 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -606,7 +606,7 @@ void _moveOldDataFiles(const QString &wasDir) { namespace SignalHandlers { - QByteArray CrashDumpPath; + QString CrashDumpPath; FILE *CrashDumpFile = 0; int CrashDumpFileNo = 0; char LaunchedDateTimeStr[32] = { 0 }; @@ -930,8 +930,12 @@ namespace SignalHandlers { } Status start() { - CrashDumpPath = QFile::encodeName(cWorkingDir() + qsl("tdata/working")); - if (FILE *f = fopen(CrashDumpPath.constData(), "rb")) { + CrashDumpPath = cWorkingDir() + qsl("tdata/working"); +#ifdef Q_OS_WIN + if (FILE *f = _wfopen(CrashDumpPath.toStdWString().c_str(), L"rb")) { +#else + if (FILE *f = fopen(QFile::encodeName(CrashDumpPath).constData(), "rb")) { +#endif QByteArray lastdump; char buffer[64 * 1024] = { 0 }; int32 read = 0; @@ -942,7 +946,7 @@ namespace SignalHandlers { Sandbox::SetLastCrashDump(lastdump); - LOG(("Opened '%1' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: %2").arg(QString::fromUtf8(CrashDumpPath)).arg(lastdump.size())); + LOG(("Opened '%1' for reading, the previous Telegram Desktop launch was not finished properly :( Crash log size: %2").arg(CrashDumpPath).arg(lastdump.size())); return LastCrashed; } @@ -954,7 +958,11 @@ namespace SignalHandlers { return Started; } - CrashDumpFile = fopen(CrashDumpPath.constData(), "wb"); +#ifdef Q_OS_WIN + CrashDumpFile = _wfopen(CrashDumpPath.toStdWString().c_str(), L"wb"); +#else + CrashDumpFile = fopen(QFile::encodeName(CrashDumpPath).constData(), "wb"); +#endif if (CrashDumpFile) { CrashDumpFileNo = fileno(CrashDumpFile); if (SetSignalHandlers) { @@ -981,7 +989,7 @@ namespace SignalHandlers { return Started; } - LOG(("FATAL: Could not open '%1' for writing!").arg(QString::fromUtf8(CrashDumpPath))); + LOG(("FATAL: Could not open '%1' for writing!").arg(CrashDumpPath)); return CantOpen; } @@ -990,7 +998,11 @@ namespace SignalHandlers { FinishBreakpad(); if (CrashDumpFile) { fclose(CrashDumpFile); - unlink(CrashDumpPath.constData()); +#ifdef Q_OS_WIN + _wunlink(CrashDumpPath.toStdWString().c_str()); +#else + unlink(CrashDumpPath.toUtf8().constData()); +#endif } } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index e91ac44112..779a93bacc 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2810,7 +2810,7 @@ void MainWidget::resizeEvent(QResizeEvent *e) { history.setGeometry(0, _playerHeight + tbh, _dialogsWidth, height() - _playerHeight - tbh); if (_hider) _hider->setGeometry(0, 0, _dialogsWidth, height()); } else { - _dialogsWidth = snap((width() * 5) / 14, st::dlgMinWidth, st::dlgMaxWidth); + _dialogsWidth = chatsListWidth(width()); dialogs.resize(_dialogsWidth, height()); dialogs.moveToLeft(0, 0); _player.resize(width() - _dialogsWidth, _player.height()); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 44e9e2accb..ffb357d81c 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -179,6 +179,10 @@ public: } }; +inline int chatsListWidth(int windowWidth) { + return snap((windowWidth * 5) / 14, st::dlgMinWidth, st::dlgMaxWidth); +} + class StickerPreviewWidget; class MainWidget : public TWidget, public RPCSender { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 397d879af6..89fbecc527 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1229,10 +1229,12 @@ void Window::resizeEvent(QResizeEvent *e) { if (!title) return; Adaptive::Layout layout = Adaptive::OneColumnLayout; - if (width() >= st::adaptiveWideWidth) { - layout = Adaptive::WideLayout; - } else if (width() >= st::adaptiveNormalWidth) { - layout = Adaptive::NormalLayout; + if (width() >= st::adaptiveNormalWidth) { + if (width() - chatsListWidth(width()) >= st::historyMaxWidth) { + layout = Adaptive::WideLayout; + } else { + layout = Adaptive::NormalLayout; + } } if (layout != Global::AdaptiveLayout()) { Global::SetAdaptiveLayout(layout); @@ -1501,7 +1503,6 @@ void Window::notifyShowNext(NotifyWindow *remove) { uint64 next = 0; HistoryItem *notifyItem = 0; History *notifyHistory = 0; - NotifyWaiters::iterator notifyWaiter = notifyWaiters.end(); for (NotifyWaiters::iterator i = notifyWaiters.begin(); i != notifyWaiters.end();) { History *history = i.key(); if (history->currentNotification() && history->currentNotification()->id != i.value().msg) { @@ -1509,7 +1510,6 @@ void Window::notifyShowNext(NotifyWindow *remove) { if (j == notifyWhenMaps.end()) { history->clearNotifications(); i = notifyWaiters.erase(i); - notifyWaiter = notifyHistory ? notifyWaiters.find(notifyHistory) : notifyWaiters.end(); continue; } do { @@ -1525,7 +1525,6 @@ void Window::notifyShowNext(NotifyWindow *remove) { if (!history->currentNotification()) { notifyWhenMaps.remove(history); i = notifyWaiters.erase(i); - notifyWaiter = notifyHistory ? notifyWaiters.find(notifyHistory) : notifyWaiters.end(); continue; } uint64 when = i.value().when; @@ -1533,7 +1532,6 @@ void Window::notifyShowNext(NotifyWindow *remove) { next = when; notifyItem = history->currentNotification(); notifyHistory = history; - notifyWaiter = i; } ++i; } @@ -1567,8 +1565,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { NotifyWhenMap::const_iterator k = j.value().constFind(history->currentNotification()->id); if (k != j.value().cend()) { nextNotify = history->currentNotification(); - notifyWaiter.value().msg = k.key(); - notifyWaiter.value().when = k.value(); + notifyWaiters.insert(notifyHistory, NotifyWaiter(k.key(), k.value(), 0)); break; } history->skipNotification(); @@ -1599,7 +1596,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { } if (!history->hasNotification()) { - if (notifyWaiter != notifyWaiters.cend()) notifyWaiters.erase(notifyWaiter); + notifyWaiters.remove(history); notifyWhenMaps.remove(history); continue; } @@ -2195,7 +2192,7 @@ void LastCrashedWindow::onSendReport() { App::setProxySettings(_sendManager); QString apiid = getReportField(qstr("apiid"), qstr("ApiId:")), version = getReportField(qstr("version"), qstr("Version:")); - _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2").arg(apiid).arg(version))); + _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2&dmp=%3").arg(apiid).arg(version).arg(minidumpFileName().isEmpty() ? 0 : 1))); connect(_checkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); connect(_checkReply, SIGNAL(finished()), this, SLOT(onCheckingFinished())); @@ -2291,6 +2288,15 @@ namespace { } +QString LastCrashedWindow::minidumpFileName() { + QFileInfo dmpFile(_minidumpFull); + if (dmpFile.exists() && dmpFile.size() > 0 && dmpFile.size() < 20 * 1024 * 1024 && + QRegularExpression(qsl("^[a-zA-Z0-9\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { + return dmpFile.fileName(); + } + return QString(); +} + void LastCrashedWindow::onCheckingFinished() { if (!_checkReply || _sendReply) return; @@ -2300,9 +2306,9 @@ void LastCrashedWindow::onCheckingFinished() { LOG(("Crash report check for sending done, result: %1").arg(QString::fromUtf8(result))); - if (result == "Many") { - _pleaseSendReport.setText(qsl("Too many crash reports at this moment :(")); - _sendingState = SendingTooMany; + if (result == "Old") { + _pleaseSendReport.setText(qsl("This report is about some old version of Telegram Desktop.")); + _sendingState = SendingTooOld; updateControls(); return; } else if (result == "Unofficial") { @@ -2311,10 +2317,11 @@ void LastCrashedWindow::onCheckingFinished() { updateControls(); return; } else if (result != "Report") { - _pleaseSendReport.setText(qsl("This report is about some old version of Telegram Desktop.")); - _pleaseSendReport.setText(qsl("Response: %1").arg(QString::fromLatin1(result))); - _sendingState = SendingTooOld; + _pleaseSendReport.setText(qsl("Thank you for your report!")); + _sendingState = SendingDone; updateControls(); + + SignalHandlers::restart(); return; } @@ -2329,15 +2336,14 @@ void LastCrashedWindow::onCheckingFinished() { reportPart.setBody(Sandbox::LastCrashDump()); multipart->append(reportPart); - QFileInfo dmpFile(_minidumpFull); - if (dmpFile.exists() && dmpFile.size() > 0 && dmpFile.size() < 20 * 1024 * 1024 && - QRegularExpression(qsl("^[a-zA-Z0-9\\-]{1,64}\\.dmp$")).match(dmpFile.fileName()).hasMatch()) { + QString dmpName = minidumpFileName(); + if (!dmpName.isEmpty()) { QFile file(_minidumpFull); if (file.open(QIODevice::ReadOnly)) { QByteArray minidump = file.readAll(); file.close(); - QString zipName = dmpFile.fileName().replace(qstr(".dmp"), qstr(".zip")); + QString zipName = QString(dmpName).replace(qstr(".dmp"), qstr(".zip")); zByteArray minidumpZip; bool failed = false; @@ -2353,8 +2359,8 @@ void LastCrashedWindow::onCheckingFinished() { if (zipFile zf = zipOpen2(0, APPEND_STATUS_CREATE, 0, &zfuncs)) { zip_fileinfo zfi = { { 0, 0, 0, 0, 0, 0 }, 0, 0, 0 }; - std::wstring fileName = dmpFile.fileName().toStdWString(); - if (zipOpenNewFileInZip(zf, std::string(fileName.begin(), fileName.end()).c_str(), &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION) != ZIP_OK) { + QByteArray dmpNameUtf = dmpName.toUtf8(); + if (zipOpenNewFileInZip(zf, dmpNameUtf.constData(), &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION) != ZIP_OK) { failed = true; } else if (zipWriteInFileInZip(zf, minidump.constData(), minidump.size()) != 0) { failed = true; diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index c96913b515..4efcdd318c 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -453,6 +453,7 @@ protected: private: + QString minidumpFileName(); void updateControls(); QString _host, _username, _password; From 19d395a9466afe866bfa11f42c1c697445d5f1c4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 9 Feb 2016 23:56:50 +0300 Subject: [PATCH 072/316] 0.9.21 dev version - fix unicode paths to working file + new layout for wide windows --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/config.h | 4 ++-- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 0499b2cbf9..f83156edae 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1051,7 +1051,7 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if (cDevVersion() && Local::oldMapVersion() < 9020) { + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9020) { if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } else { diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index ef2a395159..f5797848c9 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9020; -static const wchar_t *AppVersionStr = L"0.9.20"; +static const int32 AppVersion = 9021; +static const wchar_t *AppVersionStr = L"0.9.21"; static const bool DevVersion = true; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 33c4e28b21..9e4f736360 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.20 + 0.9.21 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 8a1df05a6e..3534874665 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,20,0 - PRODUCTVERSION 0,9,20,0 + FILEVERSION 0,9,21,0 + PRODUCTVERSION 0,9,21,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.20.0" + VALUE "FileVersion", "0.9.21.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.20.0" + VALUE "ProductVersion", "0.9.21.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index f55516422f..0e234ad04d 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.20; + CURRENT_PROJECT_VERSION = 0.9.21; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.20; + CURRENT_PROJECT_VERSION = 0.9.21; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.20; + CURRENT_PROJECT_VERSION = 0.9.21; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.20; + DYLIB_CURRENT_VERSION = 0.9.21; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.20; + CURRENT_PROJECT_VERSION = 0.9.21; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.20; + DYLIB_CURRENT_VERSION = 0.9.21; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index d2437c9552..58252de8fc 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9020 +AppVersion 9021 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.20 -AppVersionStr 0.9.20 +AppVersionStrSmall 0.9.21 +AppVersionStr 0.9.21 DevChannel 1 BetaVersion 0 9019002 From ffa588bf5d659942712123268249b87e2f71db7a Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 10 Feb 2016 12:41:32 +0300 Subject: [PATCH 073/316] crash fix --- Telegram/SourceFiles/application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f83156edae..7e65ac75fa 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -696,7 +696,8 @@ namespace Sandbox { } AppClass::AppClass() : QObject() -, _uploader(0) { +, _uploader(0) +, _translator(0) { AppObject = this; Fonts::start(); From f2c45df524ee7f2ae4b40aa0d47c7b1f2e543cef Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 10 Feb 2016 14:39:48 +0300 Subject: [PATCH 074/316] hiding, not destroying window on close on OS X, fixed app event filter --- Telegram/Resources/style.txt | 2 +- Telegram/SourceFiles/application.cpp | 11 ++--------- Telegram/SourceFiles/facades.cpp | 16 ++++++++++++++++ Telegram/SourceFiles/facades.h | 2 ++ Telegram/SourceFiles/window.cpp | 4 ++-- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 9168bdd43b..c52dfd796c 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1016,7 +1016,7 @@ historyToEndSkip: 10px; activeFadeInDuration: 500; activeFadeOutDuration: 3000; -historyMaxWidth: 640px; +historyMaxWidth: 680px; msgRadius: 3px; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f83156edae..1f1d6bf792 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -57,15 +57,8 @@ namespace { QKeyEvent *ev = static_cast(e); if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { if (ev->key() == Qt::Key_W && (ev->modifiers() & Qt::ControlModifier)) { - if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { - App::wnd()->minimizeToTray(); - return true; - } else { - App::wnd()->hide(); - App::wnd()->updateIsActive(cOfflineBlurTimeout()); - App::wnd()->updateGlobalMenu(); - return true; - } + Ui::hideWindowNoQuit(); + return true; } else if (ev->key() == Qt::Key_M && (ev->modifiers() & Qt::ControlModifier)) { App::wnd()->setWindowState(Qt::WindowMinimized); return true; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 1013d65098..1750f0250b 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -134,6 +134,22 @@ namespace Ui { } } + bool hideWindowNoQuit() { + if (!App::quiting()) { + if (Window *w = App::wnd()) { + if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { + return w->minimizeToTray(); + } else if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { + w->hide(); + w->updateIsActive(cOfflineBlurTimeout()); + w->updateGlobalMenu(); + return true; + } + } + } + return false; + } + } namespace Notify { diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index ca390d2c3c..43da4a0268 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -67,6 +67,8 @@ namespace Ui { showPeerHistory(PeerId(0), 0); } + bool hideWindowNoQuit(); + }; enum ClipStopperType { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 89fbecc527..c7cbfe3a67 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -990,7 +990,7 @@ bool Window::eventFilter(QObject *obj, QEvent *evt) { } else if (t == QEvent::MouseButtonRelease) { Ui::hideStickerPreview(); } - if (obj == App::app()) { + if (obj == Application::instance()) { if (t == QEvent::ApplicationActivate) { psUserActionDone(); QTimer::singleShot(1, this, SLOT(checkHistoryActivation())); @@ -1214,7 +1214,7 @@ void Window::toggleDisplayNotifyFromTray() { } void Window::closeEvent(QCloseEvent *e) { - if (MTP::authedId() && !Sandbox::isSavingSession() && minimizeToTray()) { + if (MTP::authedId() && !Sandbox::isSavingSession() && Ui::hideWindowNoQuit()) { e->ignore(); } else { App::quit(); From 189d0e8de383a22fbc4e397d87b8ff944a6e3dfb Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 12 Feb 2016 19:35:06 +0300 Subject: [PATCH 075/316] voice messages moved to documents with waveforms --- Telegram/Resources/style.txt | 11 +- Telegram/SourceFiles/app.cpp | 92 -- Telegram/SourceFiles/app.h | 11 - Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/audio.cpp | 668 +++++++------ Telegram/SourceFiles/audio.h | 11 +- Telegram/SourceFiles/boxes/connectionbox.cpp | 12 +- Telegram/SourceFiles/config.h | 2 + Telegram/SourceFiles/fileuploader.cpp | 47 +- Telegram/SourceFiles/fileuploader.h | 5 +- Telegram/SourceFiles/history.cpp | 572 ++++++----- Telegram/SourceFiles/history.h | 166 ++-- Telegram/SourceFiles/historywidget.cpp | 126 +-- Telegram/SourceFiles/historywidget.h | 7 +- Telegram/SourceFiles/layout.cpp | 24 +- Telegram/SourceFiles/layout.h | 6 +- Telegram/SourceFiles/localimageloader.cpp | 52 +- Telegram/SourceFiles/localimageloader.h | 11 +- Telegram/SourceFiles/localstorage.cpp | 71 ++ Telegram/SourceFiles/localstorage.h | 2 + Telegram/SourceFiles/mainwidget.cpp | 66 +- Telegram/SourceFiles/mainwidget.h | 5 +- Telegram/SourceFiles/mediaview.cpp | 12 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- .../SourceFiles/mtproto/mtpFileLoader.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpFileLoader.h | 17 - Telegram/SourceFiles/mtproto/mtpScheme.cpp | 262 ++--- Telegram/SourceFiles/mtproto/mtpScheme.h | 900 ++++-------------- Telegram/SourceFiles/mtproto/scheme.tl | 33 +- Telegram/SourceFiles/overviewwidget.cpp | 70 +- Telegram/SourceFiles/playerwidget.cpp | 62 +- Telegram/SourceFiles/profilewidget.cpp | 32 +- Telegram/SourceFiles/structs.cpp | 489 +++------- Telegram/SourceFiles/structs.h | 188 ++-- Telegram/SourceFiles/types.h | 70 +- Telegram/SourceFiles/window.cpp | 2 +- 36 files changed, 1615 insertions(+), 2495 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 9168bdd43b..5cd2bda889 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1286,6 +1286,15 @@ msgFileRadialLine: 3px; msgVideoSize: size(320px, 240px); +msgWaveformBar: 2px; +msgWaveformSkip: 1px; +msgWaveformMin: 2px; +msgWaveformMax: 20px; +msgWaveformInActive: #59b6eb; +msgWaveformInInactive: #deeaf1; +msgWaveformOutActive: #78c67f; +msgWaveformOutInactive: #c4e8c5; + sendPadding: 9px; btnSend: flatButton(btnDefFlat) { color: btnYesColor; @@ -1386,7 +1395,7 @@ btnRecordAudio: sprite(379px, 390px, 16px, 24px); btnRecordAudioActive: sprite(379px, 366px, 16px, 24px); recordSignalColor: #f17077; recordSignalMin: 5px; -recordSignalMax: 10px; +recordSignalMax: 12px; recordCancel: #aaa; recordCancelActive: #ec6466; recordFont: font(13px); diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index d36731ff79..ed66b1ba11 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -48,7 +48,6 @@ namespace { PhotosData photosData; VideosData videosData; - AudiosData audiosData; DocumentsData documentsData; typedef QHash ImageLinksData; @@ -65,7 +64,6 @@ namespace { PhotoItems photoItems; VideoItems videoItems; - AudioItems audioItems; DocumentItems documentItems; WebPageItems webPageItems; SharedContactItems sharedContactItems; @@ -1293,22 +1291,6 @@ namespace App { return App::videoSet(video.vid.v, convert, video.vaccess_hash.v, video.vdate.v, video.vduration.v, video.vw.v, video.vh.v, App::image(video.vthumb), video.vdc_id.v, video.vsize.v); } - AudioData *feedAudio(const MTPaudio &audio, AudioData *convert) { - switch (audio.type()) { - case mtpc_audio: { - return feedAudio(audio.c_audio(), convert); - } break; - case mtpc_audioEmpty: { - return App::audioSet(audio.c_audioEmpty().vid.v, convert, 0, 0, QString(), 0, 0, 0); - } break; - } - return App::audio(0); - } - - AudioData *feedAudio(const MTPDaudio &audio, AudioData *convert) { - return App::audioSet(audio.vid.v, convert, audio.vaccess_hash.v, audio.vdate.v, qs(audio.vmime_type), audio.vduration.v, audio.vdc_id.v, audio.vsize.v); - } - DocumentData *feedDocument(const MTPdocument &document, const QPixmap &thumb) { switch (document.type()) { case mtpc_document: { @@ -1568,56 +1550,6 @@ namespace App { return result; } - AudioData *audio(const AudioId &audio) { - AudiosData::const_iterator i = ::audiosData.constFind(audio); - if (i == ::audiosData.cend()) { - i = ::audiosData.insert(audio, new AudioData(audio)); - } - return i.value(); - } - - AudioData *audioSet(const AudioId &audio, AudioData *convert, const uint64 &access, int32 date, const QString &mime, int32 duration, int32 dc, int32 size) { - if (convert) { - if (convert->id != audio) { - AudiosData::iterator i = ::audiosData.find(convert->id); - if (i != ::audiosData.cend() && i.value() == convert) { - ::audiosData.erase(i); - } - convert->id = audio; - convert->status = FileReady; - } - if (date) { - convert->access = access; - convert->date = date; - convert->mime = mime; - convert->duration = duration; - convert->dc = dc; - convert->size = size; - } - } - AudiosData::const_iterator i = ::audiosData.constFind(audio); - AudioData *result; - if (i == ::audiosData.cend()) { - if (convert) { - result = convert; - } else { - result = new AudioData(audio, access, date, mime, duration, dc, size); - } - ::audiosData.insert(audio, result); - } else { - result = i.value(); - if (result != convert && date) { - result->access = access; - result->date = date; - result->mime = mime; - result->duration = duration; - result->dc = dc; - result->size = size; - } - } - return result; - } - DocumentData *document(const DocumentId &document) { DocumentsData::const_iterator i = ::documentsData.constFind(document); if (i == ::documentsData.cend()) { @@ -1795,9 +1727,6 @@ namespace App { for (VideosData::const_iterator i = ::videosData.cbegin(), e = ::videosData.cend(); i != e; ++i) { i.value()->forget(); } - for (AudiosData::const_iterator i = ::audiosData.cbegin(), e = ::audiosData.cend(); i != e; ++i) { - i.value()->forget(); - } for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) { i.value()->forget(); } @@ -1955,10 +1884,6 @@ namespace App { delete *i; } ::videosData.clear(); - for (AudiosData::const_iterator i = ::audiosData.cbegin(), e = ::audiosData.cend(); i != e; ++i) { - delete *i; - } - ::audiosData.clear(); for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) { delete *i; } @@ -1977,7 +1902,6 @@ namespace App { cSetReportSpamStatuses(ReportSpamStatuses()); ::photoItems.clear(); ::videoItems.clear(); - ::audioItems.clear(); ::documentItems.clear(); ::webPageItems.clear(); ::sharedContactItems.clear(); @@ -2392,22 +2316,6 @@ namespace App { return ::videosData; } - void regAudioItem(AudioData *data, HistoryItem *item) { - ::audioItems[data].insert(item, NullType()); - } - - void unregAudioItem(AudioData*data, HistoryItem *item) { - ::audioItems[data].remove(item); - } - - const AudioItems &audioItems() { - return ::audioItems; - } - - const AudiosData &audiosData() { - return ::audiosData; - } - void regDocumentItem(DocumentData *data, HistoryItem *item) { ::documentItems[data].insert(item, NullType()); } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 2b224e07ca..c62278798d 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -37,7 +37,6 @@ class FileUploader; typedef QMap HistoryItemsMap; typedef QHash PhotoItems; typedef QHash VideoItems; -typedef QHash AudioItems; typedef QHash DocumentItems; typedef QHash WebPageItems; typedef QHash SharedContactItems; @@ -45,7 +44,6 @@ typedef QHash GifItems; typedef QHash PhotosData; typedef QHash VideosData; -typedef QHash AudiosData; typedef QHash DocumentsData; struct ReplyMarkup { @@ -107,8 +105,6 @@ namespace App { PhotoData *feedPhoto(const MTPPhoto &photo, PhotoData *convert = 0); PhotoData *feedPhoto(const MTPDphoto &photo, PhotoData *convert = 0); VideoData *feedVideo(const MTPDvideo &video, VideoData *convert = 0); - AudioData *feedAudio(const MTPaudio &audio, AudioData *convert = 0); - AudioData *feedAudio(const MTPDaudio &audio, AudioData *convert = 0); DocumentData *feedDocument(const MTPdocument &document, const QPixmap &thumb); DocumentData *feedDocument(const MTPdocument &document, DocumentData *convert = 0); DocumentData *feedDocument(const MTPDdocument &document, DocumentData *convert = 0); @@ -138,8 +134,6 @@ namespace App { PhotoData *photoSet(const PhotoId &photo, PhotoData *convert, const uint64 &access, int32 date, const ImagePtr &thumb, const ImagePtr &medium, const ImagePtr &full); VideoData *video(const VideoId &video); VideoData *videoSet(const VideoId &video, VideoData *convert, const uint64 &access, int32 date, int32 duration, int32 w, int32 h, const ImagePtr &thumb, int32 dc, int32 size); - AudioData *audio(const AudioId &audio); - AudioData *audioSet(const AudioId &audio, AudioData *convert, const uint64 &access, int32 date, const QString &mime, int32 duration, int32 dc, int32 size); DocumentData *document(const DocumentId &document); DocumentData *documentSet(const DocumentId &document, DocumentData *convert, const uint64 &access, int32 date, const QVector &attributes, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size, const StorageImageLocation &thumbLocation); WebPageData *webPage(const WebPageId &webPage); @@ -219,11 +213,6 @@ namespace App { const VideoItems &videoItems(); const VideosData &videosData(); - void regAudioItem(AudioData *data, HistoryItem *item); - void unregAudioItem(AudioData*data, HistoryItem *item); - const AudioItems &audioItems(); - const AudiosData &audiosData(); - void regDocumentItem(DocumentData *data, HistoryItem *item); void unregDocumentItem(DocumentData *data, HistoryItem *item); const DocumentItems &documentItems(); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 7e65ac75fa..afc5e6bc07 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1039,7 +1039,7 @@ void AppClass::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId) { int32 filesize = 0; QByteArray data; - ReadyLocalMedia ready(PreparePhoto, file, filename, filesize, data, id, id, qsl("jpg"), peerId, photo, MTP_audioEmpty(MTP_long(0)), photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, false, false, 0); + ReadyLocalMedia ready(PreparePhoto, file, filename, filesize, data, id, id, qsl("jpg"), peerId, photo, photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, false, false, 0); connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&, const MTPInputFile&)), App::app(), SLOT(photoUpdated(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index db981b3aa2..7771eb39e9 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -96,6 +96,7 @@ bool _checkALError() { Q_DECLARE_METATYPE(AudioMsgId); Q_DECLARE_METATYPE(SongMsgId); +Q_DECLARE_METATYPE(VoiceWaveform); void audioInit() { if (!capture) { capture = new AudioCapture(); @@ -206,6 +207,7 @@ void audioInit() { qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); player = new AudioPlayer(); alcDevicePauseSOFT(audioDevice); @@ -368,8 +370,8 @@ void AudioPlayer::onStopped(const SongMsgId &song) { bool AudioPlayer::updateCurrentStarted(MediaOverviewType type, int32 pos) { Msg *data = 0; switch (type) { - case OverviewAudios: data = &_audioData[_audioCurrent]; break; - case OverviewDocuments: data = &_songData[_songCurrent]; break; + case OverviewVoiceFiles: data = &_audioData[_audioCurrent]; break; + case OverviewFiles: data = &_songData[_songCurrent]; break; } if (!data) return false; @@ -382,8 +384,8 @@ bool AudioPlayer::updateCurrentStarted(MediaOverviewType type, int32 pos) { if (!_checkALError()) { setStoppedState(data, AudioPlayerStoppedAtError); switch (type) { - case OverviewAudios: onError(_audioData[_audioCurrent].audio); break; - case OverviewDocuments: onError(_songData[_songCurrent].song); break; + case OverviewVoiceFiles: onError(_audioData[_audioCurrent].audio); break; + case OverviewFiles: onError(_songData[_songCurrent].song); break; } return false; } @@ -395,8 +397,8 @@ bool AudioPlayer::updateCurrentStarted(MediaOverviewType type, int32 pos) { bool AudioPlayer::fadedStop(MediaOverviewType type, bool *fadedStart) { Msg *current = 0; switch (type) { - case OverviewAudios: current = &_audioData[_audioCurrent]; break; - case OverviewDocuments: current = &_songData[_songCurrent]; break; + case OverviewVoiceFiles: current = &_audioData[_audioCurrent]; break; + case OverviewFiles: current = &_songData[_songCurrent]; break; } if (!current) return false; @@ -428,7 +430,7 @@ void AudioPlayer::play(const AudioMsgId &audio, int64 position) { bool fadedStart = false; AudioMsg *current = &_audioData[_audioCurrent]; if (current->audio != audio) { - if (fadedStop(OverviewAudios, &fadedStart)) { + if (fadedStop(OverviewVoiceFiles, &fadedStart)) { stopped = current->audio; } if (current->audio) { @@ -472,7 +474,7 @@ void AudioPlayer::play(const SongMsgId &song, int64 position) { bool fadedStart = false; SongMsg *current = &_songData[_songCurrent]; if (current->song != song) { - if (fadedStop(OverviewDocuments, &fadedStart)) { + if (fadedStop(OverviewFiles, &fadedStart)) { stopped = current->song; } if (current->song) { @@ -513,11 +515,11 @@ bool AudioPlayer::checkCurrentALError(MediaOverviewType type) { if (_checkALError()) return true; switch (type) { - case OverviewAudios: + case OverviewVoiceFiles: setStoppedState(&_audioData[_audioCurrent], AudioPlayerStoppedAtError); onError(_audioData[_audioCurrent].audio); break; - case OverviewDocuments: + case OverviewFiles: setStoppedState(&_songData[_songCurrent], AudioPlayerStoppedAtError); onError(_songData[_songCurrent].song); break; @@ -531,11 +533,11 @@ void AudioPlayer::pauseresume(MediaOverviewType type, bool fast) { Msg *current = 0; float64 suppressGain = 1.; switch (type) { - case OverviewAudios: + case OverviewVoiceFiles: current = &_audioData[_audioCurrent]; suppressGain = suppressAllGain; break; - case OverviewDocuments: + case OverviewFiles: current = &_songData[_songCurrent]; suppressGain = suppressSongGain * cSongVolume(); break; @@ -567,14 +569,14 @@ void AudioPlayer::pauseresume(MediaOverviewType type, bool fast) { alSourcePlay(current->source); if (!checkCurrentALError(type)) return; } - if (type == OverviewAudios) emit suppressSong(); + if (type == OverviewVoiceFiles) emit suppressSong(); } break; case AudioPlayerStarting: case AudioPlayerResuming: case AudioPlayerPlaying: current->state = AudioPlayerPausing; updateCurrentStarted(type); - if (type == OverviewAudios) emit unsuppressSong(); + if (type == OverviewVoiceFiles) emit unsuppressSong(); break; case AudioPlayerFinishing: current->state = AudioPlayerPausing; break; } @@ -584,18 +586,18 @@ void AudioPlayer::pauseresume(MediaOverviewType type, bool fast) { void AudioPlayer::seek(int64 position) { QMutexLocker lock(&playerMutex); - MediaOverviewType type = OverviewDocuments; + MediaOverviewType type = OverviewFiles; Msg *current = 0; float64 suppressGain = 1.; AudioMsgId audio; SongMsgId song; switch (type) { - case OverviewAudios: + case OverviewVoiceFiles: current = &_audioData[_audioCurrent]; audio = _audioData[_audioCurrent].audio; suppressGain = suppressAllGain; break; - case OverviewDocuments: + case OverviewFiles: current = &_songData[_songCurrent]; song = _songData[_songCurrent].song; suppressGain = suppressSongGain * cSongVolume(); @@ -629,7 +631,7 @@ void AudioPlayer::seek(int64 position) { case AudioPlayerPlaying: current->state = AudioPlayerPausing; updateCurrentStarted(type); - if (type == OverviewAudios) emit unsuppressSong(); + if (type == OverviewVoiceFiles) emit unsuppressSong(); break; case AudioPlayerFinishing: case AudioPlayerStopped: @@ -638,8 +640,8 @@ void AudioPlayer::seek(int64 position) { case AudioPlayerStoppedAtStart: lock.unlock(); switch (type) { - case OverviewAudios: if (audio) return play(audio, position); - case OverviewDocuments: if (song) return play(song, position); + case OverviewVoiceFiles: if (audio) return play(audio, position); + case OverviewFiles: if (song) return play(song, position); } } emit faderOnTimer(); @@ -647,7 +649,7 @@ void AudioPlayer::seek(int64 position) { void AudioPlayer::stop(MediaOverviewType type) { switch (type) { - case OverviewAudios: { + case OverviewVoiceFiles: { AudioMsgId current; { QMutexLocker lock(&playerMutex); @@ -657,7 +659,7 @@ void AudioPlayer::stop(MediaOverviewType type) { if (current) emit updated(current); } break; - case OverviewDocuments: { + case OverviewFiles: { SongMsgId current; { QMutexLocker lock(&playerMutex); @@ -754,8 +756,8 @@ void AudioPlayer::resumeDevice() { AudioCapture::AudioCapture() : _capture(new AudioCaptureInner(&_captureThread)) { connect(this, SIGNAL(captureOnStart()), _capture, SLOT(onStart())); connect(this, SIGNAL(captureOnStop(bool)), _capture, SLOT(onStop(bool))); - connect(_capture, SIGNAL(done(QByteArray,qint32)), this, SIGNAL(onDone(QByteArray,qint32))); - connect(_capture, SIGNAL(update(qint16,qint32)), this, SIGNAL(onUpdate(qint16,qint32))); + connect(_capture, SIGNAL(done(QByteArray,VoiceWaveform,qint32)), this, SIGNAL(onDone(QByteArray,VoiceWaveform,qint32))); + connect(_capture, SIGNAL(update(quint16,qint32)), this, SIGNAL(onUpdate(quint16,qint32))); connect(_capture, SIGNAL(error()), this, SIGNAL(onError())); connect(&_captureThread, SIGNAL(started()), _capture, SLOT(onInit())); connect(&_captureThread, SIGNAL(finished()), _capture, SLOT(deleteLater())); @@ -1109,19 +1111,18 @@ protected: }; -static const AVSampleFormat _toFormat = AV_SAMPLE_FMT_S16; -static const int64_t _toChannelLayout = AV_CH_LAYOUT_STEREO; -static const int32 _toChannels = 2; -class FFMpegLoader : public AudioPlayerLoader { +class AbstractFFMpegLoader : public AudioPlayerLoader { public: - FFMpegLoader(const FileLocation &file, const QByteArray &data) : AudioPlayerLoader(file, data), - freq(AudioVoiceMsgFrequency), fmt(AL_FORMAT_STEREO16), - sampleSize(2 * sizeof(short)), srcRate(AudioVoiceMsgFrequency), dstRate(AudioVoiceMsgFrequency), - maxResampleSamples(1024), dstSamplesData(0), len(0), - ioBuffer(0), ioContext(0), fmtContext(0), codec(0), codecContext(0), streamId(0), frame(0), swrContext(0), - _opened(false) { - frame = av_frame_alloc(); + AbstractFFMpegLoader(const FileLocation &file, const QByteArray &data) : AudioPlayerLoader(file, data) + , freq(AudioVoiceMsgFrequency) + , len(0) + , ioBuffer(0) + , ioContext(0) + , fmtContext(0) + , codec(0) + , streamId(0) + , _opened(false) { } bool open(qint64 position = 0) { @@ -1129,31 +1130,32 @@ public: return false; } + int res = 0; + char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; + ioBuffer = (uchar*)av_malloc(AVBlockSize); if (data.isEmpty()) { - ioContext = avio_alloc_context(ioBuffer, AVBlockSize, 0, static_cast(this), &FFMpegLoader::_read_file, 0, &FFMpegLoader::_seek_file); + ioContext = avio_alloc_context(ioBuffer, AVBlockSize, 0, reinterpret_cast(this), &AbstractFFMpegLoader::_read_file, 0, &AbstractFFMpegLoader::_seek_file); } else { - ioContext = avio_alloc_context(ioBuffer, AVBlockSize, 0, static_cast(this), &FFMpegLoader::_read_data, 0, &FFMpegLoader::_seek_data); + ioContext = avio_alloc_context(ioBuffer, AVBlockSize, 0, reinterpret_cast(this), &AbstractFFMpegLoader::_read_data, 0, &AbstractFFMpegLoader::_seek_data); } fmtContext = avformat_alloc_context(); if (!fmtContext) { - LOG(("Audio Error: Unable to avformat_alloc_context for file '%1', data size '%2'").arg(file.name()).arg(data.size())); + DEBUG_LOG(("Audio Read Error: Unable to avformat_alloc_context for file '%1', data size '%2'").arg(file.name()).arg(data.size())); return false; } fmtContext->pb = ioContext; - int res = 0; - char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; if ((res = avformat_open_input(&fmtContext, 0, 0, 0)) < 0) { ioBuffer = 0; - LOG(("Audio Error: Unable to avformat_open_input for file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + DEBUG_LOG(("Audio Read Error: Unable to avformat_open_input for file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); return false; } _opened = true; if ((res = avformat_find_stream_info(fmtContext, 0)) < 0) { - LOG(("Audio Error: Unable to avformat_find_stream_info for file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + DEBUG_LOG(("Audio Read Error: Unable to avformat_find_stream_info for file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); return false; } @@ -1163,20 +1165,130 @@ public: return false; } - // Get a pointer to the codec context for the audio stream - codecContext = fmtContext->streams[streamId]->codec; - av_opt_set_int(codecContext, "refcounted_frames", 1, 0); - if ((res = avcodec_open2(codecContext, codec, 0)) < 0) { - LOG(("Audio Error: Unable to avcodec_open2 for file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); - return false; - } - - freq = codecContext->sample_rate; + freq = fmtContext->streams[streamId]->codec->sample_rate; if (fmtContext->streams[streamId]->duration == AV_NOPTS_VALUE) { len = (fmtContext->duration * freq) / AV_TIME_BASE; } else { len = (fmtContext->streams[streamId]->duration * freq * fmtContext->streams[streamId]->time_base.num) / fmtContext->streams[streamId]->time_base.den; } + + return true; + } + + int64 duration() { + return len; + } + + int32 frequency() { + return freq; + } + + ~AbstractFFMpegLoader() { + if (ioContext) av_free(ioContext); + if (_opened) { + avformat_close_input(&fmtContext); + } else if (ioBuffer) { + av_free(ioBuffer); + } + if (fmtContext) avformat_free_context(fmtContext); + } + +protected: + + int32 freq; + int64 len; + + uchar *ioBuffer; + AVIOContext *ioContext; + AVFormatContext *fmtContext; + AVCodec *codec; + int32 streamId; + + bool _opened; + +private: + + static int _read_data(void *opaque, uint8_t *buf, int buf_size) { + AbstractFFMpegLoader *l = reinterpret_cast(opaque); + + int32 nbytes = qMin(l->data.size() - l->dataPos, int32(buf_size)); + if (nbytes <= 0) { + return 0; + } + + memcpy(buf, l->data.constData() + l->dataPos, nbytes); + l->dataPos += nbytes; + return nbytes; + } + + static int64_t _seek_data(void *opaque, int64_t offset, int whence) { + AbstractFFMpegLoader *l = reinterpret_cast(opaque); + + int32 newPos = -1; + switch (whence) { + case SEEK_SET: newPos = offset; break; + case SEEK_CUR: newPos = l->dataPos + offset; break; + case SEEK_END: newPos = l->data.size() + offset; break; + } + if (newPos < 0 || newPos > l->data.size()) { + return -1; + } + l->dataPos = newPos; + return l->dataPos; + } + + static int _read_file(void *opaque, uint8_t *buf, int buf_size) { + AbstractFFMpegLoader *l = reinterpret_cast(opaque); + return int(l->f.read((char*)(buf), buf_size)); + } + + static int64_t _seek_file(void *opaque, int64_t offset, int whence) { + AbstractFFMpegLoader *l = reinterpret_cast(opaque); + + switch (whence) { + case SEEK_SET: return l->f.seek(offset) ? l->f.pos() : -1; + case SEEK_CUR: return l->f.seek(l->f.pos() + offset) ? l->f.pos() : -1; + case SEEK_END: return l->f.seek(l->f.size() + offset) ? l->f.pos() : -1; + } + return -1; + } +}; + +static const AVSampleFormat _toFormat = AV_SAMPLE_FMT_S16; +static const int64_t _toChannelLayout = AV_CH_LAYOUT_STEREO; +static const int32 _toChannels = 2; +class FFMpegLoader : public AbstractFFMpegLoader { +public: + + FFMpegLoader(const FileLocation &file, const QByteArray &data) : AbstractFFMpegLoader(file, data) + , sampleSize(2 * sizeof(uint16)) + , fmt(AL_FORMAT_STEREO16) + , srcRate(AudioVoiceMsgFrequency) + , dstRate(AudioVoiceMsgFrequency) + , maxResampleSamples(1024) + , dstSamplesData(0) + , codecContext(0) + , frame(0) + , swrContext(0) { + frame = av_frame_alloc(); + } + + bool open(qint64 position = 0) { + if (!AbstractFFMpegLoader::open(position)) { + return false; + } + + int res = 0; + char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; + + // Get a pointer to the codec context for the audio stream + av_opt_set_int(fmtContext->streams[streamId]->codec, "refcounted_frames", 1, 0); + if ((res = avcodec_open2(fmtContext->streams[streamId]->codec, codec, 0)) < 0) { + LOG(("Audio Error: Unable to avcodec_open2 for file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + return false; + } + codecContext = fmtContext->streams[streamId]->codec; + uint64_t layout = codecContext->channel_layout; inputFormat = codecContext->sample_fmt; switch (layout) { @@ -1185,7 +1297,7 @@ public: case AV_SAMPLE_FMT_U8: case AV_SAMPLE_FMT_U8P: fmt = AL_FORMAT_MONO8; sampleSize = 1; break; case AV_SAMPLE_FMT_S16: - case AV_SAMPLE_FMT_S16P: fmt = AL_FORMAT_MONO16; sampleSize = 2; break; + case AV_SAMPLE_FMT_S16P: fmt = AL_FORMAT_MONO16; sampleSize = sizeof(uint16); break; default: sampleSize = -1; // convert needed break; @@ -1193,8 +1305,8 @@ public: break; case AV_CH_LAYOUT_STEREO: switch (inputFormat) { - case AV_SAMPLE_FMT_U8: fmt = AL_FORMAT_STEREO8; sampleSize = sizeof(short); break; - case AV_SAMPLE_FMT_S16: fmt = AL_FORMAT_STEREO16; sampleSize = 2 * sizeof(short); break; + case AV_SAMPLE_FMT_U8: fmt = AL_FORMAT_STEREO8; sampleSize = 2; break; + case AV_SAMPLE_FMT_S16: fmt = AL_FORMAT_STEREO16; sampleSize = 2 * sizeof(uint16); break; default: sampleSize = -1; // convert needed break; @@ -1256,14 +1368,6 @@ public: return true; } - int64 duration() { - return len; - } - - int32 frequency() { - return freq; - } - int32 format() { return fmt; } @@ -1326,7 +1430,6 @@ public: } ~FFMpegLoader() { - if (ioContext) av_free(ioContext); if (codecContext) avcodec_close(codecContext); if (swrContext) swr_free(&swrContext); if (dstSamplesData) { @@ -1335,80 +1438,25 @@ public: } av_freep(&dstSamplesData); } - if (_opened) { - avformat_close_input(&fmtContext); - } else if (ioBuffer) { - av_free(ioBuffer); - } - if (fmtContext) avformat_free_context(fmtContext); av_frame_free(&frame); } +protected: + int32 sampleSize; + private: - int32 freq, fmt; - int32 sampleSize, srcRate, dstRate, maxResampleSamples; + int32 fmt; + int32 srcRate, dstRate, maxResampleSamples; uint8_t **dstSamplesData; - int64 len; - uchar *ioBuffer; - AVIOContext *ioContext; - AVFormatContext *fmtContext; - AVCodec *codec; AVCodecContext *codecContext; AVPacket avpkt; - int32 streamId; AVSampleFormat inputFormat; AVFrame *frame; SwrContext *swrContext; - bool _opened; - - static int _read_data(void *opaque, uint8_t *buf, int buf_size) { - FFMpegLoader *l = reinterpret_cast(opaque); - - int32 nbytes = qMin(l->data.size() - l->dataPos, int32(buf_size)); - if (nbytes <= 0) { - return 0; - } - - memcpy(buf, l->data.constData() + l->dataPos, nbytes); - l->dataPos += nbytes; - return nbytes; - } - - static int64_t _seek_data(void *opaque, int64_t offset, int whence) { - FFMpegLoader *l = reinterpret_cast(opaque); - - int32 newPos = -1; - switch (whence) { - case SEEK_SET: newPos = offset; break; - case SEEK_CUR: newPos = l->dataPos + offset; break; - case SEEK_END: newPos = l->data.size() + offset; break; - } - if (newPos < 0 || newPos > l->data.size()) { - return -1; - } - l->dataPos = newPos; - return l->dataPos; - } - - static int _read_file(void *opaque, uint8_t *buf, int buf_size) { - FFMpegLoader *l = reinterpret_cast(opaque); - return int(l->f.read((char*)(buf), buf_size)); - } - - static int64_t _seek_file(void *opaque, int64_t offset, int whence) { - FFMpegLoader *l = reinterpret_cast(opaque); - - switch (whence) { - case SEEK_SET: return l->f.seek(offset) ? l->f.pos() : -1; - case SEEK_CUR: return l->f.seek(l->f.pos() + offset) ? l->f.pos() : -1; - case SEEK_END: return l->f.seek(l->f.size() + offset) ? l->f.pos() : -1; - } - return -1; - } }; AudioPlayerLoaders::AudioPlayerLoaders(QThread *thread) : _audioLoader(0), _songLoader(0) { @@ -1436,7 +1484,7 @@ void AudioPlayerLoaders::onStart(const AudioMsgId &audio, qint64 position) { voice->_audioData[voice->_audioCurrent].loading = true; } - loadData(OverviewAudios, static_cast(&audio), position); + loadData(OverviewVoiceFiles, static_cast(&audio), position); } void AudioPlayerLoaders::onStart(const SongMsgId &song, qint64 position) { @@ -1452,13 +1500,13 @@ void AudioPlayerLoaders::onStart(const SongMsgId &song, qint64 position) { voice->_songData[voice->_songCurrent].loading = true; } - loadData(OverviewDocuments, static_cast(&song), position); + loadData(OverviewFiles, static_cast(&song), position); } void AudioPlayerLoaders::clear(MediaOverviewType type) { switch (type) { - case OverviewAudios: clearAudio(); break; - case OverviewDocuments: clearSong(); break; + case OverviewVoiceFiles: clearAudio(); break; + case OverviewFiles: clearSong(); break; } } @@ -1469,8 +1517,8 @@ void AudioPlayerLoaders::setStoppedState(AudioPlayer::Msg *m, AudioPlayerState s void AudioPlayerLoaders::emitError(MediaOverviewType type) { switch (type) { - case OverviewAudios: emit error(clearAudio()); break; - case OverviewDocuments: emit error(clearSong()); break; + case OverviewVoiceFiles: emit error(clearAudio()); break; + case OverviewFiles: emit error(clearSong()); break; } } @@ -1491,11 +1539,11 @@ SongMsgId AudioPlayerLoaders::clearSong() { } void AudioPlayerLoaders::onLoad(const AudioMsgId &audio) { - loadData(OverviewAudios, static_cast(&audio), 0); + loadData(OverviewVoiceFiles, static_cast(&audio), 0); } void AudioPlayerLoaders::onLoad(const SongMsgId &song) { - loadData(OverviewDocuments, static_cast(&song), 0); + loadData(OverviewFiles, static_cast(&song), 0); } void AudioPlayerLoaders::loadData(MediaOverviewType type, const void *objId, qint64 position) { @@ -1608,8 +1656,8 @@ void AudioPlayerLoaders::loadData(MediaOverviewType type, const void *objId, qin audioPlayer()->resumeDevice(); switch (type) { - case OverviewAudios: alSourcef(m->source, AL_GAIN, suppressAllGain); break; - case OverviewDocuments: alSourcef(m->source, AL_GAIN, suppressSongGain * cSongVolume()); break; + case OverviewVoiceFiles: alSourcef(m->source, AL_GAIN, suppressAllGain); break; + case OverviewFiles: alSourcef(m->source, AL_GAIN, suppressSongGain * cSongVolume()); break; } if (!_checkALError()) { setStoppedState(m, AudioPlayerStoppedAtError); @@ -1643,7 +1691,7 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const AudioPlayer::Msg *m = 0; AudioPlayerLoader **l = 0; switch (type) { - case OverviewAudios: { + case OverviewVoiceFiles: { AudioPlayer::AudioMsg &msg(voice->_audioData[voice->_audioCurrent]); const AudioMsgId &audio(*static_cast(objId)); if (msg.audio != audio || !msg.loading) { @@ -1654,7 +1702,7 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const l = &_audioLoader; isGoodId = (_audio == audio); } break; - case OverviewDocuments: { + case OverviewFiles: { AudioPlayer::SongMsg &msg(voice->_songData[voice->_songCurrent]); const SongMsgId &song(*static_cast(objId)); if (msg.song != song || !msg.loading) { @@ -1676,15 +1724,15 @@ AudioPlayerLoader *AudioPlayerLoaders::setupLoader(MediaOverviewType type, const delete *l; *l = 0; switch (type) { - case OverviewAudios: _audio = AudioMsgId(); break; - case OverviewDocuments: _song = SongMsgId(); break; + case OverviewVoiceFiles: _audio = AudioMsgId(); break; + case OverviewFiles: _song = SongMsgId(); break; } } if (!*l) { switch (type) { - case OverviewAudios: _audio = *static_cast(objId); break; - case OverviewDocuments: _song = *static_cast(objId); break; + case OverviewVoiceFiles: _audio = *static_cast(objId); break; + case OverviewFiles: _song = *static_cast(objId); break; } // QByteArray header = m->data.mid(0, 8); @@ -1737,13 +1785,13 @@ AudioPlayer::Msg *AudioPlayerLoaders::checkLoader(MediaOverviewType type) { AudioPlayer::Msg *m = 0; AudioPlayerLoader **l = 0; switch (type) { - case OverviewAudios: { + case OverviewVoiceFiles: { AudioPlayer::AudioMsg &msg(voice->_audioData[voice->_audioCurrent]); isGoodId = (msg.audio == _audio); l = &_audioLoader; m = &msg; } break; - case OverviewDocuments: { + case OverviewFiles: { AudioPlayer::SongMsg &msg(voice->_songData[voice->_songCurrent]); isGoodId = (msg.song == _song); l = &_songLoader; @@ -1799,10 +1847,30 @@ void AudioPlayerLoaders::onCancel(const SongMsgId &song) { } struct AudioCapturePrivate { - AudioCapturePrivate() : - device(0), fmt(0), ioBuffer(0), ioContext(0), fmtContext(0), stream(0), codec(0), codecContext(0), opened(false), - srcSamples(0), dstSamples(0), maxDstSamples(0), dstSamplesSize(0), fullSamples(0), srcSamplesData(0), dstSamplesData(0), - swrContext(0), lastUpdate(0), level(0), dataPos(0) { + AudioCapturePrivate() + : device(0) + , fmt(0) + , ioBuffer(0) + , ioContext(0) + , fmtContext(0) + , stream(0) + , codec(0) + , codecContext(0) + , opened(false) + , srcSamples(0) + , dstSamples(0) + , maxDstSamples(0) + , dstSamplesSize(0) + , fullSamples(0) + , srcSamplesData(0) + , dstSamplesData(0) + , swrContext(0) + , lastUpdate(0) + , levelMax(0) + , waveformMod(0) + , waveformEach(AudioVoiceMsgFrequency / 100) + , waveformPeak(0) + , dataPos(0) { } ALCdevice *device; AVOutputFormat *fmt; @@ -1819,11 +1887,15 @@ struct AudioCapturePrivate { SwrContext *swrContext; int32 lastUpdate; - int64 level; + uint16 levelMax; QByteArray data; int32 dataPos; + int64 waveformMod, waveformEach; + uint16 waveformPeak; + QVector waveform; + static int _read_data(void *opaque, uint8_t *buf, int buf_size) { AudioCapturePrivate *l = reinterpret_cast(opaque); @@ -2035,6 +2107,9 @@ void AudioCaptureInner::onStop(bool needResult) { d->fullSamples = 0; d->dataPos = 0; d->data.clear(); + d->waveformMod = 0; + d->waveformPeak = 0; + d->waveform.clear(); } else { float64 coef = 1. / fadeSamples, fadedFrom = 0; for (short *ptr = ((short*)_captured.data()) + capturedSamples, *end = ptr - fadeSamples; ptr != end; ++fadedFrom) { @@ -2056,6 +2131,9 @@ void AudioCaptureInner::onStop(bool needResult) { d->fullSamples = 0; d->dataPos = 0; d->data.clear(); + d->waveformMod = 0; + d->waveformPeak = 0; + d->waveform.clear(); } } } @@ -2068,7 +2146,37 @@ void AudioCaptureInner::onStop(bool needResult) { } QByteArray result = d->fullSamples ? d->data : QByteArray(); + VoiceWaveform waveform; qint32 samples = d->fullSamples; + if (samples && !d->waveform.isEmpty()) { + int64 count = d->waveform.size(), sum = 0; + if (count >= WaveformSamplesCount) { + QVector peaks; + peaks.reserve(WaveformSamplesCount); + + uint16 peak = 0; + for (int32 i = 0; i < count; ++i) { + uint16 sample = uint16(d->waveform.at(i)) * 256; + if (peak < sample) { + peak = sample; + } + sum += WaveformSamplesCount; + if (sum >= count) { + sum -= count; + peaks.push_back(peak); + peak = 0; + } + } + + int64 sum = std::accumulate(peaks.cbegin(), peaks.cend(), 0ULL); + peak = qMax(int32(sum * 1.8 / peaks.size()), 2500); + + waveform.resize(peaks.size()); + for (int32 i = 0, l = peaks.size(); i != l; ++i) { + waveform[i] = char(qMin(31U, uint32(qMin(peaks.at(i), peak)) * 31 / peak)); + } + } + } if (d->device) { alcCaptureStop(d->device); alcCaptureCloseDevice(d->device); @@ -2116,12 +2224,16 @@ void AudioCaptureInner::onStop(bool needResult) { d->codec = 0; d->lastUpdate = 0; - d->level = 0; + d->levelMax = 0; d->dataPos = 0; d->data.clear(); + + d->waveformMod = 0; + d->waveformPeak = 0; + d->waveform.clear(); } - if (needResult) emit done(result, samples); + if (needResult) emit done(result, waveform, samples); } void AudioCaptureInner::onTimeout() { @@ -2155,18 +2267,20 @@ void AudioCaptureInner::onTimeout() { int32 levelindex = d->fullSamples + (s / sizeof(short)); for (const short *ptr = (const short*)(_captured.constData() + s), *end = (const short*)(_captured.constData() + news); ptr < end; ++ptr, ++levelindex) { if (levelindex > skipSamples) { + uint16 value = qAbs(*ptr); if (levelindex < skipSamples + fadeSamples) { - d->level += qRound(qAbs(*ptr) * float64(levelindex - skipSamples) / fadeSamples); - } else { - d->level += qAbs(*ptr); + value = qRound(value * float64(levelindex - skipSamples) / fadeSamples); + } + if (d->levelMax < value) { + d->levelMax = value; } } } qint32 samplesFull = d->fullSamples + _captured.size() / sizeof(short), samplesSinceUpdate = samplesFull - d->lastUpdate; if (samplesSinceUpdate > AudioVoiceMsgUpdateView * AudioVoiceMsgFrequency / 1000) { - emit update(d->level / samplesSinceUpdate, samplesFull); + emit update(d->levelMax, samplesFull); d->lastUpdate = samplesFull; - d->level = 0; + d->levelMax = 0; } // Write frames int32 framesize = d->srcSamples * d->codecContext->channels * sizeof(short), encoded = 0; @@ -2206,7 +2320,7 @@ void AudioCaptureInner::writeFrame(int32 offset, int32 framesize) { if (d->fullSamples < skipSamples + fadeSamples) { int32 fadedCnt = qMin(samplesCnt, skipSamples + fadeSamples - d->fullSamples); float64 coef = 1. / fadeSamples, fadedFrom = d->fullSamples - skipSamples; - short *ptr = (short*)srcSamplesData[0], *zeroEnd = ptr + qMin(samplesCnt, qMax(0, skipSamples - d->fullSamples)), *end = ptr + fadedCnt; + short *ptr = srcSamplesDataChannel, *zeroEnd = ptr + qMin(samplesCnt, qMax(0, skipSamples - d->fullSamples)), *end = ptr + fadedCnt; for (; ptr != zeroEnd; ++ptr, ++fadedFrom) { *ptr = 0; } @@ -2215,6 +2329,19 @@ void AudioCaptureInner::writeFrame(int32 offset, int32 framesize) { } } + d->waveform.reserve(d->waveform.size() + (samplesCnt / d->waveformEach) + 1); + for (short *ptr = srcSamplesDataChannel, *end = ptr + samplesCnt; ptr != end; ++ptr) { + uint16 value = qAbs(*ptr); + if (d->waveformPeak < value) { + d->waveformPeak = value; + } + if (++d->waveformMod == d->waveformEach) { + d->waveformMod -= d->waveformEach; + d->waveform.push_back(uchar(d->waveformPeak / 256)); + d->waveformPeak = 0; + } + } + // Convert to final format d->dstSamples = av_rescale_rnd(swr_get_delay(d->swrContext, d->codecContext->sample_rate) + d->srcSamples, d->codecContext->sample_rate, d->codecContext->sample_rate, AV_ROUND_UP); @@ -2269,65 +2396,25 @@ void AudioCaptureInner::writeFrame(int32 offset, int32 framesize) { av_frame_free(&frame); } -class FFMpegAttributesReader : public AudioPlayerLoader { +class FFMpegAttributesReader : public AbstractFFMpegLoader { public: - FFMpegAttributesReader(const FileLocation &file, const QByteArray &data) : AudioPlayerLoader(file, data), - ioBuffer(0), ioContext(0), fmtContext(0), codec(0), streamId(0), - _opened(false) { + FFMpegAttributesReader(const FileLocation &file, const QByteArray &data) : AbstractFFMpegLoader(file, data) { } bool open(qint64 position = 0) { - if (!AudioPlayerLoader::openFile()) { + if (!AbstractFFMpegLoader::openFile()) { return false; } - ioBuffer = (uchar*)av_malloc(AVBlockSize); - if (data.isEmpty()) { - ioContext = avio_alloc_context(ioBuffer, AVBlockSize, 0, static_cast(this), &FFMpegAttributesReader::_read_file, 0, &FFMpegAttributesReader::_seek_file); - } else { - ioContext = avio_alloc_context(ioBuffer, AVBlockSize, 0, static_cast(this), &FFMpegAttributesReader::_read_data, 0, &FFMpegAttributesReader::_seek_data); - } - fmtContext = avformat_alloc_context(); - if (!fmtContext) { - DEBUG_LOG(("Audio Read Error: Unable to avformat_alloc_context for file '%1', data size '%2'").arg(fname).arg(data.size())); - return false; - } - fmtContext->pb = ioContext; - int res = 0; char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; - if ((res = avformat_open_input(&fmtContext, 0, 0, 0)) < 0) { - ioBuffer = 0; - DEBUG_LOG(("Audio Read Error: Unable to avformat_open_input for file '%1', data size '%2', error %3, %4").arg(fname).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); + int videoStreamId = av_find_best_stream(fmtContext, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0); + if (videoStreamId >= 0) { + DEBUG_LOG(("Audio Read Error: Found video stream in file '%1', data size '%2', error %3, %4").arg(file.name()).arg(data.size()).arg(videoStreamId).arg(av_make_error_string(err, sizeof(err), streamId))); return false; } - _opened = true; - - if ((res = avformat_find_stream_info(fmtContext, 0)) < 0) { - DEBUG_LOG(("Audio Read Error: Unable to avformat_find_stream_info for file '%1', data size '%2', error %3, %4").arg(fname).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res))); - return false; - } - - streamId = av_find_best_stream(fmtContext, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0); - if (streamId >= 0) { - DEBUG_LOG(("Audio Read Error: Found video stream in file '%1', data size '%2', error %3, %4").arg(fname).arg(data.size()).arg(streamId).arg(av_make_error_string(err, sizeof(err), streamId))); - return false; - } - - streamId = av_find_best_stream(fmtContext, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0); - if (streamId < 0) { - DEBUG_LOG(("Audio Read Error: Unable to av_find_best_stream for file '%1', data size '%2', error %3, %4").arg(fname).arg(data.size()).arg(streamId).arg(av_make_error_string(err, sizeof(err), streamId))); - return false; - } - - freq = fmtContext->streams[streamId]->codec->sample_rate; - if (fmtContext->streams[streamId]->duration == AV_NOPTS_VALUE) { - len = (fmtContext->duration * freq) / AV_TIME_BASE; - } else { - len = (fmtContext->streams[streamId]->duration * freq * fmtContext->streams[streamId]->time_base.num) / fmtContext->streams[streamId]->time_base.den; - } for (int32 i = 0, l = fmtContext->nb_streams; i < l; ++i) { AVStream *stream = fmtContext->streams[i]; @@ -2370,14 +2457,6 @@ public: //} } - int64 duration() { - return len; - } - - int32 frequency() { - return freq; - } - int32 format() { return 0; } @@ -2408,77 +2487,14 @@ public: } ~FFMpegAttributesReader() { - if (ioContext) av_free(ioContext); - if (_opened) { - avformat_close_input(&fmtContext); - } else if (ioBuffer) { - av_free(ioBuffer); - } - if (fmtContext) avformat_free_context(fmtContext); } private: - QString fname, data; - - int32 freq; - int64 len; QString _title, _performer; QImage _cover; QByteArray _coverBytes, _coverFormat; - uchar *ioBuffer; - AVIOContext *ioContext; - AVFormatContext *fmtContext; - AVCodec *codec; - int32 streamId; - - bool _opened; - - static int _read_data(void *opaque, uint8_t *buf, int buf_size) { - FFMpegAttributesReader *l = reinterpret_cast(opaque); - - int32 nbytes = qMin(l->data.size() - l->dataPos, int32(buf_size)); - if (nbytes <= 0) { - return 0; - } - - memcpy(buf, l->data.constData() + l->dataPos, nbytes); - l->dataPos += nbytes; - return nbytes; - } - - static int64_t _seek_data(void *opaque, int64_t offset, int whence) { - FFMpegAttributesReader *l = reinterpret_cast(opaque); - - int32 newPos = -1; - switch (whence) { - case SEEK_SET: newPos = offset; break; - case SEEK_CUR: newPos = l->dataPos + offset; break; - case SEEK_END: newPos = l->data.size() + offset; break; - } - if (newPos < 0 || newPos > l->data.size()) { - return -1; - } - l->dataPos = newPos; - return l->dataPos; - } - - static int _read_file(void *opaque, uint8_t *buf, int buf_size) { - FFMpegAttributesReader *l = reinterpret_cast(opaque); - return int(l->f.read((char*)(buf), buf_size)); - } - - static int64_t _seek_file(void *opaque, int64_t offset, int whence) { - FFMpegAttributesReader *l = reinterpret_cast(opaque); - - switch (whence) { - case SEEK_SET: return l->f.seek(offset) ? l->f.pos() : -1; - case SEEK_CUR: return l->f.seek(l->f.pos() + offset) ? l->f.pos() : -1; - case SEEK_END: return l->f.seek(l->f.size() + offset) ? l->f.pos() : -1; - } - return -1; - } }; MTPDocumentAttribute audioReadSongAttributes(const QString &fname, const QByteArray &data, QImage &cover, QByteArray &coverBytes, QByteArray &coverFormat) { @@ -2489,8 +2505,116 @@ MTPDocumentAttribute audioReadSongAttributes(const QString &fname, const QByteAr cover = reader.cover(); coverBytes = reader.coverBytes(); coverFormat = reader.coverFormat(); - return MTP_documentAttributeAudio(MTP_int(duration), MTP_string(reader.title()), MTP_string(reader.performer())); + 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_documentAttributeFilename(MTP_string(fname)); } + +class FFMpegWaveformCounter : public FFMpegLoader { +public: + + FFMpegWaveformCounter(const FileLocation &file, const QByteArray &data) : FFMpegLoader(file, data) { + } + + bool open(qint64 position = 0) { + if (!FFMpegLoader::open(position)) { + return false; + } + + QByteArray buffer; + buffer.reserve(AudioVoiceMsgBufferSize); + int64 countbytes = sampleSize * duration(), processed = 0, sumbytes = 0; + if (duration() < WaveformSamplesCount) { + return false; + } + + QVector peaks; + peaks.reserve(WaveformSamplesCount); + + int32 fmt = format(); + uint16 peak = 0; + while (processed < countbytes) { + buffer.resize(0); + + int64 samples = 0; + int res = readMore(buffer, samples); + if (res < 0) { + break; + } + if (buffer.isEmpty()) { + continue; + } + + const char *data = buffer.data(); + if (fmt == AL_FORMAT_MONO8 || fmt == AL_FORMAT_STEREO8) { + for (int32 i = 0, l = buffer.size(); i + sizeof(uchar) <= l;) { + uint16 sample = qAbs((int32(*(uchar*)(data + i)) - 128) * 256); + if (peak < sample) { + peak = sample; + } + + i += sizeof(uchar); + sumbytes += WaveformSamplesCount; + if (sumbytes >= countbytes) { + sumbytes -= countbytes; + peaks.push_back(peak); + peak = 0; + } + } + } else if (fmt == AL_FORMAT_MONO16 || fmt == AL_FORMAT_STEREO16) { + for (int32 i = 0, l = buffer.size(); i + sizeof(uint16) <= l;) { + uint16 sample = qAbs(int32(*(int16*)(data + i))); + if (peak < sample) { + peak = sample; + } + + i += sizeof(uint16); + sumbytes += sizeof(uint16) * WaveformSamplesCount; + if (sumbytes >= countbytes) { + sumbytes -= countbytes; + peaks.push_back(peak); + peak = 0; + } + } + } + processed += sampleSize * samples; + } + if (sumbytes > 0 && peaks.size() < WaveformSamplesCount) { + peaks.push_back(peak); + } + + if (peaks.isEmpty()) { + return false; + } + + int64 sum = std::accumulate(peaks.cbegin(), peaks.cend(), 0ULL); + peak = qMax(int32(sum * 1.8 / peaks.size()), 2500); + + result.resize(peaks.size()); + for (int32 i = 0, l = peaks.size(); i != l; ++i) { + result[i] = char(qMin(31U, uint32(qMin(peaks.at(i), peak)) * 31 / peak)); + } + + return true; + } + + const VoiceWaveform &waveform() const { + return result; + } + + ~FFMpegWaveformCounter() { + } + +private: + VoiceWaveform result; + +}; + +VoiceWaveform audioCountWaveform(const FileLocation &file, const QByteArray &data) { + FFMpegWaveformCounter counter(file, data); + if (counter.open()) { + return counter.waveform(); + } + return VoiceWaveform(); +} diff --git a/Telegram/SourceFiles/audio.h b/Telegram/SourceFiles/audio.h index e21c273f78..f9259906e9 100644 --- a/Telegram/SourceFiles/audio.h +++ b/Telegram/SourceFiles/audio.h @@ -56,7 +56,7 @@ public: void play(const AudioMsgId &audio, int64 position = 0); void play(const SongMsgId &song, int64 position = 0); void pauseresume(MediaOverviewType type, bool fast = false); - void seek(int64 position); // type == OverviewDocuments + void seek(int64 position); // type == OverviewFiles void stop(MediaOverviewType type); void stopAndClear(); @@ -201,8 +201,8 @@ signals: void captureOnStart(); void captureOnStop(bool needResult); - void onDone(QByteArray data, qint32 samples); - void onUpdate(qint16 level, qint32 samples); + void onDone(QByteArray data, VoiceWaveform waveform, qint32 samples); + void onUpdate(quint16 level, qint32 samples); void onError(); private: @@ -338,8 +338,8 @@ public: signals: void error(); - void update(qint16 level, qint32 samples); - void done(QByteArray data, qint32 samples); + void update(quint16 level, qint32 samples); + void done(QByteArray data, VoiceWaveform waveform, qint32 samples); public slots: @@ -360,3 +360,4 @@ private: }; MTPDocumentAttribute audioReadSongAttributes(const QString &fname, const QByteArray &data, QImage &cover, QByteArray &coverBytes, QByteArray &coverFormat); +VoiceWaveform audioCountWaveform(const FileLocation &file, const QByteArray &data); diff --git a/Telegram/SourceFiles/boxes/connectionbox.cpp b/Telegram/SourceFiles/boxes/connectionbox.cpp index a94fdd44db..27b2ce7ff4 100644 --- a/Telegram/SourceFiles/boxes/connectionbox.cpp +++ b/Telegram/SourceFiles/boxes/connectionbox.cpp @@ -313,9 +313,11 @@ void AutoDownloadBox::onSave() { bool enabledGroups = ((cAutoDownloadAudio() & dbiadNoGroups) && !(autoDownloadAudio & dbiadNoGroups)); cSetAutoDownloadAudio(autoDownloadAudio); if (enabledPrivate || enabledGroups) { - const AudiosData &data(App::audiosData()); - for (AudiosData::const_iterator i = data.cbegin(), e = data.cend(); i != e; ++i) { - i.value()->automaticLoadSettingsChanged(); + const DocumentsData &data(App::documentsData()); + for (DocumentsData::const_iterator i = data.cbegin(), e = data.cend(); i != e; ++i) { + if (i.value()->voice()) { + i.value()->automaticLoadSettingsChanged(); + } } } changed = true; @@ -328,7 +330,9 @@ void AutoDownloadBox::onSave() { if (enabledPrivate || enabledGroups) { const DocumentsData &data(App::documentsData()); for (DocumentsData::const_iterator i = data.cbegin(), e = data.cend(); i != e; ++i) { - i.value()->automaticLoadSettingsChanged(); + if (i.value()->isAnimation()) { + i.value()->automaticLoadSettingsChanged(); + } } Notify::automaticLoadSettingsChangedGif(); } diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index f5797848c9..0878f1a6d7 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -118,6 +118,8 @@ enum { AudioVoiceMsgInMemory = 2 * 1024 * 1024, // 2 Mb audio is hold in memory and auto loaded AudioPauseDeviceTimeout = 3000, // pause in 3 secs after playing is over + WaveformSamplesCount = 100, + StickerInMemory = 2 * 1024 * 1024, // 2 Mb stickers hold in memory, auto loaded and displayed inline StickerMaxSize = 2048, // 2048x2048 is a max image size for sticker diff --git a/Telegram/SourceFiles/fileuploader.cpp b/Telegram/SourceFiles/fileuploader.cpp index 607a2e91cc..c93f8dbb6a 100644 --- a/Telegram/SourceFiles/fileuploader.cpp +++ b/Telegram/SourceFiles/fileuploader.cpp @@ -32,7 +32,7 @@ FileUploader::FileUploader() : sentSize(0) { void FileUploader::uploadMedia(const FullMsgId &msgId, const ReadyLocalMedia &media) { if (media.type == PreparePhoto) { App::feedPhoto(media.photo, media.photoThumbs); - } else if (media.type == PrepareDocument) { + } else if (media.type == PrepareDocument || media.type == PrepareAudio) { DocumentData *document; if (media.photoThumbs.isEmpty()) { document = App::feedDocument(media.document); @@ -40,13 +40,12 @@ void FileUploader::uploadMedia(const FullMsgId &msgId, const ReadyLocalMedia &me document = App::feedDocument(media.document, media.photoThumbs.begin().value()); } document->status = FileUploading; + if (!media.data.isEmpty()) { + document->setData(media.data); + } if (!media.file.isEmpty()) { document->setLocation(FileLocation(StorageFilePartial, media.file)); } - } else if (media.type == PrepareAudio) { - AudioData *audio = App::feedAudio(media.audio); - audio->status = FileUploading; - audio->setData(media.data); } queue.insert(msgId, File(media)); sendNext(); @@ -56,7 +55,7 @@ void FileUploader::upload(const FullMsgId &msgId, const FileLoadResultPtr &file) if (file->type == PreparePhoto) { PhotoData *photo = App::feedPhoto(file->photo, file->photoThumbs); photo->uploadingData = new PhotoData::UploadingData(file->partssize); - } else if (file->type == PrepareDocument) { + } else if (file->type == PrepareDocument || file->type == PrepareAudio) { DocumentData *document; if (file->thumb.isNull()) { document = App::feedDocument(file->document); @@ -64,13 +63,12 @@ void FileUploader::upload(const FullMsgId &msgId, const FileLoadResultPtr &file) document = App::feedDocument(file->document, file->thumb); } document->status = FileUploading; + if (!file->content.isEmpty()) { + document->setData(file->content); + } if (!file->filepath.isEmpty()) { document->setLocation(FileLocation(StorageFilePartial, file->filepath)); } - } else if (file->type == PrepareAudio) { - AudioData *audio = App::feedAudio(file->audio); - audio->status = FileUploading; - audio->setData(file->content); } queue.insert(msgId, File(file)); sendNext(); @@ -87,12 +85,6 @@ void FileUploader::currentFailed() { doc->status = FileUploadFailed; } emit documentFailed(j.key()); - } else if (j->type() == PrepareAudio) { - AudioData *audio = App::audio(j->id()); - if (audio->status == FileUploading) { - audio->status = FileUploadFailed; - } - emit audioFailed(j.key()); } queue.erase(j); } @@ -133,7 +125,7 @@ void FileUploader::sendNext() { if (!uploading.msg) { uploading = i.key(); } else if (i == queue.end()) { - i = queue.begin(); + i = queue.begin(); uploading = i.key(); } int todc = 0; @@ -150,7 +142,7 @@ void FileUploader::sendNext() { if (requestsSent.isEmpty() && docRequestsSent.isEmpty()) { if (i->type() == PreparePhoto) { emit photoReady(uploading, MTP_inputFile(MTP_long(i->id()), MTP_int(i->partsCount), MTP_string(i->filename()), MTP_string(i->file ? i->file->filemd5 : i->media.jpeg_md5))); - } else if (i->type() == PrepareDocument) { + } else if (i->type() == PrepareDocument || i->type() == PrepareAudio) { QByteArray docMd5(32, Qt::Uninitialized); hashMd5Hex(i->md5Hash.result(), docMd5.data()); @@ -160,12 +152,6 @@ void FileUploader::sendNext() { } else { emit documentReady(uploading, doc); } - } else if (i->type() == PrepareAudio) { - QByteArray audioMd5(32, Qt::Uninitialized); - hashMd5Hex(i->md5Hash.result(), audioMd5.data()); - - MTPInputFile audio = (i->docSize > UseBigFilesFrom) ? MTP_inputFileBig(MTP_long(i->id()), MTP_int(i->docPartsCount), MTP_string(i->filename())) : MTP_inputFile(MTP_long(i->id()), MTP_int(i->docPartsCount), MTP_string(i->filename()), MTP_string(audioMd5)); - emit audioReady(uploading, audio); } queue.remove(uploading); uploading = FullMsgId(); @@ -212,7 +198,7 @@ void FileUploader::sendNext() { i->docSentParts++; } else { UploadFileParts::iterator part = parts.begin(); - + mtpRequestId requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(partsOfId), MTP_int(part.key()), MTP_string(part.value())), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl[todc]); requestsSent.insert(requestId, part.value()); dcMap.insert(requestId, todc); @@ -303,7 +289,7 @@ void FileUploader::partLoaded(const MTPBool &result, mtpRequestId requestId) { photo->uploadingData->offset = k->fileSentSize; } emit photoProgress(k.key()); - } else if (k->type() == PrepareDocument) { + } else if (k->type() == PrepareDocument || k->type() == PrepareAudio) { DocumentData *doc = App::document(k->id()); if (doc->uploading()) { doc->uploadOffset = (k->docSentParts - docRequestsSent.size()) * k->docPartSize; @@ -312,15 +298,6 @@ void FileUploader::partLoaded(const MTPBool &result, mtpRequestId requestId) { } } emit documentProgress(k.key()); - } else if (k->type() == PrepareAudio) { - AudioData *audio = App::audio(k->id()); - if (audio->uploading()) { - audio->uploadOffset = (k->docSentParts - docRequestsSent.size()) * k->docPartSize; - if (audio->uploadOffset > audio->size) { - audio->uploadOffset = audio->size; - } - } - emit audioProgress(k.key()); } } } diff --git a/Telegram/SourceFiles/fileuploader.h b/Telegram/SourceFiles/fileuploader.h index 895e7c677a..8e038fd9d1 100644 --- a/Telegram/SourceFiles/fileuploader.h +++ b/Telegram/SourceFiles/fileuploader.h @@ -51,15 +51,12 @@ signals: void photoReady(const FullMsgId &msgId, const MTPInputFile &file); void documentReady(const FullMsgId &msgId, const MTPInputFile &file); void thumbDocumentReady(const FullMsgId &msgId, const MTPInputFile &file, const MTPInputFile &thumb); - void audioReady(const FullMsgId &msgId, const MTPInputFile &file); void photoProgress(const FullMsgId &msgId); void documentProgress(const FullMsgId &msgId); - void audioProgress(const FullMsgId &msgId); void photoFailed(const FullMsgId &msgId); void documentFailed(const FullMsgId &msgId); - void audioFailed(const FullMsgId &msgId); private: @@ -138,7 +135,7 @@ private: QMap dcMap; uint32 sentSize; uint32 sentSizes[MTPUploadSessionsCount]; - + FullMsgId uploading, _paused; Queue queue; Queue uploaded; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 869ad41142..1fec50eeeb 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -352,8 +352,8 @@ bool History::updateTyping(uint64 ms, bool force) { switch (sendActions.begin().value().type) { case SendActionRecordVideo: newTypingStr = peer->isUser() ? lang(lng_send_action_record_video) : lng_user_action_record_video(lt_user, sendActions.begin().key()->firstName); break; case SendActionUploadVideo: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_video) : lng_user_action_upload_video(lt_user, sendActions.begin().key()->firstName); break; - case SendActionRecordAudio: newTypingStr = peer->isUser() ? lang(lng_send_action_record_audio) : lng_user_action_record_audio(lt_user, sendActions.begin().key()->firstName); break; - case SendActionUploadAudio: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_audio) : lng_user_action_upload_audio(lt_user, sendActions.begin().key()->firstName); break; + case SendActionRecordVoice: newTypingStr = peer->isUser() ? lang(lng_send_action_record_audio) : lng_user_action_record_audio(lt_user, sendActions.begin().key()->firstName); break; + case SendActionUploadVoice: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_audio) : lng_user_action_upload_audio(lt_user, sendActions.begin().key()->firstName); break; case SendActionUploadPhoto: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_photo) : lng_user_action_upload_photo(lt_user, sendActions.begin().key()->firstName); break; case SendActionUploadFile: newTypingStr = peer->isUser() ? lang(lng_send_action_upload_file) : lng_user_action_upload_file(lt_user, sendActions.begin().key()->firstName); break; case SendActionChooseLocation: newTypingStr = peer->isUser() ? lang(lng_send_action_geo_location) : lng_user_action_geo_location(lt_user, sendActions.begin().key()->firstName); break; @@ -1249,8 +1249,8 @@ void Histories::regSendAction(History *history, UserData *user, const MTPSendMes case mtpc_sendMessageTypingAction: history->typing[user] = ms + 6000; break; case mtpc_sendMessageRecordVideoAction: history->sendActions.insert(user, SendAction(SendActionRecordVideo, ms + 6000)); break; case mtpc_sendMessageUploadVideoAction: history->sendActions.insert(user, SendAction(SendActionUploadVideo, ms + 6000, action.c_sendMessageUploadVideoAction().vprogress.v)); break; - case mtpc_sendMessageRecordAudioAction: history->sendActions.insert(user, SendAction(SendActionRecordAudio, ms + 6000)); break; - case mtpc_sendMessageUploadAudioAction: history->sendActions.insert(user, SendAction(SendActionUploadAudio, ms + 6000, action.c_sendMessageUploadAudioAction().vprogress.v)); break; + case mtpc_sendMessageRecordAudioAction: history->sendActions.insert(user, SendAction(SendActionRecordVoice, ms + 6000)); break; + case mtpc_sendMessageUploadAudioAction: history->sendActions.insert(user, SendAction(SendActionUploadVoice, ms + 6000, action.c_sendMessageUploadAudioAction().vprogress.v)); break; case mtpc_sendMessageUploadPhotoAction: history->sendActions.insert(user, SendAction(SendActionUploadPhoto, ms + 6000, action.c_sendMessageUploadPhotoAction().vprogress.v)); break; case mtpc_sendMessageUploadDocumentAction: history->sendActions.insert(user, SendAction(SendActionUploadFile, ms + 6000, action.c_sendMessageUploadDocumentAction().vprogress.v)); break; case mtpc_sendMessageGeoLocationAction: history->sendActions.insert(user, SendAction(SendActionChooseLocation, ms + 6000)); break; @@ -1369,13 +1369,6 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo default: badMedia = 1; break; } break; - case mtpc_messageMediaAudio: - switch (m.vmedia.c_messageMediaAudio().vaudio.type()) { - case mtpc_audio: break; - case mtpc_audioEmpty: badMedia = 2; break; - default: badMedia = 1; break; - } - break; case mtpc_messageMediaDocument: switch (m.vmedia.c_messageMediaDocument().vdocument.type()) { case mtpc_document: break; @@ -3060,18 +3053,14 @@ namespace { return result; } - int32 audioMaxStatusWidth(AudioData *audio) { - int32 result = st::normalFont->width(formatDownloadText(audio->size, audio->size)); - result = qMax(result, st::normalFont->width(formatPlayedText(audio->duration, audio->duration))); - result = qMax(result, st::normalFont->width(formatDurationAndSizeText(audio->duration, audio->size))); - return result; - } - int32 documentMaxStatusWidth(DocumentData *document) { int32 result = st::normalFont->width(formatDownloadText(document->size, document->size)); if (SongData *song = document->song()) { result = qMax(result, st::normalFont->width(formatPlayedText(song->duration, song->duration))); result = qMax(result, st::normalFont->width(formatDurationAndSizeText(song->duration, document->size))); + } else if (VoiceData *voice = document->voice()) { + result = qMax(result, st::normalFont->width(formatPlayedText(voice->duration, voice->duration))); + result = qMax(result, st::normalFont->width(formatDurationAndSizeText(voice->duration, document->size))); } else { result = qMax(result, st::normalFont->width(formatSizeText(document->size))); } @@ -3785,291 +3774,151 @@ ImagePtr HistoryVideo::replyPreview() { return _data->replyPreview; } -HistoryAudio::HistoryAudio(const MTPDaudio &audio) : HistoryFileMedia() -, _data(App::feedAudio(audio)) { - setLinks(new AudioOpenLink(_data), new AudioOpenLink(_data), new AudioCancelLink(_data)); - - setStatusSize(FileStatusSizeReady); +HistoryDocumentVoicePlayback::HistoryDocumentVoicePlayback(const HistoryDocument *that) +: _position(0) +, a_progress(0., 0.) +, _a_progress(animation(const_cast(that), &HistoryDocument::step_voiceProgress)) { } -HistoryAudio::HistoryAudio(const HistoryAudio &other) : HistoryFileMedia() -, _data(other._data) { - setLinks(new AudioOpenLink(_data), new AudioOpenLink(_data), new AudioCancelLink(_data)); - - setStatusSize(other._statusSize); -} - -void HistoryAudio::initDimensions(const HistoryItem *parent) { - _maxw = st::msgFileMinWidth; - - int32 tleft = 0, tright = 0; - - tleft = st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); - tright = st::msgFileThumbPadding.left(); - _maxw = qMax(_maxw, tleft + audioMaxStatusWidth(_data) + int(st::mediaUnreadSkip + st::mediaUnreadSize) + parent->skipBlockWidth() + st::msgPadding.right()); - - _maxw = qMax(tleft + st::semiboldFont->width(lang(lng_media_audio)) + tright, _maxw); - _maxw = qMin(_maxw, int(st::msgMaxWidth)); - - _height = _minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); -} - -void HistoryAudio::draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const { - if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; - - _data->automaticLoad(parent); - bool loaded = _data->loaded(), displayLoading = _data->displayLoading(); - - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; - - if (displayLoading) { - ensureAnimation(parent); - if (!_animation->radial.animating()) { - _animation->radial.start(_data->progress()); - } - } - bool showPause = updateStatusText(parent); - bool radial = isRadialAnimation(ms); - - int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0; - - nameleft = st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); - nametop = st::msgFileNameTop; - nameright = st::msgFilePadding.left(); - statustop = st::msgFileStatusTop; - - QRect inner(rtlrect(st::msgFilePadding.left(), st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, _width)); - p.setPen(Qt::NoPen); - if (selected) { - p.setBrush(outbg ? st::msgFileOutBgSelected : st::msgFileInBgSelected); - } else if (isThumbAnimation(ms)) { - float64 over = _animation->a_thumbOver.current(); - p.setBrush(style::interpolate(outbg ? st::msgFileOutBg : st::msgFileInBg, outbg ? st::msgFileOutBgOver : st::msgFileInBgOver, over)); - } else { - bool over = textlnkDrawOver(_data->loading() ? _cancell : _savel); - p.setBrush(outbg ? (over ? st::msgFileOutBgOver : st::msgFileOutBg) : (over ? st::msgFileInBgOver : st::msgFileInBg)); - } - - p.setRenderHint(QPainter::HighQualityAntialiasing); - p.drawEllipse(inner); - p.setRenderHint(QPainter::HighQualityAntialiasing, false); - - if (radial) { - QRect rinner(inner.marginsRemoved(QMargins(st::msgFileRadialLine, st::msgFileRadialLine, st::msgFileRadialLine, st::msgFileRadialLine))); - style::color bg(outbg ? (selected ? st::msgOutBgSelected : st::msgOutBg) : (selected ? st::msgInBgSelected : st::msgInBg)); - _animation->radial.draw(p, rinner, st::msgFileRadialLine, bg); - } - - style::sprite icon; - if (showPause) { - icon = outbg ? (selected ? st::msgFileOutPauseSelected : st::msgFileOutPause) : (selected ? st::msgFileInPauseSelected : st::msgFileInPause); - } else if (radial || _data->loading()) { - icon = outbg ? (selected ? st::msgFileOutCancelSelected : st::msgFileOutCancel) : (selected ? st::msgFileInCancelSelected : st::msgFileInCancel); - } else if (loaded) { - icon = outbg ? (selected ? st::msgFileOutPlaySelected : st::msgFileOutPlay) : (selected ? st::msgFileInPlaySelected : st::msgFileInPlay); - } else { - icon = outbg ? (selected ? st::msgFileOutDownloadSelected : st::msgFileOutDownload) : (selected ? st::msgFileInDownloadSelected : st::msgFileInDownload); - } - p.drawSpriteCenter(inner, icon); - - int32 namewidth = _width - nameleft - nameright; - - p.setFont(st::semiboldFont); - p.setPen(st::black); - p.drawTextLeft(nameleft, nametop, _width, lang(lng_media_audio)); - - style::color status(outbg ? (selected ? st::mediaOutFgSelected : st::mediaOutFg) : (selected ? st::mediaInFgSelected : st::mediaInFg)); - p.setFont(st::normalFont); - p.setPen(status); - p.drawTextLeft(nameleft, statustop, _width, _statusText); - - if (parent->isMediaUnread()) { - int32 w = st::normalFont->width(_statusText); - if (w + st::mediaUnreadSkip + st::mediaUnreadSize <= namewidth) { - p.setPen(Qt::NoPen); - p.setBrush(outbg ? (selected ? st::msgFileOutBgSelected : st::msgFileOutBg) : (selected ? st::msgFileInBgSelected : st::msgFileInBg)); - - p.setRenderHint(QPainter::HighQualityAntialiasing, true); - p.drawEllipse(rtlrect(nameleft + w + st::mediaUnreadSkip, statustop + st::mediaUnreadTop, st::mediaUnreadSize, st::mediaUnreadSize, _width)); - p.setRenderHint(QPainter::HighQualityAntialiasing, false); - } +void HistoryDocumentVoice::ensurePlayback(const HistoryDocument *that) const { + if (!_playback) { + _playback = new HistoryDocumentVoicePlayback(that); } } -void HistoryAudio::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const { - if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; - - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; - bool loaded = _data->loaded(); - - bool showPause = updateStatusText(parent); - - int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0; - - QRect inner(rtlrect(st::msgFilePadding.left(), st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, _width)); - if ((_data->loading() || _data->status == FileUploading || !loaded) && inner.contains(x, y)) { - lnk = (_data->loading() || _data->status == FileUploading) ? _cancell : _savel; - return; +void HistoryDocumentVoice::checkPlaybackFinished() const { + if (_playback && !_playback->_a_progress.animating()) { + delete _playback; + _playback = 0; } - - if (x >= 0 && y >= 0 && x < _width && y < _height && _data->access && !_data->loading()) { - lnk = _openl; - return; - } -} - -const QString HistoryAudio::inDialogsText() const { - return lang(lng_in_dlg_audio); -} - -const QString HistoryAudio::inHistoryText() const { - return qsl("[ ") + lang(lng_in_dlg_audio) + qsl(" ]"); -} - -void HistoryAudio::regItem(HistoryItem *item) { - App::regAudioItem(_data, item); -} - -void HistoryAudio::unregItem(HistoryItem *item) { - App::unregAudioItem(_data, item); -} - -void HistoryAudio::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { - if (media.type() == mtpc_messageMediaAudio) { - App::feedAudio(media.c_messageMediaAudio().vaudio, _data); - if (!_data->data().isEmpty()) { - Local::writeAudio(mediaKey(AudioFileLocation, _data->dc, _data->id), _data->data()); - } - } -} - -void HistoryAudio::setStatusSize(int32 newSize, qint64 realDuration) const { - HistoryFileMedia::setStatusSize(newSize, _data->size, _data->duration, realDuration); -} - -bool HistoryAudio::updateStatusText(const HistoryItem *parent) const { - bool showPause = false; - int32 statusSize = 0, realDuration = 0; - if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) { - statusSize = FileStatusSizeFailed; - } else if (_data->status == FileUploading) { - statusSize = _data->uploadOffset; - } else if (_data->loading()) { - statusSize = _data->loadOffset(); - } else if (_data->loaded()) { - AudioMsgId playing; - AudioPlayerState playingState = AudioPlayerStopped; - int64 playingPosition = 0, playingDuration = 0; - int32 playingFrequency = 0; - if (audioPlayer()) { - audioPlayer()->currentState(&playing, &playingState, &playingPosition, &playingDuration, &playingFrequency); - } - - if (playing.msgId == parent->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { - statusSize = -1 - (playingPosition / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency)); - realDuration = playingDuration / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency); - showPause = (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting); - } else { - statusSize = FileStatusSizeLoaded; - } - } else { - statusSize = FileStatusSizeReady; - } - if (statusSize != _statusSize) { - setStatusSize(statusSize, realDuration); - } - return showPause; } HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() -, _data(document) -, _linksavel(new DocumentSaveLink(_data)) -, _linkcancell(new DocumentCancelLink(_data)) -, _name(documentName(_data)) -, _namew(st::semiboldFont->width(_name)) -, _caption(st::msgFileMinWidth - st::msgPadding.left() - st::msgPadding.right()) { - setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); +, _parent(0) +, _data(document) { + create(!caption.isEmpty()); + if (HistoryDocumentNamed *named = Get()) { + named->_name = documentName(_data); + named->_namew = st::semiboldFont->width(named->_name); + } + + setLinks(new DocumentOpenLink(_data), _data->voice() ? (ITextLink*)(new VoiceSaveLink(_data)) : new DocumentSaveLink(_data), new DocumentCancelLink(_data)); setStatusSize(FileStatusSizeReady); - if (!caption.isEmpty()) { - _caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent)); + if (HistoryDocumentCaptioned *captioned = Get()) { + captioned->_caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent)); } } HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedia() -, _data(other._data) -, _linksavel(new DocumentSaveLink(_data)) -, _linkcancell(new DocumentCancelLink(_data)) -, _name(other._name) -, _namew(other._namew) -, _thumbw(other._thumbw) -, _caption(other._caption) { - setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); +, _parent(0) +, _data(other._data) { + const HistoryDocumentCaptioned *captioned = other.Get(); + create(captioned != 0); + if (HistoryDocumentNamed *named = Get()) { + if (const HistoryDocumentNamed *oin = other.Get()) { + named->_name = oin->_name; + named->_namew = oin->_namew; + } else { + named->_name = documentName(_data); + named->_namew = st::semiboldFont->width(named->_name); + } + } + + setLinks(new DocumentOpenLink(_data), _data->voice() ? (ITextLink*)(new VoiceSaveLink(_data)) : new DocumentSaveLink(_data), new DocumentCancelLink(_data)); setStatusSize(other._statusSize); + + if (captioned) { + Get()->_caption = captioned->_caption; + } +} + +void HistoryDocument::create(bool caption) { + uint64 mask; + if (_data->voice()) { + mask = HistoryDocumentVoice::Bit(); + } else { + mask = HistoryDocumentNamed::Bit(); + if (caption) { + mask |= HistoryDocumentCaptioned::Bit(); + } + if (!_data->song() && !_data->thumb->isNull() && _data->thumb->width() && _data->thumb->height()) { + mask |= HistoryDocumentThumbed::Bit(); + } + } + UpdateInterfaces(mask); + if (HistoryDocumentThumbed *thumbed = Get()) { + thumbed->_linksavel.reset(new DocumentSaveLink(_data)); + thumbed->_linkcancell.reset(new DocumentCancelLink(_data)); + } } void HistoryDocument::initDimensions(const HistoryItem *parent) { - if (_caption.hasSkipBlock()) { - _caption.setSkipBlock(parent->skipBlockWidth(), parent->skipBlockHeight()); + _parent = parent; + + HistoryDocumentCaptioned *captioned = Get(); + if (captioned && captioned->_caption.hasSkipBlock()) { + captioned->_caption.setSkipBlock(parent->skipBlockWidth(), parent->skipBlockHeight()); } - if (withThumb()) { + HistoryDocumentThumbed *thumbed = Get(); + if (thumbed) { _data->thumb->load(); int32 tw = _data->thumb->width(), th = _data->thumb->height(); if (tw > th) { - _thumbw = (tw * st::msgFileThumbSize) / th; + thumbed->_thumbw = (tw * st::msgFileThumbSize) / th; } else { - _thumbw = st::msgFileThumbSize; + thumbed->_thumbw = st::msgFileThumbSize; } - } else { - _thumbw = 0; } _maxw = st::msgFileMinWidth; int32 tleft = 0, tright = 0; - bool wthumb = withThumb(); - if (wthumb) { + if (thumbed) { tleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); tright = st::msgFileThumbPadding.left(); _maxw = qMax(_maxw, tleft + documentMaxStatusWidth(_data) + tright); } else { tleft = st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); tright = st::msgFileThumbPadding.left(); - _maxw = qMax(_maxw, tleft + documentMaxStatusWidth(_data) + parent->skipBlockWidth() + st::msgPadding.right()); + int32 unread = _data->voice() ? (st::mediaUnreadSkip + st::mediaUnreadSize) : 0; + _maxw = qMax(_maxw, tleft + documentMaxStatusWidth(_data) + unread + parent->skipBlockWidth() + st::msgPadding.right()); } - _maxw = qMax(tleft + _namew + tright, _maxw); - _maxw = qMin(_maxw, int(st::msgMaxWidth)); + if (HistoryDocumentNamed *named = Get()) { + _maxw = qMax(tleft + named->_namew + tright, _maxw); + _maxw = qMin(_maxw, int(st::msgMaxWidth)); + } - if (wthumb) { + if (thumbed) { _minh = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); } else { _minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); } - if (_caption.isEmpty()) { - _height = _minh; + if (captioned) { + _minh += captioned->_caption.countHeight(_maxw - st::msgPadding.left() - st::msgPadding.right()) + st::msgPadding.bottom(); } else { - _minh += _caption.countHeight(_maxw - st::msgPadding.left() - st::msgPadding.right()) + st::msgPadding.bottom(); + _height = _minh; } } int32 HistoryDocument::resize(int32 width, const HistoryItem *parent) { - if (_caption.isEmpty()) { + HistoryDocumentCaptioned *captioned = Get(); + if (!captioned) { return HistoryFileMedia::resize(width, parent); } _width = qMin(width, _maxw); - bool wthumb = withThumb(); - if (wthumb) { + if (Get()) { _height = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); } else { _height = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); } - _height += _caption.countHeight(_width - st::msgPadding.left() - st::msgPadding.right()) + st::msgPadding.bottom(); + _height += captioned->_caption.countHeight(_width - st::msgPadding.left() - st::msgPadding.right()) + st::msgPadding.bottom(); return _height; } @@ -4094,8 +3943,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r bool radial = isRadialAnimation(ms); int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0, bottom = 0; - bool wthumb = withThumb(); - if (wthumb) { + if (const HistoryDocumentThumbed *thumbed = Get()) { nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); nametop = st::msgFileThumbNameTop; nameright = st::msgFileThumbPadding.left(); @@ -4104,7 +3952,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r bottom = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); QRect rthumb(rtlrect(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbSize, st::msgFileThumbSize, _width)); - QPixmap thumb = loaded ? _data->thumb->pixSingle(_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize) : _data->thumb->pixBlurredSingle(_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize); + QPixmap thumb = loaded ? _data->thumb->pixSingle(thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize) : _data->thumb->pixBlurredSingle(thumbed->_thumbw, 0, st::msgFileThumbSize, st::msgFileThumbSize); p.drawPixmap(rthumb.topLeft(), thumb); if (selected) { App::roundRect(p, rthumb, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); @@ -4148,11 +3996,11 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r } if (_data->status != FileUploadFailed) { - const TextLinkPtr &lnk((_data->loading() || _data->status == FileUploading) ? _linkcancell : _linksavel); + const TextLinkPtr &lnk((_data->loading() || _data->status == FileUploading) ? thumbed->_linkcancell : thumbed->_linksavel); bool over = textlnkDrawOver(lnk); p.setFont(over ? st::semiboldFont->underline() : st::semiboldFont); p.setPen(outbg ? (selected ? st::msgFileThumbLinkOutFgSelected : st::msgFileThumbLinkOutFg) : (selected ? st::msgFileThumbLinkInFgSelected : st::msgFileThumbLinkInFg)); - p.drawTextLeft(nameleft, linktop, _width, _link, _linkw); + p.drawTextLeft(nameleft, linktop, _width, thumbed->_link, thumbed->_linkw); } } else { nameleft = st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); @@ -4189,7 +4037,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r } else if (radial || _data->loading()) { icon = outbg ? (selected ? st::msgFileOutCancelSelected : st::msgFileOutCancel) : (selected ? st::msgFileInCancelSelected : st::msgFileInCancel); } else if (loaded) { - if (_data->song()) { + if (_data->song() || _data->voice()) { icon = outbg ? (selected ? st::msgFileOutPlaySelected : st::msgFileOutPlay) : (selected ? st::msgFileInPlaySelected : st::msgFileInPlay); } else if (_data->isImage()) { icon = outbg ? (selected ? st::msgFileOutImageSelected : st::msgFileOutImage) : (selected ? st::msgFileInImageSelected : st::msgFileInImage); @@ -4203,12 +4051,70 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r } int32 namewidth = _width - nameleft - nameright; - p.setFont(st::semiboldFont); - p.setPen(st::black); - if (namewidth < _namew) { - p.drawTextLeft(nameleft, nametop, _width, st::semiboldFont->elided(_name, namewidth)); - } else { - p.drawTextLeft(nameleft, nametop, _width, _name, _namew); + if (const HistoryDocumentVoice *voice = Get()) { + const VoiceWaveform *wf = 0; + uchar norm_value = 0; + if (_data->voice()) { + wf = &_data->voice()->waveform; + if (wf->isEmpty()) { + wf = 0; + if (loaded) { + Local::countVoiceWaveform(_data); + } + } else if (wf->at(0) < 0) { + wf = 0; + } else { + norm_value = _data->voice()->wavemax; + } + } + float64 prg = voice->_playback ? voice->_playback->a_progress.current() : 0; + + // rescale waveform by going in waveform.size * bar_count 1D grid + style::color active(outbg ? st::msgWaveformOutActive : st::msgWaveformInActive); + style::color inactive(outbg ? st::msgWaveformOutInactive : st::msgWaveformInInactive); + int32 wf_size = wf ? wf->size() : WaveformSamplesCount, availw = int32(namewidth + st::msgWaveformSkip), activew = qRound(availw * prg); + int32 bar_count = qMin(availw / int32(st::msgWaveformBar + st::msgWaveformSkip), wf_size); + uchar max_value = 0; + int32 max_delta = st::msgWaveformMax - st::msgWaveformMin, bottom = st::msgFilePadding.top() + st::msgWaveformMax; + p.setPen(Qt::NoPen); + for (uint32 i = 0, bar_x = 0, sum_i = 0; i < wf_size; ++i) { + uchar value = wf ? wf->at(i) : 0; + if (sum_i + bar_count >= wf_size) { // draw bar + sum_i = sum_i + bar_count - wf_size; + if (sum_i < (bar_count + 1) / 2) { + if (max_value < value) max_value = value; + } + int32 bar_value = ((max_value * max_delta) + ((norm_value + 1) / 2)) / (norm_value + 1); + + if (bar_x >= activew) { + p.fillRect(nameleft + bar_x, bottom - bar_value, st::msgWaveformBar, st::msgWaveformMin + bar_value, inactive); + } else if (bar_x + st::msgWaveformBar <= activew) { + p.fillRect(nameleft + bar_x, bottom - bar_value, st::msgWaveformBar, st::msgWaveformMin + bar_value, active); + } else { + p.fillRect(nameleft + bar_x, bottom - bar_value, activew - bar_x, st::msgWaveformMin + bar_value, active); + p.fillRect(nameleft + activew, bottom - bar_value, st::msgWaveformBar - (activew - bar_x), st::msgWaveformMin + bar_value, inactive); + } + bar_x += st::msgWaveformBar + st::msgWaveformSkip; + + if (sum_i < (bar_count + 1) / 2) { + max_value = 0; + } else { + max_value = value; + } + } else { + if (max_value < value) max_value = value; + + sum_i += bar_count; + } + } + } else if (const HistoryDocumentNamed *named = Get()) { + p.setFont(st::semiboldFont); + p.setPen(st::black); + if (namewidth < named->_namew) { + p.drawTextLeft(nameleft, nametop, _width, st::semiboldFont->elided(named->_name, namewidth)); + } else { + p.drawTextLeft(nameleft, nametop, _width, named->_name, named->_namew); + } } style::color status(outbg ? (selected ? st::mediaOutFgSelected : st::mediaOutFg) : (selected ? st::mediaInFgSelected : st::mediaInFg)); @@ -4216,9 +4122,21 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r p.setPen(status); p.drawTextLeft(nameleft, statustop, _width, _statusText); - if (!_caption.isEmpty()) { + if (parent->isMediaUnread()) { + int32 w = st::normalFont->width(_statusText); + if (w + st::mediaUnreadSkip + st::mediaUnreadSize <= namewidth) { + p.setPen(Qt::NoPen); + p.setBrush(outbg ? (selected ? st::msgFileOutBgSelected : st::msgFileOutBg) : (selected ? st::msgFileInBgSelected : st::msgFileInBg)); + + p.setRenderHint(QPainter::HighQualityAntialiasing, true); + p.drawEllipse(rtlrect(nameleft + w + st::mediaUnreadSkip, statustop + st::mediaUnreadTop, st::mediaUnreadSize, st::mediaUnreadSize, _width)); + p.setRenderHint(QPainter::HighQualityAntialiasing, false); + } + } + + if (const HistoryDocumentCaptioned *captioned = Get()) { p.setPen(st::black); - _caption.draw(p, st::msgPadding.left(), bottom, captionw); + captioned->_caption.draw(p, st::msgPadding.left(), bottom, captionw); } } @@ -4231,8 +4149,7 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 bool showPause = updateStatusText(parent); int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0, bottom = 0; - bool wthumb = withThumb(); - if (wthumb) { + if (const HistoryDocumentThumbed *thumbed = Get()) { nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); linktop = st::msgFileThumbLinkTop; bottom = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); @@ -4245,8 +4162,8 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 } if (_data->status != FileUploadFailed) { - if (rtlrect(nameleft, linktop, _linkw, st::semiboldFont->height, _width).contains(x, y)) { - lnk = (_data->loading() || _data->uploading()) ? _linkcancell : _linksavel; + if (rtlrect(nameleft, linktop, thumbed->_linkw, st::semiboldFont->height, _width).contains(x, y)) { + lnk = (_data->loading() || _data->uploading()) ? thumbed->_linkcancell : thumbed->_linksavel; return; } } @@ -4261,14 +4178,14 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 } int32 height = _height; - if (!_caption.isEmpty()) { + if (const HistoryDocumentCaptioned *captioned = Get()) { if (y >= bottom) { bool inText = false; - _caption.getState(lnk, inText, x - st::msgPadding.left(), y - bottom, _width - st::msgPadding.left() - st::msgPadding.right()); + captioned->_caption.getState(lnk, inText, x - st::msgPadding.left(), y - bottom, _width - st::msgPadding.left() - st::msgPadding.right()); state = inText ? HistoryInTextCursorState : HistoryDefaultCursorState; return; } - height -= _caption.countHeight(_width - st::msgPadding.left() - st::msgPadding.right()) + st::msgPadding.bottom(); + height -= captioned->_caption.countHeight(_width - st::msgPadding.left() - st::msgPadding.right()) + st::msgPadding.bottom(); } if (x >= 0 && y >= 0 && x < _width && y < height && !_data->loading() && !_data->uploading() && _data->access) { lnk = _openl; @@ -4277,28 +4194,53 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 } const QString HistoryDocument::inDialogsText() const { - return (_name.isEmpty() ? lang(lng_in_dlg_file) : _name) + (_caption.isEmpty() ? QString() : (' ' + _caption.original(0, 0xFFFF, Text::ExpandLinksNone))); + QString result; + if (Get()) { + result = lang(lng_in_dlg_audio); + } else { + const HistoryDocumentNamed *named = Get(); + result = (!named || named->_name.isEmpty()) ? lang(lng_in_dlg_file) : named->_name; + } + if (const HistoryDocumentCaptioned *captioned = Get()) { + if (!captioned->_caption.isEmpty()) { + result.append(' ').append(captioned->_caption.original(0, 0xFFFF, Text::ExpandLinksNone)); + } + } + return result; } const QString HistoryDocument::inHistoryText() const { - return qsl("[ ") + lang(lng_in_dlg_file) + (_name.isEmpty() ? QString() : (qsl(" : ") + _name)) + (_caption.isEmpty() ? QString() : (qsl(", ") + _caption.original(0, 0xFFFF, Text::ExpandLinksAll))) + qsl(" ]"); + QString result = qsl("[ ") + lang(Get() ? lng_in_dlg_audio : lng_in_dlg_file); + if (const HistoryDocumentNamed *named = Get()) { + if (!named->_name.isEmpty()) { + result.append(qsl(" : ")).append(named->_name); + } + } + if (const HistoryDocumentCaptioned *captioned = Get()) { + if (!captioned->_caption.isEmpty()) { + result.append(qsl(", ")).append(captioned->_caption.original(0, 0xFFFF, Text::ExpandLinksAll)); + } + } + return result.append(qsl(" ]")); } void HistoryDocument::setStatusSize(int32 newSize, qint64 realDuration) const { - HistoryFileMedia::setStatusSize(newSize, _data->size, _data->song() ? _data->song()->duration : -1, realDuration); - - if (_statusSize == FileStatusSizeReady) { - _link = lang(lng_media_download).toUpper(); - } else if (_statusSize == FileStatusSizeLoaded) { - _link = lang(lng_media_open_with).toUpper(); - } else if (_statusSize == FileStatusSizeFailed) { - _link = lang(lng_media_download).toUpper(); - } else if (_statusSize >= 0) { - _link = lang(lng_media_cancel).toUpper(); - } else { - _link = lang(lng_media_open_with).toUpper(); + int32 duration = _data->song() ? _data->song()->duration : (_data->voice() ? _data->voice()->duration : -1); + HistoryFileMedia::setStatusSize(newSize, _data->size, duration, realDuration); + if (const HistoryDocumentThumbed *thumbed = Get()) { + if (_statusSize == FileStatusSizeReady) { + thumbed->_link = lang(lng_media_download).toUpper(); + } else if (_statusSize == FileStatusSizeLoaded) { + thumbed->_link = lang(lng_media_open_with).toUpper(); + } else if (_statusSize == FileStatusSizeFailed) { + thumbed->_link = lang(lng_media_download).toUpper(); + } else if (_statusSize >= 0) { + thumbed->_link = lang(lng_media_cancel).toUpper(); + } else { + thumbed->_link = lang(lng_media_open_with).toUpper(); + } + thumbed->_linkw = st::semiboldFont->width(thumbed->_link); } - _linkw = st::semiboldFont->width(_link); } bool HistoryDocument::updateStatusText(const HistoryItem *parent) const { @@ -4311,7 +4253,41 @@ bool HistoryDocument::updateStatusText(const HistoryItem *parent) const { } else if (_data->loading()) { statusSize = _data->loadOffset(); } else if (_data->loaded()) { - if (_data->song()) { + if (_data->voice()) { + AudioMsgId playing; + AudioPlayerState playingState = AudioPlayerStopped; + int64 playingPosition = 0, playingDuration = 0; + int32 playingFrequency = 0; + if (audioPlayer()) { + audioPlayer()->currentState(&playing, &playingState, &playingPosition, &playingDuration, &playingFrequency); + } + + if (playing.msgId == parent->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { + if (const HistoryDocumentVoice *voice = Get()) { + bool was = voice->_playback; + voice->ensurePlayback(this); + if (!was || playingPosition != voice->_playback->_position) { + float64 prg = playingDuration ? snap(float64(playingPosition) / playingDuration, 0., 1.) : 0.; + if (voice->_playback->_position < playingPosition) { + voice->_playback->a_progress.start(prg); + } else { + voice->_playback->a_progress = anim::fvalue(0., prg); + } + voice->_playback->_position = playingPosition; + voice->_playback->_a_progress.start(); + } + } + + statusSize = -1 - (playingPosition / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency)); + realDuration = playingDuration / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency); + showPause = (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting); + } else { + statusSize = FileStatusSizeLoaded; + if (const HistoryDocumentVoice *voice = Get()) { + voice->checkPlaybackFinished(); + } + } + } else if (_data->song()) { SongMsgId playing; AudioPlayerState playingState = AudioPlayerStopped; int64 playingPosition = 0, playingDuration = 0; @@ -4342,6 +4318,21 @@ bool HistoryDocument::updateStatusText(const HistoryItem *parent) const { return showPause; } +void HistoryDocument::step_voiceProgress(float64 ms, bool timer) { + if (HistoryDocumentVoice *voice = Get()) { + if (voice->_playback) { + float64 dt = ms / (2 * AudioVoiceMsgUpdateView); + if (dt >= 1) { + voice->_playback->_a_progress.stop(); + voice->_playback->a_progress.finish(); + } else { + voice->_playback->a_progress.update(qMin(dt, 1.), anim::linear); + } + if (timer) Ui::repaintHistoryItem(_parent); + } + } +} + void HistoryDocument::regItem(HistoryItem *item) { App::regDocumentItem(_data, item); } @@ -4353,6 +4344,13 @@ void HistoryDocument::unregItem(HistoryItem *item) { void HistoryDocument::updateFrom(const MTPMessageMedia &media, HistoryItem *parent) { if (media.type() == mtpc_messageMediaDocument) { App::feedDocument(media.c_messageMediaDocument().vdocument, _data); + if (!_data->data().isEmpty()) { + if (_data->voice()) { + Local::writeAudio(mediaKey(AudioFileLocation, _data->dc, _data->id), _data->data()); + } else { + Local::writeStickerImage(mediaKey(DocumentFileLocation, _data->dc, _data->id), _data->data()); + } + } } } @@ -4361,6 +4359,7 @@ ImagePtr HistoryDocument::replyPreview() { } HistoryGif::HistoryGif(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() +, _parent(0) , _data(document) , _thumbw(1) , _thumbh(1) @@ -5126,7 +5125,6 @@ void HistoryWebPage::initDimensions(const HistoryItem *parent) { _maxw = _minh = _height = 0; return; } - if (!_lineHeight) _lineHeight = qMax(st::webPageTitleFont->height, st::webPageDescriptionFont->height); if (!_openl && !_data->url.isEmpty()) _openl = TextLinkPtr(new TextLink(_data->url)); @@ -5144,7 +5142,7 @@ void HistoryWebPage::initDimensions(const HistoryItem *parent) { } else { _asArticle = true; } - if (_asArticle && (_data->description.isEmpty() || (title.isEmpty() && _data->siteName.isEmpty()))) { + if (_asArticle && _data->description.isEmpty() && title.isEmpty() && _data->siteName.isEmpty()) { _asArticle = false; } } else { @@ -6121,12 +6119,6 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tTex _media = new HistoryVideo(video.vvideo.c_video(), qs(video.vcaption), this); } } break; - case mtpc_messageMediaAudio: { - const MTPAudio &audio(media->c_messageMediaAudio().vaudio); - if (audio.type() == mtpc_audio) { - _media = new HistoryAudio(audio.c_audio()); - } - } break; case mtpc_messageMediaDocument: { const MTPDocument &document(media->c_messageMediaDocument().vdocument); if (document.type() == mtpc_document) { @@ -6225,8 +6217,8 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { left += (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { left += st::msgPhotoSkip; - } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { - left += st::msgPhotoSkip - (hmaxwidth - hwidth); +// } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { +// left += st::msgPhotoSkip - (hmaxwidth - hwidth); } width = hwidth - st::msgMargin.left() - st::msgMargin.right(); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 9557904364..045144ccd1 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -95,23 +95,24 @@ enum HistoryMediaType { MediaTypeVideo, MediaTypeGeo, MediaTypeContact, - MediaTypeAudio, - MediaTypeDocument, + MediaTypeFile, MediaTypeGif, MediaTypeSticker, MediaTypeImageLink, MediaTypeWebPage, + MediaTypeMusicFile, + MediaTypeVoiceFile, MediaTypeCount }; enum MediaOverviewType { - OverviewPhotos, - OverviewVideos, - OverviewAudioDocuments, - OverviewDocuments, - OverviewAudios, - OverviewLinks, + OverviewPhotos = 0, + OverviewVideos = 1, + OverviewMusicFiles = 2, + OverviewFiles = 3, + OverviewVoiceFiles = 4, + OverviewLinks = 5, OverviewCount }; @@ -120,9 +121,9 @@ inline MTPMessagesFilter typeToMediaFilter(MediaOverviewType &type) { switch (type) { case OverviewPhotos: return MTP_inputMessagesFilterPhotos(); case OverviewVideos: return MTP_inputMessagesFilterVideo(); - case OverviewAudioDocuments: return MTP_inputMessagesFilterAudioDocuments(); - case OverviewDocuments: return MTP_inputMessagesFilterDocument(); - case OverviewAudios: return MTP_inputMessagesFilterAudio(); + case OverviewMusicFiles: return MTP_inputMessagesFilterMusic(); + case OverviewFiles: return MTP_inputMessagesFilterDocument(); + case OverviewVoiceFiles: return MTP_inputMessagesFilterVoice(); case OverviewLinks: return MTP_inputMessagesFilterUrl(); default: type = OverviewCount; break; } @@ -133,8 +134,8 @@ enum SendActionType { SendActionTyping, SendActionRecordVideo, SendActionUploadVideo, - SendActionRecordAudio, - SendActionUploadAudio, + SendActionRecordVoice, + SendActionUploadVoice, SendActionUploadPhoto, SendActionUploadFile, SendActionChooseLocation, @@ -1205,10 +1206,11 @@ inline MediaOverviewType mediaToOverviewType(HistoryMedia *media) { switch (media->type()) { case MediaTypePhoto: return OverviewPhotos; case MediaTypeVideo: return OverviewVideos; - case MediaTypeDocument: return media->getDocument()->song() ? OverviewAudioDocuments : OverviewDocuments; - case MediaTypeGif: return media->getDocument()->isGifv() ? OverviewCount : OverviewDocuments; -// case MediaTypeSticker: return OverviewDocuments; - case MediaTypeAudio: return OverviewAudios; + case MediaTypeFile: return OverviewFiles; + case MediaTypeMusicFile: return media->getDocument()->isMusic() ? OverviewMusicFiles : OverviewFiles; + case MediaTypeVoiceFile: return OverviewVoiceFiles; + case MediaTypeGif: return media->getDocument()->isGifv() ? OverviewCount : OverviewFiles; +// case MediaTypeSticker: return OverviewFiles; } return OverviewCount; } @@ -1418,76 +1420,52 @@ private: }; -class HistoryAudio : public HistoryFileMedia { -public: - - HistoryAudio(const MTPDaudio &audio); - HistoryAudio(const HistoryAudio &other); - HistoryMediaType type() const { - return MediaTypeAudio; +struct HistoryDocumentThumbed : public BasicInterface { + HistoryDocumentThumbed(Interfaces *interfaces) : _thumbw(0), _linkw(0) { } - HistoryMedia *clone() const { - return new HistoryAudio(*this); + TextLinkPtr _linksavel, _linkcancell; + int32 _thumbw; + + mutable int32 _linkw; + mutable QString _link; +}; +struct HistoryDocumentCaptioned : public BasicInterface { + HistoryDocumentCaptioned(Interfaces *interfaces) : _caption(st::msgFileMinWidth - st::msgPadding.left() - st::msgPadding.right()) { } - - void initDimensions(const HistoryItem *parent); - - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; - - const QString inDialogsText() const; - const QString inHistoryText() const; - - bool uploading() const { - return _data->uploading(); + Text _caption; +}; +struct HistoryDocumentNamed : public BasicInterface { + HistoryDocumentNamed(Interfaces *interfaces) : _namew(0) { } + QString _name; + int32 _namew; +}; +class HistoryDocument; +struct HistoryDocumentVoicePlayback { + HistoryDocumentVoicePlayback(const HistoryDocument *that); - AudioData *audio() { - return _data; + int32 _position; + anim::fvalue a_progress; + Animation _a_progress; +}; +struct HistoryDocumentVoice : public BasicInterface { + HistoryDocumentVoice(Interfaces *that) : _playback(0) { } - - void regItem(HistoryItem *item); - void unregItem(HistoryItem *item); - - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); - - bool needsBubble(const HistoryItem *parent) const { - return true; + ~HistoryDocumentVoice() { + deleteAndMark(_playback); } - bool customInfoLayout() const { - return false; - } - QMargins bubbleMargins() const { - return st::msgPadding; - } - -protected: - - float64 dataProgress() const { - return _data->progress(); - } - bool dataFinished() const { - return !_data->loading() && !_data->uploading(); - } - bool dataLoaded() const { - return _data->loaded(); - } - -private: - AudioData *_data; - - void setStatusSize(int32 newSize, qint64 realDuration = 0) const; - bool updateStatusText(const HistoryItem *parent) const; // returns showPause - + void ensurePlayback(const HistoryDocument *interfaces) const; + void checkPlaybackFinished() const; + mutable HistoryDocumentVoicePlayback *_playback; }; -class HistoryDocument : public HistoryFileMedia { +class HistoryDocument : public HistoryFileMedia, public Interfaces { public: HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent); HistoryDocument(const HistoryDocument &other); HistoryMediaType type() const { - return MediaTypeDocument; + return _data->voice() ? MediaTypeVoiceFile : (_data->song() ? MediaTypeMusicFile : MediaTypeFile); } HistoryMedia *clone() const { return new HistoryDocument(*this); @@ -1506,10 +1484,6 @@ public: return _data->uploading(); } - bool withThumb() const { - return !_data->song() && !_data->thumb->isNull() && _data->thumb->width() && _data->thumb->height(); - } - DocumentData *getDocument() { return _data; } @@ -1525,7 +1499,10 @@ public: ImagePtr replyPreview(); QString getCaption() const { - return _caption.original(); + if (const HistoryDocumentCaptioned *captioned = Get()) { + return captioned->_caption.original(); + } + return QString(); } bool needsBubble(const HistoryItem *parent) const { return true; @@ -1534,12 +1511,14 @@ public: return false; } QMargins bubbleMargins() const { - return withThumb() ? QMargins(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbPadding.left(), st::msgFileThumbPadding.bottom()) : st::msgPadding; + return Get() ? QMargins(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbPadding.left(), st::msgFileThumbPadding.bottom()) : st::msgPadding; } bool hideForwardedFrom() const { return _data->song(); } + void step_voiceProgress(float64 ms, bool timer); + protected: float64 dataProgress() const { @@ -1554,17 +1533,9 @@ protected: private: + void create(bool caption); + const HistoryItem *_parent; DocumentData *_data; - TextLinkPtr _linksavel, _linkcancell; - - QString _name; - int32 _namew; - int32 _thumbw; - - mutable int32 _linkw; - mutable QString _link; - - Text _caption; void setStatusSize(int32 newSize, qint64 realDuration = 0) const; bool updateStatusText(const HistoryItem *parent) const; // returns showPause @@ -2237,7 +2208,20 @@ inline int32 newMessageFlags(PeerData *p) { return p->isSelf() ? 0 : (((p->isChat() || (p->isUser() && !p->asUser()->botInfo)) ? MTPDmessage::flag_unread : 0) | MTPDmessage::flag_out); } inline int32 newForwardedFlags(PeerData *p, int32 from, HistoryMessage *msg) { - return newMessageFlags(p) | (from ? MTPDmessage::flag_from_id : 0) | (msg->via() ? MTPDmessage::flag_via_bot_id : 0) | (!p->isChannel() && msg->getMedia() && (msg->getMedia()->type() == MediaTypeAudio/* || msg->getMedia()->type() == MediaTypeVideo*/) ? MTPDmessage::flag_media_unread : 0); + int32 result = newMessageFlags(p) | (from ? MTPDmessage::flag_from_id : 0); + if (msg->via()) { + result |= MTPDmessage::flag_via_bot_id; + } + if (!p->isChannel()) { + if (HistoryMedia *media = msg->getMedia()) { + if (media->type() == MediaTypeVoiceFile) { + result |= MTPDmessage::flag_media_unread; +// } else if (media->type() == MediaTypeVideo) { +// result |= MTPDmessage::flag_media_unread; + } + } + } + return result; } class HistoryServiceMsg : public HistoryItem { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 05c757ee77..baf099ec86 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -865,9 +865,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { HistoryItem *item = App::hoveredItem() ? App::hoveredItem() : App::hoveredLinkItem(); PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkPhoto || lnkVideo || lnkAudio || lnkDocument) { + bool lnkIsAudio = lnkDocument ? lnkDocument->document()->voice() : false; + if (lnkPhoto || lnkVideo || lnkDocument) { if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); } @@ -879,17 +879,17 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu->addAction(lang(lng_context_save_image), this, SLOT(saveContextImage()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_image), this, SLOT(copyContextImage()))->setEnabled(true); } else { - if ((lnkVideo && lnkVideo->video()->loading()) || (lnkAudio && lnkAudio->audio()->loading()) || (lnkDocument && lnkDocument->document()->loading())) { + if ((lnkVideo && lnkVideo->video()->loading()) || (lnkDocument && lnkDocument->document()->loading())) { _menu->addAction(lang(lng_context_cancel_download), this, SLOT(cancelContextDownload()))->setEnabled(true); } else { if (lnkDocument && lnkDocument->document()->loaded() && lnkDocument->document()->isGifv()) { _menu->addAction(lang(lng_context_save_gif), this, SLOT(saveContextGif()))->setEnabled(true); } - if ((lnkVideo && !lnkVideo->video()->already(true).isEmpty()) || (lnkAudio && !lnkAudio->audio()->already(true).isEmpty()) || (lnkDocument && !lnkDocument->document()->already(true).isEmpty())) { + if ((lnkVideo && !lnkVideo->video()->already(true).isEmpty()) || (lnkDocument && !lnkDocument->document()->already(true).isEmpty())) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkVideo ? lng_context_open_video : (lnkAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); - _menu->addAction(lang(lnkVideo ? lng_context_save_video : (lnkAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); } } if (isUponSelected > 1) { @@ -1071,8 +1071,6 @@ void HistoryInner::copyContextImage() { void HistoryInner::cancelContextDownload() { if (VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data())) { lnkVideo->video()->cancel(); - } else if (AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data())) { - lnkAudio->audio()->cancel(); } else if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { lnkDocument->document()->cancel(); } else if (HistoryItem *item = App::contextItem()) { @@ -1088,8 +1086,6 @@ void HistoryInner::showContextInFolder() { QString already; if (VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data())) { already = lnkVideo->video()->already(true); - } else if (AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data())) { - already = lnkAudio->audio()->already(true); } else if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { already = lnkDocument->document()->already(true); } else if (HistoryItem *item = App::contextItem()) { @@ -1106,10 +1102,8 @@ void HistoryInner::openContextFile() { HistoryItem *was = App::hoveredLinkItem(); App::hoveredLinkItem(App::contextItem()); VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); if (lnkVideo) VideoOpenLink(lnkVideo->video()).onClick(Qt::LeftButton); - if (lnkAudio) AudioOpenLink(lnkAudio->audio()).onClick(Qt::LeftButton); if (lnkDocument) DocumentOpenLink(lnkDocument->document()).onClick(Qt::LeftButton); App::hoveredLinkItem(was); } @@ -1117,8 +1111,6 @@ void HistoryInner::openContextFile() { void HistoryInner::saveContextFile() { if (VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data())) { VideoSaveLink::doSave(lnkVideo->video(), true); - } else if (AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data())) { - AudioSaveLink::doSave(lnkAudio->audio(), true); } else if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { DocumentSaveLink::doSave(lnkDocument->document(), true); } else if (HistoryItem *item = App::contextItem()) { @@ -2720,8 +2712,8 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) connect(&_previewTimer, SIGNAL(timeout()), this, SLOT(onPreviewTimeout())); if (audioCapture()) { connect(audioCapture(), SIGNAL(onError()), this, SLOT(onRecordError())); - connect(audioCapture(), SIGNAL(onUpdate(qint16,qint32)), this, SLOT(onRecordUpdate(qint16,qint32))); - connect(audioCapture(), SIGNAL(onDone(QByteArray,qint32)), this, SLOT(onRecordDone(QByteArray,qint32))); + connect(audioCapture(), SIGNAL(onUpdate(quint16,qint32)), this, SLOT(onRecordUpdate(quint16,qint32))); + connect(audioCapture(), SIGNAL(onDone(QByteArray,VoiceWaveform,qint32)), this, SLOT(onRecordDone(QByteArray,VoiceWaveform,qint32))); } _updateHistoryItems.setSingleShot(true); @@ -3005,8 +2997,8 @@ void HistoryWidget::updateSendAction(History *history, SendActionType type, int3 case SendActionTyping: action = MTP_sendMessageTypingAction(); break; case SendActionRecordVideo: action = MTP_sendMessageRecordVideoAction(); break; case SendActionUploadVideo: action = MTP_sendMessageUploadVideoAction(MTP_int(progress)); break; - case SendActionRecordAudio: action = MTP_sendMessageRecordAudioAction(); break; - case SendActionUploadAudio: action = MTP_sendMessageUploadAudioAction(MTP_int(progress)); break; + case SendActionRecordVoice: action = MTP_sendMessageRecordAudioAction(); break; + case SendActionUploadVoice: action = MTP_sendMessageUploadAudioAction(MTP_int(progress)); break; case SendActionUploadPhoto: action = MTP_sendMessageUploadPhotoAction(MTP_int(progress)); break; case SendActionUploadFile: action = MTP_sendMessageUploadDocumentAction(MTP_int(progress)); break; case SendActionChooseLocation: action = MTP_sendMessageGeoLocationAction(); break; @@ -3055,16 +3047,16 @@ void HistoryWidget::onRecordError() { stopRecording(false); } -void HistoryWidget::onRecordDone(QByteArray result, qint32 samples) { +void HistoryWidget::onRecordDone(QByteArray result, VoiceWaveform waveform, qint32 samples) { if (!_peer) return; App::wnd()->activateWindow(); int32 duration = samples / AudioVoiceMsgFrequency; - _fileLoader.addTask(new FileLoadTask(result, duration, FileLoadTo(_peer->id, _broadcast.checked(), replyToId()))); + _fileLoader.addTask(new FileLoadTask(result, duration, waveform, FileLoadTo(_peer->id, _broadcast.checked(), replyToId()))); cancelReply(lastForceReplyReplied()); } -void HistoryWidget::onRecordUpdate(qint16 level, qint32 samples) { +void HistoryWidget::onRecordUpdate(quint16 level, qint32 samples) { if (!_recording) { return; } @@ -3077,7 +3069,7 @@ void HistoryWidget::onRecordUpdate(qint16 level, qint32 samples) { } updateField(); if (_peer && (!_peer->isChannel() || _peer->isMegagroup() || !_peer->asChannel()->canPublish() || (!_peer->asChannel()->isBroadcast() && !_broadcast.checked()))) { - updateSendAction(_history, SendActionRecordAudio); + updateSendAction(_history, SendActionRecordVoice); } } @@ -4241,9 +4233,9 @@ void HistoryWidget::firstLoadMessages() { } if (loadImportant) { - _firstLoadRequest = MTP::send(MTPchannels_GetImportantHistory(from->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); + _firstLoadRequest = MTP::send(MTPchannels_GetImportantHistory(from->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); } else { - _firstLoadRequest = MTP::send(MTPmessages_GetHistory(from->input, MTP_int(offset_id), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); + _firstLoadRequest = MTP::send(MTPmessages_GetHistory(from->input, MTP_int(offset_id), MTP_int(offset), MTP_int(0), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); } } @@ -4265,9 +4257,9 @@ void HistoryWidget::loadMessages() { int32 offset = 0, loadCount = offset_id ? MessagesPerPage : MessagesFirstLoad; if (loadImportant) { - _preloadRequest = MTP::send(MTPchannels_GetImportantHistory(from->peer->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); + _preloadRequest = MTP::send(MTPchannels_GetImportantHistory(from->peer->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); } else { - _preloadRequest = MTP::send(MTPmessages_GetHistory(from->peer->input, MTP_int(offset_id), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); + _preloadRequest = MTP::send(MTPmessages_GetHistory(from->peer->input, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); } } @@ -4295,9 +4287,9 @@ void HistoryWidget::loadMessagesDown() { } if (loadImportant) { - _preloadDownRequest = MTP::send(MTPchannels_GetImportantHistory(from->peer->asChannel()->inputChannel, MTP_int(offset_id + 1), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); + _preloadDownRequest = MTP::send(MTPchannels_GetImportantHistory(from->peer->asChannel()->inputChannel, MTP_int(offset_id + 1), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); } else { - _preloadDownRequest = MTP::send(MTPmessages_GetHistory(from->peer->input, MTP_int(offset_id + 1), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); + _preloadDownRequest = MTP::send(MTPmessages_GetHistory(from->peer->input, MTP_int(offset_id + 1), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from->peer), rpcFail(&HistoryWidget::messagesFailed)); } } @@ -4355,9 +4347,9 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) { } if (loadImportant) { - _delayedShowAtRequest = MTP::send(MTPchannels_GetImportantHistory(from->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); + _delayedShowAtRequest = MTP::send(MTPchannels_GetImportantHistory(from->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); } else { - _delayedShowAtRequest = MTP::send(MTPmessages_GetHistory(from->input, MTP_int(offset_id), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); + _delayedShowAtRequest = MTP::send(MTPmessages_GetHistory(from->input, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); } } @@ -4807,7 +4799,7 @@ void HistoryWidget::onDocumentSelect() { void HistoryWidget::dragEnterEvent(QDragEnterEvent *e) { if (!_history) return; - if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + if (_peer && !_canSendMessages) return; _attachDrag = getDragState(e->mimeData()); updateDragAreas(); @@ -4887,7 +4879,7 @@ void HistoryWidget::stopRecording(bool send) { _recording = false; _recordingSamples = 0; if (_peer && (!_peer->isChannel() || _peer->isMegagroup() || !_peer->asChannel()->canPublish() || (!_peer->asChannel()->isBroadcast() && !_broadcast.checked()))) { - updateSendAction(_history, SendActionRecordAudio, -1); + updateSendAction(_history, SendActionRecordVoice, -1); } updateControlsVisibility(); @@ -5151,7 +5143,7 @@ void HistoryWidget::onPhotoDrop(const QMimeData *data) { void HistoryWidget::onDocumentDrop(const QMimeData *data) { if (!_history) return; - if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + if (_peer && !_canSendMessages) return; QStringList files = getMediasFromMime(data); if (files.isEmpty()) return; @@ -5161,7 +5153,7 @@ void HistoryWidget::onDocumentDrop(const QMimeData *data) { void HistoryWidget::onFilesDrop(const QMimeData *data) { - if (_peer && (_peer->isChannel() && !_peer->asChannel()->canPublish())) return; + if (_peer && !_canSendMessages) return; QStringList files = getMediasFromMime(data); if (files.isEmpty()) { @@ -5522,13 +5514,10 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&, const MTPInputFile&)), this, SLOT(onPhotoUploaded(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(documentReady(const FullMsgId&, const MTPInputFile&)), this, SLOT(onDocumentUploaded(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(thumbDocumentReady(const FullMsgId&, const MTPInputFile&, const MTPInputFile&)), this, SLOT(onThumbDocumentUploaded(const FullMsgId&, const MTPInputFile&, const MTPInputFile&)), Qt::UniqueConnection); - connect(App::uploader(), SIGNAL(audioReady(const FullMsgId&, const MTPInputFile&)), this, SLOT(onAudioUploaded(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(photoProgress(const FullMsgId&)), this, SLOT(onPhotoProgress(const FullMsgId&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(documentProgress(const FullMsgId&)), this, SLOT(onDocumentProgress(const FullMsgId&)), Qt::UniqueConnection); - connect(App::uploader(), SIGNAL(audioProgress(const FullMsgId&)), this, SLOT(onAudioProgress(const FullMsgId&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(photoFailed(const FullMsgId&)), this, SLOT(onPhotoFailed(const FullMsgId&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(documentFailed(const FullMsgId&)), this, SLOT(onDocumentFailed(const FullMsgId&)), Qt::UniqueConnection); - connect(App::uploader(), SIGNAL(audioFailed(const FullMsgId&)), this, SLOT(onAudioFailed(const FullMsgId&)), Qt::UniqueConnection); App::uploader()->upload(newId, file); @@ -5552,7 +5541,7 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif if (!h->peer->isChannel()) { flags |= MTPDmessage::flag_media_unread; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaAudio(file->audio), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); } if (_peer && file->to.peer == _peer->id) { @@ -5628,7 +5617,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(document->song()->duration), MTP_string(document->song()->title), MTP_string(document->song()->performer))); + 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())); + } 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)))); } return MTP_vector(attributes); } @@ -5684,33 +5675,6 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, const MTPInp } } -void HistoryWidget::onAudioUploaded(const FullMsgId &newId, const MTPInputFile &file) { - if (!MTP::authedId()) return; - HistoryMessage *item = dynamic_cast(App::histItemById(newId)); - if (item) { - AudioData *audio = 0; - if (HistoryAudio *media = dynamic_cast(item->getMedia())) { - audio = media->audio(); - } - if (audio) { - uint64 randomId = MTP::nonce(); - App::historyRegRandom(randomId, newId); - History *hist = item->history(); - MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; - int32 sendFlags = 0; - if (replyTo) { - sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; - } - - bool fromChannelName = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->fromChannel(); - if (fromChannelName) { - sendFlags |= MTPmessages_SendMedia::flag_broadcast; - } - hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedAudio(file, MTP_int(audio->duration), MTP_string(audio->mime)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId); - } - } -} - void HistoryWidget::onPhotoProgress(const FullMsgId &newId) { if (!MTP::authedId()) return; if (HistoryItem *item = App::histItemById(newId)) { @@ -5728,18 +5692,7 @@ void HistoryWidget::onDocumentProgress(const FullMsgId &newId) { HistoryMedia *media = item->getMedia(); DocumentData *doc = media ? media->getDocument() : 0; if (!item->fromChannel()) { - updateSendAction(item->history(), SendActionUploadFile, doc ? doc->uploadOffset : 0); - } - Ui::repaintHistoryItem(item); - } -} - -void HistoryWidget::onAudioProgress(const FullMsgId &newId) { - if (!MTP::authedId()) return; - if (HistoryItem *item = App::histItemById(newId)) { - AudioData *audio = (item->getMedia() && item->getMedia()->type() == MediaTypeAudio) ? static_cast(item->getMedia())->audio() : 0; - if (!item->fromChannel()) { - updateSendAction(item->history(), SendActionUploadAudio, audio ? audio->uploadOffset : 0); + updateSendAction(item->history(), (doc && doc->voice()) ? SendActionUploadVoice : SendActionUploadFile, doc ? doc->uploadOffset : 0); } Ui::repaintHistoryItem(item); } @@ -5760,19 +5713,10 @@ void HistoryWidget::onDocumentFailed(const FullMsgId &newId) { if (!MTP::authedId()) return; HistoryItem *item = App::histItemById(newId); if (item) { + HistoryMedia *media = item->getMedia(); + DocumentData *doc = media ? media->getDocument() : 0; if (!item->fromChannel()) { - updateSendAction(item->history(), SendActionUploadFile, -1); - } - Ui::repaintHistoryItem(item); - } -} - -void HistoryWidget::onAudioFailed(const FullMsgId &newId) { - if (!MTP::authedId()) return; - HistoryItem *item = App::histItemById(newId); - if (item) { - if (!item->fromChannel()) { - updateSendAction(item->history(), SendActionUploadAudio, -1); + updateSendAction(item->history(), (doc && doc->voice()) ? SendActionUploadVoice : SendActionUploadFile, -1); } Ui::repaintHistoryItem(item); } @@ -7194,7 +7138,7 @@ void HistoryWidget::drawRecording(Painter &p) { p.setPen(Qt::NoPen); p.setBrush(st::recordSignalColor->b); p.setRenderHint(QPainter::HighQualityAntialiasing); - float64 delta = qMin(float64(a_recordingLevel.current()) * 3 * M_PI / 0x7fff, 1.); + float64 delta = qMin(float64(a_recordingLevel.current()) / 0x4000, 1.); int32 d = 2 * qRound(st::recordSignalMin + (delta * (st::recordSignalMax - st::recordSignalMin))); p.drawEllipse(_attachPhoto.x() + (_attachEmoji.width() - d) / 2, _attachPhoto.y() + (_attachPhoto.height() - d) / 2, d, d); p.setRenderHint(QPainter::HighQualityAntialiasing, false); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index eda8743a12..fcf4c53771 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -610,15 +610,12 @@ public slots: void onPhotoUploaded(const FullMsgId &msgId, const MTPInputFile &file); void onDocumentUploaded(const FullMsgId &msgId, const MTPInputFile &file); void onThumbDocumentUploaded(const FullMsgId &msgId, const MTPInputFile &file, const MTPInputFile &thumb); - void onAudioUploaded(const FullMsgId &msgId, const MTPInputFile &file); void onPhotoProgress(const FullMsgId &msgId); void onDocumentProgress(const FullMsgId &msgId); - void onAudioProgress(const FullMsgId &msgId); void onPhotoFailed(const FullMsgId &msgId); void onDocumentFailed(const FullMsgId &msgId); - void onAudioFailed(const FullMsgId &msgId); void onReportSpamClicked(); void onReportSpamSure(); @@ -683,8 +680,8 @@ public slots: void updateField(); void onRecordError(); - void onRecordDone(QByteArray result, qint32 samples); - void onRecordUpdate(qint16 level, qint32 samples); + void onRecordDone(QByteArray result, VoiceWaveform waveform, qint32 samples); + void onRecordUpdate(quint16 level, qint32 samples); void onUpdateHistoryItems(); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index cf3c71c76a..8540930a8a 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -550,23 +550,25 @@ void LayoutOverviewVideo::updateStatusText() const { } } -LayoutOverviewAudio::LayoutOverviewAudio(AudioData *audio, HistoryItem *parent) : LayoutAbstractFileItem(OverviewItemInfo::Bit(), parent) -, _data(audio) -, _namel(new AudioOpenLink(_data)) { - setLinks(new AudioOpenLink(_data), new AudioOpenLink(_data), new AudioCancelLink(_data)); +LayoutOverviewVoice::LayoutOverviewVoice(DocumentData *voice, HistoryItem *parent) : LayoutAbstractFileItem(OverviewItemInfo::Bit(), parent) +, _data(voice) +, _namel(new DocumentOpenLink(_data)) { + t_assert(_data->voice() != 0); + + setLinks(new DocumentOpenLink(_data), new DocumentOpenLink(_data), new DocumentCancelLink(_data)); updateName(); QString d = textcmdLink(1, textRichPrepare(langDateTime(date(_data->date)))); TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto }; - _details.setText(st::normalFont, lng_date_and_duration(lt_date, d, lt_duration, formatDurationText(_data->duration)), opts); + _details.setText(st::normalFont, lng_date_and_duration(lt_date, d, lt_duration, formatDurationText(_data->voice()->duration)), opts); _details.setLink(1, TextLinkPtr(new MessageLink(parent))); } -void LayoutOverviewAudio::initDimensions() { +void LayoutOverviewVoice::initDimensions() { _maxw = st::profileMaxWidth; _minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom() + st::lineWidth; } -void LayoutOverviewAudio::paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const { +void LayoutOverviewVoice::paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const { bool selected = (selection == FullSelection); _data->automaticLoad(_parent); @@ -666,7 +668,7 @@ void LayoutOverviewAudio::paint(Painter &p, const QRect &clip, uint32 selection, } } -void LayoutOverviewAudio::getState(TextLinkPtr &link, HistoryCursorState &cursor, int32 x, int32 y) const { +void LayoutOverviewVoice::getState(TextLinkPtr &link, HistoryCursorState &cursor, int32 x, int32 y) const { bool loaded = _data->loaded(); bool showPause = updateStatusText(); @@ -696,7 +698,7 @@ void LayoutOverviewAudio::getState(TextLinkPtr &link, HistoryCursorState &cursor } } -void LayoutOverviewAudio::updateName() const { +void LayoutOverviewVoice::updateName() const { int32 version = 0; if (HistoryForwarded *fwd = _parent->toHistoryForwarded()) { _name.setText(st::semiboldFont, lang(lng_forwarded_from) + ' ' + App::peerName(fwd->fromForwarded()), _textNameOptions); @@ -708,7 +710,7 @@ void LayoutOverviewAudio::updateName() const { _nameVersion = version; } -bool LayoutOverviewAudio::updateStatusText() const { +bool LayoutOverviewVoice::updateStatusText() const { bool showPause = false; int32 statusSize = 0, realDuration = 0; if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) { @@ -733,7 +735,7 @@ bool LayoutOverviewAudio::updateStatusText() const { statusSize = FileStatusSizeReady; } if (statusSize != _statusSize) { - setStatusSize(statusSize, _data->size, _data->duration, realDuration); + setStatusSize(statusSize, _data->size, _data->voice()->duration, realDuration); } return showPause; } diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index 39f9ecd149..7319613a1e 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -349,9 +349,9 @@ private: }; -class LayoutOverviewAudio : public LayoutAbstractFileItem { +class LayoutOverviewVoice : public LayoutAbstractFileItem { public: - LayoutOverviewAudio(AudioData *audio, HistoryItem *parent); + LayoutOverviewVoice(DocumentData *voice, HistoryItem *parent); virtual void initDimensions(); virtual void paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const; @@ -372,7 +372,7 @@ protected: } private: - AudioData *_data; + DocumentData *_data; TextLinkPtr _namel; mutable Text _name, _details; diff --git a/Telegram/SourceFiles/localimageloader.cpp b/Telegram/SourceFiles/localimageloader.cpp index d8137a8324..49d0cfaf26 100644 --- a/Telegram/SourceFiles/localimageloader.cpp +++ b/Telegram/SourceFiles/localimageloader.cpp @@ -198,10 +198,11 @@ FileLoadTask::FileLoadTask(const QImage &image, PrepareMediaType type, const Fil , _result(0) { } -FileLoadTask::FileLoadTask(const QByteArray &audio, int32 duration, const FileLoadTo &to) : _id(MTP::nonce()) +FileLoadTask::FileLoadTask(const QByteArray &voice, int32 duration, const VoiceWaveform &waveform, const FileLoadTo &to) : _id(MTP::nonce()) , _to(to) -, _content(audio) +, _content(voice) , _duration(duration) +, _waveform(waveform) , _type(PrepareAudio) , _confirm(FileLoadNoForceConfirm) , _result(0) { @@ -220,7 +221,7 @@ void FileLoadTask::process() { QString thumbname = "thumb.jpg"; QByteArray thumbdata; - bool animated = false; + bool animated = false, song = false, gif = false, voice = (_type == PrepareAudio); QImage fullimage = _image; if (!_filepath.isEmpty()) { @@ -232,30 +233,32 @@ void FileLoadTask::process() { filesize = info.size(); filemime = mimeTypeForFile(info).name(); filename = info.fileName(); - if (filesize <= MaxUploadPhotoSize && _type != PrepareAudio) { + if (filesize <= MaxUploadPhotoSize && !voice) { bool opaque = (filemime != stickerMime); fullimage = App::readImage(_filepath, 0, opaque, &animated); } } else if (!_content.isEmpty()) { filesize = _content.size(); - MimeType mimeType = mimeTypeForData(_content); - filemime = mimeType.name(); - if (filesize <= MaxUploadPhotoSize && _type != PrepareAudio) { - bool opaque = (filemime != stickerMime); - fullimage = App::readImage(_content, 0, opaque, &animated); - } - if (filemime == "image/jpeg") { - filename = filedialogDefaultName(qsl("image"), qsl(".jpg"), QString(), true); - } else if (_type == PrepareAudio) { + if (voice) { filename = filedialogDefaultName(qsl("audio"), qsl(".ogg"), QString(), true); filemime = "audio/ogg"; } else { - QString ext; - QStringList patterns = mimeType.globPatterns(); - if (!patterns.isEmpty()) { - ext = patterns.front().replace('*', QString()); + MimeType mimeType = mimeTypeForData(_content); + filemime = mimeType.name(); + if (filesize <= MaxUploadPhotoSize && !voice) { + bool opaque = (filemime != stickerMime); + fullimage = App::readImage(_content, 0, opaque, &animated); + } + if (filemime == "image/jpeg") { + filename = filedialogDefaultName(qsl("image"), qsl(".jpg"), QString(), true); + } else { + QString ext; + QStringList patterns = mimeType.globPatterns(); + if (!patterns.isEmpty()) { + ext = patterns.front().replace('*', QString()); + } + filename = filedialogDefaultName(qsl("file"), ext, QString(), true); } - filename = filedialogDefaultName(qsl("file"), ext, QString(), true); } } else if (!_image.isNull()) { _image = QImage(); @@ -292,10 +295,8 @@ void FileLoadTask::process() { MTPPhotoSize thumbSize(MTP_photoSizeEmpty(MTP_string(""))); MTPPhoto photo(MTP_photoEmpty(MTP_long(0))); MTPDocument document(MTP_documentEmpty(MTP_long(0))); - MTPAudio audio(MTP_audioEmpty(MTP_long(0))); - bool song = false, gif = false; - if (_type != PrepareAudio) { + if (!voice) { if (filemime == qstr("audio/mp3") || filemime == qstr("audio/m4a") || filemime == qstr("audio/aac") || filemime == qstr("audio/ogg") || filemime == qstr("audio/flac") || filename.endsWith(qstr(".mp3"), Qt::CaseInsensitive) || filename.endsWith(qstr(".m4a"), Qt::CaseInsensitive) || filename.endsWith(qstr(".aac"), Qt::CaseInsensitive) || filename.endsWith(qstr(".ogg"), Qt::CaseInsensitive) || @@ -358,7 +359,7 @@ void FileLoadTask::process() { } } - if (!fullimage.isNull() && fullimage.width() > 0 && !song && !gif) { + if (!fullimage.isNull() && fullimage.width() > 0 && !song && !gif && !voice) { int32 w = fullimage.width(), h = fullimage.height(); attributes.push_back(MTP_documentAttributeImageSize(MTP_int(w), MTP_int(h))); @@ -408,8 +409,10 @@ void FileLoadTask::process() { } } - if (_type == PrepareAudio) { - audio = MTP_audio(MTP_long(_id), MTP_long(0), MTP_int(unixtime()), MTP_int(_duration), MTP_string(filemime), MTP_int(filesize), MTP_int(MTP::maindc())); + if (voice) { + attributes[0] = MTP_documentAttributeAudio(MTP_int(MTPDdocumentAttributeAudio::flag_voice | MTPDdocumentAttributeAudio::flag_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 { 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)); if (photo.type() == mtpc_photoEmpty) { @@ -431,7 +434,6 @@ void FileLoadTask::process() { _result->thumb = thumb; _result->photo = photo; - _result->audio = audio; _result->document = document; _result->photoThumbs = photoThumbs; } diff --git a/Telegram/SourceFiles/localimageloader.h b/Telegram/SourceFiles/localimageloader.h index 6078820afe..51edd73104 100644 --- a/Telegram/SourceFiles/localimageloader.h +++ b/Telegram/SourceFiles/localimageloader.h @@ -52,8 +52,8 @@ typedef QList ToPrepareMedias; typedef QMap UploadFileParts; struct ReadyLocalMedia { - ReadyLocalMedia(PrepareMediaType type, const QString &file, const QString &filename, int32 filesize, const QByteArray &data, const uint64 &id, const uint64 &thumbId, const QString &thumbExt, const PeerId &peer, const MTPPhoto &photo, const MTPAudio &audio, const PreparedPhotoThumbs &photoThumbs, const MTPDocument &document, const QByteArray &jpeg, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : - replyTo(replyTo), type(type), file(file), filename(filename), filesize(filesize), data(data), thumbExt(thumbExt), id(id), thumbId(thumbId), peer(peer), photo(photo), document(document), audio(audio), photoThumbs(photoThumbs), broadcast(broadcast), ctrlShiftEnter(ctrlShiftEnter) { + ReadyLocalMedia(PrepareMediaType type, const QString &file, const QString &filename, int32 filesize, const QByteArray &data, const uint64 &id, const uint64 &thumbId, const QString &thumbExt, const PeerId &peer, const MTPPhoto &photo, const PreparedPhotoThumbs &photoThumbs, const MTPDocument &document, const QByteArray &jpeg, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : + replyTo(replyTo), type(type), file(file), filename(filename), filesize(filesize), data(data), thumbExt(thumbExt), id(id), thumbId(thumbId), peer(peer), photo(photo), document(document), photoThumbs(photoThumbs), broadcast(broadcast), ctrlShiftEnter(ctrlShiftEnter) { if (!jpeg.isEmpty()) { int32 size = jpeg.size(); for (int32 i = 0, part = 0; i < size; i += UploadPartSize, ++part) { @@ -74,7 +74,6 @@ struct ReadyLocalMedia { MTPPhoto photo; MTPDocument document; - MTPAudio audio; PreparedPhotoThumbs photoThumbs; UploadFileParts parts; QByteArray jpeg_md5; @@ -114,7 +113,7 @@ public: TaskId addTask(TaskPtr task); void addTasks(const TasksList &tasks); void cancelTask(TaskId id); // this task finish() won't be called - + TaskId addTask(Task *task) { return addTask(TaskPtr(task)); } @@ -203,7 +202,6 @@ struct FileLoadResult { QPixmap thumb; MTPPhoto photo; - MTPAudio audio; MTPDocument document; PreparedPhotoThumbs photoThumbs; @@ -248,7 +246,7 @@ public: FileLoadTask(const QString &filepath, PrepareMediaType type, const FileLoadTo &to, FileLoadForceConfirmType confirm = FileLoadNoForceConfirm); FileLoadTask(const QByteArray &content, PrepareMediaType type, const FileLoadTo &to); FileLoadTask(const QImage &image, PrepareMediaType type, const FileLoadTo &to, FileLoadForceConfirmType confirm = FileLoadNoForceConfirm, const QString &originalText = QString()); - FileLoadTask(const QByteArray &audio, int32 duration, const FileLoadTo &to); + FileLoadTask(const QByteArray &voice, int32 duration, const VoiceWaveform &waveform, const FileLoadTo &to); uint64 fileid() const { return _id; @@ -265,6 +263,7 @@ protected: QImage _image; QByteArray _content; int32 _duration; + VoiceWaveform _waveform; PrepareMediaType _type; FileLoadForceConfirmType _confirm; QString _originalText; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 915bd35352..da64f2cb96 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -2785,6 +2785,77 @@ namespace Local { return _storageWebFilesSize; } + class CountWaveformTask : public Task { + public: + CountWaveformTask(DocumentData *doc) + : _doc(doc) + , _loc(doc->location(true)) + , _data(doc->data()) + , _wavemax(0) { + if (_data.isEmpty() && !_loc.accessEnable()) { + _doc = 0; + } + } + void process() { + if (!_doc) return; + + _waveform = audioCountWaveform(_loc, _data); + uchar wavemax = 0; + for (int32 i = 0, l = _waveform.size(); i < l; ++i) { + uchar waveat = _waveform.at(i); + if (wavemax < waveat) wavemax = waveat; + } + _wavemax = wavemax; + } + void finish() { + if (VoiceData *voice = _doc ? _doc->voice() : 0) { + if (!_waveform.isEmpty()) { + voice->waveform = _waveform; + voice->wavemax = _wavemax; + } + if (voice->waveform.isEmpty()) { + voice->waveform.resize(1); + voice->waveform[0] = -2; + voice->wavemax = 0; + } else if (voice->waveform[0] < 0) { + voice->waveform[0] = -2; + voice->wavemax = 0; + } + const DocumentItems &items(App::documentItems()); + DocumentItems::const_iterator i = items.constFind(_doc); + if (i != items.cend()) { + for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { + Ui::repaintHistoryItem(j.key()); + } + } + } + } + virtual ~CountWaveformTask() { + if (_data.isEmpty() && _doc) { + _loc.accessDisable(); + } + } + + protected: + DocumentData *_doc; + FileLocation _loc; + QByteArray _data; + VoiceWaveform _waveform; + char _wavemax; + + }; + + void countVoiceWaveform(DocumentData *document) { + if (VoiceData *voice = document->voice()) { + if (_localLoader) { + voice->waveform.resize(1 + sizeof(TaskId)); + voice->waveform[0] = -1; // counting + TaskId taskId = _localLoader->addTask(new CountWaveformTask(document)); + memcpy(voice->waveform.data() + 1, &taskId, sizeof(taskId)); + } + } + } + void cancelTask(TaskId id) { if (_localLoader) { _localLoader->cancelTask(id); diff --git a/Telegram/SourceFiles/localstorage.h b/Telegram/SourceFiles/localstorage.h index 7bc16304bf..607ec9d0ff 100644 --- a/Telegram/SourceFiles/localstorage.h +++ b/Telegram/SourceFiles/localstorage.h @@ -144,6 +144,8 @@ namespace Local { int32 hasWebFiles(); qint64 storageWebFilesSize(); + void countVoiceWaveform(DocumentData *document); + void cancelTask(TaskId id); void writeStickers(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 779a93bacc..d64f8004a6 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1124,9 +1124,9 @@ bool MainWidget::kickParticipantFail(ChatData *chat, const RPCError &error) { void MainWidget::checkPeerHistory(PeerData *peer) { if (peer->isChannel() && !peer->isMegagroup()) { - MTP::send(MTPchannels_GetImportantHistory(peer->asChannel()->inputChannel, MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::checkedHistory, peer)); + MTP::send(MTPchannels_GetImportantHistory(peer->asChannel()->inputChannel, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::checkedHistory, peer)); } else { - MTP::send(MTPmessages_GetHistory(peer->input, MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::checkedHistory, peer)); + MTP::send(MTPmessages_GetHistory(peer->input, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::checkedHistory, peer)); } } @@ -1479,9 +1479,9 @@ void MainWidget::mediaOverviewUpdated(PeerData *peer, MediaOverviewType type) { switch (i) { case OverviewPhotos: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaPhotos, lang(lng_media_type_photos))), SIGNAL(clicked()), this, SLOT(onPhotosSelect())); break; case OverviewVideos: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaVideos, lang(lng_media_type_videos))), SIGNAL(clicked()), this, SLOT(onVideosSelect())); break; - case OverviewAudioDocuments: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaSongs, lang(lng_media_type_songs))), SIGNAL(clicked()), this, SLOT(onSongsSelect())); break; - case OverviewDocuments: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaDocuments, lang(lng_media_type_files))), SIGNAL(clicked()), this, SLOT(onDocumentsSelect())); break; - case OverviewAudios: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaAudios, lang(lng_media_type_audios))), SIGNAL(clicked()), this, SLOT(onAudiosSelect())); break; + case OverviewMusicFiles: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaSongs, lang(lng_media_type_songs))), SIGNAL(clicked()), this, SLOT(onSongsSelect())); break; + case OverviewFiles: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaDocuments, lang(lng_media_type_files))), SIGNAL(clicked()), this, SLOT(onDocumentsSelect())); break; + case OverviewVoiceFiles: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaAudios, lang(lng_media_type_audios))), SIGNAL(clicked()), this, SLOT(onAudiosSelect())); break; case OverviewLinks: connect(_mediaType.addButton(new IconedButton(this, st::dropdownMediaLinks, lang(lng_media_type_links))), SIGNAL(clicked()), this, SLOT(onLinksSelect())); break; } } @@ -1709,24 +1709,6 @@ void MainWidget::videoLoadRetry() { if (video) video->save(failedFileName); } -void MainWidget::audioLoadProgress(FileLoader *loader) { - mtpFileLoader *l = loader ? loader->mtpLoader() : 0; - if (!l) return; - - AudioData *audio = App::audio(l->objId()); - if (audio->loaded()) { - audio->performActionOnLoad(); - } - - const AudioItems &items(App::audioItems()); - AudioItems::const_iterator i = items.constFind(audio); - if (i != items.cend()) { - for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { - Ui::repaintHistoryItem(j.key()); - } - } -} - void MainWidget::audioPlayProgress(const AudioMsgId &audioId) { AudioMsgId playing; AudioPlayerState state = AudioPlayerStopped; @@ -1734,7 +1716,7 @@ void MainWidget::audioPlayProgress(const AudioMsgId &audioId) { if (playing == audioId && state == AudioPlayerStoppedAtStart) { audioPlayer()->clearStoppedAtStart(audioId); - AudioData *audio = audioId.audio; + DocumentData *audio = audioId.audio; QString already = audio->already(true); if (already.isEmpty() && !audio->data().isEmpty()) { bool mp3 = (audio->mime == qstr("audio/mp3")); @@ -1746,7 +1728,7 @@ void MainWidget::audioPlayProgress(const AudioMsgId &audioId) { f.close(); already = filename; audio->setLocation(FileLocation(StorageFilePartial, filename)); - Local::writeFileLocation(mediaKey(mtpToLocationType(mtpc_inputAudioFileLocation), audio->dc, audio->id), FileLocation(mtpToStorageType(mtpc_storage_filePartial), filename)); + Local::writeFileLocation(mediaKey(AudioFileLocation, audio->dc, audio->id), FileLocation(mtpToStorageType(mtpc_storage_filePartial), filename)); } } } @@ -1794,7 +1776,7 @@ void MainWidget::documentPlayProgress(const SongMsgId &songId) { f.close(); already = filename; document->setLocation(FileLocation(StorageFilePartial, filename)); - Local::writeFileLocation(mediaKey(mtpToLocationType(mtpc_inputDocumentFileLocation), document->dc, document->id), FileLocation(mtpToStorageType(mtpc_storage_filePartial), filename)); + Local::writeFileLocation(mediaKey(DocumentFileLocation, document->dc, document->id), FileLocation(mtpToStorageType(mtpc_storage_filePartial), filename)); } } } @@ -1831,24 +1813,6 @@ void MainWidget::hidePlayer() { } } -void MainWidget::audioLoadFailed(FileLoader *loader, bool started) { - mtpFileLoader *l = loader ? loader->mtpLoader() : 0; - if (!l) return; - - loadFailed(l, started, SLOT(audioLoadRetry())); - AudioData *audio = App::audio(l->objId()); - if (audio) { - if (audio->loading()) audio->cancel(); - audio->status = FileDownloadFailed; - } -} - -void MainWidget::audioLoadRetry() { - Ui::hideLayer(); - AudioData *audio = App::audio(failedObjId); - if (audio) audio->save(failedFileName); -} - void MainWidget::documentLoadProgress(FileLoader *loader) { mtpFileLoader *l = loader ? loader->mtpLoader() : 0; if (!l) return; @@ -1915,9 +1879,9 @@ void MainWidget::inlineResultLoadFailed(FileLoader *loader, bool started) { //Ui::repaintInlineItem(); } -void MainWidget::audioMarkRead(AudioData *data) { - const AudioItems &items(App::audioItems()); - AudioItems::const_iterator i = items.constFind(data); +void MainWidget::audioMarkRead(DocumentData *data) { + const DocumentItems &items(App::documentItems()); + DocumentItems::const_iterator i = items.constFind(data); if (i != items.cend()) { mediaMarkRead(i.value()); } @@ -2428,7 +2392,7 @@ void MainWidget::showMediaOverview(PeerData *peer, MediaOverviewType type, bool if (overview && overview->peer() == peer) { if (overview->type() != type) { overview->switchType(type); - } else if (type == OverviewAudioDocuments) { // hack for player + } else if (type == OverviewMusicFiles) { // hack for player showBackFromStack(); } return; @@ -2872,17 +2836,17 @@ void MainWidget::onVideosSelect() { } void MainWidget::onSongsSelect() { - if (overview) overview->switchType(OverviewAudioDocuments); + if (overview) overview->switchType(OverviewMusicFiles); _mediaType.hideStart(); } void MainWidget::onDocumentsSelect() { - if (overview) overview->switchType(OverviewDocuments); + if (overview) overview->switchType(OverviewFiles); _mediaType.hideStart(); } void MainWidget::onAudiosSelect() { - if (overview) overview->switchType(OverviewAudios); + if (overview) overview->switchType(OverviewVoiceFiles); _mediaType.hideStart(); } diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index ffb357d81c..b20465ef8a 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -375,7 +375,7 @@ public: void cancelForwarding(); void finishForwarding(History *hist, bool broadcast); // send them - void audioMarkRead(AudioData *data); + void audioMarkRead(DocumentData *data); void videoMarkRead(VideoData *data); void mediaMarkRead(const HistoryItemsMap &items); @@ -448,9 +448,6 @@ public slots: void videoLoadProgress(FileLoader *loader); void videoLoadFailed(FileLoader *loader, bool started); void videoLoadRetry(); - void audioLoadProgress(FileLoader *loader); - void audioLoadFailed(FileLoader *loader, bool started); - void audioLoadRetry(); void audioPlayProgress(const AudioMsgId &audioId); void documentLoadProgress(FileLoader *loader); void documentLoadFailed(FileLoader *loader, bool started); diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 84af93dba5..a73603e016 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -363,7 +363,7 @@ void MediaView::updateControls() { _dateNav = myrtlrect(st::mvTextLeft, height() - st::mvTextTop, st::mvFont->width(_dateText), st::mvFont->height); } updateHeader(); - if (_photo || (_history && (_overview == OverviewPhotos || _overview == OverviewDocuments))) { + if (_photo || (_history && (_overview == OverviewPhotos || _overview == OverviewFiles))) { _leftNavVisible = (_index > 0) || (_index == 0 && ( (!_msgmigrated && _history && _history->overview[_overview].size() < _history->overviewCount(_overview)) || (_msgmigrated && _migrated && _migrated->overview[_overview].size() < _migrated->overviewCount(_overview)) || @@ -865,7 +865,7 @@ void MediaView::showDocument(DocumentData *doc, HistoryItem *context) { _canForward = _msgid > 0; _canDelete = context ? context->canDelete() : false; if (_history) { - _overview = OverviewDocuments; + _overview = OverviewFiles; findCurrent(); } displayDocument(doc, context); @@ -1486,7 +1486,7 @@ void MediaView::keyPressEvent(QKeyEvent *e) { } void MediaView::moveToNext(int32 delta) { - if (_index < 0 || (_history && _overview != OverviewPhotos && _overview != OverviewDocuments) || (_overview == OverviewCount && !_user)) { + if (_index < 0 || (_history && _overview != OverviewPhotos && _overview != OverviewFiles) || (_overview == OverviewCount && !_user)) { return; } if (_msgmigrated && !_history->overviewLoaded(_overview)) { @@ -1515,7 +1515,7 @@ void MediaView::moveToNext(int32 delta) { if (HistoryMedia *media = item->getMedia()) { switch (media->type()) { case MediaTypePhoto: displayPhoto(static_cast(item->getMedia())->photo(), item); preloadData(delta); break; - case MediaTypeDocument: + case MediaTypeFile: case MediaTypeGif: case MediaTypeSticker: displayDocument(media->getDocument(), item); preloadData(delta); break; } @@ -1562,7 +1562,7 @@ void MediaView::preloadData(int32 delta) { if (HistoryMedia *media = item->getMedia()) { switch (media->type()) { case MediaTypePhoto: static_cast(media)->photo()->forget(); break; - case MediaTypeDocument: + case MediaTypeFile: case MediaTypeGif: case MediaTypeSticker: media->getDocument()->forget(); break; } @@ -1587,7 +1587,7 @@ void MediaView::preloadData(int32 delta) { if (HistoryMedia *media = item->getMedia()) { switch (media->type()) { case MediaTypePhoto: static_cast(media)->photo()->download(); break; - case MediaTypeDocument: + case MediaTypeFile: case MediaTypeGif: { DocumentData *doc = media->getDocument(); doc->thumb->load(); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index 60d05a96aa..b0059077c1 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -368,7 +368,7 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 45; +static const mtpPrime mtpCurrentLayer = 46; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index e7c7f20c97..bfbababece 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -388,7 +388,7 @@ bool mtpFileLoader::loadPart() { } else { switch (_locationType) { case VideoFileLocation: loc = MTP_inputVideoFileLocation(MTP_long(_id), MTP_long(_access)); break; - case AudioFileLocation: loc = MTP_inputAudioFileLocation(MTP_long(_id), MTP_long(_access)); break; + case AudioFileLocation: loc = MTP_inputDocumentFileLocation(MTP_long(_id), MTP_long(_access)); break; case DocumentFileLocation: loc = MTP_inputDocumentFileLocation(MTP_long(_id), MTP_long(_access)); break; default: cancel(true); return false; break; } diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.h b/Telegram/SourceFiles/mtproto/mtpFileLoader.h index d9f06aec1b..9446c979b5 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.h +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.h @@ -30,23 +30,6 @@ enum LocationType { AudioFileLocation = 0x74dc404d, // mtpc_inputAudioFileLocation VideoFileLocation = 0x3d0364ec, // mtpc_inputVideoFileLocation }; -inline LocationType mtpToLocationType(mtpTypeId type) { - switch (type) { - case mtpc_inputDocumentFileLocation: return DocumentFileLocation; - case mtpc_inputAudioFileLocation: return AudioFileLocation; - case mtpc_inputVideoFileLocation: return VideoFileLocation; - default: return UnknownFileLocation; - } -} -inline mtpTypeId mtpFromLocationType(LocationType type) { - switch (type) { - case DocumentFileLocation: return mtpc_inputDocumentFileLocation; - case AudioFileLocation: return mtpc_inputAudioFileLocation; - case VideoFileLocation: return mtpc_inputVideoFileLocation; - case UnknownFileLocation: - default: return 0; - } -} enum StorageFileType { StorageFileUnknown = 0xaa963b05, // mtpc_storage_fileUnknown diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index aa213c7eda..4da8bb3337 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -693,34 +693,6 @@ void _serialize_inputMediaVideo(MTPStringLogger &to, int32 stage, int32 lev, Typ } } -void _serialize_inputMediaUploadedAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputMediaUploadedAudio"); - to.add("\n").addSpaces(lev); - } - 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(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - -void _serialize_inputMediaAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputMediaAudio"); - to.add("\n").addSpaces(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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -928,20 +900,6 @@ void _serialize_inputEncryptedFileLocation(MTPStringLogger &to, int32 stage, int } } -void _serialize_inputAudioFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputAudioFileLocation"); - 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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -1279,14 +1237,15 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type 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(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 14: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 16: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 17: 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 10: to.add(" invites_enabled: "); ++stages.back(); if (flag & MTPDchannel::flag_invites_enabled) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 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(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 14: 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 15: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 16: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 17: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 18: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1587,19 +1546,6 @@ void _serialize_messageMediaDocument(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_messageMediaAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messageMediaAudio"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" audio: "); ++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_messageMediaWebPage(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -2189,20 +2135,6 @@ void _serialize_contactBlocked(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_contactSuggested(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contactSuggested"); - 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(" mutual_contacts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - void _serialize_contactStatus(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -2294,20 +2226,6 @@ void _serialize_contacts_blockedSlice(MTPStringLogger &to, int32 stage, int32 le } } -void _serialize_contacts_suggested(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_suggested"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" results: "); ++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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -2458,14 +2376,6 @@ void _serialize_inputMessagesFilterDocument(MTPStringLogger &to, int32 stage, in to.add("{ inputMessagesFilterDocument }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -void _serialize_inputMessagesFilterAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - to.add("{ inputMessagesFilterAudio }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); -} - -void _serialize_inputMessagesFilterAudioDocuments(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - to.add("{ inputMessagesFilterAudioDocuments }"); 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) { to.add("{ inputMessagesFilterUrl }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -2474,6 +2384,14 @@ void _serialize_inputMessagesFilterGif(MTPStringLogger &to, int32 stage, int32 l 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) { + 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) { + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -3067,6 +2985,21 @@ void _serialize_updateBotInlineQuery(MTPStringLogger &to, int32 stage, int32 lev } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updateBotInlineSend"); + 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; + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -3673,24 +3606,6 @@ void _serialize_messages_sentEncryptedFile(MTPStringLogger &to, int32 stage, int } } -void _serialize_inputAudioEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - to.add("{ inputAudioEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); -} - -void _serialize_inputAudio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputAudio"); - 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; - 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) { to.add("{ inputDocumentEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -3709,38 +3624,6 @@ void _serialize_inputDocument(MTPStringLogger &to, int32 stage, int32 lev, Types } } -void _serialize_audioEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ audioEmpty"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - -void _serialize_audio(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ audio"); - 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(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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 5: to.add(" size: "); ++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); vtypes.push_back(0); stages.push_back(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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -3908,10 +3791,18 @@ void _serialize_inputPrivacyKeyStatusTimestamp(MTPStringLogger &to, int32 stage, 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) { + 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) { 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) { + 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) { to.add("{ inputPrivacyValueAllowContacts }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -4092,9 +3983,12 @@ void _serialize_documentAttributeAudio(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(" 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(" performer: "); ++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_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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6373,19 +6267,6 @@ void _serialize_contacts_importContacts(MTPStringLogger &to, int32 stage, int32 } } -void _serialize_contacts_getSuggested(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ contacts_getSuggested"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - void _serialize_contacts_deleteContact(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6482,10 +6363,11 @@ 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(" 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 4: 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 5: 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6539,10 +6421,11 @@ 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(" 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 4: 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 5: 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -7063,6 +6946,20 @@ 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_toggleInvites"); + to.add("\n").addSpaces(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(" 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_getChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7678,8 +7575,6 @@ namespace { _serializers.insert(mtpc_inputMediaUploadedVideo, _serialize_inputMediaUploadedVideo); _serializers.insert(mtpc_inputMediaUploadedThumbVideo, _serialize_inputMediaUploadedThumbVideo); _serializers.insert(mtpc_inputMediaVideo, _serialize_inputMediaVideo); - _serializers.insert(mtpc_inputMediaUploadedAudio, _serialize_inputMediaUploadedAudio); - _serializers.insert(mtpc_inputMediaAudio, _serialize_inputMediaAudio); _serializers.insert(mtpc_inputMediaUploadedDocument, _serialize_inputMediaUploadedDocument); _serializers.insert(mtpc_inputMediaUploadedThumbDocument, _serialize_inputMediaUploadedThumbDocument); _serializers.insert(mtpc_inputMediaDocument, _serialize_inputMediaDocument); @@ -7697,7 +7592,6 @@ namespace { _serializers.insert(mtpc_inputFileLocation, _serialize_inputFileLocation); _serializers.insert(mtpc_inputVideoFileLocation, _serialize_inputVideoFileLocation); _serializers.insert(mtpc_inputEncryptedFileLocation, _serialize_inputEncryptedFileLocation); - _serializers.insert(mtpc_inputAudioFileLocation, _serialize_inputAudioFileLocation); _serializers.insert(mtpc_inputDocumentFileLocation, _serialize_inputDocumentFileLocation); _serializers.insert(mtpc_inputPhotoCropAuto, _serialize_inputPhotoCropAuto); _serializers.insert(mtpc_inputPhotoCrop, _serialize_inputPhotoCrop); @@ -7751,7 +7645,6 @@ namespace { _serializers.insert(mtpc_messageMediaContact, _serialize_messageMediaContact); _serializers.insert(mtpc_messageMediaUnsupported, _serialize_messageMediaUnsupported); _serializers.insert(mtpc_messageMediaDocument, _serialize_messageMediaDocument); - _serializers.insert(mtpc_messageMediaAudio, _serialize_messageMediaAudio); _serializers.insert(mtpc_messageMediaWebPage, _serialize_messageMediaWebPage); _serializers.insert(mtpc_messageMediaVenue, _serialize_messageMediaVenue); _serializers.insert(mtpc_messageActionEmpty, _serialize_messageActionEmpty); @@ -7802,7 +7695,6 @@ namespace { _serializers.insert(mtpc_contact, _serialize_contact); _serializers.insert(mtpc_importedContact, _serialize_importedContact); _serializers.insert(mtpc_contactBlocked, _serialize_contactBlocked); - _serializers.insert(mtpc_contactSuggested, _serialize_contactSuggested); _serializers.insert(mtpc_contactStatus, _serialize_contactStatus); _serializers.insert(mtpc_contacts_link, _serialize_contacts_link); _serializers.insert(mtpc_contacts_contactsNotModified, _serialize_contacts_contactsNotModified); @@ -7810,7 +7702,6 @@ namespace { _serializers.insert(mtpc_contacts_importedContacts, _serialize_contacts_importedContacts); _serializers.insert(mtpc_contacts_blocked, _serialize_contacts_blocked); _serializers.insert(mtpc_contacts_blockedSlice, _serialize_contacts_blockedSlice); - _serializers.insert(mtpc_contacts_suggested, _serialize_contacts_suggested); _serializers.insert(mtpc_messages_dialogs, _serialize_messages_dialogs); _serializers.insert(mtpc_messages_dialogsSlice, _serialize_messages_dialogsSlice); _serializers.insert(mtpc_messages_messages, _serialize_messages_messages); @@ -7825,10 +7716,10 @@ namespace { _serializers.insert(mtpc_inputMessagesFilterPhotoVideo, _serialize_inputMessagesFilterPhotoVideo); _serializers.insert(mtpc_inputMessagesFilterPhotoVideoDocuments, _serialize_inputMessagesFilterPhotoVideoDocuments); _serializers.insert(mtpc_inputMessagesFilterDocument, _serialize_inputMessagesFilterDocument); - _serializers.insert(mtpc_inputMessagesFilterAudio, _serialize_inputMessagesFilterAudio); - _serializers.insert(mtpc_inputMessagesFilterAudioDocuments, _serialize_inputMessagesFilterAudioDocuments); _serializers.insert(mtpc_inputMessagesFilterUrl, _serialize_inputMessagesFilterUrl); _serializers.insert(mtpc_inputMessagesFilterGif, _serialize_inputMessagesFilterGif); + _serializers.insert(mtpc_inputMessagesFilterVoice, _serialize_inputMessagesFilterVoice); + _serializers.insert(mtpc_inputMessagesFilterMusic, _serialize_inputMessagesFilterMusic); _serializers.insert(mtpc_updateNewMessage, _serialize_updateNewMessage); _serializers.insert(mtpc_updateMessageID, _serialize_updateMessageID); _serializers.insert(mtpc_updateDeleteMessages, _serialize_updateDeleteMessages); @@ -7871,6 +7762,7 @@ namespace { _serializers.insert(mtpc_updateStickerSets, _serialize_updateStickerSets); _serializers.insert(mtpc_updateSavedGifs, _serialize_updateSavedGifs); _serializers.insert(mtpc_updateBotInlineQuery, _serialize_updateBotInlineQuery); + _serializers.insert(mtpc_updateBotInlineSend, _serialize_updateBotInlineSend); _serializers.insert(mtpc_updates_state, _serialize_updates_state); _serializers.insert(mtpc_updates_differenceEmpty, _serialize_updates_differenceEmpty); _serializers.insert(mtpc_updates_difference, _serialize_updates_difference); @@ -7910,12 +7802,8 @@ namespace { _serializers.insert(mtpc_messages_dhConfig, _serialize_messages_dhConfig); _serializers.insert(mtpc_messages_sentEncryptedMessage, _serialize_messages_sentEncryptedMessage); _serializers.insert(mtpc_messages_sentEncryptedFile, _serialize_messages_sentEncryptedFile); - _serializers.insert(mtpc_inputAudioEmpty, _serialize_inputAudioEmpty); - _serializers.insert(mtpc_inputAudio, _serialize_inputAudio); _serializers.insert(mtpc_inputDocumentEmpty, _serialize_inputDocumentEmpty); _serializers.insert(mtpc_inputDocument, _serialize_inputDocument); - _serializers.insert(mtpc_audioEmpty, _serialize_audioEmpty); - _serializers.insert(mtpc_audio, _serialize_audio); _serializers.insert(mtpc_documentEmpty, _serialize_documentEmpty); _serializers.insert(mtpc_document, _serialize_document); _serializers.insert(mtpc_help_support, _serialize_help_support); @@ -7935,7 +7823,9 @@ namespace { _serializers.insert(mtpc_sendMessageChooseContactAction, _serialize_sendMessageChooseContactAction); _serializers.insert(mtpc_contacts_found, _serialize_contacts_found); _serializers.insert(mtpc_inputPrivacyKeyStatusTimestamp, _serialize_inputPrivacyKeyStatusTimestamp); + _serializers.insert(mtpc_inputPrivacyKeyChatInvite, _serialize_inputPrivacyKeyChatInvite); _serializers.insert(mtpc_privacyKeyStatusTimestamp, _serialize_privacyKeyStatusTimestamp); + _serializers.insert(mtpc_privacyKeyChatInvite, _serialize_privacyKeyChatInvite); _serializers.insert(mtpc_inputPrivacyValueAllowContacts, _serialize_inputPrivacyValueAllowContacts); _serializers.insert(mtpc_inputPrivacyValueAllowAll, _serialize_inputPrivacyValueAllowAll); _serializers.insert(mtpc_inputPrivacyValueAllowUsers, _serialize_inputPrivacyValueAllowUsers); @@ -8133,7 +8023,6 @@ namespace { _serializers.insert(mtpc_contacts_getStatuses, _serialize_contacts_getStatuses); _serializers.insert(mtpc_contacts_getContacts, _serialize_contacts_getContacts); _serializers.insert(mtpc_contacts_importContacts, _serialize_contacts_importContacts); - _serializers.insert(mtpc_contacts_getSuggested, _serialize_contacts_getSuggested); _serializers.insert(mtpc_contacts_deleteContact, _serialize_contacts_deleteContact); _serializers.insert(mtpc_contacts_getBlocked, _serialize_contacts_getBlocked); _serializers.insert(mtpc_contacts_exportCard, _serialize_contacts_exportCard); @@ -8180,6 +8069,7 @@ namespace { _serializers.insert(mtpc_channels_inviteToChannel, _serialize_channels_inviteToChannel); _serializers.insert(mtpc_channels_kickFromChannel, _serialize_channels_kickFromChannel); _serializers.insert(mtpc_channels_deleteChannel, _serialize_channels_deleteChannel); + _serializers.insert(mtpc_channels_toggleInvites, _serialize_channels_toggleInvites); _serializers.insert(mtpc_messages_getChats, _serialize_messages_getChats); _serializers.insert(mtpc_channels_getChannels, _serialize_channels_getChannels); _serializers.insert(mtpc_messages_getFullChat, _serialize_messages_getFullChat); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 09450332c4..98bcc93e0e 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -90,8 +90,6 @@ enum { mtpc_inputMediaUploadedVideo = 0x82713fdf, mtpc_inputMediaUploadedThumbVideo = 0x7780ddf9, mtpc_inputMediaVideo = 0x936a4ebd, - mtpc_inputMediaUploadedAudio = 0x4e498cab, - mtpc_inputMediaAudio = 0x89938781, mtpc_inputMediaUploadedDocument = 0x1d89306d, mtpc_inputMediaUploadedThumbDocument = 0xad613491, mtpc_inputMediaDocument = 0x1a77f29c, @@ -109,7 +107,6 @@ enum { mtpc_inputFileLocation = 0x14637196, mtpc_inputVideoFileLocation = 0x3d0364ec, mtpc_inputEncryptedFileLocation = 0xf5235d55, - mtpc_inputAudioFileLocation = 0x74dc404d, mtpc_inputDocumentFileLocation = 0x4e45abe9, mtpc_inputPhotoCropAuto = 0xade6b004, mtpc_inputPhotoCrop = 0xd9915325, @@ -163,7 +160,6 @@ enum { mtpc_messageMediaContact = 0x5e7d2f39, mtpc_messageMediaUnsupported = 0x9f84f49e, mtpc_messageMediaDocument = 0xf3e02ea8, - mtpc_messageMediaAudio = 0xc6b68300, mtpc_messageMediaWebPage = 0xa32dd600, mtpc_messageMediaVenue = 0x7912b71f, mtpc_messageActionEmpty = 0xb6aef7b0, @@ -214,7 +210,6 @@ enum { mtpc_contact = 0xf911c994, mtpc_importedContact = 0xd0028438, mtpc_contactBlocked = 0x561bc879, - mtpc_contactSuggested = 0x3de191a1, mtpc_contactStatus = 0xd3680c61, mtpc_contacts_link = 0x3ace484c, mtpc_contacts_contactsNotModified = 0xb74ba9d2, @@ -222,7 +217,6 @@ enum { mtpc_contacts_importedContacts = 0xad524315, mtpc_contacts_blocked = 0x1c138d15, mtpc_contacts_blockedSlice = 0x900802a1, - mtpc_contacts_suggested = 0x5649dcc5, mtpc_messages_dialogs = 0x15ba6c40, mtpc_messages_dialogsSlice = 0x71e094f3, mtpc_messages_messages = 0x8c718e87, @@ -237,10 +231,10 @@ enum { mtpc_inputMessagesFilterPhotoVideo = 0x56e9f0e4, mtpc_inputMessagesFilterPhotoVideoDocuments = 0xd95e73bb, mtpc_inputMessagesFilterDocument = 0x9eddf188, - mtpc_inputMessagesFilterAudio = 0xcfc87522, - mtpc_inputMessagesFilterAudioDocuments = 0x5afbf764, mtpc_inputMessagesFilterUrl = 0x7ef0dd87, mtpc_inputMessagesFilterGif = 0xffc86587, + mtpc_inputMessagesFilterVoice = 0x50f5c392, + mtpc_inputMessagesFilterMusic = 0x3751b49e, mtpc_updateNewMessage = 0x1f2b0afd, mtpc_updateMessageID = 0x4e90bfd6, mtpc_updateDeleteMessages = 0xa20db0e5, @@ -283,6 +277,7 @@ enum { mtpc_updateStickerSets = 0x43ae3dec, mtpc_updateSavedGifs = 0x9375341e, mtpc_updateBotInlineQuery = 0xc01eea08, + mtpc_updateBotInlineSend = 0xf69e113, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_difference = 0xf49ca0, @@ -322,12 +317,8 @@ enum { mtpc_messages_dhConfig = 0x2c221edd, mtpc_messages_sentEncryptedMessage = 0x560f8935, mtpc_messages_sentEncryptedFile = 0x9493ff32, - mtpc_inputAudioEmpty = 0xd95adc84, - mtpc_inputAudio = 0x77d440ff, mtpc_inputDocumentEmpty = 0x72f0eaae, mtpc_inputDocument = 0x18798952, - mtpc_audioEmpty = 0x586988d8, - mtpc_audio = 0xf9e35055, mtpc_documentEmpty = 0x36f8c871, mtpc_document = 0xf9a39f4f, mtpc_help_support = 0x17c6b5f6, @@ -347,7 +338,9 @@ enum { mtpc_sendMessageChooseContactAction = 0x628cbc6f, mtpc_contacts_found = 0x1aa1f784, mtpc_inputPrivacyKeyStatusTimestamp = 0x4f96cb18, + mtpc_inputPrivacyKeyChatInvite = 0xbdfb0426, mtpc_privacyKeyStatusTimestamp = 0xbc2eab30, + mtpc_privacyKeyChatInvite = 0x500e6dfa, mtpc_inputPrivacyValueAllowContacts = 0xd09e07b, mtpc_inputPrivacyValueAllowAll = 0x184b35ce, mtpc_inputPrivacyValueAllowUsers = 0x131cc67f, @@ -367,7 +360,7 @@ enum { mtpc_documentAttributeAnimated = 0x11b58939, mtpc_documentAttributeSticker = 0x3a556302, mtpc_documentAttributeVideo = 0x5910cccb, - mtpc_documentAttributeAudio = 0xded218e0, + mtpc_documentAttributeAudio = 0x9852f9c6, mtpc_documentAttributeFilename = 0x15590068, mtpc_messages_stickersNotModified = 0xf1749a22, mtpc_messages_stickers = 0x8a8ecd32, @@ -388,7 +381,7 @@ enum { mtpc_account_noPassword = 0x96dabc18, mtpc_account_password = 0x7c18141c, mtpc_account_passwordSettings = 0xb7b72ab3, - mtpc_account_passwordInputSettings = 0xbcfc532c, + mtpc_account_passwordInputSettings = 0x86916deb, mtpc_auth_passwordRecovery = 0x137948a5, mtpc_receivedNotifyMessage = 0xa384b779, mtpc_chatInviteEmpty = 0x69df3769, @@ -512,7 +505,6 @@ enum { mtpc_contacts_getStatuses = 0xc4a353ee, mtpc_contacts_getContacts = 0x22c6aa08, mtpc_contacts_importContacts = 0xda30b32d, - mtpc_contacts_getSuggested = 0xcd773428, mtpc_contacts_deleteContact = 0x8e953744, mtpc_contacts_deleteContacts = 0x59ab389e, mtpc_contacts_block = 0x332b49fc, @@ -524,7 +516,7 @@ enum { mtpc_contacts_resolveUsername = 0xf93ccba3, mtpc_messages_getMessages = 0x4222fa74, mtpc_messages_getDialogs = 0x6b47f94d, - mtpc_messages_getHistory = 0x8a8ec2da, + mtpc_messages_getHistory = 0xafa92846, mtpc_messages_search = 0xd4569248, mtpc_messages_readHistory = 0xe306d3a, mtpc_messages_deleteHistory = 0xb7c13bd9, @@ -597,7 +589,7 @@ enum { mtpc_help_getAppChangelog = 0x5bab7fb2, mtpc_help_getTermsOfService = 0x37d78f83, mtpc_channels_getDialogs = 0xa9d3d249, - mtpc_channels_getImportantHistory = 0xddb929cb, + mtpc_channels_getImportantHistory = 0x8f494bb2, mtpc_channels_readHistory = 0xcc104937, mtpc_channels_deleteMessages = 0x84c1fd4e, mtpc_channels_deleteUserHistory = 0xd10dd71b, @@ -620,7 +612,8 @@ enum { mtpc_channels_inviteToChannel = 0x199f3a6c, mtpc_channels_kickFromChannel = 0xa672de14, mtpc_channels_exportInvite = 0xc7560885, - mtpc_channels_deleteChannel = 0xc0111fe3 + mtpc_channels_deleteChannel = 0xc0111fe3, + mtpc_channels_toggleInvites = 0x49609307 }; // Type forward declarations @@ -725,8 +718,6 @@ class MTPDinputMediaContact; class MTPDinputMediaUploadedVideo; class MTPDinputMediaUploadedThumbVideo; class MTPDinputMediaVideo; -class MTPDinputMediaUploadedAudio; -class MTPDinputMediaAudio; class MTPDinputMediaUploadedDocument; class MTPDinputMediaUploadedThumbDocument; class MTPDinputMediaDocument; @@ -750,7 +741,6 @@ class MTPinputFileLocation; class MTPDinputFileLocation; class MTPDinputVideoFileLocation; class MTPDinputEncryptedFileLocation; -class MTPDinputAudioFileLocation; class MTPDinputDocumentFileLocation; class MTPinputPhotoCrop; @@ -815,7 +805,6 @@ class MTPDmessageMediaVideo; class MTPDmessageMediaGeo; class MTPDmessageMediaContact; class MTPDmessageMediaDocument; -class MTPDmessageMediaAudio; class MTPDmessageMediaWebPage; class MTPDmessageMediaVenue; @@ -895,9 +884,6 @@ class MTPDimportedContact; class MTPcontactBlocked; class MTPDcontactBlocked; -class MTPcontactSuggested; -class MTPDcontactSuggested; - class MTPcontactStatus; class MTPDcontactStatus; @@ -914,9 +900,6 @@ class MTPcontacts_blocked; class MTPDcontacts_blocked; class MTPDcontacts_blockedSlice; -class MTPcontacts_suggested; -class MTPDcontacts_suggested; - class MTPmessages_dialogs; class MTPDmessages_dialogs; class MTPDmessages_dialogsSlice; @@ -978,6 +961,7 @@ class MTPDupdateChatParticipantAdmin; class MTPDupdateNewStickerSet; class MTPDupdateStickerSetsOrder; class MTPDupdateBotInlineQuery; +class MTPDupdateBotInlineSend; class MTPupdates_state; class MTPDupdates_state; @@ -1050,16 +1034,9 @@ class MTPmessages_sentEncryptedMessage; class MTPDmessages_sentEncryptedMessage; class MTPDmessages_sentEncryptedFile; -class MTPinputAudio; -class MTPDinputAudio; - class MTPinputDocument; class MTPDinputDocument; -class MTPaudio; -class MTPDaudioEmpty; -class MTPDaudio; - class MTPdocument; class MTPDdocumentEmpty; class MTPDdocument; @@ -1344,13 +1321,11 @@ typedef MTPBoxed MTPUserFull; typedef MTPBoxed MTPContact; typedef MTPBoxed MTPImportedContact; typedef MTPBoxed MTPContactBlocked; -typedef MTPBoxed MTPContactSuggested; typedef MTPBoxed MTPContactStatus; typedef MTPBoxed MTPcontacts_Link; typedef MTPBoxed MTPcontacts_Contacts; typedef MTPBoxed MTPcontacts_ImportedContacts; typedef MTPBoxed MTPcontacts_Blocked; -typedef MTPBoxed MTPcontacts_Suggested; typedef MTPBoxed MTPmessages_Dialogs; typedef MTPBoxed MTPmessages_Messages; typedef MTPBoxed MTPmessages_Chats; @@ -1376,9 +1351,7 @@ typedef MTPBoxed MTPInputEncryptedFile; typedef MTPBoxed MTPEncryptedMessage; typedef MTPBoxed MTPmessages_DhConfig; typedef MTPBoxed MTPmessages_SentEncryptedMessage; -typedef MTPBoxed MTPInputAudio; typedef MTPBoxed MTPInputDocument; -typedef MTPBoxed MTPAudio; typedef MTPBoxed MTPDocument; typedef MTPBoxed MTPhelp_Support; typedef MTPBoxed MTPNotifyPeer; @@ -2592,30 +2565,6 @@ public: return *(const MTPDinputMediaVideo*)data; } - MTPDinputMediaUploadedAudio &_inputMediaUploadedAudio() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaUploadedAudio) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedAudio); - split(); - return *(MTPDinputMediaUploadedAudio*)data; - } - const MTPDinputMediaUploadedAudio &c_inputMediaUploadedAudio() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaUploadedAudio) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedAudio); - return *(const MTPDinputMediaUploadedAudio*)data; - } - - MTPDinputMediaAudio &_inputMediaAudio() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaAudio) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaAudio); - split(); - return *(MTPDinputMediaAudio*)data; - } - const MTPDinputMediaAudio &c_inputMediaAudio() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaAudio) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaAudio); - return *(const MTPDinputMediaAudio*)data; - } - MTPDinputMediaUploadedDocument &_inputMediaUploadedDocument() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_inputMediaUploadedDocument) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedDocument); @@ -2692,8 +2641,6 @@ private: explicit MTPinputMedia(MTPDinputMediaUploadedVideo *_data); explicit MTPinputMedia(MTPDinputMediaUploadedThumbVideo *_data); explicit MTPinputMedia(MTPDinputMediaVideo *_data); - explicit MTPinputMedia(MTPDinputMediaUploadedAudio *_data); - explicit MTPinputMedia(MTPDinputMediaAudio *_data); explicit MTPinputMedia(MTPDinputMediaUploadedDocument *_data); explicit MTPinputMedia(MTPDinputMediaUploadedThumbDocument *_data); explicit MTPinputMedia(MTPDinputMediaDocument *_data); @@ -2708,8 +2655,6 @@ private: friend MTPinputMedia MTP_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption); friend MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption); friend MTPinputMedia MTP_inputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaUploadedAudio(const MTPInputFile &_file, MTPint _duration, const MTPstring &_mime_type); - friend MTPinputMedia MTP_inputMediaAudio(const MTPInputAudio &_id); 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); @@ -2930,18 +2875,6 @@ public: return *(const MTPDinputEncryptedFileLocation*)data; } - MTPDinputAudioFileLocation &_inputAudioFileLocation() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputAudioFileLocation) throw mtpErrorWrongTypeId(_type, mtpc_inputAudioFileLocation); - split(); - return *(MTPDinputAudioFileLocation*)data; - } - const MTPDinputAudioFileLocation &c_inputAudioFileLocation() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputAudioFileLocation) throw mtpErrorWrongTypeId(_type, mtpc_inputAudioFileLocation); - return *(const MTPDinputAudioFileLocation*)data; - } - MTPDinputDocumentFileLocation &_inputDocumentFileLocation() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_inputDocumentFileLocation) throw mtpErrorWrongTypeId(_type, mtpc_inputDocumentFileLocation); @@ -2966,13 +2899,11 @@ private: explicit MTPinputFileLocation(MTPDinputFileLocation *_data); explicit MTPinputFileLocation(MTPDinputVideoFileLocation *_data); explicit MTPinputFileLocation(MTPDinputEncryptedFileLocation *_data); - explicit MTPinputFileLocation(MTPDinputAudioFileLocation *_data); explicit MTPinputFileLocation(MTPDinputDocumentFileLocation *_data); friend MTPinputFileLocation MTP_inputFileLocation(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret); friend MTPinputFileLocation MTP_inputVideoFileLocation(const MTPlong &_id, const MTPlong &_access_hash); friend MTPinputFileLocation MTP_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash); - friend MTPinputFileLocation MTP_inputAudioFileLocation(const MTPlong &_id, const MTPlong &_access_hash); friend MTPinputFileLocation MTP_inputDocumentFileLocation(const MTPlong &_id, const MTPlong &_access_hash); mtpTypeId _type; @@ -3772,18 +3703,6 @@ public: return *(const MTPDmessageMediaDocument*)data; } - MTPDmessageMediaAudio &_messageMediaAudio() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messageMediaAudio) throw mtpErrorWrongTypeId(_type, mtpc_messageMediaAudio); - split(); - return *(MTPDmessageMediaAudio*)data; - } - const MTPDmessageMediaAudio &c_messageMediaAudio() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messageMediaAudio) throw mtpErrorWrongTypeId(_type, mtpc_messageMediaAudio); - return *(const MTPDmessageMediaAudio*)data; - } - MTPDmessageMediaWebPage &_messageMediaWebPage() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_messageMediaWebPage) throw mtpErrorWrongTypeId(_type, mtpc_messageMediaWebPage); @@ -3822,7 +3741,6 @@ private: explicit MTPmessageMedia(MTPDmessageMediaGeo *_data); explicit MTPmessageMedia(MTPDmessageMediaContact *_data); explicit MTPmessageMedia(MTPDmessageMediaDocument *_data); - explicit MTPmessageMedia(MTPDmessageMediaAudio *_data); explicit MTPmessageMedia(MTPDmessageMediaWebPage *_data); explicit MTPmessageMedia(MTPDmessageMediaVenue *_data); @@ -3833,7 +3751,6 @@ private: 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_messageMediaAudio(const MTPAudio &_audio); 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); @@ -4766,37 +4683,6 @@ private: }; typedef MTPBoxed MTPContactBlocked; -class MTPcontactSuggested : private mtpDataOwner { -public: - MTPcontactSuggested(); - MTPcontactSuggested(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contactSuggested) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDcontactSuggested &_contactSuggested() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDcontactSuggested*)data; - } - const MTPDcontactSuggested &c_contactSuggested() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDcontactSuggested*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contactSuggested); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPcontactSuggested(MTPDcontactSuggested *_data); - - friend MTPcontactSuggested MTP_contactSuggested(MTPint _user_id, MTPint _mutual_contacts); -}; -typedef MTPBoxed MTPContactSuggested; - class MTPcontactStatus : private mtpDataOwner { public: MTPcontactStatus(); @@ -4979,37 +4865,6 @@ private: }; typedef MTPBoxed MTPcontacts_Blocked; -class MTPcontacts_suggested : private mtpDataOwner { -public: - MTPcontacts_suggested(); - MTPcontacts_suggested(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_suggested) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDcontacts_suggested &_contacts_suggested() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDcontacts_suggested*)data; - } - const MTPDcontacts_suggested &c_contacts_suggested() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDcontacts_suggested*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_suggested); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPcontacts_suggested(MTPDcontacts_suggested *_data); - - friend MTPcontacts_suggested MTP_contacts_suggested(const MTPVector &_results, const MTPVector &_users); -}; -typedef MTPBoxed MTPcontacts_Suggested; - class MTPmessages_dialogs : private mtpDataOwner { public: MTPmessages_dialogs() : mtpDataOwner(0), _type(0) { @@ -5243,10 +5098,10 @@ private: friend MTPmessagesFilter MTP_inputMessagesFilterPhotoVideo(); friend MTPmessagesFilter MTP_inputMessagesFilterPhotoVideoDocuments(); friend MTPmessagesFilter MTP_inputMessagesFilterDocument(); - friend MTPmessagesFilter MTP_inputMessagesFilterAudio(); - friend MTPmessagesFilter MTP_inputMessagesFilterAudioDocuments(); friend MTPmessagesFilter MTP_inputMessagesFilterUrl(); friend MTPmessagesFilter MTP_inputMessagesFilterGif(); + friend MTPmessagesFilter MTP_inputMessagesFilterVoice(); + friend MTPmessagesFilter MTP_inputMessagesFilterMusic(); mtpTypeId _type; }; @@ -5740,6 +5595,18 @@ public: return *(const MTPDupdateBotInlineQuery*)data; } + MTPDupdateBotInlineSend &_updateBotInlineSend() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateBotInlineSend) throw mtpErrorWrongTypeId(_type, mtpc_updateBotInlineSend); + split(); + return *(MTPDupdateBotInlineSend*)data; + } + const MTPDupdateBotInlineSend &c_updateBotInlineSend() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateBotInlineSend) throw mtpErrorWrongTypeId(_type, mtpc_updateBotInlineSend); + return *(const MTPDupdateBotInlineSend*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -5789,6 +5656,7 @@ private: explicit MTPupdate(MTPDupdateNewStickerSet *_data); explicit MTPupdate(MTPDupdateStickerSetsOrder *_data); explicit MTPupdate(MTPDupdateBotInlineQuery *_data); + explicit MTPupdate(MTPDupdateBotInlineSend *_data); friend MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count); friend MTPupdate MTP_updateMessageID(MTPint _id, const MTPlong &_random_id); @@ -5832,6 +5700,7 @@ private: 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); mtpTypeId _type; }; @@ -6697,44 +6566,6 @@ private: }; typedef MTPBoxed MTPmessages_SentEncryptedMessage; -class MTPinputAudio : private mtpDataOwner { -public: - MTPinputAudio() : mtpDataOwner(0), _type(0) { - } - MTPinputAudio(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDinputAudio &_inputAudio() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputAudio) throw mtpErrorWrongTypeId(_type, mtpc_inputAudio); - split(); - return *(MTPDinputAudio*)data; - } - const MTPDinputAudio &c_inputAudio() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputAudio) throw mtpErrorWrongTypeId(_type, mtpc_inputAudio); - return *(const MTPDinputAudio*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPinputAudio(mtpTypeId type); - explicit MTPinputAudio(MTPDinputAudio *_data); - - friend MTPinputAudio MTP_inputAudioEmpty(); - friend MTPinputAudio MTP_inputAudio(const MTPlong &_id, const MTPlong &_access_hash); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPInputAudio; - class MTPinputDocument : private mtpDataOwner { public: MTPinputDocument() : mtpDataOwner(0), _type(0) { @@ -6773,57 +6604,6 @@ private: }; typedef MTPBoxed MTPInputDocument; -class MTPaudio : private mtpDataOwner { -public: - MTPaudio() : mtpDataOwner(0), _type(0) { - } - MTPaudio(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDaudioEmpty &_audioEmpty() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_audioEmpty) throw mtpErrorWrongTypeId(_type, mtpc_audioEmpty); - split(); - return *(MTPDaudioEmpty*)data; - } - const MTPDaudioEmpty &c_audioEmpty() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_audioEmpty) throw mtpErrorWrongTypeId(_type, mtpc_audioEmpty); - return *(const MTPDaudioEmpty*)data; - } - - MTPDaudio &_audio() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_audio) throw mtpErrorWrongTypeId(_type, mtpc_audio); - split(); - return *(MTPDaudio*)data; - } - const MTPDaudio &c_audio() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_audio) throw mtpErrorWrongTypeId(_type, mtpc_audio); - return *(const MTPDaudio*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPaudio(mtpTypeId type); - explicit MTPaudio(MTPDaudioEmpty *_data); - explicit MTPaudio(MTPDaudio *_data); - - friend MTPaudio MTP_audioEmpty(const MTPlong &_id); - friend MTPaudio MTP_audio(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _duration, const MTPstring &_mime_type, MTPint _size, MTPint _dc_id); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPAudio; - class MTPdocument : private mtpDataOwner { public: MTPdocument() : mtpDataOwner(0), _type(0) { @@ -7064,43 +6844,51 @@ typedef MTPBoxed MTPcontacts_Found; class MTPinputPrivacyKey { public: - MTPinputPrivacyKey() { + MTPinputPrivacyKey() : _type(0) { } - MTPinputPrivacyKey(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputPrivacyKeyStatusTimestamp) { + MTPinputPrivacyKey(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : _type(0) { read(from, end, cons); } uint32 innerLength() const; mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputPrivacyKeyStatusTimestamp); + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); void write(mtpBuffer &to) const; typedef void ResponseType; private: + explicit MTPinputPrivacyKey(mtpTypeId type); friend MTPinputPrivacyKey MTP_inputPrivacyKeyStatusTimestamp(); + friend MTPinputPrivacyKey MTP_inputPrivacyKeyChatInvite(); + + mtpTypeId _type; }; typedef MTPBoxed MTPInputPrivacyKey; class MTPprivacyKey { public: - MTPprivacyKey() { + MTPprivacyKey() : _type(0) { } - MTPprivacyKey(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_privacyKeyStatusTimestamp) { + MTPprivacyKey(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : _type(0) { read(from, end, cons); } uint32 innerLength() const; mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_privacyKeyStatusTimestamp); + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); void write(mtpBuffer &to) const; typedef void ResponseType; private: + explicit MTPprivacyKey(mtpTypeId type); friend MTPprivacyKey MTP_privacyKeyStatusTimestamp(); + friend MTPprivacyKey MTP_privacyKeyChatInvite(); + + mtpTypeId _type; }; typedef MTPBoxed MTPPrivacyKey; @@ -7394,7 +7182,7 @@ private: 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 _duration, const MTPstring &_title, const MTPstring &_performer); + 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); mtpTypeId _type; @@ -9850,28 +9638,6 @@ public: MTPstring vcaption; }; -class MTPDinputMediaUploadedAudio : public mtpDataImpl { -public: - MTPDinputMediaUploadedAudio() { - } - MTPDinputMediaUploadedAudio(const MTPInputFile &_file, MTPint _duration, const MTPstring &_mime_type) : vfile(_file), vduration(_duration), vmime_type(_mime_type) { - } - - MTPInputFile vfile; - MTPint vduration; - MTPstring vmime_type; -}; - -class MTPDinputMediaAudio : public mtpDataImpl { -public: - MTPDinputMediaAudio() { - } - MTPDinputMediaAudio(const MTPInputAudio &_id) : vid(_id) { - } - - MTPInputAudio vid; -}; - class MTPDinputMediaUploadedDocument : public mtpDataImpl { public: MTPDinputMediaUploadedDocument() { @@ -10024,17 +9790,6 @@ public: MTPlong vaccess_hash; }; -class MTPDinputAudioFileLocation : public mtpDataImpl { -public: - MTPDinputAudioFileLocation() { - } - MTPDinputAudioFileLocation(const MTPlong &_id, const MTPlong &_access_hash) : vid(_id), vaccess_hash(_access_hash) { - } - - MTPlong vid; - MTPlong vaccess_hash; -}; - class MTPDinputDocumentFileLocation : public mtpDataImpl { public: MTPDinputDocumentFileLocation() { @@ -10314,6 +10069,7 @@ public: flag_verified = (1 << 7), flag_megagroup = (1 << 8), flag_restricted = (1 << 9), + flag_invites_enabled = (1 << 10), flag_username = (1 << 6), flag_restriction_reason = (1 << 9), }; @@ -10327,6 +10083,7 @@ public: 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_invites_enabled() const { return vflags.v & flag_invites_enabled; } bool has_username() const { return vflags.v & flag_username; } bool has_restriction_reason() const { return vflags.v & flag_restriction_reason; } }; @@ -10621,16 +10378,6 @@ public: MTPstring vcaption; }; -class MTPDmessageMediaAudio : public mtpDataImpl { -public: - MTPDmessageMediaAudio() { - } - MTPDmessageMediaAudio(const MTPAudio &_audio) : vaudio(_audio) { - } - - MTPAudio vaudio; -}; - class MTPDmessageMediaWebPage : public mtpDataImpl { public: MTPDmessageMediaWebPage() { @@ -11056,17 +10803,6 @@ public: MTPint vdate; }; -class MTPDcontactSuggested : public mtpDataImpl { -public: - MTPDcontactSuggested() { - } - MTPDcontactSuggested(MTPint _user_id, MTPint _mutual_contacts) : vuser_id(_user_id), vmutual_contacts(_mutual_contacts) { - } - - MTPint vuser_id; - MTPint vmutual_contacts; -}; - class MTPDcontactStatus : public mtpDataImpl { public: MTPDcontactStatus() { @@ -11136,17 +10872,6 @@ public: MTPVector vusers; }; -class MTPDcontacts_suggested : public mtpDataImpl { -public: - MTPDcontacts_suggested() { - } - MTPDcontacts_suggested(const MTPVector &_results, const MTPVector &_users) : vresults(_results), vusers(_users) { - } - - MTPVector vresults; - MTPVector vusers; -}; - class MTPDmessages_dialogs : public mtpDataImpl { public: MTPDmessages_dialogs() { @@ -11720,6 +11445,18 @@ public: MTPstring voffset; }; +class MTPDupdateBotInlineSend : public mtpDataImpl { +public: + MTPDupdateBotInlineSend() { + } + MTPDupdateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) : vuser_id(_user_id), vquery(_query), vid(_id) { + } + + MTPint vuser_id; + MTPstring vquery; + MTPstring vid; +}; + class MTPDupdates_state : public mtpDataImpl { public: MTPDupdates_state() { @@ -12257,17 +11994,6 @@ public: MTPEncryptedFile vfile; }; -class MTPDinputAudio : public mtpDataImpl { -public: - MTPDinputAudio() { - } - MTPDinputAudio(const MTPlong &_id, const MTPlong &_access_hash) : vid(_id), vaccess_hash(_access_hash) { - } - - MTPlong vid; - MTPlong vaccess_hash; -}; - class MTPDinputDocument : public mtpDataImpl { public: MTPDinputDocument() { @@ -12279,32 +12005,6 @@ public: MTPlong vaccess_hash; }; -class MTPDaudioEmpty : public mtpDataImpl { -public: - MTPDaudioEmpty() { - } - MTPDaudioEmpty(const MTPlong &_id) : vid(_id) { - } - - MTPlong vid; -}; - -class MTPDaudio : public mtpDataImpl { -public: - MTPDaudio() { - } - MTPDaudio(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _duration, const MTPstring &_mime_type, MTPint _size, MTPint _dc_id) : vid(_id), vaccess_hash(_access_hash), vdate(_date), vduration(_duration), vmime_type(_mime_type), vsize(_size), vdc_id(_dc_id) { - } - - MTPlong vid; - MTPlong vaccess_hash; - MTPint vdate; - MTPint vduration; - MTPstring vmime_type; - MTPint vsize; - MTPint vdc_id; -}; - class MTPDdocumentEmpty : public mtpDataImpl { public: MTPDdocumentEmpty() { @@ -12515,12 +12215,26 @@ class MTPDdocumentAttributeAudio : public mtpDataImpl { @@ -15991,45 +15705,6 @@ public: } }; -class MTPcontacts_getSuggested { // RPC method 'contacts.getSuggested' -public: - MTPint vlimit; - - MTPcontacts_getSuggested() { - } - MTPcontacts_getSuggested(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_getSuggested) { - read(from, end, cons); - } - MTPcontacts_getSuggested(MTPint _limit) : vlimit(_limit) { - } - - uint32 innerLength() const { - return vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_contacts_getSuggested; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_contacts_getSuggested) { - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vlimit.write(to); - } - - typedef MTPcontacts_Suggested ResponseType; -}; -class MTPcontacts_GetSuggested : public MTPBoxed { -public: - MTPcontacts_GetSuggested() { - } - MTPcontacts_GetSuggested(const MTPcontacts_getSuggested &v) : MTPBoxed(v) { - } - MTPcontacts_GetSuggested(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPcontacts_GetSuggested(MTPint _limit) : MTPBoxed(MTPcontacts_getSuggested(_limit)) { - } -}; - class MTPcontacts_deleteContact { // RPC method 'contacts.deleteContact' public: MTPInputUser vid; @@ -16470,6 +16145,7 @@ class MTPmessages_getHistory { // RPC method 'messages.getHistory' public: MTPInputPeer vpeer; MTPint voffset_id; + MTPint voffset_date; MTPint vadd_offset; MTPint vlimit; MTPint vmax_id; @@ -16480,11 +16156,11 @@ public: MTPmessages_getHistory(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getHistory) { read(from, end, cons); } - MTPmessages_getHistory(const MTPInputPeer &_peer, MTPint _offset_id, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : vpeer(_peer), voffset_id(_offset_id), vadd_offset(_add_offset), vlimit(_limit), vmax_id(_max_id), vmin_id(_min_id) { + MTPmessages_getHistory(const MTPInputPeer &_peer, MTPint _offset_id, MTPint _offset_date, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : vpeer(_peer), voffset_id(_offset_id), voffset_date(_offset_date), vadd_offset(_add_offset), vlimit(_limit), vmax_id(_max_id), vmin_id(_min_id) { } uint32 innerLength() const { - return vpeer.innerLength() + voffset_id.innerLength() + vadd_offset.innerLength() + vlimit.innerLength() + vmax_id.innerLength() + vmin_id.innerLength(); + return vpeer.innerLength() + voffset_id.innerLength() + voffset_date.innerLength() + vadd_offset.innerLength() + vlimit.innerLength() + vmax_id.innerLength() + vmin_id.innerLength(); } mtpTypeId type() const { return mtpc_messages_getHistory; @@ -16492,6 +16168,7 @@ public: void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getHistory) { vpeer.read(from, end); voffset_id.read(from, end); + voffset_date.read(from, end); vadd_offset.read(from, end); vlimit.read(from, end); vmax_id.read(from, end); @@ -16500,6 +16177,7 @@ public: void write(mtpBuffer &to) const { vpeer.write(to); voffset_id.write(to); + voffset_date.write(to); vadd_offset.write(to); vlimit.write(to); vmax_id.write(to); @@ -16516,7 +16194,7 @@ public: } MTPmessages_GetHistory(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPmessages_GetHistory(const MTPInputPeer &_peer, MTPint _offset_id, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : MTPBoxed(MTPmessages_getHistory(_peer, _offset_id, _add_offset, _limit, _max_id, _min_id)) { + MTPmessages_GetHistory(const MTPInputPeer &_peer, MTPint _offset_id, MTPint _offset_date, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : MTPBoxed(MTPmessages_getHistory(_peer, _offset_id, _offset_date, _add_offset, _limit, _max_id, _min_id)) { } }; @@ -19672,6 +19350,7 @@ class MTPchannels_getImportantHistory { // RPC method 'channels.getImportantHist public: MTPInputChannel vchannel; MTPint voffset_id; + MTPint voffset_date; MTPint vadd_offset; MTPint vlimit; MTPint vmax_id; @@ -19682,11 +19361,11 @@ public: MTPchannels_getImportantHistory(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_getImportantHistory) { read(from, end, cons); } - MTPchannels_getImportantHistory(const MTPInputChannel &_channel, MTPint _offset_id, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : vchannel(_channel), voffset_id(_offset_id), vadd_offset(_add_offset), vlimit(_limit), vmax_id(_max_id), vmin_id(_min_id) { + MTPchannels_getImportantHistory(const MTPInputChannel &_channel, MTPint _offset_id, MTPint _offset_date, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : vchannel(_channel), voffset_id(_offset_id), voffset_date(_offset_date), vadd_offset(_add_offset), vlimit(_limit), vmax_id(_max_id), vmin_id(_min_id) { } uint32 innerLength() const { - return vchannel.innerLength() + voffset_id.innerLength() + vadd_offset.innerLength() + vlimit.innerLength() + vmax_id.innerLength() + vmin_id.innerLength(); + return vchannel.innerLength() + voffset_id.innerLength() + voffset_date.innerLength() + vadd_offset.innerLength() + vlimit.innerLength() + vmax_id.innerLength() + vmin_id.innerLength(); } mtpTypeId type() const { return mtpc_channels_getImportantHistory; @@ -19694,6 +19373,7 @@ public: void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_getImportantHistory) { vchannel.read(from, end); voffset_id.read(from, end); + voffset_date.read(from, end); vadd_offset.read(from, end); vlimit.read(from, end); vmax_id.read(from, end); @@ -19702,6 +19382,7 @@ public: void write(mtpBuffer &to) const { vchannel.write(to); voffset_id.write(to); + voffset_date.write(to); vadd_offset.write(to); vlimit.write(to); vmax_id.write(to); @@ -19718,7 +19399,7 @@ public: } MTPchannels_GetImportantHistory(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPchannels_GetImportantHistory(const MTPInputChannel &_channel, MTPint _offset_id, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : MTPBoxed(MTPchannels_getImportantHistory(_channel, _offset_id, _add_offset, _limit, _max_id, _min_id)) { + MTPchannels_GetImportantHistory(const MTPInputChannel &_channel, MTPint _offset_id, MTPint _offset_date, MTPint _add_offset, MTPint _limit, MTPint _max_id, MTPint _min_id) : MTPBoxed(MTPchannels_getImportantHistory(_channel, _offset_id, _offset_date, _add_offset, _limit, _max_id, _min_id)) { } }; @@ -20696,6 +20377,48 @@ public: } }; +class MTPchannels_toggleInvites { // RPC method 'channels.toggleInvites' +public: + MTPInputChannel vchannel; + MTPBool venabled; + + MTPchannels_toggleInvites() { + } + MTPchannels_toggleInvites(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_toggleInvites) { + read(from, end, cons); + } + MTPchannels_toggleInvites(const MTPInputChannel &_channel, MTPBool _enabled) : vchannel(_channel), venabled(_enabled) { + } + + uint32 innerLength() const { + return vchannel.innerLength() + venabled.innerLength(); + } + mtpTypeId type() const { + return mtpc_channels_toggleInvites; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_toggleInvites) { + vchannel.read(from, end); + venabled.read(from, end); + } + void write(mtpBuffer &to) const { + vchannel.write(to); + venabled.write(to); + } + + typedef MTPUpdates ResponseType; +}; +class MTPchannels_ToggleInvites : public MTPBoxed { +public: + MTPchannels_ToggleInvites() { + } + MTPchannels_ToggleInvites(const MTPchannels_toggleInvites &v) : MTPBoxed(v) { + } + MTPchannels_ToggleInvites(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPchannels_ToggleInvites(const MTPInputChannel &_channel, MTPBool _enabled) : MTPBoxed(MTPchannels_toggleInvites(_channel, _enabled)) { + } +}; + // Inline methods definition inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { @@ -21968,14 +21691,6 @@ inline uint32 MTPinputMedia::innerLength() const { const MTPDinputMediaVideo &v(c_inputMediaVideo()); return v.vid.innerLength() + v.vcaption.innerLength(); } - case mtpc_inputMediaUploadedAudio: { - const MTPDinputMediaUploadedAudio &v(c_inputMediaUploadedAudio()); - return v.vfile.innerLength() + v.vduration.innerLength() + v.vmime_type.innerLength(); - } - case mtpc_inputMediaAudio: { - const MTPDinputMediaAudio &v(c_inputMediaAudio()); - return v.vid.innerLength(); - } case mtpc_inputMediaUploadedDocument: { const MTPDinputMediaUploadedDocument &v(c_inputMediaUploadedDocument()); return v.vfile.innerLength() + v.vmime_type.innerLength() + v.vattributes.innerLength() + v.vcaption.innerLength(); @@ -22058,18 +21773,6 @@ inline void MTPinputMedia::read(const mtpPrime *&from, const mtpPrime *end, mtpT v.vid.read(from, end); v.vcaption.read(from, end); } break; - case mtpc_inputMediaUploadedAudio: _type = cons; { - if (!data) setData(new MTPDinputMediaUploadedAudio()); - MTPDinputMediaUploadedAudio &v(_inputMediaUploadedAudio()); - v.vfile.read(from, end); - v.vduration.read(from, end); - v.vmime_type.read(from, end); - } break; - case mtpc_inputMediaAudio: _type = cons; { - if (!data) setData(new MTPDinputMediaAudio()); - MTPDinputMediaAudio &v(_inputMediaAudio()); - v.vid.read(from, end); - } break; case mtpc_inputMediaUploadedDocument: _type = cons; { if (!data) setData(new MTPDinputMediaUploadedDocument()); MTPDinputMediaUploadedDocument &v(_inputMediaUploadedDocument()); @@ -22157,16 +21860,6 @@ inline void MTPinputMedia::write(mtpBuffer &to) const { v.vid.write(to); v.vcaption.write(to); } break; - case mtpc_inputMediaUploadedAudio: { - const MTPDinputMediaUploadedAudio &v(c_inputMediaUploadedAudio()); - v.vfile.write(to); - v.vduration.write(to); - v.vmime_type.write(to); - } break; - case mtpc_inputMediaAudio: { - const MTPDinputMediaAudio &v(c_inputMediaAudio()); - v.vid.write(to); - } break; case mtpc_inputMediaUploadedDocument: { const MTPDinputMediaUploadedDocument &v(c_inputMediaUploadedDocument()); v.vfile.write(to); @@ -22212,8 +21905,6 @@ inline MTPinputMedia::MTPinputMedia(mtpTypeId type) : mtpDataOwner(0), _type(typ case mtpc_inputMediaUploadedVideo: setData(new MTPDinputMediaUploadedVideo()); break; case mtpc_inputMediaUploadedThumbVideo: setData(new MTPDinputMediaUploadedThumbVideo()); break; case mtpc_inputMediaVideo: setData(new MTPDinputMediaVideo()); break; - case mtpc_inputMediaUploadedAudio: setData(new MTPDinputMediaUploadedAudio()); break; - case mtpc_inputMediaAudio: setData(new MTPDinputMediaAudio()); break; case mtpc_inputMediaUploadedDocument: setData(new MTPDinputMediaUploadedDocument()); break; case mtpc_inputMediaUploadedThumbDocument: setData(new MTPDinputMediaUploadedThumbDocument()); break; case mtpc_inputMediaDocument: setData(new MTPDinputMediaDocument()); break; @@ -22236,10 +21927,6 @@ inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedThumbVideo *_data) : m } inline MTPinputMedia::MTPinputMedia(MTPDinputMediaVideo *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaVideo) { } -inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedAudio *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedAudio) { -} -inline MTPinputMedia::MTPinputMedia(MTPDinputMediaAudio *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaAudio) { -} inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedDocument *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedDocument) { } inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedThumbDocument *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedThumbDocument) { @@ -22274,12 +21961,6 @@ inline MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, inline MTPinputMedia MTP_inputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption) { return MTPinputMedia(new MTPDinputMediaVideo(_id, _caption)); } -inline MTPinputMedia MTP_inputMediaUploadedAudio(const MTPInputFile &_file, MTPint _duration, const MTPstring &_mime_type) { - return MTPinputMedia(new MTPDinputMediaUploadedAudio(_file, _duration, _mime_type)); -} -inline MTPinputMedia MTP_inputMediaAudio(const MTPInputAudio &_id) { - return MTPinputMedia(new MTPDinputMediaAudio(_id)); -} 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)); } @@ -22535,10 +22216,6 @@ inline uint32 MTPinputFileLocation::innerLength() const { const MTPDinputEncryptedFileLocation &v(c_inputEncryptedFileLocation()); return v.vid.innerLength() + v.vaccess_hash.innerLength(); } - case mtpc_inputAudioFileLocation: { - const MTPDinputAudioFileLocation &v(c_inputAudioFileLocation()); - return v.vid.innerLength() + v.vaccess_hash.innerLength(); - } case mtpc_inputDocumentFileLocation: { const MTPDinputDocumentFileLocation &v(c_inputDocumentFileLocation()); return v.vid.innerLength() + v.vaccess_hash.innerLength(); @@ -22572,12 +22249,6 @@ inline void MTPinputFileLocation::read(const mtpPrime *&from, const mtpPrime *en v.vid.read(from, end); v.vaccess_hash.read(from, end); } break; - case mtpc_inputAudioFileLocation: _type = cons; { - if (!data) setData(new MTPDinputAudioFileLocation()); - MTPDinputAudioFileLocation &v(_inputAudioFileLocation()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - } break; case mtpc_inputDocumentFileLocation: _type = cons; { if (!data) setData(new MTPDinputDocumentFileLocation()); MTPDinputDocumentFileLocation &v(_inputDocumentFileLocation()); @@ -22605,11 +22276,6 @@ inline void MTPinputFileLocation::write(mtpBuffer &to) const { v.vid.write(to); v.vaccess_hash.write(to); } break; - case mtpc_inputAudioFileLocation: { - const MTPDinputAudioFileLocation &v(c_inputAudioFileLocation()); - v.vid.write(to); - v.vaccess_hash.write(to); - } break; case mtpc_inputDocumentFileLocation: { const MTPDinputDocumentFileLocation &v(c_inputDocumentFileLocation()); v.vid.write(to); @@ -22622,7 +22288,6 @@ inline MTPinputFileLocation::MTPinputFileLocation(mtpTypeId type) : mtpDataOwner case mtpc_inputFileLocation: setData(new MTPDinputFileLocation()); break; case mtpc_inputVideoFileLocation: setData(new MTPDinputVideoFileLocation()); break; case mtpc_inputEncryptedFileLocation: setData(new MTPDinputEncryptedFileLocation()); break; - case mtpc_inputAudioFileLocation: setData(new MTPDinputAudioFileLocation()); break; case mtpc_inputDocumentFileLocation: setData(new MTPDinputDocumentFileLocation()); break; default: throw mtpErrorBadTypeId(type, "MTPinputFileLocation"); } @@ -22633,8 +22298,6 @@ inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputVideoFileLocation *_d } inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputEncryptedFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputEncryptedFileLocation) { } -inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputAudioFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputAudioFileLocation) { -} inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputDocumentFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputDocumentFileLocation) { } inline MTPinputFileLocation MTP_inputFileLocation(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { @@ -22646,9 +22309,6 @@ inline MTPinputFileLocation MTP_inputVideoFileLocation(const MTPlong &_id, const inline MTPinputFileLocation MTP_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { return MTPinputFileLocation(new MTPDinputEncryptedFileLocation(_id, _access_hash)); } -inline MTPinputFileLocation MTP_inputAudioFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputFileLocation(new MTPDinputAudioFileLocation(_id, _access_hash)); -} inline MTPinputFileLocation MTP_inputDocumentFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { return MTPinputFileLocation(new MTPDinputDocumentFileLocation(_id, _access_hash)); } @@ -23796,10 +23456,6 @@ inline uint32 MTPmessageMedia::innerLength() const { const MTPDmessageMediaDocument &v(c_messageMediaDocument()); return v.vdocument.innerLength() + v.vcaption.innerLength(); } - case mtpc_messageMediaAudio: { - const MTPDmessageMediaAudio &v(c_messageMediaAudio()); - return v.vaudio.innerLength(); - } case mtpc_messageMediaWebPage: { const MTPDmessageMediaWebPage &v(c_messageMediaWebPage()); return v.vwebpage.innerLength(); @@ -23851,11 +23507,6 @@ inline void MTPmessageMedia::read(const mtpPrime *&from, const mtpPrime *end, mt v.vdocument.read(from, end); v.vcaption.read(from, end); } break; - case mtpc_messageMediaAudio: _type = cons; { - if (!data) setData(new MTPDmessageMediaAudio()); - MTPDmessageMediaAudio &v(_messageMediaAudio()); - v.vaudio.read(from, end); - } break; case mtpc_messageMediaWebPage: _type = cons; { if (!data) setData(new MTPDmessageMediaWebPage()); MTPDmessageMediaWebPage &v(_messageMediaWebPage()); @@ -23901,10 +23552,6 @@ inline void MTPmessageMedia::write(mtpBuffer &to) const { v.vdocument.write(to); v.vcaption.write(to); } break; - case mtpc_messageMediaAudio: { - const MTPDmessageMediaAudio &v(c_messageMediaAudio()); - v.vaudio.write(to); - } break; case mtpc_messageMediaWebPage: { const MTPDmessageMediaWebPage &v(c_messageMediaWebPage()); v.vwebpage.write(to); @@ -23928,7 +23575,6 @@ inline MTPmessageMedia::MTPmessageMedia(mtpTypeId type) : mtpDataOwner(0), _type case mtpc_messageMediaContact: setData(new MTPDmessageMediaContact()); break; case mtpc_messageMediaUnsupported: break; case mtpc_messageMediaDocument: setData(new MTPDmessageMediaDocument()); break; - case mtpc_messageMediaAudio: setData(new MTPDmessageMediaAudio()); break; case mtpc_messageMediaWebPage: setData(new MTPDmessageMediaWebPage()); break; case mtpc_messageMediaVenue: setData(new MTPDmessageMediaVenue()); break; default: throw mtpErrorBadTypeId(type, "MTPmessageMedia"); @@ -23944,8 +23590,6 @@ inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaContact *_data) : mtpDat } inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaDocument *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaDocument) { } -inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaAudio *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaAudio) { -} inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaWebPage *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaWebPage) { } inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaVenue *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaVenue) { @@ -23971,9 +23615,6 @@ inline MTPmessageMedia MTP_messageMediaUnsupported() { inline MTPmessageMedia MTP_messageMediaDocument(const MTPDocument &_document, const MTPstring &_caption) { return MTPmessageMedia(new MTPDmessageMediaDocument(_document, _caption)); } -inline MTPmessageMedia MTP_messageMediaAudio(const MTPAudio &_audio) { - return MTPmessageMedia(new MTPDmessageMediaAudio(_audio)); -} inline MTPmessageMedia MTP_messageMediaWebPage(const MTPWebPage &_webpage) { return MTPmessageMedia(new MTPDmessageMediaWebPage(_webpage)); } @@ -25202,35 +24843,6 @@ inline MTPcontactBlocked MTP_contactBlocked(MTPint _user_id, MTPint _date) { return MTPcontactBlocked(new MTPDcontactBlocked(_user_id, _date)); } -inline MTPcontactSuggested::MTPcontactSuggested() : mtpDataOwner(new MTPDcontactSuggested()) { -} - -inline uint32 MTPcontactSuggested::innerLength() const { - const MTPDcontactSuggested &v(c_contactSuggested()); - return v.vuser_id.innerLength() + v.vmutual_contacts.innerLength(); -} -inline mtpTypeId MTPcontactSuggested::type() const { - return mtpc_contactSuggested; -} -inline void MTPcontactSuggested::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_contactSuggested) throw mtpErrorUnexpected(cons, "MTPcontactSuggested"); - - if (!data) setData(new MTPDcontactSuggested()); - MTPDcontactSuggested &v(_contactSuggested()); - v.vuser_id.read(from, end); - v.vmutual_contacts.read(from, end); -} -inline void MTPcontactSuggested::write(mtpBuffer &to) const { - const MTPDcontactSuggested &v(c_contactSuggested()); - v.vuser_id.write(to); - v.vmutual_contacts.write(to); -} -inline MTPcontactSuggested::MTPcontactSuggested(MTPDcontactSuggested *_data) : mtpDataOwner(_data) { -} -inline MTPcontactSuggested MTP_contactSuggested(MTPint _user_id, MTPint _mutual_contacts) { - return MTPcontactSuggested(new MTPDcontactSuggested(_user_id, _mutual_contacts)); -} - inline MTPcontactStatus::MTPcontactStatus() : mtpDataOwner(new MTPDcontactStatus()) { } @@ -25442,35 +25054,6 @@ inline MTPcontacts_blocked MTP_contacts_blockedSlice(MTPint _count, const MTPVec return MTPcontacts_blocked(new MTPDcontacts_blockedSlice(_count, _blocked, _users)); } -inline MTPcontacts_suggested::MTPcontacts_suggested() : mtpDataOwner(new MTPDcontacts_suggested()) { -} - -inline uint32 MTPcontacts_suggested::innerLength() const { - const MTPDcontacts_suggested &v(c_contacts_suggested()); - return v.vresults.innerLength() + v.vusers.innerLength(); -} -inline mtpTypeId MTPcontacts_suggested::type() const { - return mtpc_contacts_suggested; -} -inline void MTPcontacts_suggested::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_contacts_suggested) throw mtpErrorUnexpected(cons, "MTPcontacts_suggested"); - - if (!data) setData(new MTPDcontacts_suggested()); - MTPDcontacts_suggested &v(_contacts_suggested()); - v.vresults.read(from, end); - v.vusers.read(from, end); -} -inline void MTPcontacts_suggested::write(mtpBuffer &to) const { - const MTPDcontacts_suggested &v(c_contacts_suggested()); - v.vresults.write(to); - v.vusers.write(to); -} -inline MTPcontacts_suggested::MTPcontacts_suggested(MTPDcontacts_suggested *_data) : mtpDataOwner(_data) { -} -inline MTPcontacts_suggested MTP_contacts_suggested(const MTPVector &_results, const MTPVector &_users) { - return MTPcontacts_suggested(new MTPDcontacts_suggested(_results, _users)); -} - inline uint32 MTPmessages_dialogs::innerLength() const { switch (_type) { case mtpc_messages_dialogs: { @@ -25756,10 +25339,10 @@ inline void MTPmessagesFilter::read(const mtpPrime *&from, const mtpPrime *end, case mtpc_inputMessagesFilterPhotoVideo: _type = cons; break; case mtpc_inputMessagesFilterPhotoVideoDocuments: _type = cons; break; case mtpc_inputMessagesFilterDocument: _type = cons; break; - case mtpc_inputMessagesFilterAudio: _type = cons; break; - case mtpc_inputMessagesFilterAudioDocuments: _type = cons; break; case mtpc_inputMessagesFilterUrl: _type = cons; break; case mtpc_inputMessagesFilterGif: _type = cons; break; + case mtpc_inputMessagesFilterVoice: _type = cons; break; + case mtpc_inputMessagesFilterMusic: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPmessagesFilter"); } } @@ -25775,10 +25358,10 @@ inline MTPmessagesFilter::MTPmessagesFilter(mtpTypeId type) : _type(type) { case mtpc_inputMessagesFilterPhotoVideo: break; case mtpc_inputMessagesFilterPhotoVideoDocuments: break; case mtpc_inputMessagesFilterDocument: break; - case mtpc_inputMessagesFilterAudio: break; - case mtpc_inputMessagesFilterAudioDocuments: break; case mtpc_inputMessagesFilterUrl: break; case mtpc_inputMessagesFilterGif: break; + case mtpc_inputMessagesFilterVoice: break; + case mtpc_inputMessagesFilterMusic: break; default: throw mtpErrorBadTypeId(type, "MTPmessagesFilter"); } } @@ -25800,18 +25383,18 @@ inline MTPmessagesFilter MTP_inputMessagesFilterPhotoVideoDocuments() { inline MTPmessagesFilter MTP_inputMessagesFilterDocument() { return MTPmessagesFilter(mtpc_inputMessagesFilterDocument); } -inline MTPmessagesFilter MTP_inputMessagesFilterAudio() { - return MTPmessagesFilter(mtpc_inputMessagesFilterAudio); -} -inline MTPmessagesFilter MTP_inputMessagesFilterAudioDocuments() { - return MTPmessagesFilter(mtpc_inputMessagesFilterAudioDocuments); -} inline MTPmessagesFilter MTP_inputMessagesFilterUrl() { return MTPmessagesFilter(mtpc_inputMessagesFilterUrl); } inline MTPmessagesFilter MTP_inputMessagesFilterGif() { return MTPmessagesFilter(mtpc_inputMessagesFilterGif); } +inline MTPmessagesFilter MTP_inputMessagesFilterVoice() { + return MTPmessagesFilter(mtpc_inputMessagesFilterVoice); +} +inline MTPmessagesFilter MTP_inputMessagesFilterMusic() { + return MTPmessagesFilter(mtpc_inputMessagesFilterMusic); +} inline uint32 MTPupdate::innerLength() const { switch (_type) { @@ -25975,6 +25558,10 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateBotInlineQuery &v(c_updateBotInlineQuery()); return v.vquery_id.innerLength() + v.vuser_id.innerLength() + v.vquery.innerLength() + v.voffset.innerLength(); } + case mtpc_updateBotInlineSend: { + const MTPDupdateBotInlineSend &v(c_updateBotInlineSend()); + return v.vuser_id.innerLength() + v.vquery.innerLength() + v.vid.innerLength(); + } } return 0; } @@ -26252,6 +25839,13 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vquery.read(from, end); v.voffset.read(from, end); } break; + case mtpc_updateBotInlineSend: _type = cons; { + if (!data) setData(new MTPDupdateBotInlineSend()); + MTPDupdateBotInlineSend &v(_updateBotInlineSend()); + v.vuser_id.read(from, end); + v.vquery.read(from, end); + v.vid.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPupdate"); } } @@ -26482,6 +26076,12 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vquery.write(to); v.voffset.write(to); } break; + case mtpc_updateBotInlineSend: { + const MTPDupdateBotInlineSend &v(c_updateBotInlineSend()); + v.vuser_id.write(to); + v.vquery.write(to); + v.vid.write(to); + } break; } } inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -26528,6 +26128,7 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateStickerSets: break; case mtpc_updateSavedGifs: break; case mtpc_updateBotInlineQuery: setData(new MTPDupdateBotInlineQuery()); break; + case mtpc_updateBotInlineSend: setData(new MTPDupdateBotInlineSend()); break; default: throw mtpErrorBadTypeId(type, "MTPupdate"); } } @@ -26611,6 +26212,8 @@ inline MTPupdate::MTPupdate(MTPDupdateStickerSetsOrder *_data) : mtpDataOwner(_d } inline MTPupdate::MTPupdate(MTPDupdateBotInlineQuery *_data) : mtpDataOwner(_data), _type(mtpc_updateBotInlineQuery) { } +inline MTPupdate::MTPupdate(MTPDupdateBotInlineSend *_data) : mtpDataOwner(_data), _type(mtpc_updateBotInlineSend) { +} inline MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateNewMessage(_message, _pts, _pts_count)); } @@ -26737,6 +26340,9 @@ inline MTPupdate MTP_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)); } +inline MTPupdate MTP_updateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) { + return MTPupdate(new MTPDupdateBotInlineSend(_user_id, _query, _id)); +} inline MTPupdates_state::MTPupdates_state() : mtpDataOwner(new MTPDupdates_state()) { } @@ -27983,57 +27589,6 @@ inline MTPmessages_sentEncryptedMessage MTP_messages_sentEncryptedFile(MTPint _d return MTPmessages_sentEncryptedMessage(new MTPDmessages_sentEncryptedFile(_date, _file)); } -inline uint32 MTPinputAudio::innerLength() const { - switch (_type) { - case mtpc_inputAudio: { - const MTPDinputAudio &v(c_inputAudio()); - return v.vid.innerLength() + v.vaccess_hash.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPinputAudio::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPinputAudio::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_inputAudioEmpty: _type = cons; break; - case mtpc_inputAudio: _type = cons; { - if (!data) setData(new MTPDinputAudio()); - MTPDinputAudio &v(_inputAudio()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPinputAudio"); - } -} -inline void MTPinputAudio::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_inputAudio: { - const MTPDinputAudio &v(c_inputAudio()); - v.vid.write(to); - v.vaccess_hash.write(to); - } break; - } -} -inline MTPinputAudio::MTPinputAudio(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_inputAudioEmpty: break; - case mtpc_inputAudio: setData(new MTPDinputAudio()); break; - default: throw mtpErrorBadTypeId(type, "MTPinputAudio"); - } -} -inline MTPinputAudio::MTPinputAudio(MTPDinputAudio *_data) : mtpDataOwner(_data), _type(mtpc_inputAudio) { -} -inline MTPinputAudio MTP_inputAudioEmpty() { - return MTPinputAudio(mtpc_inputAudioEmpty); -} -inline MTPinputAudio MTP_inputAudio(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputAudio(new MTPDinputAudio(_id, _access_hash)); -} - inline uint32 MTPinputDocument::innerLength() const { switch (_type) { case mtpc_inputDocument: { @@ -28085,81 +27640,6 @@ inline MTPinputDocument MTP_inputDocument(const MTPlong &_id, const MTPlong &_ac return MTPinputDocument(new MTPDinputDocument(_id, _access_hash)); } -inline uint32 MTPaudio::innerLength() const { - switch (_type) { - case mtpc_audioEmpty: { - const MTPDaudioEmpty &v(c_audioEmpty()); - return v.vid.innerLength(); - } - case mtpc_audio: { - const MTPDaudio &v(c_audio()); - return v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vdate.innerLength() + v.vduration.innerLength() + v.vmime_type.innerLength() + v.vsize.innerLength() + v.vdc_id.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPaudio::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPaudio::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_audioEmpty: _type = cons; { - if (!data) setData(new MTPDaudioEmpty()); - MTPDaudioEmpty &v(_audioEmpty()); - v.vid.read(from, end); - } break; - case mtpc_audio: _type = cons; { - if (!data) setData(new MTPDaudio()); - MTPDaudio &v(_audio()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - v.vdate.read(from, end); - v.vduration.read(from, end); - v.vmime_type.read(from, end); - v.vsize.read(from, end); - v.vdc_id.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPaudio"); - } -} -inline void MTPaudio::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_audioEmpty: { - const MTPDaudioEmpty &v(c_audioEmpty()); - v.vid.write(to); - } break; - case mtpc_audio: { - const MTPDaudio &v(c_audio()); - v.vid.write(to); - v.vaccess_hash.write(to); - v.vdate.write(to); - v.vduration.write(to); - v.vmime_type.write(to); - v.vsize.write(to); - v.vdc_id.write(to); - } break; - } -} -inline MTPaudio::MTPaudio(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_audioEmpty: setData(new MTPDaudioEmpty()); break; - case mtpc_audio: setData(new MTPDaudio()); break; - default: throw mtpErrorBadTypeId(type, "MTPaudio"); - } -} -inline MTPaudio::MTPaudio(MTPDaudioEmpty *_data) : mtpDataOwner(_data), _type(mtpc_audioEmpty) { -} -inline MTPaudio::MTPaudio(MTPDaudio *_data) : mtpDataOwner(_data), _type(mtpc_audio) { -} -inline MTPaudio MTP_audioEmpty(const MTPlong &_id) { - return MTPaudio(new MTPDaudioEmpty(_id)); -} -inline MTPaudio MTP_audio(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _duration, const MTPstring &_mime_type, MTPint _size, MTPint _dc_id) { - return MTPaudio(new MTPDaudio(_id, _access_hash, _date, _duration, _mime_type, _size, _dc_id)); -} - inline uint32 MTPdocument::innerLength() const { switch (_type) { case mtpc_documentEmpty: { @@ -28491,28 +27971,64 @@ inline uint32 MTPinputPrivacyKey::innerLength() const { return 0; } inline mtpTypeId MTPinputPrivacyKey::type() const { - return mtpc_inputPrivacyKeyStatusTimestamp; + if (!_type) throw mtpErrorUninitialized(); + return _type; } inline void MTPinputPrivacyKey::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + switch (cons) { + case mtpc_inputPrivacyKeyStatusTimestamp: _type = cons; break; + case mtpc_inputPrivacyKeyChatInvite: _type = cons; break; + default: throw mtpErrorUnexpected(cons, "MTPinputPrivacyKey"); + } } inline void MTPinputPrivacyKey::write(mtpBuffer &to) const { + switch (_type) { + } +} +inline MTPinputPrivacyKey::MTPinputPrivacyKey(mtpTypeId type) : _type(type) { + switch (type) { + case mtpc_inputPrivacyKeyStatusTimestamp: break; + case mtpc_inputPrivacyKeyChatInvite: break; + default: throw mtpErrorBadTypeId(type, "MTPinputPrivacyKey"); + } } inline MTPinputPrivacyKey MTP_inputPrivacyKeyStatusTimestamp() { - return MTPinputPrivacyKey(); + return MTPinputPrivacyKey(mtpc_inputPrivacyKeyStatusTimestamp); +} +inline MTPinputPrivacyKey MTP_inputPrivacyKeyChatInvite() { + return MTPinputPrivacyKey(mtpc_inputPrivacyKeyChatInvite); } inline uint32 MTPprivacyKey::innerLength() const { return 0; } inline mtpTypeId MTPprivacyKey::type() const { - return mtpc_privacyKeyStatusTimestamp; + if (!_type) throw mtpErrorUninitialized(); + return _type; } inline void MTPprivacyKey::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + switch (cons) { + case mtpc_privacyKeyStatusTimestamp: _type = cons; break; + case mtpc_privacyKeyChatInvite: _type = cons; break; + default: throw mtpErrorUnexpected(cons, "MTPprivacyKey"); + } } inline void MTPprivacyKey::write(mtpBuffer &to) const { + switch (_type) { + } +} +inline MTPprivacyKey::MTPprivacyKey(mtpTypeId type) : _type(type) { + switch (type) { + case mtpc_privacyKeyStatusTimestamp: break; + case mtpc_privacyKeyChatInvite: break; + default: throw mtpErrorBadTypeId(type, "MTPprivacyKey"); + } } inline MTPprivacyKey MTP_privacyKeyStatusTimestamp() { - return MTPprivacyKey(); + return MTPprivacyKey(mtpc_privacyKeyStatusTimestamp); +} +inline MTPprivacyKey MTP_privacyKeyChatInvite() { + return MTPprivacyKey(mtpc_privacyKeyChatInvite); } inline uint32 MTPinputPrivacyRule::innerLength() const { @@ -28782,7 +28298,7 @@ inline uint32 MTPdocumentAttribute::innerLength() const { } case mtpc_documentAttributeAudio: { const MTPDdocumentAttributeAudio &v(c_documentAttributeAudio()); - return v.vduration.innerLength() + v.vtitle.innerLength() + v.vperformer.innerLength(); + return v.vflags.innerLength() + v.vduration.innerLength() + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_performer() ? v.vperformer.innerLength() : 0) + (v.has_waveform() ? v.vwaveform.innerLength() : 0); } case mtpc_documentAttributeFilename: { const MTPDdocumentAttributeFilename &v(c_documentAttributeFilename()); @@ -28821,9 +28337,11 @@ inline void MTPdocumentAttribute::read(const mtpPrime *&from, const mtpPrime *en case mtpc_documentAttributeAudio: _type = cons; { if (!data) setData(new MTPDdocumentAttributeAudio()); MTPDdocumentAttributeAudio &v(_documentAttributeAudio()); + v.vflags.read(from, end); v.vduration.read(from, end); - v.vtitle.read(from, end); - v.vperformer.read(from, end); + if (v.has_title()) { v.vtitle.read(from, end); } else { v.vtitle = MTPstring(); } + if (v.has_performer()) { v.vperformer.read(from, end); } else { v.vperformer = MTPstring(); } + if (v.has_waveform()) { v.vwaveform.read(from, end); } else { v.vwaveform = MTPbytes(); } } break; case mtpc_documentAttributeFilename: _type = cons; { if (!data) setData(new MTPDdocumentAttributeFilename()); @@ -28853,9 +28371,11 @@ inline void MTPdocumentAttribute::write(mtpBuffer &to) const { } break; case mtpc_documentAttributeAudio: { const MTPDdocumentAttributeAudio &v(c_documentAttributeAudio()); + v.vflags.write(to); v.vduration.write(to); - v.vtitle.write(to); - v.vperformer.write(to); + if (v.has_title()) v.vtitle.write(to); + if (v.has_performer()) v.vperformer.write(to); + if (v.has_waveform()) v.vwaveform.write(to); } break; case mtpc_documentAttributeFilename: { const MTPDdocumentAttributeFilename &v(c_documentAttributeFilename()); @@ -28896,8 +28416,8 @@ inline MTPdocumentAttribute MTP_documentAttributeSticker(const MTPstring &_alt, inline MTPdocumentAttribute MTP_documentAttributeVideo(MTPint _duration, MTPint _w, MTPint _h) { return MTPdocumentAttribute(new MTPDdocumentAttributeVideo(_duration, _w, _h)); } -inline MTPdocumentAttribute MTP_documentAttributeAudio(MTPint _duration, const MTPstring &_title, const MTPstring &_performer) { - return MTPdocumentAttribute(new MTPDdocumentAttributeAudio(_duration, _title, _performer)); +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)); } inline MTPdocumentAttribute MTP_documentAttributeFilename(const MTPstring &_file_name) { return MTPdocumentAttribute(new MTPDdocumentAttributeFilename(_file_name)); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 64bfa2eaa8..d8c3c7bb9a 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -153,8 +153,6 @@ inputMediaContact#a6e45987 phone_number:string first_name:string last_name:strin inputMediaUploadedVideo#82713fdf file:InputFile duration:int w:int h:int mime_type:string caption:string = InputMedia; inputMediaUploadedThumbVideo#7780ddf9 file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string caption:string = InputMedia; inputMediaVideo#936a4ebd id:InputVideo caption:string = InputMedia; -inputMediaUploadedAudio#4e498cab file:InputFile duration:int mime_type:string = InputMedia; -inputMediaAudio#89938781 id:InputAudio = InputMedia; inputMediaUploadedDocument#1d89306d file:InputFile mime_type:string attributes:Vector caption:string = InputMedia; inputMediaUploadedThumbDocument#ad613491 file:InputFile thumb:InputFile mime_type:string attributes:Vector caption:string = InputMedia; inputMediaDocument#1a77f29c id:InputDocument caption:string = InputMedia; @@ -177,7 +175,6 @@ inputVideo#ee579652 id:long access_hash:long = InputVideo; inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation; inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation; inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation; -inputAudioFileLocation#74dc404d id:long access_hash:long = InputFileLocation; inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation; inputPhotoCropAuto#ade6b004 = InputPhotoCrop; @@ -219,7 +216,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat; chatForbidden#7328bdb id:int title:string = Chat; -channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; +channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true invites_enabled:flags.10?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; @@ -246,7 +243,6 @@ messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia; messageMediaUnsupported#9f84f49e = MessageMedia; messageMediaDocument#f3e02ea8 document:Document caption:string = MessageMedia; -messageMediaAudio#c6b68300 audio:Audio = MessageMedia; messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; messageMediaVenue#7912b71f geo:GeoPoint title:string address:string provider:string venue_id:string = MessageMedia; @@ -319,8 +315,6 @@ importedContact#d0028438 user_id:int client_id:long = ImportedContact; contactBlocked#561bc879 user_id:int date:int = ContactBlocked; -contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested; - contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus; contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link; @@ -333,8 +327,6 @@ contacts.importedContacts#ad524315 imported:Vector retry_contac contacts.blocked#1c138d15 blocked:Vector users:Vector = contacts.Blocked; contacts.blockedSlice#900802a1 count:int blocked:Vector users:Vector = contacts.Blocked; -contacts.suggested#5649dcc5 results:Vector users:Vector = contacts.Suggested; - messages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; messages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; @@ -354,10 +346,10 @@ inputMessagesFilterVideo#9fc00e65 = MessagesFilter; inputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter; inputMessagesFilterPhotoVideoDocuments#d95e73bb = MessagesFilter; inputMessagesFilterDocument#9eddf188 = MessagesFilter; -inputMessagesFilterAudio#cfc87522 = MessagesFilter; -inputMessagesFilterAudioDocuments#5afbf764 = MessagesFilter; inputMessagesFilterUrl#7ef0dd87 = MessagesFilter; inputMessagesFilterGif#ffc86587 = MessagesFilter; +inputMessagesFilterVoice#50f5c392 = MessagesFilter; +inputMessagesFilterMusic#3751b49e = MessagesFilter; updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update; updateMessageID#4e90bfd6 id:int random_id:long = Update; @@ -401,6 +393,7 @@ updateStickerSetsOrder#f0dfb451 order:Vector = Update; updateStickerSets#43ae3dec = Update; updateSavedGifs#9375341e = Update; updateBotInlineQuery#c01eea08 query_id:long user_id:int query:string offset:string = Update; +updateBotInlineSend#f69e113 user_id:int query:string id:string = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -459,15 +452,9 @@ messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhC messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage; messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage; -inputAudioEmpty#d95adc84 = InputAudio; -inputAudio#77d440ff id:long access_hash:long = InputAudio; - inputDocumentEmpty#72f0eaae = InputDocument; inputDocument#18798952 id:long access_hash:long = InputDocument; -audioEmpty#586988d8 id:long = Audio; -audio#f9e35055 id:long access_hash:long date:int duration:int mime_type:string size:int dc_id:int = Audio; - documentEmpty#36f8c871 id:long = Document; document#f9a39f4f id:long access_hash:long date:int mime_type:string size:int thumb:PhotoSize dc_id:int attributes:Vector = Document; @@ -492,8 +479,10 @@ sendMessageChooseContactAction#628cbc6f = SendMessageAction; contacts.found#1aa1f784 results:Vector chats:Vector users:Vector = contacts.Found; inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey; +inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey; privacyKeyStatusTimestamp#bc2eab30 = PrivacyKey; +privacyKeyChatInvite#500e6dfa = PrivacyKey; inputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule; inputPrivacyValueAllowAll#184b35ce = InputPrivacyRule; @@ -519,7 +508,7 @@ documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute; documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute; -documentAttributeAudio#ded218e0 duration:int title:string performer:string = DocumentAttribute; +documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute; documentAttributeFilename#15590068 file_name:string = DocumentAttribute; messages.stickersNotModified#f1749a22 = messages.Stickers; @@ -552,7 +541,7 @@ account.password#7c18141c current_salt:bytes new_salt:bytes hint:string has_reco account.passwordSettings#b7b72ab3 email:string = account.PasswordSettings; -account.passwordInputSettings#bcfc532c flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings; +account.passwordInputSettings#86916deb flags:# new_salt:flags.0?bytes new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string = account.PasswordInputSettings; auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery; @@ -717,7 +706,6 @@ users.getFullUser#ca30a5b1 id:InputUser = UserFull; contacts.getStatuses#c4a353ee = Vector; contacts.getContacts#22c6aa08 hash:string = contacts.Contacts; contacts.importContacts#da30b32d contacts:Vector replace:Bool = contacts.ImportedContacts; -contacts.getSuggested#cd773428 limit:int = contacts.Suggested; contacts.deleteContact#8e953744 id:InputUser = contacts.Link; contacts.deleteContacts#59ab389e id:Vector = Bool; contacts.block#332b49fc id:InputUser = Bool; @@ -730,7 +718,7 @@ contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer; messages.getMessages#4222fa74 id:Vector = messages.Messages; messages.getDialogs#6b47f94d offset_date:int offset_id:int offset_peer:InputPeer limit:int = messages.Dialogs; -messages.getHistory#8a8ec2da peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.getHistory#afa92846 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; messages.search#d4569248 flags:# important_only:flags.0?true peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages; messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages; messages.deleteHistory#b7c13bd9 peer:InputPeer max_id:int = messages.AffectedHistory; @@ -808,7 +796,7 @@ help.getAppChangelog#5bab7fb2 device_model:string system_version:string app_vers help.getTermsOfService#37d78f83 lang_code:string = help.TermsOfService; channels.getDialogs#a9d3d249 offset:int limit:int = messages.Dialogs; -channels.getImportantHistory#ddb929cb channel:InputChannel offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +channels.getImportantHistory#8f494bb2 channel:InputChannel offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages; channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory; @@ -832,3 +820,4 @@ channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = channels.kickFromChannel#a672de14 channel:InputChannel user_id:InputUser kicked:Bool = Updates; channels.exportInvite#c7560885 channel:InputChannel = ExportedChatInvite; channels.deleteChannel#c0111fe3 channel:InputChannel = Updates; +channels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 0c9c0698ba..84905568bb 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -39,7 +39,7 @@ OverviewInner::OverviewInner(OverviewWidget *overview, ScrollArea *scroll, PeerD , _resizeSkip(0) , _peer(peer->migrateTo() ? peer->migrateTo() : peer) , _type(type) -, _reversed(_type != OverviewDocuments && _type != OverviewLinks) +, _reversed(_type != OverviewFiles && _type != OverviewLinks) , _migrated(_peer->migrateFrom() ? App::history(_peer->migrateFrom()->id) : 0) , _history(App::history(_peer->id)) , _channel(peerToChannel(_peer->id)) @@ -108,7 +108,7 @@ OverviewInner::OverviewInner(OverviewWidget *overview, ScrollArea *scroll, PeerD connect(&_searchTimer, SIGNAL(timeout()), this, SLOT(onSearchMessages())); _cancelSearch.hide(); - if (_type == OverviewLinks || _type == OverviewDocuments) { + if (_type == OverviewLinks || _type == OverviewFiles) { _search.show(); } else { _search.hide(); @@ -735,7 +735,7 @@ QPoint OverviewInner::mapMouseToItem(QPoint p, MsgId itemId, int32 itemIndex) { } void OverviewInner::activate() { - if (_type == OverviewLinks || _type == OverviewDocuments) { + if (_type == OverviewLinks || _type == OverviewFiles) { _search.setFocus(); } else { setFocus(); @@ -759,7 +759,7 @@ void OverviewInner::clear() { } int32 OverviewInner::itemTop(const FullMsgId &msgId) const { - if (_type == OverviewAudioDocuments) { + if (_type == OverviewMusicFiles) { int32 itemIndex = -1; fixItemIndex(itemIndex, (msgId.channel == _channel) ? msgId.msg : ((_migrated && msgId.channel == _migrated->channelId()) ? -msgId.msg : 0)); if (itemIndex >= 0) { @@ -1261,9 +1261,9 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _contextMenuLnk = textlnkOver(); PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkPhoto || lnkVideo || lnkAudio || lnkDocument) { + bool lnkIsAudio = lnkDocument ? lnkDocument->document()->voice() : false; + if (lnkPhoto || lnkVideo || lnkDocument) { _menu = new PopupMenu(); if (App::hoveredLinkItem()) { _menu->addAction(lang(lng_context_to_msg), this, SLOT(goToMessage()))->setEnabled(true); @@ -1271,14 +1271,14 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkPhoto) { _menu->addAction(lang(lng_context_open_image), this, SLOT(openContextUrl()))->setEnabled(true); } else { - if ((lnkVideo && lnkVideo->video()->loading()) || (lnkAudio && lnkAudio->audio()->loading()) || (lnkDocument && lnkDocument->document()->loading())) { + if ((lnkVideo && lnkVideo->video()->loading()) || (lnkDocument && lnkDocument->document()->loading())) { _menu->addAction(lang(lng_context_cancel_download), this, SLOT(cancelContextDownload()))->setEnabled(true); } else { - if ((lnkVideo && !lnkVideo->video()->already(true).isEmpty()) || (lnkAudio && !lnkAudio->audio()->already(true).isEmpty()) || (lnkDocument && !lnkDocument->document()->already(true).isEmpty())) { + if ((lnkVideo && !lnkVideo->video()->already(true).isEmpty()) || (lnkDocument && !lnkDocument->document()->already(true).isEmpty())) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkVideo ? lng_context_open_video : (lnkAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); - _menu->addAction(lang(lnkVideo ? lng_context_save_video : (lnkAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); } } if (isUponSelected > 1) { @@ -1420,8 +1420,8 @@ void OverviewInner::switchType(MediaOverviewType type) { if (_type != type) { clear(); _type = type; - _reversed = (_type != OverviewLinks && _type != OverviewDocuments); - if (_type == OverviewLinks || _type == OverviewDocuments) { + _reversed = (_type != OverviewLinks && _type != OverviewFiles); + if (_type == OverviewLinks || _type == OverviewFiles) { _search.show(); } else { _search.hide(); @@ -1502,12 +1502,9 @@ void OverviewInner::selectMessage() { void OverviewInner::cancelContextDownload() { VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); if (lnkVideo) { lnkVideo->video()->cancel(); - } else if (lnkAudio) { - lnkAudio->audio()->cancel(); } else if (lnkDocument) { lnkDocument->document()->cancel(); } @@ -1515,18 +1512,15 @@ void OverviewInner::cancelContextDownload() { void OverviewInner::showContextInFolder() { VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - QString already = lnkVideo ? lnkVideo->video()->already(true) : (lnkAudio ? lnkAudio->audio()->already(true) : (lnkDocument ? lnkDocument->document()->already(true) : QString())); + QString already = lnkVideo ? lnkVideo->video()->already(true) : (lnkDocument ? lnkDocument->document()->already(true) : QString()); if (!already.isEmpty()) psShowInFolder(already); } void OverviewInner::saveContextFile() { VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); if (lnkVideo) VideoSaveLink::doSave(lnkVideo->video(), true); - if (lnkAudio) AudioSaveLink::doSave(lnkAudio->audio(), true); if (lnkDocument) DocumentSaveLink::doSave(lnkDocument->document(), true); } @@ -1534,10 +1528,8 @@ void OverviewInner::openContextFile() { HistoryItem *was = App::hoveredLinkItem(); App::hoveredLinkItem(App::contextItem()); VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); - AudioLink *lnkAudio = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); if (lnkVideo) VideoOpenLink(lnkVideo->video()).onClick(Qt::LeftButton); - if (lnkAudio) AudioOpenLink(lnkAudio->audio()).onClick(Qt::LeftButton); if (lnkDocument) DocumentOpenLink(lnkDocument->document()).onClick(Qt::LeftButton); App::hoveredLinkItem(was); } @@ -1581,7 +1573,7 @@ void OverviewInner::onNeedSearchMessages() { } void OverviewInner::onSearchUpdate() { - QString filterText = (_type == OverviewLinks || _type == OverviewDocuments) ? _search.text().trimmed() : QString(); + QString filterText = (_type == OverviewLinks || _type == OverviewFiles) ? _search.text().trimmed() : QString(); bool inSearch = !filterText.isEmpty(), changed = (inSearch != _inSearch); _inSearch = inSearch; @@ -1729,7 +1721,7 @@ void OverviewInner::mediaOverviewUpdated() { _height = countHeight(); } else { - bool dateEveryMonth = (_type == OverviewDocuments), dateEveryDay = (_type == OverviewLinks); + bool dateEveryMonth = (_type == OverviewFiles), dateEveryDay = (_type == OverviewLinks); bool withDates = (dateEveryMonth || dateEveryDay); History::MediaOverview &o(_history->overview[_type]), *migratedOverview = _migrated ? &_migrated->overview[_type] : 0; @@ -1793,7 +1785,7 @@ void OverviewInner::mediaOverviewUpdated() { int32 newHeight = _marginTop + _height + _marginBottom, deltaHeight = newHeight - height(); if (deltaHeight) { resize(_width, newHeight); - if (_type != OverviewLinks && _type != OverviewDocuments) { + if (_type != OverviewLinks && _type != OverviewFiles) { _overview->scrollBy(deltaHeight); } } else { @@ -1909,10 +1901,10 @@ void OverviewInner::recountMargins() { if (_type == OverviewPhotos || _type == OverviewVideos) { _marginBottom = 0; _marginTop = qMax(_minHeight - _height - _marginBottom, 0); - } else if (_type == OverviewAudioDocuments) { + } else if (_type == OverviewMusicFiles) { _marginTop = st::playlistPadding; _marginBottom = qMax(_minHeight - _height - _marginTop, int32(st::playlistPadding)); - } else if (_type == OverviewLinks || _type == OverviewDocuments) { + } else if (_type == OverviewLinks || _type == OverviewFiles) { _marginTop = st::linksSearchMargin.top() + _search.height() + st::linksSearchMargin.bottom(); _marginBottom = qMax(_minHeight - _height - _marginTop, int32(st::playlistPadding)); } else { @@ -1940,15 +1932,15 @@ LayoutMediaItem *OverviewInner::layoutPrepare(HistoryItem *item) { i.value()->initDimensions(); } } - } else if (_type == OverviewAudios) { - if (media && media->type() == MediaTypeAudio) { + } else if (_type == OverviewVoiceFiles) { + if (media && (media->type() == MediaTypeVoiceFile)) { if ((i = _layoutItems.constFind(item)) == _layoutItems.cend()) { - i = _layoutItems.insert(item, new LayoutOverviewAudio(static_cast(media)->audio(), item)); + i = _layoutItems.insert(item, new LayoutOverviewVoice(media->getDocument(), item)); i.value()->initDimensions(); } } - } else if (_type == OverviewDocuments || _type == OverviewAudioDocuments) { - if (media && (media->type() == MediaTypeDocument || media->type() == MediaTypeGif)) { + } else if (_type == OverviewFiles || _type == OverviewMusicFiles) { + if (media && (media->type() == MediaTypeFile || media->type() == MediaTypeMusicFile || media->type() == MediaTypeGif)) { if ((i = _layoutItems.constFind(item)) == _layoutItems.cend()) { i = _layoutItems.insert(item, new LayoutOverviewDocument(media->getDocument(), item)); i.value()->initDimensions(); @@ -2032,7 +2024,7 @@ void OverviewWidget::onScroll() { int32 preloadThreshold = _scroll.height() * 5; bool needToPreload = false; do { - needToPreload = (type() == OverviewLinks || type() == OverviewDocuments) ? (_scroll.scrollTop() + preloadThreshold > _scroll.scrollTopMax()) : (_scroll.scrollTop() < preloadThreshold); + needToPreload = (type() == OverviewLinks || type() == OverviewFiles) ? (_scroll.scrollTop() + preloadThreshold > _scroll.scrollTopMax()) : (_scroll.scrollTop() < preloadThreshold); if (!needToPreload || !_inner.preloadLocal()) { break; } @@ -2097,7 +2089,7 @@ void OverviewWidget::scrollBy(int32 add) { } void OverviewWidget::scrollReset() { - _scroll.scrollToY((type() == OverviewLinks || type() == OverviewDocuments) ? 0 : _scroll.scrollTopMax()); + _scroll.scrollToY((type() == OverviewLinks || type() == OverviewFiles) ? 0 : _scroll.scrollTopMax()); } void OverviewWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) { @@ -2142,9 +2134,9 @@ void OverviewWidget::switchType(MediaOverviewType type) { switch (type) { case OverviewPhotos: _header = lang(lng_profile_photos_header); break; case OverviewVideos: _header = lang(lng_profile_videos_header); break; - case OverviewAudioDocuments: _header = lang(lng_profile_songs_header); break; - case OverviewDocuments: _header = lang(lng_profile_files_header); break; - case OverviewAudios: _header = lang(lng_profile_audios_header); break; + case OverviewMusicFiles: _header = lang(lng_profile_songs_header); break; + case OverviewFiles: _header = lang(lng_profile_files_header); break; + case OverviewVoiceFiles: _header = lang(lng_profile_audios_header); break; case OverviewLinks: _header = lang(lng_profile_shared_links_header); break; } noSelectingScroll(); @@ -2183,7 +2175,7 @@ int32 OverviewWidget::lastScrollTop() const { } int32 OverviewWidget::countBestScroll() const { - if (type() == OverviewAudioDocuments && audioPlayer()) { + if (type() == OverviewMusicFiles && audioPlayer()) { SongMsgId playing; AudioPlayerState playingState = AudioPlayerStopped; audioPlayer()->currentState(&playing, &playingState); @@ -2193,7 +2185,7 @@ int32 OverviewWidget::countBestScroll() const { return snap(top - int(_scroll.height() - (st::msgPadding.top() + st::mediaThumbSize + st::msgPadding.bottom())) / 2, 0, _scroll.scrollTopMax()); } } - } else if (type() == OverviewLinks || type() == OverviewDocuments) { + } else if (type() == OverviewLinks || type() == OverviewFiles) { return 0; } return _scroll.scrollTopMax(); @@ -2350,7 +2342,7 @@ void OverviewWidget::onScrollTimer() { } void OverviewWidget::onPlayerSongChanged(const FullMsgId &msgId) { - if (type() == OverviewAudioDocuments) { + if (type() == OverviewMusicFiles) { // int32 top = _inner.itemTop(msgId); // if (top > 0) { // _scroll.scrollToY(snap(top - int(_scroll.height() - (st::msgPadding.top() + st::mediaThumbSize + st::msgPadding.bottom())) / 2, 0, _scroll.scrollTopMax())); diff --git a/Telegram/SourceFiles/playerwidget.cpp b/Telegram/SourceFiles/playerwidget.cpp index 7fdaa1b6dd..1ab72f6c51 100644 --- a/Telegram/SourceFiles/playerwidget.cpp +++ b/Telegram/SourceFiles/playerwidget.cpp @@ -198,7 +198,7 @@ void PlayerWidget::mousePressEvent(QMouseEvent *e) { audioPlayer()->currentState(&playing, &playingState, &playingPosition, &playingDuration, &playingFrequency); if (playing == _song && playingDuration) { if (playingState == AudioPlayerPlaying || playingState == AudioPlayerStarting || playingState == AudioPlayerResuming) { - audioPlayer()->pauseresume(OverviewDocuments); + audioPlayer()->pauseresume(OverviewFiles); } _down = OverPlayback; _downProgress = snap((pos.x() - _playbackRect.x()) / float64(_playbackRect.width()), 0., 1.); @@ -210,7 +210,7 @@ void PlayerWidget::mousePressEvent(QMouseEvent *e) { } } else if (_over == OverFull && _song) { if (HistoryItem *item = App::histItemById(_song.msgId)) { - App::main()->showMediaOverview(item->history()->peer, OverviewAudioDocuments); + App::main()->showMediaOverview(item->history()->peer, OverviewMusicFiles); } } else if (_over == OverRepeat) { _repeat = !_repeat; @@ -269,23 +269,23 @@ void PlayerWidget::updateControls() { _fullAvailable = (_index >= 0); History *history = _msgmigrated ? _migrated : _history; - _prevAvailable = _fullAvailable && ((_index > 0) || (_index == 0 && _migrated && !_msgmigrated && !_migrated->overview[OverviewAudioDocuments].isEmpty())); - _nextAvailable = _fullAvailable && ((_index < history->overview[OverviewAudioDocuments].size() - 1) || (_msgmigrated && _index == _migrated->overview[OverviewAudioDocuments].size() - 1 && _history->overviewLoaded(OverviewAudioDocuments) && _history->overviewCount(OverviewAudioDocuments) > 0)); + _prevAvailable = _fullAvailable && ((_index > 0) || (_index == 0 && _migrated && !_msgmigrated && !_migrated->overview[OverviewMusicFiles].isEmpty())); + _nextAvailable = _fullAvailable && ((_index < history->overview[OverviewMusicFiles].size() - 1) || (_msgmigrated && _index == _migrated->overview[OverviewMusicFiles].size() - 1 && _history->overviewLoaded(OverviewMusicFiles) && _history->overviewCount(OverviewMusicFiles) > 0)); resizeEvent(0); update(); if (_index >= 0 && _index < MediaOverviewStartPerPage) { - if (!_history->overviewLoaded(OverviewAudioDocuments) || (_migrated && !_migrated->overviewLoaded(OverviewAudioDocuments))) { + if (!_history->overviewLoaded(OverviewMusicFiles) || (_migrated && !_migrated->overviewLoaded(OverviewMusicFiles))) { if (App::main()) { - if (_msgmigrated || (_migrated && _index == 0 && _history->overviewLoaded(OverviewAudioDocuments))) { - App::main()->loadMediaBack(_migrated->peer, OverviewAudioDocuments); + if (_msgmigrated || (_migrated && _index == 0 && _history->overviewLoaded(OverviewMusicFiles))) { + App::main()->loadMediaBack(_migrated->peer, OverviewMusicFiles); } else { - App::main()->loadMediaBack(_history->peer, OverviewAudioDocuments); - if (_migrated && _index == 0 && _migrated->overview[OverviewAudioDocuments].isEmpty() && !_migrated->overviewLoaded(OverviewAudioDocuments)) { - App::main()->loadMediaBack(_migrated->peer, OverviewAudioDocuments); + App::main()->loadMediaBack(_history->peer, OverviewMusicFiles); + if (_migrated && _index == 0 && _migrated->overview[OverviewMusicFiles].isEmpty() && !_migrated->overviewLoaded(OverviewMusicFiles)) { + App::main()->loadMediaBack(_migrated->peer, OverviewMusicFiles); } } - if (_msgmigrated && !_history->overviewCountLoaded(OverviewAudioDocuments)) { - App::main()->preloadOverview(_history->peer, OverviewAudioDocuments); + if (_msgmigrated && !_history->overviewCountLoaded(OverviewMusicFiles)) { + App::main()->preloadOverview(_history->peer, OverviewMusicFiles); } } } @@ -296,7 +296,7 @@ void PlayerWidget::findCurrent() { _index = -1; if (!_history) return; - const History::MediaOverview *o = &(_msgmigrated ? _migrated : _history)->overview[OverviewAudioDocuments]; + const History::MediaOverview *o = &(_msgmigrated ? _migrated : _history)->overview[OverviewMusicFiles]; if ((_msgmigrated ? _migrated : _history)->channelId() == _song.msgId.channel) { for (int i = 0, l = o->size(); i < l; ++i) { if (o->at(i) == _song.msgId.msg) { @@ -312,14 +312,14 @@ void PlayerWidget::preloadNext() { if (_index < 0) return; History *history = _msgmigrated ? _migrated : _history; - const History::MediaOverview *o = &history->overview[OverviewAudioDocuments]; + const History::MediaOverview *o = &history->overview[OverviewMusicFiles]; HistoryItem *next = 0; if (_index < o->size() - 1) { next = App::histItemById(history->channelId(), o->at(_index + 1)); - } else if (_msgmigrated && _index == o->size() - 1 && _history->overviewLoaded(OverviewAudioDocuments) && _history->overviewCount(OverviewAudioDocuments) > 0) { - next = App::histItemById(_history->channelId(), _history->overview[OverviewAudioDocuments].at(0)); - } else if (_msgmigrated && _index == o->size() - 1 && !_history->overviewCountLoaded(OverviewAudioDocuments)) { - if (App::main()) App::main()->preloadOverview(_history->peer, OverviewAudioDocuments); + } else if (_msgmigrated && _index == o->size() - 1 && _history->overviewLoaded(OverviewMusicFiles) && _history->overviewCount(OverviewMusicFiles) > 0) { + next = App::histItemById(_history->channelId(), _history->overview[OverviewMusicFiles].at(0)); + } else if (_msgmigrated && _index == o->size() - 1 && !_history->overviewCountLoaded(OverviewMusicFiles)) { + if (App::main()) App::main()->preloadOverview(_history->peer, OverviewMusicFiles); } if (next) { if (HistoryDocument *document = static_cast(next->getMedia())) { @@ -348,12 +348,12 @@ void PlayerWidget::clearSelection() { } void PlayerWidget::mediaOverviewUpdated(PeerData *peer, MediaOverviewType type) { - if (_history && (_history->peer == peer || (_migrated && _migrated->peer == peer)) && type == OverviewAudioDocuments) { + if (_history && (_history->peer == peer || (_migrated && _migrated->peer == peer)) && type == OverviewMusicFiles) { _index = -1; History *history = _msgmigrated ? _migrated : _history; if (history->channelId() == _song.msgId.channel) { - for (int i = 0, l = history->overview[OverviewAudioDocuments].size(); i < l; ++i) { - if (history->overview[OverviewAudioDocuments].at(i) == _song.msgId.msg) { + for (int i = 0, l = history->overview[OverviewMusicFiles].size(); i < l; ++i) { + if (history->overview[OverviewMusicFiles].at(i) == _song.msgId.msg) { _index = i; preloadNext(); break; @@ -476,7 +476,7 @@ void PlayerWidget::playPressed() { audioPlayer()->currentState(&playing, &playingState); if (playing == _song && !(playingState & AudioPlayerStoppedMask)) { if (playingState == AudioPlayerPausing || playingState == AudioPlayerPaused || playingState == AudioPlayerPausedAtEnd) { - audioPlayer()->pauseresume(OverviewDocuments); + audioPlayer()->pauseresume(OverviewFiles); } } else { audioPlayer()->play(_song); @@ -492,7 +492,7 @@ void PlayerWidget::pausePressed() { audioPlayer()->currentState(&playing, &playingState); if (playing == _song && !(playingState & AudioPlayerStoppedMask)) { if (playingState == AudioPlayerStarting || playingState == AudioPlayerResuming || playingState == AudioPlayerPlaying || playingState == AudioPlayerFinishing) { - audioPlayer()->pauseresume(OverviewDocuments); + audioPlayer()->pauseresume(OverviewFiles); } } } @@ -504,7 +504,7 @@ void PlayerWidget::playPausePressed() { AudioPlayerState playingState = AudioPlayerStopped; audioPlayer()->currentState(&playing, &playingState); if (playing == _song && !(playingState & AudioPlayerStoppedMask)) { - audioPlayer()->pauseresume(OverviewDocuments); + audioPlayer()->pauseresume(OverviewFiles); } else { audioPlayer()->play(_song); if (App::main()) App::main()->documentPlayProgress(_song); @@ -515,11 +515,11 @@ void PlayerWidget::prevPressed() { if (isHidden()) return; History *history = _msgmigrated ? _migrated : _history; - const History::MediaOverview *o = history ? &history->overview[OverviewAudioDocuments] : 0; + const History::MediaOverview *o = history ? &history->overview[OverviewMusicFiles] : 0; if (audioPlayer() && o && _index > 0 && _index <= o->size() && !o->isEmpty()) { startPlay(FullMsgId(history->channelId(), o->at(_index - 1))); } else if (!_index && _history && _migrated && !_msgmigrated) { - o = &_migrated->overview[OverviewAudioDocuments]; + o = &_migrated->overview[OverviewMusicFiles]; if (!o->isEmpty()) { startPlay(FullMsgId(_migrated->channelId(), o->at(o->size() - 1))); } @@ -530,11 +530,11 @@ void PlayerWidget::nextPressed() { if (isHidden()) return; History *history = _msgmigrated ? _migrated : _history; - const History::MediaOverview *o = history ? &history->overview[OverviewAudioDocuments] : 0; + const History::MediaOverview *o = history ? &history->overview[OverviewMusicFiles] : 0; if (audioPlayer() && o && _index >= 0 && _index < o->size() - 1) { startPlay(FullMsgId(history->channelId(), o->at(_index + 1))); - } else if (o && (_index == o->size() - 1) && _msgmigrated && _history->overviewLoaded(OverviewAudioDocuments)) { - o = &_history->overview[OverviewAudioDocuments]; + } else if (o && (_index == o->size() - 1) && _msgmigrated && _history->overviewLoaded(OverviewMusicFiles)) { + o = &_history->overview[OverviewMusicFiles]; if (!o->isEmpty()) { startPlay(FullMsgId(_history->channelId(), o->at(0))); } @@ -544,7 +544,7 @@ void PlayerWidget::nextPressed() { void PlayerWidget::stopPressed() { if (!_song || isHidden()) return; - audioPlayer()->stop(OverviewDocuments); + audioPlayer()->stop(OverviewFiles); if (App::main()) App::main()->hidePlayer(); } @@ -636,7 +636,7 @@ void PlayerWidget::updateState(SongMsgId playing, AudioPlayerState playingState, display = _song.song->song()->duration; } bool showPause = false, stopped = ((playingState & AudioPlayerStoppedMask) || playingState == AudioPlayerFinishing); - bool wasPlaying = !!_duration; + bool wasPlaying = (_duration != 0); if (!stopped) { showPause = (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting); } diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index a98dee9507..53df0dedfb 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -101,7 +101,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData , _kickOver(0) , _kickDown(0) , _kickConfirm(0) - + , _menu(0) { connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); @@ -209,9 +209,9 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData // shared media connect((_mediaButtons[OverviewPhotos] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaPhotos())); connect((_mediaButtons[OverviewVideos] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaVideos())); - connect((_mediaButtons[OverviewAudioDocuments] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaSongs())); - connect((_mediaButtons[OverviewDocuments] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaDocuments())); - connect((_mediaButtons[OverviewAudios] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaAudios())); + connect((_mediaButtons[OverviewMusicFiles] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaSongs())); + connect((_mediaButtons[OverviewFiles] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaDocuments())); + connect((_mediaButtons[OverviewVoiceFiles] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaAudios())); connect((_mediaButtons[OverviewLinks] = new LinkButton(this, QString())), SIGNAL(clicked()), this, SLOT(onMediaLinks())); updateMediaLinks(); @@ -261,7 +261,7 @@ void ProfileInner::loadProfilePhotos(int32 yFrom) { int32 yTo = yFrom + (parentWidget() ? parentWidget()->height() : App::wnd()->height()) * 5; MTP::clearLoaderPriorities(); - int32 partfrom = _mediaButtons[OverviewAudios]->y() + _mediaButtons[OverviewAudios]->height() + st::profileHeaderSkip; + int32 partfrom = _mediaButtons[OverviewVoiceFiles]->y() + _mediaButtons[OverviewVoiceFiles]->height() + st::profileHeaderSkip; yFrom -= partfrom; yTo -= partfrom; @@ -279,7 +279,7 @@ void ProfileInner::loadProfilePhotos(int32 yFrom) { void ProfileInner::onUpdatePhoto() { saveError(); - QStringList imgExtensions(cImgExtensions()); + QStringList imgExtensions(cImgExtensions()); QString filter(qsl("Image files (*") + imgExtensions.join(qsl(" *")) + qsl(");;All files (*.*)")); QImage img; @@ -440,15 +440,15 @@ void ProfileInner::onMediaVideos() { } void ProfileInner::onMediaSongs() { - App::main()->showMediaOverview(_peer, OverviewAudioDocuments); + App::main()->showMediaOverview(_peer, OverviewMusicFiles); } void ProfileInner::onMediaDocuments() { - App::main()->showMediaOverview(_peer, OverviewDocuments); + App::main()->showMediaOverview(_peer, OverviewFiles); } void ProfileInner::onMediaAudios() { - App::main()->showMediaOverview(_peer, OverviewAudios); + App::main()->showMediaOverview(_peer, OverviewVoiceFiles); } void ProfileInner::onMediaLinks() { @@ -464,7 +464,7 @@ void ProfileInner::onInvitationLink() { void ProfileInner::onPublicLink() { if (!_peerChannel) return; - + if (_peerChannel->isPublic()) { QApplication::clipboard()->setText(qsl("https://telegram.me/") + _peerChannel->username); Ui::showLayer(new InformBox(lang(lng_channel_public_link_copied))); @@ -776,7 +776,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { p.setOpacity(1); } } - + int32 namew = _width - st::profilePhotoSize - st::profileNameLeft; p.setPen(st::black->p); if (_peer->isVerified()) { @@ -1271,7 +1271,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { _left = (width() - _width) / 2; int32 top = 0, btnWidth = (_width - st::profileButtonSkip) / 2; - + // profile top += st::profilePadding.top(); int32 addbyname = 0; @@ -1446,7 +1446,7 @@ ProfileInner::~ProfileInner() { } _participantsData.clear(); } - + void ProfileInner::openContextImage() { } @@ -1711,9 +1711,9 @@ QString ProfileInner::overviewLinkText(int32 type, int32 count) { switch (type) { case OverviewPhotos: return lng_profile_photos(lt_count, count); case OverviewVideos: return lng_profile_videos(lt_count, count); - case OverviewAudioDocuments: return lng_profile_songs(lt_count, count); - case OverviewDocuments: return lng_profile_files(lt_count, count); - case OverviewAudios: return lng_profile_audios(lt_count, count); + case OverviewMusicFiles: return lng_profile_songs(lt_count, count); + case OverviewFiles: return lng_profile_files(lt_count, count); + case OverviewVoiceFiles: return lng_profile_audios(lt_count, count); case OverviewLinks: return lng_profile_shared_links(lt_count, count); } return QString(); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 274b34f29b..d396ebcb88 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -1013,97 +1013,6 @@ void VideoData::setLocation(const FileLocation &loc) { } } -void AudioOpenLink::onClick(Qt::MouseButton button) const { - if (button != Qt::LeftButton) return; - AudioData *data = audio(); - - if (!data->date) return; - - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - - bool play = audioPlayer() && item; - const FileLocation &location(data->location(true)); - if (!location.isEmpty() || (!data->data().isEmpty() && play)) { - if (play) { - AudioMsgId playing; - AudioPlayerState playingState = AudioPlayerStopped; - audioPlayer()->currentState(&playing, &playingState); - if (playing.msgId == item->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { - audioPlayer()->pauseresume(OverviewAudios); - } else { - AudioMsgId audio(data, item->fullId()); - audioPlayer()->play(audio); - if (App::main()) { - App::main()->audioPlayProgress(audio); - App::main()->audioMarkRead(data); - } - } - } else { - psOpenFile(location.name()); - if (App::main()) App::main()->audioMarkRead(data); - } - return; - } - - if (data->status != FileReady) return; - - QString filename; - if (!data->saveToCache()) { - bool mp3 = (data->mime == qstr("audio/mp3")); - filename = saveFileName(lang(lng_save_audio), mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"), qsl("audio"), mp3 ? qsl(".mp3") : qsl(".ogg"), false); - - if (filename.isEmpty()) return; - } - - data->save(filename, ActionOnLoadOpen, item ? item->fullId() : FullMsgId()); -} - -void AudioSaveLink::doSave(AudioData *data, bool forceSavingAs) { - if (!data->date) return; - - QString already = data->already(true); - bool openWith = !already.isEmpty(); - if (openWith && !forceSavingAs) { - QPoint pos(QCursor::pos()); - if (!psShowOpenWithMenu(pos.x(), pos.y(), already)) { - psOpenFile(already, true); - } - } else { - QFileInfo alreadyInfo(already); - QDir alreadyDir(already.isEmpty() ? QDir() : alreadyInfo.dir()); - bool mp3 = (data->mime == qstr("audio/mp3")); - QString name = already.isEmpty() ? (mp3 ? qsl(".mp3") : qsl(".ogg")) : alreadyInfo.fileName(); - QString filename = saveFileName(lang(lng_save_audio), mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"), qsl("audio"), name, forceSavingAs, alreadyDir); - if (!filename.isEmpty()) { - ActionOnLoad action = already.isEmpty() ? ActionOnLoadNone : ActionOnLoadOpenWith; - FullMsgId actionMsgId = App::hoveredLinkItem() ? App::hoveredLinkItem()->fullId() : (App::contextItem() ? App::contextItem()->fullId() : FullMsgId()); - data->save(filename, action, actionMsgId); - } - } -} - -void AudioSaveLink::onClick(Qt::MouseButton button) const { - if (button != Qt::LeftButton) return; - doSave(audio()); -} - -void AudioCancelLink::onClick(Qt::MouseButton button) const { - AudioData *data = audio(); - if (!data->date || button != Qt::LeftButton) return; - - if (data->uploading()) { - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - if (HistoryMessage *msg = item->toHistoryMessage()) { - if (msg->getMedia() && msg->getMedia()->type() == MediaTypeAudio && static_cast(msg->getMedia())->audio() == data) { - App::contextItem(item); - App::main()->deleteLayer(-2); - } - } - } else { - data->cancel(); - } -} - bool StickerData::setInstalled() const { switch (set.type()) { case mtpc_inputStickerSetID: { @@ -1122,239 +1031,44 @@ bool StickerData::setInstalled() const { return false; } -AudioData::AudioData(const AudioId &id, const uint64 &access, int32 date, const QString &mime, int32 duration, int32 dc, int32 size) -: id(id) -, access(access) -, date(date) -, mime(mime) -, duration(duration) -, dc(dc) -, size(size) -, status(FileReady) -, uploadOffset(0) -, _actionOnLoad(ActionOnLoadNone) -, _loader(0) { - _location = Local::readFileLocation(mediaKey(AudioFileLocation, dc, id)); -} - -bool AudioData::saveToCache() const { - return size < AudioVoiceMsgInMemory; -} - -void AudioData::forget() { - _data.clear(); -} - -void AudioData::automaticLoad(const HistoryItem *item) { - if (loaded() || status != FileReady) return; - - if (saveToCache() && _loader != CancelledMtpFileLoader) { - if (item) { - bool loadFromCloud = false; - if (item->history()->peer->isUser()) { - loadFromCloud = !(cAutoDownloadAudio() & dbiadNoPrivate); - } else { - loadFromCloud = !(cAutoDownloadAudio() & dbiadNoGroups); - } - save(QString(), _actionOnLoad, _actionOnLoadMsgId, loadFromCloud ? LoadFromCloudOrLocal : LoadFromLocalOnly, true); - } - } -} - -void AudioData::automaticLoadSettingsChanged() { - if (loaded() || status != FileReady || !saveToCache() || _loader != CancelledMtpFileLoader) return; - _loader = 0; -} - -void AudioData::performActionOnLoad() { - if (_actionOnLoad == ActionOnLoadNone) return; - - const FileLocation &loc(location(true)); - QString already = loc.name(); - bool play = _actionOnLoadMsgId.msg && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && audioPlayer(); - - if (play) { - if (loaded()) { - AudioMsgId playing; - AudioPlayerState state = AudioPlayerStopped; - audioPlayer()->currentState(&playing, &state); - if (playing.msgId == _actionOnLoadMsgId && !(state & AudioPlayerStoppedMask) && state != AudioPlayerFinishing) { - audioPlayer()->pauseresume(OverviewAudios); - } else { - audioPlayer()->play(AudioMsgId(this, _actionOnLoadMsgId)); - if (App::main()) App::main()->audioMarkRead(this); - } - } - } else { - if (already.isEmpty()) return; - if (_actionOnLoad == ActionOnLoadOpenWith) { - if (already.isEmpty()) return; - - QPoint pos(QCursor::pos()); - if (!psShowOpenWithMenu(pos.x(), pos.y(), already)) { - psOpenFile(already, true); - } - if (App::main()) App::main()->audioMarkRead(this); - } else if (_actionOnLoad == ActionOnLoadOpen || _actionOnLoad == ActionOnLoadPlayInline) { - psOpenFile(already); - if (App::main()) App::main()->audioMarkRead(this); - } - } - _actionOnLoad = ActionOnLoadNone; -} - -bool AudioData::loaded(bool check) const { - if (loading() && _loader->done()) { - if (_loader->fileType() == mtpc_storage_fileUnknown) { - _loader->deleteLater(); - _loader->rpcInvalidate(); - _loader = CancelledMtpFileLoader; - } else { - AudioData *that = const_cast(this); - that->_location = FileLocation(mtpToStorageType(_loader->fileType()), _loader->fileName()); - that->_data = _loader->bytes(); - - _loader->deleteLater(); - _loader->rpcInvalidate(); - _loader = 0; - } - notifyLayoutChanged(); - } - return !_data.isEmpty() || !already(check).isEmpty(); -} - -bool AudioData::loading() const { - return _loader && _loader != CancelledMtpFileLoader; -} - -bool AudioData::displayLoading() const { - return loading() ? (!_loader->loadingLocal() || !_loader->autoLoading()) : uploading(); -} - -float64 AudioData::progress() const { - if (uploading()) { - if (size > 0) { - return float64(uploadOffset) / size; - } - return 0; - } - return loading() ? _loader->currentProgress() : (loaded() ? 1 : 0); -} - -int32 AudioData::loadOffset() const { - return loading() ? _loader->currentOffset() : 0; -} - -bool AudioData::uploading() const { - return status == FileUploading; -} - -void AudioData::save(const QString &toFile, ActionOnLoad action, const FullMsgId &actionMsgId, LoadFromCloudSetting fromCloud, bool autoLoading) { - if (loaded(true)) { - const FileLocation &l(location(true)); - if (!toFile.isEmpty()) { - if (!_data.isEmpty()) { - QFile f(toFile); - f.open(QIODevice::WriteOnly); - f.write(_data); - } else if (l.accessEnable()) { - QFile(l.name()).copy(toFile); - l.accessDisable(); - } - } - return; - } - - if (_loader == CancelledMtpFileLoader) _loader = 0; - if (_loader) { - if (!_loader->setFileName(toFile)) { - cancel(); - _loader = 0; - } - } - - _actionOnLoad = action; - _actionOnLoadMsgId = actionMsgId; - - if (_loader) { - if (fromCloud == LoadFromCloudOrLocal) _loader->permitLoadFromCloud(); - } else { - status = FileReady; - _loader = new mtpFileLoader(dc, id, access, AudioFileLocation, toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); - _loader->connect(_loader, SIGNAL(progress(FileLoader*)), App::main(), SLOT(audioLoadProgress(FileLoader*))); - _loader->connect(_loader, SIGNAL(failed(FileLoader*,bool)), App::main(), SLOT(audioLoadFailed(FileLoader*,bool))); - _loader->start(); - } - - notifyLayoutChanged(); -} - -void AudioData::cancel() { - if (!loading()) return; - - mtpFileLoader *l = _loader; - _loader = CancelledMtpFileLoader; - if (l) { - l->cancel(); - l->deleteLater(); - l->rpcInvalidate(); - - notifyLayoutChanged(); - } - _actionOnLoad = ActionOnLoadNone; -} - -void AudioData::notifyLayoutChanged() const { - const AudioItems &items(App::audioItems()); - AudioItems::const_iterator i = items.constFind(const_cast(this)); - if (i != items.cend()) { - for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { - Notify::historyItemLayoutChanged(j.key()); - } - } -} - -QString AudioData::already(bool check) const { - return location(check).name(); -} - -QByteArray AudioData::data() const { - return _data; -} - -const FileLocation &AudioData::location(bool check) const { - if (check && !_location.check()) { - const_cast(this)->_location = Local::readFileLocation(mediaKey(AudioFileLocation, dc, id)); - } - return _location; -} - -void AudioData::setLocation(const FileLocation &loc) { - if (loc.check()) { - _location = loc; - } -} - void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { if (!data->date) return; HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); + bool playVoice = data->voice() && audioPlayer() && item; bool playMusic = data->song() && audioPlayer() && item; bool playAnimation = data->isAnimation() && item && item->getMedia(); const FileLocation &location(data->location(true)); - if (!location.isEmpty() || (!data->data().isEmpty() && (playMusic || playAnimation))) { - if (playMusic) { + if (!location.isEmpty() || (!data->data().isEmpty() && (playVoice || playMusic || playAnimation))) { + if (playVoice) { + AudioMsgId playing; + AudioPlayerState playingState = AudioPlayerStopped; + audioPlayer()->currentState(&playing, &playingState); + if (playing.msgId == item->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { + audioPlayer()->pauseresume(OverviewVoiceFiles); + } else { + AudioMsgId audio(data, item->fullId()); + audioPlayer()->play(audio); + if (App::main()) { + App::main()->audioPlayProgress(audio); + App::main()->audioMarkRead(data); + } + } + } else if (playMusic) { SongMsgId playing; AudioPlayerState playingState = AudioPlayerStopped; audioPlayer()->currentState(&playing, &playingState); if (playing.msgId == item->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { - audioPlayer()->pauseresume(OverviewDocuments); + audioPlayer()->pauseresume(OverviewFiles); } else { SongMsgId song(data, item->fullId()); audioPlayer()->play(song); if (App::main()) App::main()->documentPlayProgress(song); } + } else if (data->voice()) { + psOpenFile(location.name()); + if (App::main()) App::main()->audioMarkRead(data); } else if (data->size < MediaViewImageSizeLimit) { if (!data->data().isEmpty() && playAnimation) { if (action == ActionOnLoadPlayInline) { @@ -1386,21 +1100,32 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { QString filename; if (!data->saveToCache()) { - QString name = data->name, filter; + QString name, filter, caption, prefix; MimeType mimeType = mimeTypeForName(data->mime); QStringList p = mimeType.globPatterns(); QString pattern = p.isEmpty() ? QString() : p.front(); - if (name.isEmpty()) { - name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); - } - - if (pattern.isEmpty()) { - filter = QString(); + if (data->voice()) { + bool mp3 = (data->mime == qstr("audio/mp3")); + name = mp3 ? qsl(".mp3") : qsl(".ogg"); + filter = mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"); + caption = lang(lng_save_audio); + prefix = qsl("audio"); } else { - filter = mimeType.filterString() + qsl(";;All files (*.*)"); + if (data->name.isEmpty()) { + name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); + } else { + name = data->name; + } + if (pattern.isEmpty()) { + filter = QString(); + } else { + filter = mimeType.filterString() + qsl(";;All files (*.*)"); + } + caption = lang(lng_save_file); + prefix = qsl("doc"); } - filename = saveFileName(lang(lng_save_file), filter, qsl("doc"), name, false); + filename = saveFileName(caption, filter, prefix, name, false); if (filename.isEmpty()) return; } @@ -1410,16 +1135,17 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { void DocumentOpenLink::onClick(Qt::MouseButton button) const { if (button != Qt::LeftButton) return; - doOpen(document()); + doOpen(document(), document()->voice() ? ActionOnLoadNone : ActionOnLoadOpen); } -void GifOpenLink::doOpen(DocumentData *data) { - return DocumentOpenLink::doOpen(data, ActionOnLoadPlayInline); +void VoiceSaveLink::onClick(Qt::MouseButton button) const { + if (button != Qt::LeftButton) return; + doOpen(document(), ActionOnLoadNone); } void GifOpenLink::onClick(Qt::MouseButton button) const { if (button != Qt::LeftButton) return; - doOpen(document()); + doOpen(document(), ActionOnLoadPlayInline); } void DocumentSaveLink::doSave(DocumentData *data, bool forceSavingAs) { @@ -1433,23 +1159,34 @@ void DocumentSaveLink::doSave(DocumentData *data, bool forceSavingAs) { psOpenFile(already, true); } } else { + QFileInfo alreadyInfo(already); QDir alreadyDir(already.isEmpty() ? QDir() : alreadyInfo.dir()); - QString name = already.isEmpty() ? data->name : alreadyInfo.fileName(), filter; + QString caption, filter, prefix, name; MimeType mimeType = mimeTypeForName(data->mime); QStringList p = mimeType.globPatterns(); QString pattern = p.isEmpty() ? QString() : p.front(); - if (name.isEmpty()) { - name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); - } - - if (pattern.isEmpty()) { - filter = QString(); + if (data->voice()) { + bool mp3 = (data->mime == qstr("audio/mp3")); + caption = lang(lng_save_audio); + filter = mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"); + prefix = qsl("audio"); + name = already.isEmpty() ? (mp3 ? qsl(".mp3") : qsl(".ogg")) : alreadyInfo.fileName(); } else { - filter = mimeType.filterString() + qsl(";;All files (*.*)"); + caption = lang(lng_save_file); + if (pattern.isEmpty()) { + filter = QString(); + } else { + filter = mimeType.filterString() + qsl(";;All files (*.*)"); + } + prefix = qsl("doc"); + name = already.isEmpty() ? data->name : alreadyInfo.fileName(); + if (name.isEmpty()) { + name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); + } } - QString filename = saveFileName(lang(lng_save_file), filter, qsl("doc"), name, forceSavingAs, alreadyDir); + QString filename = saveFileName(caption, filter, prefix, name, forceSavingAs, alreadyDir); if (!filename.isEmpty()) { ActionOnLoad action = already.isEmpty() ? ActionOnLoadNone : ActionOnLoadOpenWith; FullMsgId actionMsgId = App::hoveredLinkItem() ? App::hoveredLinkItem()->fullId() : (App::contextItem() ? App::contextItem()->fullId() : FullMsgId()); @@ -1482,6 +1219,14 @@ void DocumentCancelLink::onClick(Qt::MouseButton button) const { } } +VoiceData::~VoiceData() { + if (!waveform.isEmpty() && waveform.at(0) == -1 && waveform.size() > sizeof(TaskId)) { + TaskId taskId = 0; + memcpy(&taskId, waveform.constData() + 1, sizeof(taskId)); + Local::cancelTask(taskId); + } +} + DocumentData::DocumentData(const DocumentId &id, const uint64 &access, int32 date, const QVector &attributes, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size) : id(id) , type(FileDocument) , access(access) @@ -1496,8 +1241,8 @@ DocumentData::DocumentData(const DocumentId &id, const uint64 &access, int32 dat , _duration(-1) , _actionOnLoad(ActionOnLoadNone) , _loader(0) { - _location = Local::readFileLocation(mediaKey(DocumentFileLocation, dc, id)); setattributes(attributes); + _location = Local::readFileLocation(mediaKey(voice() ? AudioFileLocation : DocumentFileLocation, dc, id)); } void DocumentData::setattributes(const QVector &attributes) { @@ -1535,11 +1280,27 @@ void DocumentData::setattributes(const QVector &attributes case mtpc_documentAttributeAudio: { const MTPDdocumentAttributeAudio &d(attributes[i].c_documentAttributeAudio()); if (type == FileDocument) { - type = SongDocument; - SongData *song = new SongData(); - _additional = song; + if (d.is_voice()) { + type = VoiceDocument; + VoiceData *voice = new VoiceData(); + _additional = voice; + } else { + type = SongDocument; + SongData *song = new SongData(); + _additional = song; + } } - if (song()) { + if (voice()) { + voice()->duration = d.vduration.v; + VoiceWaveform waveform = documentWaveformDecode(qba(d.vwaveform)); + uchar wavemax = 0; + for (int32 i = 0, l = waveform.size(); i < l; ++i) { + uchar waveat = waveform.at(i); + if (wavemax < waveat) wavemax = waveat; + } + voice()->waveform = waveform; + voice()->wavemax = wavemax; + } else if (song()) { song()->duration = d.vduration.v; song()->title = qs(d.vtitle); song()->performer = qs(d.vperformer); @@ -1558,7 +1319,7 @@ void DocumentData::setattributes(const QVector &attributes } bool DocumentData::saveToCache() const { - return (type == StickerDocument) || (isAnimation() && size < AnimationInMemory); + return (type == StickerDocument) || (isAnimation() && size < AnimationInMemory) || (voice() && size < AudioVoiceMsgInMemory); } void DocumentData::forget() { @@ -1586,12 +1347,22 @@ void DocumentData::automaticLoad(const HistoryItem *item) { loadFromCloud = !(cAutoDownloadGif() & dbiadNoPrivate) || !(cAutoDownloadGif() & dbiadNoGroups); } save(QString(), _actionOnLoad, _actionOnLoadMsgId, loadFromCloud ? LoadFromCloudOrLocal : LoadFromLocalOnly, true); + } else if (voice()) { + if (item) { + bool loadFromCloud = false; + if (item->history()->peer->isUser()) { + loadFromCloud = !(cAutoDownloadAudio() & dbiadNoPrivate); + } else { + loadFromCloud = !(cAutoDownloadAudio() & dbiadNoGroups); + } + save(QString(), _actionOnLoad, _actionOnLoadMsgId, loadFromCloud ? LoadFromCloudOrLocal : LoadFromLocalOnly, true); + } } } } void DocumentData::automaticLoadSettingsChanged() { - if (loaded() || status != FileReady || !isAnimation() || !saveToCache() || _loader != CancelledMtpFileLoader) return; + if (loaded() || status != FileReady || (!isAnimation() && !voice()) || !saveToCache() || _loader != CancelledMtpFileLoader) return; _loader = 0; } @@ -1602,15 +1373,28 @@ void DocumentData::performActionOnLoad() { QString already = loc.name(); HistoryItem *item = _actionOnLoadMsgId.msg ? App::histItemById(_actionOnLoadMsgId) : 0; bool showImage = item && (size < MediaViewImageSizeLimit); + bool playVoice = voice() && audioPlayer() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && item; bool playMusic = song() && audioPlayer() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && item; bool playAnimation = isAnimation() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && showImage && item->getMedia(); - if (playMusic) { + if (playVoice) { + if (loaded()) { + AudioMsgId playing; + AudioPlayerState state = AudioPlayerStopped; + audioPlayer()->currentState(&playing, &state); + if (playing.msgId == _actionOnLoadMsgId && !(state & AudioPlayerStoppedMask) && state != AudioPlayerFinishing) { + audioPlayer()->pauseresume(OverviewVoiceFiles); + } else { + audioPlayer()->play(AudioMsgId(this, _actionOnLoadMsgId)); + if (App::main()) App::main()->audioMarkRead(this); + } + } + } else if (playMusic) { if (loaded()) { SongMsgId playing; AudioPlayerState playingState = AudioPlayerStopped; audioPlayer()->currentState(&playing, &playingState); if (playing.msgId == item->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { - audioPlayer()->pauseresume(OverviewDocuments); + audioPlayer()->pauseresume(OverviewFiles); } else { SongMsgId song(this, item->fullId()); audioPlayer()->play(song); @@ -1636,7 +1420,10 @@ void DocumentData::performActionOnLoad() { psOpenFile(already, true); } } else if (_actionOnLoad == ActionOnLoadOpen || _actionOnLoad == ActionOnLoadPlayInline) { - if (loc.accessEnable()) { + if (voice()) { + psOpenFile(already); + if (App::main()) App::main()->audioMarkRead(this); + } else if (loc.accessEnable()) { if (showImage && QImageReader(loc.name()).canRead()) { if (_actionOnLoad == ActionOnLoadPlayInline) { item->getMedia()->playInline(item); @@ -1735,7 +1522,8 @@ void DocumentData::save(const QString &toFile, ActionOnLoad action, const FullMs if (fromCloud == LoadFromCloudOrLocal) _loader->permitLoadFromCloud(); } else { status = FileReady; - _loader = new mtpFileLoader(dc, id, access, DocumentFileLocation, toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); + LocationType type = voice() ? AudioFileLocation : DocumentFileLocation; + _loader = new mtpFileLoader(dc, id, access, type, toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); _loader->connect(_loader, SIGNAL(progress(FileLoader*)), App::main(), SLOT(documentLoadProgress(FileLoader*))); _loader->connect(_loader, SIGNAL(failed(FileLoader*,bool)), App::main(), SLOT(documentLoadFailed(FileLoader*,bool))); _loader->start(); @@ -1769,6 +1557,24 @@ void DocumentData::notifyLayoutChanged() const { } } +VoiceWaveform documentWaveformDecode(const QByteArray &encoded5bit) { + VoiceWaveform result((encoded5bit.size() * 8) / 5, 0); + for (int32 i = 0, l = result.size(); i < l; ++i) { // read each 5 bit of encoded5bit as 0-31 unsigned char + int32 byte = (i * 5) / 8, shift = (i * 5) % 8; + result[i] = (((*(uint16*)(encoded5bit.constData() + byte)) >> shift) & 0x1F); + } + return result; +} + +QByteArray documentWaveformEncode5bit(const VoiceWaveform &waveform) { + QByteArray result((waveform.size() * 5 + 7) / 8, 0); + for (int32 i = 0, l = waveform.size(); i < l; ++i) { // write each 0-31 unsigned char as 5 bit to result + int32 byte = (i * 5) / 8, shift = (i * 5) % 8; + (*(uint16*)(result.data() + byte)) |= (uint16(waveform.at(i) & 0x1F) << shift); + } + return result; +} + QString DocumentData::already(bool check) const { if (check && _location.name().isEmpty()) return QString(); return location(check).name(); @@ -1780,7 +1586,8 @@ QByteArray DocumentData::data() const { const FileLocation &DocumentData::location(bool check) const { if (check && !_location.check()) { - const_cast(this)->_location = Local::readFileLocation(mediaKey(DocumentFileLocation, dc, id)); + LocationType type = voice() ? AudioFileLocation : DocumentFileLocation; + const_cast(this)->_location = Local::readFileLocation(mediaKey(type, dc, id)); } return _location; } diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 78e899e56e..38ed72308b 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -914,138 +914,13 @@ public: }; -class AudioData { -public: - AudioData(const AudioId &id, const uint64 &access = 0, int32 date = 0, const QString &mime = QString(), int32 duration = 0, int32 dc = 0, int32 size = 0); - - void automaticLoad(const HistoryItem *item); // auto load voice message - void automaticLoadSettingsChanged(); - - bool loaded(bool check = false) const; - bool loading() const; - bool displayLoading() const; - void save(const QString &toFile, ActionOnLoad action = ActionOnLoadNone, const FullMsgId &actionMsgId = FullMsgId(), LoadFromCloudSetting fromCloud = LoadFromCloudOrLocal, bool autoLoading = false); - void cancel(); - float64 progress() const; - int32 loadOffset() const; - bool uploading() const; - - QString already(bool check = false) const; - QByteArray data() const; - const FileLocation &location(bool check = false) const; - void setLocation(const FileLocation &loc); - - bool saveToCache() const; - - void performActionOnLoad(); - - void forget(); - void setData(const QByteArray &data) { - _data = data; - } - - AudioId id; - uint64 access; - int32 date; - QString mime; - int32 duration; - int32 dc; - int32 size; - - FileStatus status; - int32 uploadOffset; - - int32 md5[8]; - -private: - FileLocation _location; - QByteArray _data; - - ActionOnLoad _actionOnLoad; - FullMsgId _actionOnLoadMsgId; - mutable mtpFileLoader *_loader; - - void notifyLayoutChanged() const; - -}; - -struct AudioMsgId { - AudioMsgId() : audio(0) { - } - AudioMsgId(AudioData *audio, const FullMsgId &msgId) : audio(audio), msgId(msgId) { - } - AudioMsgId(AudioData *audio, ChannelId channelId, MsgId msgId) : audio(audio), msgId(channelId, msgId) { - } - operator bool() const { - return audio; - } - AudioData *audio; - FullMsgId msgId; - -}; - -inline bool operator<(const AudioMsgId &a, const AudioMsgId &b) { - return quintptr(a.audio) < quintptr(b.audio) || (quintptr(a.audio) == quintptr(b.audio) && a.msgId < b.msgId); -} -inline bool operator==(const AudioMsgId &a, const AudioMsgId &b) { - return a.audio == b.audio && a.msgId == b.msgId; -} -inline bool operator!=(const AudioMsgId &a, const AudioMsgId &b) { - return !(a == b); -} - -class AudioLink : public ITextLink { - TEXT_LINK_CLASS(AudioLink) - -public: - AudioLink(AudioData *audio) : _audio(audio) { - } - AudioData *audio() const { - return _audio; - } - -private: - AudioData *_audio; - -}; - -class AudioSaveLink : public AudioLink { - TEXT_LINK_CLASS(AudioSaveLink) - -public: - AudioSaveLink(AudioData *audio) : AudioLink(audio) { - } - static void doSave(AudioData *audio, bool forceSavingAs = false); - void onClick(Qt::MouseButton button) const; - -}; - -class AudioOpenLink : public AudioLink { - TEXT_LINK_CLASS(AudioOpenLink) - -public: - AudioOpenLink(AudioData *audio) : AudioLink(audio) { - } - void onClick(Qt::MouseButton button) const; - -}; - -class AudioCancelLink : public AudioLink { - TEXT_LINK_CLASS(AudioCancelLink) - -public: - AudioCancelLink(AudioData *audio) : AudioLink(audio) { - } - void onClick(Qt::MouseButton button) const; - -}; - enum DocumentType { FileDocument = 0, VideoDocument = 1, SongDocument = 2, StickerDocument = 3, AnimatedDocument = 4, + VoiceDocument = 5, }; struct DocumentAdditionalData { @@ -1072,6 +947,16 @@ struct SongData : public DocumentAdditionalData { }; +typedef QVector VoiceWaveform; // [0] == -1 -- counting, [0] == -2 -- could not count +struct VoiceData : public DocumentAdditionalData { + VoiceData() : duration(0), wavemax(0) { + } + ~VoiceData(); + int32 duration; + VoiceWaveform waveform; + char wavemax; +}; + bool fileIsImage(const QString &name, const QString &mime); class DocumentData { @@ -1126,12 +1011,21 @@ public: SongData *song() { return (type == SongDocument) ? static_cast(_additional) : 0; } + VoiceData *voice() { + return (type == VoiceDocument) ? static_cast(_additional) : 0; + } + const VoiceData *voice() const { + return (type == VoiceDocument) ? static_cast(_additional) : 0; + } bool isAnimation() const { return (type == AnimatedDocument) || !mime.compare(qstr("image/gif"), Qt::CaseInsensitive); } bool isGifv() const { return (type == AnimatedDocument) && !mime.compare(qstr("video/mp4"), Qt::CaseInsensitive); } + bool isMusic() const { + return (type == SongDocument) ? !static_cast(_additional)->title.isEmpty() : false; + } int32 duration() const { return (isAnimation() || type == VideoDocument) ? _duration : -1; } @@ -1139,6 +1033,9 @@ public: return !isAnimation() && (type != VideoDocument) && (_duration > 0); } void recountIsImage(); + void setData(const QByteArray &data) { + _data = data; + } ~DocumentData(); @@ -1172,6 +1069,9 @@ private: }; +VoiceWaveform documentWaveformDecode(const QByteArray &encoded5bit); +QByteArray documentWaveformEncode5bit(const VoiceWaveform &waveform); + struct SongMsgId { SongMsgId() : song(0) { } @@ -1196,6 +1096,31 @@ inline bool operator!=(const SongMsgId &a, const SongMsgId &b) { return !(a == b); } +struct AudioMsgId { + AudioMsgId() : audio(0) { + } + AudioMsgId(DocumentData *audio, const FullMsgId &msgId) : audio(audio), msgId(msgId) { + } + AudioMsgId(DocumentData *audio, ChannelId channelId, MsgId msgId) : audio(audio), msgId(channelId, msgId) { + } + operator bool() const { + return audio; + } + DocumentData *audio; + FullMsgId msgId; + +}; + +inline bool operator<(const AudioMsgId &a, const AudioMsgId &b) { + return quintptr(a.audio) < quintptr(b.audio) || (quintptr(a.audio) == quintptr(b.audio) && a.msgId < b.msgId); +} +inline bool operator==(const AudioMsgId &a, const AudioMsgId &b) { + return a.audio == b.audio && a.msgId == b.msgId; +} +inline bool operator!=(const AudioMsgId &a, const AudioMsgId &b) { + return !(a == b); +} + class DocumentLink : public ITextLink { TEXT_LINK_CLASS(DocumentLink) @@ -1233,13 +1158,22 @@ public: }; +class VoiceSaveLink : public DocumentOpenLink { + TEXT_LINK_CLASS(VoiceSaveLink) + +public: + VoiceSaveLink(DocumentData *document) : DocumentOpenLink(document) { + } + void onClick(Qt::MouseButton button) const; + +}; + class GifOpenLink : public DocumentOpenLink { TEXT_LINK_CLASS(GifOpenLink) public: GifOpenLink(DocumentData *document) : DocumentOpenLink(document) { } - static void doOpen(DocumentData *document); void onClick(Qt::MouseButton button) const; }; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 4647bada86..11fe4f8108 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -532,18 +532,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); struct InterfaceWrapStruct { InterfaceWrapStruct() : Size(0), Construct(0), Destruct(0) { } - InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct) + InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct, InterfaceAssign assign) : Size(size) , Construct(construct) - , Destruct(destruct) { + , Destruct(destruct) + , Assign(assign) { } int Size; InterfaceConstruct Construct; InterfaceDestruct Destruct; + InterfaceAssign Assign; }; template @@ -560,6 +563,9 @@ struct InterfaceWrapTemplate { static void Destruct(void *location) { ((Type*)location)->~Type(); } + static void Assign(void *location, void *waslocation) { + *((Type*)location) = *((Type*)waslocation); + } }; extern InterfaceWrapStruct InterfaceWraps[64]; @@ -578,7 +584,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); + InterfaceWraps[last] = InterfaceWrapStruct(InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct, InterfaceWrapTemplate::Assign); } break; } @@ -627,6 +633,10 @@ public: int size, last; int offsets[64]; + bool equals(const uint64 &mask) const { + return _mask == mask; + } + private: uint64 _mask; @@ -637,22 +647,25 @@ const InterfacesMetadata *GetInterfacesMetadata(uint64 mask); class Interfaces { public: - Interfaces(uint64 mask = 0) : _meta(GetInterfacesMetadata(mask)), _data(0) { - if (_meta->size) { - _data = malloc(_meta->size); + Interfaces(uint64 mask = 0) : _data(0) { + if (mask) { + const InterfacesMetadata *meta = GetInterfacesMetadata(mask); + int32 size = sizeof(const InterfacesMetadata *) + meta->size; + _data = malloc(size); if (!_data) { // terminate if we can't allocate memory throw "Can't allocate memory!"; } - for (int i = 0; i < _meta->last; ++i) { - int offset = _meta->offsets[i]; + _meta() = meta; + for (int i = 0; i < meta->last; ++i) { + int offset = meta->offsets[i]; if (offset >= 0) { try { InterfaceWraps[i].Construct(_dataptrunsafe(offset), this); } catch (...) { while (i > 0) { --i; - offset = _meta->offsets[--i]; + offset = meta->offsets[--i]; if (offset >= 0) { InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); } @@ -663,10 +676,28 @@ public: } } } + void UpdateInterfaces(uint64 mask = 0) { + if (!_data && !mask) return; + if (!_data || !_meta()->equals(mask)) { + Interfaces tmp(mask); + tmp.swap(*this); + + if (_data && tmp._data) { + 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)); + } + } + } + } + } ~Interfaces() { if (_data) { - for (int i = 0; i < _meta->last; ++i) { - int offset = _meta->offsets[i]; + const InterfacesMetadata *meta = _meta(); + for (int i = 0; i < meta->last; ++i) { + int offset = meta->offsets[i]; if (offset >= 0) { InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); } @@ -677,24 +708,33 @@ public: template Type *Get() { - return (Type*)_dataptr(_meta->offsets[Type::Index()]); + return static_cast(_dataptr(_meta()->offsets[Type::Index()])); } template const Type *Get() const { - return (const Type*)_dataptr(_meta->offsets[Type::Index()]); + return static_cast(_dataptr(_meta()->offsets[Type::Index()])); } private: void *_dataptrunsafe(int skip) const { - return (char*)_data + skip; + return (char*)_data + sizeof(const InterfacesMetadata*) + skip; } void *_dataptr(int skip) const { return (skip >= 0) ? _dataptrunsafe(skip) : 0; } - const InterfacesMetadata *_meta; + const InterfacesMetadata *&_meta() const { + return *static_cast(_data); + } void *_data; + Interfaces(const Interfaces &other); + Interfaces &operator=(const Interfaces &other); + + void swap(Interfaces &other) { + std::swap(_data, other._data); + } + }; template diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 89fbecc527..801b0d0f24 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -645,7 +645,7 @@ void Window::sendServiceHistoryRequest() { 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()))); } - _serviceHistoryRequest = MTP::send(MTPmessages_GetHistory(user->input, MTP_int(0), MTP_int(0), MTP_int(1), MTP_int(0), MTP_int(0)), main->rpcDone(&MainWidget::serviceHistoryDone), main->rpcFail(&MainWidget::serviceHistoryFail)); + _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)); } void Window::setupMain(bool anim, const MTPUser *self) { From 3579276b49267cc5d012198a112954b93623c3af Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 12 Feb 2016 21:18:32 +0300 Subject: [PATCH 076/316] videos rendered like files, fixed history loading --- Telegram/SourceFiles/app.cpp | 105 +--- Telegram/SourceFiles/app.h | 10 - Telegram/SourceFiles/history.cpp | 51 +- Telegram/SourceFiles/history.h | 8 +- Telegram/SourceFiles/historywidget.cpp | 28 +- Telegram/SourceFiles/layout.cpp | 6 +- Telegram/SourceFiles/layout.h | 4 +- Telegram/SourceFiles/mainwidget.cpp | 46 +- Telegram/SourceFiles/mainwidget.h | 6 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- .../SourceFiles/mtproto/mtpFileLoader.cpp | 4 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 141 ----- Telegram/SourceFiles/mtproto/mtpScheme.h | 541 ------------------ Telegram/SourceFiles/mtproto/scheme.tl | 11 - Telegram/SourceFiles/overviewwidget.cpp | 26 +- Telegram/SourceFiles/structs.cpp | 343 ++--------- Telegram/SourceFiles/structs.h | 111 +--- Telegram/SourceFiles/types.cpp | 2 + Telegram/SourceFiles/types.h | 18 +- 19 files changed, 136 insertions(+), 1327 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index ed66b1ba11..ebd42f899a 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -47,7 +47,6 @@ namespace { UpdatedPeers updatedPeers; PhotosData photosData; - VideosData videosData; DocumentsData documentsData; typedef QHash ImageLinksData; @@ -63,7 +62,6 @@ namespace { ChannelReplyMarkups channelReplyMarkups; PhotoItems photoItems; - VideoItems videoItems; DocumentItems documentItems; WebPageItems webPageItems; SharedContactItems sharedContactItems; @@ -1287,10 +1285,6 @@ namespace App { return App::photoSet(photo.vid.v, convert, 0, 0, ImagePtr(), ImagePtr(), ImagePtr()); } - VideoData *feedVideo(const MTPDvideo &video, VideoData *convert) { - return App::videoSet(video.vid.v, convert, video.vaccess_hash.v, video.vdate.v, video.vduration.v, video.vw.v, video.vh.v, App::image(video.vthumb), video.vdc_id.v, video.vsize.v); - } - DocumentData *feedDocument(const MTPdocument &document, const QPixmap &thumb) { switch (document.type()) { case mtpc_document: { @@ -1496,60 +1490,6 @@ namespace App { return result; } - VideoData *video(const VideoId &video) { - VideosData::const_iterator i = ::videosData.constFind(video); - if (i == ::videosData.cend()) { - i = ::videosData.insert(video, new VideoData(video)); - } - return i.value(); - } - - VideoData *videoSet(const VideoId &video, VideoData *convert, const uint64 &access, int32 date, int32 duration, int32 w, int32 h, const ImagePtr &thumb, int32 dc, int32 size) { - if (convert) { - if (convert->id != video) { - VideosData::iterator i = ::videosData.find(convert->id); - if (i != ::videosData.cend() && i.value() == convert) { - ::videosData.erase(i); - } - convert->id = video; - convert->status = FileReady; - } - if (date) { - convert->access = access; - convert->date = date; - updateImage(convert->thumb, thumb); - convert->duration = duration; - convert->w = w; - convert->h = h; - convert->dc = dc; - convert->size = size; - } - } - VideosData::const_iterator i = ::videosData.constFind(video); - VideoData *result; - if (i == ::videosData.cend()) { - if (convert) { - result = convert; - } else { - result = new VideoData(video, access, date, duration, w, h, thumb, dc, size); - } - ::videosData.insert(video, result); - } else { - result = i.value(); - if (result != convert && date) { - result->access = access; - result->date = date; - result->duration = duration; - result->w = w; - result->h = h; - updateImage(result->thumb, thumb); - result->dc = dc; - result->size = size; - } - } - return result; - } - DocumentData *document(const DocumentId &document) { DocumentsData::const_iterator i = ::documentsData.constFind(document); if (i == ::documentsData.cend()) { @@ -1566,10 +1506,15 @@ namespace App { if (i != ::documentsData.cend() && i.value() == convert) { ::documentsData.erase(i); } - Local::copyStickerImage(mediaKey(DocumentFileLocation, convert->dc, convert->id), mediaKey(DocumentFileLocation, dc, document)); + + // inline bot sent gifs caching + if (!convert->voice() && !convert->isVideo()) { + Local::copyStickerImage(mediaKey(DocumentFileLocation, convert->dc, convert->id), mediaKey(DocumentFileLocation, dc, document)); + } + convert->id = document; convert->status = FileReady; - sentSticker = !!convert->sticker(); + sentSticker = (convert->sticker() != 0); } if (date) { convert->access = access; @@ -1577,7 +1522,7 @@ namespace App { convert->setattributes(attributes); convert->mime = mime; if (!thumb->isNull() && (convert->thumb->isNull() || convert->thumb->width() < thumb->width() || convert->thumb->height() < thumb->height())) { - convert->thumb = thumb; + updateImage(convert->thumb, thumb); } convert->dc = dc; convert->size = size; @@ -1593,7 +1538,7 @@ namespace App { const FileLocation &loc(convert->location(true)); if (!loc.isEmpty()) { - Local::writeFileLocation(mediaKey(DocumentFileLocation, convert->dc, convert->id), loc); + Local::writeFileLocation(convert->mediaKey(), loc); } } DocumentsData::const_iterator i = ::documentsData.constFind(document); @@ -1604,7 +1549,9 @@ namespace App { } else { result = new DocumentData(document, access, date, attributes, mime, thumb, dc, size); result->recountIsImage(); - if (result->sticker()) result->sticker()->loc = thumbLocation; + if (result->sticker()) { + result->sticker()->loc = thumbLocation; + } } ::documentsData.insert(document, result); } else { @@ -1625,7 +1572,9 @@ namespace App { } } } - if (sentSticker && App::main()) App::main()->incrementSticker(result); + if (sentSticker && App::main()) { + App::main()->incrementSticker(result); + } return result; } @@ -1724,9 +1673,6 @@ namespace App { for (PhotosData::const_iterator i = ::photosData.cbegin(), e = ::photosData.cend(); i != e; ++i) { i.value()->forget(); } - for (VideosData::const_iterator i = ::videosData.cbegin(), e = ::videosData.cend(); i != e; ++i) { - i.value()->forget(); - } for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) { i.value()->forget(); } @@ -1880,10 +1826,6 @@ namespace App { delete *i; } ::photosData.clear(); - for (VideosData::const_iterator i = ::videosData.cbegin(), e = ::videosData.cend(); i != e; ++i) { - delete *i; - } - ::videosData.clear(); for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) { delete *i; } @@ -1901,7 +1843,6 @@ namespace App { cSetLastSavedGifsUpdate(0); cSetReportSpamStatuses(ReportSpamStatuses()); ::photoItems.clear(); - ::videoItems.clear(); ::documentItems.clear(); ::webPageItems.clear(); ::sharedContactItems.clear(); @@ -2300,22 +2241,6 @@ namespace App { return ::photosData; } - void regVideoItem(VideoData *data, HistoryItem *item) { - ::videoItems[data].insert(item, NullType()); - } - - void unregVideoItem(VideoData *data, HistoryItem *item) { - ::videoItems[data].remove(item); - } - - const VideoItems &videoItems() { - return ::videoItems; - } - - const VideosData &videosData() { - return ::videosData; - } - void regDocumentItem(DocumentData *data, HistoryItem *item) { ::documentItems[data].insert(item, NullType()); } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index c62278798d..760ea77805 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -36,14 +36,12 @@ class FileUploader; typedef QMap HistoryItemsMap; typedef QHash PhotoItems; -typedef QHash VideoItems; typedef QHash DocumentItems; typedef QHash WebPageItems; typedef QHash SharedContactItems; typedef QHash GifItems; typedef QHash PhotosData; -typedef QHash VideosData; typedef QHash DocumentsData; struct ReplyMarkup { @@ -104,7 +102,6 @@ namespace App { PhotoData *feedPhoto(const MTPPhoto &photo, const PreparedPhotoThumbs &thumbs); PhotoData *feedPhoto(const MTPPhoto &photo, PhotoData *convert = 0); PhotoData *feedPhoto(const MTPDphoto &photo, PhotoData *convert = 0); - VideoData *feedVideo(const MTPDvideo &video, VideoData *convert = 0); DocumentData *feedDocument(const MTPdocument &document, const QPixmap &thumb); DocumentData *feedDocument(const MTPdocument &document, DocumentData *convert = 0); DocumentData *feedDocument(const MTPDdocument &document, DocumentData *convert = 0); @@ -132,8 +129,6 @@ namespace App { QString peerName(const PeerData *peer, bool forDialogs = false); PhotoData *photo(const PhotoId &photo); PhotoData *photoSet(const PhotoId &photo, PhotoData *convert, const uint64 &access, int32 date, const ImagePtr &thumb, const ImagePtr &medium, const ImagePtr &full); - VideoData *video(const VideoId &video); - VideoData *videoSet(const VideoId &video, VideoData *convert, const uint64 &access, int32 date, int32 duration, int32 w, int32 h, const ImagePtr &thumb, int32 dc, int32 size); DocumentData *document(const DocumentId &document); DocumentData *documentSet(const DocumentId &document, DocumentData *convert, const uint64 &access, int32 date, const QVector &attributes, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size, const StorageImageLocation &thumbLocation); WebPageData *webPage(const WebPageId &webPage); @@ -208,11 +203,6 @@ namespace App { const PhotoItems &photoItems(); const PhotosData &photosData(); - void regVideoItem(VideoData *data, HistoryItem *item); - void unregVideoItem(VideoData *data, HistoryItem *item); - const VideoItems &videoItems(); - const VideosData &videosData(); - void regDocumentItem(DocumentData *data, HistoryItem *item); void unregDocumentItem(DocumentData *data, HistoryItem *item); const DocumentItems &documentItems(); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 1fec50eeeb..8c675c0ce8 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1362,13 +1362,6 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo default: badMedia = 1; break; } break; - case mtpc_messageMediaVideo: - switch (m.vmedia.c_messageMediaVideo().vvideo.type()) { - case mtpc_video: break; - case mtpc_videoEmpty: badMedia = 2; break; - default: badMedia = 1; break; - } - break; case mtpc_messageMediaDocument: switch (m.vmedia.c_messageMediaDocument().vdocument.type()) { case mtpc_document: break; @@ -3047,12 +3040,6 @@ void RadialAnimation::draw(Painter &p, const QRect &inner, int32 thickness, cons } namespace { - int32 videoMaxStatusWidth(VideoData *video) { - int32 result = st::normalFont->width(formatDownloadText(video->size, video->size)); - result = qMax(result, st::normalFont->width(formatDurationAndSizeText(video->duration, video->size))); - return result; - } - int32 documentMaxStatusWidth(DocumentData *document) { int32 result = st::normalFont->width(formatDownloadText(document->size, document->size)); if (SongData *song = document->song()) { @@ -3061,6 +3048,8 @@ namespace { } else if (VoiceData *voice = document->voice()) { result = qMax(result, st::normalFont->width(formatPlayedText(voice->duration, voice->duration))); result = qMax(result, st::normalFont->width(formatDurationAndSizeText(voice->duration, document->size))); + } else if (document->isVideo()) { + result = qMax(result, st::normalFont->width(formatDurationAndSizeText(document->duration(), document->size))); } else { result = qMax(result, st::normalFont->width(formatSizeText(document->size))); } @@ -3494,15 +3483,15 @@ ImagePtr HistoryPhoto::replyPreview() { return _data->makeReplyPreview(); } -HistoryVideo::HistoryVideo(const MTPDvideo &video, const QString &caption, HistoryItem *parent) : HistoryFileMedia() -, _data(App::feedVideo(video)) +HistoryVideo::HistoryVideo(DocumentData *document, const QString &caption, HistoryItem *parent) : HistoryFileMedia() +, _data(document) , _thumbw(1) , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) { if (!caption.isEmpty()) { _caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent)); } - setLinks(new VideoOpenLink(_data), new VideoSaveLink(_data), new VideoCancelLink(_data)); + setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); setStatusSize(FileStatusSizeReady); @@ -3513,7 +3502,7 @@ HistoryVideo::HistoryVideo(const HistoryVideo &other) : HistoryFileMedia() , _data(other._data) , _thumbw(other._thumbw) , _caption(other._caption) { - setLinks(new VideoOpenLink(_data), new VideoSaveLink(_data), new VideoCancelLink(_data)); + setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); setStatusSize(other._statusSize); } @@ -3539,8 +3528,8 @@ void HistoryVideo::initDimensions(const HistoryItem *parent) { _thumbw = qMax(tw, 1); int32 minWidth = qMax(st::minPhotoSize, parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); - minWidth = qMax(minWidth, videoMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); - _maxw = qMax(_thumbw, int16(minWidth)); + minWidth = qMax(minWidth, documentMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); + _maxw = qMax(_thumbw, int32(minWidth)); _minh = qMax(th, int32(st::minPhotoSize)); if (bubble) { _maxw += st::mediaPadding.left() + st::mediaPadding.right(); @@ -3575,8 +3564,8 @@ int32 HistoryVideo::resize(int32 width, const HistoryItem *parent) { } int32 minWidth = qMax(st::minPhotoSize, parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); - minWidth = qMax(minWidth, videoMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); - _width = qMax(_thumbw, int16(minWidth)); + minWidth = qMax(minWidth, documentMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); + _width = qMax(_thumbw, int32(minWidth)); _height = qMax(th, int32(st::minPhotoSize)); if (bubble) { _width += st::mediaPadding.left() + st::mediaPadding.right(); @@ -3722,7 +3711,7 @@ void HistoryVideo::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x } void HistoryVideo::setStatusSize(int32 newSize) const { - HistoryFileMedia::setStatusSize(newSize, _data->size, _data->duration, 0); + HistoryFileMedia::setStatusSize(newSize, _data->size, _data->duration(), 0); } const QString HistoryVideo::inDialogsText() const { @@ -3753,11 +3742,11 @@ void HistoryVideo::updateStatusText(const HistoryItem *parent) const { } void HistoryVideo::regItem(HistoryItem *item) { - App::regVideoItem(_data, item); + App::regDocumentItem(_data, item); } void HistoryVideo::unregItem(HistoryItem *item) { - App::unregVideoItem(_data, item); + App::unregDocumentItem(_data, item); } ImagePtr HistoryVideo::replyPreview() { @@ -4346,9 +4335,9 @@ void HistoryDocument::updateFrom(const MTPMessageMedia &media, HistoryItem *pare App::feedDocument(media.c_messageMediaDocument().vdocument, _data); if (!_data->data().isEmpty()) { if (_data->voice()) { - Local::writeAudio(mediaKey(AudioFileLocation, _data->dc, _data->id), _data->data()); + Local::writeAudio(_data->mediaKey(), _data->data()); } else { - Local::writeStickerImage(mediaKey(DocumentFileLocation, _data->dc, _data->id), _data->data()); + Local::writeStickerImage(_data->mediaKey(), _data->data()); } } } @@ -4887,7 +4876,7 @@ void HistorySticker::updateFrom(const MTPMessageMedia &media, HistoryItem *paren if (media.type() == mtpc_messageMediaDocument) { App::feedDocument(media.c_messageMediaDocument().vdocument, _data); if (!_data->data().isEmpty()) { - Local::writeStickerImage(mediaKey(DocumentFileLocation, _data->dc, _data->id), _data->data()); + Local::writeStickerImage(_data->mediaKey(), _data->data()); } } } @@ -6113,12 +6102,6 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tTex _media = new HistoryPhoto(App::feedPhoto(photo.vphoto.c_photo()), qs(photo.vcaption), this); } } break; - case mtpc_messageMediaVideo: { - const MTPDmessageMediaVideo &video(media->c_messageMediaVideo()); - if (video.vvideo.type() == mtpc_video) { - _media = new HistoryVideo(video.vvideo.c_video(), qs(video.vcaption), this); - } - } break; case mtpc_messageMediaDocument: { const MTPDocument &document(media->c_messageMediaDocument().vdocument); if (document.type() == mtpc_document) { @@ -6146,6 +6129,8 @@ void HistoryMessage::initMediaFromDocument(DocumentData *doc, const QString &cap _media = new HistorySticker(doc); } else if (doc->isAnimation()) { _media = new HistoryGif(doc, caption, this); + } else if (doc->isVideo()) { + _media = new HistoryVideo(doc, caption, this); } else { _media = new HistoryDocument(doc, caption, this); } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 045144ccd1..0ac06d6140 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1354,7 +1354,7 @@ private: class HistoryVideo : public HistoryFileMedia { public: - HistoryVideo(const MTPDvideo &video, const QString &caption, HistoryItem *parent); + HistoryVideo(DocumentData *document, const QString &caption, HistoryItem *parent); HistoryVideo(const HistoryVideo &other); HistoryMediaType type() const { return MediaTypeVideo; @@ -1372,7 +1372,7 @@ public: const QString inDialogsText() const; const QString inHistoryText() const; - VideoData *video() const { + DocumentData *getDocument() { return _data; } @@ -1411,8 +1411,8 @@ protected: } private: - VideoData *_data; - int16 _thumbw; + DocumentData *_data; + int32 _thumbw; Text _caption; void setStatusSize(int32 newSize) const; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index baf099ec86..59daed82be 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -864,10 +864,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _contextMenuLnk = textlnkOver(); HistoryItem *item = App::hoveredItem() ? App::hoveredItem() : App::hoveredLinkItem(); PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); + bool lnkIsVideo = lnkDocument ? lnkDocument->document()->isVideo() : false; bool lnkIsAudio = lnkDocument ? lnkDocument->document()->voice() : false; - if (lnkPhoto || lnkVideo || lnkDocument) { + if (lnkPhoto || lnkDocument) { if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); } @@ -879,17 +879,17 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu->addAction(lang(lng_context_save_image), this, SLOT(saveContextImage()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_image), this, SLOT(copyContextImage()))->setEnabled(true); } else { - if ((lnkVideo && lnkVideo->video()->loading()) || (lnkDocument && lnkDocument->document()->loading())) { + if (lnkDocument && lnkDocument->document()->loading()) { _menu->addAction(lang(lng_context_cancel_download), this, SLOT(cancelContextDownload()))->setEnabled(true); } else { if (lnkDocument && lnkDocument->document()->loaded() && lnkDocument->document()->isGifv()) { _menu->addAction(lang(lng_context_save_gif), this, SLOT(saveContextGif()))->setEnabled(true); } - if ((lnkVideo && !lnkVideo->video()->already(true).isEmpty()) || (lnkDocument && !lnkDocument->document()->already(true).isEmpty())) { + if (lnkDocument && !lnkDocument->document()->already(true).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); - _menu->addAction(lang(lnkVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkIsVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); } } if (isUponSelected > 1) { @@ -1069,9 +1069,7 @@ void HistoryInner::copyContextImage() { } void HistoryInner::cancelContextDownload() { - if (VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data())) { - lnkVideo->video()->cancel(); - } else if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { + if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { lnkDocument->document()->cancel(); } else if (HistoryItem *item = App::contextItem()) { if (HistoryMedia *media = item->getMedia()) { @@ -1084,9 +1082,7 @@ void HistoryInner::cancelContextDownload() { void HistoryInner::showContextInFolder() { QString already; - if (VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data())) { - already = lnkVideo->video()->already(true); - } else if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { + if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { already = lnkDocument->document()->already(true); } else if (HistoryItem *item = App::contextItem()) { if (HistoryMedia *media = item->getMedia()) { @@ -1101,17 +1097,13 @@ void HistoryInner::showContextInFolder() { void HistoryInner::openContextFile() { HistoryItem *was = App::hoveredLinkItem(); App::hoveredLinkItem(App::contextItem()); - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkVideo) VideoOpenLink(lnkVideo->video()).onClick(Qt::LeftButton); if (lnkDocument) DocumentOpenLink(lnkDocument->document()).onClick(Qt::LeftButton); App::hoveredLinkItem(was); } void HistoryInner::saveContextFile() { - if (VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data())) { - VideoSaveLink::doSave(lnkVideo->video(), true); - } else if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { + if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { DocumentSaveLink::doSave(lnkDocument->document(), true); } else if (HistoryItem *item = App::contextItem()) { if (HistoryMedia *media = item->getMedia()) { @@ -4235,7 +4227,7 @@ void HistoryWidget::firstLoadMessages() { if (loadImportant) { _firstLoadRequest = MTP::send(MTPchannels_GetImportantHistory(from->asChannel()->inputChannel, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); } else { - _firstLoadRequest = MTP::send(MTPmessages_GetHistory(from->input, MTP_int(offset_id), MTP_int(offset), MTP_int(0), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); + _firstLoadRequest = MTP::send(MTPmessages_GetHistory(from->input, MTP_int(offset_id), MTP_int(0), MTP_int(offset), MTP_int(loadCount), MTP_int(0), MTP_int(0)), rpcDone(&HistoryWidget::messagesReceived, from), rpcFail(&HistoryWidget::messagesFailed)); } } diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 8540930a8a..20b5ad04cd 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -385,11 +385,11 @@ void LayoutOverviewPhoto::getState(TextLinkPtr &link, HistoryCursorState &cursor } } -LayoutOverviewVideo::LayoutOverviewVideo(VideoData *video, HistoryItem *parent) : LayoutAbstractFileItem(0, parent) +LayoutOverviewVideo::LayoutOverviewVideo(DocumentData *video, HistoryItem *parent) : LayoutAbstractFileItem(0, parent) , _data(video) -, _duration(formatDurationText(_data->duration)) +, _duration(formatDurationText(_data->duration())) , _thumbLoaded(false) { - setLinks(new VideoOpenLink(_data), new VideoSaveLink(_data), new VideoCancelLink(_data)); + setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); } void LayoutOverviewVideo::initDimensions() { diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index 7319613a1e..9cd6241278 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -317,7 +317,7 @@ private: class LayoutOverviewVideo : public LayoutAbstractFileItem { public: - LayoutOverviewVideo(VideoData *photo, HistoryItem *parent); + LayoutOverviewVideo(DocumentData *video, HistoryItem *parent); virtual void initDimensions(); virtual int32 resizeGetHeight(int32 width); @@ -339,7 +339,7 @@ protected: } private: - VideoData *_data; + DocumentData *_data; QString _duration; mutable QPixmap _pix; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index d64f8004a6..085b958d73 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1647,24 +1647,6 @@ void MainWidget::messagesAffected(PeerData *peer, const MTPmessages_AffectedMess } } -void MainWidget::videoLoadProgress(FileLoader *loader) { - mtpFileLoader *l = loader ? loader->mtpLoader() : 0; - if (!l) return; - - VideoData *video = App::video(l->objId()); - if (video->loaded()) { - video->performActionOnLoad(); - } - - const VideoItems &items(App::videoItems()); - VideoItems::const_iterator i = items.constFind(video); - if (i != items.cend()) { - for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { - Ui::repaintHistoryItem(j.key()); - } - } -} - void MainWidget::loadFailed(mtpFileLoader *loader, bool started, const char *retrySlot) { failedObjId = loader->objId(); failedFileName = loader->fileName(); @@ -1691,24 +1673,6 @@ void MainWidget::ui_showPeerHistoryAsync(quint64 peerId, qint32 showAtMsgId) { Ui::showPeerHistory(peerId, showAtMsgId); } -void MainWidget::videoLoadFailed(FileLoader *loader, bool started) { - mtpFileLoader *l = loader ? loader->mtpLoader() : 0; - if (!l) return; - - loadFailed(l, started, SLOT(videoLoadRetry())); - VideoData *video = App::video(l->objId()); - if (video) { - if (video->loading()) video->cancel(); - video->status = FileDownloadFailed; - } -} - -void MainWidget::videoLoadRetry() { - Ui::hideLayer(); - VideoData *video = App::video(failedObjId); - if (video) video->save(failedFileName); -} - void MainWidget::audioPlayProgress(const AudioMsgId &audioId) { AudioMsgId playing; AudioPlayerState state = AudioPlayerStopped; @@ -1879,7 +1843,7 @@ void MainWidget::inlineResultLoadFailed(FileLoader *loader, bool started) { //Ui::repaintInlineItem(); } -void MainWidget::audioMarkRead(DocumentData *data) { +void MainWidget::mediaMarkRead(DocumentData *data) { const DocumentItems &items(App::documentItems()); DocumentItems::const_iterator i = items.constFind(data); if (i != items.cend()) { @@ -1887,14 +1851,6 @@ void MainWidget::audioMarkRead(DocumentData *data) { } } -void MainWidget::videoMarkRead(VideoData *data) { - const VideoItems &items(App::videoItems()); - VideoItems::const_iterator i = items.constFind(data); - if (i != items.cend()) { - mediaMarkRead(i.value()); - } -} - void MainWidget::mediaMarkRead(const HistoryItemsMap &items) { QVector markedIds; markedIds.reserve(items.size()); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index b20465ef8a..31a8989df8 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -375,8 +375,7 @@ public: void cancelForwarding(); void finishForwarding(History *hist, bool broadcast); // send them - void audioMarkRead(DocumentData *data); - void videoMarkRead(VideoData *data); + void mediaMarkRead(DocumentData *data); void mediaMarkRead(const HistoryItemsMap &items); void webPageUpdated(WebPageData *page); @@ -445,9 +444,6 @@ public slots: void webPagesUpdate(); - void videoLoadProgress(FileLoader *loader); - void videoLoadFailed(FileLoader *loader, bool started); - void videoLoadRetry(); void audioPlayProgress(const AudioMsgId &audioId); void documentLoadProgress(FileLoader *loader); void documentLoadFailed(FileLoader *loader, bool started); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index b0059077c1..b6dab0b004 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -368,7 +368,7 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 46; +static const mtpPrime mtpCurrentLayer = 47; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index bfbababece..04a7b68eb0 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -387,8 +387,8 @@ bool mtpFileLoader::loadPart() { limit = DownloadPartSize; } else { switch (_locationType) { - case VideoFileLocation: loc = MTP_inputVideoFileLocation(MTP_long(_id), MTP_long(_access)); break; - case AudioFileLocation: loc = MTP_inputDocumentFileLocation(MTP_long(_id), MTP_long(_access)); break; + case VideoFileLocation: + case AudioFileLocation: case DocumentFileLocation: loc = MTP_inputDocumentFileLocation(MTP_long(_id), MTP_long(_access)); break; default: cancel(true); return false; break; } diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 4da8bb3337..e2231a54ae 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -642,57 +642,6 @@ void _serialize_inputMediaContact(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_inputMediaUploadedVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputMediaUploadedVideo"); - to.add("\n").addSpaces(lev); - } - 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(" duration: "); ++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); 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(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - -void _serialize_inputMediaUploadedThumbVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputMediaUploadedThumbVideo"); - to.add("\n").addSpaces(lev); - } - 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(" 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(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: 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 6: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - -void _serialize_inputMediaVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputMediaVideo"); - to.add("\n").addSpaces(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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -839,24 +788,6 @@ void _serialize_inputPhoto(MTPStringLogger &to, int32 stage, int32 lev, Types &t } } -void _serialize_inputVideoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - to.add("{ inputVideoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); -} - -void _serialize_inputVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputVideo"); - 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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -872,20 +803,6 @@ void _serialize_inputFileLocation(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_inputVideoFileLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputVideoFileLocation"); - 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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -1485,20 +1402,6 @@ void _serialize_messageMediaPhoto(MTPStringLogger &to, int32 stage, int32 lev, T } } -void _serialize_messageMediaVideo(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messageMediaVideo"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" video: "); ++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; - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -1816,41 +1719,6 @@ void _serialize_photoCachedSize(MTPStringLogger &to, int32 stage, int32 lev, Typ } } -void _serialize_videoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ videoEmpty"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - -void _serialize_video(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ video"); - 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(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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 5: to.add(" size: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" thumb: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: 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 8: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - void _serialize_geoPointEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { to.add("{ geoPointEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -7572,9 +7440,6 @@ namespace { _serializers.insert(mtpc_inputMediaPhoto, _serialize_inputMediaPhoto); _serializers.insert(mtpc_inputMediaGeoPoint, _serialize_inputMediaGeoPoint); _serializers.insert(mtpc_inputMediaContact, _serialize_inputMediaContact); - _serializers.insert(mtpc_inputMediaUploadedVideo, _serialize_inputMediaUploadedVideo); - _serializers.insert(mtpc_inputMediaUploadedThumbVideo, _serialize_inputMediaUploadedThumbVideo); - _serializers.insert(mtpc_inputMediaVideo, _serialize_inputMediaVideo); _serializers.insert(mtpc_inputMediaUploadedDocument, _serialize_inputMediaUploadedDocument); _serializers.insert(mtpc_inputMediaUploadedThumbDocument, _serialize_inputMediaUploadedThumbDocument); _serializers.insert(mtpc_inputMediaDocument, _serialize_inputMediaDocument); @@ -7587,10 +7452,7 @@ namespace { _serializers.insert(mtpc_inputGeoPoint, _serialize_inputGeoPoint); _serializers.insert(mtpc_inputPhotoEmpty, _serialize_inputPhotoEmpty); _serializers.insert(mtpc_inputPhoto, _serialize_inputPhoto); - _serializers.insert(mtpc_inputVideoEmpty, _serialize_inputVideoEmpty); - _serializers.insert(mtpc_inputVideo, _serialize_inputVideo); _serializers.insert(mtpc_inputFileLocation, _serialize_inputFileLocation); - _serializers.insert(mtpc_inputVideoFileLocation, _serialize_inputVideoFileLocation); _serializers.insert(mtpc_inputEncryptedFileLocation, _serialize_inputEncryptedFileLocation); _serializers.insert(mtpc_inputDocumentFileLocation, _serialize_inputDocumentFileLocation); _serializers.insert(mtpc_inputPhotoCropAuto, _serialize_inputPhotoCropAuto); @@ -7640,7 +7502,6 @@ namespace { _serializers.insert(mtpc_messageService, _serialize_messageService); _serializers.insert(mtpc_messageMediaEmpty, _serialize_messageMediaEmpty); _serializers.insert(mtpc_messageMediaPhoto, _serialize_messageMediaPhoto); - _serializers.insert(mtpc_messageMediaVideo, _serialize_messageMediaVideo); _serializers.insert(mtpc_messageMediaGeo, _serialize_messageMediaGeo); _serializers.insert(mtpc_messageMediaContact, _serialize_messageMediaContact); _serializers.insert(mtpc_messageMediaUnsupported, _serialize_messageMediaUnsupported); @@ -7665,8 +7526,6 @@ namespace { _serializers.insert(mtpc_photoSizeEmpty, _serialize_photoSizeEmpty); _serializers.insert(mtpc_photoSize, _serialize_photoSize); _serializers.insert(mtpc_photoCachedSize, _serialize_photoCachedSize); - _serializers.insert(mtpc_videoEmpty, _serialize_videoEmpty); - _serializers.insert(mtpc_video, _serialize_video); _serializers.insert(mtpc_geoPointEmpty, _serialize_geoPointEmpty); _serializers.insert(mtpc_geoPoint, _serialize_geoPoint); _serializers.insert(mtpc_auth_checkedPhone, _serialize_auth_checkedPhone); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 98bcc93e0e..1f32eb20ec 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -87,9 +87,6 @@ enum { mtpc_inputMediaPhoto = 0xe9bfb4f3, mtpc_inputMediaGeoPoint = 0xf9c44144, mtpc_inputMediaContact = 0xa6e45987, - mtpc_inputMediaUploadedVideo = 0x82713fdf, - mtpc_inputMediaUploadedThumbVideo = 0x7780ddf9, - mtpc_inputMediaVideo = 0x936a4ebd, mtpc_inputMediaUploadedDocument = 0x1d89306d, mtpc_inputMediaUploadedThumbDocument = 0xad613491, mtpc_inputMediaDocument = 0x1a77f29c, @@ -102,10 +99,7 @@ enum { mtpc_inputGeoPoint = 0xf3b7acc9, mtpc_inputPhotoEmpty = 0x1cd7bf0d, mtpc_inputPhoto = 0xfb95c6c4, - mtpc_inputVideoEmpty = 0x5508ec75, - mtpc_inputVideo = 0xee579652, mtpc_inputFileLocation = 0x14637196, - mtpc_inputVideoFileLocation = 0x3d0364ec, mtpc_inputEncryptedFileLocation = 0xf5235d55, mtpc_inputDocumentFileLocation = 0x4e45abe9, mtpc_inputPhotoCropAuto = 0xade6b004, @@ -155,7 +149,6 @@ enum { mtpc_messageService = 0xc06b9607, mtpc_messageMediaEmpty = 0x3ded6320, mtpc_messageMediaPhoto = 0x3d8ce53d, - mtpc_messageMediaVideo = 0x5bcf1675, mtpc_messageMediaGeo = 0x56e0d474, mtpc_messageMediaContact = 0x5e7d2f39, mtpc_messageMediaUnsupported = 0x9f84f49e, @@ -180,8 +173,6 @@ enum { mtpc_photoSizeEmpty = 0xe17e23c, mtpc_photoSize = 0x77bfb61b, mtpc_photoCachedSize = 0xe9a734fa, - mtpc_videoEmpty = 0xc10658a8, - mtpc_video = 0xf72887d3, mtpc_geoPointEmpty = 0x1117dd5f, mtpc_geoPoint = 0x2049d70c, mtpc_auth_checkedPhone = 0x811ea28e, @@ -715,9 +706,6 @@ class MTPDinputMediaUploadedPhoto; class MTPDinputMediaPhoto; class MTPDinputMediaGeoPoint; class MTPDinputMediaContact; -class MTPDinputMediaUploadedVideo; -class MTPDinputMediaUploadedThumbVideo; -class MTPDinputMediaVideo; class MTPDinputMediaUploadedDocument; class MTPDinputMediaUploadedThumbDocument; class MTPDinputMediaDocument; @@ -734,12 +722,8 @@ class MTPDinputGeoPoint; class MTPinputPhoto; class MTPDinputPhoto; -class MTPinputVideo; -class MTPDinputVideo; - class MTPinputFileLocation; class MTPDinputFileLocation; -class MTPDinputVideoFileLocation; class MTPDinputEncryptedFileLocation; class MTPDinputDocumentFileLocation; @@ -801,7 +785,6 @@ class MTPDmessageService; class MTPmessageMedia; class MTPDmessageMediaPhoto; -class MTPDmessageMediaVideo; class MTPDmessageMediaGeo; class MTPDmessageMediaContact; class MTPDmessageMediaDocument; @@ -832,10 +815,6 @@ class MTPDphotoSizeEmpty; class MTPDphotoSize; class MTPDphotoCachedSize; -class MTPvideo; -class MTPDvideoEmpty; -class MTPDvideo; - class MTPgeoPoint; class MTPDgeoPoint; @@ -1283,7 +1262,6 @@ typedef MTPBoxed MTPInputMedia; typedef MTPBoxed MTPInputChatPhoto; typedef MTPBoxed MTPInputGeoPoint; typedef MTPBoxed MTPInputPhoto; -typedef MTPBoxed MTPInputVideo; typedef MTPBoxed MTPInputFileLocation; typedef MTPBoxed MTPInputPhotoCrop; typedef MTPBoxed MTPInputAppEvent; @@ -1304,7 +1282,6 @@ typedef MTPBoxed MTPMessageAction; typedef MTPBoxed MTPDialog; typedef MTPBoxed MTPPhoto; typedef MTPBoxed MTPPhotoSize; -typedef MTPBoxed MTPVideo; typedef MTPBoxed MTPGeoPoint; typedef MTPBoxed MTPauth_CheckedPhone; typedef MTPBoxed MTPauth_SentCode; @@ -2529,42 +2506,6 @@ public: return *(const MTPDinputMediaContact*)data; } - MTPDinputMediaUploadedVideo &_inputMediaUploadedVideo() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaUploadedVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedVideo); - split(); - return *(MTPDinputMediaUploadedVideo*)data; - } - const MTPDinputMediaUploadedVideo &c_inputMediaUploadedVideo() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaUploadedVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedVideo); - return *(const MTPDinputMediaUploadedVideo*)data; - } - - MTPDinputMediaUploadedThumbVideo &_inputMediaUploadedThumbVideo() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaUploadedThumbVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedThumbVideo); - split(); - return *(MTPDinputMediaUploadedThumbVideo*)data; - } - const MTPDinputMediaUploadedThumbVideo &c_inputMediaUploadedThumbVideo() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaUploadedThumbVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedThumbVideo); - return *(const MTPDinputMediaUploadedThumbVideo*)data; - } - - MTPDinputMediaVideo &_inputMediaVideo() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaVideo); - split(); - return *(MTPDinputMediaVideo*)data; - } - const MTPDinputMediaVideo &c_inputMediaVideo() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputMediaVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaVideo); - return *(const MTPDinputMediaVideo*)data; - } - MTPDinputMediaUploadedDocument &_inputMediaUploadedDocument() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_inputMediaUploadedDocument) throw mtpErrorWrongTypeId(_type, mtpc_inputMediaUploadedDocument); @@ -2638,9 +2579,6 @@ private: explicit MTPinputMedia(MTPDinputMediaPhoto *_data); explicit MTPinputMedia(MTPDinputMediaGeoPoint *_data); explicit MTPinputMedia(MTPDinputMediaContact *_data); - explicit MTPinputMedia(MTPDinputMediaUploadedVideo *_data); - explicit MTPinputMedia(MTPDinputMediaUploadedThumbVideo *_data); - explicit MTPinputMedia(MTPDinputMediaVideo *_data); explicit MTPinputMedia(MTPDinputMediaUploadedDocument *_data); explicit MTPinputMedia(MTPDinputMediaUploadedThumbDocument *_data); explicit MTPinputMedia(MTPDinputMediaDocument *_data); @@ -2652,9 +2590,6 @@ private: 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_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption); 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); @@ -2793,44 +2728,6 @@ private: }; typedef MTPBoxed MTPInputPhoto; -class MTPinputVideo : private mtpDataOwner { -public: - MTPinputVideo() : mtpDataOwner(0), _type(0) { - } - MTPinputVideo(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDinputVideo &_inputVideo() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputVideo); - split(); - return *(MTPDinputVideo*)data; - } - const MTPDinputVideo &c_inputVideo() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputVideo) throw mtpErrorWrongTypeId(_type, mtpc_inputVideo); - return *(const MTPDinputVideo*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPinputVideo(mtpTypeId type); - explicit MTPinputVideo(MTPDinputVideo *_data); - - friend MTPinputVideo MTP_inputVideoEmpty(); - friend MTPinputVideo MTP_inputVideo(const MTPlong &_id, const MTPlong &_access_hash); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPInputVideo; - class MTPinputFileLocation : private mtpDataOwner { public: MTPinputFileLocation() : mtpDataOwner(0), _type(0) { @@ -2851,18 +2748,6 @@ public: return *(const MTPDinputFileLocation*)data; } - MTPDinputVideoFileLocation &_inputVideoFileLocation() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputVideoFileLocation) throw mtpErrorWrongTypeId(_type, mtpc_inputVideoFileLocation); - split(); - return *(MTPDinputVideoFileLocation*)data; - } - const MTPDinputVideoFileLocation &c_inputVideoFileLocation() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputVideoFileLocation) throw mtpErrorWrongTypeId(_type, mtpc_inputVideoFileLocation); - return *(const MTPDinputVideoFileLocation*)data; - } - MTPDinputEncryptedFileLocation &_inputEncryptedFileLocation() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_inputEncryptedFileLocation) throw mtpErrorWrongTypeId(_type, mtpc_inputEncryptedFileLocation); @@ -2897,12 +2782,10 @@ public: private: explicit MTPinputFileLocation(mtpTypeId type); explicit MTPinputFileLocation(MTPDinputFileLocation *_data); - explicit MTPinputFileLocation(MTPDinputVideoFileLocation *_data); 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_inputVideoFileLocation(const MTPlong &_id, const MTPlong &_access_hash); friend MTPinputFileLocation MTP_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash); friend MTPinputFileLocation MTP_inputDocumentFileLocation(const MTPlong &_id, const MTPlong &_access_hash); @@ -3655,18 +3538,6 @@ public: return *(const MTPDmessageMediaPhoto*)data; } - MTPDmessageMediaVideo &_messageMediaVideo() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messageMediaVideo) throw mtpErrorWrongTypeId(_type, mtpc_messageMediaVideo); - split(); - return *(MTPDmessageMediaVideo*)data; - } - const MTPDmessageMediaVideo &c_messageMediaVideo() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messageMediaVideo) throw mtpErrorWrongTypeId(_type, mtpc_messageMediaVideo); - return *(const MTPDmessageMediaVideo*)data; - } - MTPDmessageMediaGeo &_messageMediaGeo() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_messageMediaGeo) throw mtpErrorWrongTypeId(_type, mtpc_messageMediaGeo); @@ -3737,7 +3608,6 @@ public: private: explicit MTPmessageMedia(mtpTypeId type); explicit MTPmessageMedia(MTPDmessageMediaPhoto *_data); - explicit MTPmessageMedia(MTPDmessageMediaVideo *_data); explicit MTPmessageMedia(MTPDmessageMediaGeo *_data); explicit MTPmessageMedia(MTPDmessageMediaContact *_data); explicit MTPmessageMedia(MTPDmessageMediaDocument *_data); @@ -3746,7 +3616,6 @@ private: friend MTPmessageMedia MTP_messageMediaEmpty(); friend MTPmessageMedia MTP_messageMediaPhoto(const MTPPhoto &_photo, const MTPstring &_caption); - friend MTPmessageMedia MTP_messageMediaVideo(const MTPVideo &_video, 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(); @@ -4076,57 +3945,6 @@ private: }; typedef MTPBoxed MTPPhotoSize; -class MTPvideo : private mtpDataOwner { -public: - MTPvideo() : mtpDataOwner(0), _type(0) { - } - MTPvideo(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDvideoEmpty &_videoEmpty() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_videoEmpty) throw mtpErrorWrongTypeId(_type, mtpc_videoEmpty); - split(); - return *(MTPDvideoEmpty*)data; - } - const MTPDvideoEmpty &c_videoEmpty() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_videoEmpty) throw mtpErrorWrongTypeId(_type, mtpc_videoEmpty); - return *(const MTPDvideoEmpty*)data; - } - - MTPDvideo &_video() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_video) throw mtpErrorWrongTypeId(_type, mtpc_video); - split(); - return *(MTPDvideo*)data; - } - const MTPDvideo &c_video() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_video) throw mtpErrorWrongTypeId(_type, mtpc_video); - return *(const MTPDvideo*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPvideo(mtpTypeId type); - explicit MTPvideo(MTPDvideoEmpty *_data); - explicit MTPvideo(MTPDvideo *_data); - - friend MTPvideo MTP_videoEmpty(const MTPlong &_id); - friend MTPvideo MTP_video(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _duration, const MTPstring &_mime_type, MTPint _size, const MTPPhotoSize &_thumb, MTPint _dc_id, MTPint _w, MTPint _h); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPVideo; - class MTPgeoPoint : private mtpDataOwner { public: MTPgeoPoint() : mtpDataOwner(0), _type(0) { @@ -9596,48 +9414,6 @@ public: MTPstring vlast_name; }; -class MTPDinputMediaUploadedVideo : public mtpDataImpl { -public: - MTPDinputMediaUploadedVideo() { - } - MTPDinputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption) : vfile(_file), vduration(_duration), vw(_w), vh(_h), vmime_type(_mime_type), vcaption(_caption) { - } - - MTPInputFile vfile; - MTPint vduration; - MTPint vw; - MTPint vh; - MTPstring vmime_type; - MTPstring vcaption; -}; - -class MTPDinputMediaUploadedThumbVideo : public mtpDataImpl { -public: - MTPDinputMediaUploadedThumbVideo() { - } - MTPDinputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption) : vfile(_file), vthumb(_thumb), vduration(_duration), vw(_w), vh(_h), vmime_type(_mime_type), vcaption(_caption) { - } - - MTPInputFile vfile; - MTPInputFile vthumb; - MTPint vduration; - MTPint vw; - MTPint vh; - MTPstring vmime_type; - MTPstring vcaption; -}; - -class MTPDinputMediaVideo : public mtpDataImpl { -public: - MTPDinputMediaVideo() { - } - MTPDinputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption) : vid(_id), vcaption(_caption) { - } - - MTPInputVideo vid; - MTPstring vcaption; -}; - class MTPDinputMediaUploadedDocument : public mtpDataImpl { public: MTPDinputMediaUploadedDocument() { @@ -9745,17 +9521,6 @@ public: MTPlong vaccess_hash; }; -class MTPDinputVideo : public mtpDataImpl { -public: - MTPDinputVideo() { - } - MTPDinputVideo(const MTPlong &_id, const MTPlong &_access_hash) : vid(_id), vaccess_hash(_access_hash) { - } - - MTPlong vid; - MTPlong vaccess_hash; -}; - class MTPDinputFileLocation : public mtpDataImpl { public: MTPDinputFileLocation() { @@ -9768,17 +9533,6 @@ public: MTPlong vsecret; }; -class MTPDinputVideoFileLocation : public mtpDataImpl { -public: - MTPDinputVideoFileLocation() { - } - MTPDinputVideoFileLocation(const MTPlong &_id, const MTPlong &_access_hash) : vid(_id), vaccess_hash(_access_hash) { - } - - MTPlong vid; - MTPlong vaccess_hash; -}; - class MTPDinputEncryptedFileLocation : public mtpDataImpl { public: MTPDinputEncryptedFileLocation() { @@ -10333,17 +10087,6 @@ public: MTPstring vcaption; }; -class MTPDmessageMediaVideo : public mtpDataImpl { -public: - MTPDmessageMediaVideo() { - } - MTPDmessageMediaVideo(const MTPVideo &_video, const MTPstring &_caption) : vvideo(_video), vcaption(_caption) { - } - - MTPVideo vvideo; - MTPstring vcaption; -}; - class MTPDmessageMediaGeo : public mtpDataImpl { public: MTPDmessageMediaGeo() { @@ -10586,35 +10329,6 @@ public: MTPbytes vbytes; }; -class MTPDvideoEmpty : public mtpDataImpl { -public: - MTPDvideoEmpty() { - } - MTPDvideoEmpty(const MTPlong &_id) : vid(_id) { - } - - MTPlong vid; -}; - -class MTPDvideo : public mtpDataImpl { -public: - MTPDvideo() { - } - MTPDvideo(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _duration, const MTPstring &_mime_type, MTPint _size, const MTPPhotoSize &_thumb, MTPint _dc_id, MTPint _w, MTPint _h) : vid(_id), vaccess_hash(_access_hash), vdate(_date), vduration(_duration), vmime_type(_mime_type), vsize(_size), vthumb(_thumb), vdc_id(_dc_id), vw(_w), vh(_h) { - } - - MTPlong vid; - MTPlong vaccess_hash; - MTPint vdate; - MTPint vduration; - MTPstring vmime_type; - MTPint vsize; - MTPPhotoSize vthumb; - MTPint vdc_id; - MTPint vw; - MTPint vh; -}; - class MTPDgeoPoint : public mtpDataImpl { public: MTPDgeoPoint() { @@ -21679,18 +21393,6 @@ inline uint32 MTPinputMedia::innerLength() const { const MTPDinputMediaContact &v(c_inputMediaContact()); return v.vphone_number.innerLength() + v.vfirst_name.innerLength() + v.vlast_name.innerLength(); } - case mtpc_inputMediaUploadedVideo: { - const MTPDinputMediaUploadedVideo &v(c_inputMediaUploadedVideo()); - return v.vfile.innerLength() + v.vduration.innerLength() + v.vw.innerLength() + v.vh.innerLength() + v.vmime_type.innerLength() + v.vcaption.innerLength(); - } - case mtpc_inputMediaUploadedThumbVideo: { - const MTPDinputMediaUploadedThumbVideo &v(c_inputMediaUploadedThumbVideo()); - return v.vfile.innerLength() + v.vthumb.innerLength() + v.vduration.innerLength() + v.vw.innerLength() + v.vh.innerLength() + v.vmime_type.innerLength() + v.vcaption.innerLength(); - } - case mtpc_inputMediaVideo: { - const MTPDinputMediaVideo &v(c_inputMediaVideo()); - return v.vid.innerLength() + v.vcaption.innerLength(); - } case mtpc_inputMediaUploadedDocument: { const MTPDinputMediaUploadedDocument &v(c_inputMediaUploadedDocument()); return v.vfile.innerLength() + v.vmime_type.innerLength() + v.vattributes.innerLength() + v.vcaption.innerLength(); @@ -21746,33 +21448,6 @@ inline void MTPinputMedia::read(const mtpPrime *&from, const mtpPrime *end, mtpT v.vfirst_name.read(from, end); v.vlast_name.read(from, end); } break; - case mtpc_inputMediaUploadedVideo: _type = cons; { - if (!data) setData(new MTPDinputMediaUploadedVideo()); - MTPDinputMediaUploadedVideo &v(_inputMediaUploadedVideo()); - v.vfile.read(from, end); - v.vduration.read(from, end); - v.vw.read(from, end); - v.vh.read(from, end); - v.vmime_type.read(from, end); - v.vcaption.read(from, end); - } break; - case mtpc_inputMediaUploadedThumbVideo: _type = cons; { - if (!data) setData(new MTPDinputMediaUploadedThumbVideo()); - MTPDinputMediaUploadedThumbVideo &v(_inputMediaUploadedThumbVideo()); - v.vfile.read(from, end); - v.vthumb.read(from, end); - v.vduration.read(from, end); - v.vw.read(from, end); - v.vh.read(from, end); - v.vmime_type.read(from, end); - v.vcaption.read(from, end); - } break; - case mtpc_inputMediaVideo: _type = cons; { - if (!data) setData(new MTPDinputMediaVideo()); - MTPDinputMediaVideo &v(_inputMediaVideo()); - v.vid.read(from, end); - v.vcaption.read(from, end); - } break; case mtpc_inputMediaUploadedDocument: _type = cons; { if (!data) setData(new MTPDinputMediaUploadedDocument()); MTPDinputMediaUploadedDocument &v(_inputMediaUploadedDocument()); @@ -21836,30 +21511,6 @@ inline void MTPinputMedia::write(mtpBuffer &to) const { v.vfirst_name.write(to); v.vlast_name.write(to); } break; - case mtpc_inputMediaUploadedVideo: { - const MTPDinputMediaUploadedVideo &v(c_inputMediaUploadedVideo()); - v.vfile.write(to); - v.vduration.write(to); - v.vw.write(to); - v.vh.write(to); - v.vmime_type.write(to); - v.vcaption.write(to); - } break; - case mtpc_inputMediaUploadedThumbVideo: { - const MTPDinputMediaUploadedThumbVideo &v(c_inputMediaUploadedThumbVideo()); - v.vfile.write(to); - v.vthumb.write(to); - v.vduration.write(to); - v.vw.write(to); - v.vh.write(to); - v.vmime_type.write(to); - v.vcaption.write(to); - } break; - case mtpc_inputMediaVideo: { - const MTPDinputMediaVideo &v(c_inputMediaVideo()); - v.vid.write(to); - v.vcaption.write(to); - } break; case mtpc_inputMediaUploadedDocument: { const MTPDinputMediaUploadedDocument &v(c_inputMediaUploadedDocument()); v.vfile.write(to); @@ -21902,9 +21553,6 @@ inline MTPinputMedia::MTPinputMedia(mtpTypeId type) : mtpDataOwner(0), _type(typ case mtpc_inputMediaPhoto: setData(new MTPDinputMediaPhoto()); break; case mtpc_inputMediaGeoPoint: setData(new MTPDinputMediaGeoPoint()); break; case mtpc_inputMediaContact: setData(new MTPDinputMediaContact()); break; - case mtpc_inputMediaUploadedVideo: setData(new MTPDinputMediaUploadedVideo()); break; - case mtpc_inputMediaUploadedThumbVideo: setData(new MTPDinputMediaUploadedThumbVideo()); break; - case mtpc_inputMediaVideo: setData(new MTPDinputMediaVideo()); break; case mtpc_inputMediaUploadedDocument: setData(new MTPDinputMediaUploadedDocument()); break; case mtpc_inputMediaUploadedThumbDocument: setData(new MTPDinputMediaUploadedThumbDocument()); break; case mtpc_inputMediaDocument: setData(new MTPDinputMediaDocument()); break; @@ -21921,12 +21569,6 @@ inline MTPinputMedia::MTPinputMedia(MTPDinputMediaGeoPoint *_data) : mtpDataOwne } inline MTPinputMedia::MTPinputMedia(MTPDinputMediaContact *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaContact) { } -inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedVideo *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedVideo) { -} -inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedThumbVideo *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedThumbVideo) { -} -inline MTPinputMedia::MTPinputMedia(MTPDinputMediaVideo *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaVideo) { -} inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedDocument *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedDocument) { } inline MTPinputMedia::MTPinputMedia(MTPDinputMediaUploadedThumbDocument *_data) : mtpDataOwner(_data), _type(mtpc_inputMediaUploadedThumbDocument) { @@ -21952,15 +21594,6 @@ inline MTPinputMedia MTP_inputMediaGeoPoint(const MTPInputGeoPoint &_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)); } -inline MTPinputMedia MTP_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedVideo(_file, _duration, _w, _h, _mime_type, _caption)); -} -inline MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedThumbVideo(_file, _thumb, _duration, _w, _h, _mime_type, _caption)); -} -inline MTPinputMedia MTP_inputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaVideo(_id, _caption)); -} 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)); } @@ -22151,67 +21784,12 @@ inline MTPinputPhoto MTP_inputPhoto(const MTPlong &_id, const MTPlong &_access_h return MTPinputPhoto(new MTPDinputPhoto(_id, _access_hash)); } -inline uint32 MTPinputVideo::innerLength() const { - switch (_type) { - case mtpc_inputVideo: { - const MTPDinputVideo &v(c_inputVideo()); - return v.vid.innerLength() + v.vaccess_hash.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPinputVideo::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPinputVideo::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_inputVideoEmpty: _type = cons; break; - case mtpc_inputVideo: _type = cons; { - if (!data) setData(new MTPDinputVideo()); - MTPDinputVideo &v(_inputVideo()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPinputVideo"); - } -} -inline void MTPinputVideo::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_inputVideo: { - const MTPDinputVideo &v(c_inputVideo()); - v.vid.write(to); - v.vaccess_hash.write(to); - } break; - } -} -inline MTPinputVideo::MTPinputVideo(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_inputVideoEmpty: break; - case mtpc_inputVideo: setData(new MTPDinputVideo()); break; - default: throw mtpErrorBadTypeId(type, "MTPinputVideo"); - } -} -inline MTPinputVideo::MTPinputVideo(MTPDinputVideo *_data) : mtpDataOwner(_data), _type(mtpc_inputVideo) { -} -inline MTPinputVideo MTP_inputVideoEmpty() { - return MTPinputVideo(mtpc_inputVideoEmpty); -} -inline MTPinputVideo MTP_inputVideo(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputVideo(new MTPDinputVideo(_id, _access_hash)); -} - inline uint32 MTPinputFileLocation::innerLength() const { switch (_type) { case mtpc_inputFileLocation: { const MTPDinputFileLocation &v(c_inputFileLocation()); return v.vvolume_id.innerLength() + v.vlocal_id.innerLength() + v.vsecret.innerLength(); } - case mtpc_inputVideoFileLocation: { - const MTPDinputVideoFileLocation &v(c_inputVideoFileLocation()); - return v.vid.innerLength() + v.vaccess_hash.innerLength(); - } case mtpc_inputEncryptedFileLocation: { const MTPDinputEncryptedFileLocation &v(c_inputEncryptedFileLocation()); return v.vid.innerLength() + v.vaccess_hash.innerLength(); @@ -22237,12 +21815,6 @@ inline void MTPinputFileLocation::read(const mtpPrime *&from, const mtpPrime *en v.vlocal_id.read(from, end); v.vsecret.read(from, end); } break; - case mtpc_inputVideoFileLocation: _type = cons; { - if (!data) setData(new MTPDinputVideoFileLocation()); - MTPDinputVideoFileLocation &v(_inputVideoFileLocation()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - } break; case mtpc_inputEncryptedFileLocation: _type = cons; { if (!data) setData(new MTPDinputEncryptedFileLocation()); MTPDinputEncryptedFileLocation &v(_inputEncryptedFileLocation()); @@ -22266,11 +21838,6 @@ inline void MTPinputFileLocation::write(mtpBuffer &to) const { v.vlocal_id.write(to); v.vsecret.write(to); } break; - case mtpc_inputVideoFileLocation: { - const MTPDinputVideoFileLocation &v(c_inputVideoFileLocation()); - v.vid.write(to); - v.vaccess_hash.write(to); - } break; case mtpc_inputEncryptedFileLocation: { const MTPDinputEncryptedFileLocation &v(c_inputEncryptedFileLocation()); v.vid.write(to); @@ -22286,7 +21853,6 @@ inline void MTPinputFileLocation::write(mtpBuffer &to) const { inline MTPinputFileLocation::MTPinputFileLocation(mtpTypeId type) : mtpDataOwner(0), _type(type) { switch (type) { case mtpc_inputFileLocation: setData(new MTPDinputFileLocation()); break; - case mtpc_inputVideoFileLocation: setData(new MTPDinputVideoFileLocation()); break; case mtpc_inputEncryptedFileLocation: setData(new MTPDinputEncryptedFileLocation()); break; case mtpc_inputDocumentFileLocation: setData(new MTPDinputDocumentFileLocation()); break; default: throw mtpErrorBadTypeId(type, "MTPinputFileLocation"); @@ -22294,8 +21860,6 @@ inline MTPinputFileLocation::MTPinputFileLocation(mtpTypeId type) : mtpDataOwner } inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputFileLocation) { } -inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputVideoFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputVideoFileLocation) { -} inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputEncryptedFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputEncryptedFileLocation) { } inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputDocumentFileLocation *_data) : mtpDataOwner(_data), _type(mtpc_inputDocumentFileLocation) { @@ -22303,9 +21867,6 @@ inline MTPinputFileLocation::MTPinputFileLocation(MTPDinputDocumentFileLocation inline MTPinputFileLocation MTP_inputFileLocation(const MTPlong &_volume_id, MTPint _local_id, const MTPlong &_secret) { return MTPinputFileLocation(new MTPDinputFileLocation(_volume_id, _local_id, _secret)); } -inline MTPinputFileLocation MTP_inputVideoFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { - return MTPinputFileLocation(new MTPDinputVideoFileLocation(_id, _access_hash)); -} inline MTPinputFileLocation MTP_inputEncryptedFileLocation(const MTPlong &_id, const MTPlong &_access_hash) { return MTPinputFileLocation(new MTPDinputEncryptedFileLocation(_id, _access_hash)); } @@ -23440,10 +23001,6 @@ inline uint32 MTPmessageMedia::innerLength() const { const MTPDmessageMediaPhoto &v(c_messageMediaPhoto()); return v.vphoto.innerLength() + v.vcaption.innerLength(); } - case mtpc_messageMediaVideo: { - const MTPDmessageMediaVideo &v(c_messageMediaVideo()); - return v.vvideo.innerLength() + v.vcaption.innerLength(); - } case mtpc_messageMediaGeo: { const MTPDmessageMediaGeo &v(c_messageMediaGeo()); return v.vgeo.innerLength(); @@ -23481,12 +23038,6 @@ inline void MTPmessageMedia::read(const mtpPrime *&from, const mtpPrime *end, mt v.vphoto.read(from, end); v.vcaption.read(from, end); } break; - case mtpc_messageMediaVideo: _type = cons; { - if (!data) setData(new MTPDmessageMediaVideo()); - MTPDmessageMediaVideo &v(_messageMediaVideo()); - v.vvideo.read(from, end); - v.vcaption.read(from, end); - } break; case mtpc_messageMediaGeo: _type = cons; { if (!data) setData(new MTPDmessageMediaGeo()); MTPDmessageMediaGeo &v(_messageMediaGeo()); @@ -23531,11 +23082,6 @@ inline void MTPmessageMedia::write(mtpBuffer &to) const { v.vphoto.write(to); v.vcaption.write(to); } break; - case mtpc_messageMediaVideo: { - const MTPDmessageMediaVideo &v(c_messageMediaVideo()); - v.vvideo.write(to); - v.vcaption.write(to); - } break; case mtpc_messageMediaGeo: { const MTPDmessageMediaGeo &v(c_messageMediaGeo()); v.vgeo.write(to); @@ -23570,7 +23116,6 @@ inline MTPmessageMedia::MTPmessageMedia(mtpTypeId type) : mtpDataOwner(0), _type switch (type) { case mtpc_messageMediaEmpty: break; case mtpc_messageMediaPhoto: setData(new MTPDmessageMediaPhoto()); break; - case mtpc_messageMediaVideo: setData(new MTPDmessageMediaVideo()); break; case mtpc_messageMediaGeo: setData(new MTPDmessageMediaGeo()); break; case mtpc_messageMediaContact: setData(new MTPDmessageMediaContact()); break; case mtpc_messageMediaUnsupported: break; @@ -23582,8 +23127,6 @@ inline MTPmessageMedia::MTPmessageMedia(mtpTypeId type) : mtpDataOwner(0), _type } inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaPhoto *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaPhoto) { } -inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaVideo *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaVideo) { -} inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaGeo *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaGeo) { } inline MTPmessageMedia::MTPmessageMedia(MTPDmessageMediaContact *_data) : mtpDataOwner(_data), _type(mtpc_messageMediaContact) { @@ -23600,9 +23143,6 @@ inline MTPmessageMedia MTP_messageMediaEmpty() { inline MTPmessageMedia MTP_messageMediaPhoto(const MTPPhoto &_photo, const MTPstring &_caption) { return MTPmessageMedia(new MTPDmessageMediaPhoto(_photo, _caption)); } -inline MTPmessageMedia MTP_messageMediaVideo(const MTPVideo &_video, const MTPstring &_caption) { - return MTPmessageMedia(new MTPDmessageMediaVideo(_video, _caption)); -} inline MTPmessageMedia MTP_messageMediaGeo(const MTPGeoPoint &_geo) { return MTPmessageMedia(new MTPDmessageMediaGeo(_geo)); } @@ -24084,87 +23624,6 @@ inline MTPphotoSize MTP_photoCachedSize(const MTPstring &_type, const MTPFileLoc return MTPphotoSize(new MTPDphotoCachedSize(_type, _location, _w, _h, _bytes)); } -inline uint32 MTPvideo::innerLength() const { - switch (_type) { - case mtpc_videoEmpty: { - const MTPDvideoEmpty &v(c_videoEmpty()); - return v.vid.innerLength(); - } - case mtpc_video: { - const MTPDvideo &v(c_video()); - return v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vdate.innerLength() + v.vduration.innerLength() + v.vmime_type.innerLength() + v.vsize.innerLength() + v.vthumb.innerLength() + v.vdc_id.innerLength() + v.vw.innerLength() + v.vh.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPvideo::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPvideo::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_videoEmpty: _type = cons; { - if (!data) setData(new MTPDvideoEmpty()); - MTPDvideoEmpty &v(_videoEmpty()); - v.vid.read(from, end); - } break; - case mtpc_video: _type = cons; { - if (!data) setData(new MTPDvideo()); - MTPDvideo &v(_video()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - v.vdate.read(from, end); - v.vduration.read(from, end); - v.vmime_type.read(from, end); - v.vsize.read(from, end); - v.vthumb.read(from, end); - v.vdc_id.read(from, end); - v.vw.read(from, end); - v.vh.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPvideo"); - } -} -inline void MTPvideo::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_videoEmpty: { - const MTPDvideoEmpty &v(c_videoEmpty()); - v.vid.write(to); - } break; - case mtpc_video: { - const MTPDvideo &v(c_video()); - v.vid.write(to); - v.vaccess_hash.write(to); - v.vdate.write(to); - v.vduration.write(to); - v.vmime_type.write(to); - v.vsize.write(to); - v.vthumb.write(to); - v.vdc_id.write(to); - v.vw.write(to); - v.vh.write(to); - } break; - } -} -inline MTPvideo::MTPvideo(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_videoEmpty: setData(new MTPDvideoEmpty()); break; - case mtpc_video: setData(new MTPDvideo()); break; - default: throw mtpErrorBadTypeId(type, "MTPvideo"); - } -} -inline MTPvideo::MTPvideo(MTPDvideoEmpty *_data) : mtpDataOwner(_data), _type(mtpc_videoEmpty) { -} -inline MTPvideo::MTPvideo(MTPDvideo *_data) : mtpDataOwner(_data), _type(mtpc_video) { -} -inline MTPvideo MTP_videoEmpty(const MTPlong &_id) { - return MTPvideo(new MTPDvideoEmpty(_id)); -} -inline MTPvideo MTP_video(const MTPlong &_id, const MTPlong &_access_hash, MTPint _date, MTPint _duration, const MTPstring &_mime_type, MTPint _size, const MTPPhotoSize &_thumb, MTPint _dc_id, MTPint _w, MTPint _h) { - return MTPvideo(new MTPDvideo(_id, _access_hash, _date, _duration, _mime_type, _size, _thumb, _dc_id, _w, _h)); -} - inline uint32 MTPgeoPoint::innerLength() const { switch (_type) { case mtpc_geoPoint: { diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index d8c3c7bb9a..499823df8e 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -150,9 +150,6 @@ inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia; inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia; inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia; inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia; -inputMediaUploadedVideo#82713fdf file:InputFile duration:int w:int h:int mime_type:string caption:string = InputMedia; -inputMediaUploadedThumbVideo#7780ddf9 file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string caption:string = InputMedia; -inputMediaVideo#936a4ebd id:InputVideo caption:string = InputMedia; inputMediaUploadedDocument#1d89306d file:InputFile mime_type:string attributes:Vector caption:string = InputMedia; inputMediaUploadedThumbDocument#ad613491 file:InputFile thumb:InputFile mime_type:string attributes:Vector caption:string = InputMedia; inputMediaDocument#1a77f29c id:InputDocument caption:string = InputMedia; @@ -169,11 +166,7 @@ inputGeoPoint#f3b7acc9 lat:double long:double = InputGeoPoint; inputPhotoEmpty#1cd7bf0d = InputPhoto; inputPhoto#fb95c6c4 id:long access_hash:long = InputPhoto; -inputVideoEmpty#5508ec75 = InputVideo; -inputVideo#ee579652 id:long access_hash:long = InputVideo; - inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation; -inputVideoFileLocation#3d0364ec id:long access_hash:long = InputFileLocation; inputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation; inputDocumentFileLocation#4e45abe9 id:long access_hash:long = InputFileLocation; @@ -238,7 +231,6 @@ messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:f messageMediaEmpty#3ded6320 = MessageMedia; messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia; -messageMediaVideo#5bcf1675 video:Video caption:string = MessageMedia; messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia; messageMediaContact#5e7d2f39 phone_number:string first_name:string last_name:string user_id:int = MessageMedia; messageMediaUnsupported#9f84f49e = MessageMedia; @@ -268,9 +260,6 @@ photoSizeEmpty#e17e23c type:string = PhotoSize; photoSize#77bfb61b type:string location:FileLocation w:int h:int size:int = PhotoSize; photoCachedSize#e9a734fa type:string location:FileLocation w:int h:int bytes:bytes = PhotoSize; -videoEmpty#c10658a8 id:long = Video; -video#f72887d3 id:long access_hash:long date:int duration:int mime_type:string size:int thumb:PhotoSize dc_id:int w:int h:int = Video; - geoPointEmpty#1117dd5f = GeoPoint; geoPoint#2049d70c long:double lat:double = GeoPoint; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 84905568bb..1aa2e0da4e 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1260,10 +1260,10 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _contextMenuLnk = textlnkOver(); PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); bool lnkIsAudio = lnkDocument ? lnkDocument->document()->voice() : false; - if (lnkPhoto || lnkVideo || lnkDocument) { + bool lnkIsVideo = lnkDocument ? lnkDocument->document()->isVideo() : false; + if (lnkPhoto || lnkDocument) { _menu = new PopupMenu(); if (App::hoveredLinkItem()) { _menu->addAction(lang(lng_context_to_msg), this, SLOT(goToMessage()))->setEnabled(true); @@ -1271,14 +1271,14 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkPhoto) { _menu->addAction(lang(lng_context_open_image), this, SLOT(openContextUrl()))->setEnabled(true); } else { - if ((lnkVideo && lnkVideo->video()->loading()) || (lnkDocument && lnkDocument->document()->loading())) { + if (lnkDocument && lnkDocument->document()->loading()) { _menu->addAction(lang(lng_context_cancel_download), this, SLOT(cancelContextDownload()))->setEnabled(true); } else { - if ((lnkVideo && !lnkVideo->video()->already(true).isEmpty()) || (lnkDocument && !lnkDocument->document()->already(true).isEmpty())) { + if (lnkDocument && !lnkDocument->document()->already(true).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); - _menu->addAction(lang(lnkVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkIsVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); } } if (isUponSelected > 1) { @@ -1501,35 +1501,27 @@ void OverviewInner::selectMessage() { } void OverviewInner::cancelContextDownload() { - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkVideo) { - lnkVideo->video()->cancel(); - } else if (lnkDocument) { + if (lnkDocument) { lnkDocument->document()->cancel(); } } void OverviewInner::showContextInFolder() { - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - QString already = lnkVideo ? lnkVideo->video()->already(true) : (lnkDocument ? lnkDocument->document()->already(true) : QString()); + QString already = lnkDocument ? lnkDocument->document()->already(true) : QString(); if (!already.isEmpty()) psShowInFolder(already); } void OverviewInner::saveContextFile() { - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkVideo) VideoSaveLink::doSave(lnkVideo->video(), true); if (lnkDocument) DocumentSaveLink::doSave(lnkDocument->document(), true); } void OverviewInner::openContextFile() { HistoryItem *was = App::hoveredLinkItem(); App::hoveredLinkItem(App::contextItem()); - VideoLink *lnkVideo = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkVideo) VideoOpenLink(lnkVideo->video()).onClick(Qt::LeftButton); if (lnkDocument) DocumentOpenLink(lnkDocument->document()).onClick(Qt::LeftButton); App::hoveredLinkItem(was); } @@ -1928,7 +1920,7 @@ LayoutMediaItem *OverviewInner::layoutPrepare(HistoryItem *item) { } else if (_type == OverviewVideos) { if (media && media->type() == MediaTypeVideo) { if ((i = _layoutItems.constFind(item)) == _layoutItems.cend()) { - i = _layoutItems.insert(item, new LayoutOverviewVideo(static_cast(media)->video(), item)); + i = _layoutItems.insert(item, new LayoutOverviewVideo(media->getDocument(), item)); i.value()->initDimensions(); } } diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index d396ebcb88..506acafa65 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -785,234 +785,6 @@ QString saveFileName(const QString &title, const QString &filter, const QString return name; } -void VideoOpenLink::onClick(Qt::MouseButton button) const { - if (button != Qt::LeftButton) return; - VideoData *data = video(); - - if (!data->date) return; - - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - - const FileLocation &location(data->location(true)); - if (!location.isEmpty()) { - psOpenFile(location.name()); - if (App::main()) App::main()->videoMarkRead(data); - return; - } - - if (data->status != FileReady) return; - - QString filename; - if (!data->saveToCache()) { - filename = saveFileName(lang(lng_save_video), qsl("MOV Video (*.mov);;All files (*.*)"), qsl("video"), qsl(".mov"), false); - if (filename.isEmpty()) return; - } - - data->save(filename, ActionOnLoadOpen, item ? item->fullId() : FullMsgId()); -} - -void VideoSaveLink::doSave(VideoData *data, bool forceSavingAs) { - if (!data->date) return; - - QString already = data->already(true); - bool openWith = !already.isEmpty(); - if (openWith && !forceSavingAs) { - QPoint pos(QCursor::pos()); - if (!psShowOpenWithMenu(pos.x(), pos.y(), already)) { - psOpenFile(already, true); - } - } else { - QFileInfo alreadyInfo(already); - QDir alreadyDir(already.isEmpty() ? QDir() : alreadyInfo.dir()); - QString name = already.isEmpty() ? QString(".mov") : alreadyInfo.fileName(); - QString filename = saveFileName(lang(lng_save_video), qsl("MOV Video (*.mov);;All files (*.*)"), qsl("video"), name, forceSavingAs, alreadyDir); - if (!filename.isEmpty()) { - ActionOnLoad action = already.isEmpty() ? ActionOnLoadNone : ActionOnLoadOpenWith; - FullMsgId actionMsgId = App::hoveredLinkItem() ? App::hoveredLinkItem()->fullId() : (App::contextItem() ? App::contextItem()->fullId() : FullMsgId()); - data->save(filename, action, actionMsgId); - } - } -} - -void VideoSaveLink::onClick(Qt::MouseButton button) const { - if (button != Qt::LeftButton) return; - doSave(video()); -} - -void VideoCancelLink::onClick(Qt::MouseButton button) const { - VideoData *data = video(); - if (!data->date || button != Qt::LeftButton) return; - - data->cancel(); -} - -VideoData::VideoData(const VideoId &id, const uint64 &access, int32 date, int32 duration, int32 w, int32 h, const ImagePtr &thumb, int32 dc, int32 size) -: id(id) -, access(access) -, date(date) -, duration(duration) -, w(w) -, h(h) -, thumb(thumb) -, dc(dc) -, size(size) -, status(FileReady) -, uploadOffset(0) -, _actionOnLoad(ActionOnLoadNone) -, _loader(0) { - _location = Local::readFileLocation(mediaKey(VideoFileLocation, dc, id)); -} - -void VideoData::forget() { - replyPreview->forget(); - thumb->forget(); -} - -void VideoData::performActionOnLoad() { - if (_actionOnLoad == ActionOnLoadNone) return; - - const FileLocation &loc(location(true)); - QString already = loc.name(); - if (already.isEmpty()) return; - - if (_actionOnLoad == ActionOnLoadOpenWith) { - QPoint pos(QCursor::pos()); - if (!psShowOpenWithMenu(pos.x(), pos.y(), already)) { - psOpenFile(already, true); - } - } else if (_actionOnLoad == ActionOnLoadOpen || _actionOnLoad == ActionOnLoadPlayInline) { - psOpenFile(already); - } - _actionOnLoad = ActionOnLoadNone; -} - -bool VideoData::loaded(bool check) const { - if (loading() && _loader->done()) { - if (_loader->fileType() == mtpc_storage_fileUnknown) { - _loader->deleteLater(); - _loader->rpcInvalidate(); - _loader = CancelledMtpFileLoader; - } else { - VideoData *that = const_cast(this); - that->_location = FileLocation(mtpToStorageType(_loader->fileType()), _loader->fileName()); - - _loader->deleteLater(); - _loader->rpcInvalidate(); - _loader = 0; - } - notifyLayoutChanged(); - } - return !already(check).isEmpty(); -} - -bool VideoData::loading() const { - return _loader && _loader != CancelledMtpFileLoader; -} - -bool VideoData::displayLoading() const { - return loading() ? (!_loader->loadingLocal() || !_loader->autoLoading()) : uploading(); -} - -float64 VideoData::progress() const { - if (uploading()) { - if (size > 0) { - return float64(uploadOffset) / size; - } - return 0; - } - return loading() ? _loader->currentProgress() : (loaded() ? 1 : 0); -} - -int32 VideoData::loadOffset() const { - return loading() ? _loader->currentOffset() : 0; -} - -bool VideoData::uploading() const { - return status == FileUploading; -} - -void VideoData::save(const QString &toFile, ActionOnLoad action, const FullMsgId &actionMsgId, LoadFromCloudSetting fromCloud, bool autoLoading) { - if (loaded(true)) { - const FileLocation &l(location(true)); - if (!toFile.isEmpty()) { - if (l.accessEnable()) { - QFile(l.name()).copy(toFile); - l.accessDisable(); - } - } - return; - } - - if (_loader == CancelledMtpFileLoader) _loader = 0; - if (_loader) { - if (!_loader->setFileName(toFile)) { - cancel(); - _loader = 0; - } - } - - _actionOnLoad = action; - _actionOnLoadMsgId = actionMsgId; - - if (_loader) { - if (fromCloud == LoadFromCloudOrLocal) _loader->permitLoadFromCloud(); - } else { - status = FileReady; - _loader = new mtpFileLoader(dc, id, access, VideoFileLocation, toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); - _loader->connect(_loader, SIGNAL(progress(FileLoader*)), App::main(), SLOT(videoLoadProgress(FileLoader*))); - _loader->connect(_loader, SIGNAL(failed(FileLoader*,bool)), App::main(), SLOT(videoLoadFailed(FileLoader*,bool))); - _loader->start(); - } - - notifyLayoutChanged(); -} - -void VideoData::cancel() { - if (!loading()) return; - - mtpFileLoader *l = _loader; - _loader = CancelledMtpFileLoader; - if (l) { - l->cancel(); - l->deleteLater(); - l->rpcInvalidate(); - - notifyLayoutChanged(); - } - _actionOnLoad = ActionOnLoadNone; -} - -void VideoData::notifyLayoutChanged() const { - const VideoItems &items(App::videoItems()); - VideoItems::const_iterator i = items.constFind(const_cast(this)); - if (i != items.cend()) { - for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) { - Notify::historyItemLayoutChanged(j.key()); - } - } -} - -QString VideoData::already(bool check) const { - return location(check).name(); -} - -QByteArray VideoData::data() const { - return QByteArray(); -} - -const FileLocation &VideoData::location(bool check) const { - if (check && !_location.check()) { - const_cast(this)->_location = Local::readFileLocation(mediaKey(VideoFileLocation, dc, id)); - } - return _location; -} - -void VideoData::setLocation(const FileLocation &loc) { - if (loc.check()) { - _location = loc; - } -} - bool StickerData::setInstalled() const { switch (set.type()) { case mtpc_inputStickerSetID: { @@ -1031,6 +803,39 @@ bool StickerData::setInstalled() const { return false; } +QString documentSaveFilename(DocumentData *data, bool forceSavingAs = false, const QString already = QString(), const QDir &dir = QDir()) { + QString name, filter, caption, prefix; + MimeType mimeType = mimeTypeForName(data->mime); + QStringList p = mimeType.globPatterns(); + QString pattern = p.isEmpty() ? QString() : p.front(); + if (data->voice()) { + bool mp3 = (data->mime == qstr("audio/mp3")); + name = already.isEmpty() ? (mp3 ? qsl(".mp3") : qsl(".ogg")) : already; + filter = mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"); + caption = lang(lng_save_audio); + prefix = qsl("audio"); + } else if (data->isVideo()) { + name = already.isEmpty() ? qsl(".mov") : already; + filter = qsl("MOV Video (*.mov);;All files (*.*)"); + caption = lang(lng_save_video); + prefix = qsl("video"); + } else { + name = already.isEmpty() ? data->name : already; + if (name.isEmpty()) { + name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); + } + if (pattern.isEmpty()) { + filter = QString(); + } else { + filter = mimeType.filterString() + qsl(";;All files (*.*)"); + } + caption = lang(lng_save_file); + prefix = qsl("doc"); + } + + return saveFileName(caption, filter, prefix, name, forceSavingAs, dir); +} + void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { if (!data->date) return; @@ -1052,7 +857,7 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { audioPlayer()->play(audio); if (App::main()) { App::main()->audioPlayProgress(audio); - App::main()->audioMarkRead(data); + App::main()->mediaMarkRead(data); } } } else if (playMusic) { @@ -1066,9 +871,9 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { audioPlayer()->play(song); if (App::main()) App::main()->documentPlayProgress(song); } - } else if (data->voice()) { + } else if (data->voice() || data->isVideo()) { psOpenFile(location.name()); - if (App::main()) App::main()->audioMarkRead(data); + if (App::main()) App::main()->mediaMarkRead(data); } else if (data->size < MediaViewImageSizeLimit) { if (!data->data().isEmpty() && playAnimation) { if (action == ActionOnLoadPlayInline) { @@ -1100,33 +905,7 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { QString filename; if (!data->saveToCache()) { - QString name, filter, caption, prefix; - MimeType mimeType = mimeTypeForName(data->mime); - QStringList p = mimeType.globPatterns(); - QString pattern = p.isEmpty() ? QString() : p.front(); - if (data->voice()) { - bool mp3 = (data->mime == qstr("audio/mp3")); - name = mp3 ? qsl(".mp3") : qsl(".ogg"); - filter = mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"); - caption = lang(lng_save_audio); - prefix = qsl("audio"); - } else { - if (data->name.isEmpty()) { - name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); - } else { - name = data->name; - } - if (pattern.isEmpty()) { - filter = QString(); - } else { - filter = mimeType.filterString() + qsl(";;All files (*.*)"); - } - caption = lang(lng_save_file); - prefix = qsl("doc"); - } - - filename = saveFileName(caption, filter, prefix, name, false); - + filename = documentSaveFilename(data); if (filename.isEmpty()) return; } @@ -1159,34 +938,10 @@ void DocumentSaveLink::doSave(DocumentData *data, bool forceSavingAs) { psOpenFile(already, true); } } else { - QFileInfo alreadyInfo(already); QDir alreadyDir(already.isEmpty() ? QDir() : alreadyInfo.dir()); - QString caption, filter, prefix, name; - MimeType mimeType = mimeTypeForName(data->mime); - QStringList p = mimeType.globPatterns(); - QString pattern = p.isEmpty() ? QString() : p.front(); - if (data->voice()) { - bool mp3 = (data->mime == qstr("audio/mp3")); - caption = lang(lng_save_audio); - filter = mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"); - prefix = qsl("audio"); - name = already.isEmpty() ? (mp3 ? qsl(".mp3") : qsl(".ogg")) : alreadyInfo.fileName(); - } else { - caption = lang(lng_save_file); - if (pattern.isEmpty()) { - filter = QString(); - } else { - filter = mimeType.filterString() + qsl(";;All files (*.*)"); - } - prefix = qsl("doc"); - name = already.isEmpty() ? data->name : alreadyInfo.fileName(); - if (name.isEmpty()) { - name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); - } - } - - QString filename = saveFileName(caption, filter, prefix, name, forceSavingAs, alreadyDir); + QString alreadyName(already.isEmpty() ? QString() : alreadyInfo.fileName()); + QString filename = documentSaveFilename(data, forceSavingAs, alreadyName, alreadyDir); if (!filename.isEmpty()) { ActionOnLoad action = already.isEmpty() ? ActionOnLoadNone : ActionOnLoadOpenWith; FullMsgId actionMsgId = App::hoveredLinkItem() ? App::hoveredLinkItem()->fullId() : (App::contextItem() ? App::contextItem()->fullId() : FullMsgId()); @@ -1242,7 +997,7 @@ DocumentData::DocumentData(const DocumentId &id, const uint64 &access, int32 dat , _actionOnLoad(ActionOnLoadNone) , _loader(0) { setattributes(attributes); - _location = Local::readFileLocation(mediaKey(voice() ? AudioFileLocation : DocumentFileLocation, dc, id)); + _location = Local::readFileLocation(mediaKey()); } void DocumentData::setattributes(const QVector &attributes) { @@ -1372,7 +1127,7 @@ void DocumentData::performActionOnLoad() { const FileLocation &loc(location(true)); QString already = loc.name(); HistoryItem *item = _actionOnLoadMsgId.msg ? App::histItemById(_actionOnLoadMsgId) : 0; - bool showImage = item && (size < MediaViewImageSizeLimit); + bool showImage = !isVideo() && item && (size < MediaViewImageSizeLimit); bool playVoice = voice() && audioPlayer() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && item; bool playMusic = song() && audioPlayer() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && item; bool playAnimation = isAnimation() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && showImage && item->getMedia(); @@ -1385,7 +1140,7 @@ void DocumentData::performActionOnLoad() { audioPlayer()->pauseresume(OverviewVoiceFiles); } else { audioPlayer()->play(AudioMsgId(this, _actionOnLoadMsgId)); - if (App::main()) App::main()->audioMarkRead(this); + if (App::main()) App::main()->mediaMarkRead(this); } } } else if (playMusic) { @@ -1413,16 +1168,14 @@ void DocumentData::performActionOnLoad() { if (already.isEmpty()) return; if (_actionOnLoad == ActionOnLoadOpenWith) { - if (already.isEmpty()) return; - QPoint pos(QCursor::pos()); if (!psShowOpenWithMenu(pos.x(), pos.y(), already)) { psOpenFile(already, true); } } else if (_actionOnLoad == ActionOnLoadOpen || _actionOnLoad == ActionOnLoadPlayInline) { - if (voice()) { + if (voice() || isVideo()) { psOpenFile(already); - if (App::main()) App::main()->audioMarkRead(this); + if (App::main()) App::main()->mediaMarkRead(this); } else if (loc.accessEnable()) { if (showImage && QImageReader(loc.name()).canRead()) { if (_actionOnLoad == ActionOnLoadPlayInline) { @@ -1522,13 +1275,12 @@ void DocumentData::save(const QString &toFile, ActionOnLoad action, const FullMs if (fromCloud == LoadFromCloudOrLocal) _loader->permitLoadFromCloud(); } else { status = FileReady; - LocationType type = voice() ? AudioFileLocation : DocumentFileLocation; + LocationType type = voice() ? AudioFileLocation : (isVideo() ? VideoFileLocation : DocumentFileLocation); _loader = new mtpFileLoader(dc, id, access, type, toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); _loader->connect(_loader, SIGNAL(progress(FileLoader*)), App::main(), SLOT(documentLoadProgress(FileLoader*))); _loader->connect(_loader, SIGNAL(failed(FileLoader*,bool)), App::main(), SLOT(documentLoadFailed(FileLoader*,bool))); _loader->start(); } - notifyLayoutChanged(); } @@ -1586,8 +1338,7 @@ QByteArray DocumentData::data() const { const FileLocation &DocumentData::location(bool check) const { if (check && !_location.check()) { - LocationType type = voice() ? AudioFileLocation : DocumentFileLocation; - const_cast(this)->_location = Local::readFileLocation(mediaKey(type, dc, id)); + const_cast(this)->_location = Local::readFileLocation(mediaKey()); } return _location; } @@ -1632,7 +1383,7 @@ bool fileIsImage(const QString &name, const QString &mime) { } void DocumentData::recountIsImage() { - if (isAnimation() || type == VideoDocument) return; + if (isAnimation() || isVideo()) return; _duration = fileIsImage(name, mime) ? 1 : -1; // hack } diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 38ed72308b..887ab0ebf5 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -815,105 +815,6 @@ enum FileStatus { FileReady = 1, }; -class VideoData { -public: - VideoData(const VideoId &id, const uint64 &access = 0, int32 date = 0, int32 duration = 0, int32 w = 0, int32 h = 0, const ImagePtr &thumb = ImagePtr(), int32 dc = 0, int32 size = 0); - - void automaticLoad(const HistoryItem *item) { - } - void automaticLoadSettingsChanged() { - } - - bool loaded(bool check = false) const; - bool loading() const; - bool displayLoading() const; - void save(const QString &toFile, ActionOnLoad action = ActionOnLoadNone, const FullMsgId &actionMsgId = FullMsgId(), LoadFromCloudSetting fromCloud = LoadFromCloudOrLocal, bool autoLoading = false); - void cancel(); - float64 progress() const; - int32 loadOffset() const; - bool uploading() const; - - QString already(bool check = false) const; - QByteArray data() const; - const FileLocation &location(bool check = false) const; - void setLocation(const FileLocation &loc); - - bool saveToCache() const { - return false; - } - - void performActionOnLoad(); - - void forget(); - - VideoId id; - uint64 access; - int32 date; - int32 duration; - int32 w, h; - ImagePtr thumb, replyPreview; - int32 dc, size; - // geo, caption - - FileStatus status; - int32 uploadOffset; - -private: - FileLocation _location; - - ActionOnLoad _actionOnLoad; - FullMsgId _actionOnLoadMsgId; - mutable mtpFileLoader *_loader; - - void notifyLayoutChanged() const; - -}; - -class VideoLink : public ITextLink { - TEXT_LINK_CLASS(VideoLink) - -public: - VideoLink(VideoData *video) : _video(video) { - } - VideoData *video() const { - return _video; - } - -private: - VideoData *_video; - -}; - -class VideoSaveLink : public VideoLink { - TEXT_LINK_CLASS(VideoSaveLink) - -public: - VideoSaveLink(VideoData *video) : VideoLink(video) { - } - static void doSave(VideoData *video, bool forceSavingAs = false); - void onClick(Qt::MouseButton button) const; -}; - -class VideoOpenLink : public VideoLink { - TEXT_LINK_CLASS(VideoOpenLink) - -public: - VideoOpenLink(VideoData *video) : VideoLink(video) { - } - void onClick(Qt::MouseButton button) const; - -}; - -class VideoCancelLink : public VideoLink { - TEXT_LINK_CLASS(VideoCancelLink) - -public: - VideoCancelLink(VideoData *video) : VideoLink(video) { - } - void onClick(Qt::MouseButton button) const; - -}; - enum DocumentType { FileDocument = 0, VideoDocument = 1, @@ -1026,11 +927,14 @@ public: bool isMusic() const { return (type == SongDocument) ? !static_cast(_additional)->title.isEmpty() : false; } + bool isVideo() const { + return (type == VideoDocument); + } int32 duration() const { - return (isAnimation() || type == VideoDocument) ? _duration : -1; + return (isAnimation() || isVideo()) ? _duration : -1; } bool isImage() const { - return !isAnimation() && (type != VideoDocument) && (_duration > 0); + return !isAnimation() && !isVideo() && (_duration > 0); } void recountIsImage(); void setData(const QByteArray &data) { @@ -1054,6 +958,11 @@ public: int32 md5[8]; + MediaKey mediaKey() const { + LocationType t = isVideo() ? VideoFileLocation : (voice() ? AudioFileLocation : DocumentFileLocation); + return ::mediaKey(t, dc, id); + } + private: FileLocation _location; diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index b3fb139f2b..497627b7a6 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -1044,6 +1044,8 @@ const InterfacesMetadata *GetInterfacesMetadata(uint64 mask) { return i.value(); } +const InterfacesMetadata *Interfaces::ZeroInterfacesMetadata = GetInterfacesMetadata(0); + InterfaceWrapStruct InterfaceWraps[64]; QAtomicInt InterfaceIndexLast(0); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 11fe4f8108..a87d0fa679 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -647,15 +647,16 @@ const InterfacesMetadata *GetInterfacesMetadata(uint64 mask); class Interfaces { public: - Interfaces(uint64 mask = 0) : _data(0) { + Interfaces(uint64 mask = 0) : _data(zerodata()) { if (mask) { const InterfacesMetadata *meta = GetInterfacesMetadata(mask); int32 size = sizeof(const InterfacesMetadata *) + meta->size; - _data = malloc(size); - if (!_data) { // terminate if we can't allocate memory + void *data = malloc(size); + if (!data) { // terminate if we can't allocate memory throw "Can't allocate memory!"; } + _data = data; _meta() = meta; for (int i = 0; i < meta->last; ++i) { int offset = meta->offsets[i]; @@ -677,12 +678,11 @@ public: } } void UpdateInterfaces(uint64 mask = 0) { - if (!_data && !mask) return; - if (!_data || !_meta()->equals(mask)) { + if (!_meta()->equals(mask)) { Interfaces tmp(mask); tmp.swap(*this); - if (_data && tmp._data) { + 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]; @@ -694,7 +694,7 @@ public: } } ~Interfaces() { - if (_data) { + if (_data != zerodata()) { const InterfacesMetadata *meta = _meta(); for (int i = 0; i < meta->last; ++i) { int offset = meta->offsets[i]; @@ -716,6 +716,10 @@ public: } private: + static const InterfacesMetadata *ZeroInterfacesMetadata; + static void *zerodata() { + return &ZeroInterfacesMetadata; + } void *_dataptrunsafe(int skip) const { return (char*)_data + sizeof(const InterfacesMetadata*) + skip; From 2e60f23733883d202ebc75cc0fa5cc35109fc87a Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 12 Feb 2016 21:21:03 +0300 Subject: [PATCH 077/316] icons fixed for megagroups in username search results and notifications --- Telegram/SourceFiles/dialogswidget.cpp | 2 +- Telegram/SourceFiles/window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index ca7b364e03..9e59115339 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -258,7 +258,7 @@ void DialogsInner::peopleResultPaint(PeerData *peer, Painter &p, int32 w, bool a QRect rectForName(nameleft, st::dlgPaddingVer + st::dlgNameTop, namewidth, st::msgNameFont->height); // draw chat icon - if (peer->isChat()) { + if (peer->isChat() || peer->isMegagroup()) { p.drawPixmap(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), App::sprite(), (act ? st::dlgActiveChatImg : st::dlgChatImg)); rectForName.setLeft(rectForName.left() + st::dlgImgSkip); } else if (peer->isChannel()) { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 801b0d0f24..aad4e29982 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -183,7 +183,7 @@ void NotifyWindow::updateNotifyDisplay() { QRect rectForName(st::notifyPhotoPos.x() + st::notifyPhotoSize + st::notifyTextLeft, st::notifyTextTop, itemWidth, st::msgNameFont->height); if (!App::passcoded() && cNotifyView() <= dbinvShowName) { - if (history->peer->isChat()) { + if (history->peer->isChat() || history->peer->isMegagroup()) { p.drawPixmap(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), App::sprite(), st::dlgChatImg); rectForName.setLeft(rectForName.left() + st::dlgImgSkip); } else if (history->peer->isChannel()) { From 759e062bcc7f9bcfd0fa66d64381d4a51cbcb935 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 13 Feb 2016 14:21:03 +0300 Subject: [PATCH 078/316] sending only reports with dumps, report tag added --- Telegram/SourceFiles/window.cpp | 34 +++++++++++++++++++++++++-------- Telegram/SourceFiles/window.h | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index aad4e29982..593925800e 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1995,6 +1995,7 @@ LastCrashedWindow::LastCrashedWindow() : _port(80) , _label(this) , _pleaseSendReport(this) +, _yourReportName(this) , _minidump(this) , _report(this) , _send(this) @@ -2007,7 +2008,7 @@ LastCrashedWindow::LastCrashedWindow() , _reportText(QString::fromUtf8(Sandbox::LastCrashDump())) , _reportShown(false) , _reportSaved(false) -, _sendingState(((!cDevVersion() && !cBetaVersion()) || Sandbox::LastCrashDump().isEmpty()) ? SendingNoReport : SendingUpdateCheck) +, _sendingState(Sandbox::LastCrashDump().isEmpty() ? SendingNoReport : SendingUpdateCheck) , _updating(this) , _sendingProgress(0) , _sendingTotal(0) @@ -2018,7 +2019,9 @@ LastCrashedWindow::LastCrashedWindow() , _updatingSkip(this, false) #endif { - + if (!cDevVersion() && !cBetaVersion()) { + _sendingState = SendingNoReport; + } if (_sendingState != SendingNoReport) { qint64 dumpsize = 0; QString dumpspath = cWorkingDir() + qsl("tdata/dumps"); @@ -2061,8 +2064,11 @@ LastCrashedWindow::LastCrashedWindow() _minidumpFull = maxDumpFull; } } - - _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(dumpsize / 1024)); + if (_minidumpName.isEmpty()) { + _sendingState = SendingNoReport; + } else { + _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(dumpsize / 1024)); + } } _networkSettings.setText(qsl("NETWORK SETTINGS")); @@ -2105,6 +2111,9 @@ LastCrashedWindow::LastCrashedWindow() #endif _pleaseSendReport.setText(qsl("Please send us a crash report.")); + _yourReportName.setText(qsl("Your crash report tag: %1").arg(_minidumpName)); + _yourReportName.setCursor(style::cur_text); + _yourReportName.setTextInteractionFlags(Qt::TextSelectableByMouse); _report.setPlainText(_reportText); @@ -2411,6 +2420,7 @@ void LastCrashedWindow::updateControls() { _sendSkip.hide(); _continue.hide(); _pleaseSendReport.hide(); + _yourReportName.hide(); _getApp.hide(); _showReport.hide(); _report.hide(); @@ -2427,6 +2437,7 @@ void LastCrashedWindow::updateControls() { h += padding + _updatingCheck.height() + padding; if (_sendingState == SendingNoReport) { _pleaseSendReport.hide(); + _yourReportName.hide(); _getApp.hide(); _showReport.hide(); _report.hide(); @@ -2436,14 +2447,17 @@ void LastCrashedWindow::updateControls() { _sendSkip.hide(); _continue.show(); } else { - h += _showReport.height() + padding; + h += _showReport.height() + padding + _yourReportName.height() + padding; _pleaseSendReport.show(); + _yourReportName.show(); if (_sendingState == SendingTooOld || _sendingState == SendingUnofficial) { QString verStr = getReportField(qstr("version"), qstr("Version:")); qint64 ver = verStr.isEmpty() ? 0 : verStr.toLongLong(); if (!ver || (ver == AppVersion) || (ver < 0 && (-ver / 1000) == AppVersion)) { h += _getApp.height() + padding; _getApp.show(); + h -= _yourReportName.height() + padding; // hide report name + _yourReportName.hide(); } else { _getApp.hide(); } @@ -2498,6 +2512,7 @@ void LastCrashedWindow::updateControls() { } else { _getApp.hide(); _pleaseSendReport.hide(); + _yourReportName.hide(); _showReport.hide(); _report.hide(); _minidump.hide(); @@ -2519,6 +2534,7 @@ void LastCrashedWindow::updateControls() { h += padding + _send.height() + padding; if (_sendingState == SendingNoReport) { _pleaseSendReport.hide(); + _yourReportName.hide(); _showReport.hide(); _report.hide(); _minidump.hide(); @@ -2528,8 +2544,9 @@ void LastCrashedWindow::updateControls() { _continue.show(); _networkSettings.hide(); } else { - h += _showReport.height() + padding; + h += _showReport.height() + padding + _yourReportName.height() + padding; _pleaseSendReport.show(); + _yourReportName.show(); if (_reportShown) { h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding)); _report.show(); @@ -2771,6 +2788,7 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) { #ifndef TDESKTOP_DISABLE_AUTOUPDATE _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); _showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding); + _yourReportName.move(padding, _showReport.y() + _showReport.height() + padding); _getApp.move((width() - _getApp.width()) / 2, _showReport.y() + _showReport.height() + padding); if (_sendingState == SendingFail || _sendingState == SendingProgress) { @@ -2791,11 +2809,11 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) { _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); _showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); + _yourReportName.move(padding, _showReport.y() + _showReport.height() + padding); _networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); #endif - - _report.setGeometry(padding, _showReport.y() + _showReport.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); + _report.setGeometry(padding, _yourReportName.y() + _yourReportName.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); _minidump.move(padding, _report.y() + _report.height() + padding); _saveReport.move(_showReport.x(), _showReport.y()); diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index 4efcdd318c..63c1675d00 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -459,7 +459,7 @@ private: QString _host, _username, _password; quint32 _port; - PreLaunchLabel _label, _pleaseSendReport, _minidump; + PreLaunchLabel _label, _pleaseSendReport, _yourReportName, _minidump; PreLaunchLog _report; PreLaunchButton _send, _sendSkip, _networkSettings, _continue, _showReport, _saveReport, _getApp; From f5dd8f8112f0d45beacddc66bd9b88776b492288 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 13 Feb 2016 16:08:28 +0300 Subject: [PATCH 079/316] fixed webpage preview layout, switched to abridged version of the tcp protocol --- Telegram/SourceFiles/gui/text.cpp | 27 +++- .../SourceFiles/mtproto/mtpConnection.cpp | 132 +++++++++++++----- Telegram/SourceFiles/mtproto/mtpConnection.h | 12 +- 3 files changed, 127 insertions(+), 44 deletions(-) diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 0837eaeb8a..00f31d3041 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -455,6 +455,25 @@ public: } } + bool readSkipBlockCommand() { + const QChar *afterCmd = textSkipCommand(ptr, end, links.size() < 0x7FFF); + if (afterCmd == ptr) { + return false; + } + + ushort cmd = (++ptr)->unicode(); + ++ptr; + + switch (cmd) { + case TextCommandSkipBlock: + createSkipBlock(ptr->unicode(), (ptr + 1)->unicode()); + break; + } + + ptr = afterCmd; + return true; + } + bool readCommand() { const QChar *afterCmd = textSkipCommand(ptr, end, links.size() < 0x7FFF); if (afterCmd == ptr) { @@ -530,7 +549,6 @@ public: } break; case TextCommandSkipBlock: - createBlock(); createSkipBlock(ptr->unicode(), (ptr + 1)->unicode()); break; @@ -703,6 +721,13 @@ public: if (sumFinished || _t->_text.size() >= 0x8000) break; // 32k max } createBlock(); + if (sumFinished && rich) { // we could've skipped the final skip block command + for (; ptr < end; ++ptr) { + if (*ptr == TextCommand && readSkipBlockCommand()) { + break; + } + } + } removeFlags.clear(); _t->_links.resize(maxLnkIndex); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index b1bfac554c..dcde71a52a 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -405,33 +405,44 @@ namespace { return mayBeBadKey; } - mtpBuffer _handleTcpResponse(mtpPrime *packet, uint32 size) { - if (size < 4 || size * sizeof(mtpPrime) > MTPPacketSizeMax) { - LOG(("TCP Error: bad packet size %1").arg(size * sizeof(mtpPrime))); + uint32 _tcpPacketSize(const char *packet) { // must have at least 4 bytes readable + uint32 result = (packet[0] > 0) ? packet[0] : 0; + if (result == 0x7f) { + const uchar *bytes = reinterpret_cast(packet); + result = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); + return (result << 2) + 4; + } + return (result << 2) + 1; + } + + mtpBuffer _handleTcpResponse(const char *packet, uint32 length) { + if (length < 5 || length > MTPPacketSizeMax) { + LOG(("TCP Error: bad packet size %1").arg(length)); return mtpBuffer(1, -500); } - if (packet[0] != int32(size * sizeof(mtpPrime))) { + int32 size = packet[0], len = length - 1; + if (size == 0x7f) { + const uchar *bytes = reinterpret_cast(packet); + size = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); + len -= 3; + } + if (size * sizeof(mtpPrime) != len) { LOG(("TCP Error: bad packet header")); - TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, size * sizeof(mtpPrime)).str())); + TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); return mtpBuffer(1, -500); } - if (packet[size - 1] != hashCrc32(packet, (size - 1) * sizeof(mtpPrime))) { - LOG(("TCP Error: bad packet checksum")); - TCP_LOG(("TCP Error: bad packet checksum, packet: %1").arg(Logs::mb(packet, size * sizeof(mtpPrime)).str())); - return mtpBuffer(1, -500); - } - TCP_LOG(("TCP Info: packet received, num = %1, size = %2").arg(packet[1]).arg(size * sizeof(mtpPrime))); - if (size == 4) { - if (packet[2] == -429) { + TCP_LOG(("TCP Info: packet received, size = %1").arg(size * sizeof(mtpPrime))); + if (size == 1) { + if (packet[0] == -429) { LOG(("Protocol Error: -429 flood code returned!")); } else { - LOG(("TCP Error: error packet received, code = %1").arg(packet[2])); + LOG(("TCP Error: error packet received, code = %1").arg(packet[0])); } - return mtpBuffer(1, packet[2]); + return mtpBuffer(1, packet[0]); } - mtpBuffer data(size - 3); - memcpy(data.data(), packet + 2, (size - 3) * sizeof(mtpPrime)); + mtpBuffer data(size); + memcpy(data.data(), packet + (length - len), size * sizeof(mtpPrime)); return data; } @@ -557,7 +568,7 @@ void MTPabstractTcpConnection::socketRead() { if (packetLeft) { packetLeft -= bytes; if (!packetLeft) { - socketPacket((mtpPrime*)(currentPos - packetRead), packetRead >> 2); + socketPacket(currentPos - packetRead, packetRead); currentPos = (char*)shortBuffer; packetRead = packetLeft = 0; readingToShort = true; @@ -568,14 +579,14 @@ void MTPabstractTcpConnection::socketRead() { } else { bool move = false; while (packetRead >= 4) { - uint32 packetSize = *(uint32*)(currentPos - packetRead); - if (packetSize < 16 || packetSize > MTPPacketSizeMax || (packetSize & 0x03)) { + uint32 packetSize = _tcpPacketSize(currentPos - packetRead); + if (packetSize < 5 || packetSize > MTPPacketSizeMax) { LOG(("TCP Error: packet size = %1").arg(packetSize)); emit error(); return; } if (packetRead >= packetSize) { - socketPacket((mtpPrime*)(currentPos - packetRead), packetSize >> 2); + socketPacket(currentPos - packetRead, packetSize); packetRead -= packetSize; packetLeft = 0; move = true; @@ -704,15 +715,41 @@ void MTPautoConnection::sendData(mtpBuffer &buffer) { } } +uint32 FourCharsToUInt(char ch1, char ch2, char ch3, char ch4) { + char ch[4] = { ch1, ch2, ch3, ch4 }; + return *reinterpret_cast(ch); +} + void MTPautoConnection::tcpSend(mtpBuffer &buffer) { - uint32 size = buffer.size(), len = size * 4; + if (!packetNum) { + char nonce[64]; + uint32 *first = reinterpret_cast(nonce), *second = first + 1; + uint32 g1 = FourCharsToUInt('P', 'O', 'S', 'T'), g2 = FourCharsToUInt('G', 'E', 'T', ' '), g3 = FourCharsToUInt('H', 'E', 'A', 'D'); + uint32 first1 = 0x44414548U, first2 = 0x54534f50U, first3 = 0x20544547U, first4 = 0x20544547U, first5 = 0xeeeeeeeeU; + uint32 second1 = 0; + do { + memset_rand(nonce, sizeof(nonce)); + } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || nonce[0] == 0xef); + sock.write(nonce, sizeof(nonce)); + } + ++packetNum; - buffer[0] = len; - buffer[1] = packetNum++; - buffer[size - 1] = hashCrc32(&buffer[0], len - 4); - TCP_LOG(("TCP Info: write %1 packet %2 bytes").arg(packetNum).arg(len)); + uint32 size = buffer.size() - 3, len = size * 4; + char *data = reinterpret_cast(&buffer[0]); + if (size < 0x7f) { + data[7] = char(size); + TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 1)); - sock.write((const char*)&buffer[0], len); + sock.write(data + 7, len + 1); + } else { + data[4] = 0x7f; + reinterpret_cast(data)[5] = uchar(size & 0xFF); + reinterpret_cast(data)[6] = uchar((size >> 8) & 0xFF); + reinterpret_cast(data)[7] = uchar((size >> 16) & 0xFF); + TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 4)); + + sock.write(data + 4, len + 4); + } } void MTPautoConnection::httpSend(mtpBuffer &buffer) { @@ -831,10 +868,10 @@ void MTPautoConnection::requestFinished(QNetworkReply *reply) { } } -void MTPautoConnection::socketPacket(mtpPrime *packet, uint32 size) { +void MTPautoConnection::socketPacket(const char *packet, uint32 length) { if (status == FinishedWork) return; - mtpBuffer data = _handleTcpResponse(packet, size); + mtpBuffer data = _handleTcpResponse(packet, length); if (data.size() == 1) { if (status == WaitingBoth) { status = WaitingHttp; @@ -984,14 +1021,35 @@ void MTPtcpConnection::sendData(mtpBuffer &buffer) { return; } - uint32 size = buffer.size(), len = size * 4; + if (!packetNum) { + char nonce[64]; + uint32 *first = reinterpret_cast(nonce), *second = first + 1; + uint32 g1 = FourCharsToUInt('P', 'O', 'S', 'T'), g2 = FourCharsToUInt('G', 'E', 'T', ' '), g3 = FourCharsToUInt('H', 'E', 'A', 'D'); + uint32 first1 = 0x44414548U, first2 = 0x54534f50U, first3 = 0x20544547U, first4 = 0x20544547U, first5 = 0xeeeeeeeeU; + uint32 second1 = 0; + do { + memset_rand(nonce, sizeof(nonce)); + } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || nonce[0] == 0xef); + sock.write(nonce, sizeof(nonce)); + } + ++packetNum; - buffer[0] = len; - buffer[1] = packetNum++; - buffer[size - 1] = hashCrc32(&buffer[0], len - 4); - TCP_LOG(("TCP Info: write %1 packet %2 bytes %3").arg(packetNum).arg(len).arg(Logs::mb(&buffer[0], len).str())); + uint32 size = buffer.size() - 3, len = size * 4; + char *data = reinterpret_cast(&buffer[0]); + if (size < 0x7f) { + data[7] = char(size); + TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 1)); - sock.write((const char*)&buffer[0], len); + sock.write(data + 7, len + 1); + } else { + data[4] = 0x7f; + reinterpret_cast(data)[5] = uchar(size & 0xFF); + reinterpret_cast(data)[6] = uchar((size >> 8) & 0xFF); + reinterpret_cast(data)[7] = uchar((size >> 16) & 0xFF); + TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 4)); + + sock.write(data + 4, len + 4); + } } void MTPtcpConnection::disconnectFromServer() { @@ -1011,10 +1069,10 @@ void MTPtcpConnection::connectToServer(const QString &addr, int32 port, int32 fl sock.connectToHost(QHostAddress(_addr), _port); } -void MTPtcpConnection::socketPacket(mtpPrime *packet, uint32 size) { +void MTPtcpConnection::socketPacket(const char *packet, uint32 length) { if (status == FinishedWork) return; - mtpBuffer data = _handleTcpResponse(packet, size); + mtpBuffer data = _handleTcpResponse(packet, length); if (data.size() == 1) { bool mayBeBadKey = (data[0] == -410) && _sentEncrypted; emit error(mayBeBadKey); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 74d281ae4c..5674fc4012 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -168,7 +168,7 @@ protected: char *currentPos; mtpBuffer longBuffer; mtpPrime shortBuffer[MTPShortBufferSize]; - virtual void socketPacket(mtpPrime *packet, uint32 packetSize) = 0; + virtual void socketPacket(const char *packet, uint32 length) = 0; }; @@ -203,7 +203,7 @@ public slots: protected: - void socketPacket(mtpPrime *packet, uint32 packetSize); + void socketPacket(const char *packet, uint32 length); private: @@ -261,7 +261,7 @@ public slots: protected: - void socketPacket(mtpPrime *packet, uint32 packetSize); + void socketPacket(const char *packet, uint32 length); private: @@ -285,7 +285,7 @@ class MTPhttpConnection : public MTPabstractConnection { public: MTPhttpConnection(QThread *thread); - + void sendData(mtpBuffer &buffer); void disconnectFromServer(); void connectToServer(const QString &addr, int32 port, int32 flags); @@ -441,7 +441,7 @@ private: // if badTime received - search for ids in sessionData->haveSent and sessionData->wereAcked and sync time/salt, return true if found bool requestsFixTimeSalt(const QVector &ids, int32 serverTime, uint64 serverSalt); - + // remove msgs with such ids from sessionData->haveSent, add to sessionData->wereAcked void requestsAcked(const QVector &ids, bool byResponse = false); @@ -491,7 +491,7 @@ private: MTPlong retry_id; int32 g; - + uchar aesKey[32], aesIV[32]; uint32 auth_key[64]; MTPlong auth_key_hash; From e492b1e93ddcebb72fc80066afd2294a2802fe22 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 14 Feb 2016 18:58:39 +0300 Subject: [PATCH 080/316] some crashes fixed --- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/application.cpp | 38 ++++++++++++++----------- Telegram/SourceFiles/application.h | 2 +- Telegram/SourceFiles/dialogswidget.cpp | 11 ++++--- Telegram/SourceFiles/gui/animation.cpp | 6 ++-- Telegram/SourceFiles/historywidget.cpp | 6 ++-- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/overviewwidget.cpp | 9 +++--- Telegram/SourceFiles/structs.cpp | 4 ++- 9 files changed, 47 insertions(+), 33 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index d36731ff79..9002e8aedf 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2469,7 +2469,7 @@ namespace App { QString phoneFromSharedContact(int32 userId) { SharedContactItems::const_iterator i = ::sharedContactItems.constFind(userId); - if (i != ::sharedContactItems.cend()) { + if (i != ::sharedContactItems.cend() && !i->isEmpty()) { HistoryMedia *media = i->cbegin().key()->getMedia(); if (media && media->type() == MediaTypeContact) { return static_cast(media)->phone(); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 41d26b0a74..1f8c6a8b50 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -689,6 +689,8 @@ namespace Sandbox { } AppClass::AppClass() : QObject() +, _lastActionTime(0) +, _window(0) , _uploader(0) , _translator(0) { AppObject = this; @@ -749,20 +751,21 @@ AppClass::AppClass() : QObject() application()->installNativeEventFilter(psNativeEventFilter()); - Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); + cChangeTimeFormat(QLocale::system().timeFormat(QLocale::ShortFormat)); connect(&_mtpUnpauseTimer, SIGNAL(timeout()), this, SLOT(doMtpUnpause())); connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions())); - cChangeTimeFormat(QLocale::system().timeFormat(QLocale::ShortFormat)); - DEBUG_LOG(("Application Info: starting app..")); QMimeDatabase().mimeTypeForName(qsl("text/plain")); // create mime database - _window.createWinId(); - _window.init(); + _window = new Window(); + _window->createWinId(); + _window->init(); + + Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); DEBUG_LOG(("Application Info: window created..")); @@ -785,18 +788,18 @@ AppClass::AppClass() : QObject() DEBUG_LOG(("Application Info: showing.")); if (state == Local::ReadMapPassNeeded) { - _window.setupPasscode(false); + _window->setupPasscode(false); } else { if (MTP::authedId()) { - _window.setupMain(false); + _window->setupMain(false); } else { - _window.setupIntro(false); + _window->setupIntro(false); } } - _window.firstShow(); + _window->firstShow(); if (cStartToSettings()) { - _window.showSettings(); + _window->showSettings(); } QNetworkProxyFactory::setUseSystemConfiguration(true); @@ -805,7 +808,7 @@ AppClass::AppClass() : QObject() checkMapVersion(); } - _window.updateIsActive(cOnlineFocusTimeout()); + _window->updateIsActive(cOnlineFocusTimeout()); } void AppClass::regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId) { @@ -922,7 +925,7 @@ void AppClass::checkLocalTime() { void AppClass::onAppStateChanged(Qt::ApplicationState state) { checkLocalTime(); - _window.updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); } void AppClass::killDownloadSessions() { @@ -1058,7 +1061,7 @@ void AppClass::checkMapVersion() { } if (!versionFeatures.isEmpty()) { versionFeatures = lng_new_version_wrap(lt_version, QString::fromStdWString(AppVersionStr), lt_changes, versionFeatures, lt_link, qsl("https://desktop.telegram.org/#changelog")); - _window.serviceNotification(versionFeatures); + _window->serviceNotification(versionFeatures); } } } @@ -1068,7 +1071,10 @@ void AppClass::checkMapVersion() { } AppClass::~AppClass() { - _window.setParent(0); + if (Window *w = _window) { + _window = 0; + delete w; + } anim::stopManager(); stopWebLoadManager(); @@ -1097,9 +1103,9 @@ AppClass *AppClass::app() { } Window *AppClass::wnd() { - return AppObject ? &AppObject->_window : 0; + return AppObject ? AppObject->_window : 0; } MainWidget *AppClass::main() { - return AppObject ? AppObject->_window.mainWidget() : 0; + return (AppObject && AppObject->_window) ? AppObject->_window->mainWidget() : 0; } diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index c5a11080f1..d823ab1f2c 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -208,7 +208,7 @@ private: uint64 _lastActionTime; - Window _window; + Window *_window; FileUploader *_uploader; Translator *_translator; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index ca7b364e03..e7a700bd30 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -1040,13 +1040,16 @@ bool DialogsInner::searchReceived(const QVector &messages, DialogsSe _lastSearchDate = lastDateFound; } } - if (type == DialogsSearchFromStart || type == DialogsSearchFromOffset) { - _lastSearchPeer = item->history()->peer; + if (item) { + if (type == DialogsSearchFromStart || type == DialogsSearchFromOffset) { + _lastSearchPeer = item->history()->peer; + } } + MsgId msgId = item ? item->id : idFromMessage(*i); if (type == DialogsSearchMigratedFromStart || type == DialogsSearchMigratedFromOffset) { - _lastSearchMigratedId = item->id; + _lastSearchMigratedId = msgId; } else { - _lastSearchId = item->id; + _lastSearchId = msgId; } } if (type == DialogsSearchMigratedFromStart || type == DialogsSearchMigratedFromOffset) { diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index 98d756bb07..c5c1e02c4a 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -142,7 +142,7 @@ void AnimationManager::stop(Animation *obj) { if (_iterating) { _stopping.insert(obj, NullType()); if (!_starting.isEmpty()) { - _starting.insert(obj, NullType()); + _starting.remove(obj); } } else { AnimatingObjects::iterator i = _objects.find(obj); @@ -159,7 +159,9 @@ void AnimationManager::timeout() { _iterating = true; uint64 ms = getms(); for (AnimatingObjects::const_iterator i = _objects.begin(), e = _objects.end(); i != e; ++i) { - i.key()->step(ms, true); + if (!_stopping.contains(i.key())) { + i.key()->step(ms, true); + } } _iterating = false; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 05c757ee77..b4103258c5 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -680,8 +680,6 @@ void HistoryInner::itemRemoved(HistoryItem *item) { _widget->updateTopBarSelection(); } - if (_dragAction == NoDrag) return; - if (_dragItem == item) { dragActionCancel(); } @@ -733,8 +731,9 @@ void HistoryInner::dragActionFinish(const QPoint &screenPos, Qt::MouseButton but if (needClick) { DEBUG_LOG(("Clicked link: %1 (%2) %3").arg(needClick->text()).arg(needClick->readable()).arg(needClick->encoded())); - needClick->onClick(button); dragActionCancel(); + + needClick->onClick(button); // this possibly can delete this object return; } if (_dragAction == PrepareSelect && !_dragWasInactive && !_selected.isEmpty() && _selected.cbegin().value() == FullSelection) { @@ -777,6 +776,7 @@ void HistoryInner::dragActionFinish(const QPoint &screenPos, Qt::MouseButton but } } _dragAction = NoDrag; + _dragItem = 0; _dragSelType = TextSelectLetters; _widget->noSelectingScroll(); _widget->updateTopBarSelection(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 779a93bacc..76efb6a1c5 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1185,7 +1185,7 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu History *h = App::history(peer->id); if (!h->lastMsg) { HistoryItem *item = h->addNewMessage((*v)[0], NewMessageLast); - if (collapsed && !collapsed->isEmpty() && collapsed->at(0).type() == mtpc_messageGroup && h->isChannel()) { + if (item && collapsed && !collapsed->isEmpty() && collapsed->at(0).type() == mtpc_messageGroup && h->isChannel()) { if (collapsed->at(0).c_messageGroup().vmax_id.v > item->id) { if (h->asChannelHistory()->onlyImportant()) { h->asChannelHistory()->clearOther(); diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 0c9c0698ba..797c76bead 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -265,12 +265,13 @@ void OverviewInner::searchReceived(SearchRequestType type, const MTPmessages_Mes } for (QVector::const_iterator i = messages->cbegin(), e = messages->cend(); i != e; ++i) { HistoryItem *item = App::histories().addNewMessage(*i, NewMessageExisting); + MsgId msgId = item ? item->id : idFromMessage(*i); if (migratedSearch) { - _searchResults.push_front(-item->id); - _lastSearchMigratedId = item->id; + if (item) _searchResults.push_front(-item->id); + _lastSearchMigratedId = msgId; } else { - _searchResults.push_front(item->id); - _lastSearchId = item->id; + if (item) _searchResults.push_front(item->id); + _lastSearchId = msgId; } } mediaOverviewUpdated(); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 274b34f29b..db43d23377 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -189,7 +189,9 @@ void UserData::setPhoto(const MTPUserProfilePhoto &p) { // see Local::readPeer a photoId = newPhotoId; photo = newPhoto; photoLoc = newPhotoLoc; - emit App::main()->peerPhotoChanged(this); + if (App::main()) { + emit App::main()->peerPhotoChanged(this); + } } } From 3281b81565e72fb488235d9101820d285795e6b3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 14 Feb 2016 21:29:17 +0300 Subject: [PATCH 081/316] using new privacy settings (error display), crash reports collecting improved, colors for waveforms imporved, preparing for 0.9.22.dev (next commit) --- Telegram/Resources/lang.strings | 2 + Telegram/Resources/style.txt | 8 +++- Telegram/SourceFiles/_other/updater.cpp | 9 ++++- Telegram/SourceFiles/application.cpp | 4 +- Telegram/SourceFiles/config.h | 4 +- Telegram/SourceFiles/dropdown.cpp | 2 + Telegram/SourceFiles/history.cpp | 9 ++++- Telegram/SourceFiles/mainwidget.cpp | 4 ++ Telegram/SourceFiles/profilewidget.cpp | 12 ++++-- Telegram/SourceFiles/pspecific_wnd.cpp | 42 --------------------- Telegram/SourceFiles/structs.h | 3 ++ Telegram/SourceFiles/window.cpp | 13 +++++-- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++-- Telegram/Telegram.xcodeproj/project.pbxproj | 12 +++--- Telegram/Version | 6 +-- 16 files changed, 67 insertions(+), 73 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 57da8554cc..0ee26c103f 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Sorry, you can only add mutual contacts\nto groups at the moment. {more_info}"; "lng_cant_invite_not_contact_channel" = "Sorry, you can only add mutual contacts\nto channels at the moment. {more_info}"; "lng_cant_more_info" = "More info »"; +"lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings."; +"lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message.."; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5cd2bda889..92e1622b56 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1291,9 +1291,13 @@ msgWaveformSkip: 1px; msgWaveformMin: 2px; msgWaveformMax: 20px; msgWaveformInActive: #59b6eb; -msgWaveformInInactive: #deeaf1; +msgWaveformInActiveSelected: #51a3d3; +msgWaveformInInactive: #d4dee6; +msgWaveformInInactiveSelected: #9cc1e1; msgWaveformOutActive: #78c67f; -msgWaveformOutInactive: #c4e8c5; +msgWaveformOutActiveSelected: #6badad; +msgWaveformOutInactive: #b3e2b4; +msgWaveformOutInactiveSelected: #91c3c3; sendPadding: 9px; btnSend: flatButton(btnDefFlat) { diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index 9dea213aa9..d89efcd950 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -482,13 +482,18 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { static const int maxFileLen = MAX_PATH * 10; WCHAR szPath[maxFileLen]; - wsprintf(szPath, L"%stdumps\\", path); - + wsprintf(szPath, L"%stdata\\", path); if (!CreateDirectory(szPath, NULL)) { if (GetLastError() != ERROR_ALREADY_EXISTS) { return 0; } } + wsprintf(szPath, L"%sdumps\\", path); + if (!CreateDirectory(szPath, NULL)) { + if (GetLastError() != ERROR_ALREADY_EXISTS) { + return 0; + } + } WCHAR szFileName[maxFileLen]; WCHAR szExeName[maxFileLen]; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index afc5e6bc07..89e667eb11 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1052,9 +1052,9 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9020) { + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9022) { if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } else { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Ctrl+W or Ctrl+F4 closes Telegram window\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 0878f1a6d7..1816d479ca 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9021; -static const wchar_t *AppVersionStr = L"0.9.21"; +static const int32 AppVersion = 9022; +static const wchar_t *AppVersionStr = L"0.9.22"; static const bool DevVersion = true; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index f4b9ac2a58..737e70d0b6 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1698,6 +1698,7 @@ bool StickerPanInner::inlineRowFinalize(InlineRow &row, int32 &sumWidth, bool fo void StickerPanInner::refreshSavedGifs() { if (_showingSavedGifs) { + _settings.hide(); clearInlineRows(false); if (_showingInlineItems) { const SavedGifs &saved(cSavedGifs()); @@ -1919,6 +1920,7 @@ int32 StickerPanInner::refreshInlineRows(UserData *bot, const InlineResults &res _showingInlineItems = true; _showingSavedGifs = false; + _settings.hide(); int32 count = results.size(), from = validateExistingInlineRows(results), added = 0; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8c675c0ce8..8d1ed775ae 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4059,9 +4059,12 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r float64 prg = voice->_playback ? voice->_playback->a_progress.current() : 0; // rescale waveform by going in waveform.size * bar_count 1D grid - style::color active(outbg ? st::msgWaveformOutActive : st::msgWaveformInActive); - style::color inactive(outbg ? st::msgWaveformOutInactive : st::msgWaveformInInactive); + style::color active(outbg ? (selected ? st::msgWaveformOutActiveSelected : st::msgWaveformOutActive) : (selected ? st::msgWaveformInActiveSelected : st::msgWaveformInActive)); + style::color inactive(outbg ? (selected ? st::msgWaveformOutInactiveSelected : st::msgWaveformOutInactive) : (selected ? st::msgWaveformInInactiveSelected : st::msgWaveformInInactive)); int32 wf_size = wf ? wf->size() : WaveformSamplesCount, availw = int32(namewidth + st::msgWaveformSkip), activew = qRound(availw * prg); + if (!outbg && !voice->_playback && parent->isMediaUnread()) { + activew = availw; + } int32 bar_count = qMin(availw / int32(st::msgWaveformBar + st::msgWaveformSkip), wf_size); uchar max_value = 0; int32 max_delta = st::msgWaveformMax - st::msgWaveformMin, bottom = st::msgFilePadding.top() + st::msgWaveformMax; @@ -7531,6 +7534,8 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 } int32 HistoryServiceMsg::resize(int32 width) { + int32 maxwidth = qMin(_history->width, int(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + if (width > maxwidth) width = maxwidth; width -= st::msgServiceMargin.left() + st::msgServiceMargin.left(); // two small margins if (width < st::msgServicePadding.left() + st::msgServicePadding.right() + 1) width = st::msgServicePadding.left() + st::msgServicePadding.right() + 1; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 085b958d73..e5be52e982 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1084,6 +1084,8 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { QString text = lang(lng_failed_add_participant); if (error.type() == "USER_LEFT_CHAT") { // trying to return banned user to his group + } else if (error.type() == "USER_PRIVACY_RESTRICTED") { + text = lang(lng_cant_invite_privacy); } else if (error.type() == "USER_NOT_MUTUAL_CONTACT") { // trying to return user who does not have me in contacts text = lang(lng_failed_add_not_mutual); } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { @@ -1100,6 +1102,8 @@ bool MainWidget::addParticipantsFail(ChannelData *channel, const RPCError &error QString text = lang(lng_failed_add_participant); if (error.type() == "USER_LEFT_CHAT") { // trying to return banned user to his group + } else if (error.type() == "USER_PRIVACY_RESTRICTED") { + text = lang(lng_cant_invite_privacy_channel); } else if (error.type() == "USER_NOT_MUTUAL_CONTACT") { // trying to return user who does not have me in contacts text = lang(channel->isMegagroup() ? lng_failed_add_not_mutual : lng_failed_add_not_mutual_channel); } else if (error.type() == "PEER_FLOOD") { diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 53df0dedfb..313709f181 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -817,7 +817,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { top += st::profilePhotoSize; top += st::profileButtonTop; - if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->amEditor() && _peerChannel->isMegagroup()))) { + if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->canAddParticipants() && _peerChannel->isMegagroup()))) { top += _shareContact.height(); } else { top -= st::profileButtonTop; @@ -1294,13 +1294,17 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { top += st::profileButtonTop; _uploadPhoto.setGeometry(_left, top, btnWidth, _uploadPhoto.height()); - _addParticipant.setGeometry(_left + _width - btnWidth, top, btnWidth, _addParticipant.height()); + if (_peerChannel && _peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && !_amCreator && !_peerChannel->amEditor() && _peerChannel->canAddParticipants()) { + _addParticipant.setGeometry(_left, top, btnWidth, _addParticipant.height()); + } else { + _addParticipant.setGeometry(_left + _width - btnWidth, top, btnWidth, _addParticipant.height()); + } _sendMessage.setGeometry(_left, top, btnWidth, _sendMessage.height()); _shareContact.setGeometry(_left + _width - btnWidth, top, btnWidth, _shareContact.height()); _inviteToGroup.setGeometry(_left + _width - btnWidth, top, btnWidth, _inviteToGroup.height()); - if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->amEditor() && _peerChannel->isMegagroup()))) { + if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->canAddParticipants() && _peerChannel->isMegagroup()))) { top += _shareContact.height(); } else { top -= st::profileButtonTop; @@ -1634,7 +1638,7 @@ void ProfileInner::showAll() { _invitationLink.hide(); } } - if (_peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && (_amCreator || _peerChannel->amEditor())) { + if (_peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && _peerChannel->canAddParticipants()) { _addParticipant.show(); } else { _addParticipant.hide(); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index b29ff4c1f8..044827de67 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2475,48 +2475,6 @@ BOOL __stdcall ReadProcessMemoryRoutine64( return bRet; } -HANDLE _generateDumpFileAtPath(const WCHAR *path) { - static const int maxFileLen = MAX_PATH * 10; - - WCHAR szPath[maxFileLen]; - wsprintf(szPath, L"%stdumps\\", path); - - if (!CreateDirectory(szPath, NULL)) { - DWORD errCode = GetLastError(); - if (errCode && errCode != ERROR_ALREADY_EXISTS) { - return 0; - } - } - - WCHAR szFileName[maxFileLen]; - WCHAR szExeName[maxFileLen]; - - wcscpy_s(szExeName, _exeName); - WCHAR *dotFrom = wcschr(szExeName, WCHAR(L'.')); - if (dotFrom) { - wsprintf(dotFrom, L""); - } - - SYSTEMTIME stLocalTime; - - GetLocalTime(&stLocalTime); - - if (cBetaVersion()) { - wsprintf(szFileName, L"%s%s-%ld-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, cBetaVersion(), - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, - GetCurrentProcessId(), GetCurrentThreadId()); - } else { - wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, AppVersionStr, - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, - GetCurrentProcessId(), GetCurrentThreadId()); - } - return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); -} - // **************************************** ToolHelp32 ************************ #define MAX_MODULE_NAME32 255 #define TH32CS_SNAPMODULE 0x00000008 diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 887ab0ebf5..625b300db3 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -626,6 +626,9 @@ public: bool isVerified() const { return flags & MTPDchannel::flag_verified; } + bool canAddParticipants() const { + return amCreator() || amEditor() || (flags & MTPDchannel::flag_invites_enabled); + } // ImagePtr photoFull; QString invitationUrl; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 593925800e..932d464df5 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2019,7 +2019,7 @@ LastCrashedWindow::LastCrashedWindow() , _updatingSkip(this, false) #endif { - if (!cDevVersion() && !cBetaVersion()) { + if (!cDevVersion() && !cBetaVersion()) { // currently accept crash reports only from testers _sendingState = SendingNoReport; } if (_sendingState != SendingNoReport) { @@ -2064,12 +2064,19 @@ LastCrashedWindow::LastCrashedWindow() _minidumpFull = maxDumpFull; } } - if (_minidumpName.isEmpty()) { + if (_minidumpName.isEmpty()) { // currently don't accept crash reports without dumps from google libraries _sendingState = SendingNoReport; } else { _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(dumpsize / 1024)); } } + if (_sendingState != SendingNoReport) { + QString version = getReportField(qstr("version"), qstr("Version:")); + QString current = cBetaVersion() ? qsl("-%1").arg(cBetaVersion()) : QString::number(AppVersion); + if (version != current) { // currently don't accept crash reports from not current app version + _sendingState = SendingNoReport; + } + } _networkSettings.setText(qsl("NETWORK SETTINGS")); connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings())); @@ -2201,7 +2208,7 @@ void LastCrashedWindow::onSendReport() { App::setProxySettings(_sendManager); QString apiid = getReportField(qstr("apiid"), qstr("ApiId:")), version = getReportField(qstr("version"), qstr("Version:")); - _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2&dmp=%3").arg(apiid).arg(version).arg(minidumpFileName().isEmpty() ? 0 : 1))); + _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2&dmp=%3&platform=%4").arg(apiid).arg(version).arg(minidumpFileName().isEmpty() ? 0 : 1).arg(cPlatformString()))); connect(_checkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); connect(_checkReply, SIGNAL(finished()), this, SLOT(onCheckingFinished())); diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 9e4f736360..8bc5a45e02 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.21 + 0.9.22 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 3534874665..8dd9cd58c1 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,21,0 - PRODUCTVERSION 0,9,21,0 + FILEVERSION 0,9,22,0 + PRODUCTVERSION 0,9,22,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.21.0" + VALUE "FileVersion", "0.9.22.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.21.0" + VALUE "ProductVersion", "0.9.22.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 0e234ad04d..8454cab837 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.21; + DYLIB_CURRENT_VERSION = 0.9.22; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.21; + DYLIB_CURRENT_VERSION = 0.9.22; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 58252de8fc..bcf8c071a9 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9021 +AppVersion 9022 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.21 -AppVersionStr 0.9.21 +AppVersionStrSmall 0.9.22 +AppVersionStr 0.9.22 DevChannel 1 BetaVersion 0 9019002 From 0154be513868b21d95b474452e8ffff094a09f90 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 14 Feb 2016 22:46:01 +0300 Subject: [PATCH 082/316] fixed errors for 0.9.22 dev version --- Telegram/SourceFiles/audio.cpp | 8 ++++---- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpConnection.cpp | 13 +++++++------ Telegram/SourceFiles/overviewwidget.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 7771eb39e9..a074ad3f88 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -1867,10 +1867,10 @@ struct AudioCapturePrivate { , swrContext(0) , lastUpdate(0) , levelMax(0) + , dataPos(0) , waveformMod(0) , waveformEach(AudioVoiceMsgFrequency / 100) - , waveformPeak(0) - , dataPos(0) { + , waveformPeak(0) { } ALCdevice *device; AVOutputFormat *fmt; @@ -2548,7 +2548,7 @@ public: const char *data = buffer.data(); if (fmt == AL_FORMAT_MONO8 || fmt == AL_FORMAT_STEREO8) { - for (int32 i = 0, l = buffer.size(); i + sizeof(uchar) <= l;) { + for (int32 i = 0, l = buffer.size(); i + int32(sizeof(uchar)) <= l;) { uint16 sample = qAbs((int32(*(uchar*)(data + i)) - 128) * 256); if (peak < sample) { peak = sample; @@ -2563,7 +2563,7 @@ public: } } } else if (fmt == AL_FORMAT_MONO16 || fmt == AL_FORMAT_STEREO16) { - for (int32 i = 0, l = buffer.size(); i + sizeof(uint16) <= l;) { + for (int32 i = 0, l = buffer.size(); i + int32(sizeof(uint16)) <= l;) { uint16 sample = qAbs(int32(*(int16*)(data + i))); if (peak < sample) { peak = sample; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8d1ed775ae..8c38444160 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4069,7 +4069,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r uchar max_value = 0; int32 max_delta = st::msgWaveformMax - st::msgWaveformMin, bottom = st::msgFilePadding.top() + st::msgWaveformMax; p.setPen(Qt::NoPen); - for (uint32 i = 0, bar_x = 0, sum_i = 0; i < wf_size; ++i) { + for (int32 i = 0, bar_x = 0, sum_i = 0; i < wf_size; ++i) { uchar value = wf ? wf->at(i) : 0; if (sum_i + bar_count >= wf_size) { // draw bar sum_i = sum_i + bar_count - wf_size; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index ad23e890b5..01a3cb2b6e 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -866,7 +866,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); bool lnkIsVideo = lnkDocument ? lnkDocument->document()->isVideo() : false; - bool lnkIsAudio = lnkDocument ? lnkDocument->document()->voice() : false; + bool lnkIsAudio = lnkDocument ? (lnkDocument->document()->voice() != 0) : false; if (lnkPhoto || lnkDocument) { if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index dcde71a52a..0ef1430e05 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -431,18 +431,19 @@ namespace { TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); return mtpBuffer(1, -500); } + const mtpPrime *packetdata = reinterpret_cast(packet + (length - len)); TCP_LOG(("TCP Info: packet received, size = %1").arg(size * sizeof(mtpPrime))); if (size == 1) { - if (packet[0] == -429) { + if (*packetdata == -429) { LOG(("Protocol Error: -429 flood code returned!")); } else { - LOG(("TCP Error: error packet received, code = %1").arg(packet[0])); + LOG(("TCP Error: error packet received, code = %1").arg(*packetdata)); } - return mtpBuffer(1, packet[0]); + return mtpBuffer(1, *packetdata); } mtpBuffer data(size); - memcpy(data.data(), packet + (length - len), size * sizeof(mtpPrime)); + memcpy(data.data(), packetdata, size * sizeof(mtpPrime)); return data; } @@ -729,7 +730,7 @@ void MTPautoConnection::tcpSend(mtpBuffer &buffer) { uint32 second1 = 0; do { memset_rand(nonce, sizeof(nonce)); - } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || nonce[0] == 0xef); + } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || *reinterpret_cast(nonce) == 0xef); sock.write(nonce, sizeof(nonce)); } ++packetNum; @@ -1029,7 +1030,7 @@ void MTPtcpConnection::sendData(mtpBuffer &buffer) { uint32 second1 = 0; do { memset_rand(nonce, sizeof(nonce)); - } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || nonce[0] == 0xef); + } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || *reinterpret_cast(nonce) == 0xef); sock.write(nonce, sizeof(nonce)); } ++packetNum; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index dd9cf6dbe6..919f770a2e 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1262,7 +1262,7 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _contextMenuLnk = textlnkOver(); PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - bool lnkIsAudio = lnkDocument ? lnkDocument->document()->voice() : false; + bool lnkIsAudio = lnkDocument ? (lnkDocument->document()->voice() != 0) : false; bool lnkIsVideo = lnkDocument ? lnkDocument->document()->isVideo() : false; if (lnkPhoto || lnkDocument) { _menu = new PopupMenu(); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 6a9f25ed9a..90757d14e7 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -977,7 +977,7 @@ void DocumentCancelLink::onClick(Qt::MouseButton button) const { } VoiceData::~VoiceData() { - if (!waveform.isEmpty() && waveform.at(0) == -1 && waveform.size() > sizeof(TaskId)) { + if (!waveform.isEmpty() && waveform.at(0) == -1 && waveform.size() > int32(sizeof(TaskId))) { TaskId taskId = 0; memcpy(&taskId, waveform.constData() + 1, sizeof(taskId)); Local::cancelTask(taskId); From bbc804bd5623af30fa4f4a616b7e1a2fc4b1a769 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 14 Feb 2016 22:53:42 +0300 Subject: [PATCH 083/316] added numeric header, v 0.9.22 dev --- Telegram/SourceFiles/stdafx.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index fa83246785..b9d77d66ba 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -26,6 +26,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #ifdef __cplusplus +#include + #include #include #include From 01c26cedb12f46b4bbbef1eacad410599cc619c8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Feb 2016 10:09:14 +0300 Subject: [PATCH 084/316] three crashes fixed --- Telegram/SourceFiles/audio.cpp | 2 +- Telegram/SourceFiles/history.cpp | 12 +++++++----- Telegram/SourceFiles/mtproto/mtpConnection.cpp | 11 +++++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index a074ad3f88..6393fc3dd5 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -2403,7 +2403,7 @@ public: } bool open(qint64 position = 0) { - if (!AbstractFFMpegLoader::openFile()) { + if (!AbstractFFMpegLoader::open()) { return false; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8c38444160..540f83bc63 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2536,13 +2536,14 @@ void History::clear(bool leaveItems) { if (App::wnd() && !App::quiting()) App::wnd()->mediaOverviewUpdated(peer, MediaOverviewType(i)); } } - for (Blocks::const_iterator i = blocks.cbegin(), e = blocks.cend(); i != e; ++i) { + Blocks lst = blocks; + blocks.clear(); + for (Blocks::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { if (leaveItems) { (*i)->clear(true); } delete *i; } - blocks.clear(); if (leaveItems) { lastKeyboardInited = false; } else { @@ -2698,16 +2699,17 @@ int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, const HistoryI } void HistoryBlock::clear(bool leaveItems) { + Items lst = items; + items.clear(); if (leaveItems) { - for (Items::const_iterator i = items.cbegin(), e = items.cend(); i != e; ++i) { + for (Items::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { (*i)->detachFast(); } } else { - for (Items::const_iterator i = items.cbegin(), e = items.cend(); i != e; ++i) { + for (Items::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { delete *i; } } - items.clear(); } void HistoryBlock::removeItem(HistoryItem *item) { diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 0ef1430e05..e9c8502db6 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -546,21 +546,21 @@ void MTPabstractTcpConnection::socketRead() { } do { - char *readTo = currentPos; uint32 toRead = packetLeft ? packetLeft : (readingToShort ? (MTPShortBufferSize * sizeof(mtpPrime)-packetRead) : 4); if (readingToShort) { if (currentPos + toRead > ((char*)shortBuffer) + MTPShortBufferSize * sizeof(mtpPrime)) { longBuffer.resize(((packetRead + toRead) >> 2) + 1); memcpy(&longBuffer[0], shortBuffer, packetRead); - readTo = ((char*)&longBuffer[0]) + packetRead; + currentPos = ((char*)&longBuffer[0]) + packetRead; + readingToShort = false; } } else { if (longBuffer.size() * sizeof(mtpPrime) < packetRead + toRead) { longBuffer.resize(((packetRead + toRead) >> 2) + 1); - readTo = ((char*)&longBuffer[0]) + packetRead; + currentPos = ((char*)&longBuffer[0]) + packetRead; } } - int32 bytes = (int32)sock.read(readTo, toRead); + int32 bytes = (int32)sock.read(currentPos, toRead); if (bytes > 0) { TCP_LOG(("TCP Info: read %1 bytes").arg(bytes)); @@ -573,6 +573,7 @@ void MTPabstractTcpConnection::socketRead() { currentPos = (char*)shortBuffer; packetRead = packetLeft = 0; readingToShort = true; + longBuffer.clear(); } else { TCP_LOG(("TCP Info: not enough %1 for packet! read %2").arg(packetLeft).arg(packetRead)); emit receivedSome(); @@ -602,10 +603,12 @@ void MTPabstractTcpConnection::socketRead() { if (!packetRead) { currentPos = (char*)shortBuffer; readingToShort = true; + longBuffer.clear(); } else if (!readingToShort && packetRead < MTPShortBufferSize * sizeof(mtpPrime)) { memcpy(shortBuffer, currentPos - packetRead, packetRead); currentPos = (char*)shortBuffer; readingToShort = true; + longBuffer.clear(); } } } From 517358c8e9a1c172d44bdfefcfef23ce28db861a Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Feb 2016 14:11:07 +0300 Subject: [PATCH 085/316] clearing media autodownload settings on logout, fixed history clearing --- Telegram/SourceFiles/app.cpp | 3 +++ Telegram/SourceFiles/mainwidget.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 67ad444262..2915f02ac6 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1842,6 +1842,9 @@ namespace App { cSetSavedGifs(SavedGifs()); cSetLastSavedGifsUpdate(0); cSetReportSpamStatuses(ReportSpamStatuses()); + cSetAutoDownloadPhoto(0); + cSetAutoDownloadAudio(0); + cSetAutoDownloadGif(0); ::photoItems.clear(); ::documentItems.clear(); ::webPageItems.clear(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index c632b510d0..8944d59f38 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -994,7 +994,7 @@ void MainWidget::deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHis return; } - MTP::send(MTPmessages_DeleteHistory(peer->input, d.voffset), rpcDone(&MainWidget::deleteHistoryPart, peer)); + MTP::send(MTPmessages_DeleteHistory(peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, peer)); } void MainWidget::deleteMessages(PeerData *peer, const QVector &ids) { From bb30b71b8686bd017467b7df3335079c8c10b0ed Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Feb 2016 14:23:45 +0300 Subject: [PATCH 086/316] 0.9.23 dev version, convertScale() added to inline result thumbs in some places --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/history.cpp | 4 ++-- Telegram/SourceFiles/layout.cpp | 10 +++++----- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 84520a5b73..0f2300491a 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1052,7 +1052,7 @@ void AppClass::checkMapVersion() { if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } else { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Ctrl+W or Ctrl+F4 closes Telegram window\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } } else if (Local::oldMapVersion() < 9016) { versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 1816d479ca..363e19b564 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9022; -static const wchar_t *AppVersionStr = L"0.9.22"; +static const int32 AppVersion = 9023; +static const wchar_t *AppVersionStr = L"0.9.23"; static const bool DevVersion = true; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 540f83bc63..890cd38b51 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3754,7 +3754,7 @@ void HistoryVideo::unregItem(HistoryItem *item) { ImagePtr HistoryVideo::replyPreview() { if (_data->replyPreview->isNull() && !_data->thumb->isNull()) { if (_data->thumb->loaded()) { - int w = _data->thumb->width(), h = _data->thumb->height(); + int w = convertScale(_data->thumb->width()), h = convertScale(_data->thumb->height()); if (w <= 0) w = 1; if (h <= 0) h = 1; _data->replyPreview = ImagePtr(w > h ? _data->thumb->pix(w * st::msgReplyBarSize.height() / h, st::msgReplyBarSize.height()) : _data->thumb->pix(st::msgReplyBarSize.height()), "PNG"); @@ -3857,7 +3857,7 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) { HistoryDocumentThumbed *thumbed = Get(); if (thumbed) { _data->thumb->load(); - int32 tw = _data->thumb->width(), th = _data->thumb->height(); + int32 tw = convertScale(_data->thumb->width()), th = convertScale(_data->thumb->height()); if (tw > th) { thumbed->_thumbw = (tw * st::msgFileThumbSize) / th; } else { diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 20b5ad04cd..549b442e8a 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -756,7 +756,7 @@ LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryIt if (withThumb()) { _data->thumb->load(); - int32 tw = _data->thumb->width(), th = _data->thumb->height(); + int32 tw = convertScale(_data->thumb->width()), th = convertScale(_data->thumb->height()); if (tw > th) { _thumbw = (tw * st::overviewFileSize) / th; } else { @@ -1651,7 +1651,7 @@ int32 LayoutInlineGif::content_width() const { return doc->dimensions.width(); } if (!doc->thumb->isNull()) { - return doc->thumb->width(); + return convertScale(doc->thumb->width()); } } else if (_result) { return _result->width; @@ -1666,7 +1666,7 @@ int32 LayoutInlineGif::content_height() const { return doc->dimensions.height(); } if (!doc->thumb->isNull()) { - return doc->thumb->height(); + return convertScale(doc->thumb->height()); } } else if (_result) { return _result->height; @@ -1920,7 +1920,7 @@ void LayoutInlineWebVideo::getState(TextLinkPtr &link, HistoryCursorState &curso void LayoutInlineWebVideo::prepareThumb(int32 width, int32 height) const { if (_result->thumb->loaded()) { if (_thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - int32 w = qMax(_result->thumb->width(), 1), h = qMax(_result->thumb->height(), 1); + int32 w = qMax(convertScale(_result->thumb->width()), 1), h = qMax(convertScale(_result->thumb->height()), 1); if (w * height > h * width) { if (height < h) { w = w * height / h; @@ -2068,7 +2068,7 @@ void LayoutInlineArticle::prepareThumb(int32 width, int32 height) const { if (_result->thumb->loaded()) { if (_thumb.width() != width * cIntRetinaFactor() || _thumb.height() != height * cIntRetinaFactor()) { - int32 w = qMax(_result->thumb->width(), 1), h = qMax(_result->thumb->height(), 1); + int32 w = qMax(convertScale(_result->thumb->width()), 1), h = qMax(convertScale(_result->thumb->height()), 1); if (w * height > h * width) { if (height < h) { w = w * height / h; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 8bc5a45e02..468ce68fd6 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.22 + 0.9.23 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 8dd9cd58c1..036e34bc70 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,22,0 - PRODUCTVERSION 0,9,22,0 + FILEVERSION 0,9,23,0 + PRODUCTVERSION 0,9,23,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.22.0" + VALUE "FileVersion", "0.9.23.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.22.0" + VALUE "ProductVersion", "0.9.23.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 8454cab837..3f464ec555 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.22; + CURRENT_PROJECT_VERSION = 0.9.23; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.22; + CURRENT_PROJECT_VERSION = 0.9.23; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.22; + CURRENT_PROJECT_VERSION = 0.9.23; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.22; + DYLIB_CURRENT_VERSION = 0.9.23; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.22; + CURRENT_PROJECT_VERSION = 0.9.23; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.22; + DYLIB_CURRENT_VERSION = 0.9.23; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index bcf8c071a9..98e88320e9 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9022 +AppVersion 9023 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.22 -AppVersionStr 0.9.22 +AppVersionStrSmall 0.9.23 +AppVersionStr 0.9.23 DevChannel 1 BetaVersion 0 9019002 From 4081af12dd2503f9b7860d6cf97b10d4f3f25498 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Feb 2016 14:46:01 +0300 Subject: [PATCH 087/316] words selection fixed, wide mode starts from 720px conversation width, hiding tooltips on app state changed to inactive, 0.9.23 dev version --- Telegram/Resources/style.txt | 2 +- Telegram/SourceFiles/application.cpp | 3 +++ Telegram/SourceFiles/history.cpp | 11 +++++++++-- Telegram/SourceFiles/historywidget.cpp | 3 +-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 98b23e2dbc..5999c47f4f 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1016,7 +1016,7 @@ historyToEndSkip: 10px; activeFadeInDuration: 500; activeFadeOutDuration: 3000; -historyMaxWidth: 680px; +historyMaxWidth: 720px; msgRadius: 3px; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 0f2300491a..dc3fc7505d 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -926,6 +926,9 @@ void AppClass::checkLocalTime() { void AppClass::onAppStateChanged(Qt::ApplicationState state) { checkLocalTime(); _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + if (state != Qt::ApplicationActive) { + PopupTooltip::Hide(); + } } void AppClass::killDownloadSessions() { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 890cd38b51..b27b6aac0e 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7462,7 +7462,11 @@ void HistoryServiceMsg::initDimensions() { void HistoryServiceMsg::countPositionAndSize(int32 &left, int32 &width) const { left = st::msgServiceMargin.left(); - width = qMin(_history->width, int(st::msgMaxWidth + 2 * st::msgPhotoSkip)) - st::msgServiceMargin.left() - st::msgServiceMargin.left(); + int32 maxwidth = _history->width; + if (Adaptive::Wide()) { + maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + } + width = maxwidth - st::msgServiceMargin.left() - st::msgServiceMargin.left(); } QString HistoryServiceMsg::selectedText(uint32 selection) const { @@ -7536,7 +7540,10 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 } int32 HistoryServiceMsg::resize(int32 width) { - int32 maxwidth = qMin(_history->width, int(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + int32 maxwidth = _history->width; + if (Adaptive::Wide()) { + maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + } if (width > maxwidth) width = maxwidth; width -= st::msgServiceMargin.left() + st::msgServiceMargin.left(); // two small margins if (width < st::msgServicePadding.left() + st::msgServicePadding.right() + 1) width = st::msgServicePadding.left() + st::msgServicePadding.right() + 1; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 01a3cb2b6e..e8b3539667 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -792,6 +792,7 @@ void HistoryInner::mouseReleaseEvent(QMouseEvent *e) { void HistoryInner::mouseDoubleClickEvent(QMouseEvent *e) { if (!_history) return; + dragActionStart(e->globalPos(), e->button()); if (((_dragAction == Selecting && !_selected.isEmpty() && _selected.cbegin().value() != FullSelection) || (_dragAction == NoDrag && (_selected.isEmpty() || _selected.cbegin().value() != FullSelection))) && _dragSelType == TextSelectLetters && _dragItem) { bool afterDragSymbol, uponSelected; uint16 symbol; @@ -813,8 +814,6 @@ void HistoryInner::mouseDoubleClickEvent(QMouseEvent *e) { _trippleClickPoint = e->globalPos(); _trippleClickTimer.start(QApplication::doubleClickInterval()); } - } else { - mousePressEvent(e); } } From ebd77ba71de75c7f5426844c84df698835e19831 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Feb 2016 14:52:27 +0300 Subject: [PATCH 088/316] re-fixed crash in ffmpeg, 0.9.23 dev --- Telegram/SourceFiles/types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 497627b7a6..67adc1560c 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -293,7 +293,7 @@ namespace ThirdParty { av_register_all(); avcodec_register_all(); -// av_lockmgr_register(_ffmpegLockManager); + av_lockmgr_register(_ffmpegLockManager); _sslInited = true; } From 71e544e0fcda061aab5c2f65f73f2a1b93c74fef Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Feb 2016 18:52:11 +0300 Subject: [PATCH 089/316] added user tag for reports, fixed couple of compile warnings in gcc --- Telegram/SourceFiles/facades.cpp | 28 +++++++++++++++++-- Telegram/SourceFiles/facades.h | 2 ++ Telegram/SourceFiles/history.cpp | 1 + Telegram/SourceFiles/logs.cpp | 1 + .../SourceFiles/mtproto/mtpConnection.cpp | 2 +- Telegram/SourceFiles/types.h | 11 ++++++++ Telegram/SourceFiles/window.cpp | 2 +- 7 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 1750f0250b..69d1584cdf 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -215,6 +215,7 @@ struct SandboxDataStruct { ConnectionProxy PreLaunchProxy; }; SandboxDataStruct *SandboxData = 0; +uint64 SandboxUserTag = 0; namespace Sandbox { @@ -276,6 +277,27 @@ namespace Sandbox { f.write("1"); } } + + srand((int32)time(NULL)); + + SandboxUserTag = 0; + QFile usertag(cWorkingDir() + qsl("tdata/usertag")); + if (usertag.open(QIODevice::ReadOnly)) { + if (usertag.read(reinterpret_cast(&SandboxUserTag), sizeof(uint64)) != sizeof(uint64)) { + SandboxUserTag = 0; + } + usertag.close(); + } + if (!SandboxUserTag) { + do { + memsetrnd_bad(SandboxUserTag); + } while (!SandboxUserTag); + + if (usertag.open(QIODevice::WriteOnly)) { + usertag.write(reinterpret_cast(&SandboxUserTag), sizeof(uint64)); + usertag.close(); + } + } } void start() { @@ -290,8 +312,6 @@ namespace Sandbox { break; } } - - srand((int32)time(NULL)); } void finish() { @@ -299,6 +319,10 @@ namespace Sandbox { SandboxData = 0; } + uint64 UserTag() { + return SandboxUserTag; + } + DefineReadOnlyVar(Sandbox, QString, LangSystemISO); DefineReadOnlyVar(Sandbox, int32, LangSystem); DefineVar(Sandbox, QByteArray, LastCrashDump); diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 43da4a0268..0e32721934 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -112,6 +112,8 @@ namespace Sandbox { void start(); void finish(); + uint64 UserTag(); + DeclareReadOnlyVar(QString, LangSystemISO); DeclareReadOnlyVar(int32, LangSystem); DeclareVar(QByteArray, LastCrashDump); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index b27b6aac0e..fc0cbceb48 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3803,6 +3803,7 @@ HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, } HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedia() +, Interfaces() , _parent(0) , _data(other._data) { const HistoryDocumentCaptioned *captioned = other.Get(); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 502644d7a1..4a90c14aa1 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -868,6 +868,7 @@ namespace SignalHandlers { ProcessAnnotations["Version"] = (cBetaVersion() ? qsl("%1 beta").arg(cBetaVersion()) : (cDevVersion() ? qsl("%1 dev") : qsl("%1")).arg(AppVersion)).toUtf8().constData(); ProcessAnnotations["Launched"] = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss").toUtf8().constData(); ProcessAnnotations["Platform"] = cPlatformString().toUtf8().constData(); + ProcessAnnotations["UserTag"] = QString::number(Sandbox::UserTag(), 16).toUtf8().constData(); QString dumpspath = cWorkingDir() + qsl("tdata/dumps"); QDir().mkpath(dumpspath); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index e9c8502db6..0410baf264 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -426,7 +426,7 @@ namespace { size = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); len -= 3; } - if (size * sizeof(mtpPrime) != len) { + if (size * int32(sizeof(mtpPrime)) != len) { LOG(("TCP Error: bad packet header")); TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); return mtpBuffer(1, -500); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index a87d0fa679..b93bf822d3 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -222,6 +222,17 @@ inline void memsetrnd(T &value) { memset_rand(&value, sizeof(value)); } +inline void memset_rand_bad(void *data, uint32 len) { + for (uchar *i = reinterpret_cast(data), *e = i + len; i != e; ++i) { + *i = uchar(rand() & 0xFF); + } +} + +template +inline void memsetrnd_bad(T &value) { + memset_rand_bad(&value, sizeof(value)); +} + class ReadLockerAttempt { public: diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 9c6b19c649..87022c4d94 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2118,7 +2118,7 @@ LastCrashedWindow::LastCrashedWindow() #endif _pleaseSendReport.setText(qsl("Please send us a crash report.")); - _yourReportName.setText(qsl("Your crash report tag: %1").arg(_minidumpName)); + _yourReportName.setText(qsl("Your Report Tag: %1\nYour User Tag: %2").arg(QString(_minidumpName).replace(".dmp", "")).arg(Sandbox::UserTag(), 0, 16)); _yourReportName.setCursor(style::cur_text); _yourReportName.setTextInteractionFlags(Qt::TextSelectableByMouse); From a5b466ec054c71f0039e1abfb092571f90e62faa Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Feb 2016 14:21:39 +0300 Subject: [PATCH 090/316] link clicks and popup menu items activated async, some crashes fixed --- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/facades.cpp | 19 +++++++++++++++++-- Telegram/SourceFiles/facades.h | 2 ++ Telegram/SourceFiles/gui/popupmenu.cpp | 2 +- Telegram/SourceFiles/history.cpp | 3 ++- Telegram/SourceFiles/historywidget.cpp | 14 +++++++------- .../SourceFiles/mtproto/mtpConnection.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 6 +++--- Telegram/SourceFiles/types.cpp | 3 +-- Telegram/SourceFiles/window.cpp | 4 ++++ Telegram/SourceFiles/window.h | 2 ++ 11 files changed, 41 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 2915f02ac6..d196f32493 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1410,7 +1410,7 @@ namespace App { QString uname(username.trimmed()); for (PeersData::const_iterator i = peersData.cbegin(), e = peersData.cend(); i != e; ++i) { if (!i.value()->userName().compare(uname, Qt::CaseInsensitive)) { - return i.value()->asUser(); + return i.value(); } } return 0; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 1750f0250b..fda6a00a27 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -63,11 +63,26 @@ namespace App { } void removeDialog(History *history) { - if (MainWidget *m = main()) m->removeDialog(history); + if (MainWidget *m = main()) { + m->removeDialog(history); + } } void showSettings() { - if (Window *win = wnd()) win->showSettings(); + if (Window *w = wnd()) { + w->showSettings(); + } + } + + Q_DECLARE_METATYPE(TextLinkPtr); + Q_DECLARE_METATYPE(Qt::MouseButton); + + void activateTextLink(TextLinkPtr link, Qt::MouseButton button) { + if (Window *w = wnd()) { + qRegisterMetaType(); + qRegisterMetaType(); + QMetaObject::invokeMethod(w, "app_activateTextLink", Qt::QueuedConnection, Q_ARG(TextLinkPtr, link), Q_ARG(Qt::MouseButton, button)); + } } } diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 43da4a0268..074e0ab24b 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -35,6 +35,8 @@ namespace App { void removeDialog(History *history); void showSettings(); + void activateTextLink(TextLinkPtr link, Qt::MouseButton button); + }; namespace Ui { diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index f116dce00c..8fb99d7d52 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -81,7 +81,7 @@ void PopupMenu::init() { QAction *PopupMenu::addAction(const QString &text, const QObject *receiver, const char* member) { QAction *a = new QAction(text, this); - connect(a, SIGNAL(triggered(bool)), receiver, member); + connect(a, SIGNAL(triggered(bool)), receiver, member, Qt::QueuedConnection); return addAction(a); } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index b27b6aac0e..6ad8a9bca8 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -681,8 +681,9 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { int32 addToH = 0, skip = 0; if (!blocks.isEmpty()) { // remove date block if (width) addToH = -blocks.front()->height; - delete blocks.front(); + HistoryBlock *dateblock = blocks.front(); blocks.pop_front(); + delete dateblock; } HistoryItem *till = blocks.isEmpty() ? 0 : blocks.front()->items.front(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e8b3539667..a7e5a35958 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -684,11 +684,12 @@ void HistoryInner::itemRemoved(HistoryItem *item) { dragActionCancel(); } + if (_dragSelFrom == item || _dragSelTo == item) { + _dragSelFrom = 0; + _dragSelTo = 0; + update(); + } onUpdateSelected(); - - if (_dragSelFrom == item) _dragSelFrom = 0; - if (_dragSelTo == item) _dragSelTo = 0; - updateDragSelection(_dragSelFrom, _dragSelTo, _dragSelecting, true); } void HistoryInner::dragActionFinish(const QPoint &screenPos, Qt::MouseButton button) { @@ -730,10 +731,9 @@ void HistoryInner::dragActionFinish(const QPoint &screenPos, Qt::MouseButton but _wasSelectedText = false; if (needClick) { - DEBUG_LOG(("Clicked link: %1 (%2) %3").arg(needClick->text()).arg(needClick->readable()).arg(needClick->encoded())); + DEBUG_LOG(("Will click link: %1 (%2) %3").arg(needClick->text()).arg(needClick->readable()).arg(needClick->encoded())); dragActionCancel(); - - needClick->onClick(button); // this possibly can delete this object + App::activateTextLink(needClick, button); return; } if (_dragAction == PrepareSelect && !_dragWasInactive && !_selected.isEmpty() && _selected.cbegin().value() == FullSelection) { diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index e9c8502db6..5f42edecda 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -606,7 +606,7 @@ void MTPabstractTcpConnection::socketRead() { longBuffer.clear(); } else if (!readingToShort && packetRead < MTPShortBufferSize * sizeof(mtpPrime)) { memcpy(shortBuffer, currentPos - packetRead, packetRead); - currentPos = (char*)shortBuffer; + currentPos = (char*)shortBuffer + packetRead; readingToShort = true; longBuffer.clear(); } diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 90757d14e7..3803850684 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -199,15 +199,15 @@ void PeerData::fillNames() { names.clear(); chars.clear(); QString toIndex = textAccentFold(name); + if (cRussianLetters().match(toIndex).hasMatch()) { + toIndex += ' ' + translitRusEng(toIndex); + } if (isUser()) { if (!asUser()->nameOrPhone.isEmpty() && asUser()->nameOrPhone != name) toIndex += ' ' + textAccentFold(asUser()->nameOrPhone); if (!asUser()->username.isEmpty()) toIndex += ' ' + textAccentFold(asUser()->username); } else if (isChannel()) { if (!asChannel()->username.isEmpty()) toIndex += ' ' + textAccentFold(asChannel()->username); } - if (cRussianLetters().match(toIndex).hasMatch()) { - toIndex += ' ' + translitRusEng(toIndex); - } toIndex += ' ' + rusKeyboardLayoutSwitch(toIndex); QStringList namesList = toIndex.toLower().split(cWordSplit(), QString::SkipEmptyParts); diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 67adc1560c..706cae9c47 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -811,8 +811,7 @@ QString translitRusEng(const QString &rus) { result.reserve(rus.size() * 2); int32 toSkip = 0; - for (QString::const_iterator i = rus.cbegin(), e = rus.cend(); i != e;) { - i += toSkip; + for (QString::const_iterator i = rus.cbegin(), e = rus.cend(); i != e; i += toSkip) { result += translitLetterRusEng(*i, (i + 1 == e) ? ' ' : *(i + 1), toSkip); } return result; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 9c6b19c649..749c7a9774 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1651,6 +1651,10 @@ void Window::notifyUpdateAllPhotos() { if (_mediaView && !_mediaView->isHidden()) _mediaView->updateControls(); } +void Window::app_activateTextLink(TextLinkPtr link, Qt::MouseButton button) { + link->onClick(button); +} + void Window::notifyUpdateAll() { if (cCustomNotifies()) { for (NotifyWindows::const_iterator i = notifyWindows.cbegin(), e = notifyWindows.cend(); i != e; ++i) { diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index 63c1675d00..af821859f0 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -281,6 +281,8 @@ public slots: void notifyUpdateAllPhotos(); + void app_activateTextLink(TextLinkPtr link, Qt::MouseButton button); + signals: void resized(const QSize &size); From d178b84baf3701edfc8f62ad1aca5fa028f8467a Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Feb 2016 16:06:27 +0300 Subject: [PATCH 091/316] langs updated --- Telegram/Resources/lang.strings | 2 +- Telegram/SourceFiles/langs/lang_de.strings | 4 +++- Telegram/SourceFiles/langs/lang_es.strings | 6 ++++-- Telegram/SourceFiles/langs/lang_it.strings | 6 ++++-- Telegram/SourceFiles/langs/lang_ko.strings | 4 +++- Telegram/SourceFiles/langs/lang_nl.strings | 4 +++- Telegram/SourceFiles/langs/lang_pt_BR.strings | 4 +++- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 0ee26c103f..a03f486635 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -836,7 +836,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop was updated to version {version}\n\n{changes}\n\nFull version history is available here:\n{link}"; "lng_new_version_minor" = "— Bug fixes and other minor improvements"; -"lng_new_version_text" = "GIF revolution: 10x faster sending and downloading, autoplay, save your favorite GIFs to a dedicated tab on the sticker panel.\n\nMore about GIFs:\n{gifs_link}\n\nInline bots: A new way to add bot content to any chat. Type a bot's username and your query in the text field to get instant results and send them to your chat partner. Try typing “@gif dog” in your next chat. Sample bots: @gif, @wiki, @bing, @vid, @bold.\n\nMore about inline bots:\n{bots_link}\n\nAlso in this release: New cute design for media, automatic download settings for photos, voice messages and GIFs."; +"lng_new_version_text" = "— New waveform visualizations for voice messages\n— Sticker suggestions when you type an emoji"; "lng_menu_insert_unicode" = "Insert Unicode control character"; diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 98f775bac2..364c5849a8 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Du kannst nur Personen hinzufügen, wenn ihr eure Nummern ausgetauscht habt. {more_info}"; "lng_cant_invite_not_contact_channel" = "Du kannst nur Personen hinzufügen,wenn ihr\neure Nummern ausgetauscht habt. {more_info}\n"; "lng_cant_more_info" = "Weitere Infos »"; +"lng_cant_invite_privacy" = "Du kannst mit diesen Nutzern keine Gruppe erstellen, weil sie es nicht erlauben."; +"lng_cant_invite_privacy_channel" = "Du kannst diese Nutzer keinen Kanälen hinzufügen, weil sie es nicht erlauben."; "lng_send_button" = "Senden"; "lng_message_ph" = "Schreibe deine Nachricht.."; @@ -834,7 +836,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}"; "lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen"; -"lng_new_version_text" = "GIF-Revolution: 10x schnelleres Senden und Herunterladen, Autoplay und Speichern von GIFs in einem eigenen Tab im Sticker-Panel.\n\nMehr Infos über GIFs:\n{gifs_link}\n\nInline-Bots: Ein neuer Weg um Bot-Inhalte dem Chat hinzuzufügen. Einfach den Bot-Benutzernamen gefolgt vom Suchbegriff im Eingabefeld eintippen um Echtzeitsuchergebnisse zu erhalten und im Chat zu senden. Probier doch mal “@gif dog” im nächsten Chat aus. Beispiel-Bots: @gif, @wiki, @bing, @vid, @bold.\n\nAusführliche Informationen zu den neuen Inline-Bots:\n{bot_link}\n\nAußerdem neu: Ein neues niedliches Design für Medien, automatische Download-Einstellungen für Bilder, Sprachnachrichten und GIFs.\n\nPS: Unseren deutschsprachigen Infokanal findest du hier: https://telegram.me/TelegramDE"; +"lng_new_version_text" = "— Neue Optik für Sprachnachrichten\n— Sticker werden nach Emoji-Eingabe vorgeschlagen"; "lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index fb3020bfaf..2c0e037f93 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -638,9 +638,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Por ahora, sólo puedes añadir contactos \nmutuos a grupos. {more_info}"; "lng_cant_invite_not_contact_channel" = "Lo sentimos, sólo puedes añadir contactos\nmutuos a canales. {more_info}"; "lng_cant_more_info" = "Más información »"; +"lng_cant_invite_privacy" = "No puedes añadir a este usuario a grupos por sus ajustes de privacidad."; +"lng_cant_invite_privacy_channel" = "No puedes añadir a este usuario a canales por sus ajustes de privacidad."; "lng_send_button" = "Enviar"; -"lng_message_ph" = "Escribir un mensaje..."; +"lng_message_ph" = "Escribe un mensaje..."; "lng_comment_ph" = "Escribe un comentario..."; "lng_broadcast_ph" = "Difunde un mensaje..."; "lng_record_cancel" = "Suelta fuera de aquí para cancelar"; @@ -834,7 +836,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop ha sido actualizada a la versión {version}\n\n{changes}\n\nEl historial completo está disponible aquí:\n{link}"; "lng_new_version_minor" = "— Corrección de errores y otras mejoras menores"; -"lng_new_version_text" = "Revolución del GIF: envío y descarga 10 veces más rápido, reproducción automática, guarda tus GIF favoritos en una pestaña especial en el panel de stickers.\n\nMás sobre los GIF:\n{gifs_link}\n\nBots integrados: una nueva forma para añadir contenidos en los chats. Escribe el alias del bot y tu solicitud, en el campo de escritura, para obtener resultados inmediatamente y enviarlos a tu compañero de chat. Prueba escribiendo “@gif dog” en un chat. Algunos ejemplos: @gif, @wiki, @bing, @vid, @bold.\n\nMás sobre los bots integrados:\n{bots_link}\n\nTambién encontrarás un lindo nuevo diseño para la multimedia y ajustes de descarga automática para fotos, mensajes de voz y GIF."; +"lng_new_version_text" = "– Nueva visualización de ondas para los mensajes de voz\n– Sugerencias de stickers cuando escribes un emoji"; "lng_menu_insert_unicode" = "Insertar caracteres de control Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 441b872c8a..c1d8564f62 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Spiacenti, ma al momento puoi aggiungere\nai gruppi solo contatti in comune. {more_info}"; "lng_cant_invite_not_contact_channel" = "Spiacenti, ma al momento puoi aggiungere\nai canali solo contatti in comune. {more_info}"; "lng_cant_more_info" = "Più info »"; +"lng_cant_invite_privacy" = "Spiacenti, non puoi aggiungere questo utente al gruppo a causa delle sue impostazioni di privacy."; +"lng_cant_invite_privacy_channel" = "Spiacenti, non puoi aggiungere questo utente al canale a causa delle sue impostazioni di privacy."; "lng_send_button" = "Invia"; "lng_message_ph" = "Scrivi un messaggio.."; @@ -833,8 +835,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_authorization" = "{name},\nAbbiamo rilevato un accesso al tuo account da un nuovo dispositivo il {day}, {date} alle {time}\n\nDispositivo: {device}\nPosizione: {location}\n\nSe non sei tu, puoi andare su Impostazioni – Mostra tutte le sessioni e terminare quella sessione.\n\nSe credi che qualcuno si sia collegato al tuo account contro il tuo volere, puoi attivare la verifica in due passaggi nelle Impostazioni. \n\nGrazie, \nIl Team di Telegram"; "lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}"; -"lng_new_version_minor" = "— Bug fix e altri miglioramenti minori"; -"lng_new_version_text" = "Rivoluzione GIF: L'invio e il download delle GIF sono ora 10 volte più veloci, riproduci automaticamente le GIF e salva le tue GIF preferite in una pagina dedicata nel pannello sticker.\n\nPiù info sulle GIF:\n{gifs_link}\n\nInline Bot: Un nuovo modo di aggiungere contenuto dai bot in qualsiasi chat. Scrivi l'username di un bot e la tua domanda nel campo di scrittura per ricevere risultati immediati e inviarli nella chat. Prova a scrivere “@gif dog” nella tua prossima chat. Bot di esempio: @gif, @wiki, @bing, @vid, @bold.\n\nPiù info sugli Inline Bot:\n{bots_link}\n\nInoltre in questa versione: Nuovo design per i media, impostazioni di download automatico per foto, note vocali e GIF."; +"lng_new_version_minor" = "— Risoluzione di problemi e altri miglioramenti minori"; +"lng_new_version_text" = "— Nuova visualizzazione delle onde sonore per i messaggi vocali\n— Suggerimento per gli sticker quando digiti un'emoji"; "lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 17bfe72f9d..1d401e7e30 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 추가 가능합니다. {more_info}"; "lng_cant_invite_not_contact_channel" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 추가 가능합니다. {more_info}"; "lng_cant_more_info" = "자세한 정보 »"; +"lng_cant_invite_privacy" = "죄송합니다, 개인설정으로 인하여 이 사용자를 그룹에 초대할 수 없습니다."; +"lng_cant_invite_privacy_channel" = "죄송합니다, 개인설정으로 인하여 이 사용자를 채널에 초대할 수 없습니다."; "lng_send_button" = "보내기"; "lng_message_ph" = "메시지 쓰기"; @@ -834,7 +836,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}"; "lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상"; -"lng_new_version_text" = "GIF 혁명: 10배 빠른 전송, 다운로드 및 자동재생이 가능하며, 스티커 패널에서 즐겨찾는 GIF를 저장가능\n\nGIF에 대한 자세한 정보:\n{gifs_link}\n\n@-봇 : 모든 대화에 봇 기능을 추가 할 수 있습니다. 봇 아이디를 입력란에 같이 입력해주시면 즉시 결과값을 확인 할 수 있습니다.“@gif dog”와 같은 명령어를 입력란에 같이 입력해보세요. 예시:@gif, @wiki, @bing, @vid, @bold.\n\n@-봇에 대한 자세한 정보\n{bots_link}\n\n업데이트 추가사항: 미디어, 사진, 음성메시지 및 GIF 파일 자동다운로드 설정화면 새로운 디자인 적용"; +"lng_new_version_text" = "— 음성 메시지에 웨이브 시각 효과 추가\n— 이모티콘 입력시 스티커 추천"; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 4a6b48ee17..6f6d5dca07 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Op dit moment kun je alleen onderlinge\ncontacten aan groepen toevoegen. {more_info}"; "lng_cant_invite_not_contact_channel" = "Je kunt momenteel alleen onderlinge\ncontacten aan kanalen toevoegen.\n{more_info}"; "lng_cant_more_info" = "Meer informatie »"; +"lng_cant_invite_privacy" = "Je kunt deze gebruiker niet toevoegen aan groepen door zijn/haar privacyinstellingen."; +"lng_cant_invite_privacy_channel" = "Je kunt deze gebruiker niet toevoegen aan kanalen door zijn/haar privacyinstellingen."; "lng_send_button" = "Stuur"; "lng_message_ph" = "Bericht schrijven"; @@ -834,7 +836,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}"; "lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen"; -"lng_new_version_text" = "GIF-revolutie: 10 keer zo snel GIF's sturen en downloaden. Speel ze automatisch af en sla je favorieten op in het stickerpaneel.\n\nMeer over GIFs:\n{gifs_link}\n\nInline-bots: Voeg botcontent toe aan chats op een nieuwe manier! Geef in het invoerveld de naam van een bot en je commando in en stuur de resultaten naar je chatpartner. Probeer het eens met “@gif dog”. Voorbeelden: @gif, @wiki, @bing, @vid, @bold.\n\nMeer over inline-bots:\n{bots_link}\n\nIn deze release hebben we nog meer voor je. Een nieuw design voor media en automatische download-instellingen voor foto's, spraakberichten en GIF's."; +"lng_new_version_text" = "— Nieuwe visualisatie voor spraakberichten\n— Stickersuggesties als een emoji typt"; "lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index e4a7a676cd..bc77b4a315 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Você só pode adicionar contatos\nmútuos ao grupo no momento. {more_info}"; "lng_cant_invite_not_contact_channel" = "Desculpe, você só pode adicionar contatos\nmútuos para canais no momento. {more_info}"; "lng_cant_more_info" = "Informações »"; +"lng_cant_invite_privacy" = "Você não pode adicionar esse usuário em grupos devido as configurações de privacidade."; +"lng_cant_invite_privacy_channel" = "Você não pode adicionar esse usuário em canais devido as configurações de privacidade."; "lng_send_button" = "Enviar"; "lng_message_ph" = "Escrever a mensagem.."; @@ -834,7 +836,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop foi atualizado para a versão {version}\n\n{changes}\n\nHistórico completo de mudanças disponível aqui:\n{link}"; "lng_new_version_minor" = "— Resolução de bugs e outras melhorias menores"; -"lng_new_version_text" = "Revolução dos GIFs: download e envio 10x mais rápido, reprodução automática, salve seus GIFs favoritos em um guia dedicada no painel de stickers.\n\nMais sobre GIFs:\n{gifs_link}\n\nBots integrados: Uma nova maneira de adicionar conteúdo de um bot a qualquer conversa. Digite o nome de usuário do bot seguido do comando no campo de texto para obter resultados imediatos e enviá-los na conversa. Experimente digitar “@gif dog” na sua próxima conversa. Bots de exemplo: @gif, @wiki, @bing, @vid, @bold.\n\nMais sobre bots integrados:\n{bots_link}\n\nTambém nessa versão: Novo design para mídias, configuração de download automático para fotos, mensagens de voz e GIFs."; +"lng_new_version_text" = "— Nova visualização em ondas para mensagens de voz\n— Sugestões de sticker quando você inicia com emoji"; "lng_menu_insert_unicode" = "Inserir caractere de controle Unicode"; From 80455492b02fff2c7965fa93bb3f444a9b924bf6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Feb 2016 16:14:19 +0300 Subject: [PATCH 092/316] a couple of crashes fixed, version 0.9.24 stable --- Telegram/SourceFiles/application.cpp | 13 +++++-------- Telegram/SourceFiles/config.h | 6 +++--- Telegram/SourceFiles/dialogswidget.cpp | 8 ++++++-- Telegram/SourceFiles/overviewwidget.cpp | 18 ++++++++++++------ Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 8 ++++---- 8 files changed, 41 insertions(+), 34 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index dc3fc7505d..f9c77dfc0f 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1051,14 +1051,11 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9022) { - if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); - } else { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); - } - } else if (Local::oldMapVersion() < 9016) { - versionFeatures = lng_new_version_text(lt_gifs_link, qsl("https://telegram.org/blog/gif-revolution"), lt_bots_link, qsl("https://telegram.org/blog/inline-bots")).trimmed(); + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9024) { +// versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + versionFeatures = lang(lng_new_version_minor).trimmed(); + } else if (Local::oldMapVersion() < 9024) { + versionFeatures = lang(lng_new_version_text).trimmed(); } else { versionFeatures = lang(lng_new_version_minor).trimmed(); } diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 363e19b564..e8981faaee 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9023; -static const wchar_t *AppVersionStr = L"0.9.23"; -static const bool DevVersion = true; +static const int32 AppVersion = 9024; +static const wchar_t *AppVersionStr = L"0.9.24"; +static const bool DevVersion = false; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index f968d3d571..889580af44 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -963,7 +963,9 @@ void DialogsInner::dialogsReceived(const QVector &added) { case mtpc_dialog: { const MTPDdialog &d(i->c_dialog()); history = App::historyFromDialog(peerFromMTP(d.vpeer), d.vunread_count.v, d.vread_inbox_max_id.v); - App::main()->applyNotifySetting(MTP_notifyPeer(d.vpeer), d.vnotify_settings, history); + if (App::main()) { + App::main()->applyNotifySetting(MTP_notifyPeer(d.vpeer), d.vnotify_settings, history); + } } break; case mtpc_dialogChannel: { @@ -986,7 +988,9 @@ void DialogsInner::dialogsReceived(const QVector &added) { if (!history->isMegagroup() && d.vtop_message.v > d.vtop_important_message.v) { history->setNotLoadedAtBottom(); } - App::main()->applyNotifySetting(MTP_notifyPeer(d.vpeer), d.vnotify_settings, history); + if (App::main()) { + App::main()->applyNotifySetting(MTP_notifyPeer(d.vpeer), d.vnotify_settings, history); + } } break; } diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 919f770a2e..f00799cf63 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1821,19 +1821,25 @@ void OverviewInner::itemRemoved(HistoryItem *item) { _overview->updateTopBarSelection(); } - onUpdateSelected(); + LayoutItems::iterator j = _layoutItems.find(item); + if (j != _layoutItems.cend()) { + int32 index = _items.indexOf(j.value()); + if (index >= 0) { + _items.remove(index); + } + delete j.value(); + _layoutItems.erase(j); + } - if (_dragSelFrom == msgId) { + if (_dragSelFrom == msgId || _dragSelTo == msgId) { _dragSelFrom = 0; _dragSelFromIndex = -1; - } - if (_dragSelTo == msgId) { _dragSelTo = 0; _dragSelToIndex = -1; + update(); } - updateDragSelection(_dragSelFrom, _dragSelFromIndex, _dragSelTo, _dragSelToIndex, _dragSelecting); - update(); + onUpdateSelected(); } void OverviewInner::repaintItem(const HistoryItem *msg) { diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 468ce68fd6..48739e2a3e 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.23 + 0.9.24 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 036e34bc70..a73c381b16 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,23,0 - PRODUCTVERSION 0,9,23,0 + FILEVERSION 0,9,24,0 + PRODUCTVERSION 0,9,24,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.23.0" + VALUE "FileVersion", "0.9.24.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.23.0" + VALUE "ProductVersion", "0.9.24.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 3f464ec555..90ee768992 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.23; + CURRENT_PROJECT_VERSION = 0.9.24; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.23; + CURRENT_PROJECT_VERSION = 0.9.24; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.23; + CURRENT_PROJECT_VERSION = 0.9.24; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.23; + DYLIB_CURRENT_VERSION = 0.9.24; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.23; + CURRENT_PROJECT_VERSION = 0.9.24; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.23; + DYLIB_CURRENT_VERSION = 0.9.24; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 98e88320e9..5108f1ff6f 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9023 +AppVersion 9024 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.23 -AppVersionStr 0.9.23 -DevChannel 1 +AppVersionStrSmall 0.9.24 +AppVersionStr 0.9.24 +DevChannel 0 BetaVersion 0 9019002 From 6a299e32d31001aad32f90ec9b1e76ef8868b898 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Feb 2016 16:33:33 +0300 Subject: [PATCH 093/316] fixed metatypes declaration for 0.9.24 version --- Telegram/SourceFiles/facades.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 6f74d9021f..e6b3c22f0a 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -26,6 +26,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "layerwidget.h" #include "lang.h" +Q_DECLARE_METATYPE(TextLinkPtr); +Q_DECLARE_METATYPE(Qt::MouseButton); + namespace App { void sendBotCommand(const QString &cmd, MsgId replyTo) { @@ -74,9 +77,6 @@ namespace App { } } - Q_DECLARE_METATYPE(TextLinkPtr); - Q_DECLARE_METATYPE(Qt::MouseButton); - void activateTextLink(TextLinkPtr link, Qt::MouseButton button) { if (Window *w = wnd()) { qRegisterMetaType(); From 7433cea0fdc8970cad8348aa566fdd0962abdd9b Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 17 Feb 2016 19:37:21 +0300 Subject: [PATCH 094/316] fixed copy selected text, post author display added, post links handling added, windows bingmaps opening added, sticker previews from mentionsdropdown and stickersetbox added --- Telegram/Resources/style.txt | 1 + Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/app.h | 2 +- Telegram/SourceFiles/application.cpp | 4 +- Telegram/SourceFiles/boxes/stickersetbox.cpp | 58 +++- Telegram/SourceFiles/boxes/stickersetbox.h | 15 +- Telegram/SourceFiles/dropdown.cpp | 54 +++- Telegram/SourceFiles/dropdown.h | 10 +- Telegram/SourceFiles/facades.cpp | 12 +- Telegram/SourceFiles/facades.h | 2 +- Telegram/SourceFiles/gui/text.cpp | 24 +- Telegram/SourceFiles/gui/text.h | 32 +- Telegram/SourceFiles/history.cpp | 314 +++++++++++-------- Telegram/SourceFiles/history.h | 105 ++++--- Telegram/SourceFiles/historywidget.cpp | 93 +++--- Telegram/SourceFiles/mainwidget.cpp | 109 ++++--- Telegram/SourceFiles/mainwidget.h | 10 +- Telegram/SourceFiles/mediaview.cpp | 6 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 193 ++++++++---- Telegram/SourceFiles/mtproto/mtpScheme.h | 236 ++++++++++++-- Telegram/SourceFiles/mtproto/scheme.tl | 22 +- Telegram/SourceFiles/overviewwidget.cpp | 9 +- Telegram/SourceFiles/profilewidget.cpp | 18 +- Telegram/SourceFiles/pspecific_linux.cpp | 4 + Telegram/SourceFiles/pspecific_linux.h | 2 + Telegram/SourceFiles/pspecific_mac.cpp | 4 + Telegram/SourceFiles/pspecific_mac.h | 2 + Telegram/SourceFiles/pspecific_wnd.cpp | 4 + Telegram/SourceFiles/pspecific_wnd.h | 2 + Telegram/SourceFiles/structs.cpp | 22 +- Telegram/SourceFiles/structs.h | 6 +- Telegram/SourceFiles/window.cpp | 50 ++- Telegram/SourceFiles/window.h | 5 + 34 files changed, 1009 insertions(+), 425 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5999c47f4f..d06880d617 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -2074,6 +2074,7 @@ minPhotoSize: 100px; maxMediaSize: 420px; maxStickerSize: 256px; maxGifSize: 320px; +maxSignatureSize: 144px; mvBgColor: #222; mvBgOpacity: 0.92; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index d196f32493..22cad42f6e 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1654,7 +1654,7 @@ namespace App { return i.value(); } - ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type, const QString &url) { + ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type) { ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink); ImageLinkData *result; if (i == imageLinksData.cend()) { diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 760ea77805..2f4144e85f 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -134,7 +134,7 @@ namespace App { WebPageData *webPage(const WebPageId &webPage); WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill); ImageLinkData *imageLink(const QString &imageLink); - ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type, const QString &url); + ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type); void forgetMedia(); MTPPhoto photoFromUserPhoto(MTPint userId, MTPint date, const MTPUserProfilePhoto &photo); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f9c77dfc0f..b414fdb399 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -925,7 +925,9 @@ void AppClass::checkLocalTime() { void AppClass::onAppStateChanged(Qt::ApplicationState state) { checkLocalTime(); - _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + if (_window) { + _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + } if (state != Qt::ApplicationActive) { PopupTooltip::Hide(); } diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index 8b756c4ee4..65fdd9b32a 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -29,9 +29,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" -StickerSetInner::StickerSetInner(const MTPInputStickerSet &set) : -_loaded(false), _setId(0), _setAccess(0), _setCount(0), _setHash(0), _setFlags(0), _bottom(0), -_input(set), _installRequest(0) { +StickerSetInner::StickerSetInner(const MTPInputStickerSet &set) : TWidget() +, _loaded(false) +, _setId(0) +, _setAccess(0) +, _setCount(0) +, _setHash(0) +, _setFlags(0) +, _bottom(0) +, _input(set) +, _installRequest(0) +, _previewShown(-1) { connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); switch (set.type()) { case mtpc_inputStickerSetID: _setId = set.c_inputStickerSetID().vid.v; _setAccess = set.c_inputStickerSetID().vaccess_hash.v; break; @@ -39,6 +47,9 @@ _input(set), _installRequest(0) { } MTP::send(MTPmessages_GetStickerSet(_input), rpcDone(&StickerSetInner::gotSet), rpcFail(&StickerSetInner::failedSet)); App::main()->updateStickers(); + + _previewTimer.setSingleShot(true); + connect(&_previewTimer, SIGNAL(timeout()), this, SLOT(onPreview())); } void StickerSetInner::gotSet(const MTPmessages_StickerSet &set) { @@ -148,6 +159,47 @@ bool StickerSetInner::installFailed(const RPCError &error) { return true; } +void StickerSetInner::mousePressEvent(QMouseEvent *e) { + int32 index = stickerFromGlobalPos(e->globalPos()); + if (index >= 0 && index < _pack.size()) { + _previewTimer.start(QApplication::startDragTime()); + } +} + +void StickerSetInner::mouseMoveEvent(QMouseEvent *e) { + if (_previewShown >= 0) { + int32 index = stickerFromGlobalPos(e->globalPos()); + if (index >= 0 && index < _pack.size() && index != _previewShown) { + _previewShown = index; + Ui::showStickerPreview(_pack.at(_previewShown)); + } + } +} + +void StickerSetInner::mouseReleaseEvent(QMouseEvent *e) { + _previewTimer.stop(); +} + +void StickerSetInner::onPreview() { + int32 index = stickerFromGlobalPos(QCursor::pos()); + if (index >= 0 && index < _pack.size()) { + _previewShown = index; + Ui::showStickerPreview(_pack.at(_previewShown)); + } +} + +int32 StickerSetInner::stickerFromGlobalPos(const QPoint &p) const { + QPoint l(mapFromGlobal(p)); + if (rtl()) l.setX(width() - l.x()); + int32 row = (l.y() >= st::stickersPadding.top()) ? qFloor((l.y() - st::stickersPadding.top()) / st::stickersSize.height()) : -1; + int32 col = (l.x() >= st::stickersPadding.left()) ? qFloor((l.x() - st::stickersPadding.left()) / st::stickersSize.width()) : -1; + if (row >= 0 && col >= 0 && col < StickerPanPerRow) { + int32 result = row * StickerPanPerRow + col; + return (result < _pack.size()) ? result : -1; + } + return -1; +} + void StickerSetInner::paintEvent(QPaintEvent *e) { QRect r(e->rect()); Painter p(this); diff --git a/Telegram/SourceFiles/boxes/stickersetbox.h b/Telegram/SourceFiles/boxes/stickersetbox.h index d2fd4749ee..356fd4b60f 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.h +++ b/Telegram/SourceFiles/boxes/stickersetbox.h @@ -29,7 +29,9 @@ public: StickerSetInner(const MTPInputStickerSet &set); - void init(); + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); void paintEvent(QPaintEvent *e); @@ -42,10 +44,12 @@ public: void setScrollBottom(int32 bottom); void install(); - QString getTitle() const; - ~StickerSetInner(); +public slots: + + void onPreview(); + signals: void updateButtons(); @@ -53,6 +57,8 @@ signals: private: + int32 stickerFromGlobalPos(const QPoint &p) const; + void gotSet(const MTPmessages_StickerSet &set); bool failedSet(const RPCError &error); @@ -70,6 +76,9 @@ private: MTPInputStickerSet _input; mtpRequestId _installRequest; + + QTimer _previewTimer; + int32 _previewShown; }; class StickerSetBox : public ScrollableBox, public RPCSender { diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 737e70d0b6..0241da6b79 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -3852,8 +3852,12 @@ MentionsInner::MentionsInner(MentionsDropdown *parent, MentionRows *mrows, Hasht , _stickersPerRow(1) , _recentInlineBotsInRows(0) , _sel(-1) +, _down(-1) , _mouseSel(false) -, _overDelete(false) { +, _overDelete(false) +, _previewShown(false) { + _previewTimer.setSingleShot(true); + connect(&_previewTimer, SIGNAL(timeout()), this, SLOT(onPreview())); } void MentionsInner::paintEvent(QPaintEvent *e) { @@ -4030,9 +4034,13 @@ void MentionsInner::mouseMoveEvent(QMouseEvent *e) { onUpdateSelected(true); } -void MentionsInner::clearSel() { +void MentionsInner::clearSel(bool hidden) { _mouseSel = _overDelete = false; setSel((_mrows->isEmpty() && _brows->isEmpty() && _hrows->isEmpty()) ? -1 : 0); + if (hidden) { + _down = -1; + _previewShown = false; + } } bool MentionsInner::moveSel(int key) { @@ -4140,12 +4148,35 @@ void MentionsInner::mousePressEvent(QMouseEvent *e) { _mouseSel = true; onUpdateSelected(true); - } else { + } else if (_srows->isEmpty()) { select(); + } else { + _down = _sel; + _previewTimer.start(QApplication::startDragTime()); } } } +void MentionsInner::mouseReleaseEvent(QMouseEvent *e) { + _previewTimer.stop(); + + int32 pressed = _down; + _down = -1; + + _mousePos = mapToGlobal(e->pos()); + _mouseSel = true; + onUpdateSelected(true); + + if (_previewShown) { + _previewShown = false; + return; + } + + if (_sel < 0 || _sel != pressed || _srows->isEmpty()) return; + + select(); +} + void MentionsInner::enterEvent(QEvent *e) { setMouseTracking(true); _mousePos = QCursor::pos(); @@ -4189,6 +4220,8 @@ void MentionsInner::onUpdateSelected(bool force) { QPoint mouse(mapFromGlobal(_mousePos)); if ((!force && !rect().contains(mouse)) || !_mouseSel) return; + if (_down >= 0 && !_previewShown) return; + int32 sel = -1, maxSel = 0; if (!_srows->isEmpty()) { int32 rows = rowscount(_srows->size(), _stickersPerRow); @@ -4209,6 +4242,12 @@ void MentionsInner::onUpdateSelected(bool force) { } if (sel != _sel) { setSel(sel); + if (_down >= 0 && _sel >= 0 && _down != _sel) { + _down = _sel; + if (_down >= 0 && _down < _srows->size()) { + Ui::showStickerPreview(_srows->at(_down)); + } + } } } @@ -4220,6 +4259,13 @@ void MentionsInner::onParentGeometryChanged() { } } +void MentionsInner::onPreview() { + if (_down >= 0 && _down < _srows->size()) { + Ui::showStickerPreview(_srows->at(_down)); + _previewShown = true; + } +} + MentionsDropdown::MentionsDropdown(QWidget *parent) : TWidget(parent) , _scroll(this, st::mentionScroll) , _inner(this, &_mrows, &_hrows, &_brows, &_srows) @@ -4569,7 +4615,7 @@ void MentionsDropdown::hideFinish() { hide(); _hiding = false; _filter = qsl("-"); - _inner.clearSel(); + _inner.clearSel(true); } void MentionsDropdown::showStart() { diff --git a/Telegram/SourceFiles/dropdown.h b/Telegram/SourceFiles/dropdown.h index 5ff587a236..bacf6149c1 100644 --- a/Telegram/SourceFiles/dropdown.h +++ b/Telegram/SourceFiles/dropdown.h @@ -744,8 +744,9 @@ public: void mousePressEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); - void clearSel(); + void clearSel(bool hidden = false); bool moveSel(int key); bool select(); @@ -763,6 +764,7 @@ public slots: void onParentGeometryChanged(); void onUpdateSelected(bool force = false); + void onPreview(); private: @@ -775,11 +777,15 @@ private: BotCommandRows *_brows; StickerPack *_srows; int32 _stickersPerRow, _recentInlineBotsInRows; - int32 _sel; + int32 _sel, _down; bool _mouseSel; QPoint _mousePos; bool _overDelete; + + bool _previewShown; + + QTimer _previewTimer; }; class MentionsDropdown : public TWidget { diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index e6b3c22f0a..d65081f517 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -44,8 +44,8 @@ namespace App { if (MainWidget *m = main()) m->searchMessages(tag + ' ', (inPeer && inPeer->isChannel()) ? inPeer : 0); } - void openPeerByName(const QString &username, bool toProfile, const QString &startToken) { - if (MainWidget *m = main()) m->openPeerByName(username, toProfile, startToken); + void openPeerByName(const QString &username, MsgId msgId, const QString &startToken) { + if (MainWidget *m = main()) m->openPeerByName(username, msgId, startToken); } void joinGroupByHash(const QString &hash) { @@ -90,11 +90,15 @@ namespace App { namespace Ui { void showStickerPreview(DocumentData *sticker) { - if (MainWidget *m = App::main()) m->ui_showStickerPreview(sticker); + if (Window *w = App::wnd()) { + w->ui_showStickerPreview(sticker); + } } void hideStickerPreview() { - if (MainWidget *m = App::main()) m->ui_hideStickerPreview(); + if (Window *w = App::wnd()) { + w->ui_hideStickerPreview(); + } } void showLayer(LayeredWidget *box, ShowLayerOptions options) { diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 328773f2de..e89c2da180 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -27,7 +27,7 @@ namespace App { void sendBotCommand(const QString &cmd, MsgId replyTo = 0); bool insertBotCommand(const QString &cmd, bool specialGif = false); void searchByHashtag(const QString &tag, PeerData *inPeer); - void openPeerByName(const QString &username, bool toProfile = false, const QString &startToken = QString()); + void openPeerByName(const QString &username, MsgId msgId = ShowAtUnreadMsgId, const QString &startToken = QString()); void joinGroupByHash(const QString &hash); void stickersBox(const QString &name); void openLocalUrl(const QString &url); diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 00f31d3041..6e7a772c8b 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -914,19 +914,22 @@ void TextLink::onClick(Qt::MouseButton button) const { PopupTooltip::Hide(); QString url = TextLink::encoded(); - QRegularExpressionMatch telegramMeUser = QRegularExpression(qsl("^https?://telegram\\.me/([a-zA-Z0-9\\.\\_]+)/?(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); + QRegularExpressionMatch telegramMeUser = QRegularExpression(qsl("^https?://telegram\\.me/([a-zA-Z0-9\\.\\_]+)(/?\\?|/?$|/(\\d+)/?(?:\\?|$))"), QRegularExpression::CaseInsensitiveOption).match(url); QRegularExpressionMatch telegramMeGroup = QRegularExpression(qsl("^https?://telegram\\.me/joinchat/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); QRegularExpressionMatch telegramMeStickers = QRegularExpression(qsl("^https?://telegram\\.me/addstickers/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); QRegularExpressionMatch telegramMeShareUrl = QRegularExpression(qsl("^https?://telegram\\.me/share/url\\?(.+)$"), QRegularExpression::CaseInsensitiveOption).match(url); - if (telegramMeUser.hasMatch()) { - QString params = url.mid(telegramMeUser.captured(0).size()); - url = qsl("tg://resolve/?domain=") + myUrlEncode(telegramMeUser.captured(1)) + (params.isEmpty() ? QString() : '&' + params); - } else if (telegramMeGroup.hasMatch()) { + if (telegramMeGroup.hasMatch()) { url = qsl("tg://join?invite=") + myUrlEncode(telegramMeGroup.captured(1)); } else if (telegramMeStickers.hasMatch()) { url = qsl("tg://addstickers?set=") + myUrlEncode(telegramMeStickers.captured(1)); } else if (telegramMeShareUrl.hasMatch()) { url = qsl("tg://msg_url?") + telegramMeShareUrl.captured(1); + } else if (telegramMeUser.hasMatch()) { + QString params = url.mid(telegramMeUser.captured(0).size()), postParam; + if (QRegularExpression(qsl("^/\\d+/?(?:\\?|$)")).match(telegramMeUser.captured(2)).hasMatch()) { + postParam = qsl("&post=") + telegramMeUser.captured(3); + } + url = qsl("tg://resolve/?domain=") + myUrlEncode(telegramMeUser.captured(1)) + postParam + (params.isEmpty() ? QString() : '&' + params); } if (QRegularExpression(qsl("^tg://[a-zA-Z0-9]+"), QRegularExpression::CaseInsensitiveOption).match(url).hasMatch()) { @@ -951,6 +954,17 @@ void CustomTextLink::onClick(Qt::MouseButton button) const { Ui::showLayer(new ConfirmLinkBox(text())); } +void LocationLink::onClick(Qt::MouseButton button) const { + if (!psLaunchMaps(_lat, _lon)) { + QDesktopServices::openUrl(_text); + } +} + +void LocationLink::setup() { + QString latlon = _lat + ',' + _lon; + _text = qsl("https://maps.google.com/maps?q=") + latlon + qsl("&ll=") + latlon + qsl("&z=16"); +} + void MentionLink::onClick(Qt::MouseButton button) const { if (button == Qt::LeftButton || button == Qt::MiddleButton) { App::openPeerByName(_tag.mid(1), true); diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index 1312bc759f..341ebb9034 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -374,7 +374,7 @@ public: QUrl u(_url), good(u.isValid() ? u.toEncoded() : QString()); QString result(good.isValid() ? QString::fromUtf8(good.toEncoded()) : _url); - if (!QRegularExpression(qsl("^[a-zA-Z]+://")).match(result).hasMatch()) { // no protocol + if (!QRegularExpression(qsl("^[a-zA-Z]+:")).match(result).hasMatch()) { // no protocol return qsl("http://") + result; } return result; @@ -423,6 +423,36 @@ private: }; +class LocationLink : public ITextLink { + TEXT_LINK_CLASS(LocationLink) + +public: + + LocationLink(const QString &lat, const QString &lon) : _lat(lat), _lon(lon) { + setup(); + } + + const QString &text() const { + return _text; + } + + void onClick(Qt::MouseButton button) const; + + const QString &readable() const { + return _text; + } + + QString encoded() const { + return _text; + } + +private: + + void setup(); + QString _lat, _lon, _text; + +}; + class MentionLink : public ITextLink { TEXT_LINK_CLASS(MentionLink) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e64facc5b4..eeda88bf71 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -88,10 +88,10 @@ namespace { return item ? item->toHistoryForwarded() : 0; } inline const TextParseOptions &itemTextOptions(HistoryItem *item) { - return itemTextOptions(item->history(), item->from()); + return itemTextOptions(item->history(), item->author()); } inline const TextParseOptions &itemTextNoMonoOptions(const HistoryItem *item) { - return itemTextNoMonoOptions(item->history(), item->from()); + return itemTextNoMonoOptions(item->history(), item->author()); } } @@ -1385,7 +1385,7 @@ 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, 0); + 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, -1, 0); } 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); } else { @@ -1532,8 +1532,8 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo return regItem(result); } -HistoryItem *History::createItemForwarded(HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg) { - return regItem(new HistoryForwarded(this, block, id, date, from, msg)); +HistoryItem *History::createItemForwarded(HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) { + return regItem(new HistoryForwarded(this, block, 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) { @@ -1609,7 +1609,7 @@ HistoryItem *History::addToHistory(const MTPMessage &msg) { return createItem(0, msg, false); } -HistoryItem *History::addNewForwarded(MsgId id, QDateTime date, int32 from, HistoryMessage *item) { +HistoryItem *History::addNewForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *item) { HistoryBlock *to = 0; bool newBlock = blocks.isEmpty(); if (newBlock) { @@ -1617,7 +1617,7 @@ HistoryItem *History::addNewForwarded(MsgId id, QDateTime date, int32 from, Hist } else { to = blocks.back(); } - return addNewItem(to, newBlock, createItemForwarded(to, id, date, from, item), true); + return addNewItem(to, newBlock, createItemForwarded(to, 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) { @@ -1823,7 +1823,9 @@ void History::unregTyping(UserData *from) { void History::newItemAdded(HistoryItem *item) { App::checkImageCacheSize(); if (item->from() && item->from()->isUser()) { - unregTyping(item->from()->asUser()); + if (item->from() == item->author()) { + unregTyping(item->from()->asUser()); + } item->from()->asUser()->madeAction(); } if (item->out()) { @@ -2001,28 +2003,30 @@ 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()) { - bool wasKeyboardHide = markupSenders->contains(item->from()); + bool wasKeyboardHide = markupSenders->contains(item->author()); if (!wasKeyboardHide) { - markupSenders->insert(item->from(), true); + markupSenders->insert(item->author(), true); } if (!(markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO)) { if (!lastKeyboardInited) { bool botNotInChat = false; if (peer->isChat()) { - botNotInChat = (!peer->canWrite() || !peer->asChat()->participants.isEmpty()) && item->from()->isUser() && !peer->asChat()->participants.contains(item->from()->asUser()); + 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->from()->isUser() && !peer->asChannel()->mgInfo->bots.contains(item->from()->asUser()); + 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->from()->id; + lastKeyboardFrom = item->author()->id; lastKeyboardUsed = false; } } @@ -2037,7 +2041,7 @@ void History::addOlderSlice(const QVector &slice, const QVectorid; - lastKeyboardFrom = item->from()->id; + lastKeyboardFrom = item->author()->id; lastKeyboardUsed = false; } } @@ -2828,7 +2832,7 @@ void HistoryBlock::removeItem(HistoryItem *item) { dh = item->height(); items.remove(i); int32 l = items.size(); - if ((!item->out() || item->fromChannel()) && item->unread() && history->unreadCount) { + if ((!item->out() || item->isPost()) && item->unread() && history->unreadCount) { history->setUnreadCount(history->unreadCount - 1); } int32 itemType = item->type(); @@ -2856,11 +2860,10 @@ HistoryItem::HistoryItem(History *history, HistoryBlock *block, MsgId msgId, int , id(msgId) , date(msgDate) , _from(from ? App::user(from) : history->peer) -, _fromVersion(_from->nameVersion) , _history(history) , _block(block) , _flags(flags) -{ +, _authorNameVersion(author()->nameVersion) { } void HistoryItem::destroy() { @@ -2913,7 +2916,7 @@ void HistoryItem::setId(MsgId newId) { } bool HistoryItem::displayFromPhoto() const { - return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !fromChannel(); + return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !isPost(); } void HistoryItem::clipCallback(ClipReaderNotification notification) { @@ -3280,7 +3283,7 @@ void HistoryPhoto::draw(Painter &p, const HistoryItem *parent, const QRect &r, b bool notChild = (parent->getMedia() == this); int32 skipx = 0, skipy = 0, width = _width, height = _height; bool bubble = parent->hasBubble(); - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 captionw = width - st::msgPadding.left() - st::msgPadding.right(); @@ -3362,7 +3365,7 @@ void HistoryPhoto::draw(Painter &p, const HistoryItem *parent, const QRect &r, b // date if (_caption.isEmpty()) { - if (notChild) { + if (notChild && (_data->uploading() || App::hoveredItem() == parent)) { int32 fullRight = skipx + width, fullBottom = skipy + height; parent->drawInfo(p, fullRight, fullBottom, 2 * skipx + width, selected, InfoDisplayOverImage); } @@ -3589,7 +3592,7 @@ void HistoryVideo::draw(Painter &p, const HistoryItem *parent, const QRect &r, b int32 skipx = 0, skipy = 0, width = _width, height = _height; bool bubble = parent->hasBubble(); - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 captionw = width - st::msgPadding.left() - st::msgPadding.right(); @@ -3829,11 +3832,11 @@ HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedi } void HistoryDocument::create(bool caption) { - uint64 mask; + uint64 mask = 0; if (_data->voice()) { - mask = HistoryDocumentVoice::Bit(); + mask |= HistoryDocumentVoice::Bit(); } else { - mask = HistoryDocumentNamed::Bit(); + mask |= HistoryDocumentNamed::Bit(); if (caption) { mask |= HistoryDocumentCaptioned::Bit(); } @@ -3924,7 +3927,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r int32 captionw = _width - st::msgPadding.left() - st::msgPadding.right(); - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; if (displayLoading) { ensureAnimation(parent); @@ -4139,7 +4142,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const { if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; bool loaded = _data->loaded(); bool showPause = updateStatusText(parent); @@ -4508,7 +4511,7 @@ void HistoryGif::draw(Painter &p, const HistoryItem *parent, const QRect &r, boo int32 skipx = 0, skipy = 0, width = _width, height = _height; bool bubble = parent->hasBubble(); - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 captionw = width - st::msgPadding.left() - st::msgPadding.right(); @@ -4789,13 +4792,13 @@ void HistorySticker::draw(Painter &p, const HistoryItem *parent, const QRect &r, _data->checkSticker(); bool loaded = _data->loaded(); - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel, hovered, pressed; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost, hovered, pressed; int32 usew = _maxw, usex = 0; const HistoryReply *reply = toHistoryReply(parent); if (reply) { usew -= st::msgReplyPadding.left() + reply->replyToWidth(); - if (fromChannel) { + if (isPost) { } else if (out) { usex = _width - usew; } @@ -4821,7 +4824,7 @@ void HistorySticker::draw(Painter &p, const HistoryItem *parent, const QRect &r, if (reply) { int32 rw = _width - usew - st::msgReplyPadding.left(), rh = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - int32 rx = fromChannel ? (usew + st::msgReplyPadding.left()) : (out ? 0 : (usew + st::msgReplyPadding.left())), ry = _height - rh; + int32 rx = isPost ? (usew + st::msgReplyPadding.left()) : (out ? 0 : (usew + st::msgReplyPadding.left())), ry = _height - rh; if (rtl()) rx = _width - rx - rw; App::roundRect(p, rx, ry, rw, rh, selected ? App::msgServiceSelectBg() : App::msgServiceBg(), selected ? ServiceSelectedCorners : ServiceCorners); @@ -4834,13 +4837,13 @@ void HistorySticker::draw(Painter &p, const HistoryItem *parent, const QRect &r, void HistorySticker::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const { if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 usew = _maxw, usex = 0; const HistoryReply *reply = toHistoryReply(parent); if (reply) { usew -= reply->replyToWidth(); - if (fromChannel) { + if (isPost) { } else if (out) { usex = _width - usew; } @@ -4848,7 +4851,7 @@ void HistorySticker::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 if (rtl()) usex = _width - usex - usew; if (reply) { int32 rw = _width - usew, rh = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - int32 rx = fromChannel ? (usew + st::msgReplyPadding.left()) : (out ? 0 : (usew + st::msgReplyPadding.left())), ry = _height - rh; + int32 rx = isPost ? (usew + st::msgReplyPadding.left()) : (out ? 0 : (usew + st::msgReplyPadding.left())), ry = _height - rh; if (rtl()) rx = _width - rx - rw; if (x >= rx && y >= ry && x < rx + rw && y < ry + rh) { lnk = reply->replyToLink(); @@ -4964,7 +4967,7 @@ void HistoryContact::draw(Painter &p, const HistoryItem *parent, const QRect &r, if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; int32 skipx = 0, skipy = 0, width = _width, height = _height; - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; if (width >= _maxw) { width = _maxw; @@ -5015,7 +5018,7 @@ void HistoryContact::draw(Painter &p, const HistoryItem *parent, const QRect &r, } void HistoryContact::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const { - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0; if (_userId) { @@ -5341,7 +5344,7 @@ void HistoryWebPage::draw(Painter &p, const HistoryItem *parent, const QRect &r, if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; int32 skipx = 0, skipy = 0, width = _width, height = _height; - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; style::color barfg = (selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor)); style::color semibold = (selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); @@ -5745,11 +5748,10 @@ _description(st::msgMinWidth) { _description.setText(st::webPageDescriptionFont, textClean(description), _webpageDescriptionOptions); } - if (url.startsWith(qsl("location:"))) { - QString lnk = qsl("https://maps.google.com/maps?q=") + url.mid(9) + qsl("&ll=") + url.mid(9) + qsl("&z=17"); - _link.reset(new TextLink(lnk)); - - _data = App::imageLinkSet(url, GoogleMapsLink, lnk); + QRegularExpressionMatch m = QRegularExpression(qsl("^location:(-?\\d+(?:\\.\\d+)?),(-?\\d+(?:\\.\\d+)?)$")).match(url); + if (m.hasMatch()) { + _link.reset(new LocationLink(m.captured(1), m.captured(2))); + _data = App::imageLinkSet(url, GoogleMapsLink); } else { _link.reset(new TextLink(url)); } @@ -5831,7 +5833,7 @@ void HistoryImageLink::draw(Painter &p, const HistoryItem *parent, const QRect & if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; int32 skipx = 0, skipy = 0, width = _width, height = _height; bool bubble = parent->hasBubble(); - bool out = parent->out(), fromChannel = parent->fromChannel(), outbg = out && !fromChannel; + bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; if (bubble) { skipx = st::mediaPadding.left(); @@ -5973,18 +5975,24 @@ void ViaInlineBotLink::onClick(Qt::MouseButton button) const { App::insertBotCommand('@' + _bot->username); } -HistoryMessageVia::HistoryMessageVia(int32 userId) -: bot(App::userLoaded(peerFromUser(userId))) +HistoryMessageVia::HistoryMessageVia(Interfaces *) +: bot(0) , width(0) -, maxWidth(bot ? st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + bot->username)) : 0) -, lnk(new ViaInlineBotLink(bot)) { +, maxWidth(0) { +} + +void HistoryMessageVia::create(int32 userId) { + if (bot = App::userLoaded(peerFromUser(userId))) { + maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + bot->username)); + lnk.reset(new ViaInlineBotLink(bot)); + } } bool HistoryMessageVia::isNull() const { return !bot || bot->username.isEmpty(); } -void HistoryMessageVia::resize(int32 availw) { +void HistoryMessageVia::resize(int32 availw) const { if (availw < 0) { text = QString(); width = 0; @@ -5999,29 +6007,46 @@ void HistoryMessageVia::resize(int32 availw) { } } +HistoryMessageViews::HistoryMessageViews(Interfaces *) +: _views(0) +, _viewsWidth(0) { +} + +HistoryMessageSigned::HistoryMessageSigned(Interfaces *) { +} + +void HistoryMessageSigned::create(UserData *from, const QDateTime &date) { + QString time = qsl(", ") + date.toString(cTimeFormat()), name = App::peerName(from); + int32 timew = st::msgDateFont->width(time), namew = st::msgDateFont->width(name); + if (timew + namew > st::maxSignatureSize) { + name = st::msgDateFont->elided(from->firstName, st::maxSignatureSize - timew); + } + _signature.setText(st::msgDateFont, name + time, _textNameOptions); +} + +int32 HistoryMessageSigned::maxWidth() const { + return _signature.maxWidth(); +} + 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) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via(msg.has_via_bot_id() ? new HistoryMessageVia(msg.vvia_bot_id.v) : 0) -, _media(0) -, _views(msg.has_views() ? msg.vviews.v : -1) { +, _media(0) { + create(msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0, msg.has_views() ? msg.vviews.v : -1); QString text(textClean(qs(msg.vmessage))); - initTime(); 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 msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, HistoryMedia *fromMedia) : +HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, int32 fromViews, HistoryMedia *fromMedia) : HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via((flags & MTPDmessage::flag_via_bot_id) ? new HistoryMessageVia(viaBotId) : 0) -, _media(0) -, _views(fromChannel() ? 1 : -1) { - initTime(); +, _media(0) { + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, (fromViews > 0) ? fromViews : (isPost() ? 1 : -1)); if (fromMedia) { _media = fromMedia->clone(); _media->regItem(this); @@ -6034,10 +6059,8 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via((flags & MTPDmessage::flag_via_bot_id) ? new HistoryMessageVia(viaBotId) : 0) -, _media(0) -, _views(fromChannel() ? 1 : -1) { - initTime(); +, _media(0) { + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); } @@ -6047,15 +6070,37 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _via((flags & MTPDmessage::flag_via_bot_id) ? new HistoryMessageVia(viaBotId) : 0) -, _media(0) -, _views(fromChannel() ? 1 : -1) { - initTime(); +, _media(0) { + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); _media = new HistoryPhoto(photo, caption, this); _media->regItem(this); setText(QString(), EntitiesInText()); } +void HistoryMessage::create(int32 viaBotId, int32 viewsCount) { + uint64 mask = 0; + if (viaBotId) { + mask |= HistoryMessageVia::Bit(); + } + if (viewsCount >= 0) { + mask |= HistoryMessageViews::Bit(); + } + if (isPost() && _from->isUser()) { + mask |= HistoryMessageSigned::Bit(); + } + UpdateInterfaces(mask); + if (HistoryMessageVia *via = Get()) { + via->create(viaBotId); + } + if (HistoryMessageViews *views = Get()) { + views->_views = viewsCount; + } + if (HistoryMessageSigned *msgsigned = Get()) { + msgsigned->create(_from->asUser(), date); + } + initTime(); +} + QString formatViewsCount(int32 views) { if (views > 999999) { views /= 100000; @@ -6076,11 +6121,16 @@ QString formatViewsCount(int32 views) { } void HistoryMessage::initTime() { - _timeText = date.toString(cTimeFormat()); - _timeWidth = st::msgDateFont->width(_timeText); - - _viewsText = (_views >= 0) ? formatViewsCount(_views) : QString(); - _viewsWidth = _viewsText.isEmpty() ? 0 : st::msgDateFont->width(_viewsText); + if (HistoryMessageSigned *msgsigned = Get()) { + _timeWidth = msgsigned->maxWidth(); + } else { + _timeText = date.toString(cTimeFormat()); + _timeWidth = st::msgDateFont->width(_timeText); + } + if (HistoryMessageViews *views = Get()) { + views->_viewsText = (views->_views >= 0) ? formatViewsCount(views->_views) : QString(); + views->_viewsWidth = views->_viewsText.isEmpty() ? 0 : st::msgDateFont->width(views->_viewsText); + } } void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tText) { @@ -6178,7 +6228,7 @@ void HistoryMessage::initDimensions() { } if (!_media) { if (displayFromName()) { - int32 namew = st::msgPadding.left() + _from->nameText.maxWidth() + st::msgPadding.right(); + int32 namew = st::msgPadding.left() + author()->nameText.maxWidth() + st::msgPadding.right(); if (via() && !toHistoryForwarded()) { namew += st::msgServiceFont->spacew + via()->maxWidth; } @@ -6206,7 +6256,7 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { if (Adaptive::Wide()) { hwidth = hmaxwidth; } - left += (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); + left += (!isPost() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { left += st::msgPhotoSkip; // } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { @@ -6215,7 +6265,7 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { width = hwidth - st::msgMargin.left() - st::msgMargin.right(); if (width > maxwidth) { - if (!fromChannel() && out() && !Adaptive::Wide()) { + if (!isPost() && out() && !Adaptive::Wide()) { left += width - maxwidth; } width = maxwidth; @@ -6223,10 +6273,10 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { } void HistoryMessage::fromNameUpdated(int32 width) const { - _fromVersion = _from->nameVersion; + _authorNameVersion = author()->nameVersion; if (drawBubble() && displayFromName()) { if (via() && !toHistoryForwarded()) { - via()->resize(width - st::msgPadding.left() - st::msgPadding.right() - _from->nameText.maxWidth() - st::msgServiceFont->spacew); + via()->resize(width - st::msgPadding.left() - st::msgPadding.right() - author()->nameText.maxWidth() - st::msgServiceFont->spacew); } } } @@ -6304,7 +6354,7 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media) { } void HistoryMessage::setText(const QString &text, const EntitiesInText &entities) { - textstyleSet(&((out() && !fromChannel()) ? st::outTextStyle : st::inTextStyle)); + textstyleSet(&((out() && !isPost()) ? st::outTextStyle : st::inTextStyle)); if (_media && _media->isDisplayed()) { _text.setMarkedText(st::msgFont, text, entities, itemTextOptions(this)); } else { @@ -6337,7 +6387,7 @@ bool HistoryMessage::textHasLinks() { void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const { p.setFont(st::msgDateFont); - bool outbg = out() && !fromChannel(), overimg = (type == InfoDisplayOverImage); + bool outbg = out() && !isPost(), overimg = (type == InfoDisplayOverImage); int32 infoRight = right, infoBottom = bottom; switch (type) { case InfoDisplayDefault: @@ -6363,22 +6413,26 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width } dateX += HistoryMessage::timeLeft(); - p.drawText(dateX, dateY + st::msgDateFont->ascent, _timeText); + if (const HistoryMessageSigned *msgsigned = Get()) { + msgsigned->_signature.drawElided(p, dateX, dateY, _timeWidth); + } else { + p.drawText(dateX, dateY + st::msgDateFont->ascent, _timeText); + } QPoint iconPos; const QRect *iconRect = 0; - if (!_viewsText.isEmpty()) { + if (const HistoryMessageViews *views = Get()) { iconPos = QPoint(infoRight - infoW + st::msgViewsPos.x(), infoBottom - st::msgViewsImg.pxHeight() + st::msgViewsPos.y()); if (id > 0) { - if (out() && !fromChannel()) { + if (outbg) { iconRect = &(overimg ? st::msgInvViewsImg : (selected ? st::msgSelectOutViewsImg : st::msgOutViewsImg)); } else { iconRect = &(overimg ? st::msgInvViewsImg : (selected ? st::msgSelectViewsImg : st::msgViewsImg)); } - p.drawText(iconPos.x() + st::msgViewsImg.pxWidth() + st::msgDateCheckSpace, infoBottom - st::msgDateFont->descent, _viewsText); + p.drawText(iconPos.x() + st::msgViewsImg.pxWidth() + st::msgDateCheckSpace, infoBottom - st::msgDateFont->descent, views->_viewsText); } else { - iconPos.setX(iconPos.x() + st::msgDateViewsSpace + _viewsWidth); - if (out() && !fromChannel()) { + iconPos.setX(iconPos.x() + st::msgDateViewsSpace + views->_viewsWidth); + if (outbg) { iconRect = &(overimg ? st::msgInvSendingViewsImg : st::msgSendingOutViewsImg); } else { iconRect = &(overimg ? st::msgInvSendingViewsImg : st::msgSendingViewsImg); @@ -6390,7 +6444,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width iconRect = &(overimg ? st::msgInvSendingViewsImg : st::msgSendingViewsImg); p.drawPixmap(iconPos, App::sprite(), *iconRect); } - if (out() && !fromChannel()) { + if (outbg) { iconPos = QPoint(infoRight - st::msgCheckImg.pxWidth() + st::msgCheckPos.x(), infoBottom - st::msgCheckImg.pxHeight() + st::msgCheckPos.y()); if (id > 0) { if (unread()) { @@ -6406,13 +6460,14 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width } void HistoryMessage::setViewsCount(int32 count, bool reinit) { - if (_views == count || (count >= 0 && _views > count)) return; + HistoryMessageViews *views = Get(); + if (!views || views->_views == count || (count >= 0 && views->_views > count)) return; - int32 was = _viewsWidth; - _views = count; - _viewsText = (_views >= 0) ? formatViewsCount(_views) : QString(); - _viewsWidth = _viewsText.isEmpty() ? 0 : st::msgDateFont->width(_viewsText); - if (was == _viewsWidth) { + int32 was = views->_viewsWidth; + views->_views = count; + views->_viewsText = (views->_views >= 0) ? formatViewsCount(views->_views) : QString(); + views->_viewsWidth = views->_viewsText.isEmpty() ? 0 : st::msgDateFont->width(views->_viewsText); + if (was == views->_viewsWidth) { Ui::repaintHistoryItem(this); } else { if (_text.hasSkipBlock()) { @@ -6444,7 +6499,7 @@ void HistoryMessage::setId(MsgId newId) { } void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { - bool outbg = out() && !fromChannel(), bubble = drawBubble(), selected = (selection == FullSelection); + bool outbg = out() && !isPost(), bubble = drawBubble(), selected = (selection == FullSelection); textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); @@ -6464,13 +6519,13 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m int32 left = 0, width = 0; countPositionAndSize(left, width); - if (_from->nameVersion > _fromVersion) { + if (author()->nameVersion > _authorNameVersion) { fromNameUpdated(width); } if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - p.drawPixmap(photoleft, _height - st::msgMargin.bottom() - st::msgPhotoSize, _from->photo->pixRounded(st::msgPhotoSize)); + 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)); } if (width < 1) return; @@ -6484,15 +6539,15 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m if (displayFromName()) { p.setFont(st::msgNameFont); - if (fromChannel()) { + if (isPost()) { p.setPen(selected ? st::msgInServiceFgSelected : st::msgInServiceFg); } else { - p.setPen(_from->color); + p.setPen(author()->color); } - _from->nameText.drawElided(p, r.left() + st::msgPadding.left(), r.top() + st::msgPadding.top(), width - st::msgPadding.left() - st::msgPadding.right()); - if (via() && !toHistoryForwarded() && width > st::msgPadding.left() + st::msgPadding.right() + _from->nameText.maxWidth() + st::msgServiceFont->spacew) { + author()->nameText.drawElided(p, r.left() + st::msgPadding.left(), r.top() + st::msgPadding.top(), width - st::msgPadding.left() - st::msgPadding.right()); + if (via() && !toHistoryForwarded() && width > st::msgPadding.left() + st::msgPadding.right() + author()->nameText.maxWidth() + st::msgServiceFont->spacew) { p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); - p.drawText(r.left() + st::msgPadding.left() + _from->nameText.maxWidth() + st::msgServiceFont->spacew, r.top() + st::msgPadding.top() + st::msgServiceFont->ascent, via()->text); + p.drawText(r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew, r.top() + st::msgPadding.top() + st::msgServiceFont->ascent, via()->text); } r.setTop(r.top() + st::msgNameFont->height); } @@ -6524,7 +6579,7 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m } void HistoryMessage::drawMessageText(Painter &p, QRect trect, uint32 selection) const { - bool outbg = out() && !fromChannel(), selected = (selection == FullSelection); + bool outbg = out() && !isPost(), selected = (selection == FullSelection); if (!displayFromName() && via() && !toHistoryForwarded()) { p.setFont(st::msgServiceNameFont); p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); @@ -6564,7 +6619,7 @@ int32 HistoryMessage::resize(int32 width) { } else { int32 textWidth = qMax(width - st::msgPadding.left() - st::msgPadding.right(), 1); if (textWidth != _textWidth) { - textstyleSet(&((out() && !fromChannel()) ? st::outTextStyle : st::inTextStyle)); + textstyleSet(&((out() && !isPost()) ? st::outTextStyle : st::inTextStyle)); _textWidth = textWidth; _textHeight = _text.countHeight(textWidth); textstyleRestore(); @@ -6637,9 +6692,9 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + 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()) { - lnk = _from->lnk; + lnk = author()->lnk; return; } } @@ -6649,11 +6704,11 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 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() + _from->nameText.maxWidth()) { - lnk = _from->lnk; + if (x >= r.left() + st::msgPadding.left() && x < r.left() + r.width() - st::msgPadding.right() && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth()) { + lnk = author()->lnk; return; } - if (via() && !toHistoryForwarded() && x >= r.left() + st::msgPadding.left() + _from->nameText.maxWidth() + st::msgServiceFont->spacew && x < r.left() + st::msgPadding.left() + _from->nameText.maxWidth() + st::msgServiceFont->spacew + via()->width) { + if (via() && !toHistoryForwarded() && x >= r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew + via()->width) { lnk = via()->lnk; return; } @@ -6694,7 +6749,7 @@ void HistoryMessage::getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorStat inDate = HistoryMessage::pointInTime(r.x() + r.width(), r.y() + r.height(), x, y, InfoDisplayDefault); } - textstyleSet(&((out() && !fromChannel()) ? st::outTextStyle : st::inTextStyle)); + textstyleSet(&((out() && !isPost()) ? st::outTextStyle : st::inTextStyle)); bool inText = false; _text.getState(lnk, inText, x - trect.x(), y - trect.y(), trect.width()); textstyleRestore(); @@ -6728,7 +6783,7 @@ void HistoryMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, trect.setBottom(trect.bottom() - _media->height()); } - textstyleSet(&((out() && !fromChannel()) ? st::outTextStyle : st::inTextStyle)); + textstyleSet(&((out() && !isPost()) ? st::outTextStyle : st::inTextStyle)); _text.getSymbol(symbol, after, upon, x - trect.x(), y - trect.y(), trect.width()); textstyleRestore(); } @@ -6738,10 +6793,10 @@ void HistoryMessage::drawInDialog(Painter &p, const QRect &r, bool act, const Hi if (cacheFor != this) { cacheFor = this; QString msg(inDialogsText()); - if ((!_history->peer->isUser() || out()) && !fromChannel()) { + if ((!_history->peer->isUser() || out()) && !isPost()) { TextCustomTagsMap custom; custom.insert(QChar('c'), qMakePair(textcmdStartLink(1), textcmdStopLink())); - msg = lng_message_with_from(lt_from, textRichPrepare((_from == App::self()) ? lang(lng_from_you) : _from->shortName()), lt_message, textRichPrepare(msg)); + msg = lng_message_with_from(lt_from, textRichPrepare((author() == App::self()) ? lang(lng_from_you) : author()->shortName()), lt_message, textRichPrepare(msg)); cache.setRichText(st::dlgHistFont, msg, _textDlgOptions, custom); } else { cache.setText(st::dlgHistFont, msg, _textDlgOptions); @@ -6757,7 +6812,7 @@ void HistoryMessage::drawInDialog(Painter &p, const QRect &r, bool act, const Hi } QString HistoryMessage::notificationHeader() const { - return (!_history->peer->isUser() && !fromChannel()) ? from()->name : QString(); + return (!_history->peer->isUser() && !isPost()) ? from()->name : QString(); } QString HistoryMessage::notificationText() const { @@ -6771,7 +6826,6 @@ HistoryMessage::~HistoryMessage() { _media->unregItem(this); deleteAndMark(_media); } - deleteAndMark(_via); if (_flags & MTPDmessage::flag_reply_markup) { App::clearReplyMarkup(channelId(), id); } @@ -6785,8 +6839,8 @@ HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const , fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { } -HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg) -: HistoryMessage(history, block, id, newForwardedFlags(history->peer, from, msg), msg->via() ? peerToUser(msg->viaBot()->id) : 0, date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->getMedia()) +HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) +: HistoryMessage(history, block, id, newForwardedFlags(history->peer, from, msg) | flags, msg->via() ? peerToUser(msg->viaBot()->id) : 0, date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->HistoryMessage::viewsCount(), msg->getMedia()) , fwdDate(msg->dateForwarded()) , fwdFrom(msg->fromForwarded()) , fwdFromVersion(fwdFrom->nameVersion) @@ -6834,7 +6888,7 @@ void HistoryForwarded::draw(Painter &p, const QRect &r, uint32 selection, uint64 void HistoryForwarded::drawForwardedFrom(Painter &p, int32 x, int32 y, int32 w, bool selected) const { style::font serviceFont(st::msgServiceFont), serviceName(st::msgServiceNameFont); - bool outbg = out() && !fromChannel(); + bool outbg = out() && !isPost(); p.setPen((selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg))->p); p.setFont(serviceFont); @@ -6902,7 +6956,7 @@ void HistoryForwarded::getState(TextLinkPtr &lnk, HistoryCursorState &state, int int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + int32 photoleft = left + ((!isPost() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); if (x >= photoleft && x < photoleft + st::msgPhotoSize) { return HistoryMessage::getState(lnk, state, x, y); } @@ -7010,8 +7064,8 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, i QString HistoryReply::selectedText(uint32 selection) const { if (selection != FullSelection || !replyToMsg) return HistoryMessage::selectedText(selection); QString result, original = HistoryMessage::selectedText(selection); - result.reserve(lang(lng_in_reply_to).size() + replyToMsg->from()->name.size() + 4 + original.size()); - result.append('[').append(lang(lng_in_reply_to)).append(' ').append(replyToMsg->from()->name).append(qsl("]\n")).append(original); + result.reserve(lang(lng_in_reply_to).size() + replyToMsg->author()->name.size() + 4 + original.size()); + result.append('[').append(lang(lng_in_reply_to)).append(' ').append(replyToMsg->author()->name).append(qsl("]\n")).append(original); return result; } @@ -7040,7 +7094,8 @@ bool HistoryReply::updateReplyTo(bool force) { replyToLnk = TextLinkPtr(new MessageLink(replyToMsg->history()->peer->id, replyToMsg->id)); if (!replyToMsg->toHistoryForwarded()) { if (UserData *bot = replyToMsg->viaBot()) { - _replyToVia = new HistoryMessageVia(peerToUser(bot->id)); + _replyToVia = new HistoryMessageVia(0); + _replyToVia->create(peerToUser(bot->id)); } } } else if (force) { @@ -7055,9 +7110,9 @@ bool HistoryReply::updateReplyTo(bool force) { void HistoryReply::replyToNameUpdated() const { if (replyToMsg) { - QString name = (replyToVia() && replyToMsg->from()->isUser()) ? replyToMsg->from()->asUser()->firstName : App::peerName(replyToMsg->from()); + QString name = (replyToVia() && replyToMsg->author()->isUser()) ? replyToMsg->author()->asUser()->firstName : App::peerName(replyToMsg->author()); replyToName.setText(st::msgServiceNameFont, name, _textNameOptions); - replyToVersion = replyToMsg->from()->nameVersion; + replyToVersion = replyToMsg->author()->nameVersion; bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; int32 previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; int32 w = replyToName.maxWidth(); @@ -7098,14 +7153,15 @@ void HistoryReply::replyToReplaced(HistoryItem *oldItem, HistoryItem *newItem) { initDimensions(); } else if (!replyToMsg->toHistoryForwarded()) { if (UserData *bot = replyToMsg->viaBot()) { - _replyToVia = new HistoryMessageVia(peerToUser(bot->id)); + _replyToVia = new HistoryMessageVia(0); + _replyToVia->create(peerToUser(bot->id)); } } } } void HistoryReply::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { - if (replyToMsg && replyToMsg->from()->nameVersion > replyToVersion) { + if (replyToMsg && replyToMsg->author()->nameVersion > replyToVersion) { replyToNameUpdated(); } HistoryMessage::draw(p, r, selection, ms); @@ -7113,7 +7169,7 @@ void HistoryReply::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) void HistoryReply::drawReplyTo(Painter &p, int32 x, int32 y, int32 w, bool selected, bool likeService) const { style::color bar; - bool outbg = out() && !fromChannel(); + bool outbg = out() && !isPost(); if (likeService) { bar = st::white; } else { @@ -7223,7 +7279,7 @@ void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x int32 left = 0, width = 0; countPositionAndSize(left, width); if (displayFromPhoto()) { - int32 photoleft = left + ((!fromChannel() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + int32 photoleft = left + ((!isPost() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); if (x >= photoleft && x < photoleft + st::msgPhotoSize) { return HistoryMessage::getState(lnk, state, x, y); } @@ -7372,7 +7428,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { case mtpc_messageActionChannelCreate: { const MTPDmessageActionChannelCreate &d(action.c_messageActionChannelCreate()); - if (fromChannel()) { + if (isPost()) { text = lng_action_created_channel(lt_title, textClean(qs(d.vtitle))); } else { text = lng_action_created_chat(lt_from, from, lt_title, textClean(qs(d.vtitle))); @@ -7380,7 +7436,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { } break; case mtpc_messageActionChatDeletePhoto: { - text = fromChannel() ? lang(lng_action_removed_photo_channel) : lng_action_removed_photo(lt_from, from); + text = isPost() ? lang(lng_action_removed_photo_channel) : lng_action_removed_photo(lt_from, from); } break; case mtpc_messageActionChatDeleteUser: { @@ -7399,12 +7455,12 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { if (d.vphoto.type() == mtpc_photo) { _media = new HistoryPhoto(history()->peer, d.vphoto.c_photo(), st::msgServicePhotoWidth); } - text = fromChannel() ? lang(lng_action_changed_photo_channel) : lng_action_changed_photo(lt_from, from); + text = isPost() ? lang(lng_action_changed_photo_channel) : lng_action_changed_photo(lt_from, from); } break; case mtpc_messageActionChatEditTitle: { const MTPDmessageActionChatEditTitle &d(action.c_messageActionChatEditTitle()); - text = fromChannel() ? lng_action_changed_title_channel(lt_title, textClean(qs(d.vtitle))) : lng_action_changed_title(lt_from, from, lt_title, textClean(qs(d.vtitle))); + text = isPost() ? lng_action_changed_title_channel(lt_title, textClean(qs(d.vtitle))) : lng_action_changed_title(lt_from, from, lt_title, textClean(qs(d.vtitle))); } break; case mtpc_messageActionChatMigrateTo: { @@ -7483,7 +7539,7 @@ QString HistoryServiceMsg::inDialogsText() const { QString HistoryServiceMsg::inReplyText() const { QString result = HistoryServiceMsg::inDialogsText(); - return result.trimmed().startsWith(from()->name) ? result.trimmed().mid(from()->name.size()).trimmed() : result; + return result.trimmed().startsWith(author()->name) ? result.trimmed().mid(author()->name.size()).trimmed() : result; } void HistoryServiceMsg::setServiceText(const QString &text) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 0ac06d6140..c5f667f253 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -189,14 +189,14 @@ public: } HistoryItem *createItem(HistoryBlock *block, const MTPMessage &msg, bool applyServiceAction); - HistoryItem *createItemForwarded(HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg); + 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 *addNewService(MsgId msgId, QDateTime date, const QString &text, int32 flags = 0, HistoryMedia *media = 0, bool newMsg = true); HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); HistoryItem *addToHistory(const MTPMessage &msg); - HistoryItem *addNewForwarded(MsgId id, QDateTime date, int32 from, HistoryMessage *item); + 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); @@ -779,7 +779,7 @@ enum InfoDisplayType { }; 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) || ((id > 0 || flags != 0) && !(flags & MTPDmessage::flag_from_id)); + return (flags & MTPDmessage::flag_out) || (flags & MTPDmessage::flag_mentioned) || (flags & MTPDmessage::flag_post); } enum HistoryItemType { @@ -860,14 +860,20 @@ public: bool hasViews() const { return _flags & MTPDmessage::flag_views; } - bool fromChannel() const { - return _from->isChannel(); + bool isPost() const { + return _flags & MTPDmessage::flag_post; } bool isImportant() const { return _history->isChannel() && isImportantChannelMessage(id, _flags); } bool indexInOverview() const { - return (id > 0) && (!history()->isChannel() || history()->isMegagroup() || fromChannel()); + return (id > 0) && (!history()->isChannel() || history()->isMegagroup() || isPost()); + } + bool isSilent() const { + return _flags & MTPDmessage::flag_silent; + } + virtual int32 viewsCount() const { + return hasViews() ? 1 : -1; } virtual bool needCheck() const { @@ -937,7 +943,7 @@ public: if (id == 1) return false; if (channel->amCreator()) return true; - if (fromChannel()) { + if (isPost()) { if (channel->amEditor() && out()) return true; return false; } @@ -979,12 +985,6 @@ public: virtual int32 timeWidth() const { return 0; } - virtual QString viewsText() const { - return QString(); - } - virtual int32 viewsWidth() const { - return 0; - } virtual bool pointInTime(int32 right, int32 bottom, int32 x, int32 y, InfoDisplayType type) const { return false; } @@ -1019,7 +1019,10 @@ public: } bool hasFromName() const { - return (!out() || fromChannel()) && !history()->peer->isUser(); + return (!out() || isPost()) && !history()->peer->isUser(); + } + PeerData *author() const { + return isPost() ? history()->peer : _from; } bool displayFromPhoto() const; @@ -1030,11 +1033,12 @@ public: protected: PeerData *_from; - mutable int32 _fromVersion; History *_history; HistoryBlock *_block; int32 _flags; + mutable int32 _authorNameVersion; + }; class MessageLink : public ITextLink { @@ -1931,25 +1935,40 @@ private: }; -class HistoryMessageVia { -public: - HistoryMessageVia(int32 userId); +struct HistoryMessageVia : public BasicInterface { + HistoryMessageVia(Interfaces *); + + void create(int32 userId); bool isNull() const; - void resize(int32 availw); + void resize(int32 availw) const; UserData *bot; - QString text; - int32 width, maxWidth; + mutable QString text; + mutable int32 width, maxWidth; TextLinkPtr lnk; - }; -class HistoryMessage : public HistoryItem { +struct HistoryMessageViews : public BasicInterface { + HistoryMessageViews(Interfaces *); + + QString _viewsText; + int32 _views, _viewsWidth; +}; + +struct HistoryMessageSigned : public BasicInterface { + HistoryMessageSigned(Interfaces *); + void create(UserData *from, const QDateTime &date); + int32 maxWidth() const; + + Text _signature; +}; + +class HistoryMessage : public HistoryItem, public Interfaces { public: HistoryMessage(History *history, HistoryBlock *block, const MTPDmessage &msg); - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, HistoryMedia *media); // local forwarded + HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, int32 fromViews, HistoryMedia *fromMedia); // local forwarded 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 @@ -1959,8 +1978,9 @@ public: void initDimensions(); void fromNameUpdated(int32 width) const; - virtual HistoryMessageVia *via() const { - return (_via && !_via->isNull()) ? _via : 0; + const HistoryMessageVia *via() const { + const HistoryMessageVia *result = Get(); + return (result && !result->isNull()) ? result : 0; } virtual UserData *viaBot() const { return via() ? via()->bot : 0; @@ -2037,20 +2057,20 @@ public: int32 infoWidth() const { int32 result = _timeWidth; - if (!_viewsText.isEmpty()) { - result += st::msgDateViewsSpace + _viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth(); + if (const HistoryMessageViews *views = Get()) { + result += st::msgDateViewsSpace + views->_viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth(); } else if (id < 0 && history()->peer->isSelf()) { result += st::msgDateCheckSpace + st::msgCheckImg.pxWidth(); } - if (out() && !fromChannel()) { + if (out() && !isPost()) { result += st::msgDateCheckSpace + st::msgCheckImg.pxWidth(); } return result; } int32 timeLeft() const { int32 result = 0; - if (!_viewsText.isEmpty()) { - result += st::msgDateViewsSpace + _viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth(); + if (const HistoryMessageViews *views = Get()) { + result += st::msgDateViewsSpace + views->_viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth(); } else if (id < 0 && history()->peer->isSelf()) { result += st::msgDateCheckSpace + st::msgCheckImg.pxWidth(); } @@ -2059,18 +2079,19 @@ public: int32 timeWidth() const { return _timeWidth; } - QString viewsText() const { - return _viewsText; - } - int32 viewsWidth() const { - return _viewsWidth; + + int32 viewsCount() const { + if (const HistoryMessageViews *views = Get()) { + return views->_views; + } + return HistoryItem::viewsCount(); } virtual QDateTime dateForwarded() const { // dynamic_cast optimize return date; } virtual PeerData *fromForwarded() const { // dynamic_cast optimize - return from(); + return author(); } HistoryMessage *toHistoryMessage() { // dynamic_cast optimize @@ -2084,25 +2105,23 @@ public: protected: + void create(int32 viaBotId, int32 viewsCount); + Text _text; int32 _textWidth, _textHeight; - HistoryMessageVia *_via; HistoryMedia *_media; QString _timeText; int32 _timeWidth; - QString _viewsText; - int32 _views, _viewsWidth; - }; class HistoryForwarded : public HistoryMessage { public: HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg); - HistoryForwarded(History *history, HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg); + HistoryForwarded(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg); void initDimensions(); void fwdNameUpdated() const; @@ -2175,7 +2194,7 @@ public: void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const; PeerData *replyTo() const { - return replyToMsg ? replyToMsg->from() : 0; + return replyToMsg ? replyToMsg->author() : 0; } QString selectedText(uint32 selection) const; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a7e5a35958..d197e54593 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -844,10 +844,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } else { uint16 symbol, selFrom = (_selected.cbegin().value() >> 16) & 0xFFFF, selTo = _selected.cbegin().value() & 0xFFFF; hasSelected = (selTo > selFrom) ? 1 : 0; - if (_dragItem && _dragItem == App::hoveredItem()) { - QPoint mousePos(mapMouseToItem(mapFromGlobal(_dragPos), _dragItem)); + if (App::mousedItem() && App::mousedItem() == App::hoveredItem()) { + QPoint mousePos(mapMouseToItem(mapFromGlobal(_dragPos), App::mousedItem())); bool afterDragSymbol, uponSymbol; - _dragItem->getSymbol(symbol, afterDragSymbol, uponSymbol, mousePos.x(), mousePos.y()); + App::mousedItem()->getSymbol(symbol, afterDragSymbol, uponSymbol, mousePos.x(), mousePos.y()); if (uponSymbol && symbol >= selFrom && symbol < selTo) { isUponSelected = 1; } @@ -963,16 +963,17 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } } - if (_contextMenuLnk && dynamic_cast(_contextMenuLnk.data())) { + QLatin1String linktype = _contextMenuLnk ? _contextMenuLnk->type() : qstr(""); + if (linktype == qstr("TextLink") || linktype == qstr("LocationLink")) { _menu->addAction(lang(lng_context_open_link), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_link), this, SLOT(copyContextUrl()))->setEnabled(true); - } else if (_contextMenuLnk && dynamic_cast(_contextMenuLnk.data())) { + } else if (linktype == qstr("EmailLink")) { _menu->addAction(lang(lng_context_open_email), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_email), this, SLOT(copyContextUrl()))->setEnabled(true); - } else if (_contextMenuLnk && dynamic_cast(_contextMenuLnk.data())) { + } else if (linktype == qstr("MentionLink")) { _menu->addAction(lang(lng_context_open_mention), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_mention), this, SLOT(copyContextUrl()))->setEnabled(true); - } else if (_contextMenuLnk && dynamic_cast(_contextMenuLnk.data())) { + } else if (linktype == qstr("HashtagLink")) { _menu->addAction(lang(lng_context_open_hashtag), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_hashtag), this, SLOT(copyContextUrl()))->setEnabled(true); } else { @@ -1159,12 +1160,12 @@ QString HistoryInner::getSelectedText() const { if (item->detached()) continue; QString text, sel = item->selectedText(FullSelection), time = item->date.toString(timeFormat); - int32 size = item->from()->name.size() + time.size() + sel.size(); + int32 size = item->author()->name.size() + time.size() + sel.size(); text.reserve(size); int32 y = itemTop(item); if (y >= 0) { - texts.insert(y, text.append(item->from()->name).append(time).append(sel)); + texts.insert(y, text.append(item->author()->name).append(time).append(sel)); fullSize += size; } } @@ -3474,7 +3475,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _canSendMessages = canSendMessages(_peer); if (_peer && _peer->isChannel()) { _peer->asChannel()->updateFull(); - _joinChannel.setText(lang(lng_channel_join)); + _joinChannel.setText(lang(_peer->isMegagroup() ? lng_group_invite_join : lng_channel_join)); } _unblockRequest = _reportSpamRequest = 0; @@ -4553,14 +4554,17 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = p->isChannel() && !p->isMegagroup() && p->asChannel()->canPublish() && (p->asChannel()->isBroadcast() || _broadcast.checked()); - if (fromChannelName) { + bool channelPost = p->isChannel() && !p->isMegagroup() && p->asChannel()->canPublish() && (p->asChannel()->isBroadcast() || _broadcast.checked()); + bool showFromName = !channelPost || p->asChannel()->addsSignature(); + if (channelPost) { sendFlags |= MTPmessages_SendMedia::flag_broadcast; flags |= MTPDmessage::flag_views; - } else { + flags |= MTPDmessage::flag_post; + } + if (showFromName) { flags |= MTPDmessage::flag_from_id; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(peer), MTPPeer(), MTPint(), 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)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(peer), MTPPeer(), MTPint(), MTPint(), 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)), 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); App::historyRegRandom(randomId, newId); @@ -5518,21 +5522,24 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif int32 flags = newMessageFlags(h->peer) | MTPDmessage::flag_media; // unread, out if (file->to.replyTo) flags |= MTPDmessage::flag_reply_to_msg_id; - bool fromChannelName = h->peer->isChannel() && !h->peer->isMegagroup() && h->peer->asChannel()->canPublish() && (h->peer->asChannel()->isBroadcast() || file->to.broadcast); - if (fromChannelName) { + 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(); + if (channelPost) { flags |= MTPDmessage::flag_views; - } else { + flags |= MTPDmessage::flag_post; + } + if (showFromName) { flags |= MTPDmessage::flag_from_id; } if (file->type == PreparePhoto) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(file->photo, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(file->photo, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); } else if (file->type == PrepareDocument) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); } else if (file->type == PrepareAudio) { if (!h->peer->isChannel()) { flags |= MTPDmessage::flag_media_unread; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); } if (_peer && file->to.peer == _peer->id) { @@ -5583,8 +5590,8 @@ void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, const MTPInputFile & sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->fromChannel(); - if (fromChannelName) { + bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->isPost(); + if (channelPost) { sendFlags |= MTPmessages_SendMedia::flag_broadcast; } QString caption = item->getMedia() ? item->getMedia()->getCaption() : QString(); @@ -5631,8 +5638,8 @@ void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, const MTPInputFil sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->fromChannel(); - if (fromChannelName) { + bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->isPost(); + if (channelPost) { sendFlags |= MTPmessages_SendMedia::flag_broadcast; } QString caption = item->getMedia() ? item->getMedia()->getCaption() : QString(); @@ -5656,8 +5663,8 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, const MTPInp sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->fromChannel(); - if (fromChannelName) { + bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && item->isPost(); + if (channelPost) { sendFlags |= MTPmessages_SendMedia::flag_broadcast; } QString caption = item->getMedia() ? item->getMedia()->getCaption() : QString(); @@ -5670,7 +5677,7 @@ void HistoryWidget::onPhotoProgress(const FullMsgId &newId) { if (!MTP::authedId()) return; if (HistoryItem *item = App::histItemById(newId)) { PhotoData *photo = (item->getMedia() && item->getMedia()->type() == MediaTypePhoto) ? static_cast(item->getMedia())->photo() : 0; - if (!item->fromChannel()) { + if (!item->isPost()) { updateSendAction(item->history(), SendActionUploadPhoto, 0); } Ui::repaintHistoryItem(item); @@ -5682,7 +5689,7 @@ void HistoryWidget::onDocumentProgress(const FullMsgId &newId) { if (HistoryItem *item = App::histItemById(newId)) { HistoryMedia *media = item->getMedia(); DocumentData *doc = media ? media->getDocument() : 0; - if (!item->fromChannel()) { + if (!item->isPost()) { updateSendAction(item->history(), (doc && doc->voice()) ? SendActionUploadVoice : SendActionUploadFile, doc ? doc->uploadOffset : 0); } Ui::repaintHistoryItem(item); @@ -5693,7 +5700,7 @@ void HistoryWidget::onPhotoFailed(const FullMsgId &newId) { if (!MTP::authedId()) return; HistoryItem *item = App::histItemById(newId); if (item) { - if (!item->fromChannel()) { + if (!item->isPost()) { updateSendAction(item->history(), SendActionUploadPhoto, -1); } // Ui::repaintHistoryItem(item); @@ -5706,7 +5713,7 @@ void HistoryWidget::onDocumentFailed(const FullMsgId &newId) { if (item) { HistoryMedia *media = item->getMedia(); DocumentData *doc = media ? media->getDocument() : 0; - if (!item->fromChannel()) { + if (!item->isPost()) { updateSendAction(item->history(), (doc && doc->voice()) ? SendActionUploadVoice : SendActionUploadFile, -1); } Ui::repaintHistoryItem(item); @@ -6355,10 +6362,14 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { flags |= MTPDmessage::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); - if (fromChannelName) { + bool channelPost = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); + bool showFromName = !channelPost || _peer->asChannel()->addsSignature(); + if (channelPost) { sendFlags |= MTPmessages_SendMedia::flag_broadcast; - } else { + flags |= MTPDmessage::flag_views; + flags |= MTPDmessage::flag_post; + } + if (showFromName) { flags |= MTPDmessage::flag_from_id; } if (bot) { @@ -6367,9 +6378,9 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { if (result->message.isEmpty()) { if (result->doc) { - _history->addNewDocument(newId.msg, flags, bot ? peerToUser(bot->id) : 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), result->doc, result->caption); + _history->addNewDocument(newId.msg, flags, bot ? peerToUser(bot->id) : 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, result->doc, result->caption); } else if (result->photo) { - _history->addNewPhoto(newId.msg, flags, bot ? peerToUser(bot->id) : 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), result->photo, result->caption); + _history->addNewPhoto(newId.msg, flags, bot ? peerToUser(bot->id) : 0, replyToId(), date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, result->photo, result->caption); } else if (result->type == qstr("gif")) { MTPPhotoSize thumbSize; QPixmap thumb; @@ -6399,7 +6410,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(fromChannelName ? 0 : MTP::authedId()), peerToMTP(_history->peer->id), MTPPeer(), MTPint(), 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)), NewMessageUnread); + _history->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPPeer(), MTPint(), MTPint(), 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)), NewMessageUnread); } else if (result->type == qstr("photo")) { QImage fileThumb(result->thumb->pix().toImage()); @@ -6418,14 +6429,14 @@ 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(fromChannelName ? 0 : MTP::authedId()), peerToMTP(_history->peer->id), MTPPeer(), MTPint(), 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)), NewMessageUnread); + _history->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPPeer(), MTPint(), MTPint(), 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)), 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(fromChannelName ? 0 : MTP::authedId()), peerToMTP(_history->peer->id), MTPPeer(), MTPint(), 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)), NewMessageUnread); + _history->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(_history->peer->id), MTPPeer(), MTPint(), MTPint(), 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)), 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); App::main()->finishForwarding(_history, _broadcast.checked()); @@ -7016,8 +7027,8 @@ void HistoryWidget::updateForwarding(bool force) { void HistoryWidget::updateReplyToName() { if (!_replyTo && (_replyToId || !_kbReplyTo)) return; - _replyToName.setText(st::msgServiceNameFont, App::peerName((_replyTo ? _replyTo : _kbReplyTo)->from()), _textNameOptions); - _replyToNameVersion = (_replyTo ? _replyTo : _kbReplyTo)->from()->nameVersion; + _replyToName.setText(st::msgServiceNameFont, App::peerName((_replyTo ? _replyTo : _kbReplyTo)->author()), _textNameOptions); + _replyToNameVersion = (_replyTo ? _replyTo : _kbReplyTo)->author()->nameVersion; } void HistoryWidget::updateField() { @@ -7032,7 +7043,7 @@ void HistoryWidget::drawField(Painter &p) { ImagePtr preview; HistoryItem *drawReplyTo = _replyToId ? _replyTo : _kbReplyTo; if (_replyToId || (!hasForward && _kbReplyTo)) { - if (drawReplyTo && drawReplyTo->from()->nameVersion > _replyToNameVersion) { + if (drawReplyTo && drawReplyTo->author()->nameVersion > _replyToNameVersion) { updateReplyToName(); } backy -= st::replyHeight; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8944d59f38..181fd9b840 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -395,7 +395,6 @@ MainWidget::MainWidget(Window *window) : TWidget(window) , _hider(0) , _peerInStack(0) , _msgIdInStack(0) -, _stickerPreview(0) , _playerHeight(0) , _contentScrollAddToY(0) , _mediaType(this) @@ -541,7 +540,7 @@ void MainWidget::fillForwardingInfo(Text *&from, Text *&text, bool &serviceColor if (HistoryForwarded *fwd = i.value()->toHistoryForwarded()) { version += fwd->fromForwarded()->nameVersion; } else { - version += i.value()->from()->nameVersion; + version += i.value()->author()->nameVersion; } } if (version != _toForwardNameVersion) { @@ -563,7 +562,7 @@ void MainWidget::updateForwardingTexts() { QVector fromUsers; fromUsers.reserve(_toForward.size()); for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { - PeerData *from = i.value()->from(); + PeerData *from = i.value()->author(); if (HistoryForwarded *fwd = i.value()->toHistoryForwarded()) { from = fwd->fromForwarded(); } @@ -571,7 +570,7 @@ void MainWidget::updateForwardingTexts() { fromUsersMap.insert(from, true); fromUsers.push_back(from); } - version += i.value()->from()->nameVersion; + version += from->nameVersion; } if (fromUsers.size() > 2) { from = lng_forwarding_from(lt_user, fromUsers.at(0)->shortName(), lt_count, fromUsers.size() - 1); @@ -602,13 +601,22 @@ void MainWidget::cancelForwarding() { void MainWidget::finishForwarding(History *hist, bool broadcast) { if (!hist) return; - bool fromChannelName = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && (hist->peer->asChannel()->isBroadcast() || broadcast); if (!_toForward.isEmpty()) { bool genClientSideMessage = (_toForward.size() < 2); PeerData *forwardFrom = 0; App::main()->readServerHistory(hist, false); - int32 flags = fromChannelName ? MTPmessages_ForwardMessages::flag_broadcast : 0; + int32 sendFlags = 0, flags = 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(); + if (channelPost) { + sendFlags |= MTPmessages_ForwardMessages::flag_broadcast; + flags |= MTPDmessage::flag_views; + flags |= MTPDmessage::flag_post; + } + if (showFromName) { + flags |= MTPDmessage::flag_from_id; + } QVector ids; QVector randomIds; @@ -619,7 +627,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast) { if (genClientSideMessage) { FullMsgId newId(peerToChannel(hist->peer->id), clientMsgId()); HistoryMessage *msg = static_cast(_toForward.cbegin().value()); - hist->addNewForwarded(newId.msg, date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), msg); + hist->addNewForwarded(newId.msg, flags, date(MTP_int(unixtime())), showFromName ? MTP::authedId() : 0, msg); if (HistoryMedia *media = msg->getMedia()) { if (media->type() == MediaTypeSticker) { App::main()->incrementSticker(media->getDocument()); @@ -629,7 +637,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast) { } if (forwardFrom != i.value()->history()->peer) { if (forwardFrom) { - hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_int(flags), 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_int(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); } @@ -638,7 +646,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast) { ids.push_back(MTP_int(i.value()->id)); randomIds.push_back(MTP_long(randomId)); } - hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_int(flags), 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_int(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(); @@ -741,20 +749,6 @@ QPixmap MainWidget::grabTopBar() { } } -void MainWidget::ui_showStickerPreview(DocumentData *sticker) { - if (!sticker || ((!sticker->isAnimation() || !sticker->loaded()) && !sticker->sticker())) return; - if (!_stickerPreview) { - _stickerPreview = new StickerPreviewWidget(this); - resizeEvent(0); - } - _stickerPreview->showPreview(sticker); -} - -void MainWidget::ui_hideStickerPreview() { - if (!_stickerPreview) return; - _stickerPreview->hidePreview(); -} - void MainWidget::notify_botCommandsChanged(UserData *bot) { history.notify_botCommandsChanged(bot); } @@ -1320,18 +1314,21 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, media = MTP_messageMediaWebPage(MTP_webPagePending(MTP_long(page->id), MTP_int(page->pendingTill))); flags |= MTPDmessage::flag_media; } - bool fromChannelName = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && (hist->peer->asChannel()->isBroadcast() || broadcast); - if (fromChannelName) { + bool channelPost = hist->peer->isChannel() && !hist->peer->isMegagroup() && hist->peer->asChannel()->canPublish() && (hist->peer->asChannel()->isBroadcast() || broadcast); + bool showFromName = !channelPost || hist->peer->asChannel()->addsSignature(); + if (channelPost) { sendFlags |= MTPmessages_SendMessage::flag_broadcast; flags |= MTPDmessage::flag_views; - } else { + flags |= MTPDmessage::flag_post; + } + if (showFromName) { flags |= MTPDmessage::flag_from_id; } MTPVector localEntities = linksToMTP(sendingEntities), sentEntities = linksToMTP(sendingEntities, true); if (!sentEntities.c_vector().v.isEmpty()) { sendFlags |= MTPmessages_SendMessage::flag_entities; } - hist->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(hist->peer->id), MTPPeer(), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities, MTP_int(1)), NewMessageUnread); + hist->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(hist->peer->id), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities, MTP_int(1)), 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); } @@ -1915,7 +1912,7 @@ void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia & 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())), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint()), NewMessageUnread); + item = App::histories().addNewMessage(MTP_message(MTP_int(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPPeer(), MTPint(), MTPint(), MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint()), NewMessageUnread); } if (item) { history.peerMessagesUpdated(item->history()->peer->id); @@ -2502,7 +2499,6 @@ void MainWidget::orderWidgets() { dialogs.raise(); _mediaType.raise(); if (_hider) _hider->raise(); - if (_stickerPreview) _stickerPreview->raise(); } QRect MainWidget::historyRect() const { @@ -2751,7 +2747,6 @@ void MainWidget::resizeEvent(QResizeEvent *e) { _mediaType.moveToLeft(width() - _mediaType.width(), _playerHeight + st::topBarHeight); if (profile) profile->setGeometry(history.geometry()); if (overview) overview->setGeometry(history.geometry()); - if (_stickerPreview) _stickerPreview->setGeometry(rect()); _contentScrollAddToY = 0; } @@ -3405,10 +3400,24 @@ bool MainWidget::started() { void MainWidget::openLocalUrl(const QString &url) { QString u(url.trimmed()); if (u.startsWith(qstr("tg://resolve"), Qt::CaseInsensitive)) { - QRegularExpressionMatch m = QRegularExpression(qsl("^tg://resolve/?\\?domain=([a-zA-Z0-9\\.\\_]+)(&(start|startgroup)=([a-zA-Z0-9\\.\\_\\-]+))?(&|$)"), QRegularExpression::CaseInsensitiveOption).match(u); + QRegularExpressionMatch m = QRegularExpression(qsl("^tg://resolve/?\\?domain=([a-zA-Z0-9\\.\\_]+)(&|$)"), QRegularExpression::CaseInsensitiveOption).match(u); if (m.hasMatch()) { - QString start = m.captured(3), startToken = m.captured(4); - openPeerByName(m.captured(1), (start == qsl("startgroup")), startToken); + QString params = u.mid(m.capturedLength(0)); + + QString start, startToken; + QRegularExpressionMatch startparam = QRegularExpression(qsl("(^|&)(start|startgroup)=([a-zA-Z0-9\\.\\_\\-]+)(&|$)")).match(params); + if (startparam.hasMatch()) { + start = startparam.captured(2); + startToken = startparam.captured(3); + } + + MsgId post = (start == qsl("startgroup")) ? ShowAtProfileMsgId : ShowAtUnreadMsgId; + QRegularExpressionMatch postparam = QRegularExpression(qsl("(^|&)post=(\\d+)(&|$)")).match(params); + if (postparam.hasMatch()) { + post = postparam.captured(2).toInt(); + } + + openPeerByName(m.captured(1), post, startToken); } } else if (u.startsWith(qstr("tg://join"), Qt::CaseInsensitive)) { QRegularExpressionMatch m = QRegularExpression(qsl("^tg://join/?\\?invite=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"), QRegularExpression::CaseInsensitiveOption).match(u); @@ -3439,12 +3448,12 @@ void MainWidget::openLocalUrl(const QString &url) { } } -void MainWidget::openPeerByName(const QString &username, bool toProfile, const QString &startToken) { +void MainWidget::openPeerByName(const QString &username, MsgId msgId, const QString &startToken) { App::wnd()->hideMediaview(); PeerData *peer = App::peerByName(username); if (peer) { - if (toProfile && !peer->isChannel()) { + if (msgId == ShowAtProfileMsgId && !peer->isChannel()) { if (peer->isUser() && peer->asUser()->botInfo && !peer->asUser()->botInfo->cantJoinGroups && !startToken.isEmpty()) { peer->asUser()->botInfo->startGroupToken = startToken; Ui::showLayer(new ContactsBox(peer->asUser())); @@ -3452,6 +3461,9 @@ void MainWidget::openPeerByName(const QString &username, bool toProfile, const Q showPeerProfile(peer); } } else { + if (msgId == ShowAtProfileMsgId) { + msgId = ShowAtUnreadMsgId; + } if (peer->isUser() && peer->asUser()->botInfo) { peer->asUser()->botInfo->startToken = startToken; if (peer == history.peer()) { @@ -3459,10 +3471,10 @@ void MainWidget::openPeerByName(const QString &username, bool toProfile, const Q history.resizeEvent(0); } } - Ui::showPeerHistoryAsync(peer->id, ShowAtUnreadMsgId); + Ui::showPeerHistoryAsync(peer->id, msgId); } } else { - MTP::send(MTPcontacts_ResolveUsername(MTP_string(username)), rpcDone(&MainWidget::usernameResolveDone, qMakePair(toProfile, startToken)), rpcFail(&MainWidget::usernameResolveFail, username)); + MTP::send(MTPcontacts_ResolveUsername(MTP_string(username)), rpcDone(&MainWidget::usernameResolveDone, qMakePair(msgId, startToken)), rpcFail(&MainWidget::usernameResolveFail, username)); } } @@ -3508,7 +3520,7 @@ bool MainWidget::contentOverlapped(const QRect &globalRect) { _mediaType.overlaps(globalRect)); } -void MainWidget::usernameResolveDone(QPair toProfileStartToken, const MTPcontacts_ResolvedPeer &result) { +void MainWidget::usernameResolveDone(QPair msgIdAndStartToken, const MTPcontacts_ResolvedPeer &result) { Ui::hideLayer(); if (result.type() != mtpc_contacts_resolvedPeer) return; @@ -3519,24 +3531,27 @@ void MainWidget::usernameResolveDone(QPair toProfileStartToken, c if (!peerId) return; PeerData *peer = App::peer(peerId); - if (toProfileStartToken.first) { - if (peer->isUser() && peer->asUser()->botInfo && !peer->asUser()->botInfo->cantJoinGroups && !toProfileStartToken.second.isEmpty()) { - peer->asUser()->botInfo->startGroupToken = toProfileStartToken.second; + MsgId msgId = msgIdAndStartToken.first; + QString startToken = msgIdAndStartToken.second; + if (msgId == ShowAtProfileMsgId && !peer->isChannel()) { + if (peer->isUser() && peer->asUser()->botInfo && !peer->asUser()->botInfo->cantJoinGroups && !startToken.isEmpty()) { + peer->asUser()->botInfo->startGroupToken = startToken; Ui::showLayer(new ContactsBox(peer->asUser())); - } else if (peer->isChannel()) { - Ui::showPeerHistory(peer->id, ShowAtUnreadMsgId); } else { showPeerProfile(peer); } } else { + if (msgId == ShowAtProfileMsgId) { + msgId = ShowAtUnreadMsgId; + } if (peer->isUser() && peer->asUser()->botInfo) { - peer->asUser()->botInfo->startToken = toProfileStartToken.second; + peer->asUser()->botInfo->startToken = startToken; if (peer == history.peer()) { history.updateControlsVisibility(); history.resizeEvent(0); } } - Ui::showPeerHistory(peer->id, ShowAtUnreadMsgId); + Ui::showPeerHistory(peer->id, msgId); } } @@ -4007,7 +4022,7 @@ 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_id, d.vfwd_date, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread); + 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_id, d.vfwd_date, d.vfwd_post, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread); if (item) { history.peerMessagesUpdated(item->history()->peer->id); } @@ -4032,7 +4047,7 @@ 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_id, d.vfwd_date, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread); + HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_int(flags), d.vid, d.vfrom_id, MTP_peerChat(d.vchat_id), d.vfwd_from_id, d.vfwd_date, d.vfwd_post, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread); if (item) { history.peerMessagesUpdated(item->history()->peer->id); } diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 31a8989df8..075a37474d 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -183,8 +183,6 @@ inline int chatsListWidth(int windowWidth) { return snap((windowWidth * 5) / 14, st::dlgMinWidth, st::dlgMaxWidth); } -class StickerPreviewWidget; - class MainWidget : public TWidget, public RPCSender { Q_OBJECT @@ -212,7 +210,7 @@ public: void start(const MTPUser &user); void openLocalUrl(const QString &str); - void openPeerByName(const QString &name, bool toProfile = false, const QString &startToken = QString()); + void openPeerByName(const QString &name, MsgId msgId = ShowAtUnreadMsgId, const QString &startToken = QString()); void joinGroupByHash(const QString &hash); void stickersBox(const MTPInputStickerSet &set); @@ -410,8 +408,6 @@ public: bool isItemVisible(HistoryItem *item); - void ui_showStickerPreview(DocumentData *sticker); - void ui_hideStickerPreview(); void ui_repaintHistoryItem(const HistoryItem *item); void ui_repaintInlineItem(const LayoutInlineItem *layout); bool ui_isInlineItemVisible(const LayoutInlineItem *layout); @@ -544,7 +540,7 @@ private: void updateReceived(const mtpPrime *from, const mtpPrime *end); bool updateFail(const RPCError &e); - void usernameResolveDone(QPair toProfileStartToken, const MTPcontacts_ResolvedPeer &result); + void usernameResolveDone(QPair msgIdAndStartToken, const MTPcontacts_ResolvedPeer &result); bool usernameResolveFail(QString name, const RPCError &error); void inviteCheckDone(QString hash, const MTPChatInvite &invite); @@ -578,8 +574,6 @@ private: PeerData *_peerInStack; MsgId _msgIdInStack; - StickerPreviewWidget *_stickerPreview; - int32 _playerHeight; int32 _contentScrollAddToY; diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index a73603e016..c8719fb3f0 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -883,7 +883,7 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) { _caption = Text(); if (HistoryMessage *itemMsg = item ? item->toHistoryMessage() : 0) { if (HistoryPhoto *photoMsg = dynamic_cast(itemMsg->getMedia())) { - _caption.setText(st::mvCaptionFont, photoMsg->getCaption(), (item->from()->isUser() && item->from()->asUser()->botInfo) ? _captionBotOptions : _captionTextOptions); + _caption.setText(st::mvCaptionFont, photoMsg->getCaption(), (item->author()->isUser() && item->author()->asUser()->botInfo) ? _captionBotOptions : _captionTextOptions); } } @@ -912,7 +912,7 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) { if (HistoryForwarded *fwd = item->toHistoryForwarded()) { _from = fwd->fromForwarded(); } else { - _from = item->from(); + _from = item->author(); } } else { _from = _user; @@ -1065,7 +1065,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty if (HistoryForwarded *fwd = item->toHistoryForwarded()) { _from = fwd->fromForwarded(); } else { - _from = item->from(); + _from = item->author(); } _full = 1; updateControls(); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index b6dab0b004..b1f655dc49 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -368,7 +368,7 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 47; +static const mtpPrime mtpCurrentLayer = 48; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index e2231a54ae..462d46aeaf 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1154,15 +1154,16 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type 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(" invites_enabled: "); ++stages.back(); if (flag & MTPDchannel::flag_invites_enabled) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 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(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: 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 15: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 16: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 17: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 18: 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 10: to.add(" admin_invites: "); ++stages.back(); if (flag & MTPDchannel::flag_admin_invites) { 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(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 13: 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 14: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 15: 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 16: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 17: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 18: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 19: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1345,19 +1346,22 @@ void _serialize_message(MTPStringLogger &to, int32 stage, int32 lev, Types &type 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(" 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(" 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 7: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_from_id) { 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 9: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_date) { 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 10: 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 11: 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 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(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: 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 15: 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 16: 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 17: 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 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 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_id: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_date) { 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 12: to.add(" fwd_post: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; + case 13: 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 14: 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 15: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 16: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 17: 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 18: 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 19: 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 20: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2952,17 +2956,19 @@ void _serialize_updateShortMessage(MTPStringLogger &to, int32 stage, int32 lev, 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(" 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(" user_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(" 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(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: 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 10: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_from_id) { 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 12: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_date) { 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 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 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_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_date) { 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 14: to.add(" fwd_post: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; + case 15: 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 16: 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 17: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2980,18 +2986,20 @@ void _serialize_updateShortChatMessage(MTPStringLogger &to, int32 stage, int32 l 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(" 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(" from_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(" chat_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_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_date) { 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 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 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_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_date) { 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 15: to.add(" fwd_post: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; + case 16: 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 17: 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 18: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -3135,9 +3143,10 @@ void _serialize_dcOption(MTPStringLogger &to, int32 stage, int32 lev, Types &typ 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(" 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(" ip_address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" port: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5071,6 +5080,19 @@ void _serialize_messages_botResults(MTPStringLogger &to, int32 stage, int32 lev, } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ exportedMessageLink"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6448,12 +6470,13 @@ void _serialize_messages_sendMessage(MTPStringLogger &to, int32 stage, int32 lev 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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 5: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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(" 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 8: 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 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(" 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_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 6: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); 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_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 9: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6468,11 +6491,12 @@ void _serialize_messages_sendMedia(MTPStringLogger &to, int32 stage, int32 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: 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 4: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: 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 6: 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 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: 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(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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(" 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6487,10 +6511,11 @@ void _serialize_messages_forwardMessages(MTPStringLogger &to, int32 stage, int32 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(" from_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; - case 4: 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(" to_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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(" from_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; + case 5: 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 6: 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; } } @@ -6663,11 +6688,12 @@ void _serialize_messages_sendInlineBotResult(MTPStringLogger &to, int32 stage, i 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: 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 4: 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 5: 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 6: 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(" 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: 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 5: 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 6: 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 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6828,6 +6854,20 @@ 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_toggleSignatures"); + to.add("\n").addSpaces(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(" 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_getChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7341,6 +7381,20 @@ 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_exportMessageLink"); + to.add("\n").addSpaces(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(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7799,6 +7853,7 @@ namespace { _serializers.insert(mtpc_botInlineMediaResultPhoto, _serialize_botInlineMediaResultPhoto); _serializers.insert(mtpc_botInlineResult, _serialize_botInlineResult); _serializers.insert(mtpc_messages_botResults, _serialize_messages_botResults); + _serializers.insert(mtpc_exportedMessageLink, _serialize_exportedMessageLink); _serializers.insert(mtpc_req_pq, _serialize_req_pq); _serializers.insert(mtpc_req_DH_params, _serialize_req_DH_params); @@ -7929,6 +7984,7 @@ namespace { _serializers.insert(mtpc_channels_kickFromChannel, _serialize_channels_kickFromChannel); _serializers.insert(mtpc_channels_deleteChannel, _serialize_channels_deleteChannel); _serializers.insert(mtpc_channels_toggleInvites, _serialize_channels_toggleInvites); + _serializers.insert(mtpc_channels_toggleSignatures, _serialize_channels_toggleSignatures); _serializers.insert(mtpc_messages_getChats, _serialize_messages_getChats); _serializers.insert(mtpc_channels_getChannels, _serialize_channels_getChannels); _serializers.insert(mtpc_messages_getFullChat, _serialize_messages_getFullChat); @@ -7968,6 +8024,7 @@ namespace { _serializers.insert(mtpc_help_getTermsOfService, _serialize_help_getTermsOfService); _serializers.insert(mtpc_channels_getParticipants, _serialize_channels_getParticipants); _serializers.insert(mtpc_channels_getParticipant, _serialize_channels_getParticipant); + _serializers.insert(mtpc_channels_exportMessageLink, _serialize_channels_exportMessageLink); _serializers.insert(mtpc_rpc_result, _serialize_rpc_result); _serializers.insert(mtpc_msg_container, _serialize_msg_container); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 1f32eb20ec..0f15155a17 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -145,7 +145,7 @@ enum { mtpc_chatPhotoEmpty = 0x37c1011c, mtpc_chatPhoto = 0x6153276a, mtpc_messageEmpty = 0x83e5de54, - mtpc_message = 0xc992e15c, + mtpc_message = 0xef11cef6, mtpc_messageService = 0xc06b9607, mtpc_messageMediaEmpty = 0x3ded6320, mtpc_messageMediaPhoto = 0x3d8ce53d, @@ -274,8 +274,8 @@ enum { mtpc_updates_difference = 0xf49ca0, mtpc_updates_differenceSlice = 0xa8fb1981, mtpc_updatesTooLong = 0xe317af7e, - mtpc_updateShortMessage = 0x13e4deaa, - mtpc_updateShortChatMessage = 0x248afa62, + mtpc_updateShortMessage = 0x3afbe9d1, + mtpc_updateShortChatMessage = 0xca2ef195, mtpc_updateShort = 0x78d4dec1, mtpc_updatesCombined = 0x725b04c3, mtpc_updates = 0x74ae4240, @@ -446,6 +446,7 @@ enum { mtpc_botInlineMediaResultPhoto = 0xc5528587, mtpc_botInlineResult = 0x9bebaeb9, mtpc_messages_botResults = 0x1170b0a3, + mtpc_exportedMessageLink = 0x1f486803, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, @@ -604,7 +605,9 @@ enum { mtpc_channels_kickFromChannel = 0xa672de14, mtpc_channels_exportInvite = 0xc7560885, mtpc_channels_deleteChannel = 0xc0111fe3, - mtpc_channels_toggleInvites = 0x49609307 + mtpc_channels_toggleInvites = 0x49609307, + mtpc_channels_exportMessageLink = 0xc846d22d, + mtpc_channels_toggleSignatures = 0x1f69b606 }; // Type forward declarations @@ -1227,6 +1230,9 @@ class MTPDbotInlineResult; class MTPmessages_botResults; class MTPDmessages_botResults; +class MTPexportedMessageLink; +class MTPDexportedMessageLink; + // Boxed types definitions typedef MTPBoxed MTPResPQ; @@ -1388,6 +1394,7 @@ typedef MTPBoxed MTPInputBotInlineResult; typedef MTPBoxed MTPBotInlineMessage; typedef MTPBoxed MTPBotInlineResult; typedef MTPBoxed MTPmessages_BotResults; +typedef MTPBoxed MTPExportedMessageLink; // Type classes definitions @@ -3511,7 +3518,7 @@ private: 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, 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); + friend MTPmessage MTP_message(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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); friend MTPmessage MTP_messageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _date, const MTPMessageAction &_action); mtpTypeId _type; @@ -5717,8 +5724,8 @@ private: 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities); + friend MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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); @@ -8956,6 +8963,37 @@ private: }; typedef MTPBoxed MTPmessages_BotResults; +class MTPexportedMessageLink : private mtpDataOwner { +public: + MTPexportedMessageLink(); + MTPexportedMessageLink(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_exportedMessageLink) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDexportedMessageLink &_exportedMessageLink() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDexportedMessageLink*)data; + } + const MTPDexportedMessageLink &c_exportedMessageLink() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDexportedMessageLink*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_exportedMessageLink); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPexportedMessageLink(MTPDexportedMessageLink *_data); + + friend MTPexportedMessageLink MTP_exportedMessageLink(const MTPstring &_link); +}; +typedef MTPBoxed MTPExportedMessageLink; + // Type constructors with data class MTPDresPQ : public mtpDataImpl { @@ -9823,7 +9861,8 @@ public: flag_verified = (1 << 7), flag_megagroup = (1 << 8), flag_restricted = (1 << 9), - flag_invites_enabled = (1 << 10), + flag_admin_invites = (1 << 10), + flag_signatures = (1 << 11), flag_username = (1 << 6), flag_restriction_reason = (1 << 9), }; @@ -9837,7 +9876,8 @@ public: 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_invites_enabled() const { return vflags.v & flag_invites_enabled; } + bool is_admin_invites() const { return vflags.v & flag_admin_invites; } + bool is_signatures() const { return vflags.v & flag_signatures; } bool has_username() const { return vflags.v & flag_username; } bool has_restriction_reason() const { return vflags.v & flag_restriction_reason; } }; @@ -9998,7 +10038,7 @@ class MTPDmessage : public mtpDataImpl { public: MTPDmessage() { } - MTPDmessage(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, 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) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vfwd_from_id(_fwd_from_id), vfwd_date(_fwd_date), 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) { + MTPDmessage(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vfwd_from_id(_fwd_from_id), vfwd_date(_fwd_date), vfwd_post(_fwd_post), 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) { } MTPint vflags; @@ -10007,6 +10047,7 @@ public: MTPPeer vto_id; MTPPeer vfwd_from_id; MTPint vfwd_date; + MTPint vfwd_post; MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPint vdate; @@ -10021,9 +10062,12 @@ public: 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_id = (1 << 2), flag_fwd_date = (1 << 2), + flag_fwd_post = (1 << 12), flag_via_bot_id = (1 << 11), flag_reply_to_msg_id = (1 << 3), flag_media = (1 << 9), @@ -10036,9 +10080,12 @@ public: 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_id() const { return vflags.v & flag_fwd_from_id; } bool has_fwd_date() const { return vflags.v & flag_fwd_date; } + bool has_fwd_post() const { return vflags.v & flag_fwd_post; } 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; } @@ -11230,7 +11277,7 @@ class MTPDupdateShortMessage : public mtpDataImpl { public: MTPDupdateShortMessage() { } - MTPDupdateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, 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_id(_fwd_from_id), vfwd_date(_fwd_date), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { + MTPDupdateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id(_fwd_from_id), vfwd_date(_fwd_date), vfwd_post(_fwd_post), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { } MTPint vflags; @@ -11242,6 +11289,7 @@ public: MTPint vdate; MTPPeer vfwd_from_id; MTPint vfwd_date; + MTPint vfwd_post; MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPVector ventities; @@ -11251,8 +11299,10 @@ public: flag_out = (1 << 1), flag_mentioned = (1 << 4), flag_media_unread = (1 << 5), + flag_silent = (1 << 13), flag_fwd_from_id = (1 << 2), flag_fwd_date = (1 << 2), + flag_fwd_post = (1 << 12), flag_via_bot_id = (1 << 11), flag_reply_to_msg_id = (1 << 3), flag_entities = (1 << 7), @@ -11262,8 +11312,10 @@ public: 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_id() const { return vflags.v & flag_fwd_from_id; } bool has_fwd_date() const { return vflags.v & flag_fwd_date; } + bool has_fwd_post() const { return vflags.v & flag_fwd_post; } 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; } @@ -11273,7 +11325,7 @@ class MTPDupdateShortChatMessage : public mtpDataImpl &_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_id(_fwd_from_id), vfwd_date(_fwd_date), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { + MTPDupdateShortChatMessage(MTPint _flags, MTPint _id, MTPint _from_id, MTPint _chat_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id(_fwd_from_id), vfwd_date(_fwd_date), vfwd_post(_fwd_post), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { } MTPint vflags; @@ -11286,6 +11338,7 @@ public: MTPint vdate; MTPPeer vfwd_from_id; MTPint vfwd_date; + MTPint vfwd_post; MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPVector ventities; @@ -11295,8 +11348,10 @@ public: flag_out = (1 << 1), flag_mentioned = (1 << 4), flag_media_unread = (1 << 5), + flag_silent = (1 << 13), flag_fwd_from_id = (1 << 2), flag_fwd_date = (1 << 2), + flag_fwd_post = (1 << 12), flag_via_bot_id = (1 << 11), flag_reply_to_msg_id = (1 << 3), flag_entities = (1 << 7), @@ -11306,8 +11361,10 @@ public: 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_id() const { return vflags.v & flag_fwd_from_id; } bool has_fwd_date() const { return vflags.v & flag_fwd_date; } + bool has_fwd_post() const { return vflags.v & flag_fwd_post; } 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; } @@ -11442,10 +11499,12 @@ public: 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 { @@ -13023,6 +13082,16 @@ public: bool has_next_offset() const { return vflags.v & flag_next_offset; } }; +class MTPDexportedMessageLink : public mtpDataImpl { +public: + MTPDexportedMessageLink() { + } + MTPDexportedMessageLink(const MTPstring &_link) : vlink(_link) { + } + + MTPstring vlink; +}; + // RPC methods class MTPreq_pq { // RPC method 'req_pq' @@ -16206,6 +16275,7 @@ public: enum { flag_no_webpage = (1 << 1), flag_broadcast = (1 << 4), + flag_silent = (1 << 5), flag_reply_to_msg_id = (1 << 0), flag_reply_markup = (1 << 2), flag_entities = (1 << 3), @@ -16213,6 +16283,7 @@ public: 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 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; } @@ -16275,11 +16346,13 @@ public: enum { flag_broadcast = (1 << 4), + flag_silent = (1 << 5), 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 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; } @@ -16338,9 +16411,11 @@ public: enum { flag_broadcast = (1 << 4), + flag_silent = (1 << 5), }; bool is_broadcast() const { return vflags.v & flag_broadcast; } + bool is_silent() const { return vflags.v & flag_silent; } uint32 innerLength() const { return vflags.innerLength() + vfrom_peer.innerLength() + vid.innerLength() + vrandom_id.innerLength() + vto_peer.innerLength(); @@ -18230,10 +18305,12 @@ public: enum { flag_broadcast = (1 << 4), + flag_silent = (1 << 5), 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 has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; } uint32 innerLength() const { @@ -20133,6 +20210,90 @@ public: } }; +class MTPchannels_exportMessageLink { // RPC method 'channels.exportMessageLink' +public: + MTPInputChannel vchannel; + MTPint vid; + + MTPchannels_exportMessageLink() { + } + MTPchannels_exportMessageLink(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_exportMessageLink) { + read(from, end, cons); + } + MTPchannels_exportMessageLink(const MTPInputChannel &_channel, MTPint _id) : vchannel(_channel), vid(_id) { + } + + uint32 innerLength() const { + return vchannel.innerLength() + vid.innerLength(); + } + mtpTypeId type() const { + return mtpc_channels_exportMessageLink; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_exportMessageLink) { + vchannel.read(from, end); + vid.read(from, end); + } + void write(mtpBuffer &to) const { + vchannel.write(to); + vid.write(to); + } + + typedef MTPExportedMessageLink ResponseType; +}; +class MTPchannels_ExportMessageLink : public MTPBoxed { +public: + MTPchannels_ExportMessageLink() { + } + MTPchannels_ExportMessageLink(const MTPchannels_exportMessageLink &v) : MTPBoxed(v) { + } + MTPchannels_ExportMessageLink(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPchannels_ExportMessageLink(const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_exportMessageLink(_channel, _id)) { + } +}; + +class MTPchannels_toggleSignatures { // RPC method 'channels.toggleSignatures' +public: + MTPInputChannel vchannel; + MTPBool venabled; + + MTPchannels_toggleSignatures() { + } + MTPchannels_toggleSignatures(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_toggleSignatures) { + read(from, end, cons); + } + MTPchannels_toggleSignatures(const MTPInputChannel &_channel, MTPBool _enabled) : vchannel(_channel), venabled(_enabled) { + } + + uint32 innerLength() const { + return vchannel.innerLength() + venabled.innerLength(); + } + mtpTypeId type() const { + return mtpc_channels_toggleSignatures; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_toggleSignatures) { + vchannel.read(from, end); + venabled.read(from, end); + } + void write(mtpBuffer &to) const { + vchannel.write(to); + venabled.write(to); + } + + typedef MTPUpdates ResponseType; +}; +class MTPchannels_ToggleSignatures : public MTPBoxed { +public: + MTPchannels_ToggleSignatures() { + } + MTPchannels_ToggleSignatures(const MTPchannels_toggleSignatures &v) : MTPBoxed(v) { + } + MTPchannels_ToggleSignatures(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPchannels_ToggleSignatures(const MTPInputChannel &_channel, MTPBool _enabled) : MTPBoxed(MTPchannels_toggleSignatures(_channel, _enabled)) { + } +}; + // Inline methods definition inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { @@ -22885,7 +23046,7 @@ inline uint32 MTPmessage::innerLength() const { } case mtpc_message: { const MTPDmessage &v(c_message()); - return v.vflags.innerLength() + v.vid.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vto_id.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vmessage.innerLength() + (v.has_media() ? v.vmedia.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0) + (v.has_views() ? v.vviews.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vto_id.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_fwd_post() ? v.vfwd_post.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vmessage.innerLength() + (v.has_media() ? v.vmedia.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0) + (v.has_views() ? v.vviews.innerLength() : 0); } case mtpc_messageService: { const MTPDmessageService &v(c_messageService()); @@ -22915,6 +23076,7 @@ inline void MTPmessage::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vto_id.read(from, end); if (v.has_fwd_from_id()) { v.vfwd_from_id.read(from, end); } else { v.vfwd_from_id = MTPPeer(); } if (v.has_fwd_date()) { v.vfwd_date.read(from, end); } else { v.vfwd_date = MTPint(); } + if (v.has_fwd_post()) { v.vfwd_post.read(from, end); } else { v.vfwd_post = MTPint(); } if (v.has_via_bot_id()) { v.vvia_bot_id.read(from, end); } else { v.vvia_bot_id = MTPint(); } if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } v.vdate.read(from, end); @@ -22951,6 +23113,7 @@ inline void MTPmessage::write(mtpBuffer &to) const { v.vto_id.write(to); if (v.has_fwd_from_id()) v.vfwd_from_id.write(to); if (v.has_fwd_date()) v.vfwd_date.write(to); + if (v.has_fwd_post()) v.vfwd_post.write(to); if (v.has_via_bot_id()) v.vvia_bot_id.write(to); if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); v.vdate.write(to); @@ -22988,8 +23151,8 @@ inline MTPmessage::MTPmessage(MTPDmessageService *_data) : mtpDataOwner(_data), inline MTPmessage MTP_messageEmpty(MTPint _id) { return MTPmessage(new MTPDmessageEmpty(_id)); } -inline MTPmessage MTP_message(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, 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) { - return MTPmessage(new MTPDmessage(_flags, _id, _from_id, _to_id, _fwd_from_id, _fwd_date, _via_bot_id, _reply_to_msg_id, _date, _message, _media, _reply_markup, _entities, _views)); +inline MTPmessage MTP_message(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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) { + return MTPmessage(new MTPDmessage(_flags, _id, _from_id, _to_id, _fwd_from_id, _fwd_date, _fwd_post, _via_bot_id, _reply_to_msg_id, _date, _message, _media, _reply_markup, _entities, _views)); } inline MTPmessage MTP_messageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _date, const MTPMessageAction &_action) { return MTPmessage(new MTPDmessageService(_flags, _id, _from_id, _to_id, _date, _action)); @@ -25946,11 +26109,11 @@ inline uint32 MTPupdates::innerLength() const { switch (_type) { case mtpc_updateShortMessage: { const MTPDupdateShortMessage &v(c_updateShortMessage()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vuser_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vuser_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_fwd_post() ? v.vfwd_post.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); } case mtpc_updateShortChatMessage: { const MTPDupdateShortChatMessage &v(c_updateShortChatMessage()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vchat_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vchat_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_fwd_post() ? v.vfwd_post.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); } case mtpc_updateShort: { const MTPDupdateShort &v(c_updateShort()); @@ -25991,6 +26154,7 @@ inline void MTPupdates::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vdate.read(from, end); if (v.has_fwd_from_id()) { v.vfwd_from_id.read(from, end); } else { v.vfwd_from_id = MTPPeer(); } if (v.has_fwd_date()) { v.vfwd_date.read(from, end); } else { v.vfwd_date = MTPint(); } + if (v.has_fwd_post()) { v.vfwd_post.read(from, end); } else { v.vfwd_post = MTPint(); } if (v.has_via_bot_id()) { v.vvia_bot_id.read(from, end); } else { v.vvia_bot_id = MTPint(); } if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } @@ -26008,6 +26172,7 @@ inline void MTPupdates::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vdate.read(from, end); if (v.has_fwd_from_id()) { v.vfwd_from_id.read(from, end); } else { v.vfwd_from_id = MTPPeer(); } if (v.has_fwd_date()) { v.vfwd_date.read(from, end); } else { v.vfwd_date = MTPint(); } + if (v.has_fwd_post()) { v.vfwd_post.read(from, end); } else { v.vfwd_post = MTPint(); } if (v.has_via_bot_id()) { v.vvia_bot_id.read(from, end); } else { v.vvia_bot_id = MTPint(); } if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } @@ -26064,6 +26229,7 @@ inline void MTPupdates::write(mtpBuffer &to) const { v.vdate.write(to); if (v.has_fwd_from_id()) v.vfwd_from_id.write(to); if (v.has_fwd_date()) v.vfwd_date.write(to); + if (v.has_fwd_post()) v.vfwd_post.write(to); if (v.has_via_bot_id()) v.vvia_bot_id.write(to); if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); if (v.has_entities()) v.ventities.write(to); @@ -26080,6 +26246,7 @@ inline void MTPupdates::write(mtpBuffer &to) const { v.vdate.write(to); if (v.has_fwd_from_id()) v.vfwd_from_id.write(to); if (v.has_fwd_date()) v.vfwd_date.write(to); + if (v.has_fwd_post()) v.vfwd_post.write(to); if (v.has_via_bot_id()) v.vvia_bot_id.write(to); if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); if (v.has_entities()) v.ventities.write(to); @@ -26145,11 +26312,11 @@ inline MTPupdates::MTPupdates(MTPDupdateShortSentMessage *_data) : mtpDataOwner( inline MTPupdates MTP_updatesTooLong() { return MTPupdates(mtpc_updatesTooLong); } -inline MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, 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_id, _fwd_date, _via_bot_id, _reply_to_msg_id, _entities)); +inline MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id, _fwd_date, _fwd_post, _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 MTPPeer &_fwd_from_id, MTPint _fwd_date, 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_id, _fwd_date, _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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id, _fwd_date, _fwd_post, _via_bot_id, _reply_to_msg_id, _entities)); } inline MTPupdates MTP_updateShort(const MTPUpdate &_update, MTPint _date) { return MTPupdates(new MTPDupdateShort(_update, _date)); @@ -30417,5 +30584,32 @@ inline MTPmessages_botResults MTP_messages_botResults(MTPint _flags, const MTPlo return MTPmessages_botResults(new MTPDmessages_botResults(_flags, _query_id, _next_offset, _results)); } +inline MTPexportedMessageLink::MTPexportedMessageLink() : mtpDataOwner(new MTPDexportedMessageLink()) { +} + +inline uint32 MTPexportedMessageLink::innerLength() const { + const MTPDexportedMessageLink &v(c_exportedMessageLink()); + return v.vlink.innerLength(); +} +inline mtpTypeId MTPexportedMessageLink::type() const { + return mtpc_exportedMessageLink; +} +inline void MTPexportedMessageLink::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_exportedMessageLink) throw mtpErrorUnexpected(cons, "MTPexportedMessageLink"); + + if (!data) setData(new MTPDexportedMessageLink()); + MTPDexportedMessageLink &v(_exportedMessageLink()); + v.vlink.read(from, end); +} +inline void MTPexportedMessageLink::write(mtpBuffer &to) const { + const MTPDexportedMessageLink &v(c_exportedMessageLink()); + v.vlink.write(to); +} +inline MTPexportedMessageLink::MTPexportedMessageLink(MTPDexportedMessageLink *_data) : mtpDataOwner(_data) { +} +inline MTPexportedMessageLink MTP_exportedMessageLink(const MTPstring &_link) { + return MTPexportedMessageLink(new MTPDexportedMessageLink(_link)); +} + // 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/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 499823df8e..8c3a8a5dda 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -209,7 +209,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat; chatForbidden#7328bdb id:int title:string = Chat; -channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true invites_enabled:flags.10?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; +channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true admin_invites:flags.10?true signatures:flags.11?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; @@ -226,7 +226,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto; messageEmpty#83e5de54 id:int = Message; -message#c992e15c flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int = Message; +message#ef11cef6 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int fwd_post:flags.12?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int = Message; messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message; messageMediaEmpty#3ded6320 = MessageMedia; @@ -391,8 +391,8 @@ updates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Ve updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference; updatesTooLong#e317af7e = Updates; -updateShortMessage#13e4deaa flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; -updateShortChatMessage#248afa62 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; +updateShortMessage#3afbe9d1 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int fwd_post:flags.12?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; +updateShortChatMessage#ca2ef195 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int fwd_post:flags.12?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; updateShort#78d4dec1 update:Update date:int = Updates; updatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates; updates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates; @@ -405,7 +405,7 @@ photos.photo#20212ca8 photo:Photo users:Vector = photos.Photo; upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File; -dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true id:int ip_address:string port:int = DcOption; +dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true id:int ip_address:string port:int = DcOption; config#6bbc5f8 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int disabled_features:Vector = Config; @@ -639,6 +639,8 @@ botInlineResult#9bebaeb9 flags:# id:string type:string title:flags.1?string desc messages.botResults#1170b0a3 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string results:Vector = messages.BotResults; +exportedMessageLink#1f486803 link:string = ExportedMessageLink; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -714,9 +716,9 @@ messages.deleteHistory#b7c13bd9 peer:InputPeer max_id:int = messages.AffectedHis messages.deleteMessages#a5f18925 id:Vector = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector; messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; -messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true broadcast:flags.4?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; -messages.sendMedia#c8f16791 flags:# broadcast:flags.4?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; -messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer = Updates; +messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true broadcast:flags.4?true silent:flags.5?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; +messages.sendMedia#c8f16791 flags:# broadcast:flags.4?true silent:flags.5?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; +messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true silent:flags.5?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getChats#3c6aa187 id:Vector = messages.Chats; messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; @@ -760,7 +762,7 @@ messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs; messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; messages.getInlineBotResults#9324600d bot:InputUser query:string offset:string = messages.BotResults; messages.setInlineBotResults#3f23ec12 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector cache_time:int next_offset:flags.2?string = Bool; -messages.sendInlineBotResult#b16e06fe flags:# broadcast:flags.4?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates; +messages.sendInlineBotResult#b16e06fe flags:# broadcast:flags.4?true silent:flags.5?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates; updates.getState#edd4882a = updates.State; updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; @@ -810,3 +812,5 @@ channels.kickFromChannel#a672de14 channel:InputChannel user_id:InputUser kicked: channels.exportInvite#c7560885 channel:InputChannel = ExportedChatInvite; channels.deleteChannel#c0111fe3 channel:InputChannel = Updates; channels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates; +channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessageLink; +channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index f00799cf63..d0246cf776 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1306,16 +1306,17 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (_selectedMsgId) repaintItem(_selectedMsgId, -1); } else if (!ignoreMousedItem && App::mousedItem() && App::mousedItem()->channelId() == itemChannel(_mousedItem) && App::mousedItem()->id == itemMsgId(_mousedItem)) { _menu = new PopupMenu(); - if ((_contextMenuLnk && dynamic_cast(_contextMenuLnk.data()))) { + QLatin1String linktype = _contextMenuLnk ? _contextMenuLnk->type() : qstr(""); + if (linktype == qstr("TextLink") || linktype == qstr("LocationLink")) { _menu->addAction(lang(lng_context_open_link), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_link), this, SLOT(copyContextUrl()))->setEnabled(true); - } else if ((_contextMenuLnk && dynamic_cast(_contextMenuLnk.data()))) { + } else if (linktype == qstr("EmailLink")) { _menu->addAction(lang(lng_context_open_email), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_email), this, SLOT(copyContextUrl()))->setEnabled(true); - } else if (_contextMenuLnk && dynamic_cast(_contextMenuLnk.data())) { + } else if (linktype == qstr("MentionLink")) { _menu->addAction(lang(lng_context_open_mention), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_mention), this, SLOT(copyContextUrl()))->setEnabled(true); - } else if (_contextMenuLnk && dynamic_cast(_contextMenuLnk.data())) { + } else if (linktype == qstr("HashtagLink")) { _menu->addAction(lang(lng_context_open_hashtag), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_hashtag), this, SLOT(copyContextUrl()))->setEnabled(true); } else { diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 313709f181..665ed2b668 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1077,6 +1077,15 @@ void ProfileInner::mouseReleaseEvent(QMouseEvent *e) { connect(box, SIGNAL(confirmed()), this, SLOT(onKickConfirm())); Ui::showLayer(box); } + + _kickDown = 0; + if (!_photoLink && (_peerUser || (_peerChat && !_peerChat->canEdit()) || (_peerChannel && !_amCreator))) { + setCursor((_kickOver || _kickDown || textlnkOver()) ? style::cur_pointer : style::cur_default); + } else { + setCursor((_kickOver || _kickDown || _photoOver || textlnkOver()) ? style::cur_pointer : style::cur_default); + } + update(); + if (textlnkDown()) { TextLinkPtr lnk = textlnkDown(); textlnkDown(TextLinkPtr()); @@ -1087,17 +1096,10 @@ void ProfileInner::mouseReleaseEvent(QMouseEvent *e) { if (reBotCommand().match(lnk->encoded()).hasMatch()) { Ui::showPeerHistory(_peer, ShowAtTheEndMsgId); } - lnk->onClick(e->button()); + App::activateTextLink(lnk, e->button()); } } } - _kickDown = 0; - if (!_photoLink && (_peerUser || (_peerChat && !_peerChat->canEdit()) || (_peerChannel && !_amCreator))) { - setCursor((_kickOver || _kickDown || textlnkOver()) ? style::cur_pointer : style::cur_default); - } else { - setCursor((_kickOver || _kickDown || _photoOver || textlnkOver()) ? style::cur_pointer : style::cur_default); - } - update(); } void ProfileInner::onKickConfirm() { diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 6b1e982da9..146e6fc759 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -1488,3 +1488,7 @@ bool linuxMoveFile(const char *from, const char *to) { return true; } + +bool psLaunchMaps(const QString &lat, const QString &lon) { + return false; +} diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index 8a527b1f73..748a5639c9 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -194,3 +194,5 @@ public: }; bool linuxMoveFile(const char *from, const char *to); + +bool psLaunchMaps(const QString &lat, const QString &lon); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 84349d6160..edaaa92ab1 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -926,3 +926,7 @@ QString strNeedToRefresh2() { const uint32 letters[] = { 0x8F001546, 0xAF007A49, 0xB8002B5F, 0x1A000B54, 0xD003E49, 0xE0003663, 0x4900796F, 0x500836E, 0x9A00D156, 0x5E00FF69, 0x5900C765, 0x3D00D177 }; return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0])); } + +bool psLaunchMaps(const QString &lat, const QString &lon) { + return false; +} diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index 70ca3ade6d..979e9825fd 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -223,3 +223,5 @@ QString strStyleOfInterface(); QString strNeedToReload(); QString strNeedToRefresh1(); QString strNeedToRefresh2(); + +bool psLaunchMaps(const QString &lat, const QString &lon); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 044827de67..a2c4e879ee 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -3650,3 +3650,7 @@ bool InitToastManager() { QDir().mkpath(cWorkingDir() + qsl("tdata/temp")); return true; } + +bool psLaunchMaps(const QString &lat, const QString &lon) { + return QDesktopServices::openUrl(qsl("bingmaps:?lvl=16&collection=point.") + lat + '_' + lon + '_' + qsl("Point")); +} diff --git a/Telegram/SourceFiles/pspecific_wnd.h b/Telegram/SourceFiles/pspecific_wnd.h index ce46b80cc9..90bc466c46 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -194,3 +194,5 @@ public: } }; + +bool psLaunchMaps(const QString &lat, const QString &lon); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 3803850684..1c05b266ab 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -688,11 +688,12 @@ void PhotoCancelLink::onClick(Qt::MouseButton button) const { if (!data->date) return; if (data->uploading()) { - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - if (HistoryMessage *msg = item->toHistoryMessage()) { - if (msg->getMedia() && msg->getMedia()->type() == MediaTypePhoto && static_cast(msg->getMedia())->photo() == data) { - App::contextItem(item); - App::main()->deleteLayer(-2); + if (HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0)) { + if (HistoryMessage *msg = item->toHistoryMessage()) { + if (msg->getMedia() && msg->getMedia()->type() == MediaTypePhoto && static_cast(msg->getMedia())->photo() == data) { + App::contextItem(item); + App::main()->deleteLayer(-2); + } } } } else { @@ -964,11 +965,12 @@ void DocumentCancelLink::onClick(Qt::MouseButton button) const { if (!data->date) return; if (data->uploading()) { - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - if (HistoryMessage *msg = item->toHistoryMessage()) { - if (msg->getMedia() && msg->getMedia()->getDocument() == data) { - App::contextItem(item); - App::main()->deleteLayer(-2); + if (HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0)) { + if (HistoryMessage *msg = item->toHistoryMessage()) { + if (msg->getMedia() && msg->getMedia()->getDocument() == data) { + App::contextItem(item); + App::main()->deleteLayer(-2); + } } } } else { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 625b300db3..3afef5e2b1 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -156,6 +156,7 @@ inline bool isClientMsgId(MsgId id) { } static const MsgId ShowAtTheEndMsgId = -0x40000000; static const MsgId SwitchAtTopMsgId = -0x3FFFFFFF; +static const MsgId ShowAtProfileMsgId = -0x3FFFFFFE; static const MsgId ServerMaxMsgId = 0x3FFFFFFF; static const MsgId ShowAtUnreadMsgId = 0; @@ -622,12 +623,15 @@ public: bool canViewParticipants() const { return flagsFull & MTPDchannelFull::flag_can_view_participants; } + bool addsSignature() const { + return flags & MTPDchannel::flag_signatures; + } bool isForbidden; bool isVerified() const { return flags & MTPDchannel::flag_verified; } bool canAddParticipants() const { - return amCreator() || amEditor() || (flags & MTPDchannel::flag_invites_enabled); + return amCreator() || amEditor() || (flags & MTPDchannel::flag_admin_invites); } // ImagePtr photoFull; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 52f823b27e..83679b68de 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -210,8 +210,8 @@ void NotifyWindow::updateNotifyDisplay() { item->drawInDialog(p, r, active, textCachedFor, itemTextCache); } else { p.setFont(st::dlgHistFont->f); - if (item->hasFromName() && !item->fromChannel()) { - itemTextCache.setText(st::dlgHistFont, item->from()->name); + if (item->hasFromName() && !item->isPost()) { + itemTextCache.setText(st::dlgHistFont, item->author()->name); p.setPen(st::dlgSystemColor->p); itemTextCache.drawElided(p, r.left(), r.top(), r.width(), st::dlgHistFont->height); r.setTop(r.top() + st::dlgHistFont->height); @@ -363,9 +363,22 @@ NotifyWindow::~NotifyWindow() { if (App::wnd()) App::wnd()->notifyShowNext(this); } -Window::Window(QWidget *parent) : PsMainWindow(parent), _serviceHistoryRequest(0), title(0), -_passcode(0), intro(0), main(0), settings(0), layerBg(0), _isActive(false), -_connecting(0), _clearManager(0), dragging(false), _inactivePress(false), _shouldLockAt(0), _mediaView(0) { +Window::Window(QWidget *parent) : PsMainWindow(parent) +, _serviceHistoryRequest(0) +, title(0) +, _passcode(0) +, intro(0) +, main(0) +, settings(0) +, layerBg(0) +, _stickerPreview(0) +, _isActive(false) +, _connecting(0) +, _clearManager(0) +, dragging(false) +, _inactivePress(false) +, _shouldLockAt(0) +, _mediaView(0) { icon16 = icon256.scaledToWidth(16, Qt::SmoothTransformation); icon32 = icon256.scaledToWidth(32, Qt::SmoothTransformation); @@ -842,6 +855,23 @@ bool Window::ui_isMediaViewShown() { return _mediaView && !_mediaView->isHidden(); } +void Window::ui_showStickerPreview(DocumentData *sticker) { + if (!sticker || ((!sticker->isAnimation() || !sticker->loaded()) && !sticker->sticker())) return; + if (!_stickerPreview) { + _stickerPreview = new StickerPreviewWidget(this); + resizeEvent(0); + } + if (_stickerPreview->isHidden()) { + fixOrder(); + } + _stickerPreview->showPreview(sticker); +} + +void Window::ui_hideStickerPreview() { + if (!_stickerPreview) return; + _stickerPreview->hidePreview(); +} + void Window::showConnecting(const QString &text, const QString &reconnect) { if (_connecting) { _connecting->set(text, reconnect); @@ -1169,6 +1199,7 @@ void Window::layerFinishedHide(BackgroundWidget *was) { void Window::fixOrder() { title->raise(); if (layerBg) layerBg->raise(); + if (_stickerPreview) _stickerPreview->raise(); if (_connecting) _connecting->raise(); } @@ -1242,6 +1273,7 @@ void Window::resizeEvent(QResizeEvent *e) { } title->setGeometry(0, 0, width(), st::titleHeight); if (layerBg) layerBg->resize(width(), height()); + if (_stickerPreview) _stickerPreview->setGeometry(0, title->height(), width(), height() - title->height()); if (_connecting) _connecting->setGeometry(0, height() - _connecting->height(), _connecting->width(), _connecting->height()); emit resized(QSize(width(), height() - st::titleHeight)); } @@ -1317,6 +1349,11 @@ void Window::notifySchedule(History *history, HistoryItem *item) { PeerData *notifyByFrom = (!history->peer->isUser() && item->mentionsMe()) ? item->from() : 0; + if (item->isSilent()) { + history->popNotification(item); + return; + } + bool haveSetting = (history->peer->notify != UnknownNotifySettings); if (haveSetting) { if (history->peer->notify != EmptyNotifySettings && history->peer->notify->mute > unixtime()) { @@ -1824,6 +1861,7 @@ void Window::updateIsActive(int timeout) { Window::~Window() { notifyClearFast(); + deleteAndMark(_stickerPreview); delete _clearManager; delete _connecting; delete _mediaView; @@ -2730,7 +2768,7 @@ void LastCrashedWindow::onUpdateFailed() { void LastCrashedWindow::onContinue() { if (SignalHandlers::restart() == SignalHandlers::CantOpen) { new NotStartedWindow(); - } else { + } else if (!Global::started()) { Sandbox::launch(); } close(); diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index af821859f0..ab34c00d92 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -121,6 +121,8 @@ private: typedef QList NotifyWindows; +class StickerPreviewWidget; + class Window : public PsMainWindow { Q_OBJECT @@ -239,6 +241,8 @@ public: void ui_showLayer(LayeredWidget *box, ShowLayerOptions options); bool ui_isLayerShown(); bool ui_isMediaViewShown(); + void ui_showStickerPreview(DocumentData *sticker); + void ui_hideStickerPreview(); public slots: @@ -311,6 +315,7 @@ private: MainWidget *main; SettingsWidget *settings; BackgroundWidget *layerBg; + StickerPreviewWidget *_stickerPreview; QTimer _isActiveTimer; bool _isActive; From 57b771c879499f13eeac0b9f37d0ebe39782e382 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 17 Feb 2016 20:14:09 +0300 Subject: [PATCH 095/316] some possible crashes fixed, showing maps app on os x --- Telegram/SourceFiles/apiwrap.cpp | 4 +++- Telegram/SourceFiles/dialogswidget.cpp | 2 ++ Telegram/SourceFiles/history.cpp | 3 ++- Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/pspecific_mac.cpp | 8 ++++---- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index ac90340590..e529b1f74d 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -346,7 +346,9 @@ void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestI App::feedUsers(MTP_vector(1, d.vuser), false); App::feedPhoto(d.vprofile_photo); App::feedUserLink(MTP_int(peerToUser(peer->id)), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link, false); - App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); + if (App::main()) { + App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); + } peer->asUser()->setBotInfo(d.vbot_info); peer->asUser()->blocked = mtpIsTrue(d.vblocked) ? UserIsBlocked : UserIsNotBlocked; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 889580af44..fca26a14b1 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -1366,6 +1366,8 @@ void DialogsInner::selectSkipPage(int32 pixels, int32 direction) { } void DialogsInner::loadPeerPhotos(int32 yFrom) { + if (!parentWidget()) return; + int32 yTo = yFrom + parentWidget()->height() * 5; MTP::clearLoaderPriorities(); if (_state == DefaultState) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index eeda88bf71..66f3608474 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -5982,7 +5982,8 @@ HistoryMessageVia::HistoryMessageVia(Interfaces *) } void HistoryMessageVia::create(int32 userId) { - if (bot = App::userLoaded(peerFromUser(userId))) { + bot = App::userLoaded(peerFromUser(userId)); + if (bot) { maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + bot->username)); lnk.reset(new ViaInlineBotLink(bot)); } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index d197e54593..24105a3722 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -7159,7 +7159,7 @@ void HistoryWidget::drawRecording(Painter &p) { } void HistoryWidget::paintEvent(QPaintEvent *e) { - if (App::wnd() && App::wnd()->contentOverlapped(this, e)) return; + if (!App::main() || (App::wnd() && App::wnd()->contentOverlapped(this, e))) return; Painter p(this); QRect r(e->rect()); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index edaaa92ab1..c3bbde72bb 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -902,6 +902,10 @@ QByteArray psPathBookmark(const QString &path) { return objc_pathBookmark(path); } +bool psLaunchMaps(const QString &lat, const QString &lon) { + return QDesktopServices::openUrl(qsl("https://maps.apple.com/?q=Point&z=16&ll=%1,%2").arg(lat).arg(lon)); +} + QString strNotificationAboutThemeChange() { const uint32 letters[] = { 0xE9005541, 0x5600DC70, 0x88001570, 0xF500D86C, 0x8100E165, 0xEE005949, 0x2900526E, 0xAE00FB74, 0x96000865, 0x7000CD72, 0x3B001566, 0x5F007361, 0xAE00B663, 0x74009A65, 0x29003054, 0xC6002668, 0x98003865, 0xFA00336D, 0xA3007A65, 0x93001443, 0xBB007868, 0xE100E561, 0x3500366E, 0xC0007A67, 0x200CA65, 0xBE00DF64, 0xE300BB4E, 0x2900D26F, 0xD500D374, 0xE900E269, 0x86008F66, 0xC4006669, 0x1C00A863, 0xE600A761, 0x8E00EE74, 0xB300B169, 0xCF00B36F, 0xE600D36E }; return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0])); @@ -926,7 +930,3 @@ QString strNeedToRefresh2() { const uint32 letters[] = { 0x8F001546, 0xAF007A49, 0xB8002B5F, 0x1A000B54, 0xD003E49, 0xE0003663, 0x4900796F, 0x500836E, 0x9A00D156, 0x5E00FF69, 0x5900C765, 0x3D00D177 }; return strMakeFromLetters(letters, sizeof(letters) / sizeof(letters[0])); } - -bool psLaunchMaps(const QString &lat, const QString &lon) { - return false; -} From 803d1a429d938ac5a5ee6fb71a60d0d3cb235dbd Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 18 Feb 2016 19:36:33 +0300 Subject: [PATCH 096/316] scheme updated, config vars moved to Global namespace --- Telegram/SourceFiles/apiwrap.cpp | 4 +- Telegram/SourceFiles/app.cpp | 81 +-- Telegram/SourceFiles/app.h | 1 + Telegram/SourceFiles/application.cpp | 8 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 2 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- Telegram/SourceFiles/boxes/contactsbox.cpp | 18 +- Telegram/SourceFiles/facades.cpp | 36 +- Telegram/SourceFiles/facades.h | 17 + Telegram/SourceFiles/history.cpp | 59 +-- Telegram/SourceFiles/history.h | 48 +- Telegram/SourceFiles/historywidget.cpp | 18 +- Telegram/SourceFiles/layout.cpp | 6 +- Telegram/SourceFiles/localstorage.cpp | 16 +- Telegram/SourceFiles/mainwidget.cpp | 89 +++- Telegram/SourceFiles/mediaview.cpp | 12 +- Telegram/SourceFiles/mtproto/mtp.cpp | 12 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp | 4 + Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 7 +- Telegram/SourceFiles/mtproto/mtpDC.cpp | 20 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 166 +++++-- Telegram/SourceFiles/mtproto/mtpScheme.h | 468 +++++++++++++++--- Telegram/SourceFiles/mtproto/scheme.tl | 19 +- Telegram/SourceFiles/profilewidget.cpp | 16 +- Telegram/SourceFiles/settings.cpp | 13 +- Telegram/SourceFiles/settings.h | 11 - Telegram/SourceFiles/structs.cpp | 6 +- Telegram/SourceFiles/types.h | 4 +- Telegram/SourceFiles/window.cpp | 12 +- 29 files changed, 848 insertions(+), 327 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index e529b1f74d..2955002259 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -421,13 +421,13 @@ void ApiWrap::requestLastParticipants(ChannelData *peer, bool fromStart) { return; } } - mtpRequestId req = MTP::send(MTPchannels_GetParticipants(peer->inputChannel, MTP_channelParticipantsRecent(), MTP_int(fromStart ? 0 : peer->mgInfo->lastParticipants.size()), MTP_int(cMaxGroupCount())), rpcDone(&ApiWrap::lastParticipantsDone, peer), rpcFail(&ApiWrap::lastParticipantsFail, peer)); + mtpRequestId req = MTP::send(MTPchannels_GetParticipants(peer->inputChannel, MTP_channelParticipantsRecent(), MTP_int(fromStart ? 0 : peer->mgInfo->lastParticipants.size()), MTP_int(Global::ChatSizeMax())), rpcDone(&ApiWrap::lastParticipantsDone, peer), rpcFail(&ApiWrap::lastParticipantsFail, peer)); _participantsRequests.insert(peer, fromStart ? req : -req); } void ApiWrap::requestBots(ChannelData *peer) { if (!peer || !peer->isMegagroup() || _botsRequests.contains(peer)) return; - _botsRequests.insert(peer, MTP::send(MTPchannels_GetParticipants(peer->inputChannel, MTP_channelParticipantsBots(), MTP_int(0), MTP_int(cMaxGroupCount())), rpcDone(&ApiWrap::lastParticipantsDone, peer), rpcFail(&ApiWrap::lastParticipantsFail, peer))); + _botsRequests.insert(peer, MTP::send(MTPchannels_GetParticipants(peer->inputChannel, MTP_channelParticipantsBots(), MTP_int(0), MTP_int(Global::ChatSizeMax())), rpcDone(&ApiWrap::lastParticipantsDone, peer), rpcFail(&ApiWrap::lastParticipantsFail, peer))); } void ApiWrap::gotChat(PeerData *peer, const MTPmessages_Chats &result) { diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 22cad42f6e..367f4f90b4 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -350,7 +350,7 @@ namespace App { for (QVector::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) { const MTPuser &user(*i); data = 0; - bool wasContact = false; + bool wasContact = false, minimal = false; const MTPUserStatus *status = 0, emptyStatus = MTP_userStatusEmpty(); switch (user.type()) { @@ -372,19 +372,22 @@ namespace App { } break; case mtpc_user: { const MTPDuser &d(user.c_user()); + minimal = d.is_min(); PeerId peer(peerFromUser(d.vid.v)); data = App::user(peer); - data->flags = d.vflags.v; - if (d.is_self()) { - data->input = MTP_inputPeerSelf(); - data->inputUser = MTP_inputUserSelf(); - } else if (!d.has_access_hash()) { - data->input = MTP_inputPeerUser(d.vid, MTP_long((data->access == UserNoAccess) ? 0 : data->access)); - data->inputUser = MTP_inputUser(d.vid, MTP_long((data->access == UserNoAccess) ? 0 : data->access)); - } else { - data->input = MTP_inputPeerUser(d.vid, d.vaccess_hash); - data->inputUser = MTP_inputUser(d.vid, d.vaccess_hash); + if (!minimal) { + data->flags = d.vflags.v; + if (d.is_self()) { + data->input = MTP_inputPeerSelf(); + data->inputUser = MTP_inputUserSelf(); + } else if (!d.has_access_hash()) { + data->input = MTP_inputPeerUser(d.vid, MTP_long((data->access == UserNoAccess) ? 0 : data->access)); + data->inputUser = MTP_inputUser(d.vid, MTP_long((data->access == UserNoAccess) ? 0 : data->access)); + } else { + data->input = MTP_inputPeerUser(d.vid, d.vaccess_hash); + data->inputUser = MTP_inputUser(d.vid, d.vaccess_hash); + } } if (d.is_deleted()) { data->setPhone(QString()); @@ -393,10 +396,10 @@ namespace App { data->access = UserNoAccess; status = &emptyStatus; } else { - QString phone = d.has_phone() ? qs(d.vphone) : QString(); + QString phone = minimal ? data->phone : (d.has_phone() ? qs(d.vphone) : QString()); QString fname = d.has_first_name() ? textOneLine(qs(d.vfirst_name)) : QString(); QString lname = d.has_last_name() ? textOneLine(qs(d.vlast_name)) : QString(); - QString uname = d.has_username() ? textOneLine(qs(d.vusername)) : QString(); + QString uname = minimal ? data->username : (d.has_username() ? textOneLine(qs(d.vusername)) : QString()); bool phoneChanged = (data->phone != phone); if (phoneChanged) data->setPhone(phone); @@ -420,22 +423,24 @@ namespace App { status = d.has_status() ? &d.vstatus : &emptyStatus; } wasContact = (data->contact > 0); - if (d.has_bot_info_version()) { - data->setBotInfoVersion(d.vbot_info_version.v); - data->botInfo->readsAllHistory = d.is_bot_chat_history(); - data->botInfo->cantJoinGroups = d.is_bot_nochats(); - data->botInfo->inlinePlaceholder = d.has_bot_inline_placeholder() ? '_' + qs(d.vbot_inline_placeholder) : QString(); - } else { - data->setBotInfoVersion(-1); - } - data->contact = (d.is_contact() || d.is_mutual_contact()) ? 1 : (data->phone.isEmpty() ? -1 : 0); - if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsNoButton) != dbiprsNoButton) { - cRefReportSpamStatuses().insert(data->id, dbiprsNoButton); - Local::writeReportSpamStatuses(); - } - if (d.is_self() && ::self != data) { - ::self = data; - if (App::wnd()) App::wnd()->updateGlobalMenu(); + if (!minimal) { + if (d.has_bot_info_version()) { + data->setBotInfoVersion(d.vbot_info_version.v); + data->botInfo->readsAllHistory = d.is_bot_chat_history(); + data->botInfo->cantJoinGroups = d.is_bot_nochats(); + data->botInfo->inlinePlaceholder = d.has_bot_inline_placeholder() ? '_' + qs(d.vbot_inline_placeholder) : QString(); + } else { + data->setBotInfoVersion(-1); + } + data->contact = (d.is_contact() || d.is_mutual_contact()) ? 1 : (data->phone.isEmpty() ? -1 : 0); + if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsNoButton) != dbiprsNoButton) { + cRefReportSpamStatuses().insert(data->id, dbiprsNoButton); + Local::writeReportSpamStatuses(); + } + if (d.is_self() && ::self != data) { + ::self = data; + if (App::wnd()) App::wnd()->updateGlobalMenu(); + } } } break; } @@ -443,7 +448,7 @@ namespace App { if (!data) continue; data->loaded = true; - if (status) switch (status->type()) { + if (status && !minimal) switch (status->type()) { case mtpc_userStatusEmpty: data->onlineTill = 0; break; case mtpc_userStatusRecently: if (data->onlineTill > -10) { // don't modify pseudo-online @@ -916,13 +921,27 @@ namespace App { return false; } + void updateEditedMessage(const MTPDmessage &m) { + PeerId peerId = peerFromMTP(m.vto_id); + if (m.has_from_id() && peerToUser(peerId) == MTP::authedId()) { + peerId = peerFromUser(m.vfrom_id); + } + 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(); + Notify::historyItemResized(existing); + } + } + void addSavedGif(DocumentData *doc) { SavedGifs &saved(cRefSavedGifs()); int32 index = saved.indexOf(doc); if (index) { if (index > 0) saved.remove(index); saved.push_front(doc); - if (saved.size() > cSavedGifsLimit()) saved.pop_back(); + if (saved.size() > Global::SavedGifsLimit()) saved.pop_back(); Local::writeSavedGifs(); if (App::main()) emit App::main()->savedGifsUpdated(); diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 2f4144e85f..a23c92c39a 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -81,6 +81,7 @@ namespace App { void feedChatAdmins(const MTPDupdateChatAdmins &d, bool emitPeerUpdated = true); void feedParticipantAdmin(const MTPDupdateChatParticipantAdmin &d, bool emitPeerUpdated = true); bool checkEntitiesAndViewsUpdate(const MTPDmessage &m); // returns true if item found and it is not detached + void updateEditedMessage(const MTPDmessage &m); void addSavedGif(DocumentData *doc); void checkSavedGif(HistoryItem *item); void feedMsgs(const QVector &msgs, NewMessageType type); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index b414fdb399..2e68ddd31c 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -384,8 +384,6 @@ void Application::closeApplication() { i->first->close(); } _localClients.clear(); - - MTP::stop(); } #ifndef TDESKTOP_DISABLE_AUTOUPDATE @@ -808,7 +806,7 @@ AppClass::AppClass() : QObject() checkMapVersion(); } - _window->updateIsActive(cOnlineFocusTimeout()); + _window->updateIsActive(Global::OnlineFocusTimeout()); } void AppClass::regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId) { @@ -926,7 +924,7 @@ void AppClass::checkLocalTime() { void AppClass::onAppStateChanged(Qt::ApplicationState state) { checkLocalTime(); if (_window) { - _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + _window->updateIsActive((state == Qt::ApplicationActive) ? Global::OnlineFocusTimeout() : Global::OfflineBlurTimeout()); } if (state != Qt::ApplicationActive) { PopupTooltip::Hide(); @@ -1083,6 +1081,8 @@ AppClass::~AppClass() { App::deinitMedia(); deinitImageLinkManager(); + MTP::stop(); + AppObject = 0; deleteAndMark(_uploader); deleteAndMark(_translator); diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index d236862a30..2a710d7aa8 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -275,7 +275,7 @@ NewGroupBox::NewGroupBox() : AbstractBox(), _group(this, qsl("group_type"), 0, lang(lng_create_group_title), true), _channel(this, qsl("group_type"), 1, lang(lng_create_channel_title)), _aboutGroupWidth(width() - st::boxPadding.left() - st::boxButtonPadding.right() - st::newGroupPadding.left() - st::defaultRadiobutton.textPosition.x()), -_aboutGroup(st::normalFont, lng_create_group_about(lt_count, cMaxGroupCount()), _defaultOptions, _aboutGroupWidth), +_aboutGroup(st::normalFont, lng_create_group_about(lt_count, Global::ChatSizeMax()), _defaultOptions, _aboutGroupWidth), _aboutChannel(st::normalFont, lang(lng_create_channel_about), _defaultOptions, _aboutGroupWidth), _next(this, lang(lng_create_group_next), st::defaultBoxButton), _cancel(this, lang(lng_cancel), st::cancelBoxButton) { diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index b114ffa18b..f7d3bfc64d 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -189,7 +189,7 @@ void ConfirmLinkBox::onOpenLink() { MaxInviteBox::MaxInviteBox(const QString &link) : AbstractBox(st::boxWidth) , _close(this, lang(lng_box_ok), st::defaultBoxButton) -, _text(st::boxTextFont, lng_participant_invite_sorry(lt_count, cMaxGroupCount()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()) +, _text(st::boxTextFont, lng_participant_invite_sorry(lt_count, Global::ChatSizeMax()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()) , _link(link) , _linkOver(false) , a_goodOpacity(0, 0) diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index e295611fe8..80eca99357 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -427,7 +427,7 @@ void ContactsInner::paintDialog(Painter &p, PeerData *peer, ContactData *data, b sel = false; } } else { - if (data->inchat || data->check || selectedCount() >= ((_channel && _channel->isMegagroup()) ? cMaxMegaGroupCount() : cMaxGroupCount())) { + if (data->inchat || data->check || selectedCount() >= ((_channel && _channel->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) { sel = false; } } @@ -767,7 +767,7 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) { data->check = false; _checkedContacts.remove(peer); --_selCount; - } else if (selectedCount() < ((_channel && _channel->isMegagroup()) ? cMaxMegaGroupCount() : cMaxGroupCount())) { + } else if (selectedCount() < ((_channel && _channel->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) { data->check = true; _checkedContacts.insert(peer, true); ++_selCount; @@ -1535,7 +1535,7 @@ void ContactsBox::paintEvent(QPaintEvent *e) { paintTitle(p, lang(lng_channel_admins)); } else if (_inner.chat() || _inner.creating() != CreatingGroupNone) { QString title(lang(addingAdmin ? lng_channel_add_admin : lng_profile_add_participant)); - QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(((_inner.channel() && _inner.channel()->isMegagroup()) ? cMaxMegaGroupCount() : cMaxGroupCount()))); + QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(((_inner.channel() && _inner.channel()->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax()))); paintTitle(p, title, additional); } else if (_inner.bot()) { paintTitle(p, lang(lng_bot_choose_group)); @@ -1757,7 +1757,7 @@ bool ContactsBox::creationFail(const RPCError &error) { MembersInner::MembersInner(ChannelData *channel, MembersFilter filter) : TWidget() , _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom()) -, _newItemHeight((channel->amCreator() && (channel->count < (channel->isMegagroup() ? cMaxMegaGroupCount() : cMaxGroupCount()) || (!channel->isMegagroup() && !channel->isPublic()) || filter == MembersFilterAdmins)) ? st::contactsNewItemHeight : 0) +, _newItemHeight((channel->amCreator() && (channel->count < (channel->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax()) || (!channel->isMegagroup() && !channel->isPublic()) || filter == MembersFilterAdmins)) ? st::contactsNewItemHeight : 0) , _newItemSel(false) , _channel(channel) , _filter(filter) @@ -1787,7 +1787,7 @@ MembersInner::MembersInner(ChannelData *channel, MembersFilter filter) : TWidget void MembersInner::load() { if (!_loadingRequestId) { - _loadingRequestId = MTP::send(MTPchannels_GetParticipants(_channel->inputChannel, (_filter == MembersFilterRecent) ? MTP_channelParticipantsRecent() : MTP_channelParticipantsAdmins(), MTP_int(0), MTP_int(cMaxGroupCount())), rpcDone(&MembersInner::membersReceived), rpcFail(&MembersInner::membersFailed)); + _loadingRequestId = MTP::send(MTPchannels_GetParticipants(_channel->inputChannel, (_filter == MembersFilterRecent) ? MTP_channelParticipantsRecent() : MTP_channelParticipantsAdmins(), MTP_int(0), MTP_int(Global::ChatSizeMax())), rpcDone(&MembersInner::membersReceived), rpcFail(&MembersInner::membersFailed)); } } @@ -1826,7 +1826,7 @@ void MembersInner::paintEvent(QPaintEvent *e) { paintDialog(p, _rows[from], data(from), sel, kickSel, kickDown); p.translate(0, _rowHeight); } - if (to == _rows.size() && _filter == MembersFilterRecent && (_rows.size() < _channel->count || _rows.size() >= cMaxGroupCount())) { + if (to == _rows.size() && _filter == MembersFilterRecent && (_rows.size() < _channel->count || _rows.size() >= Global::ChatSizeMax())) { p.setPen(st::stickersReorderFg); _about.draw(p, st::contactsPadding.left(), st::stickersReorderPadding.top(), _aboutWidth, style::al_center); } @@ -2005,7 +2005,7 @@ void MembersInner::refresh() { } else { _about.setText(st::boxTextFont, lng_channel_only_last_shown(lt_count, _rows.size())); _aboutHeight = st::stickersReorderPadding.top() + _about.countHeight(_aboutWidth) + st::stickersReorderPadding.bottom(); - if (_filter != MembersFilterRecent || (_rows.size() >= _channel->count && _rows.size() < cMaxGroupCount())) { + if (_filter != MembersFilterRecent || (_rows.size() >= _channel->count && _rows.size() < Global::ChatSizeMax())) { _aboutHeight = 0; } resize(width(), st::membersPadding.top() + _newItemHeight + _rows.size() * _rowHeight + st::membersPadding.bottom() + _aboutHeight); @@ -2220,7 +2220,7 @@ void MembersInner::kickAdminDone(const MTPUpdates &result, mtpRequestId req) { bool MembersInner::kickFail(const RPCError &error, mtpRequestId req) { if (mtpIsFlood(error)) return false; - + if (_kickBox) _kickBox->onClose(); load(); return true; @@ -2297,7 +2297,7 @@ void MembersBox::onScroll() { } void MembersBox::onAdd() { - if (_inner.filter() == MembersFilterRecent && _inner.channel()->count >= (_inner.channel()->isMegagroup() ? cMaxMegaGroupCount() : cMaxGroupCount())) { + if (_inner.filter() == MembersFilterRecent && _inner.channel()->count >= (_inner.channel()->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) { Ui::showLayer(new MaxInviteBox(_inner.channel()->invitationUrl), KeepOtherLayers); return; } diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index d65081f517..70c257e9a2 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -160,7 +160,7 @@ namespace Ui { return w->minimizeToTray(); } else if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { w->hide(); - w->updateIsActive(cOfflineBlurTimeout()); + w->updateIsActive(Global::OfflineBlurTimeout()); w->updateGlobalMenu(); return true; } @@ -352,6 +352,23 @@ namespace Sandbox { struct GlobalDataStruct { uint64 LaunchId = 0; Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; + + // 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 = 190; // ? + int32 PushChatPeriod = 0; // ? + int32 PushChatLimit = 0; // ? + int32 SavedGifsLimit = 100; + int32 EditTimeLimit = 0; // ? }; GlobalDataStruct *GlobalData = 0; @@ -375,4 +392,21 @@ namespace Global { DefineReadOnlyVar(Global, uint64, LaunchId); DefineVar(Global, Adaptive::Layout, AdaptiveLayout); + // config + DefineVar(Global, int32, ChatSizeMax); + DefineVar(Global, int32, MegagroupSizeMax); + DefineVar(Global, int32, ForwardedCountMax); + DefineVar(Global, int32, OnlineUpdatePeriod); + DefineVar(Global, int32, OfflineBlurTimeout); + DefineVar(Global, int32, OfflineIdleTimeout); + DefineVar(Global, int32, OnlineFocusTimeout); + DefineVar(Global, int32, OnlineCloudTimeout); + DefineVar(Global, int32, NotifyCloudDelay); + DefineVar(Global, int32, NotifyDefaultDelay); + DefineVar(Global, int32, ChatBigSize); + DefineVar(Global, int32, PushChatPeriod); + DefineVar(Global, int32, PushChatLimit); + DefineVar(Global, int32, SavedGifsLimit); + DefineVar(Global, int32, EditTimeLimit); + }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index e89c2da180..96ee166872 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -140,6 +140,23 @@ namespace Global { DeclareReadOnlyVar(uint64, LaunchId); DeclareVar(Adaptive::Layout, AdaptiveLayout); + // config + DeclareVar(int32, ChatSizeMax); + DeclareVar(int32, MegagroupSizeMax); + DeclareVar(int32, ForwardedCountMax); + DeclareVar(int32, OnlineUpdatePeriod); + DeclareVar(int32, OfflineBlurTimeout); + DeclareVar(int32, OfflineIdleTimeout); + DeclareVar(int32, OnlineFocusTimeout); // not from config + DeclareVar(int32, OnlineCloudTimeout); + DeclareVar(int32, NotifyCloudDelay); + DeclareVar(int32, NotifyDefaultDelay); + DeclareVar(int32, ChatBigSize); + DeclareVar(int32, PushChatPeriod); + DeclareVar(int32, PushChatLimit); + DeclareVar(int32, SavedGifsLimit); + DeclareVar(int32, EditTimeLimit); + }; namespace Adaptive { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 66f3608474..a1dcac2c32 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1389,8 +1389,8 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo } 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); } else { - if ((m.has_fwd_date() && m.vfwd_date.v > 0) || (m.has_fwd_from_id() && peerFromMTP(m.vfwd_from_id) != 0)) { - result = new HistoryForwarded(this, block, m); + if (m.has_fwd_from() && m.vfwd_from.type() == mtpc_messageFwdHeader) { + result = new HistoryForwarded(this, block, m, m.vfwd_from.c_messageFwdHeader()); } else if (m.has_reply_to_msg_id() && m.vreply_to_msg_id.v > 0) { result = new HistoryReply(this, block, m); } else { @@ -6832,27 +6832,28 @@ HistoryMessage::~HistoryMessage() { } } -HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg) +HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg, const MTPDmessageFwdHeader &f) : HistoryMessage(history, block, msg) -, fwdDate(::date(msg.vfwd_date)) -, fwdFrom(App::peer(peerFromMTP(msg.vfwd_from_id))) -, fwdFromVersion(fwdFrom->nameVersion) -, fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { +, _fwdDate(::date(f.vdate)) +, _fwdAuthor(App::peer(f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id))) +, _fwdFrom(App::peer(f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id))) +, _fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { } HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) : HistoryMessage(history, block, id, newForwardedFlags(history->peer, from, msg) | flags, msg->via() ? peerToUser(msg->viaBot()->id) : 0, date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->HistoryMessage::viewsCount(), msg->getMedia()) -, fwdDate(msg->dateForwarded()) -, fwdFrom(msg->fromForwarded()) -, fwdFromVersion(fwdFrom->nameVersion) -, fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { +, _fwdDate(msg->fwdDate()) +, _fwdAuthor(msg->fwdAuthor()) +, _fwdFrom(msg->fwdFrom()) +, _fwdAuthorVersion(_fwdAuthor->nameVersion) +, _fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { } QString HistoryForwarded::selectedText(uint32 selection) const { if (selection != FullSelection) return HistoryMessage::selectedText(selection); QString result, original = HistoryMessage::selectedText(selection); - result.reserve(lang(lng_forwarded_from).size() + fwdFrom->name.size() + 4 + original.size()); - result.append('[').append(lang(lng_forwarded_from)).append(' ').append(fwdFrom->name).append(qsl("]\n")).append(original); + result.reserve(lang(lng_forwarded_from).size() + _fwdAuthor->name.size() + 4 + original.size()); + result.append('[').append(lang(lng_forwarded_from)).append(' ').append(_fwdAuthor->name).append(qsl("]\n")).append(original); return result; } @@ -6860,7 +6861,7 @@ void HistoryForwarded::initDimensions() { fwdNameUpdated(); HistoryMessage::initDimensions(); if (!_media) { - int32 _namew = st::msgPadding.left() + fromWidth + fwdFromName.maxWidth() + st::msgPadding.right(); + int32 _namew = st::msgPadding.left() + _fromWidth + _fwdAuthorName.maxWidth() + st::msgPadding.right(); if (via()) { _namew += st::msgServiceFont->spacew + via()->maxWidth; } @@ -6869,19 +6870,19 @@ void HistoryForwarded::initDimensions() { } void HistoryForwarded::fwdNameUpdated() const { - QString fwdName((via() && fwdFrom->isUser()) ? fwdFrom->asUser()->firstName : App::peerName(fwdFrom)); - fwdFromName.setText(st::msgServiceNameFont, fwdName, _textNameOptions); + QString fwdName((via() && _fwdAuthor->isUser()) ? _fwdAuthor->asUser()->firstName : App::peerName(_fwdAuthor)); + _fwdAuthorName.setText(st::msgServiceNameFont, fwdName, _textNameOptions); if (via()) { int32 l = 0, w = 0; countPositionAndSize(l, w); - via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - fromWidth - fwdFromName.maxWidth() - st::msgServiceFont->spacew); + via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - _fromWidth - _fwdAuthorName.maxWidth() - st::msgServiceFont->spacew); } } void HistoryForwarded::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { - if (drawBubble() && fwdFrom->nameVersion > fwdFromVersion) { + if (drawBubble() && _fwdAuthor->nameVersion > _fwdAuthorVersion) { fwdNameUpdated(); - fwdFromVersion = fwdFrom->nameVersion; + _fwdAuthorVersion = _fwdAuthor->nameVersion; } HistoryMessage::draw(p, r, selection, ms); } @@ -6893,18 +6894,18 @@ void HistoryForwarded::drawForwardedFrom(Painter &p, int32 x, int32 y, int32 w, p.setPen((selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg))->p); p.setFont(serviceFont); - if (via() && w > fromWidth + fwdFromName.maxWidth() + serviceFont->spacew) { + if (via() && w > _fromWidth + _fwdAuthorName.maxWidth() + serviceFont->spacew) { p.drawText(x, y + serviceFont->ascent, lang(lng_forwarded_from)); p.setFont(serviceName); - fwdFromName.draw(p, x + fromWidth, y, w - fromWidth); + _fwdAuthorName.draw(p, x + _fromWidth, y, w - _fromWidth); - p.drawText(x + fromWidth + fwdFromName.maxWidth() + serviceFont->spacew, y + serviceFont->ascent, via()->text); - } else if (w > fromWidth) { + p.drawText(x + _fromWidth + _fwdAuthorName.maxWidth() + serviceFont->spacew, y + serviceFont->ascent, via()->text); + } else if (w > _fromWidth) { p.drawText(x, y + serviceFont->ascent, lang(lng_forwarded_from)); p.setFont(serviceName); - fwdFromName.drawElided(p, x + fromWidth, y, w - fromWidth); + _fwdAuthorName.drawElided(p, x + _fromWidth, y, w - _fromWidth); } else { p.drawText(x, y + serviceFont->ascent, serviceFont->elided(lang(lng_forwarded_from), w)); } @@ -6930,7 +6931,7 @@ int32 HistoryForwarded::resize(int32 width) { if (via()) { int32 l = 0, w = 0; countPositionAndSize(l, w); - via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - fromWidth - fwdFromName.maxWidth() - st::msgServiceFont->spacew); + via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - _fromWidth - _fwdAuthorName.maxWidth() - st::msgServiceFont->spacew); } } } @@ -6992,9 +6993,9 @@ void HistoryForwarded::getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorSt void HistoryForwarded::getForwardedState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 w) const { state = HistoryDefaultCursorState; - if (x >= fromWidth && x < w && x < fromWidth + fwdFromName.maxWidth()) { - lnk = fwdFrom->lnk; - } else if (via() && x >= fromWidth + fwdFromName.maxWidth() + st::msgServiceFont->spacew && x < w && x < fromWidth + fwdFromName.maxWidth() + st::msgServiceFont->spacew + via()->maxWidth) { + if (x >= _fromWidth && x < w && x < _fromWidth + _fwdAuthorName.maxWidth()) { + lnk = _fwdAuthor->lnk; + } else if (via() && x >= _fromWidth + _fwdAuthorName.maxWidth() + st::msgServiceFont->spacew && x < w && x < _fromWidth + _fwdAuthorName.maxWidth() + st::msgServiceFont->spacew + via()->maxWidth) { lnk = via()->lnk; } else { lnk = TextLinkPtr(); @@ -7121,7 +7122,7 @@ void HistoryReply::replyToNameUpdated() const { w += st::msgServiceFont->spacew + replyToVia()->maxWidth; } - _maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), 4 * w)); + _maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize))); } else { _maxReplyWidth = st::msgDateFont->width(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message)); } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index c5f667f253..0435cd00bf 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -904,7 +904,7 @@ public: virtual bool serviceMsg() const { return false; } - virtual void updateMedia(const MTPMessageMedia *media) { + virtual void updateMedia(const MTPMessageMedia *media, bool edited = false) { } virtual int32 addToOverview(AddToOverviewMethod method) { return 0; @@ -1026,6 +1026,16 @@ public: } bool displayFromPhoto() const; + virtual QDateTime fwdDate() const { // dynamic_cast optimize + return date; + } + virtual PeerData *fwdFrom() const { // dynamic_cast optimize + return from(); + } + virtual PeerData *fwdAuthor() const { // dynamic_cast optimize + return author(); + } + void clipCallback(ClipReaderNotification notification); virtual ~HistoryItem(); @@ -2036,8 +2046,8 @@ public: QString notificationHeader() const; QString notificationText() const; - void updateMedia(const MTPMessageMedia *media) { - if (media && _media && _media->type() != MediaTypeWebPage) { + void updateMedia(const MTPMessageMedia *media, bool edited = false) { + if (!edited && media && _media && _media->type() != MediaTypeWebPage) { _media->updateFrom(*media, this); } else { setMedia(media); @@ -2087,13 +2097,6 @@ public: return HistoryItem::viewsCount(); } - virtual QDateTime dateForwarded() const { // dynamic_cast optimize - return date; - } - virtual PeerData *fromForwarded() const { // dynamic_cast optimize - return author(); - } - HistoryMessage *toHistoryMessage() { // dynamic_cast optimize return this; } @@ -2120,7 +2123,7 @@ protected: class HistoryForwarded : public HistoryMessage { public: - HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg); + HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg, const MTPDmessageFwdHeader &f); HistoryForwarded(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg); void initDimensions(); @@ -2136,15 +2139,18 @@ public: void getForwardedState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 w) const; void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const; - QDateTime dateForwarded() const { - return fwdDate; + QDateTime fwdDate() const { + return _fwdDate; } - PeerData *fromForwarded() const { - return fwdFrom; + PeerData *fwdAuthor() const { + return _fwdAuthor; + } + PeerData *fwdFrom() const { + return _fwdFrom; } QString selectedText(uint32 selection) const; bool displayForwardedFrom() const { - return via() || !_media || !_media->isDisplayed() || (fwdFrom->isChannel() || !_media->hideForwardedFrom()); + return via() || !_media || !_media->isDisplayed() || _fwdAuthor->isChannel() || !_media->hideForwardedFrom(); } HistoryForwarded *toHistoryForwarded() { @@ -2156,11 +2162,11 @@ public: protected: - QDateTime fwdDate; - PeerData *fwdFrom; - mutable Text fwdFromName; - mutable int32 fwdFromVersion; - int32 fromWidth; + QDateTime _fwdDate; + PeerData *_fwdAuthor, *_fwdFrom; + mutable Text _fwdAuthorName; + mutable int32 _fwdAuthorVersion; + int32 _fromWidth; }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 24105a3722..d995e8bc52 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4564,7 +4564,7 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const if (showFromName) { flags |= MTPDmessage::flag_from_id; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(peer), MTPPeer(), MTPint(), MTPint(), 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)), NewMessageUnread); + 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); App::historyRegRandom(randomId, newId); @@ -4894,7 +4894,7 @@ void HistoryWidget::sendBotCommand(const QString &cmd, MsgId replyTo) { // reply bool lastKeyboardUsed = (_keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard.forMsgId() == FullMsgId(_channel, replyTo)); QString toSend = cmd; - PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? (App::hoveredLinkItem()->toHistoryForwarded() ? App::hoveredLinkItem()->toHistoryForwarded()->fromForwarded() : App::hoveredLinkItem()->from()) : 0); + PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? App::hoveredLinkItem()->toHistoryForwarded()->fwdFrom() : 0); if (bot && (!bot->isUser() || !bot->asUser()->botInfo)) bot = 0; QString username = bot ? bot->asUser()->username : QString(); int32 botStatus = _peer->isChat() ? _peer->asChat()->botStatus : (_peer->isMegagroup() ? _peer->asChannel()->mgInfo->botStatus : -1); @@ -4919,7 +4919,7 @@ bool HistoryWidget::insertBotCommand(const QString &cmd, bool specialGif) { QString toInsert = cmd; if (!toInsert.isEmpty() && toInsert.at(0) != '@') { - PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? (App::hoveredLinkItem()->toHistoryForwarded() ? App::hoveredLinkItem()->toHistoryForwarded()->fromForwarded() : App::hoveredLinkItem()->from()) : 0); + PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? App::hoveredLinkItem()->toHistoryForwarded()->fwdFrom() : 0); if (!bot->isUser() || !bot->asUser()->botInfo) bot = 0; QString username = bot ? bot->asUser()->username : QString(); int32 botStatus = _peer->isChat() ? _peer->asChat()->botStatus : (_peer->isMegagroup() ? _peer->asChannel()->mgInfo->botStatus : -1); @@ -5532,14 +5532,14 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif flags |= MTPDmessage::flag_from_id; } if (file->type == PreparePhoto) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaPhoto(file->photo, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), 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 ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), 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; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document, MTP_string(file->caption)), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread); + h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), 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) { @@ -6410,7 +6410,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), MTPPeer(), MTPint(), MTPint(), 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)), NewMessageUnread); + _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); } else if (result->type == qstr("photo")) { QImage fileThumb(result->thumb->pix().toImage()); @@ -6429,14 +6429,14 @@ 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), MTPPeer(), MTPint(), MTPint(), 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)), NewMessageUnread); + _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); } } 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), MTPPeer(), MTPint(), MTPint(), 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)), NewMessageUnread); + _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); } _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); App::main()->finishForwarding(_history, _broadcast.checked()); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 549b442e8a..bcc91d7171 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -582,7 +582,7 @@ void LayoutOverviewVoice::paint(Painter &p, const QRect &clip, uint32 selection, } bool showPause = updateStatusText(); int32 nameVersion = _parent->from()->nameVersion; - if (HistoryForwarded *fwd = _parent->toHistoryForwarded()) nameVersion = fwd->fromForwarded()->nameVersion; + if (HistoryForwarded *fwd = _parent->toHistoryForwarded()) nameVersion = fwd->fwdFrom()->nameVersion; if (nameVersion > _nameVersion) { updateName(); } @@ -701,8 +701,8 @@ void LayoutOverviewVoice::getState(TextLinkPtr &link, HistoryCursorState &cursor void LayoutOverviewVoice::updateName() const { int32 version = 0; if (HistoryForwarded *fwd = _parent->toHistoryForwarded()) { - _name.setText(st::semiboldFont, lang(lng_forwarded_from) + ' ' + App::peerName(fwd->fromForwarded()), _textNameOptions); - version = fwd->fromForwarded()->nameVersion; + _name.setText(st::semiboldFont, lang(lng_forwarded_from) + ' ' + App::peerName(fwd->fwdFrom()), _textNameOptions); + version = fwd->fwdFrom()->nameVersion; } else { _name.setText(st::semiboldFont, App::peerName(_parent->from()), _textNameOptions); version = _parent->from()->nameVersion; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index da64f2cb96..f8e622375a 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -822,12 +822,12 @@ namespace { if (_dcOpts) _dcOpts->insert(dcIdWithShift, mtpDcOption(dcIdWithShift % _mtp_internal::dcShift, flags, ip.toUtf8().constData(), port)); } break; - case dbiMaxGroupCount: { + case dbiChatSizeMax: { qint32 maxSize; stream >> maxSize; if (!_checkStreamStatus(stream)) return false; - cSetMaxGroupCount(maxSize); + Global::SetChatSizeMax(maxSize); } break; case dbiSavedGifsLimit: { @@ -835,15 +835,15 @@ namespace { stream >> limit; if (!_checkStreamStatus(stream)) return false; - cSetSavedGifsLimit(limit); + Global::SetSavedGifsLimit(limit); } break; - case dbiMaxMegaGroupCount: { + case dbiMegagroupSizeMax: { qint32 maxSize; stream >> maxSize; if (!_checkStreamStatus(stream)) return false; - cSetMaxMegaGroupCount(maxSize); + Global::SetMegagroupSizeMax(maxSize); } break; case dbiUser: { @@ -2124,9 +2124,9 @@ namespace Local { size += sizeof(quint32) + sizeof(qint32) * 6; EncryptedDescriptor data(size); - data.stream << quint32(dbiMaxGroupCount) << qint32(cMaxGroupCount()); - data.stream << quint32(dbiMaxMegaGroupCount) << qint32(cMaxMegaGroupCount()); - data.stream << quint32(dbiSavedGifsLimit) << qint32(cSavedGifsLimit()); + data.stream << quint32(dbiChatSizeMax) << qint32(Global::ChatSizeMax()); + data.stream << quint32(dbiMegagroupSizeMax) << qint32(Global::MegagroupSizeMax()); + data.stream << quint32(dbiSavedGifsLimit) << qint32(Global::SavedGifsLimit()); data.stream << quint32(dbiAutoStart) << qint32(cAutoStart()); data.stream << quint32(dbiStartMinimized) << qint32(cStartMinimized()); data.stream << quint32(dbiSendToMenu) << qint32(cSendToMenu()); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 181fd9b840..8d45382bea 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -537,11 +537,7 @@ void MainWidget::fillForwardingInfo(Text *&from, Text *&text, bool &serviceColor if (_toForward.isEmpty()) return; int32 version = 0; for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { - if (HistoryForwarded *fwd = i.value()->toHistoryForwarded()) { - version += fwd->fromForwarded()->nameVersion; - } else { - version += i.value()->author()->nameVersion; - } + version += i.value()->fwdAuthor()->nameVersion; } if (version != _toForwardNameVersion) { updateForwardingTexts(); @@ -562,10 +558,7 @@ void MainWidget::updateForwardingTexts() { QVector fromUsers; fromUsers.reserve(_toForward.size()); for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { - PeerData *from = i.value()->author(); - if (HistoryForwarded *fwd = i.value()->toHistoryForwarded()) { - from = fwd->fromForwarded(); - } + PeerData *from = i.value()->fwdAuthor(); if (!fromUsersMap.contains(from)) { fromUsersMap.insert(from, true); fromUsers.push_back(from); @@ -1328,7 +1321,7 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, if (!sentEntities.c_vector().v.isEmpty()) { sendFlags |= MTPmessages_SendMessage::flag_entities; } - hist->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? MTP::authedId() : 0), peerToMTP(hist->peer->id), MTPPeer(), MTPint(), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities, MTP_int(1)), NewMessageUnread); + 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); } @@ -1912,7 +1905,7 @@ void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia & 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())), MTPPeer(), MTPint(), MTPint(), MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities, MTPint()), NewMessageUnread); + 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); } if (item) { history.peerMessagesUpdated(item->history()->peer->id); @@ -3461,7 +3454,7 @@ void MainWidget::openPeerByName(const QString &username, MsgId msgId, const QStr showPeerProfile(peer); } } else { - if (msgId == ShowAtProfileMsgId) { + if (msgId == ShowAtProfileMsgId || !peer->isChannel()) { // show specific posts only in channels / supergroups msgId = ShowAtUnreadMsgId; } if (peer->isUser() && peer->asUser()->botInfo) { @@ -3541,7 +3534,7 @@ void MainWidget::usernameResolveDone(QPair msgIdAndStartToken, c showPeerProfile(peer); } } else { - if (msgId == ShowAtProfileMsgId) { + if (msgId == ShowAtProfileMsgId || !peer->isChannel()) { // show specific posts only in channels / supergroups msgId = ShowAtUnreadMsgId; } if (peer->isUser() && peer->asUser()->botInfo) { @@ -3892,21 +3885,21 @@ void MainWidget::updateOnline(bool gotOtherOffline) { App::wnd()->checkAutoLock(); bool isOnline = App::wnd()->isActive(); - int updateIn = cOnlineUpdatePeriod(); + int updateIn = Global::OnlineUpdatePeriod(); if (isOnline) { uint64 idle = psIdleTime(); - if (idle >= uint64(cOfflineIdleTimeout())) { + if (idle >= uint64(Global::OfflineIdleTimeout())) { isOnline = false; if (!_isIdle) { _isIdle = true; _idleFinishTimer.start(900); } } else { - updateIn = qMin(updateIn, int(cOfflineIdleTimeout() - idle)); + updateIn = qMin(updateIn, int(Global::OfflineIdleTimeout() - idle)); } } uint64 ms = getms(true); - if (isOnline != _lastWasOnline || (isOnline && _lastSetOnline + cOnlineUpdatePeriod() <= ms) || (isOnline && gotOtherOffline)) { + if (isOnline != _lastWasOnline || (isOnline && _lastSetOnline + Global::OnlineUpdatePeriod() <= ms) || (isOnline && gotOtherOffline)) { if (_onlineRequest) { MTP::cancel(_onlineRequest); _onlineRequest = 0; @@ -3916,20 +3909,20 @@ void MainWidget::updateOnline(bool gotOtherOffline) { _lastSetOnline = ms; _onlineRequest = MTP::send(MTPaccount_UpdateStatus(MTP_bool(!isOnline))); - if (App::self()) App::self()->onlineTill = unixtime() + (isOnline ? (cOnlineUpdatePeriod() / 1000) : -1); + if (App::self()) App::self()->onlineTill = unixtime() + (isOnline ? (Global::OnlineUpdatePeriod() / 1000) : -1); _lastSetOnline = getms(true); updateOnlineDisplay(); } else if (isOnline) { - updateIn = qMin(updateIn, int(_lastSetOnline + cOnlineUpdatePeriod() - ms)); + updateIn = qMin(updateIn, int(_lastSetOnline + Global::OnlineUpdatePeriod() - ms)); } _onlineTimer.start(updateIn); } void MainWidget::checkIdleFinish() { if (this != App::main()) return; - if (psIdleTime() < uint64(cOfflineIdleTimeout())) { + if (psIdleTime() < uint64(Global::OfflineIdleTimeout())) { _idleFinishTimer.stop(); _isIdle = false; updateOnline(); @@ -4011,18 +4004,28 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { case mtpc_updateShortMessage: { const MTPDupdateShortMessage &d(updates.c_updateShortMessage()); - if (!App::userLoaded(d.vuser_id.v) || (d.has_fwd_from_id() && !App::peerLoaded(peerFromMTP(d.vfwd_from_id))) || (d.has_via_bot_id() && !App::peerLoaded(peerFromUser(d.vvia_bot_id)))) { + if (!App::userLoaded(d.vuser_id.v) || (d.has_via_bot_id() && !App::peerLoaded(peerFromUser(d.vvia_bot_id)))) { MTP_LOG(0, ("getDifference { good - getting user for updateShortMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); } - + if (d.has_fwd_from() && d.vfwd_from.type() == mtpc_messageFwdHeader) { + const MTPDmessageFwdHeader &f(d.vfwd_from.c_messageFwdHeader()); + if (f.has_from_id() && !App::peerLoaded(peerFromUser(f.vfrom_id))) { + MTP_LOG(0, ("getDifference { good - getting user for updateShortMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); + return getDifference(); + } + if (f.has_channel_id() && !App::peerLoaded(peerFromChannel(f.vchannel_id))) { + MTP_LOG(0, ("getDifference { good - getting user for updateShortMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); + return getDifference(); + } + } if (!ptsUpdated(d.vpts.v, d.vpts_count.v, updates)) { return; } // 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_id, d.vfwd_date, d.vfwd_post, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread); + 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); if (item) { history.peerMessagesUpdated(item->history()->peer->id); } @@ -4035,19 +4038,29 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { case mtpc_updateShortChatMessage: { const MTPDupdateShortChatMessage &d(updates.c_updateShortChatMessage()); bool noFrom = !App::userLoaded(d.vfrom_id.v); - if (!App::chatLoaded(d.vchat_id.v) || noFrom || (d.has_fwd_from_id() && !App::peerLoaded(peerFromMTP(d.vfwd_from_id))) || (d.has_via_bot_id() && !App::peerLoaded(peerFromUser(d.vvia_bot_id)))) { + if (!App::chatLoaded(d.vchat_id.v) || noFrom || (d.has_via_bot_id() && !App::peerLoaded(peerFromUser(d.vvia_bot_id)))) { MTP_LOG(0, ("getDifference { good - getting user for updateShortChatMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); if (noFrom && App::api()) App::api()->requestFullPeer(App::chatLoaded(d.vchat_id.v)); return getDifference(); } - + if (d.has_fwd_from() && d.vfwd_from.type() == mtpc_messageFwdHeader) { + const MTPDmessageFwdHeader &f(d.vfwd_from.c_messageFwdHeader()); + if (f.has_from_id() && !App::peerLoaded(peerFromUser(f.vfrom_id))) { + MTP_LOG(0, ("getDifference { good - getting user for updateShortChatMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); + return getDifference(); + } + if (f.has_channel_id() && !App::peerLoaded(peerFromChannel(f.vchannel_id))) { + MTP_LOG(0, ("getDifference { good - getting user for updateShortChatMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); + return getDifference(); + } + } if (!ptsUpdated(d.vpts.v, d.vpts_count.v, updates)) { return; } // 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_id, d.vfwd_date, d.vfwd_post, d.vvia_bot_id, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread); + 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); if (item) { history.peerMessagesUpdated(item->history()->peer->id); } @@ -4436,6 +4449,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { const MTPDupdatePrivacy &d(update.c_updatePrivacy()); } break; + /////// Channel updates case mtpc_updateChannel: { const MTPDupdateChannel &d(update.c_updateChannel()); if (ChannelData *channel = App::channelLoaded(d.vchannel_id.v)) { @@ -4481,6 +4495,27 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { } } break; + case mtpc_updateEditChannelMessage: { + const MTPDupdateEditChannelMessage &d(update.c_updateEditChannelMessage()); + ChannelData *channel = App::channelLoaded(peerToChannel(peerFromMessage(d.vmessage))); + + if (channel && !_handlingChannelDifference) { + if (channel->ptsRequesting()) { // skip global updates while getting channel difference + return; + } else if (!channel->ptsUpdated(d.vpts.v, d.vpts_count.v, update)) { + return; + } + } + + // update before applying skipped + if (d.vmessage.type() == mtpc_message) { // apply message edit + App::updateEditedMessage(d.vmessage.c_message()); + } + if (channel && !_handlingChannelDifference) { + channel->ptsApplySkippedUpdates(); + } + } break; + case mtpc_updateReadChannelInbox: { const MTPDupdateReadChannelInbox &d(update.c_updateReadChannelInbox()); ChannelData *channel = App::channelLoaded(d.vchannel_id.v); @@ -4528,6 +4563,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { } } break; + ////// Cloud sticker sets case mtpc_updateNewStickerSet: { const MTPDupdateNewStickerSet &d(update.c_updateNewStickerSet()); if (d.vstickerset.type() == mtpc_messages_stickerSet) { @@ -4624,6 +4660,5 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { cSetLastSavedGifsUpdate(0); App::main()->updateStickers(); } break; - } } diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index c8719fb3f0..56fe2baecc 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -909,11 +909,7 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) { _y = (height() - _h) / 2; _width = _w; if (_msgid && item) { - if (HistoryForwarded *fwd = item->toHistoryForwarded()) { - _from = fwd->fromForwarded(); - } else { - _from = item->author(); - } + _from = item->fwdAuthor(); } else { _from = _user; } @@ -1062,11 +1058,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty } _x = (width() - _w) / 2; _y = (height() - _h) / 2; - if (HistoryForwarded *fwd = item->toHistoryForwarded()) { - _from = fwd->fromForwarded(); - } else { - _from = item->author(); - } + _from = item->fwdAuthor(); _full = 1; updateControls(); if (isHidden()) { diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index fdd03e1229..a6847bf34f 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -39,7 +39,7 @@ namespace { bool _started = false; uint32 layer; - + typedef QMap ParserMap; ParserMap parserMap; QMutex parserMapLock; @@ -209,7 +209,7 @@ namespace { return true; } else if (code < 0 || code >= 500 || (m = QRegularExpression("^FLOOD_WAIT_(\\d+)$").match(err)).hasMatch()) { if (!requestId) return false; - + int32 secs = 1; if (code < 0 || code >= 500) { RequestsDelays::iterator i = requestsDelays.find(requestId); @@ -366,13 +366,13 @@ namespace _mtp_internal { if (!(dcWithShift % _mtp_internal::dcShift)) { dcWithShift += (mainSession->getDcWithShift() % _mtp_internal::dcShift); } - + Sessions::const_iterator i = sessions.constFind(dcWithShift); if (i != sessions.cend()) return *i; MTProtoSessionPtr result(new MTProtoSession()); result->start(dcWithShift); - + sessions.insert(dcWithShift, result); return result; } @@ -380,7 +380,7 @@ namespace _mtp_internal { bool paused() { return _paused; } - + void registerRequest(mtpRequestId requestId, int32 dcWithShift) { { QMutexLocker locker(&requestByDCLock); @@ -704,7 +704,7 @@ namespace MTP { if (!(dc % _mtp_internal::dcShift)) { dc += (mainSession->getDcWithShift() % _mtp_internal::dcShift); } - + Sessions::const_iterator i = sessions.constFind(dc); if (i != sessions.cend()) return (*i)->getState(); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp index 858394a319..48bd7fd52d 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp @@ -149,6 +149,10 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP } } +const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector(0)); +const MTPVector MTPnullEntities = MTP_vector(0); +const MTPMessageFwdHeader MTPnullFwdHeader = MTP_messageFwdHeader(MTPint(), 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)) { diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index b1f655dc49..dc16848d75 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -985,7 +985,8 @@ enum { // client side flags MTPDstickerSet_flag_NOT_LOADED = (1 << 31), // sticker set is not yet loaded }; -static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector(0)); -static const MTPVector MTPnullEntities = MTP_vector(0); +extern const MTPReplyMarkup MTPnullMarkup; +extern const MTPVector MTPnullEntities; +extern const MTPMessageFwdHeader MTPnullFwdHeader; -QString stickerSetTitle(const MTPDstickerSet &s); \ No newline at end of file +QString stickerSetTitle(const MTPDstickerSet &s); diff --git a/Telegram/SourceFiles/mtproto/mtpDC.cpp b/Telegram/SourceFiles/mtproto/mtpDC.cpp index 1a9bf11d76..899e21a2ca 100644 --- a/Telegram/SourceFiles/mtproto/mtpDC.cpp +++ b/Telegram/SourceFiles/mtproto/mtpDC.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" namespace { - + MTProtoDCMap gDCs; bool configLoadedOnce = false; bool mainDCChanged = false; @@ -152,9 +152,21 @@ namespace { DEBUG_LOG(("MTP Info: got config, chat_size_max: %1, date: %2, test_mode: %3, this_dc: %4, dc_options.length: %5").arg(data.vchat_size_max.v).arg(data.vdate.v).arg(mtpIsTrue(data.vtest_mode)).arg(data.vthis_dc.v).arg(data.vdc_options.c_vector().v.size())); mtpUpdateDcOptions(data.vdc_options.c_vector().v); - cSetMaxGroupCount(data.vchat_size_max.v); - cSetMaxMegaGroupCount(data.vmegagroup_size_max.v); - cSetSavedGifsLimit(data.vsaved_gifs_limit.v); + + Global::SetChatSizeMax(data.vchat_size_max.v); + Global::SetMegagroupSizeMax(data.vmegagroup_size_max.v); + Global::SetForwardedCountMax(data.vforwarded_count_max.v); + Global::SetOnlineUpdatePeriod(data.vonline_update_period_ms.v); + Global::SetOfflineBlurTimeout(data.voffline_blur_timeout_ms.v); + Global::SetOfflineIdleTimeout(data.voffline_idle_timeout_ms.v); + Global::SetOnlineCloudTimeout(data.vonline_cloud_timeout_ms.v); + Global::SetNotifyCloudDelay(data.vnotify_cloud_delay_ms.v); + Global::SetNotifyDefaultDelay(data.vnotify_default_delay_ms.v); + Global::SetChatBigSize(data.vchat_big_size.v); // ? + Global::SetPushChatPeriod(data.vpush_chat_period_ms.v); // ? + Global::SetPushChatLimit(data.vpush_chat_limit.v); // ? + Global::SetSavedGifsLimit(data.vsaved_gifs_limit.v); + Global::SetEditTimeLimit(data.vedit_time_limit.v); // ? configLoadedOnce = true; Local::writeSettings(); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 462d46aeaf..0d1eb87c25 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1007,17 +1007,18 @@ void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types, 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(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break; - case 12: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 13: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break; - case 14: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; - case 15: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::flag_phone) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break; - case 16: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::flag_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break; - case 17: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::flag_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; - case 18: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::flag_bot_info_version) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break; - case 19: 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 20: 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1351,17 +1352,16 @@ void _serialize_message(MTPStringLogger &to, int32 stage, int32 lev, Types &type 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 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_id: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_date) { 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 12: to.add(" fwd_post: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; - case 13: 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 14: 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 15: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 16: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 17: 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 18: 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 19: 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 20: 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1379,11 +1379,13 @@ void _serialize_messageService(MTPStringLogger &to, int32 stage, int32 lev, Type 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(" 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(" 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 7: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 8: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 9: to.add(" action: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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 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(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 11: 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; } } @@ -2872,6 +2874,21 @@ void _serialize_updateBotInlineSend(MTPStringLogger &to, int32 stage, int32 lev, } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updateEditChannelMessage"); + to.add("\n").addSpaces(lev); + } + 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; + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -2963,12 +2980,10 @@ void _serialize_updateShortMessage(MTPStringLogger &to, int32 stage, int32 lev, 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_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_date) { 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 14: to.add(" fwd_post: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; - case 15: 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 16: 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 17: 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2994,12 +3009,10 @@ void _serialize_updateShortChatMessage(MTPStringLogger &to, int32 stage, int32 l 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_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_from_id) { 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(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_date) { 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 15: to.add(" fwd_post: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_post) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break; - case 16: 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 17: 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 18: 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -3177,7 +3190,8 @@ void _serialize_config(MTPStringLogger &to, int32 stage, int32 lev, Types &types 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(" disabled_features: "); ++stages.back(); types.push_back(00); 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 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; } } @@ -5093,6 +5107,41 @@ void _serialize_exportedMessageLink(MTPStringLogger &to, int32 stage, int32 lev, } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messageFwdHeader"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_messageEditData"); + 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 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; + case 2: 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 3: to.add(" edit_by: "); ++stages.back(); if (flag & MTPDchannels_messageEditData::flag_edit_by) { 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 4: to.add(" edit_date: "); ++stages.back(); if (flag & MTPDchannels_messageEditData::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 0 IN FIELD flags ]"); } break; + case 5: 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_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6868,6 +6917,24 @@ 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_editMessage"); + 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 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7395,6 +7462,20 @@ void _serialize_channels_exportMessageLink(MTPStringLogger &to, int32 stage, int } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_getMessageEditData"); + to.add("\n").addSpaces(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(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7676,6 +7757,7 @@ namespace { _serializers.insert(mtpc_updateSavedGifs, _serialize_updateSavedGifs); _serializers.insert(mtpc_updateBotInlineQuery, _serialize_updateBotInlineQuery); _serializers.insert(mtpc_updateBotInlineSend, _serialize_updateBotInlineSend); + _serializers.insert(mtpc_updateEditChannelMessage, _serialize_updateEditChannelMessage); _serializers.insert(mtpc_updates_state, _serialize_updates_state); _serializers.insert(mtpc_updates_differenceEmpty, _serialize_updates_differenceEmpty); _serializers.insert(mtpc_updates_difference, _serialize_updates_difference); @@ -7854,6 +7936,8 @@ namespace { _serializers.insert(mtpc_botInlineResult, _serialize_botInlineResult); _serializers.insert(mtpc_messages_botResults, _serialize_messages_botResults); _serializers.insert(mtpc_exportedMessageLink, _serialize_exportedMessageLink); + _serializers.insert(mtpc_messageFwdHeader, _serialize_messageFwdHeader); + _serializers.insert(mtpc_channels_messageEditData, _serialize_channels_messageEditData); _serializers.insert(mtpc_req_pq, _serialize_req_pq); _serializers.insert(mtpc_req_DH_params, _serialize_req_DH_params); @@ -7985,6 +8069,7 @@ namespace { _serializers.insert(mtpc_channels_deleteChannel, _serialize_channels_deleteChannel); _serializers.insert(mtpc_channels_toggleInvites, _serialize_channels_toggleInvites); _serializers.insert(mtpc_channels_toggleSignatures, _serialize_channels_toggleSignatures); + _serializers.insert(mtpc_channels_editMessage, _serialize_channels_editMessage); _serializers.insert(mtpc_messages_getChats, _serialize_messages_getChats); _serializers.insert(mtpc_channels_getChannels, _serialize_channels_getChannels); _serializers.insert(mtpc_messages_getFullChat, _serialize_messages_getFullChat); @@ -8025,6 +8110,7 @@ namespace { _serializers.insert(mtpc_channels_getParticipants, _serialize_channels_getParticipants); _serializers.insert(mtpc_channels_getParticipant, _serialize_channels_getParticipant); _serializers.insert(mtpc_channels_exportMessageLink, _serialize_channels_exportMessageLink); + _serializers.insert(mtpc_channels_getMessageEditData, _serialize_channels_getMessageEditData); _serializers.insert(mtpc_rpc_result, _serialize_rpc_result); _serializers.insert(mtpc_msg_container, _serialize_msg_container); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 0f15155a17..87a972c7e2 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -145,7 +145,7 @@ enum { mtpc_chatPhotoEmpty = 0x37c1011c, mtpc_chatPhoto = 0x6153276a, mtpc_messageEmpty = 0x83e5de54, - mtpc_message = 0xef11cef6, + mtpc_message = 0xc09be45f, mtpc_messageService = 0xc06b9607, mtpc_messageMediaEmpty = 0x3ded6320, mtpc_messageMediaPhoto = 0x3d8ce53d, @@ -269,13 +269,14 @@ enum { mtpc_updateSavedGifs = 0x9375341e, mtpc_updateBotInlineQuery = 0xc01eea08, mtpc_updateBotInlineSend = 0xf69e113, + mtpc_updateEditChannelMessage = 0x1b3f4df7, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_difference = 0xf49ca0, mtpc_updates_differenceSlice = 0xa8fb1981, mtpc_updatesTooLong = 0xe317af7e, - mtpc_updateShortMessage = 0x3afbe9d1, - mtpc_updateShortChatMessage = 0xca2ef195, + mtpc_updateShortMessage = 0x914fbf11, + mtpc_updateShortChatMessage = 0x16812688, mtpc_updateShort = 0x78d4dec1, mtpc_updatesCombined = 0x725b04c3, mtpc_updates = 0x74ae4240, @@ -285,7 +286,7 @@ enum { mtpc_photos_photo = 0x20212ca8, mtpc_upload_file = 0x96a18d5, mtpc_dcOption = 0x5d8c6cc, - mtpc_config = 0x6bbc5f8, + mtpc_config = 0x317ceef4, mtpc_nearestDc = 0x8e1a1775, mtpc_help_appUpdate = 0x8987f311, mtpc_help_noAppUpdate = 0xc45a6536, @@ -447,6 +448,8 @@ enum { mtpc_botInlineResult = 0x9bebaeb9, mtpc_messages_botResults = 0x1170b0a3, mtpc_exportedMessageLink = 0x1f486803, + mtpc_messageFwdHeader = 0xc786ddcb, + mtpc_channels_messageEditData = 0xb86fd3cf, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, @@ -607,7 +610,9 @@ enum { mtpc_channels_deleteChannel = 0xc0111fe3, mtpc_channels_toggleInvites = 0x49609307, mtpc_channels_exportMessageLink = 0xc846d22d, - mtpc_channels_toggleSignatures = 0x1f69b606 + mtpc_channels_toggleSignatures = 0x1f69b606, + mtpc_channels_getMessageEditData = 0x27ea3a28, + mtpc_channels_editMessage = 0xdcda80ed }; // Type forward declarations @@ -944,6 +949,7 @@ class MTPDupdateNewStickerSet; class MTPDupdateStickerSetsOrder; class MTPDupdateBotInlineQuery; class MTPDupdateBotInlineSend; +class MTPDupdateEditChannelMessage; class MTPupdates_state; class MTPDupdates_state; @@ -1233,6 +1239,12 @@ class MTPDmessages_botResults; class MTPexportedMessageLink; class MTPDexportedMessageLink; +class MTPmessageFwdHeader; +class MTPDmessageFwdHeader; + +class MTPchannels_messageEditData; +class MTPDchannels_messageEditData; + // Boxed types definitions typedef MTPBoxed MTPResPQ; @@ -1395,6 +1407,8 @@ typedef MTPBoxed MTPBotInlineMessage; typedef MTPBoxed MTPBotInlineResult; typedef MTPBoxed MTPmessages_BotResults; typedef MTPBoxed MTPExportedMessageLink; +typedef MTPBoxed MTPMessageFwdHeader; +typedef MTPBoxed MTPchannels_MessageEditData; // Type classes definitions @@ -3518,7 +3532,7 @@ private: 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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); + 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 _date, const MTPMessageAction &_action); mtpTypeId _type; @@ -5432,6 +5446,18 @@ public: return *(const MTPDupdateBotInlineSend*)data; } + MTPDupdateEditChannelMessage &_updateEditChannelMessage() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateEditChannelMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateEditChannelMessage); + split(); + return *(MTPDupdateEditChannelMessage*)data; + } + const MTPDupdateEditChannelMessage &c_updateEditChannelMessage() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateEditChannelMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateEditChannelMessage); + return *(const MTPDupdateEditChannelMessage*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -5482,6 +5508,7 @@ private: explicit MTPupdate(MTPDupdateStickerSetsOrder *_data); explicit MTPupdate(MTPDupdateBotInlineQuery *_data); explicit MTPupdate(MTPDupdateBotInlineSend *_data); + explicit MTPupdate(MTPDupdateEditChannelMessage *_data); friend MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count); friend MTPupdate MTP_updateMessageID(MTPint _id, const MTPlong &_random_id); @@ -5526,6 +5553,7 @@ private: 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); mtpTypeId _type; }; @@ -5724,8 +5752,8 @@ private: 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, MTPint _via_bot_id, MTPint _reply_to_msg_id, const MTPVector &_entities); + 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); @@ -5906,7 +5934,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, const MTPVector &_disabled_features); + 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); }; typedef MTPBoxed MTPConfig; @@ -8994,6 +9022,68 @@ private: }; typedef MTPBoxed MTPExportedMessageLink; +class MTPmessageFwdHeader : private mtpDataOwner { +public: + MTPmessageFwdHeader(); + MTPmessageFwdHeader(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messageFwdHeader) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDmessageFwdHeader &_messageFwdHeader() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDmessageFwdHeader*)data; + } + const MTPDmessageFwdHeader &c_messageFwdHeader() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDmessageFwdHeader*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messageFwdHeader); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPmessageFwdHeader(MTPDmessageFwdHeader *_data); + + friend MTPmessageFwdHeader MTP_messageFwdHeader(MTPint _flags, MTPint _from_id, MTPint _date, MTPint _channel_id, MTPint _channel_post); +}; +typedef MTPBoxed MTPMessageFwdHeader; + +class MTPchannels_messageEditData : private mtpDataOwner { +public: + MTPchannels_messageEditData(); + MTPchannels_messageEditData(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_messageEditData) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDchannels_messageEditData &_channels_messageEditData() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDchannels_messageEditData*)data; + } + const MTPDchannels_messageEditData &c_channels_messageEditData() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDchannels_messageEditData*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_messageEditData); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPchannels_messageEditData(MTPDchannels_messageEditData *_data); + + friend MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags, MTPint _from_id, MTPint _edit_by, MTPint _edit_date, const MTPVector &_users); +}; +typedef MTPBoxed MTPchannels_MessageEditData; + // Type constructors with data class MTPDresPQ : public mtpDataImpl { @@ -9713,6 +9803,7 @@ public: 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), @@ -9734,6 +9825,7 @@ public: 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; } @@ -10038,16 +10130,14 @@ class MTPDmessage : public mtpDataImpl { public: MTPDmessage() { } - MTPDmessage(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vfwd_from_id(_fwd_from_id), vfwd_date(_fwd_date), vfwd_post(_fwd_post), 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) { + 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) { } MTPint vflags; MTPint vid; MTPint vfrom_id; MTPPeer vto_id; - MTPPeer vfwd_from_id; - MTPint vfwd_date; - MTPint vfwd_post; + MTPMessageFwdHeader vfwd_from; MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPint vdate; @@ -10056,6 +10146,7 @@ public: MTPReplyMarkup vreply_markup; MTPVector ventities; MTPint vviews; + MTPint vedit_date; enum { flag_unread = (1 << 0), @@ -10065,15 +10156,14 @@ public: flag_silent = (1 << 13), flag_post = (1 << 14), flag_from_id = (1 << 8), - flag_fwd_from_id = (1 << 2), - flag_fwd_date = (1 << 2), - flag_fwd_post = (1 << 12), + 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; } @@ -10083,15 +10173,14 @@ public: 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_id() const { return vflags.v & flag_fwd_from_id; } - bool has_fwd_date() const { return vflags.v & flag_fwd_date; } - bool has_fwd_post() const { return vflags.v & flag_fwd_post; } + 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 { @@ -10113,6 +10202,8 @@ public: 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), }; @@ -10120,6 +10211,8 @@ public: 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; } }; @@ -11218,6 +11311,18 @@ public: MTPstring vid; }; +class MTPDupdateEditChannelMessage : public mtpDataImpl { +public: + MTPDupdateEditChannelMessage() { + } + MTPDupdateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) : vmessage(_message), vpts(_pts), vpts_count(_pts_count) { + } + + MTPMessage vmessage; + MTPint vpts; + MTPint vpts_count; +}; + class MTPDupdates_state : public mtpDataImpl { public: MTPDupdates_state() { @@ -11277,7 +11382,7 @@ class MTPDupdateShortMessage : public mtpDataImpl { public: MTPDupdateShortMessage() { } - MTPDupdateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id(_fwd_from_id), vfwd_date(_fwd_date), vfwd_post(_fwd_post), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { + 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) { } MTPint vflags; @@ -11287,9 +11392,7 @@ public: MTPint vpts; MTPint vpts_count; MTPint vdate; - MTPPeer vfwd_from_id; - MTPint vfwd_date; - MTPint vfwd_post; + MTPMessageFwdHeader vfwd_from; MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPVector ventities; @@ -11300,9 +11403,7 @@ public: flag_mentioned = (1 << 4), flag_media_unread = (1 << 5), flag_silent = (1 << 13), - flag_fwd_from_id = (1 << 2), - flag_fwd_date = (1 << 2), - flag_fwd_post = (1 << 12), + flag_fwd_from = (1 << 2), flag_via_bot_id = (1 << 11), flag_reply_to_msg_id = (1 << 3), flag_entities = (1 << 7), @@ -11313,9 +11414,7 @@ public: 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_id() const { return vflags.v & flag_fwd_from_id; } - bool has_fwd_date() const { return vflags.v & flag_fwd_date; } - bool has_fwd_post() const { return vflags.v & flag_fwd_post; } + 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; } @@ -11325,7 +11424,7 @@ class MTPDupdateShortChatMessage : public mtpDataImpl &_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_id(_fwd_from_id), vfwd_date(_fwd_date), vfwd_post(_fwd_post), vvia_bot_id(_via_bot_id), vreply_to_msg_id(_reply_to_msg_id), ventities(_entities) { + 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) { } MTPint vflags; @@ -11336,9 +11435,7 @@ public: MTPint vpts; MTPint vpts_count; MTPint vdate; - MTPPeer vfwd_from_id; - MTPint vfwd_date; - MTPint vfwd_post; + MTPMessageFwdHeader vfwd_from; MTPint vvia_bot_id; MTPint vreply_to_msg_id; MTPVector ventities; @@ -11349,9 +11446,7 @@ public: flag_mentioned = (1 << 4), flag_media_unread = (1 << 5), flag_silent = (1 << 13), - flag_fwd_from_id = (1 << 2), - flag_fwd_date = (1 << 2), - flag_fwd_post = (1 << 12), + flag_fwd_from = (1 << 2), flag_via_bot_id = (1 << 11), flag_reply_to_msg_id = (1 << 3), flag_entities = (1 << 7), @@ -11362,9 +11457,7 @@ public: 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_id() const { return vflags.v & flag_fwd_from_id; } - bool has_fwd_date() const { return vflags.v & flag_fwd_date; } - bool has_fwd_post() const { return vflags.v & flag_fwd_post; } + 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; } @@ -11511,7 +11604,7 @@ class MTPDconfig : public mtpDataImpl { public: MTPDconfig() { } - MTPDconfig(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, const MTPVector &_disabled_features) : vdate(_date), vexpires(_expires), vtest_mode(_test_mode), vthis_dc(_this_dc), vdc_options(_dc_options), vchat_size_max(_chat_size_max), vmegagroup_size_max(_megagroup_size_max), vforwarded_count_max(_forwarded_count_max), vonline_update_period_ms(_online_update_period_ms), voffline_blur_timeout_ms(_offline_blur_timeout_ms), voffline_idle_timeout_ms(_offline_idle_timeout_ms), vonline_cloud_timeout_ms(_online_cloud_timeout_ms), vnotify_cloud_delay_ms(_notify_cloud_delay_ms), vnotify_default_delay_ms(_notify_default_delay_ms), vchat_big_size(_chat_big_size), vpush_chat_period_ms(_push_chat_period_ms), vpush_chat_limit(_push_chat_limit), vsaved_gifs_limit(_saved_gifs_limit), vdisabled_features(_disabled_features) { + MTPDconfig(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) : vdate(_date), vexpires(_expires), vtest_mode(_test_mode), vthis_dc(_this_dc), vdc_options(_dc_options), vchat_size_max(_chat_size_max), vmegagroup_size_max(_megagroup_size_max), vforwarded_count_max(_forwarded_count_max), vonline_update_period_ms(_online_update_period_ms), voffline_blur_timeout_ms(_offline_blur_timeout_ms), voffline_idle_timeout_ms(_offline_idle_timeout_ms), vonline_cloud_timeout_ms(_online_cloud_timeout_ms), vnotify_cloud_delay_ms(_notify_cloud_delay_ms), vnotify_default_delay_ms(_notify_default_delay_ms), vchat_big_size(_chat_big_size), vpush_chat_period_ms(_push_chat_period_ms), vpush_chat_limit(_push_chat_limit), vsaved_gifs_limit(_saved_gifs_limit), vedit_time_limit(_edit_time_limit), vdisabled_features(_disabled_features) { } MTPint vdate; @@ -11532,6 +11625,7 @@ public: MTPint vpush_chat_period_ms; MTPint vpush_chat_limit; MTPint vsaved_gifs_limit; + MTPint vedit_time_limit; MTPVector vdisabled_features; }; @@ -13092,6 +13186,54 @@ public: MTPstring vlink; }; +class MTPDmessageFwdHeader : public mtpDataImpl { +public: + 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) { + } + + MTPint 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: + MTPDchannels_messageEditData() { + } + MTPDchannels_messageEditData(MTPint _flags, MTPint _from_id, MTPint _edit_by, MTPint _edit_date, const MTPVector &_users) : vflags(_flags), vfrom_id(_from_id), vedit_by(_edit_by), vedit_date(_edit_date), vusers(_users) { + } + + MTPint vflags; + MTPint vfrom_id; + MTPint vedit_by; + MTPint vedit_date; + MTPVector vusers; + + enum { + flag_caption = (1 << 1), + flag_edit_by = (1 << 0), + flag_edit_date = (1 << 0), + }; + + bool is_caption() const { return vflags.v & flag_caption; } + bool has_edit_by() const { return vflags.v & flag_edit_by; } + bool has_edit_date() const { return vflags.v & flag_edit_date; } +}; + // RPC methods class MTPreq_pq { // RPC method 'req_pq' @@ -20294,6 +20436,107 @@ public: } }; +class MTPchannels_getMessageEditData { // RPC method 'channels.getMessageEditData' +public: + MTPInputChannel vchannel; + MTPint vid; + + MTPchannels_getMessageEditData() { + } + MTPchannels_getMessageEditData(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_getMessageEditData) { + read(from, end, cons); + } + MTPchannels_getMessageEditData(const MTPInputChannel &_channel, MTPint _id) : vchannel(_channel), vid(_id) { + } + + uint32 innerLength() const { + return vchannel.innerLength() + vid.innerLength(); + } + mtpTypeId type() const { + return mtpc_channels_getMessageEditData; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_getMessageEditData) { + vchannel.read(from, end); + vid.read(from, end); + } + void write(mtpBuffer &to) const { + vchannel.write(to); + vid.write(to); + } + + typedef MTPchannels_MessageEditData ResponseType; +}; +class MTPchannels_GetMessageEditData : public MTPBoxed { +public: + MTPchannels_GetMessageEditData() { + } + MTPchannels_GetMessageEditData(const MTPchannels_getMessageEditData &v) : MTPBoxed(v) { + } + MTPchannels_GetMessageEditData(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPchannels_GetMessageEditData(const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_getMessageEditData(_channel, _id)) { + } +}; + +class MTPchannels_editMessage { // RPC method 'channels.editMessage' +public: + MTPint vflags; + MTPInputChannel vchannel; + MTPint vid; + MTPstring vmessage; + MTPVector ventities; + + MTPchannels_editMessage() { + } + 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) { + } + + 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); + } + mtpTypeId type() const { + return mtpc_channels_editMessage; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_editMessage) { + vflags.read(from, end); + vchannel.read(from, end); + vid.read(from, end); + vmessage.read(from, end); + if (has_entities()) { ventities.read(from, end); } else { ventities = MTPVector(); } + } + void write(mtpBuffer &to) const { + vflags.write(to); + vchannel.write(to); + vid.write(to); + vmessage.write(to); + if (has_entities()) ventities.write(to); + } + + typedef MTPUpdates ResponseType; +}; +class MTPchannels_EditMessage : public MTPBoxed { +public: + MTPchannels_EditMessage() { + } + MTPchannels_EditMessage(const MTPchannels_editMessage &v) : MTPBoxed(v) { + } + 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)) { + } +}; + // Inline methods definition inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { @@ -23046,7 +23289,7 @@ inline uint32 MTPmessage::innerLength() const { } case mtpc_message: { const MTPDmessage &v(c_message()); - return v.vflags.innerLength() + v.vid.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vto_id.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_fwd_post() ? v.vfwd_post.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vmessage.innerLength() + (v.has_media() ? v.vmedia.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0) + (v.has_views() ? v.vviews.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vto_id.innerLength() + (v.has_fwd_from() ? v.vfwd_from.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vmessage.innerLength() + (v.has_media() ? v.vmedia.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0) + (v.has_views() ? v.vviews.innerLength() : 0) + (v.has_edit_date() ? v.vedit_date.innerLength() : 0); } case mtpc_messageService: { const MTPDmessageService &v(c_messageService()); @@ -23074,9 +23317,7 @@ inline void MTPmessage::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vid.read(from, end); if (v.has_from_id()) { v.vfrom_id.read(from, end); } else { v.vfrom_id = MTPint(); } v.vto_id.read(from, end); - if (v.has_fwd_from_id()) { v.vfwd_from_id.read(from, end); } else { v.vfwd_from_id = MTPPeer(); } - if (v.has_fwd_date()) { v.vfwd_date.read(from, end); } else { v.vfwd_date = MTPint(); } - if (v.has_fwd_post()) { v.vfwd_post.read(from, end); } else { v.vfwd_post = MTPint(); } + if (v.has_fwd_from()) { v.vfwd_from.read(from, end); } else { v.vfwd_from = MTPMessageFwdHeader(); } if (v.has_via_bot_id()) { v.vvia_bot_id.read(from, end); } else { v.vvia_bot_id = MTPint(); } if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } v.vdate.read(from, end); @@ -23085,6 +23326,7 @@ inline void MTPmessage::read(const mtpPrime *&from, const mtpPrime *end, mtpType if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } if (v.has_views()) { v.vviews.read(from, end); } else { v.vviews = MTPint(); } + if (v.has_edit_date()) { v.vedit_date.read(from, end); } else { v.vedit_date = MTPint(); } } break; case mtpc_messageService: _type = cons; { if (!data) setData(new MTPDmessageService()); @@ -23111,9 +23353,7 @@ inline void MTPmessage::write(mtpBuffer &to) const { v.vid.write(to); if (v.has_from_id()) v.vfrom_id.write(to); v.vto_id.write(to); - if (v.has_fwd_from_id()) v.vfwd_from_id.write(to); - if (v.has_fwd_date()) v.vfwd_date.write(to); - if (v.has_fwd_post()) v.vfwd_post.write(to); + if (v.has_fwd_from()) v.vfwd_from.write(to); if (v.has_via_bot_id()) v.vvia_bot_id.write(to); if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); v.vdate.write(to); @@ -23122,6 +23362,7 @@ inline void MTPmessage::write(mtpBuffer &to) const { if (v.has_reply_markup()) v.vreply_markup.write(to); if (v.has_entities()) v.ventities.write(to); if (v.has_views()) v.vviews.write(to); + if (v.has_edit_date()) v.vedit_date.write(to); } break; case mtpc_messageService: { const MTPDmessageService &v(c_messageService()); @@ -23151,8 +23392,8 @@ inline MTPmessage::MTPmessage(MTPDmessageService *_data) : mtpDataOwner(_data), inline MTPmessage MTP_messageEmpty(MTPint _id) { return MTPmessage(new MTPDmessageEmpty(_id)); } -inline MTPmessage MTP_message(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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) { - return MTPmessage(new MTPDmessage(_flags, _id, _from_id, _to_id, _fwd_from_id, _fwd_date, _fwd_post, _via_bot_id, _reply_to_msg_id, _date, _message, _media, _reply_markup, _entities, _views)); +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)); } inline MTPmessage MTP_messageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _date, const MTPMessageAction &_action) { return MTPmessage(new MTPDmessageService(_flags, _id, _from_id, _to_id, _date, _action)); @@ -25184,6 +25425,10 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateBotInlineSend &v(c_updateBotInlineSend()); return v.vuser_id.innerLength() + v.vquery.innerLength() + v.vid.innerLength(); } + case mtpc_updateEditChannelMessage: { + const MTPDupdateEditChannelMessage &v(c_updateEditChannelMessage()); + return v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength(); + } } return 0; } @@ -25468,6 +25713,13 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vquery.read(from, end); v.vid.read(from, end); } break; + case mtpc_updateEditChannelMessage: _type = cons; { + if (!data) setData(new MTPDupdateEditChannelMessage()); + MTPDupdateEditChannelMessage &v(_updateEditChannelMessage()); + v.vmessage.read(from, end); + v.vpts.read(from, end); + v.vpts_count.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPupdate"); } } @@ -25704,6 +25956,12 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vquery.write(to); v.vid.write(to); } break; + case mtpc_updateEditChannelMessage: { + const MTPDupdateEditChannelMessage &v(c_updateEditChannelMessage()); + v.vmessage.write(to); + v.vpts.write(to); + v.vpts_count.write(to); + } break; } } inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -25751,6 +26009,7 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateSavedGifs: break; case mtpc_updateBotInlineQuery: setData(new MTPDupdateBotInlineQuery()); break; case mtpc_updateBotInlineSend: setData(new MTPDupdateBotInlineSend()); break; + case mtpc_updateEditChannelMessage: setData(new MTPDupdateEditChannelMessage()); break; default: throw mtpErrorBadTypeId(type, "MTPupdate"); } } @@ -25836,6 +26095,8 @@ inline MTPupdate::MTPupdate(MTPDupdateBotInlineQuery *_data) : mtpDataOwner(_dat } inline MTPupdate::MTPupdate(MTPDupdateBotInlineSend *_data) : mtpDataOwner(_data), _type(mtpc_updateBotInlineSend) { } +inline MTPupdate::MTPupdate(MTPDupdateEditChannelMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateEditChannelMessage) { +} inline MTPupdate MTP_updateNewMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateNewMessage(_message, _pts, _pts_count)); } @@ -25965,6 +26226,9 @@ inline MTPupdate MTP_updateBotInlineQuery(const MTPlong &_query_id, MTPint _user inline MTPupdate MTP_updateBotInlineSend(MTPint _user_id, const MTPstring &_query, const MTPstring &_id) { return MTPupdate(new MTPDupdateBotInlineSend(_user_id, _query, _id)); } +inline MTPupdate MTP_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { + return MTPupdate(new MTPDupdateEditChannelMessage(_message, _pts, _pts_count)); +} inline MTPupdates_state::MTPupdates_state() : mtpDataOwner(new MTPDupdates_state()) { } @@ -26109,11 +26373,11 @@ inline uint32 MTPupdates::innerLength() const { switch (_type) { case mtpc_updateShortMessage: { const MTPDupdateShortMessage &v(c_updateShortMessage()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vuser_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_fwd_post() ? v.vfwd_post.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vuser_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from() ? v.vfwd_from.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); } case mtpc_updateShortChatMessage: { const MTPDupdateShortChatMessage &v(c_updateShortChatMessage()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vchat_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_fwd_post() ? v.vfwd_post.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vchat_id.innerLength() + v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_fwd_from() ? v.vfwd_from.innerLength() : 0) + (v.has_via_bot_id() ? v.vvia_bot_id.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); } case mtpc_updateShort: { const MTPDupdateShort &v(c_updateShort()); @@ -26152,9 +26416,7 @@ inline void MTPupdates::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vpts.read(from, end); v.vpts_count.read(from, end); v.vdate.read(from, end); - if (v.has_fwd_from_id()) { v.vfwd_from_id.read(from, end); } else { v.vfwd_from_id = MTPPeer(); } - if (v.has_fwd_date()) { v.vfwd_date.read(from, end); } else { v.vfwd_date = MTPint(); } - if (v.has_fwd_post()) { v.vfwd_post.read(from, end); } else { v.vfwd_post = MTPint(); } + if (v.has_fwd_from()) { v.vfwd_from.read(from, end); } else { v.vfwd_from = MTPMessageFwdHeader(); } if (v.has_via_bot_id()) { v.vvia_bot_id.read(from, end); } else { v.vvia_bot_id = MTPint(); } if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } @@ -26170,9 +26432,7 @@ inline void MTPupdates::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vpts.read(from, end); v.vpts_count.read(from, end); v.vdate.read(from, end); - if (v.has_fwd_from_id()) { v.vfwd_from_id.read(from, end); } else { v.vfwd_from_id = MTPPeer(); } - if (v.has_fwd_date()) { v.vfwd_date.read(from, end); } else { v.vfwd_date = MTPint(); } - if (v.has_fwd_post()) { v.vfwd_post.read(from, end); } else { v.vfwd_post = MTPint(); } + if (v.has_fwd_from()) { v.vfwd_from.read(from, end); } else { v.vfwd_from = MTPMessageFwdHeader(); } if (v.has_via_bot_id()) { v.vvia_bot_id.read(from, end); } else { v.vvia_bot_id = MTPint(); } if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } @@ -26227,9 +26487,7 @@ inline void MTPupdates::write(mtpBuffer &to) const { v.vpts.write(to); v.vpts_count.write(to); v.vdate.write(to); - if (v.has_fwd_from_id()) v.vfwd_from_id.write(to); - if (v.has_fwd_date()) v.vfwd_date.write(to); - if (v.has_fwd_post()) v.vfwd_post.write(to); + if (v.has_fwd_from()) v.vfwd_from.write(to); if (v.has_via_bot_id()) v.vvia_bot_id.write(to); if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); if (v.has_entities()) v.ventities.write(to); @@ -26244,9 +26502,7 @@ inline void MTPupdates::write(mtpBuffer &to) const { v.vpts.write(to); v.vpts_count.write(to); v.vdate.write(to); - if (v.has_fwd_from_id()) v.vfwd_from_id.write(to); - if (v.has_fwd_date()) v.vfwd_date.write(to); - if (v.has_fwd_post()) v.vfwd_post.write(to); + if (v.has_fwd_from()) v.vfwd_from.write(to); if (v.has_via_bot_id()) v.vvia_bot_id.write(to); if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); if (v.has_entities()) v.ventities.write(to); @@ -26312,11 +26568,11 @@ inline MTPupdates::MTPupdates(MTPDupdateShortSentMessage *_data) : mtpDataOwner( inline MTPupdates MTP_updatesTooLong() { return MTPupdates(mtpc_updatesTooLong); } -inline MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id, _fwd_date, _fwd_post, _via_bot_id, _reply_to_msg_id, _entities)); +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)); } -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 MTPPeer &_fwd_from_id, MTPint _fwd_date, MTPint _fwd_post, 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_id, _fwd_date, _fwd_post, _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)); } inline MTPupdates MTP_updateShort(const MTPUpdate &_update, MTPint _date) { return MTPupdates(new MTPDupdateShort(_update, _date)); @@ -26498,7 +26754,7 @@ inline MTPconfig::MTPconfig() : mtpDataOwner(new MTPDconfig()) { inline uint32 MTPconfig::innerLength() const { const MTPDconfig &v(c_config()); - return v.vdate.innerLength() + v.vexpires.innerLength() + v.vtest_mode.innerLength() + v.vthis_dc.innerLength() + v.vdc_options.innerLength() + v.vchat_size_max.innerLength() + v.vmegagroup_size_max.innerLength() + v.vforwarded_count_max.innerLength() + v.vonline_update_period_ms.innerLength() + v.voffline_blur_timeout_ms.innerLength() + v.voffline_idle_timeout_ms.innerLength() + v.vonline_cloud_timeout_ms.innerLength() + v.vnotify_cloud_delay_ms.innerLength() + v.vnotify_default_delay_ms.innerLength() + v.vchat_big_size.innerLength() + v.vpush_chat_period_ms.innerLength() + v.vpush_chat_limit.innerLength() + v.vsaved_gifs_limit.innerLength() + v.vdisabled_features.innerLength(); + return v.vdate.innerLength() + v.vexpires.innerLength() + v.vtest_mode.innerLength() + v.vthis_dc.innerLength() + v.vdc_options.innerLength() + v.vchat_size_max.innerLength() + v.vmegagroup_size_max.innerLength() + v.vforwarded_count_max.innerLength() + v.vonline_update_period_ms.innerLength() + v.voffline_blur_timeout_ms.innerLength() + v.voffline_idle_timeout_ms.innerLength() + v.vonline_cloud_timeout_ms.innerLength() + v.vnotify_cloud_delay_ms.innerLength() + v.vnotify_default_delay_ms.innerLength() + v.vchat_big_size.innerLength() + v.vpush_chat_period_ms.innerLength() + v.vpush_chat_limit.innerLength() + v.vsaved_gifs_limit.innerLength() + v.vedit_time_limit.innerLength() + v.vdisabled_features.innerLength(); } inline mtpTypeId MTPconfig::type() const { return mtpc_config; @@ -26526,6 +26782,7 @@ inline void MTPconfig::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vpush_chat_period_ms.read(from, end); v.vpush_chat_limit.read(from, end); v.vsaved_gifs_limit.read(from, end); + v.vedit_time_limit.read(from, end); v.vdisabled_features.read(from, end); } inline void MTPconfig::write(mtpBuffer &to) const { @@ -26548,12 +26805,13 @@ inline void MTPconfig::write(mtpBuffer &to) const { v.vpush_chat_period_ms.write(to); v.vpush_chat_limit.write(to); v.vsaved_gifs_limit.write(to); + v.vedit_time_limit.write(to); v.vdisabled_features.write(to); } 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, 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, _disabled_features)); +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)); } inline MTPnearestDc::MTPnearestDc() : mtpDataOwner(new MTPDnearestDc()) { @@ -30611,5 +30869,75 @@ inline MTPexportedMessageLink MTP_exportedMessageLink(const MTPstring &_link) { return MTPexportedMessageLink(new MTPDexportedMessageLink(_link)); } +inline MTPmessageFwdHeader::MTPmessageFwdHeader() : mtpDataOwner(new MTPDmessageFwdHeader()) { +} + +inline uint32 MTPmessageFwdHeader::innerLength() const { + const MTPDmessageFwdHeader &v(c_messageFwdHeader()); + return v.vflags.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vdate.innerLength() + (v.has_channel_id() ? v.vchannel_id.innerLength() : 0) + (v.has_channel_post() ? v.vchannel_post.innerLength() : 0); +} +inline mtpTypeId MTPmessageFwdHeader::type() const { + return mtpc_messageFwdHeader; +} +inline void MTPmessageFwdHeader::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_messageFwdHeader) throw mtpErrorUnexpected(cons, "MTPmessageFwdHeader"); + + if (!data) setData(new MTPDmessageFwdHeader()); + MTPDmessageFwdHeader &v(_messageFwdHeader()); + v.vflags.read(from, end); + if (v.has_from_id()) { v.vfrom_id.read(from, end); } else { v.vfrom_id = MTPint(); } + v.vdate.read(from, end); + if (v.has_channel_id()) { v.vchannel_id.read(from, end); } else { v.vchannel_id = MTPint(); } + if (v.has_channel_post()) { v.vchannel_post.read(from, end); } else { v.vchannel_post = MTPint(); } +} +inline void MTPmessageFwdHeader::write(mtpBuffer &to) const { + const MTPDmessageFwdHeader &v(c_messageFwdHeader()); + v.vflags.write(to); + if (v.has_from_id()) v.vfrom_id.write(to); + v.vdate.write(to); + if (v.has_channel_id()) v.vchannel_id.write(to); + if (v.has_channel_post()) v.vchannel_post.write(to); +} +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)); +} + +inline MTPchannels_messageEditData::MTPchannels_messageEditData() : mtpDataOwner(new MTPDchannels_messageEditData()) { +} + +inline uint32 MTPchannels_messageEditData::innerLength() const { + const MTPDchannels_messageEditData &v(c_channels_messageEditData()); + return v.vflags.innerLength() + v.vfrom_id.innerLength() + (v.has_edit_by() ? v.vedit_by.innerLength() : 0) + (v.has_edit_date() ? v.vedit_date.innerLength() : 0) + v.vusers.innerLength(); +} +inline mtpTypeId MTPchannels_messageEditData::type() const { + return mtpc_channels_messageEditData; +} +inline void MTPchannels_messageEditData::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_channels_messageEditData) throw mtpErrorUnexpected(cons, "MTPchannels_messageEditData"); + + if (!data) setData(new MTPDchannels_messageEditData()); + MTPDchannels_messageEditData &v(_channels_messageEditData()); + v.vflags.read(from, end); + v.vfrom_id.read(from, end); + if (v.has_edit_by()) { v.vedit_by.read(from, end); } else { v.vedit_by = MTPint(); } + if (v.has_edit_date()) { v.vedit_date.read(from, end); } else { v.vedit_date = MTPint(); } + v.vusers.read(from, end); +} +inline void MTPchannels_messageEditData::write(mtpBuffer &to) const { + const MTPDchannels_messageEditData &v(c_channels_messageEditData()); + v.vflags.write(to); + v.vfrom_id.write(to); + if (v.has_edit_by()) v.vedit_by.write(to); + if (v.has_edit_date()) v.vedit_date.write(to); + v.vusers.write(to); +} +inline MTPchannels_messageEditData::MTPchannels_messageEditData(MTPDchannels_messageEditData *_data) : mtpDataOwner(_data) { +} +inline MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags, MTPint _from_id, MTPint _edit_by, MTPint _edit_date, const MTPVector &_users) { + return MTPchannels_messageEditData(new MTPDchannels_messageEditData(_flags, _from_id, _edit_by, _edit_date, _users)); +} + // 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/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 8c3a8a5dda..94df0ec3e7 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -194,7 +194,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation; userEmpty#200250ba id:int = User; -user#d10d979a flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string = User; +user#d10d979a flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?string bot_inline_placeholder:flags.19?string = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto; @@ -226,8 +226,8 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto; messageEmpty#83e5de54 id:int = Message; -message#ef11cef6 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int fwd_post:flags.12?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int = Message; -messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message; +message#c09be45f flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int edit_date:flags.15?int = Message; +messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message; messageMediaEmpty#3ded6320 = MessageMedia; messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia; @@ -383,6 +383,7 @@ updateStickerSets#43ae3dec = Update; updateSavedGifs#9375341e = Update; updateBotInlineQuery#c01eea08 query_id:long user_id:int query:string offset:string = Update; updateBotInlineSend#f69e113 user_id:int query:string id:string = Update; +updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -391,8 +392,8 @@ updates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Ve updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference; updatesTooLong#e317af7e = Updates; -updateShortMessage#3afbe9d1 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int fwd_post:flags.12?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; -updateShortChatMessage#ca2ef195 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int fwd_post:flags.12?int via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; +updateShortMessage#914fbf11 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; +updateShortChatMessage#16812688 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int entities:flags.7?Vector = Updates; updateShort#78d4dec1 update:Update date:int = Updates; updatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates; updates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates; @@ -407,7 +408,7 @@ upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File; dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true id:int ip_address:string port:int = DcOption; -config#6bbc5f8 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int disabled_features:Vector = Config; +config#317ceef4 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int disabled_features:Vector = Config; nearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc; @@ -641,6 +642,10 @@ messages.botResults#1170b0a3 flags:# gallery:flags.0?true query_id:long next_off exportedMessageLink#1f486803 link:string = ExportedMessageLink; +messageFwdHeader#c786ddcb flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int = MessageFwdHeader; + +channels.messageEditData#b86fd3cf flags:# caption:flags.1?true from_id:int edit_by:flags.0?int edit_date:flags.0?int users:Vector = channels.MessageEditData; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -814,3 +819,5 @@ channels.deleteChannel#c0111fe3 channel:InputChannel = Updates; channels.toggleInvites#49609307 channel:InputChannel enabled:Bool = Updates; channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessageLink; channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; +channels.getMessageEditData#27ea3a28 channel:InputChannel id:int = channels.MessageEditData; +channels.editMessage#dcda80ed flags:# no_webpage:flags.1?true channel:InputChannel id:int message:string entities:flags.3?Vector = Updates; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 665ed2b668..19f23036c7 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -72,7 +72,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData , _photoOver(false) // migrate to megagroup -, _showMigrate(_peerChat && _amCreator && !_peerChat->isMigrated() && _peerChat->count >= cMaxGroupCount()) +, _showMigrate(_peerChat && _amCreator && !_peerChat->isMigrated() && _peerChat->count >= Global::ChatSizeMax()) , _forceShowMigrate(false) , _aboutMigrate(st::normalFont, lang(lng_profile_migrate_about), _defaultOptions, st::wndMinWidth - st::profilePadding.left() - st::profilePadding.right()) , _migrate(this, lang(lng_profile_migrate_button), st::btnMigrateToMega) @@ -537,7 +537,7 @@ void ProfileInner::onFullPeerUpdated(PeerData *peer) { } } else if (_peerChat) { updateInvitationLink(); - _showMigrate = (_peerChat && _amCreator && !_peerChat->isMigrated() && (_forceShowMigrate || _peerChat->count >= cMaxGroupCount())); + _showMigrate = (_peerChat && _amCreator && !_peerChat->isMigrated() && (_forceShowMigrate || _peerChat->count >= Global::ChatSizeMax())); showAll(); resizeEvent(0); _admins.setText(lng_channel_admins_link(lt_count, _peerChat->adminsEnabled() ? (_peerChat->admins.size() + 1) : 0)); @@ -597,7 +597,7 @@ void ProfileInner::peerUpdated(PeerData *data) { } else if (_peerChat) { if (_peerChat->photoId && _peerChat->photoId != UnknownPeerPhotoId) photo = App::photo(_peerChat->photoId); _admins.setText(lng_channel_admins_link(lt_count, _peerChat->adminsEnabled() ? (_peerChat->admins.size() + 1) : 0)); - _showMigrate = (_peerChat && _amCreator && !_peerChat->isMigrated() && (_forceShowMigrate || _peerChat->count >= cMaxGroupCount())); + _showMigrate = (_peerChat && _amCreator && !_peerChat->isMigrated() && (_forceShowMigrate || _peerChat->count >= Global::ChatSizeMax())); if (App::main()) App::main()->topBar()->showAll(); } else if (_peerChannel) { if (_peerChannel->photoId && _peerChannel->photoId != UnknownPeerPhotoId) photo = App::photo(_peerChannel->photoId); @@ -838,13 +838,13 @@ void ProfileInner::paintEvent(QPaintEvent *e) { if (_showMigrate) { p.setFont(st::profileHeaderFont->f); p.setPen(st::profileHeaderColor->p); - p.drawText(_left + st::profileHeaderLeft, top + st::profileHeaderTop + st::profileHeaderFont->ascent, lng_profile_migrate_reached(lt_count, cMaxGroupCount())); + p.drawText(_left + st::profileHeaderLeft, top + st::profileHeaderTop + st::profileHeaderFont->ascent, lng_profile_migrate_reached(lt_count, Global::ChatSizeMax())); top += st::profileHeaderSkip; _aboutMigrate.draw(p, _left, top, _width); top += _aboutMigrate.countHeight(_width) + st::setLittleSkip; p.setFont(st::normalFont); p.setPen(st::black); - p.drawText(_left, top + st::normalFont->ascent, lng_profile_migrate_feature1(lt_count, cMaxMegaGroupCount())); top += st::normalFont->height + st::setLittleSkip; + p.drawText(_left, top + st::normalFont->ascent, lng_profile_migrate_feature1(lt_count, Global::MegagroupSizeMax())); top += st::normalFont->height + st::setLittleSkip; p.drawText(_left, top + st::normalFont->ascent, lang(lng_profile_migrate_feature2)); top += st::normalFont->height + st::setLittleSkip; p.drawText(_left, top + st::normalFont->ascent, lang(lng_profile_migrate_feature3)); top += st::normalFont->height + st::setLittleSkip; p.drawText(_left, top + st::normalFont->ascent, lang(lng_profile_migrate_feature4)); top += st::normalFont->height + st::setSectionSkip; @@ -1296,7 +1296,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { top += st::profileButtonTop; _uploadPhoto.setGeometry(_left, top, btnWidth, _uploadPhoto.height()); - if (_peerChannel && _peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && !_amCreator && !_peerChannel->amEditor() && _peerChannel->canAddParticipants()) { + if (_peerChannel && _peerChannel->count < Global::MegagroupSizeMax() && _peerChannel->isMegagroup() && !_amCreator && !_peerChannel->amEditor() && _peerChannel->canAddParticipants()) { _addParticipant.setGeometry(_left, top, btnWidth, _addParticipant.height()); } else { _addParticipant.setGeometry(_left + _width - btnWidth, top, btnWidth, _addParticipant.height()); @@ -1592,7 +1592,7 @@ void ProfileInner::showAll() { _createInvitationLink.hide(); _invitationLink.hide(); } - if (_peerChat->count < cMaxGroupCount() && !_showMigrate) { + if (_peerChat->count < Global::ChatSizeMax() && !_showMigrate) { _addParticipant.show(); } else { _addParticipant.hide(); @@ -1640,7 +1640,7 @@ void ProfileInner::showAll() { _invitationLink.hide(); } } - if (_peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && _peerChannel->canAddParticipants()) { + if (_peerChannel->count < Global::MegagroupSizeMax() && _peerChannel->isMegagroup() && _peerChannel->canAddParticipants()) { _addParticipant.show(); } else { _addParticipant.hide(); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index bd6578eb76..c98fe4a55d 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -74,8 +74,6 @@ bool gRestartingUpdate = false, gRestarting = false, gRestartingToSettings = fal int32 gLastUpdateCheck = 0; bool gNoStartUpdate = false; bool gStartToSettings = false; -int32 gMaxGroupCount = 200; -int32 gMaxMegaGroupCount = 500; DBIDefaultAttach gDefaultAttach = dbidaDocument; bool gReplaceEmojis = true; bool gAskDownloadPath = false; @@ -119,7 +117,6 @@ uint64 gLastStickersUpdate = 0; SavedGifs gSavedGifs; uint64 gLastSavedGifsUpdate = 0; bool gShowingSavedGifs = false; -int32 gSavedGifsLimit = 100; RecentHashtagPack gRecentWriteHashtags, gRecentSearchHashtags; @@ -155,14 +152,6 @@ bool gIsElCapitan = false; bool gContactsReceived = false; bool gDialogsReceived = false; -int gOnlineUpdatePeriod = 120000; -int gOfflineBlurTimeout = 5000; -int gOfflineIdleTimeout = 30000; -int gOnlineFocusTimeout = 1000; -int gOnlineCloudTimeout = 300000; -int gNotifyCloudDelay = 30000; -int gNotifyDefaultDelay = 1500; - int gOtherOnline = 0; float64 gSongVolume = 0.9; @@ -185,7 +174,7 @@ void settingsParseArgs(int argc, char *argv[]) { gPlatform = dbipMacOld; } #endif - + switch (cPlatform()) { case dbipWindows: gUpdateURL = QUrl(qsl("http://tdesktop.com/win/tupdates/current")); diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index dc4adaaa64..b57a6b4f15 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -140,8 +140,6 @@ DeclareSetting(bool, WriteProtected); DeclareSetting(int32, LastUpdateCheck); DeclareSetting(bool, NoStartUpdate); DeclareSetting(bool, StartToSettings); -DeclareSetting(int32, MaxGroupCount); -DeclareSetting(int32, MaxMegaGroupCount); DeclareSetting(bool, ReplaceEmojis); DeclareReadSetting(bool, ManyInstance); DeclareSetting(bool, AskDownloadPath); @@ -240,7 +238,6 @@ typedef QVector SavedGifs; DeclareRefSetting(SavedGifs, SavedGifs); DeclareSetting(uint64, LastSavedGifsUpdate); DeclareSetting(bool, ShowingSavedGifs); -DeclareSetting(int32, SavedGifsLimit); typedef QList > RecentHashtagPack; DeclareRefSetting(RecentHashtagPack, RecentWriteHashtags); @@ -324,14 +321,6 @@ DeclareReadSetting(QUrl, UpdateURL); DeclareSetting(bool, ContactsReceived); DeclareSetting(bool, DialogsReceived); -DeclareSetting(int, OnlineUpdatePeriod); -DeclareSetting(int, OfflineBlurTimeout); -DeclareSetting(int, OfflineIdleTimeout); -DeclareSetting(int, OnlineFocusTimeout); -DeclareSetting(int, OnlineCloudTimeout); -DeclareSetting(int, NotifyCloudDelay); -DeclareSetting(int, NotifyDefaultDelay); - DeclareSetting(int, OtherOnline); DeclareSetting(float64, SongVolume); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 1c05b266ab..0ce99caad2 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -98,15 +98,15 @@ ImagePtr channelDefPhoto(int32 index) { NotifySettings globalNotifyAll, globalNotifyUsers, globalNotifyChats; NotifySettingsPtr globalNotifyAllPtr = UnknownNotifySettings, globalNotifyUsersPtr = UnknownNotifySettings, globalNotifyChatsPtr = UnknownNotifySettings; -PeerData::PeerData(const PeerId &id) : id(id), lnk(new PeerLink(this)) +PeerData::PeerData(const PeerId &id) : id(id) +, lnk(new PeerLink(this)) , 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) { if (!peerIsUser(id) && !peerIsChannel(id)) updateName(QString(), QString(), QString()); } diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index b93bf822d3..2e983d5706 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -305,7 +305,7 @@ enum DataBlockId { dbiKey = 0x00, dbiUser = 0x01, dbiDcOptionOld = 0x02, - dbiMaxGroupCount = 0x03, + dbiChatSizeMax = 0x03, dbiMutePeer = 0x04, dbiSendKey = 0x05, dbiAutoStart = 0x06, @@ -346,7 +346,7 @@ enum DataBlockId { dbiSongVolume = 0x29, dbiWindowsNotifications = 0x30, dbiIncludeMuted = 0x31, - dbiMaxMegaGroupCount = 0x32, + dbiMegagroupSizeMax = 0x32, dbiDownloadPath = 0x33, dbiAutoDownload = 0x34, dbiSavedGifsLimit = 0x35, diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 83679b68de..24c24101f5 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -435,7 +435,7 @@ void Window::onInactiveTimer() { void Window::stateChanged(Qt::WindowState state) { psUserActionDone(); - updateIsActive((state == Qt::WindowMinimized) ? cOfflineBlurTimeout() : cOnlineFocusTimeout()); + updateIsActive((state == Qt::WindowMinimized) ? Global::OfflineBlurTimeout() : Global::OnlineFocusTimeout()); psUpdateSysMenu(state); if (state == Qt::WindowMinimized && cWorkMode() == dbiwmTrayOnly) { @@ -1075,7 +1075,7 @@ bool Window::minimizeToTray() { cSetSeenTrayTooltip(true); Local::writeSettings(); } - updateIsActive(cOfflineBlurTimeout()); + updateIsActive(Global::OfflineBlurTimeout()); updateTrayMenu(); updateGlobalMenu(); return true; @@ -1157,7 +1157,7 @@ void Window::activate() { setVisible(true); psActivateProcess(); activateWindow(); - updateIsActive(cOnlineFocusTimeout()); + updateIsActive(Global::OnlineFocusTimeout()); if (wasHidden) { if (main) { main->windowShown(); @@ -1382,12 +1382,12 @@ void Window::notifySchedule(History *history, HistoryItem *item) { HistoryForwarded *fwd = item->toHistoryForwarded(); int delay = fwd ? 500 : 100, t = unixtime(); uint64 ms = getms(true); - bool isOnline = main->lastWasOnline(), otherNotOld = ((cOtherOnline() * uint64(1000)) + cOnlineCloudTimeout() > t * uint64(1000)); + bool isOnline = main->lastWasOnline(), otherNotOld = ((cOtherOnline() * uint64(1000)) + Global::OnlineCloudTimeout() > t * uint64(1000)); bool otherLaterThanMe = (cOtherOnline() * uint64(1000) + (ms - main->lastSetOnline()) > t * uint64(1000)); if (!isOnline && otherNotOld && otherLaterThanMe) { - delay = cNotifyCloudDelay(); + delay = Global::NotifyCloudDelay(); } else if (cOtherOnline() >= t) { - delay = cNotifyDefaultDelay(); + delay = Global::NotifyDefaultDelay(); } uint64 when = getms(true) + delay; From c3845ead85adc4092aeb25e312a3b41f760febce Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 18 Feb 2016 22:12:50 +0300 Subject: [PATCH 097/316] moved forwarded to an interface, testing required --- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/history.cpp | 491 +++++++++++-------------- Telegram/SourceFiles/history.h | 185 ++++------ Telegram/SourceFiles/historywidget.cpp | 4 +- Telegram/SourceFiles/layout.cpp | 10 +- Telegram/SourceFiles/mainwidget.cpp | 4 +- Telegram/SourceFiles/mediaview.cpp | 4 +- Telegram/SourceFiles/types.h | 4 + Telegram/SourceFiles/window.cpp | 9 +- 9 files changed, 316 insertions(+), 397 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 367f4f90b4..a96c182e7f 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -951,7 +951,7 @@ namespace App { } void checkSavedGif(HistoryItem *item) { - if (!item->toHistoryForwarded() && (item->out() || item->history()->peer == App::self())) { + if (!item->Is() && (item->out() || item->history()->peer == App::self())) { if (HistoryMedia *media = item->getMedia()) { if (DocumentData *doc = media->getDocument()) { if (doc->isGifv()) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index a1dcac2c32..3ebc832300 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -81,12 +81,6 @@ namespace { inline const HistoryReply *toHistoryReply(const HistoryItem *item) { return item ? item->toHistoryReply() : 0; } - inline HistoryForwarded *toHistoryForwarded(HistoryItem *item) { - return item ? item->toHistoryForwarded() : 0; - } - inline const HistoryForwarded *toHistoryForwarded(const HistoryItem *item) { - return item ? item->toHistoryForwarded() : 0; - } inline const TextParseOptions &itemTextOptions(HistoryItem *item) { return itemTextOptions(item->history(), item->author()); } @@ -1385,13 +1379,11 @@ 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, -1, 0); + 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); } 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); } else { - if (m.has_fwd_from() && m.vfwd_from.type() == mtpc_messageFwdHeader) { - result = new HistoryForwarded(this, block, m, m.vfwd_from.c_messageFwdHeader()); - } else if (m.has_reply_to_msg_id() && m.vreply_to_msg_id.v > 0) { + if (m.has_reply_to_msg_id() && m.vreply_to_msg_id.v > 0) { result = new HistoryReply(this, block, m); } else { result = new HistoryMessage(this, block, m); @@ -1533,7 +1525,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo } HistoryItem *History::createItemForwarded(HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) { - return regItem(new HistoryForwarded(this, block, id, flags, date, from, msg)); + return regItem(new HistoryMessage(this, block, 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) { @@ -5781,7 +5773,7 @@ void HistoryImageLink::initDimensions(const HistoryItem *parent) { _minh += st::mediaPadding.top() + st::mediaPadding.bottom(); if (!_title.isEmpty() || !_description.isEmpty()) { _minh += st::webPagePhotoSkip; - if (!parent->toHistoryForwarded() && !parent->toHistoryReply()) { + if (!parent->Is() && !parent->toHistoryReply()) { _minh += st::msgPadding.top(); } } @@ -5821,7 +5813,7 @@ int32 HistoryImageLink::resize(int32 width, const HistoryItem *parent) { } if (!_title.isEmpty() || !_description.isEmpty()) { _height += st::webPagePhotoSkip; - if (!parent->toHistoryForwarded() && !parent->toHistoryReply()) { + if (!parent->Is() && !parent->toHistoryReply()) { _height += st::msgPadding.top(); } } @@ -5840,7 +5832,7 @@ void HistoryImageLink::draw(Painter &p, const HistoryItem *parent, const QRect & skipy = st::mediaPadding.top(); if (!_title.isEmpty() || !_description.isEmpty()) { - if (!parent->toHistoryForwarded() && !parent->toHistoryReply()) { + if (!parent->Is() && !parent->toHistoryReply()) { skipy += st::msgPadding.top(); } } @@ -5903,7 +5895,7 @@ void HistoryImageLink::getState(TextLinkPtr &lnk, HistoryCursorState &state, int skipy = st::mediaPadding.top(); if (!_title.isEmpty() || !_description.isEmpty()) { - if (!parent->toHistoryForwarded() && !parent->toHistoryReply()) { + if (!parent->Is() && !parent->toHistoryReply()) { skipy += st::msgPadding.top(); } } @@ -5976,34 +5968,28 @@ void ViaInlineBotLink::onClick(Qt::MouseButton button) const { } HistoryMessageVia::HistoryMessageVia(Interfaces *) -: bot(0) -, width(0) -, maxWidth(0) { +: _bot(0) +, _width(0) +, _maxWidth(0) { } void HistoryMessageVia::create(int32 userId) { - bot = App::userLoaded(peerFromUser(userId)); - if (bot) { - maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + bot->username)); - lnk.reset(new ViaInlineBotLink(bot)); - } -} - -bool HistoryMessageVia::isNull() const { - return !bot || bot->username.isEmpty(); + _bot = App::user(peerFromUser(userId)); + _maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + _bot->username)); + _lnk.reset(new ViaInlineBotLink(_bot)); } void HistoryMessageVia::resize(int32 availw) const { if (availw < 0) { - text = QString(); - width = 0; + _text = QString(); + _width = 0; } else { - text = lng_inline_bot_via(lt_inline_bot, '@' + bot->username); - if (availw < maxWidth) { - text = st::msgServiceNameFont->elided(text, availw); - width = st::msgServiceNameFont->width(text); - } else if (width < maxWidth) { - width = maxWidth; + _text = lng_inline_bot_via(lt_inline_bot, '@' + _bot->username); + if (availw < _maxWidth) { + _text = st::msgServiceNameFont->elided(_text, availw); + _width = st::msgServiceNameFont->width(_text); + } else if (_width < _maxWidth) { + _width = _maxWidth; } } } @@ -6029,29 +6015,66 @@ int32 HistoryMessageSigned::maxWidth() const { return _signature.maxWidth(); } +HistoryMessageForwarded::HistoryMessageForwarded(Interfaces *) +: _authorOriginal(0) +, _fromOriginal(0) +, _authorOriginalVersion(0) +, _fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { +} + +void HistoryMessageForwarded::authorNameUpdated(bool hasVia) const { + QString name((hasVia && _authorOriginal->isUser()) ? _authorOriginal->asUser()->firstName : App::peerName(_authorOriginal)); + _authorOriginalName.setText(st::msgServiceNameFont, name, _textNameOptions); + _authorOriginalVersion = _authorOriginal->nameVersion; +} + 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) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(0) { - create(msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0, msg.has_views() ? msg.vviews.v : -1); + PeerId fwdAuthorId = 0, fwdFromId = 0; + if (msg.has_fwd_from() && msg.vfwd_from.type() == mtpc_messageFwdHeader) { + const MTPDmessageFwdHeader &f(msg.vfwd_from.c_messageFwdHeader()); + if (f.has_from_id() || f.has_channel_id()) { + fwdAuthorId = f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id); + fwdFromId = f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id); + } + } + create(msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0, msg.has_views() ? msg.vviews.v : -1, fwdAuthorId, fwdFromId); + 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 msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, int32 fromViews, HistoryMedia *fromMedia) : -HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_id) ? from : 0) +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) , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) , _media(0) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, (fromViews > 0) ? fromViews : (isPost() ? 1 : -1)); - if (fromMedia) { - _media = fromMedia->clone(); + 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); + + if (HistoryMedia *mediaOriginal = fwd->getMedia()) { + _media = mediaOriginal->clone(); _media->regItem(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) + , _text(st::msgMinWidth) + , _textWidth(0) + , _textHeight(0) + , _media(0) { + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1, 0, 0); + setText(msg, entities); } @@ -6061,7 +6084,8 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _textWidth(0) , _textHeight(0) , _media(0) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1, 0, 0); + initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); } @@ -6072,13 +6096,14 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _textWidth(0) , _textHeight(0) , _media(0) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1, 0, 0); + _media = new HistoryPhoto(photo, caption, this); _media->regItem(this); setText(QString(), EntitiesInText()); } -void HistoryMessage::create(int32 viaBotId, int32 viewsCount) { +void HistoryMessage::create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal) { uint64 mask = 0; if (viaBotId) { mask |= HistoryMessageVia::Bit(); @@ -6089,6 +6114,12 @@ void HistoryMessage::create(int32 viaBotId, int32 viewsCount) { if (isPost() && _from->isUser()) { mask |= HistoryMessageSigned::Bit(); } + if (authorIdOriginal && fromIdOriginal) { + mask |= HistoryMessageForwarded::Bit(); + if (authorIdOriginal != fromIdOriginal) { + mask |= HistoryMessageSigned::Bit(); + } + } UpdateInterfaces(mask); if (HistoryMessageVia *via = Get()) { via->create(viaBotId); @@ -6099,6 +6130,10 @@ void HistoryMessage::create(int32 viaBotId, int32 viewsCount) { if (HistoryMessageSigned *msgsigned = Get()) { msgsigned->create(_from->asUser(), date); } + if (HistoryMessageForwarded *fwd = Get()) { + fwd->_authorOriginal = App::peer(authorIdOriginal); + fwd->_fromOriginal = App::peer(fromIdOriginal); + } initTime(); } @@ -6201,6 +6236,12 @@ int32 HistoryMessage::plainMaxWidth() const { void HistoryMessage::initDimensions() { if (drawBubble()) { + HistoryMessageForwarded *fwd = Get(); + HistoryMessageVia *via = Get(); + if (fwd) { + fwd->authorNameUpdated(via != 0); + } + if (_media) { _media->initDimensions(this); if (_media->isDisplayed()) { @@ -6230,15 +6271,22 @@ void HistoryMessage::initDimensions() { if (!_media) { if (displayFromName()) { int32 namew = st::msgPadding.left() + author()->nameText.maxWidth() + st::msgPadding.right(); - if (via() && !toHistoryForwarded()) { - namew += st::msgServiceFont->spacew + via()->maxWidth; + if (via && !fwd) { + namew += st::msgServiceFont->spacew + via->_maxWidth; } if (namew > _maxw) _maxw = namew; - } else if (via() && !toHistoryForwarded()) { - if (st::msgPadding.left() + via()->maxWidth + st::msgPadding.right() > _maxw) { - _maxw = st::msgPadding.left() + via()->maxWidth + st::msgPadding.right(); + } else if (via && !fwd) { + if (st::msgPadding.left() + via->_maxWidth + st::msgPadding.right() > _maxw) { + _maxw = st::msgPadding.left() + via->_maxWidth + st::msgPadding.right(); } } + if (fwd) { + int32 _namew = st::msgPadding.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + st::msgPadding.right(); + if (via) { + _namew += st::msgServiceFont->spacew + via->_maxWidth; + } + if (_namew > _maxw) _maxw = _namew; + } } } else { _media->initDimensions(this); @@ -6275,9 +6323,9 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { void HistoryMessage::fromNameUpdated(int32 width) const { _authorNameVersion = author()->nameVersion; - if (drawBubble() && displayFromName()) { - if (via() && !toHistoryForwarded()) { - via()->resize(width - st::msgPadding.left() - st::msgPadding.right() - author()->nameText.maxWidth() - st::msgServiceFont->spacew); + if (!Is()) { + if (const HistoryMessageVia *via = Get()) { + via->resize(width - st::msgPadding.left() - st::msgPadding.right() - author()->nameText.maxWidth() - st::msgServiceFont->spacew); } } } @@ -6315,13 +6363,24 @@ void HistoryMessage::eraseFromOverview() { } QString HistoryMessage::selectedText(uint32 selection) const { + QString result; if (_media && selection == FullSelection) { QString text = _text.original(0, 0xFFFF, Text::ExpandLinksAll), mediaText = _media->inHistoryText(); - return text.isEmpty() ? mediaText : (mediaText.isEmpty() ? text : (text + ' ' + mediaText)); + result = text.isEmpty() ? mediaText : (mediaText.isEmpty() ? text : (text + ' ' + mediaText)); + } else { + uint16 selectedFrom = (selection == FullSelection) ? 0 : ((selection >> 16) & 0xFFFF); + uint16 selectedTo = (selection == FullSelection) ? 0xFFFF : (selection & 0xFFFF); + result = _text.original(selectedFrom, selectedTo, Text::ExpandLinksAll); } - uint16 selectedFrom = (selection == FullSelection) ? 0 : ((selection >> 16) & 0xFFFF); - uint16 selectedTo = (selection == FullSelection) ? 0xFFFF : (selection & 0xFFFF); - return _text.original(selectedFrom, selectedTo, Text::ExpandLinksAll); + if (const HistoryMessageForwarded *fwd = Get()) { + if (selection == FullSelection) { + QString wrapped; + wrapped.reserve(lang(lng_forwarded_from).size() + fwd->_authorOriginal->name.size() + 4 + result.size()); + wrapped.append('[').append(lang(lng_forwarded_from)).append(' ').append(fwd->_authorOriginal->name).append(qsl("]\n")).append(result); + result = wrapped; + } + } + return result; } QString HistoryMessage::inDialogsText() const { @@ -6520,9 +6579,6 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m int32 left = 0, width = 0; countPositionAndSize(left, width); - if (author()->nameVersion > _authorNameVersion) { - fromNameUpdated(width); - } if (displayFromPhoto()) { int32 photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); @@ -6531,6 +6587,18 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m if (width < 1) return; if (bubble) { + const HistoryMessageForwarded *fwd = Get(); + const HistoryMessageVia *via = Get(); + if (displayFromName() && author()->nameVersion > _authorNameVersion) { + fromNameUpdated(width); + } + if (fwd && fwd->_authorOriginal->nameVersion > fwd->_authorOriginalVersion) { + fwd->authorNameUpdated(via != 0); + if (via) { + via->resize(width - st::msgPadding.left() - st::msgPadding.right() - fwd->_fromWidth - fwd->_authorOriginalName.maxWidth() - st::msgServiceFont->spacew); + } + } + 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)); @@ -6546,9 +6614,9 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m p.setPen(author()->color); } author()->nameText.drawElided(p, r.left() + st::msgPadding.left(), r.top() + st::msgPadding.top(), width - st::msgPadding.left() - st::msgPadding.right()); - if (via() && !toHistoryForwarded() && width > st::msgPadding.left() + st::msgPadding.right() + author()->nameText.maxWidth() + st::msgServiceFont->spacew) { + if (via && !fwd && width > st::msgPadding.left() + st::msgPadding.right() + author()->nameText.maxWidth() + st::msgServiceFont->spacew) { p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); - p.drawText(r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew, r.top() + st::msgPadding.top() + st::msgServiceFont->ascent, via()->text); + p.drawText(r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew, r.top() + st::msgPadding.top() + st::msgServiceFont->ascent, via->_text); } r.setTop(r.top() + st::msgNameFont->height); } @@ -6580,14 +6648,21 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m } void HistoryMessage::drawMessageText(Painter &p, QRect trect, uint32 selection) const { - bool outbg = out() && !isPost(), selected = (selection == FullSelection); - if (!displayFromName() && via() && !toHistoryForwarded()) { - p.setFont(st::msgServiceNameFont); - p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); - p.drawTextLeft(trect.left(), trect.top(), _history->width, via()->text); + if (displayForwardedFrom()) { + paintForwardedInfo(p, trect.x(), trect.y(), trect.width(), (selection == FullSelection)); trect.setY(trect.y() + st::msgServiceNameFont->height); } + bool outbg = out() && !isPost(), selected = (selection == FullSelection); + if (!displayFromName() && !Is()) { + if (const HistoryMessageVia *via = Get()) { + p.setFont(st::msgServiceNameFont); + p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); + p.drawTextLeft(trect.left(), trect.top(), _history->width, via->_text); + trect.setY(trect.y() + st::msgServiceNameFont->height); + } + } + p.setPen(st::msgColor); p.setFont(st::msgFont); uint16 selectedFrom = (selection == FullSelection) ? 0 : (selection >> 16) & 0xFFFF; @@ -6610,6 +6685,9 @@ int32 HistoryMessage::resize(int32 width) { width = st::msgMaxWidth; } if (drawBubble()) { + HistoryMessageForwarded *fwd = Get(); + HistoryMessageVia *via = Get(); + bool media = (_media && _media->isDisplayed()); if (width >= _maxw) { _height = _minh; @@ -6639,16 +6717,29 @@ int32 HistoryMessage::resize(int32 width) { int32 l = 0, w = 0; countPositionAndSize(l, w); fromNameUpdated(w); - } else if (via() && !toHistoryForwarded()) { + } else if (via && !fwd) { int32 l = 0, w = 0; countPositionAndSize(l, w); - via()->resize(w - st::msgPadding.left() - st::msgPadding.right()); + via->resize(w - st::msgPadding.left() - st::msgPadding.right()); if (emptyText() && !displayFromName()) { _height += st::msgPadding.top() + st::msgNameFont->height + st::mediaHeaderSkip; } else { _height += st::msgNameFont->height; } } + + if (displayForwardedFrom()) { + if (emptyText() && !displayFromName()) { + _height += st::msgPadding.top() + st::msgServiceNameFont->height + st::mediaHeaderSkip; + } else { + _height += st::msgServiceNameFont->height; + } + if (via) { + int32 l = 0, w = 0; + countPositionAndSize(l, w); + via->resize(w - st::msgPadding.left() - st::msgPadding.right() - fwd->_fromWidth - fwd->_authorOriginalName.maxWidth() - st::msgServiceFont->spacew); + } + } } else { _height = _media->resize(width, this); } @@ -6662,6 +6753,10 @@ bool HistoryMessage::hasPoint(int32 x, int32 y) const { if (width < 1) return false; if (drawBubble()) { + if (displayForwardedFrom()) { + QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); + return r.contains(x, y); + } QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); return r.contains(x, y); } else { @@ -6687,11 +6782,12 @@ bool HistoryMessage::pointInTime(int32 right, int32 bottom, int32 x, int32 y, In } void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { - state = HistoryDefaultCursorState; lnk = TextLinkPtr(); + state = HistoryDefaultCursorState; int32 left = 0, width = 0; countPositionAndSize(left, width); + 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()) { @@ -6702,6 +6798,9 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 if (width < 1) return; if (drawBubble()) { + const HistoryMessageForwarded *fwd = Get(); + const HistoryMessageVia *via = Get(); + 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) { @@ -6709,13 +6808,28 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 lnk = author()->lnk; return; } - if (via() && !toHistoryForwarded() && x >= r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew + via()->width) { - lnk = via()->lnk; + if (via && !fwd && x >= r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew + via->_width) { + lnk = via->_lnk; return; } } r.setTop(r.top() + st::msgNameFont->height); } + if (displayForwardedFrom()) { + QRect trect(r.marginsAdded(-st::msgPadding)); + if (y >= trect.top() && y < trect.top() + st::msgServiceNameFont->height) { + if (x >= trect.left() + fwd->_fromWidth && x < trect.right() && x < trect.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth()) { + lnk = fwd->_authorOriginal->lnk; + } else if (via && x >= trect.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + st::msgServiceFont->spacew && x < trect.right() && x < trect.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + st::msgServiceFont->spacew + via->_maxWidth) { + lnk = via->_lnk; + } else { + lnk = TextLinkPtr(); + } + return; + } + y -= st::msgServiceNameFont->height; + r.setHeight(r.height() - st::msgServiceNameFont->height); + } getStateFromMessageText(lnk, state, x, y, r); } else { _media->getState(lnk, state, x - left, y - st::msgMargin.top(), this); @@ -6727,12 +6841,15 @@ void HistoryMessage::getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorStat QRect trect(r.marginsAdded(-st::msgPadding)); - if (!displayFromName() && via() && !toHistoryForwarded()) { - if (x >= trect.left() && y >= trect.top() && y < trect.top() + st::msgNameFont->height && x < trect.left() + via()->width) { - lnk = via()->lnk; - return; + const HistoryMessageForwarded *fwd = Get(); + if (!displayFromName() && !fwd) { + if (const HistoryMessageVia *via = Get()) { + if (x >= trect.left() && y >= trect.top() && y < trect.top() + st::msgNameFont->height && x < trect.left() + via->_width) { + lnk = via->_lnk; + return; + } + trect.setTop(trect.top() + st::msgNameFont->height); } - trect.setTop(trect.top() + st::msgNameFont->height); } TextLinkPtr medialnk; @@ -6773,12 +6890,19 @@ void HistoryMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, countPositionAndSize(left, width); if (width < 1) return; + const HistoryMessageForwarded *fwd = Get(); + const HistoryMessageVia *via = Get(); + 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() && !toHistoryForwarded()) { + } else if (via && !fwd) { r.setTop(r.top() + st::msgNameFont->height); } + if (displayForwardedFrom()) { + y -= st::msgServiceNameFont->height; + r.setHeight(r.height() - st::msgServiceNameFont->height); + } QRect trect(r.marginsAdded(-st::msgPadding)); if (_media && _media->isDisplayed()) { trect.setBottom(trect.bottom() - _media->height()); @@ -6832,201 +6956,32 @@ HistoryMessage::~HistoryMessage() { } } -HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg, const MTPDmessageFwdHeader &f) -: HistoryMessage(history, block, msg) -, _fwdDate(::date(f.vdate)) -, _fwdAuthor(App::peer(f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id))) -, _fwdFrom(App::peer(f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id))) -, _fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { -} - -HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg) -: HistoryMessage(history, block, id, newForwardedFlags(history->peer, from, msg) | flags, msg->via() ? peerToUser(msg->viaBot()->id) : 0, date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->HistoryMessage::viewsCount(), msg->getMedia()) -, _fwdDate(msg->fwdDate()) -, _fwdAuthor(msg->fwdAuthor()) -, _fwdFrom(msg->fwdFrom()) -, _fwdAuthorVersion(_fwdAuthor->nameVersion) -, _fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { -} - -QString HistoryForwarded::selectedText(uint32 selection) const { - if (selection != FullSelection) return HistoryMessage::selectedText(selection); - QString result, original = HistoryMessage::selectedText(selection); - result.reserve(lang(lng_forwarded_from).size() + _fwdAuthor->name.size() + 4 + original.size()); - result.append('[').append(lang(lng_forwarded_from)).append(' ').append(_fwdAuthor->name).append(qsl("]\n")).append(original); - return result; -} - -void HistoryForwarded::initDimensions() { - fwdNameUpdated(); - HistoryMessage::initDimensions(); - if (!_media) { - int32 _namew = st::msgPadding.left() + _fromWidth + _fwdAuthorName.maxWidth() + st::msgPadding.right(); - if (via()) { - _namew += st::msgServiceFont->spacew + via()->maxWidth; - } - if (_namew > _maxw) _maxw = _namew; - } -} - -void HistoryForwarded::fwdNameUpdated() const { - QString fwdName((via() && _fwdAuthor->isUser()) ? _fwdAuthor->asUser()->firstName : App::peerName(_fwdAuthor)); - _fwdAuthorName.setText(st::msgServiceNameFont, fwdName, _textNameOptions); - if (via()) { - int32 l = 0, w = 0; - countPositionAndSize(l, w); - via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - _fromWidth - _fwdAuthorName.maxWidth() - st::msgServiceFont->spacew); - } -} - -void HistoryForwarded::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { - if (drawBubble() && _fwdAuthor->nameVersion > _fwdAuthorVersion) { - fwdNameUpdated(); - _fwdAuthorVersion = _fwdAuthor->nameVersion; - } - HistoryMessage::draw(p, r, selection, ms); -} - -void HistoryForwarded::drawForwardedFrom(Painter &p, int32 x, int32 y, int32 w, bool selected) const { +void HistoryMessage::paintForwardedInfo(Painter &p, int32 x, int32 y, int32 w, bool selected) const { style::font serviceFont(st::msgServiceFont), serviceName(st::msgServiceNameFont); bool outbg = out() && !isPost(); p.setPen((selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg))->p); p.setFont(serviceFont); - if (via() && w > _fromWidth + _fwdAuthorName.maxWidth() + serviceFont->spacew) { + const HistoryMessageForwarded *fwd = Get(); + const HistoryMessageVia *via = Get(); + if (via && w > fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + serviceFont->spacew) { p.drawText(x, y + serviceFont->ascent, lang(lng_forwarded_from)); p.setFont(serviceName); - _fwdAuthorName.draw(p, x + _fromWidth, y, w - _fromWidth); + fwd->_authorOriginalName.draw(p, x + fwd->_fromWidth, y, w - fwd->_fromWidth); - p.drawText(x + _fromWidth + _fwdAuthorName.maxWidth() + serviceFont->spacew, y + serviceFont->ascent, via()->text); - } else if (w > _fromWidth) { + p.drawText(x + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + serviceFont->spacew, y + serviceFont->ascent, via->_text); + } else if (w > fwd->_fromWidth) { p.drawText(x, y + serviceFont->ascent, lang(lng_forwarded_from)); p.setFont(serviceName); - _fwdAuthorName.drawElided(p, x + _fromWidth, y, w - _fromWidth); + fwd->_authorOriginalName.drawElided(p, x + fwd->_fromWidth, y, w - fwd->_fromWidth); } else { p.drawText(x, y + serviceFont->ascent, serviceFont->elided(lang(lng_forwarded_from), w)); } } -void HistoryForwarded::drawMessageText(Painter &p, QRect trect, uint32 selection) const { - if (displayForwardedFrom()) { - drawForwardedFrom(p, trect.x(), trect.y(), trect.width(), (selection == FullSelection)); - trect.setY(trect.y() + st::msgServiceNameFont->height); - } - HistoryMessage::drawMessageText(p, trect, selection); -} - -int32 HistoryForwarded::resize(int32 width) { - HistoryMessage::resize(width); - if (drawBubble()) { - if (displayForwardedFrom()) { - if (emptyText() && !displayFromName()) { - _height += st::msgPadding.top() + st::msgServiceNameFont->height + st::mediaHeaderSkip; - } else { - _height += st::msgServiceNameFont->height; - } - if (via()) { - int32 l = 0, w = 0; - countPositionAndSize(l, w); - via()->resize(w - st::msgPadding.left() - st::msgPadding.right() - _fromWidth - _fwdAuthorName.maxWidth() - st::msgServiceFont->spacew); - } - } - } - return _height; -} - -bool HistoryForwarded::hasPoint(int32 x, int32 y) const { - if (drawBubble() && displayForwardedFrom()) { - 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 HistoryForwarded::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { - lnk = TextLinkPtr(); - state = HistoryDefaultCursorState; - - if (drawBubble() && displayForwardedFrom()) { - int32 left = 0, width = 0; - countPositionAndSize(left, width); - if (displayFromPhoto()) { - int32 photoleft = left + ((!isPost() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - if (x >= photoleft && x < photoleft + st::msgPhotoSize) { - return HistoryMessage::getState(lnk, state, x, y); - } - } - if (width < 1) return; - - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); - if (displayFromName()) { - style::font nameFont(st::msgNameFont); - if (y >= r.top() + st::msgPadding.top() && y < r.top() + st::msgPadding.top() + nameFont->height) { - return HistoryMessage::getState(lnk, state, x, y); - } - r.setTop(r.top() + nameFont->height); - } - QRect trect(r.marginsAdded(-st::msgPadding)); - - if (y >= trect.top() && y < trect.top() + st::msgServiceNameFont->height) { - return getForwardedState(lnk, state, x - trect.left(), trect.right() - trect.left()); - } - y -= st::msgServiceNameFont->height; - } - return HistoryMessage::getState(lnk, state, x, y); -} - -void HistoryForwarded::getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const { - QRect realr(r); - if (drawBubble() && displayForwardedFrom()) { - realr.setHeight(r.height() - st::msgServiceNameFont->height); - } - HistoryMessage::getStateFromMessageText(lnk, state, x, y, realr); -} - -void HistoryForwarded::getForwardedState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 w) const { - state = HistoryDefaultCursorState; - if (x >= _fromWidth && x < w && x < _fromWidth + _fwdAuthorName.maxWidth()) { - lnk = _fwdAuthor->lnk; - } else if (via() && x >= _fromWidth + _fwdAuthorName.maxWidth() + st::msgServiceFont->spacew && x < w && x < _fromWidth + _fwdAuthorName.maxWidth() + st::msgServiceFont->spacew + via()->maxWidth) { - lnk = via()->lnk; - } else { - lnk = TextLinkPtr(); - } -} - -void HistoryForwarded::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { - symbol = 0; - after = false; - upon = false; - - if (drawBubble() && displayForwardedFrom()) { - int32 left = 0, width = 0; - countPositionAndSize(left, width); - if (width < 1) return; - - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); - if (displayFromName()) { - style::font nameFont(st::msgNameFont); - if (y >= r.top() + st::msgPadding.top() && y < r.top() + st::msgPadding.top() + nameFont->height) { - return HistoryMessage::getSymbol(symbol, after, upon, x, y); - } - r.setTop(r.top() + nameFont->height); - } - QRect trect(r.marginsAdded(-st::msgPadding)); - - y -= st::msgServiceNameFont->height; - } - return HistoryMessage::getSymbol(symbol, after, upon, x, y); -} - HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg) , replyToMsgId(msg.vreply_to_msg_id.v) , replyToMsg(0) @@ -7076,8 +7031,8 @@ void HistoryReply::initDimensions() { HistoryMessage::initDimensions(); if (!_media) { int32 replyw = st::msgPadding.left() + _maxReplyWidth - st::msgReplyPadding.left() - st::msgReplyPadding.right() + st::msgPadding.right(); - if (replyToVia()) { - replyw += st::msgServiceFont->spacew + replyToVia()->maxWidth; + if (_replyToVia) { + replyw += st::msgServiceFont->spacew + _replyToVia->_maxWidth; } if (replyw > _maxw) _maxw = replyw; } @@ -7094,7 +7049,7 @@ bool HistoryReply::updateReplyTo(bool force) { replyToNameUpdated(); replyToLnk = TextLinkPtr(new MessageLink(replyToMsg->history()->peer->id, replyToMsg->id)); - if (!replyToMsg->toHistoryForwarded()) { + if (!replyToMsg->Is()) { if (UserData *bot = replyToMsg->viaBot()) { _replyToVia = new HistoryMessageVia(0); _replyToVia->create(peerToUser(bot->id)); @@ -7112,14 +7067,14 @@ bool HistoryReply::updateReplyTo(bool force) { void HistoryReply::replyToNameUpdated() const { if (replyToMsg) { - QString name = (replyToVia() && replyToMsg->author()->isUser()) ? replyToMsg->author()->asUser()->firstName : App::peerName(replyToMsg->author()); + QString name = (_replyToVia && replyToMsg->author()->isUser()) ? replyToMsg->author()->asUser()->firstName : App::peerName(replyToMsg->author()); replyToName.setText(st::msgServiceNameFont, name, _textNameOptions); replyToVersion = replyToMsg->author()->nameVersion; bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; int32 previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; int32 w = replyToName.maxWidth(); - if (replyToVia()) { - w += st::msgServiceFont->spacew + replyToVia()->maxWidth; + if (_replyToVia) { + w += st::msgServiceFont->spacew + _replyToVia->_maxWidth; } _maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize))); @@ -7153,7 +7108,7 @@ void HistoryReply::replyToReplaced(HistoryItem *oldItem, HistoryItem *newItem) { if (!newItem) { replyToMsgId = 0; initDimensions(); - } else if (!replyToMsg->toHistoryForwarded()) { + } else if (!replyToMsg->Is()) { if (UserData *bot = replyToMsg->viaBot()) { _replyToVia = new HistoryMessageVia(0); _replyToVia->create(peerToUser(bot->id)); @@ -7202,9 +7157,9 @@ void HistoryReply::drawReplyTo(Painter &p, int32 x, int32 y, int32 w, bool selec p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); } replyToName.drawLeftElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top(), w - st::msgReplyBarSkip - previewSkip, w + 2 * x); - if (replyToVia() && w > st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew) { + if (_replyToVia && w > st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew) { p.setFont(st::msgServiceFont); - p.drawText(x + st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew, y + st::msgReplyPadding.top() + st::msgServiceFont->ascent, replyToVia()->text); + p.drawText(x + st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew, y + st::msgReplyPadding.top() + st::msgServiceFont->ascent, _replyToVia->_text); } HistoryMessage *replyToAsMsg = replyToMsg->toHistoryMessage(); @@ -7239,26 +7194,26 @@ int32 HistoryReply::resize(int32 width) { HistoryMessage::resize(width); if (drawBubble()) { - if (emptyText() && !displayFromName() && !via()) { + if (emptyText() && !displayFromName() && !Is()) { _height += st::msgPadding.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom() + st::mediaHeaderSkip; } else { _height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); } - if (replyToVia()) { + if (_replyToVia) { bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; - replyToVia()->resize(width - st::msgPadding.left() - st::msgPadding.right() - st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew); + _replyToVia->resize(width - st::msgPadding.left() - st::msgPadding.right() - st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew); } } return _height; } void HistoryReply::resizeVia(int32 w) const { - if (!replyToVia()) return; + if (!_replyToVia) return; bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; - replyToVia()->resize(w - st::msgReplyBarSkip - previewSkip - replyToName.maxWidth() - st::msgServiceFont->spacew); + _replyToVia->resize(w - st::msgReplyBarSkip - previewSkip - replyToName.maxWidth() - st::msgServiceFont->spacew); } bool HistoryReply::hasPoint(int32 x, int32 y) const { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 0435cd00bf..fbcc1e7da9 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -765,7 +765,6 @@ protected: class HistoryReply; // dynamic_cast optimize class HistoryMessage; // dynamic_cast optimize -class HistoryForwarded; // dynamic_cast optimize enum HistoryCursorState { HistoryDefaultCursorState, @@ -791,8 +790,46 @@ enum HistoryItemType { HistoryItemJoined }; +struct HistoryMessageVia : public BasicInterface { + HistoryMessageVia(Interfaces *); + void create(int32 userId); + void resize(int32 availw) const; + + UserData *_bot; + mutable QString _text; + mutable int32 _width, _maxWidth; + TextLinkPtr _lnk; +}; + +struct HistoryMessageViews : public BasicInterface { + HistoryMessageViews(Interfaces *); + + QString _viewsText; + int32 _views, _viewsWidth; +}; + +struct HistoryMessageSigned : public BasicInterface { + HistoryMessageSigned(Interfaces *); + + void create(UserData *from, const QDateTime &date); + int32 maxWidth() const; + + Text _signature; +}; + +struct HistoryMessageForwarded : public BasicInterface { + HistoryMessageForwarded(Interfaces *); + void authorNameUpdated(bool hasVia) const; + bool display(bool hasVia) const; + + PeerData *_authorOriginal, *_fromOriginal; + mutable Text _authorOriginalName; + mutable int32 _authorOriginalVersion; + int32 _fromWidth; +}; + class HistoryMedia; -class HistoryItem : public HistoryElem { +class HistoryItem : public HistoryElem, public Interfaces { public: HistoryItem(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime msgDate, int32 from); @@ -1005,12 +1042,6 @@ public: virtual const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize return 0; } - virtual HistoryForwarded *toHistoryForwarded() { // dynamic_cast optimize - return 0; - } - virtual const HistoryForwarded *toHistoryForwarded() const { // dynamic_cast optimize - return 0; - } virtual HistoryReply *toHistoryReply() { // dynamic_cast optimize return 0; } @@ -1026,13 +1057,16 @@ public: } bool displayFromPhoto() const; - virtual QDateTime fwdDate() const { // dynamic_cast optimize - return date; - } - virtual PeerData *fwdFrom() const { // dynamic_cast optimize + PeerData *fromOriginal() const { + if (const HistoryMessageForwarded *fwd = Get()) { + return fwd->_fromOriginal; + } return from(); } - virtual PeerData *fwdAuthor() const { // dynamic_cast optimize + PeerData *authorOriginal() const { + if (const HistoryMessageForwarded *fwd = Get()) { + return fwd->_authorOriginal; + } return author(); } @@ -1042,6 +1076,9 @@ public: protected: + HistoryItem(const HistoryItem &); + HistoryItem &operator=(const HistoryItem &); + PeerData *_from; History *_history; HistoryBlock *_block; @@ -1337,7 +1374,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const { - return !_caption.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return _caption.isEmpty(); @@ -1403,7 +1440,7 @@ public: ImagePtr replyPreview(); bool needsBubble(const HistoryItem *parent) const { - return !_caption.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return _caption.isEmpty(); @@ -1605,7 +1642,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const { - return !_caption.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return _caption.isEmpty(); @@ -1916,7 +1953,7 @@ public: } bool needsBubble(const HistoryItem *parent) const { - return !_title.isEmpty() || !_description.isEmpty() || parent->toHistoryForwarded() || parent->toHistoryReply() || parent->viaBot(); + return !_title.isEmpty() || !_description.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } bool customInfoLayout() const { return true; @@ -1945,40 +1982,12 @@ private: }; -struct HistoryMessageVia : public BasicInterface { - HistoryMessageVia(Interfaces *); - - void create(int32 userId); - - bool isNull() const; - void resize(int32 availw) const; - - UserData *bot; - mutable QString text; - mutable int32 width, maxWidth; - TextLinkPtr lnk; -}; - -struct HistoryMessageViews : public BasicInterface { - HistoryMessageViews(Interfaces *); - - QString _viewsText; - int32 _views, _viewsWidth; -}; - -struct HistoryMessageSigned : public BasicInterface { - HistoryMessageSigned(Interfaces *); - void create(UserData *from, const QDateTime &date); - int32 maxWidth() const; - - Text _signature; -}; - -class HistoryMessage : public HistoryItem, public Interfaces { +class HistoryMessage : public HistoryItem { public: HistoryMessage(History *history, HistoryBlock *block, const MTPDmessage &msg); - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities, int32 fromViews, HistoryMedia *fromMedia); // local forwarded + 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 @@ -1988,12 +1997,11 @@ public: void initDimensions(); void fromNameUpdated(int32 width) const; - const HistoryMessageVia *via() const { - const HistoryMessageVia *result = Get(); - return (result && !result->isNull()) ? result : 0; - } virtual UserData *viaBot() const { - return via() ? via()->bot : 0; + if (const HistoryMessageVia *via = Get()) { + return via->_bot; + } + return 0; } int32 plainMaxWidth() const; @@ -2009,7 +2017,7 @@ public: return drawBubble(); } bool displayFromName() const { - return hasFromName() && (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || toHistoryForwarded() || viaBot() || !_media->hideFromName()); + return hasFromName() && (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || Is() || viaBot() || !_media->hideFromName()); } bool uploading() const { return _media && _media->uploading(); @@ -2108,7 +2116,15 @@ public: protected: - void create(int32 viaBotId, int32 viewsCount); + void create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal); + + bool displayForwardedFrom() const { + if (const HistoryMessageForwarded *fwd = Get()) { + return Is() || !_media || !_media->isDisplayed() || fwd->_authorOriginal->isChannel() || !_media->hideForwardedFrom(); + } + return false; + } + void paintForwardedInfo(Painter &p, int32 x, int32 y, int32 w, bool selected) const; Text _text; @@ -2120,56 +2136,6 @@ protected: }; -class HistoryForwarded : public HistoryMessage { -public: - - HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg, const MTPDmessageFwdHeader &f); - HistoryForwarded(History *history, HistoryBlock *block, MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *msg); - - void initDimensions(); - void fwdNameUpdated() const; - - void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; - void drawForwardedFrom(Painter &p, int32 x, int32 y, int32 w, bool selected) const; - void drawMessageText(Painter &p, QRect trect, uint32 selection) const; - int32 resize(int32 width); - bool hasPoint(int32 x, int32 y) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const; - void getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const; - void getForwardedState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 w) const; - void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const; - - QDateTime fwdDate() const { - return _fwdDate; - } - PeerData *fwdAuthor() const { - return _fwdAuthor; - } - PeerData *fwdFrom() const { - return _fwdFrom; - } - QString selectedText(uint32 selection) const; - bool displayForwardedFrom() const { - return via() || !_media || !_media->isDisplayed() || _fwdAuthor->isChannel() || !_media->hideForwardedFrom(); - } - - HistoryForwarded *toHistoryForwarded() { - return this; - } - const HistoryForwarded *toHistoryForwarded() const { - return this; - } - -protected: - - QDateTime _fwdDate; - PeerData *_fwdAuthor, *_fwdFrom; - mutable Text _fwdAuthorName; - mutable int32 _fwdAuthorVersion; - int32 _fromWidth; - -}; - class HistoryReply : public HistoryMessage { public: @@ -2222,9 +2188,6 @@ protected: mutable int32 replyToVersion; mutable int32 _maxReplyWidth; HistoryMessageVia *_replyToVia; - HistoryMessageVia *replyToVia() const { - return (_replyToVia && !_replyToVia->isNull()) ? _replyToVia : 0; - } int32 toWidth; }; @@ -2232,13 +2195,13 @@ 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 int32 newForwardedFlags(PeerData *p, int32 from, HistoryMessage *msg) { +inline int32 newForwardedFlags(PeerData *p, int32 from, HistoryMessage *fwd) { int32 result = newMessageFlags(p) | (from ? MTPDmessage::flag_from_id : 0); - if (msg->via()) { + if (fwd->Is()) { result |= MTPDmessage::flag_via_bot_id; } if (!p->isChannel()) { - if (HistoryMedia *media = msg->getMedia()) { + if (HistoryMedia *media = fwd->getMedia()) { if (media->type() == MediaTypeVoiceFile) { result |= MTPDmessage::flag_media_unread; // } else if (media->type() == MediaTypeVideo) { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index d995e8bc52..99e07198d3 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4894,7 +4894,7 @@ void HistoryWidget::sendBotCommand(const QString &cmd, MsgId replyTo) { // reply bool lastKeyboardUsed = (_keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId)) && (_keyboard.forMsgId() == FullMsgId(_channel, replyTo)); QString toSend = cmd; - PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? App::hoveredLinkItem()->toHistoryForwarded()->fwdFrom() : 0); + PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? App::hoveredLinkItem()->fromOriginal() : 0); if (bot && (!bot->isUser() || !bot->asUser()->botInfo)) bot = 0; QString username = bot ? bot->asUser()->username : QString(); int32 botStatus = _peer->isChat() ? _peer->asChat()->botStatus : (_peer->isMegagroup() ? _peer->asChannel()->mgInfo->botStatus : -1); @@ -4919,7 +4919,7 @@ bool HistoryWidget::insertBotCommand(const QString &cmd, bool specialGif) { QString toInsert = cmd; if (!toInsert.isEmpty() && toInsert.at(0) != '@') { - PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? App::hoveredLinkItem()->toHistoryForwarded()->fwdFrom() : 0); + PeerData *bot = _peer->isUser() ? _peer : (App::hoveredLinkItem() ? App::hoveredLinkItem()->fromOriginal() : 0); if (!bot->isUser() || !bot->asUser()->botInfo) bot = 0; QString username = bot ? bot->asUser()->username : QString(); int32 botStatus = _peer->isChat() ? _peer->asChat()->botStatus : (_peer->isMegagroup() ? _peer->asChannel()->mgInfo->botStatus : -1); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index bcc91d7171..90f1415c65 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -581,8 +581,7 @@ void LayoutOverviewVoice::paint(Painter &p, const QRect &clip, uint32 selection, } } bool showPause = updateStatusText(); - int32 nameVersion = _parent->from()->nameVersion; - if (HistoryForwarded *fwd = _parent->toHistoryForwarded()) nameVersion = fwd->fwdFrom()->nameVersion; + int32 nameVersion = _parent->fromOriginal()->nameVersion; if (nameVersion > _nameVersion) { updateName(); } @@ -700,13 +699,12 @@ void LayoutOverviewVoice::getState(TextLinkPtr &link, HistoryCursorState &cursor void LayoutOverviewVoice::updateName() const { int32 version = 0; - if (HistoryForwarded *fwd = _parent->toHistoryForwarded()) { - _name.setText(st::semiboldFont, lang(lng_forwarded_from) + ' ' + App::peerName(fwd->fwdFrom()), _textNameOptions); - version = fwd->fwdFrom()->nameVersion; + if (const HistoryMessageForwarded *fwd = _parent->Get()) { + _name.setText(st::semiboldFont, lang(lng_forwarded_from) + ' ' + App::peerName(_parent->fromOriginal()), _textNameOptions); } else { _name.setText(st::semiboldFont, App::peerName(_parent->from()), _textNameOptions); - version = _parent->from()->nameVersion; } + version = _parent->fromOriginal()->nameVersion; _nameVersion = version; } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8d45382bea..aef60bc1dc 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -537,7 +537,7 @@ void MainWidget::fillForwardingInfo(Text *&from, Text *&text, bool &serviceColor if (_toForward.isEmpty()) return; int32 version = 0; for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { - version += i.value()->fwdAuthor()->nameVersion; + version += i.value()->authorOriginal()->nameVersion; } if (version != _toForwardNameVersion) { updateForwardingTexts(); @@ -558,7 +558,7 @@ void MainWidget::updateForwardingTexts() { QVector fromUsers; fromUsers.reserve(_toForward.size()); for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { - PeerData *from = i.value()->fwdAuthor(); + PeerData *from = i.value()->authorOriginal(); if (!fromUsersMap.contains(from)) { fromUsersMap.insert(from, true); fromUsers.push_back(from); diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 56fe2baecc..5330c1331e 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -909,7 +909,7 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) { _y = (height() - _h) / 2; _width = _w; if (_msgid && item) { - _from = item->fwdAuthor(); + _from = item->authorOriginal(); } else { _from = _user; } @@ -1058,7 +1058,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) { // empty } _x = (width() - _w) / 2; _y = (height() - _h) / 2; - _from = item->fwdAuthor(); + _from = item->authorOriginal(); _full = 1; updateControls(); if (isHidden()) { diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 2e983d5706..a0e196255a 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -725,6 +725,10 @@ public: const Type *Get() const { return static_cast(_dataptr(_meta()->offsets[Type::Index()])); } + template + bool Is() const { + return (_meta()->offsets[Type::Index()] >= 0); + } private: static const InterfacesMetadata *ZeroInterfacesMetadata; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 24c24101f5..0ca9a5d820 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1379,8 +1379,7 @@ void Window::notifySchedule(History *history, HistoryItem *item) { App::wnd()->getNotifySetting(MTP_inputNotifyPeer(history->peer->input)); } - HistoryForwarded *fwd = item->toHistoryForwarded(); - int delay = fwd ? 500 : 100, t = unixtime(); + int delay = item->Is() ? 500 : 100, t = unixtime(); uint64 ms = getms(true); bool isOnline = main->lastWasOnline(), otherNotOld = ((cOtherOnline() * uint64(1000)) + Global::OnlineCloudTimeout() > t * uint64(1000)); bool otherLaterThanMe = (cOtherOnline() * uint64(1000) + (ms - main->lastSetOnline()) > t * uint64(1000)); @@ -1581,7 +1580,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { notifyWaitTimer.start(next - ms); break; } else { - HistoryForwarded *fwd = notifyItem->toHistoryForwarded(); // forwarded notify grouping + HistoryItem *fwd = notifyItem->Is() ? notifyItem : 0; // forwarded notify grouping int32 fwdCount = 1; uint64 ms = getms(true); @@ -1609,8 +1608,8 @@ void Window::notifyShowNext(NotifyWindow *remove) { } while (history->hasNotification()); if (nextNotify) { if (fwd) { - HistoryForwarded *nextFwd = nextNotify->toHistoryForwarded(); - if (nextFwd && fwd->from() == nextFwd->from() && qAbs(int64(nextFwd->date.toTime_t()) - int64(fwd->date.toTime_t())) < 2) { + HistoryItem *nextFwd = nextNotify->Is() ? nextNotify : 0; + if (nextFwd && fwd->author() == nextFwd->author() && qAbs(int64(nextFwd->date.toTime_t()) - int64(fwd->date.toTime_t())) < 2) { fwd = nextFwd; ++fwdCount; } else { From 6d423506918613cfd36d4fb33f4f8e082a996e12 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 19 Feb 2016 14:53:49 +0300 Subject: [PATCH 098/316] forwarded display improved --- Telegram/Resources/lang.strings | 4 +- Telegram/Resources/style.txt | 18 +++ Telegram/SourceFiles/gui/text.cpp | 20 ++-- Telegram/SourceFiles/gui/text.h | 16 +-- Telegram/SourceFiles/history.cpp | 155 ++++++++++++------------- Telegram/SourceFiles/history.h | 12 +- Telegram/SourceFiles/historywidget.cpp | 16 ++- Telegram/SourceFiles/layout.cpp | 2 +- 8 files changed, 132 insertions(+), 111 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index a03f486635..be3832f2a1 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -555,7 +555,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link copied to clipboard."; -"lng_forwarded_from" = "Forwarded from"; +"lng_forwarded" = "Forwarded from {original}"; +"lng_forwarded_via" = "Forwarded from {original} via {inline_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "In reply to"; "lng_attach_failed" = "Failed"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index d06880d617..3a9794fe14 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1163,6 +1163,24 @@ outTextStyle: textStyle(defaultTextStyle) { selectBg: msgOutBgSelected; selectOverlay: msgSelectOverlay; } +inFwdTextStyle: textStyle(defaultTextStyle) { + linkFlags: semiboldFont; + linkFlagsOver: semiboldFont; + linkFg: msgInServiceFg; + linkFgDown: msgInServiceFg; +} +outFwdTextStyle: textStyle(inFwdTextStyle) { + linkFg: msgOutServiceFg; + linkFgDown: msgOutServiceFg; +} +inFwdTextStyleSelected: textStyle(inFwdTextStyle) { + linkFg: msgInServiceFgSelected; + linkFgDown: msgInServiceFgSelected; +} +outFwdTextStyleSelected: textStyle(inFwdTextStyle) { + linkFg: msgOutServiceFgSelected; + linkFgDown: msgOutServiceFgSelected; +} medviewSaveAsTextStyle: textStyle(defaultTextStyle) { linkFg: #91d9ff; linkFgDown: #91d9ff; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 6e7a772c8b..3939945add 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -994,7 +994,7 @@ public: return _blockEnd(t, i, e) - (*i)->from(); } - TextPainter(QPainter *p, const Text *t) : _p(p), _t(t), _elideLast(false), _elideRemoveFromEnd(0), _str(0), _elideSavedBlock(0), _lnkResult(0), _inTextFlag(0), _getSymbol(0), _getSymbolAfter(0), _getSymbolUpon(0) { + TextPainter(QPainter *p, const Text *t) : _p(p), _t(t), _elideLast(false), _breakEverywhere(false), _elideRemoveFromEnd(0), _str(0), _elideSavedBlock(0), _lnkResult(0), _inTextFlag(0), _getSymbol(0), _getSymbolAfter(0), _getSymbolUpon(0) { } void initNextParagraph(Text::TextBlocks::const_iterator i) { @@ -1192,7 +1192,7 @@ public: bool elidedLine = _elideLast && (_y + elidedLineHeight >= _yToElide); if (elidedLine) { _lineHeight = elidedLineHeight; - } else if (f != j) { + } else if (f != j && !_breakEverywhere) { // word did not fit completely, so we roll back the state to the beginning of this long word j = f; _wLeft = f_wLeft; @@ -1251,7 +1251,7 @@ public: } } - void drawElided(int32 left, int32 top, int32 w, style::align align, int32 lines, int32 yFrom, int32 yTo, int32 removeFromEnd) { + void drawElided(int32 left, int32 top, int32 w, style::align align, int32 lines, int32 yFrom, int32 yTo, int32 removeFromEnd, bool breakEverywhere) { if (lines <= 0 || _t->isNull()) return; if (yTo < 0 || (lines - 1) * _t->_font->height < yTo) { @@ -1259,6 +1259,7 @@ public: _elideLast = true; _elideRemoveFromEnd = removeFromEnd; } + _breakEverywhere = breakEverywhere; draw(left, top, w, align, yFrom, yTo); } @@ -1272,7 +1273,7 @@ public: return *_lnkResult; } - void getState(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 w, style::align align) { + void getState(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 w, style::align align, bool breakEverywhere) { lnk = TextLinkPtr(); inText = false; @@ -1281,6 +1282,7 @@ public: _lnkY = y; _lnkResult = &lnk; _inTextFlag = &inText; + _breakEverywhere = breakEverywhere; draw(0, 0, w, align, _lnkY, _lnkY + 1); lnk = *_lnkResult; } @@ -2437,7 +2439,7 @@ private: QPainter *_p; const Text *_t; - bool _elideLast; + bool _elideLast, _breakEverywhere; int32 _elideRemoveFromEnd; style::align _align; QPen _originalPen; @@ -2984,10 +2986,10 @@ void Text::draw(QPainter &painter, int32 left, int32 top, int32 w, style::align p.draw(left, top, w, align, yFrom, yTo, selectedFrom, selectedTo); } -void Text::drawElided(QPainter &painter, int32 left, int32 top, int32 w, int32 lines, style::align align, int32 yFrom, int32 yTo, int32 removeFromEnd) const { +void Text::drawElided(QPainter &painter, int32 left, int32 top, int32 w, int32 lines, style::align align, int32 yFrom, int32 yTo, int32 removeFromEnd, bool breakEverywhere) const { // painter.fillRect(QRect(left, top, w, countHeight(w)), QColor(0, 0, 0, 32)); // debug TextPainter p(&painter, this); - p.drawElided(left, top, w, align, lines, yFrom, yTo, removeFromEnd); + p.drawElided(left, top, w, align, lines, yFrom, yTo, removeFromEnd, breakEverywhere); } const TextLinkPtr &Text::link(int32 x, int32 y, int32 width, style::align align) const { @@ -2995,9 +2997,9 @@ const TextLinkPtr &Text::link(int32 x, int32 y, int32 width, style::align align) return p.link(x, y, width, align); } -void Text::getState(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 width, style::align align) const { +void Text::getState(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 width, style::align align, bool breakEverywhere) const { TextPainter p(0, this); - p.getState(lnk, inText, x, y, width, align); + p.getState(lnk, inText, x, y, width, align, breakEverywhere); } void Text::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y, int32 width, style::align align) const { diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index 341ebb9034..731e996217 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -604,27 +604,27 @@ public: void replaceFont(style::font f); // does not recount anything, use at your own risk! void draw(QPainter &p, int32 left, int32 top, int32 width, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, uint16 selectedFrom = 0, uint16 selectedTo = 0) const; - void drawElided(QPainter &p, int32 left, int32 top, int32 width, int32 lines = 1, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, int32 removeFromEnd = 0) const; + void drawElided(QPainter &p, int32 left, int32 top, int32 width, int32 lines = 1, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, int32 removeFromEnd = 0, bool breakEverywhere = false) const; void drawLeft(QPainter &p, int32 left, int32 top, int32 width, int32 outerw, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, uint16 selectedFrom = 0, uint16 selectedTo = 0) const { draw(p, rtl() ? (outerw - left - width) : left, top, width, align, yFrom, yTo, selectedFrom, selectedTo); } - void drawLeftElided(QPainter &p, int32 left, int32 top, int32 width, int32 outerw, int32 lines = 1, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, int32 removeFromEnd = 0) const { - drawElided(p, rtl() ? (outerw - left - width) : left, top, width, lines, align, yFrom, yTo, removeFromEnd); + void drawLeftElided(QPainter &p, int32 left, int32 top, int32 width, int32 outerw, int32 lines = 1, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, int32 removeFromEnd = 0, bool breakEverywhere = false) const { + drawElided(p, rtl() ? (outerw - left - width) : left, top, width, lines, align, yFrom, yTo, removeFromEnd, breakEverywhere); } void drawRight(QPainter &p, int32 right, int32 top, int32 width, int32 outerw, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, uint16 selectedFrom = 0, uint16 selectedTo = 0) const { draw(p, rtl() ? right : (outerw - right - width), top, width, align, yFrom, yTo, selectedFrom, selectedTo); } - void drawRightElided(QPainter &p, int32 right, int32 top, int32 width, int32 outerw, int32 lines = 1, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, int32 removeFromEnd = 0) const { - drawElided(p, rtl() ? right : (outerw - right - width), top, width, lines, align, yFrom, yTo, removeFromEnd); + void drawRightElided(QPainter &p, int32 right, int32 top, int32 width, int32 outerw, int32 lines = 1, style::align align = style::al_left, int32 yFrom = 0, int32 yTo = -1, int32 removeFromEnd = 0, bool breakEverywhere = false) const { + drawElided(p, rtl() ? right : (outerw - right - width), top, width, lines, align, yFrom, yTo, removeFromEnd, breakEverywhere); } const TextLinkPtr &link(int32 x, int32 y, int32 width, style::align align = style::al_left) const; const TextLinkPtr &linkLeft(int32 x, int32 y, int32 width, int32 outerw, style::align align = style::al_left) const { return link(rtl() ? (outerw - x - width) : x, y, width, align); } - void getState(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 width, style::align align = style::al_left) const; - void getStateLeft(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 width, int32 outerw, style::align align = style::al_left) const { - return getState(lnk, inText, rtl() ? (outerw - x - width) : x, y, width, align); + void getState(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 width, style::align align = style::al_left, bool breakEverywhere = false) const; + void getStateLeft(TextLinkPtr &lnk, bool &inText, int32 x, int32 y, int32 width, int32 outerw, style::align align = style::al_left, bool breakEverywhere = false) const { + return getState(lnk, inText, rtl() ? (outerw - x - width) : x, y, width, align, breakEverywhere); } void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y, int32 width, style::align align = style::al_left) const; void getSymbolLeft(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y, int32 width, int32 outerw, style::align align = style::al_left) const { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 3ebc832300..6ef6b30c57 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6018,14 +6018,30 @@ int32 HistoryMessageSigned::maxWidth() const { HistoryMessageForwarded::HistoryMessageForwarded(Interfaces *) : _authorOriginal(0) , _fromOriginal(0) -, _authorOriginalVersion(0) -, _fromWidth(st::msgServiceFont->width(lang(lng_forwarded_from)) + st::msgServiceFont->spacew) { +, _originalId(0) +, _text(1) { } -void HistoryMessageForwarded::authorNameUpdated(bool hasVia) const { - QString name((hasVia && _authorOriginal->isUser()) ? _authorOriginal->asUser()->firstName : App::peerName(_authorOriginal)); - _authorOriginalName.setText(st::msgServiceNameFont, name, _textNameOptions); - _authorOriginalVersion = _authorOriginal->nameVersion; +void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { + QString text; + if (_authorOriginal != _fromOriginal) { + text = lng_forwarded_signed(lt_channel, App::peerName(_authorOriginal), lt_user, App::peerName(_fromOriginal)); + } else { + text = App::peerName(_authorOriginal); + } + if (via) { + text = lng_forwarded_via(lt_original, textcmdLink(1, text), lt_inline_bot, textcmdLink(2, '@' + via->_bot->username)); + } else { + text = lng_forwarded(lt_original, textcmdLink(1, text)); + } + TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto }; + textstyleSet(&st::inFwdTextStyle); + _text.setText(st::msgServiceNameFont, text, opts); + textstyleRestore(); + _text.setLink(1, (_originalId && _authorOriginal->isChannel()) ? TextLinkPtr(new MessageLink(_authorOriginal->id, _originalId)) : _authorOriginal->lnk); + if (via) { + _text.setLink(2, via->_lnk); + } } HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, const MTPDmessage &msg) : @@ -6034,15 +6050,17 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, const MTPD , _textWidth(0) , _textHeight(0) , _media(0) { - PeerId fwdAuthorId = 0, fwdFromId = 0; + PeerId authorOriginalId = 0, fromOriginalId = 0; + MsgId originalId = 0; if (msg.has_fwd_from() && msg.vfwd_from.type() == mtpc_messageFwdHeader) { const MTPDmessageFwdHeader &f(msg.vfwd_from.c_messageFwdHeader()); if (f.has_from_id() || f.has_channel_id()) { - fwdAuthorId = f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id); - fwdFromId = f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id); + authorOriginalId = f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id); + fromOriginalId = f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id); + 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, fwdAuthorId, fwdFromId); + create(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); @@ -6058,7 +6076,7 @@ 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); + create(viaBotId, views, fwd->authorOriginal()->id, fwd->fromOriginal()->id, fwd->authorOriginal()->isChannel() ? fwd->id : 0); if (HistoryMedia *mediaOriginal = fwd->getMedia()) { _media = mediaOriginal->clone(); @@ -6073,7 +6091,7 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id, , _textWidth(0) , _textHeight(0) , _media(0) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1, 0, 0); + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); setText(msg, entities); } @@ -6084,7 +6102,7 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _textWidth(0) , _textHeight(0) , _media(0) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1, 0, 0); + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); @@ -6096,14 +6114,14 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _textWidth(0) , _textHeight(0) , _media(0) { - create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1, 0, 0); + create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); _media = new HistoryPhoto(photo, caption, this); _media->regItem(this); setText(QString(), EntitiesInText()); } -void HistoryMessage::create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal) { +void HistoryMessage::create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal, MsgId originalId) { uint64 mask = 0; if (viaBotId) { mask |= HistoryMessageVia::Bit(); @@ -6116,9 +6134,6 @@ void HistoryMessage::create(int32 viaBotId, int32 viewsCount, const PeerId &auth } if (authorIdOriginal && fromIdOriginal) { mask |= HistoryMessageForwarded::Bit(); - if (authorIdOriginal != fromIdOriginal) { - mask |= HistoryMessageSigned::Bit(); - } } UpdateInterfaces(mask); if (HistoryMessageVia *via = Get()) { @@ -6133,6 +6148,7 @@ void HistoryMessage::create(int32 viaBotId, int32 viewsCount, const PeerId &auth if (HistoryMessageForwarded *fwd = Get()) { fwd->_authorOriginal = App::peer(authorIdOriginal); fwd->_fromOriginal = App::peer(fromIdOriginal); + fwd->_originalId = originalId; } initTime(); } @@ -6239,7 +6255,7 @@ void HistoryMessage::initDimensions() { HistoryMessageForwarded *fwd = Get(); HistoryMessageVia *via = Get(); if (fwd) { - fwd->authorNameUpdated(via != 0); + fwd->create(via); } if (_media) { @@ -6281,7 +6297,7 @@ void HistoryMessage::initDimensions() { } } if (fwd) { - int32 _namew = st::msgPadding.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + st::msgPadding.right(); + int32 _namew = st::msgPadding.left() + fwd->_text.maxWidth() + st::msgPadding.right(); if (via) { _namew += st::msgServiceFont->spacew + via->_maxWidth; } @@ -6374,9 +6390,9 @@ QString HistoryMessage::selectedText(uint32 selection) const { } if (const HistoryMessageForwarded *fwd = Get()) { if (selection == FullSelection) { - QString wrapped; - wrapped.reserve(lang(lng_forwarded_from).size() + fwd->_authorOriginal->name.size() + 4 + result.size()); - wrapped.append('[').append(lang(lng_forwarded_from)).append(' ').append(fwd->_authorOriginal->name).append(qsl("]\n")).append(result); + QString fwdinfo = fwd->_text.original(0, 0xFFFF, Text::ExpandLinksAll), wrapped; + wrapped.reserve(fwdinfo.size() + 4 + result.size()); + wrapped.append('[').append(fwdinfo).append(qsl("]\n")).append(result); result = wrapped; } } @@ -6592,12 +6608,6 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m if (displayFromName() && author()->nameVersion > _authorNameVersion) { fromNameUpdated(width); } - if (fwd && fwd->_authorOriginal->nameVersion > fwd->_authorOriginalVersion) { - fwd->authorNameUpdated(via != 0); - if (via) { - via->resize(width - st::msgPadding.left() - st::msgPadding.right() - fwd->_fromWidth - fwd->_authorOriginalName.maxWidth() - st::msgServiceFont->spacew); - } - } QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); @@ -6649,8 +6659,19 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m void HistoryMessage::drawMessageText(Painter &p, QRect trect, uint32 selection) const { if (displayForwardedFrom()) { - paintForwardedInfo(p, trect.x(), trect.y(), trect.width(), (selection == FullSelection)); - trect.setY(trect.y() + st::msgServiceNameFont->height); + style::font serviceFont(st::msgServiceFont), serviceName(st::msgServiceNameFont); + + bool outbg = out() && !isPost(); + p.setPen((selection == FullSelection) ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); + p.setFont(serviceFont); + + const HistoryMessageForwarded *fwd = Get(); + bool breakEverywhere = (fwd->_text.countHeight(trect.width()) > 2 * serviceFont->height); + textstyleSet(&((selection == FullSelection) ? (outbg ? st::outFwdTextStyleSelected : st::inFwdTextStyleSelected) : (outbg ? st::outFwdTextStyle : st::inFwdTextStyle))); + fwd->_text.drawElided(p, trect.x(), trect.y(), trect.width(), 2, style::al_left, 0, -1, 0, breakEverywhere); + textstyleRestore(); + + trect.setY(trect.y() + (((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * serviceFont->height)); } bool outbg = out() && !isPost(), selected = (selection == FullSelection); @@ -6729,15 +6750,14 @@ int32 HistoryMessage::resize(int32 width) { } if (displayForwardedFrom()) { + int32 l = 0, w = 0; + countPositionAndSize(l, w); + int32 fwdheight = ((fwd->_text.maxWidth() > (w - st::msgPadding.left() - st::msgPadding.right())) ? 2 : 1) * st::semiboldFont->height; + if (emptyText() && !displayFromName()) { - _height += st::msgPadding.top() + st::msgServiceNameFont->height + st::mediaHeaderSkip; + _height += st::msgPadding.top() + fwdheight + st::mediaHeaderSkip; } else { - _height += st::msgServiceNameFont->height; - } - if (via) { - int32 l = 0, w = 0; - countPositionAndSize(l, w); - via->resize(w - st::msgPadding.left() - st::msgPadding.right() - fwd->_fromWidth - fwd->_authorOriginalName.maxWidth() - st::msgServiceFont->spacew); + _height += fwdheight; } } } else { @@ -6753,10 +6773,6 @@ bool HistoryMessage::hasPoint(int32 x, int32 y) const { if (width < 1) return false; if (drawBubble()) { - if (displayForwardedFrom()) { - QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); - return r.contains(x, y); - } QRect r(left, st::msgMargin.top(), width, _height - st::msgMargin.top() - st::msgMargin.bottom()); return r.contains(x, y); } else { @@ -6817,18 +6833,20 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 } if (displayForwardedFrom()) { QRect trect(r.marginsAdded(-st::msgPadding)); - if (y >= trect.top() && y < trect.top() + st::msgServiceNameFont->height) { - if (x >= trect.left() + fwd->_fromWidth && x < trect.right() && x < trect.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth()) { - lnk = fwd->_authorOriginal->lnk; - } else if (via && x >= trect.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + st::msgServiceFont->spacew && x < trect.right() && x < trect.left() + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + st::msgServiceFont->spacew + via->_maxWidth) { - lnk = via->_lnk; - } else { - lnk = TextLinkPtr(); + int32 fwdheight = ((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * st::semiboldFont->height; + if (y >= trect.top() && y < trect.top() + fwdheight) { + bool inText = false; + bool breakEverywhere = (fwd->_text.countHeight(trect.width()) > 2 * st::semiboldFont->height); + textstyleSet(&st::inFwdTextStyle); + fwd->_text.getState(lnk, inText, x - trect.left(), y - trect.top(), trect.right() - trect.left(), style::al_left, breakEverywhere); + textstyleRestore(); + if (breakEverywhere) { + state = HistoryInForwardedCursorState; } return; } - y -= st::msgServiceNameFont->height; - r.setHeight(r.height() - st::msgServiceNameFont->height); + y -= fwdheight; + r.setHeight(r.height() - fwdheight); } getStateFromMessageText(lnk, state, x, y, r); } else { @@ -6899,11 +6917,12 @@ void HistoryMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, } else if (via && !fwd) { r.setTop(r.top() + st::msgNameFont->height); } - if (displayForwardedFrom()) { - y -= st::msgServiceNameFont->height; - r.setHeight(r.height() - st::msgServiceNameFont->height); - } QRect trect(r.marginsAdded(-st::msgPadding)); + if (displayForwardedFrom()) { + int32 fwdheight = ((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * st::semiboldFont->height; + y -= fwdheight; + r.setHeight(r.height() - fwdheight); + } if (_media && _media->isDisplayed()) { trect.setBottom(trect.bottom() - _media->height()); } @@ -6956,32 +6975,6 @@ HistoryMessage::~HistoryMessage() { } } -void HistoryMessage::paintForwardedInfo(Painter &p, int32 x, int32 y, int32 w, bool selected) const { - style::font serviceFont(st::msgServiceFont), serviceName(st::msgServiceNameFont); - - bool outbg = out() && !isPost(); - p.setPen((selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg))->p); - p.setFont(serviceFont); - - const HistoryMessageForwarded *fwd = Get(); - const HistoryMessageVia *via = Get(); - if (via && w > fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + serviceFont->spacew) { - p.drawText(x, y + serviceFont->ascent, lang(lng_forwarded_from)); - - p.setFont(serviceName); - fwd->_authorOriginalName.draw(p, x + fwd->_fromWidth, y, w - fwd->_fromWidth); - - p.drawText(x + fwd->_fromWidth + fwd->_authorOriginalName.maxWidth() + serviceFont->spacew, y + serviceFont->ascent, via->_text); - } else if (w > fwd->_fromWidth) { - p.drawText(x, y + serviceFont->ascent, lang(lng_forwarded_from)); - - p.setFont(serviceName); - fwd->_authorOriginalName.drawElided(p, x + fwd->_fromWidth, y, w - fwd->_fromWidth); - } else { - p.drawText(x, y + serviceFont->ascent, serviceFont->elided(lang(lng_forwarded_from), w)); - } -} - HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg) , replyToMsgId(msg.vreply_to_msg_id.v) , replyToMsg(0) diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index fbcc1e7da9..6b20310bed 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -769,7 +769,8 @@ class HistoryMessage; // dynamic_cast optimize enum HistoryCursorState { HistoryDefaultCursorState, HistoryInTextCursorState, - HistoryInDateCursorState + HistoryInDateCursorState, + HistoryInForwardedCursorState, }; enum InfoDisplayType { @@ -819,13 +820,12 @@ struct HistoryMessageSigned : public BasicInterface { struct HistoryMessageForwarded : public BasicInterface { HistoryMessageForwarded(Interfaces *); - void authorNameUpdated(bool hasVia) const; + void create(const HistoryMessageVia *via) const; bool display(bool hasVia) const; PeerData *_authorOriginal, *_fromOriginal; - mutable Text _authorOriginalName; - mutable int32 _authorOriginalVersion; - int32 _fromWidth; + MsgId _originalId; + mutable Text _text; }; class HistoryMedia; @@ -2116,7 +2116,7 @@ public: protected: - void create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal); + void create(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal = 0, const PeerId &fromIdOriginal = 0, MsgId originalId = 0); bool displayForwardedFrom() const { if (const HistoryMessageForwarded *fwd = Get()) { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 99e07198d3..30048f24f1 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1610,10 +1610,10 @@ void HistoryInner::onUpdateSelected() { } } } - if (_dragCursorState == HistoryInDateCursorState && cursorState != HistoryInDateCursorState) { + if (cursorState != _dragCursorState) { PopupTooltip::Hide(); } - if (lnk || cursorState == HistoryInDateCursorState) { + if (lnk || cursorState == HistoryInDateCursorState || cursorState == HistoryInForwardedCursorState) { PopupTooltip::Show(1000, this); } @@ -1859,6 +1859,12 @@ QString HistoryInner::tooltipText() const { if (App::hoveredItem()) { return App::hoveredItem()->date.toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)); } + } else if (_dragCursorState == HistoryInForwardedCursorState && _dragAction == NoDrag) { + if (App::hoveredItem()) { + if (HistoryMessageForwarded *fwd = App::hoveredItem()->Get()) { + return fwd->_text.original(0, 0xFFFF, Text::ExpandLinksNone); + } + } } return QString(); } @@ -5532,14 +5538,14 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif flags |= MTPDmessage::flag_from_id; } if (file->type == PreparePhoto) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), 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_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); } else if (file->type == PrepareDocument) { - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), 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_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); } else if (file->type == PrepareAudio) { if (!h->peer->isChannel()) { flags |= MTPDmessage::flag_media_unread; } - h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(showFromName ? 0 : MTP::authedId()), 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_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); } if (_peer && file->to.peer == _peer->id) { diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 90f1415c65..3e792b0145 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -700,7 +700,7 @@ void LayoutOverviewVoice::getState(TextLinkPtr &link, HistoryCursorState &cursor void LayoutOverviewVoice::updateName() const { int32 version = 0; if (const HistoryMessageForwarded *fwd = _parent->Get()) { - _name.setText(st::semiboldFont, lang(lng_forwarded_from) + ' ' + App::peerName(_parent->fromOriginal()), _textNameOptions); + _name.setText(st::semiboldFont, lng_forwarded(lt_original, App::peerName(_parent->fromOriginal())), _textNameOptions); } else { _name.setText(st::semiboldFont, App::peerName(_parent->from()), _textNameOptions); } From 3a919628b3a8875dc46f96348b2303ff4949a903 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 18 Feb 2016 21:28:38 -0300 Subject: [PATCH 099/316] Include some reference XDG files Include a .desktop file (for app menu in xdg-complaint desktops), and tg.protocol (for having xdg-complaint apps pick up the tg: protocol). Signed-off-by: Hugo Osvaldo Barrera (github: hobarrera) --- lib/xdg/telegramdesktop.desktop | 12 ++++++++++++ lib/xdg/tg.protocol | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 lib/xdg/telegramdesktop.desktop create mode 100644 lib/xdg/tg.protocol diff --git a/lib/xdg/telegramdesktop.desktop b/lib/xdg/telegramdesktop.desktop new file mode 100644 index 0000000000..2151d0ad45 --- /dev/null +++ b/lib/xdg/telegramdesktop.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Telegram Desktop +Comment=Official desktop version of Telegram messaging app +Exec=/usr/bin/telegram-desktop -- %u +Icon=telegram-desktop +Terminal=false +StartupWMClass=Telegram +Type=Application +Categories=Network; +MimeType=application/x-xdg-protocol-tg;x-scheme-handler/tg; diff --git a/lib/xdg/tg.protocol b/lib/xdg/tg.protocol new file mode 100644 index 0000000000..a4b083acb1 --- /dev/null +++ b/lib/xdg/tg.protocol @@ -0,0 +1,11 @@ +[Protocol] +exec=/usr/bin/telegram-desktop -- %u +protocol=tg +input=none +output=none +helper=true +listing=false +reading=false +writing=false +makedir=false +deleting=false From 29fefbc4bb0b33bdd218020d8238a65d8159a90b Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 15:30:16 +0300 Subject: [PATCH 100/316] post edit started, sign messages checkbox added in channel edit by creator --- Telegram/Resources/lang.strings | 5 + Telegram/Resources/style.txt | 5 + Telegram/SourceFiles/boxes/addcontactbox.cpp | 82 ++++- Telegram/SourceFiles/boxes/addcontactbox.h | 5 +- Telegram/SourceFiles/boxes/photosendbox.cpp | 306 +++++++++++++++++++ Telegram/SourceFiles/boxes/photosendbox.h | 57 +++- Telegram/SourceFiles/facades.cpp | 10 +- Telegram/SourceFiles/history.cpp | 33 +- Telegram/SourceFiles/history.h | 2 + Telegram/SourceFiles/historywidget.cpp | 36 ++- Telegram/SourceFiles/historywidget.h | 1 + Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/structs.h | 2 + 13 files changed, 508 insertions(+), 38 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index be3832f2a1..a1badd427f 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -123,6 +123,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "Internal server error."; "lng_flood_error" = "Too many tries. Please try again later."; "lng_gif_error" = "An error has occured while reading GIF animation :("; +"lng_edit_error" = "You cannot edit this message"; "lng_deleted" = "Unknown"; "lng_deleted_message" = "Deleted message"; @@ -737,6 +738,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "Save GIF"; "lng_context_to_msg" = "Go To Message"; "lng_context_reply_msg" = "Reply"; +"lng_context_edit_msg" = "Edit"; "lng_context_forward_msg" = "Forward Message"; "lng_context_delete_msg" = "Delete Message"; "lng_context_select_msg" = "Select Message"; @@ -753,6 +755,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Could not send a file, because it is larger than 1.5 GB :("; "lng_send_folder" = "Could not send «{name}» because it is a directory :("; +"lng_edit_placeholder" = "Message text"; + "lng_forward_choose" = "Choose recipient.."; "lng_forward_cant" = "Sorry, no way to forward here :("; "lng_forward_confirm" = "Forward to {recipient}?"; @@ -773,6 +777,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "Edit group name"; "lng_edit_contact_title" = "Edit contact name"; "lng_edit_channel_title" = "Edit channel"; +"lng_edit_sign_messages" = "Sign messages"; "lng_edit_group" = "Edit group"; "lng_edit_self_title" = "Edit your name"; "lng_confirm_contact_data" = "New Contact"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 3a9794fe14..a8f7e3c32e 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -2438,3 +2438,8 @@ inlineRowBorder: linksBorder; inlineRowBorderFg: linksBorderFg; inlineResultsMinWidth: 64px; inlineDurationMargin: 3px; + +editTextArea: InputArea(defaultInputArea) { + textMargins: margins(1px, 6px, 1px, 4px); + heightMax: 256px; +} diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 2a710d7aa8..86accc4bc9 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -1150,14 +1150,17 @@ void EditNameTitleBox::onSaveChatDone(const MTPUpdates &updates) { emit closed(); } -EditChannelBox::EditChannelBox(ChannelData *channel) : -_channel(channel), -_save(this, lang(lng_settings_save), st::defaultBoxButton), -_cancel(this, lang(lng_cancel), st::cancelBoxButton), -_title(this, st::defaultInputField, lang(lng_dlg_new_channel_name), _channel->name), -_description(this, st::newGroupDescription, lang(lng_create_group_description), _channel->about), -_publicLink(this, lang(channel->isPublic() ? lng_profile_edit_public_link : lng_profile_create_public_link), st::defaultBoxLinkButton), -_saveTitleRequestId(0), _saveDescriptionRequestId(0) { +EditChannelBox::EditChannelBox(ChannelData *channel) : AbstractBox() +, _channel(channel) +, _save(this, lang(lng_settings_save), st::defaultBoxButton) +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) +, _title(this, st::defaultInputField, lang(lng_dlg_new_channel_name), _channel->name) +, _description(this, st::newGroupDescription, lang(lng_create_group_description), _channel->about) +, _sign(this, lang(lng_edit_sign_messages), channel->addsSignature()) +, _publicLink(this, lang(channel->isPublic() ? lng_profile_edit_public_link : lng_profile_create_public_link), st::defaultBoxLinkButton) +, _saveTitleRequestId(0) +, _saveDescriptionRequestId(0) +, _saveSignRequestId(0) { connect(App::main(), SIGNAL(peerNameChanged(PeerData*, const PeerData::Names&, const PeerData::NameFirstChars&)), this, SLOT(peerUpdated(PeerData*))); setMouseTracking(true); @@ -1183,6 +1186,7 @@ _saveTitleRequestId(0), _saveDescriptionRequestId(0) { void EditChannelBox::hideAll() { _title.hide(); _description.hide(); + _sign.hide(); _save.hide(); _cancel.hide(); _publicLink.hide(); @@ -1195,8 +1199,10 @@ void EditChannelBox::showAll() { _cancel.show(); if (_channel->isMegagroup()) { _publicLink.hide(); + _sign.hide(); } else { _publicLink.show(); + _sign.show(); } } @@ -1224,6 +1230,7 @@ void EditChannelBox::paintEvent(QPaintEvent *e) { void EditChannelBox::peerUpdated(PeerData *peer) { if (peer == _channel) { _publicLink.setText(lang(_channel->isPublic() ? lng_profile_edit_public_link : lng_profile_create_public_link)); + _sign.setChecked(_channel->addsSignature()); } } @@ -1235,6 +1242,9 @@ void EditChannelBox::onDescriptionResized() { void EditChannelBox::updateMaxHeight() { int32 h = st::boxTitleHeight + st::newGroupInfoPadding.top() + _title.height(); h += st::newGroupDescriptionPadding.top() + _description.height() + st::newGroupDescriptionPadding.bottom(); + if (!_channel->isMegagroup()) { + h += st::newGroupPublicLinkPadding.top() + _sign.height() + st::newGroupPublicLinkPadding.bottom(); + } h += st::newGroupPublicLinkPadding.top() + _publicLink.height() + st::newGroupPublicLinkPadding.bottom(); h += st::boxPadding.bottom() + st::newGroupInfoPadding.bottom() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom(); setMaxHeight(h); @@ -1246,14 +1256,16 @@ void EditChannelBox::resizeEvent(QResizeEvent *e) { _description.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _title.y() + _title.height() + st::newGroupDescriptionPadding.top()); - _publicLink.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _description.y() + _description.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); + _sign.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _description.y() + _description.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); + + _publicLink.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _sign.y() + _sign.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); _save.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _save.height()); _cancel.moveToRight(st::boxButtonPadding.right() + _save.width() + st::boxButtonPadding.left(), _save.y()); } void EditChannelBox::onSave() { - if (_saveTitleRequestId || _saveDescriptionRequestId) return; + if (_saveTitleRequestId || _saveDescriptionRequestId || _saveSignRequestId) return; QString title = prepareText(_title.getLastText()), description = prepareText(_description.getLastText(), true); if (title.isEmpty()) { @@ -1263,7 +1275,11 @@ void EditChannelBox::onSave() { } _sentTitle = title; _sentDescription = description; - _saveTitleRequestId = MTP::send(MTPchannels_EditTitle(_channel->inputChannel, MTP_string(_sentTitle)), rpcDone(&EditChannelBox::onSaveTitleDone), rpcFail(&EditChannelBox::onSaveFail)); + if (_sentTitle == _channel->name) { + saveDescription(); + } else { + _saveTitleRequestId = MTP::send(MTPchannels_EditTitle(_channel->inputChannel, MTP_string(_sentTitle)), rpcDone(&EditChannelBox::onSaveTitleDone), rpcFail(&EditChannelBox::onSaveFail)); + } } void EditChannelBox::onPublicLink() { @@ -1271,7 +1287,19 @@ void EditChannelBox::onPublicLink() { } void EditChannelBox::saveDescription() { - _saveDescriptionRequestId = MTP::send(MTPchannels_EditAbout(_channel->inputChannel, MTP_string(_sentDescription)), rpcDone(&EditChannelBox::onSaveDescriptionDone), rpcFail(&EditChannelBox::onSaveFail)); + if (_sentDescription == _channel->about) { + saveSign(); + } else { + _saveDescriptionRequestId = MTP::send(MTPchannels_EditAbout(_channel->inputChannel, MTP_string(_sentDescription)), rpcDone(&EditChannelBox::onSaveDescriptionDone), rpcFail(&EditChannelBox::onSaveFail)); + } +} + +void EditChannelBox::saveSign() { + if (_channel->isMegagroup() || _channel->addsSignature() == _sign.checked()) { + onClose(); + } else { + _saveSignRequestId = MTP::send(MTPchannels_ToggleSignatures(_channel->inputChannel, MTP_bool(_sign.checked())), rpcDone(&EditChannelBox::onSaveSignDone), rpcFail(&EditChannelBox::onSaveFail)); + } } bool EditChannelBox::onSaveFail(const RPCError &error, mtpRequestId req) { @@ -1295,24 +1323,46 @@ bool EditChannelBox::onSaveFail(const RPCError &error, mtpRequestId req) { _saveDescriptionRequestId = 0; if (err == qstr("CHAT_ABOUT_NOT_MODIFIED")) { _channel->about = _sentDescription; - if (App::api()) emit App::api()->fullPeerUpdated(_channel); - onClose(); + if (App::api()) { + emit App::api()->fullPeerUpdated(_channel); + } + saveSign(); + return true; } else { _description.setFocus(); } + } else if (req == _saveSignRequestId) { + _saveSignRequestId = 0; + if (err == qstr("CHAT_NOT_MODIFIED")) { + onClose(); + return true; + } } return true; } void EditChannelBox::onSaveTitleDone(const MTPUpdates &updates) { _saveTitleRequestId = 0; - App::main()->sentUpdatesReceived(updates); + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } saveDescription(); } void EditChannelBox::onSaveDescriptionDone(const MTPBool &result) { _saveDescriptionRequestId = 0; _channel->about = _sentDescription; - if (App::api()) emit App::api()->fullPeerUpdated(_channel); + if (App::api()) { + emit App::api()->fullPeerUpdated(_channel); + } + saveSign(); +} + +void EditChannelBox::onSaveSignDone(const MTPUpdates &updates) { + _saveSignRequestId = 0; + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } onClose(); } + diff --git a/Telegram/SourceFiles/boxes/addcontactbox.h b/Telegram/SourceFiles/boxes/addcontactbox.h index 0289bc3d53..55e89f3e68 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.h +++ b/Telegram/SourceFiles/boxes/addcontactbox.h @@ -315,18 +315,21 @@ private: void onSaveTitleDone(const MTPUpdates &updates); void onSaveDescriptionDone(const MTPBool &result); + void onSaveSignDone(const MTPUpdates &updates); bool onSaveFail(const RPCError &e, mtpRequestId req); void saveDescription(); + void saveSign(); ChannelData *_channel; BoxButton _save, _cancel; InputField _title; InputArea _description; + Checkbox _sign; LinkButton _publicLink; - mtpRequestId _saveTitleRequestId, _saveDescriptionRequestId; + mtpRequestId _saveTitleRequestId, _saveDescriptionRequestId, _saveSignRequestId; QString _sentTitle, _sentDescription; }; diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index 1a25dd55ec..4bc63c021d 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -359,3 +359,309 @@ void PhotoSendBox::onSend(bool ctrlShiftEnter) { _confirmed = true; onClose(); } + +EditPostBox::EditPostBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) +, _msg(msg) +, _animated(false) +, _photo(false) +, _doc(false) +, _text(0) +, _save(this, lang(lng_settings_save), st::defaultBoxButton) +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) +, _thumbx(0) +, _thumby(0) +, _thumbw(0) +, _thumbh(0) +, _statusw(0) +, _isImage(false) +, _previewCancelled(false) +, _saveRequestId(0) { + connect(&_save, SIGNAL(clicked()), this, SLOT(onSave())); + connect(&_cancel, SIGNAL(clicked()), this, SLOT(onClose())); + + QSize dimensions; + ImagePtr image; + QString caption; + DocumentData *doc = 0; + if (HistoryMedia *media = _msg->getMedia()) { + HistoryMediaType t = media->type(); + switch (t) { + case MediaTypeGif: { + _animated = true; + doc = static_cast(media)->getDocument(); + dimensions = doc->dimensions; + image = doc->thumb; + } break; + + case MediaTypePhoto: { + _photo = true; + PhotoData *photo = static_cast(media)->photo(); + dimensions = QSize(photo->full->width(), photo->full->height()); + image = photo->full; + } break; + + case MediaTypeVideo: { + _animated = true; + doc = static_cast(media)->getDocument(); + dimensions = doc->dimensions; + image = doc->thumb; + } break; + + case MediaTypeFile: + case MediaTypeMusicFile: + case MediaTypeVoiceFile: { + _doc = true; + doc = static_cast(media)->getDocument(); + image = doc->thumb; + } break; + } + caption = media->getCaption(); + } + if (!_animated && (dimensions.isEmpty() || doc) || image->isNull()) { + _animated = false; + if (image->isNull()) { + _thumbw = 0; + } else { + int32 tw = image->width(), th = image->height(); + if (tw > th) { + _thumbw = (tw * st::msgFileThumbSize) / th; + } else { + _thumbw = st::msgFileThumbSize; + } + _thumb = imagePix(image->pix().toImage(), _thumbw * cIntRetinaFactor(), 0, true, false, true, st::msgFileThumbSize, st::msgFileThumbSize); + } + + if (doc) { + if (doc->voice()) { + _name.setText(st::semiboldFont, lang(lng_media_audio), _textNameOptions); + } else { + _name.setText(st::semiboldFont, documentName(doc), _textNameOptions); + } + _status = formatSizeText(doc->size); + _statusw = qMax(_name.maxWidth(), st::normalFont->width(_status)); + _isImage = doc->isImage(); + } + } else { + int32 maxW = 0, maxH = 0; + if (_animated) { + int32 limitW = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); + int32 limitH = st::confirmMaxHeight; + maxW = dimensions.width(); + maxH = dimensions.height(); + if (maxW * limitH > maxH * limitW) { + if (maxW < limitW) { + maxH = maxH * limitW / maxW; + maxW = limitW; + } + } else { + if (maxH < limitH) { + maxW = maxW * limitH / maxH; + maxH = limitH; + } + } + _thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), true, true, false, maxW, maxH); + } else { + maxW = dimensions.width(); + maxH = dimensions.height(); + _thumb = image->pixNoCache(maxW * cIntRetinaFactor(), maxH * cIntRetinaFactor(), true, false, false, maxW, maxH); + } + int32 tw = _thumb.width(), th = _thumb.height(); + if (!tw || !th) { + tw = th = 1; + } + _thumbw = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); + if (_thumb.width() < _thumbw) { + _thumbw = (_thumb.width() > 20) ? _thumb.width() : 20; + } + int32 maxthumbh = qMin(qRound(1.5 * _thumbw), int(st::confirmMaxHeight)); + _thumbh = qRound(th * float64(_thumbw) / tw); + if (_thumbh > maxthumbh) { + _thumbw = qRound(_thumbw * float64(maxthumbh) / _thumbh); + _thumbh = maxthumbh; + if (_thumbw < 10) { + _thumbw = 10; + } + } + _thumbx = (width() - _thumbw) / 2; + + _thumb = QPixmap::fromImage(_thumb.toImage().scaled(_thumbw * cIntRetinaFactor(), _thumbh * cIntRetinaFactor(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::ColorOnly); + _thumb.setDevicePixelRatio(cRetinaFactor()); + } + + if (_animated || _photo || _doc) { + _text = new InputArea(this, st::confirmCaptionArea, lang(lng_photo_caption), caption); + _text->setMaxLength(MaxPhotoCaption); + _text->setCtrlEnterSubmit(CtrlEnterSubmitBoth); + } else { + _text = new InputArea(this, st::editTextArea, lang(lng_edit_placeholder), msg->originalText()); + _text->setMaxLength(MaxMessageSize); + _text->setCtrlEnterSubmit(cCtrlEnter() ? CtrlEnterSubmitCtrlEnter : CtrlEnterSubmitEnter); + } + updateBoxSize(); + connect(_text, SIGNAL(resized()), this, SLOT(onCaptionResized())); + connect(_text, SIGNAL(submitted(bool)), this, SLOT(onSave(bool))); + connect(_text, SIGNAL(cancelled()), this, SLOT(onClose())); + + QTextCursor c(_text->textCursor()); + c.movePosition(QTextCursor::End); + _text->setTextCursor(c); + + prepare(); +} + +void EditPostBox::onCaptionResized() { + updateBoxSize(); + resizeEvent(0); + update(); +} + +void EditPostBox::updateBoxSize() { + if (_photo || _animated) { + setMaxHeight(st::boxPhotoPadding.top() + _thumbh + st::boxPhotoPadding.bottom() + st::boxPhotoCompressedPadding.bottom() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + } else if (_thumbw) { + setMaxHeight(st::boxPhotoPadding.top() + st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom() + st::boxPhotoPadding.bottom() + st::boxPhotoCompressedPadding.bottom() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + } else if (_doc) { + setMaxHeight(st::boxPhotoPadding.top() + st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom() + st::boxPhotoPadding.bottom() + st::boxPhotoCompressedPadding.bottom() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + } else { + setMaxHeight(st::boxPhotoPadding.top() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + } +} + +void EditPostBox::paintEvent(QPaintEvent *e) { + Painter p(this); + if (paint(p)) return; + + if (_photo || _animated) { + if (_thumbx > st::boxPhotoPadding.left()) { + p.fillRect(st::boxPhotoPadding.left(), st::boxPhotoPadding.top(), _thumbx - st::boxPhotoPadding.left(), _thumbh, st::confirmBg->b); + } + if (_thumbx + _thumbw < width() - st::boxPhotoPadding.right()) { + p.fillRect(_thumbx + _thumbw, st::boxPhotoPadding.top(), width() - st::boxPhotoPadding.right() - _thumbx - _thumbw, _thumbh, st::confirmBg->b); + } + p.drawPixmap(_thumbx, st::boxPhotoPadding.top(), _thumb); + if (_animated) { + QRect inner(_thumbx + (_thumbw - st::msgFileSize) / 2, st::boxPhotoPadding.top() + (_thumbh - st::msgFileSize) / 2, st::msgFileSize, st::msgFileSize); + p.setPen(Qt::NoPen); + p.setBrush(st::msgDateImgBg); + + p.setRenderHint(QPainter::HighQualityAntialiasing); + p.drawEllipse(inner); + p.setRenderHint(QPainter::HighQualityAntialiasing, false); + + p.drawSpriteCenter(inner, st::msgFileInPlay); + } + } else if (_doc) { + int32 w = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); + int32 h = _thumbw ? (st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom()) : (st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom()); + int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0; + if (_thumbw) { + nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); + nametop = st::msgFileThumbNameTop; + nameright = st::msgFileThumbPadding.left(); + statustop = st::msgFileThumbStatusTop; + linktop = st::msgFileThumbLinkTop; + } else { + nameleft = st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); + nametop = st::msgFileNameTop; + nameright = st::msgFilePadding.left(); + statustop = st::msgFileStatusTop; + } + int32 namewidth = w - nameleft - (_thumbw ? st::msgFileThumbPadding.left() : st::msgFilePadding.left()); + if (namewidth > _statusw) { + w -= (namewidth - _statusw); + namewidth = _statusw; + } + int32 x = (width() - w) / 2, y = st::boxPhotoPadding.top(); + + App::roundRect(p, x, y, w, h, st::msgOutBg, MessageOutCorners, &st::msgOutShadow); + + if (_thumbw) { + QRect rthumb(rtlrect(x + st::msgFileThumbPadding.left(), y + st::msgFileThumbPadding.top(), st::msgFileThumbSize, st::msgFileThumbSize, width())); + p.drawPixmap(rthumb.topLeft(), _thumb); + } else { + QRect inner(rtlrect(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, width())); + p.setPen(Qt::NoPen); + p.setBrush(st::msgFileOutBg); + + p.setRenderHint(QPainter::HighQualityAntialiasing); + p.drawEllipse(inner); + p.setRenderHint(QPainter::HighQualityAntialiasing, false); + + p.drawSpriteCenter(inner, _isImage ? st::msgFileOutImage : st::msgFileOutFile); + } + p.setFont(st::semiboldFont); + p.setPen(st::black); + _name.drawLeftElided(p, x + nameleft, y + nametop, namewidth, width()); + + style::color status(st::mediaOutFg); + p.setFont(st::normalFont); + p.setPen(status); + p.drawTextLeft(x + nameleft, y + statustop, width(), _status); + } +} + +void EditPostBox::resizeEvent(QResizeEvent *e) { + _save.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _save.height()); + _cancel.moveToRight(st::boxButtonPadding.right() + _save.width() + st::boxButtonPadding.left(), _save.y()); + _text->resize(st::boxWideWidth - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(), _text->height()); + _text->moveToLeft(st::boxPhotoPadding.left(), _save.y() - st::boxButtonPadding.top() - _text->height()); +} + +void EditPostBox::hideAll() { + _save.hide(); + _cancel.hide(); + _text->hide(); +} + +void EditPostBox::showAll() { + _save.show(); + _cancel.show(); + _text->show(); +} + +void EditPostBox::showDone() { + setInnerFocus(); +} + +void EditPostBox::onSave(bool ctrlShiftEnter) { + if (_saveRequestId) return; + + int32 flags = 0; + if (_previewCancelled) { + flags |= MTPchannels_EditMessage::flag_no_webpage; + } + EntitiesInText sendingEntities; + MTPVector sentEntities = linksToMTP(sendingEntities, true); + if (!sentEntities.c_vector().v.isEmpty()) { + flags |= MTPmessages_SendMessage::flag_entities; + } + _saveRequestId = MTP::send(MTPchannels_EditMessage(MTP_int(flags), _msg->history()->peer->asChannel()->inputChannel, MTP_int(_msg->id), MTP_string(_text->getLastText()), sentEntities), rpcDone(&EditPostBox::saveDone), rpcFail(&EditPostBox::saveFail)); +} + +void EditPostBox::saveDone(const MTPUpdates &updates) { + _saveRequestId = 0; + onClose(); + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } +} + +bool EditPostBox::saveFail(const RPCError &error) { + if (mtpIsFlood(error)) return false; + + _saveRequestId = 0; + QString err = error.type(); + if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) { + _error = lang(lng_edit_error); + } else if (err == qstr("MESSAGE_NOT_MODIFIED")) { + onClose(); + return true; + } else if (err == qstr("MESSAGE_EMPTY")) { + _text->setFocus(); + _text->showError(); + } else { + _error = lang(lng_edit_error); + } + update(); + return true; +} diff --git a/Telegram/SourceFiles/boxes/photosendbox.h b/Telegram/SourceFiles/boxes/photosendbox.h index 1cd4bbf00e..462e8bc503 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.h +++ b/Telegram/SourceFiles/boxes/photosendbox.h @@ -42,11 +42,6 @@ public: } } -signals: - - void confirmed(); - void cancelled(); - public slots: void onCompressedChange(); @@ -87,3 +82,55 @@ private: bool _confirmed; }; + +class EditPostBox : public AbstractBox, public RPCSender { + Q_OBJECT + +public: + + EditPostBox(HistoryItem *msg); + void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e); + + void setInnerFocus() { + _text->setFocus(); + } + +public slots: + + void onCaptionResized(); + void onSave(bool ctrlShiftEnter = false); + +protected: + + void hideAll(); + void showAll(); + void showDone(); + +private: + + void updateBoxSize(); + + void saveDone(const MTPUpdates &updates); + bool saveFail(const RPCError &error); + + HistoryItem *_msg; + bool _animated, _photo, _doc; + + QPixmap _thumb; + + InputArea *_text; + BoxButton _save, _cancel; + + int32 _thumbx, _thumby, _thumbw, _thumbh; + Text _name; + QString _status; + int32 _statusw; + bool _isImage; + + bool _previewCancelled; + mtpRequestId _saveRequestId; + + QString _error; + +}; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 70c257e9a2..6e7a621c3e 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -364,11 +364,11 @@ struct GlobalDataStruct { int32 OnlineCloudTimeout = 300000; int32 NotifyCloudDelay = 30000; int32 NotifyDefaultDelay = 1500; - int32 ChatBigSize = 190; // ? - int32 PushChatPeriod = 0; // ? - int32 PushChatLimit = 0; // ? - int32 SavedGifsLimit = 100; - int32 EditTimeLimit = 0; // ? + int32 ChatBigSize = 10; + int32 PushChatPeriod = 60000; + int32 PushChatLimit = 2; + int32 SavedGifsLimit = 200; + int32 EditTimeLimit = 172800; }; GlobalDataStruct *GlobalData = 0; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 6ef6b30c57..ffa79820b9 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2911,6 +2911,33 @@ bool HistoryItem::displayFromPhoto() const { return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !isPost(); } +bool HistoryItem::canEdit(const QDateTime &cur) const { + ChannelData *channel = _history->peer->asChannel(); + int32 s = date.secsTo(cur); + if (!channel || id < 0 || date.secsTo(cur) >= Global::EditTimeLimit()) return false; + + if (const HistoryMessage *msg = toHistoryMessage()) { + if (msg->Is() || msg->Is()) return false; + + if (HistoryMedia *media = msg->getMedia()) { + HistoryMediaType t = media->type(); + if (t != MediaTypePhoto && + t != MediaTypeVideo && + t != MediaTypeFile && + t != MediaTypeGif && + t != MediaTypeMusicFile && + t != MediaTypeVoiceFile) { + return false; + } + } + if (isPost()) { + return (channel->amCreator() || (channel->amEditor() && out())); + } + return out(); + } + return false; +} + void HistoryItem::clipCallback(ClipReaderNotification notification) { HistoryMedia *media = getMedia(); if (!media) return; @@ -3829,13 +3856,13 @@ void HistoryDocument::create(bool caption) { mask |= HistoryDocumentVoice::Bit(); } else { mask |= HistoryDocumentNamed::Bit(); - if (caption) { - mask |= HistoryDocumentCaptioned::Bit(); - } if (!_data->song() && !_data->thumb->isNull() && _data->thumb->width() && _data->thumb->height()) { mask |= HistoryDocumentThumbed::Bit(); } } + if (caption) { + mask |= HistoryDocumentCaptioned::Bit(); + } UpdateInterfaces(mask); if (HistoryDocumentThumbed *thumbed = Get()) { thumbed->_linksavel.reset(new DocumentSaveLink(_data)); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 6b20310bed..d1e410d1fd 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -987,6 +987,8 @@ public: return (channel->amEditor() || channel->amModerator() || out()); } + bool canEdit(const QDateTime &cur) const; + int32 y; MsgId id; QDateTime date; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 30048f24f1..8835be63bf 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -870,8 +870,13 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); } - if (item && item->id > 0 && isUponSelected != 2 && isUponSelected != -2 && canSendMessages) { - _menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage())); + if (item && item->id > 0 && isUponSelected != 2 && isUponSelected != -2) { + if (canSendMessages) { + _menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage())); + } + if (item->canEdit(::date(unixtime()))) { + _menu->addAction(lang(lng_context_edit_msg), _widget, SLOT(onEditMessage())); + } } if (lnkPhoto) { _menu->addAction(lang(lng_context_open_image), this, SLOT(openContextUrl()))->setEnabled(true); @@ -920,12 +925,22 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); - if (item && item->id > 0 && isUponSelected != 2 && canSendMessages) { - _menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage())); + if (item && item->id > 0 && isUponSelected != 2) { + if (canSendMessages) { + _menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage())); + } + if (item->canEdit(::date(unixtime()))) { + _menu->addAction(lang(lng_context_edit_msg), _widget, SLOT(onEditMessage())); + } } } else { - if (item && item->id > 0 && isUponSelected != -2 && canSendMessages) { - _menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage())); + if (item && item->id > 0 && isUponSelected != -2) { + if (canSendMessages) { + _menu->addAction(lang(lng_context_reply_msg), _widget, SLOT(onReplyToMessage())); + } + if (item->canEdit(::date(unixtime()))) { + _menu->addAction(lang(lng_context_edit_msg), _widget, SLOT(onEditMessage())); + } } if (item && !isUponSelected && !_contextMenuLnk) { if (HistoryMedia *media = (msg ? msg->getMedia() : 0)) { @@ -4422,7 +4437,7 @@ void HistoryWidget::onSend(bool ctrlShiftEnter, MsgId replyTo) { bool lastKeyboardUsed = lastForceReplyReplied(FullMsgId(_channel, replyTo)); - WebPageId webPageId = _previewCancelled ? 0xFFFFFFFFFFFFFFFFULL : ((_previewData && _previewData->pendingTill >= 0) ? _previewData->id : 0); + WebPageId webPageId = _previewCancelled ? CancelledWebPageId : ((_previewData && _previewData->pendingTill >= 0) ? _previewData->id : 0); App::main()->sendMessage(_history, _field.getLastText(), replyTo, _broadcast.checked(), webPageId); setFieldText(QString()); @@ -6617,6 +6632,13 @@ void HistoryWidget::onReplyToMessage() { _field.setFocus(); } +void HistoryWidget::onEditMessage() { + HistoryItem *to = App::contextItem(); + if (!to || !to->history()->peer->isChannel()) return; + + Ui::showLayer(new EditPostBox(to)); +} + bool HistoryWidget::lastForceReplyReplied(const FullMsgId &replyTo) const { if (replyTo.msg > 0 && replyTo.channel != _channel) return false; return _keyboard.forceReply() && _keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _keyboard.forMsgId().msg == (replyTo.msg < 0 ? replyToId() : replyTo.msg); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index fcf4c53771..d18f081035 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -594,6 +594,7 @@ public slots: void onCancel(); void onReplyToMessage(); + void onEditMessage(); void onReplyForwardPreviewCancel(); void onCancelSendAction(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index aef60bc1dc..27175c2f3f 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1300,7 +1300,7 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, sendFlags |= MTPmessages_SendMessage::flag_reply_to_msg_id; } MTPMessageMedia media = MTP_messageMediaEmpty(); - if (webPageId == 0xFFFFFFFFFFFFFFFFULL) { + if (webPageId == CancelledWebPageId) { sendFlags |= MTPmessages_SendMessage::flag_no_webpage; } else if (webPageId) { WebPageData *page = App::webPage(webPageId); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 3afef5e2b1..69604e5017 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -131,6 +131,8 @@ typedef uint64 VideoId; typedef uint64 AudioId; typedef uint64 DocumentId; typedef uint64 WebPageId; +static const WebPageId CancelledWebPageId = 0xFFFFFFFFFFFFFFFFULL; + typedef int32 MsgId; struct FullMsgId { FullMsgId() : channel(NoChannel), msg(0) { From 9fec887044aae5342d8b766f7f205ce00245de17 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 15:47:30 +0300 Subject: [PATCH 101/316] langs updated, link click async in overviewwidget --- Telegram/Resources/lang.strings | 3 ++- Telegram/SourceFiles/langs/lang_de.strings | 2 +- Telegram/SourceFiles/langs/lang_it.strings | 4 ++-- Telegram/SourceFiles/overviewwidget.cpp | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index a03f486635..93d274595e 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Choose from gallery"; "lng_settings_bg_from_file" = "Choose from file"; "lng_settings_bg_tile" = "Tile background"; +"lng_settings_adaptive_wide" = "Adaptive layout for wide screens"; "lng_backgrounds_header" = "Choose your new chat background"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop was updated to version {version}\n\n{changes}\n\nFull version history is available here:\n{link}"; "lng_new_version_minor" = "— Bug fixes and other minor improvements"; -"lng_new_version_text" = "— New waveform visualizations for voice messages\n— Sticker suggestions when you type an emoji"; +"lng_new_version_text" = "— Adaptive layout for wide screens switch added to Settings\n— Linux version crash fix"; "lng_menu_insert_unicode" = "Insert Unicode control character"; diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 364c5849a8..f9ea8f55ec 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -525,7 +525,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_reached" = "Limit von {count:_not_used_|# Mitglied|# Mitgliedern} erreicht"; "lng_profile_migrate_about" = "Für weitere Funktionen und um das Limit aufzuheben in Supergruppe ändern:"; -"lng_profile_migrate_feature1" = "— Bis zu {count:_not_used_|# Mitglied|# ;Mitglieder} sind nun möglich"; +"lng_profile_migrate_feature1" = "— Bis zu {count:_not_used_|# Mitglied|# Mitglieder} sind nun möglich"; "lng_profile_migrate_feature2" = "— Neue Mitglieder sehen gesamten Verlauf"; "lng_profile_migrate_feature3" = "— Admins können alle Nachrichten löschen"; "lng_profile_migrate_feature4" = "— Mitteilungen sind standardmäßig stumm"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index c1d8564f62..fac88aef7a 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -33,7 +33,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_open_from_tray" = "Apri Telegram"; "lng_minimize_to_tray" = "Riduci a icona"; "lng_quit_from_tray" = "Chiudi Telegram"; -"lng_tray_icon_text" = "Telegram è ancora attivo qui,\npuoi cambiarlo nelle impostazioni.\nSe l'icona scompare dall'area di notifica,\npuoi ripristinarla dalle icone nascoste."; +"lng_tray_icon_text" = "Telegram è ancora attivo qui,\npuoi cambiarlo nelle impostazioni.\nSe l'icona scompare dall'area di notifica,\npuoi trascinarla qui dalle icone nascoste."; "lng_month1" = "Gennaio"; "lng_month2" = "Febbraio"; @@ -276,7 +276,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_dir_radio" = "Cartella personalizzata, pulita a mano"; "lng_download_path_choose" = "Scegli il percorso di download"; "lng_sure_clear_downloads" = "Vuoi eliminare tutti i file scaricati nella cartella temporanea? Sarà fatto automaticamente alla disconnessione o alla disinstallazione del programma"; -"lng_download_path_failed" = "Il download del file non può iniziare. Potrebbe accadere a causa di un'errata posizione di download.\n\nPuoi cambiare il percorso di download nelle Impostazioni."; +"lng_download_path_failed" = "Il download del file non può iniziare. La causa potrebbe essere una posizione sbagliata per i download.\n\nPuoi cambiare il percorso di download nelle Impostazioni."; "lng_download_path_settings" = "Impostazioni"; "lng_download_finish_failed" = "Il download del file non può essere concluso.\n\nVuoi riprovare?"; "lng_download_path_clearing" = "Eliminazione.."; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index f00799cf63..ad6c8473a5 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -560,8 +560,9 @@ void OverviewInner::dragActionFinish(const QPoint &screenPos, Qt::MouseButton bu } } if (needClick) { - needClick->onClick(button); + DEBUG_LOG(("Will click link: %1 (%2) %3").arg(needClick->text()).arg(needClick->readable()).arg(needClick->encoded())); dragActionCancel(); + App::activateTextLink(needClick, button); return; } if (_dragAction == PrepareSelect && !needClick && !_dragWasInactive && !_selected.isEmpty() && _selected.cbegin().value() == FullSelection) { From fb0f2971c0cb7e6e9694539e102a6a2878f3bff2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 16:00:46 +0300 Subject: [PATCH 102/316] fixed some possible crashes, fixed copy selected text to clipboard --- Telegram/SourceFiles/apiwrap.cpp | 4 +++- Telegram/SourceFiles/application.cpp | 4 +++- Telegram/SourceFiles/dialogswidget.cpp | 2 ++ Telegram/SourceFiles/historywidget.cpp | 8 ++++---- Telegram/SourceFiles/profilewidget.cpp | 18 ++++++++++-------- Telegram/SourceFiles/structs.cpp | 22 ++++++++++++---------- Telegram/SourceFiles/window.cpp | 2 +- 7 files changed, 35 insertions(+), 25 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index ac90340590..e529b1f74d 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -346,7 +346,9 @@ void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestI App::feedUsers(MTP_vector(1, d.vuser), false); App::feedPhoto(d.vprofile_photo); App::feedUserLink(MTP_int(peerToUser(peer->id)), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link, false); - App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); + if (App::main()) { + App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); + } peer->asUser()->setBotInfo(d.vbot_info); peer->asUser()->blocked = mtpIsTrue(d.vblocked) ? UserIsBlocked : UserIsNotBlocked; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f9c77dfc0f..b414fdb399 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -925,7 +925,9 @@ void AppClass::checkLocalTime() { void AppClass::onAppStateChanged(Qt::ApplicationState state) { checkLocalTime(); - _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + if (_window) { + _window->updateIsActive((state == Qt::ApplicationActive) ? cOnlineFocusTimeout() : cOfflineBlurTimeout()); + } if (state != Qt::ApplicationActive) { PopupTooltip::Hide(); } diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 889580af44..fca26a14b1 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -1366,6 +1366,8 @@ void DialogsInner::selectSkipPage(int32 pixels, int32 direction) { } void DialogsInner::loadPeerPhotos(int32 yFrom) { + if (!parentWidget()) return; + int32 yTo = yFrom + parentWidget()->height() * 5; MTP::clearLoaderPriorities(); if (_state == DefaultState) { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a7e5a35958..35ca99daae 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -844,10 +844,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } else { uint16 symbol, selFrom = (_selected.cbegin().value() >> 16) & 0xFFFF, selTo = _selected.cbegin().value() & 0xFFFF; hasSelected = (selTo > selFrom) ? 1 : 0; - if (_dragItem && _dragItem == App::hoveredItem()) { - QPoint mousePos(mapMouseToItem(mapFromGlobal(_dragPos), _dragItem)); + if (App::mousedItem() && App::mousedItem() == App::hoveredItem()) { + QPoint mousePos(mapMouseToItem(mapFromGlobal(_dragPos), App::mousedItem())); bool afterDragSymbol, uponSymbol; - _dragItem->getSymbol(symbol, afterDragSymbol, uponSymbol, mousePos.x(), mousePos.y()); + App::mousedItem()->getSymbol(symbol, afterDragSymbol, uponSymbol, mousePos.x(), mousePos.y()); if (uponSymbol && symbol >= selFrom && symbol < selTo) { isUponSelected = 1; } @@ -7148,7 +7148,7 @@ void HistoryWidget::drawRecording(Painter &p) { } void HistoryWidget::paintEvent(QPaintEvent *e) { - if (App::wnd() && App::wnd()->contentOverlapped(this, e)) return; + if (!App::main() || (App::wnd() && App::wnd()->contentOverlapped(this, e))) return; Painter p(this); QRect r(e->rect()); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 313709f181..665ed2b668 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1077,6 +1077,15 @@ void ProfileInner::mouseReleaseEvent(QMouseEvent *e) { connect(box, SIGNAL(confirmed()), this, SLOT(onKickConfirm())); Ui::showLayer(box); } + + _kickDown = 0; + if (!_photoLink && (_peerUser || (_peerChat && !_peerChat->canEdit()) || (_peerChannel && !_amCreator))) { + setCursor((_kickOver || _kickDown || textlnkOver()) ? style::cur_pointer : style::cur_default); + } else { + setCursor((_kickOver || _kickDown || _photoOver || textlnkOver()) ? style::cur_pointer : style::cur_default); + } + update(); + if (textlnkDown()) { TextLinkPtr lnk = textlnkDown(); textlnkDown(TextLinkPtr()); @@ -1087,17 +1096,10 @@ void ProfileInner::mouseReleaseEvent(QMouseEvent *e) { if (reBotCommand().match(lnk->encoded()).hasMatch()) { Ui::showPeerHistory(_peer, ShowAtTheEndMsgId); } - lnk->onClick(e->button()); + App::activateTextLink(lnk, e->button()); } } } - _kickDown = 0; - if (!_photoLink && (_peerUser || (_peerChat && !_peerChat->canEdit()) || (_peerChannel && !_amCreator))) { - setCursor((_kickOver || _kickDown || textlnkOver()) ? style::cur_pointer : style::cur_default); - } else { - setCursor((_kickOver || _kickDown || _photoOver || textlnkOver()) ? style::cur_pointer : style::cur_default); - } - update(); } void ProfileInner::onKickConfirm() { diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 3803850684..1c05b266ab 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -688,11 +688,12 @@ void PhotoCancelLink::onClick(Qt::MouseButton button) const { if (!data->date) return; if (data->uploading()) { - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - if (HistoryMessage *msg = item->toHistoryMessage()) { - if (msg->getMedia() && msg->getMedia()->type() == MediaTypePhoto && static_cast(msg->getMedia())->photo() == data) { - App::contextItem(item); - App::main()->deleteLayer(-2); + if (HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0)) { + if (HistoryMessage *msg = item->toHistoryMessage()) { + if (msg->getMedia() && msg->getMedia()->type() == MediaTypePhoto && static_cast(msg->getMedia())->photo() == data) { + App::contextItem(item); + App::main()->deleteLayer(-2); + } } } } else { @@ -964,11 +965,12 @@ void DocumentCancelLink::onClick(Qt::MouseButton button) const { if (!data->date) return; if (data->uploading()) { - HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0); - if (HistoryMessage *msg = item->toHistoryMessage()) { - if (msg->getMedia() && msg->getMedia()->getDocument() == data) { - App::contextItem(item); - App::main()->deleteLayer(-2); + if (HistoryItem *item = App::hoveredLinkItem() ? App::hoveredLinkItem() : (App::contextItem() ? App::contextItem() : 0)) { + if (HistoryMessage *msg = item->toHistoryMessage()) { + if (msg->getMedia() && msg->getMedia()->getDocument() == data) { + App::contextItem(item); + App::main()->deleteLayer(-2); + } } } } else { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 52f823b27e..1209ffc3e0 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2730,7 +2730,7 @@ void LastCrashedWindow::onUpdateFailed() { void LastCrashedWindow::onContinue() { if (SignalHandlers::restart() == SignalHandlers::CantOpen) { new NotStartedWindow(); - } else { + } else if (!Global::started()) { Sandbox::launch(); } close(); From fc9d75b4f01fed32f3b4d5827ac47c5724ea5787 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 17:27:54 +0300 Subject: [PATCH 103/316] adaptive layout checkbox added to settings --- Telegram/SourceFiles/facades.cpp | 2 ++ Telegram/SourceFiles/facades.h | 3 ++- Telegram/SourceFiles/historywidget.cpp | 1 + Telegram/SourceFiles/localstorage.cpp | 9 +++++++ Telegram/SourceFiles/settingswidget.cpp | 36 +++++++++++++++++++++++-- Telegram/SourceFiles/settingswidget.h | 5 +++- Telegram/SourceFiles/types.h | 1 + 7 files changed, 53 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index e6b3c22f0a..4ddf6aa6b4 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -348,6 +348,7 @@ namespace Sandbox { struct GlobalDataStruct { uint64 LaunchId = 0; Adaptive::Layout AdaptiveLayout = Adaptive::NormalLayout; + bool AdaptiveForWide = true; }; GlobalDataStruct *GlobalData = 0; @@ -370,5 +371,6 @@ namespace Global { DefineReadOnlyVar(Global, uint64, LaunchId); DefineVar(Global, Adaptive::Layout, AdaptiveLayout); + DefineVar(Global, bool, AdaptiveForWide); }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 328773f2de..5d54267d54 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -139,6 +139,7 @@ namespace Global { DeclareReadOnlyVar(uint64, LaunchId); DeclareVar(Adaptive::Layout, AdaptiveLayout); + DeclareVar(bool, AdaptiveForWide); }; @@ -150,6 +151,6 @@ namespace Adaptive { return Global::AdaptiveLayout() == NormalLayout; } inline bool Wide() { - return Global::AdaptiveLayout() == WideLayout; + return Global::AdaptiveForWide() && (Global::AdaptiveLayout() == WideLayout); } } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 35ca99daae..e0883fe375 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4690,6 +4690,7 @@ void HistoryWidget::doneShow() { void HistoryWidget::updateAdaptiveLayout() { _sideShadow.setVisible(!Adaptive::OneColumn()); + update(); } void HistoryWidget::animStop() { diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index da64f2cb96..bc7757d133 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -1121,6 +1121,14 @@ namespace { } } break; + case dbiAdaptiveForWide: { + qint32 v; + stream >> v; + if (!_checkStreamStatus(stream)) return false; + + Global::SetAdaptiveForWide(v == 1); + } break; + case dbiAutoLock: { qint32 v; stream >> v; @@ -1506,6 +1514,7 @@ namespace { EncryptedDescriptor data(size); data.stream << quint32(dbiSendKey) << qint32(cCtrlEnter() ? dbiskCtrlEnter : dbiskEnter); data.stream << quint32(dbiTileBackground) << qint32(cTileBackground() ? 1 : 0); + data.stream << quint32(dbiAdaptiveForWide) << qint32(Global::AdaptiveForWide() ? 1 : 0); data.stream << quint32(dbiAutoLock) << qint32(cAutoLock()); data.stream << quint32(dbiReplaceEmojis) << qint32(cReplaceEmojis() ? 1 : 0); data.stream << quint32(dbiDefaultAttach) << qint32(cDefaultAttach()); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 36c4fa1df0..89e0925c5e 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -187,6 +187,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) , _backFromGallery(this, lang(lng_settings_bg_from_gallery)) , _backFromFile(this, lang(lng_settings_bg_from_file)) , _tileBackground(this, lang(lng_settings_bg_tile), cTileBackground()) +, _adaptiveForWide(this, lang(lng_settings_adaptive_wide), Global::AdaptiveForWide()) , _needBackgroundUpdate(false) // advanced @@ -310,6 +311,7 @@ SettingsInner::SettingsInner(SettingsWidget *parent) : TWidget(parent) connect(&_backFromGallery, SIGNAL(clicked()), this, SLOT(onBackFromGallery())); connect(&_backFromFile, SIGNAL(clicked()), this, SLOT(onBackFromFile())); connect(&_tileBackground, SIGNAL(changed()), this, SLOT(onTileBackground())); + connect(&_adaptiveForWide, SIGNAL(changed()), this, SLOT(onAdaptiveForWide())); // advanced connect(&_passcodeEdit, SIGNAL(clicked()), this, SLOT(onPasscode())); @@ -635,6 +637,10 @@ void SettingsInner::paintEvent(QPaintEvent *e) { top += st::setBackgroundSize; top += st::setLittleSkip; top += _tileBackground.height(); + if (Global::AdaptiveLayout() == Adaptive::WideLayout) { + top += st::setLittleSkip; + top += _adaptiveForWide.height(); + } } // advanced @@ -753,6 +759,10 @@ void SettingsInner::resizeEvent(QResizeEvent *e) { top += st::setLittleSkip; _tileBackground.move(_left, top); top += _tileBackground.height(); + if (Global::AdaptiveLayout() == Adaptive::WideLayout) { + top += st::setLittleSkip; + _adaptiveForWide.move(_left, top); top += _adaptiveForWide.height(); + } } // advanced @@ -855,6 +865,11 @@ void SettingsInner::mousePressEvent(QMouseEvent *e) { void SettingsInner::contextMenuEvent(QContextMenuEvent *e) { } +void SettingsInner::updateAdaptiveLayout() { + showAll(); + resizeEvent(0); +} + void SettingsInner::step_photo(float64 ms, bool timer) { float64 dt = ms / st::setPhotoDuration; if (dt >= 1) { @@ -1093,10 +1108,16 @@ void SettingsInner::showAll() { _backFromGallery.show(); _backFromFile.show(); _tileBackground.show(); + if (Global::AdaptiveLayout() == Adaptive::WideLayout) { + _adaptiveForWide.show(); + } else { + _adaptiveForWide.hide(); + } } else { _backFromGallery.hide(); _backFromFile.hide(); _tileBackground.hide(); + _adaptiveForWide.hide(); } // advanced @@ -1628,6 +1649,16 @@ void SettingsInner::onTileBackground() { } } +void SettingsInner::onAdaptiveForWide() { + if (Global::AdaptiveForWide() != _adaptiveForWide.checked()) { + Global::SetAdaptiveForWide(_adaptiveForWide.checked()); + if (App::wnd()) { + App::wnd()->updateAdaptiveLayout(); + } + Local::writeUserSettings(); + } +} + void SettingsInner::onDontAskDownloadPath() { cSetAskDownloadPath(!_dontAskDownloadPath.checked()); Local::writeUserSettings(); @@ -1898,10 +1929,11 @@ void SettingsWidget::updateAdaptiveLayout() { } else { _close.show(); } + _inner.updateAdaptiveLayout(); + resizeEvent(0); } -void SettingsWidget::updateDisplayNotify() -{ +void SettingsWidget::updateDisplayNotify() { _inner.enableDisplayNotify(cDesktopNotify()); } diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index 08499ca60d..65e222fcb3 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -71,6 +71,8 @@ public: void mousePressEvent(QMouseEvent *e); void contextMenuEvent(QContextMenuEvent *e); + void updateAdaptiveLayout(); + void step_photo(float64 ms, bool timer); void updateSize(int32 newWidth); @@ -156,6 +158,7 @@ public slots: void onBackFromGallery(); void onBackFromFile(); void onTileBackground(); + void onAdaptiveForWide(); void onLocalStorageClear(); @@ -273,7 +276,7 @@ private: // chat background QPixmap _background; LinkButton _backFromGallery, _backFromFile; - FlatCheckbox _tileBackground; + FlatCheckbox _tileBackground, _adaptiveForWide; bool _needBackgroundUpdate; // advanced diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index b93bf822d3..99f12ef31c 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -352,6 +352,7 @@ enum DataBlockId { dbiSavedGifsLimit = 0x35, dbiShowingSavedGifs = 0x36, dbiAutoPlay = 0x37, + dbiAdaptiveForWide = 0x38, dbiEncryptedWithSalt = 333, dbiEncrypted = 444, From 23a8090a7337ce75ee01baf4df586d0409cd1ba4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 17:45:07 +0300 Subject: [PATCH 104/316] static linked openssl in Qt, gobject dynamic linked, moved gtk/appindicator init after Qt Application creation, trying to enable rdynamic flag --- QTCREATOR.md | 13 +++++++++- Telegram/Build.sh | 4 +-- Telegram/FixMake.sh | 9 ++++--- Telegram/SourceFiles/pspecific.h | 5 ++++ Telegram/SourceFiles/pspecific_linux.cpp | 31 ++++++++++++++---------- Telegram/SourceFiles/pspecific_mac.cpp | 8 ++++++ Telegram/SourceFiles/pspecific_wnd.cpp | 8 ++++++ Telegram/SourceFiles/types.cpp | 4 +++ Telegram/Telegram.pro | 6 ++--- 9 files changed, 65 insertions(+), 23 deletions(-) diff --git a/QTCREATOR.md b/QTCREATOR.md index 9576e30dd5..28184888b9 100644 --- a/QTCREATOR.md +++ b/QTCREATOR.md @@ -101,6 +101,17 @@ then go to **/home/user/TBuild/Libraries/openal-soft/build** and run make sudo make install +####OpenSSL + +In Terminal go to **/home/user/TBuild/Libraries** and run + + git clone https://github.com/openssl/openssl + cd openssl + git checkout OpenSSL_1_0_1-stable + ./config + make + sudo make install + ####libxkbcommon (required for Fcitx Qt plugin) In Terminal go to **/home/user/TBuild/Libraries** and run @@ -136,7 +147,7 @@ Install some packages for Qt (see **/home/user/TBuild/Libraries/QtStatic/qtbase/ In Terminal go to **/home/user/TBuild/Libraries/QtStatic** and there run - ./configure -release -opensource -confirm-license -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests + OPENSSL_LIBS='/usr/local/ssl/lib/libssl.a /usr/local/ssl/lib/libcrypto.a' ./configure -release -opensource -confirm-license -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon-x11 -no-opengl -static -openssl-linked -nomake examples -nomake tests make -j4 sudo make -j4 install diff --git a/Telegram/Build.sh b/Telegram/Build.sh index f7a64597ff..615639257f 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -111,14 +111,14 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then mkdir -p "$WorkPath/ReleaseIntermediateUpdater" cd "$WorkPath/ReleaseIntermediateUpdater" - /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Updater.pro" + /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Updater.pro" -r -spec linux-g++ make echo "Updater build complete!" cd "$HomePath" mkdir -p "$WorkPath/ReleaseIntermediate" cd "$WorkPath/ReleaseIntermediate" - /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Telegram.pro" + /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Telegram.pro" -r -spec linux-g++ eval "$FixScript" make echo "Telegram build complete!" diff --git a/Telegram/FixMake.sh b/Telegram/FixMake.sh index e03c47d215..a92840e7c1 100755 --- a/Telegram/FixMake.sh +++ b/Telegram/FixMake.sh @@ -11,10 +11,10 @@ Replace () { } Replace '\-llzma' '\/usr\/lib\/x86_64\-linux\-gnu\/liblzma\.a' -Replace '\-lssl' '\/usr\/lib\/x86_64\-linux\-gnu\/libssl\.a' -Replace '\-lcrypto' '\/usr\/lib\/x86_64\-linux\-gnu\/libcrypto\.a' -Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' -Replace '\-lXi' '\/usr\/lib\/x86_64\-linux\-gnu\/libXi\.a' +#Replace '\-lssl' '\/usr\/lib\/x86_64\-linux\-gnu\/libssl\.a' +#Replace '\-lcrypto' '\/usr\/lib\/x86_64\-linux\-gnu\/libcrypto\.a' +#Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' +Replace '\-lXi' '\/usr\/lib\/x86_64\-linux\-gnu\/libXi\.a \/usr\/lib\/x86_64\-linux\-gnu\/libXext\.a' Replace '\-lSM' '\/usr\/lib\/x86_64\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/x86_64\-linux\-gnu\/libICE\.a' Replace '\-lfontconfig' '\/usr\/lib\/x86_64\-linux\-gnu\/libfontconfig\.a \/usr\/lib\/x86_64\-linux\-gnu\/libexpat\.a' @@ -28,3 +28,4 @@ Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a' Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a' Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a' Replace '\-lva' '\/usr\/local\/lib\/libva\.a' +Replace '\-lQt5Network' '\/usr\/local\/Qt-5.5.1\/lib\/libQt5Network.a \/usr\/local\/ssl\/lib\/libssl.a \/usr\/local\/ssl\/lib\/libcrypto.a' diff --git a/Telegram/SourceFiles/pspecific.h b/Telegram/SourceFiles/pspecific.h index 98c8411466..7362f15da0 100644 --- a/Telegram/SourceFiles/pspecific.h +++ b/Telegram/SourceFiles/pspecific.h @@ -43,4 +43,9 @@ namespace PlatformSpecific { ~Initializer(); }; + namespace ThirdParty { + void start(); + void finish(); + } + } diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 6b1e982da9..3ee28e7741 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -752,9 +752,6 @@ void PsMainWindow::psUpdatedPosition() { void PsMainWindow::psCreateTrayIcon() { if (!noQtTrayIcon) { cSetSupportTray(QSystemTrayIcon::isSystemTrayAvailable()); - if (!noTryUnity) { - useUnityCount = false; - } return; } @@ -1241,16 +1238,6 @@ void psShowInFolder(const QString &name) { namespace PlatformSpecific { Initializer::Initializer() { - QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower(); - noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome")); - tryAppIndicator = (cdesktop == qstr("xfce")); - noTryUnity = (cdesktop != qstr("unity")); - - if (noQtTrayIcon) cSetSupportTray(false); - - DEBUG_LOG(("Loading libraries")); - setupGtk(); - setupUnity(); } Initializer::~Initializer() { @@ -1258,6 +1245,24 @@ namespace PlatformSpecific { _psEventFilter = 0; } + namespace ThirdParty { + void start() { + QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower(); + noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome")); + tryAppIndicator = (cdesktop == qstr("xfce")); + noTryUnity = (cdesktop != qstr("unity")); + + if (noQtTrayIcon) cSetSupportTray(false); + + DEBUG_LOG(("Loading libraries")); + setupGtk(); + setupUnity(); + } + + void finish() { + } + } + } namespace { diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 84349d6160..9d9c66cc03 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -861,6 +861,14 @@ namespace PlatformSpecific { objc_finish(); } + namespace ThirdParty { + void start() { + } + + void finish() { + } + } + } void psNewVersion() { diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 044827de67..dc8b32d603 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2170,6 +2170,14 @@ namespace PlatformSpecific { } } + namespace ThirdParty { + void start() { + } + + void finish() { + } + } + } namespace { diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 706cae9c47..ce77262ae4 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -267,6 +267,8 @@ namespace { namespace ThirdParty { void start() { + PlatformSpecific::ThirdParty::start(); + if (!RAND_status()) { // should be always inited in all modern OS char buf[16]; memcpy(buf, &_msStart, 8); @@ -303,6 +305,8 @@ namespace ThirdParty { delete[] _sslLocks; _sslLocks = 0; + + PlatformSpecific::ThirdParty::finish(); } } diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 408bd81904..4ff476e8b3 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -288,10 +288,10 @@ CONFIG(release, debug|release) { QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE += -Ofast -flto -fno-strict-aliasing -g QMAKE_LFLAGS_RELEASE -= -O1 - QMAKE_LFLAGS_RELEASE += -Ofast -flto -g + QMAKE_LFLAGS_RELEASE += -Ofast -flto -g -rdynamic } CONFIG(debug, debug|release) { - QMAKE_LFLAGS_DEBUG += -g + QMAKE_LFLAGS_DEBUG += -g -rdynamic } INCLUDEPATH += ./../../Libraries/QtStatic/qtbase/include/QtGui/5.5.1/QtGui\ @@ -319,7 +319,7 @@ INCLUDEPATH += "/usr/include/atk-1.0" INCLUDEPATH += "/usr/include/dee-1.0" INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4" -LIBS += -lcrypto -lssl -ldl -llzma -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva +LIBS += -ldl -llzma -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \ ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a From 90d104cf6135db5e24481d1087d04bf719289178 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 17:54:00 +0300 Subject: [PATCH 105/316] version 0.9.25 dev --- Telegram/FixMake.sh | 3 --- Telegram/FixMake32.sh | 4 +--- Telegram/SourceFiles/application.cpp | 5 ++--- Telegram/SourceFiles/config.h | 6 +++--- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 8 ++++---- 8 files changed, 21 insertions(+), 27 deletions(-) diff --git a/Telegram/FixMake.sh b/Telegram/FixMake.sh index a92840e7c1..74b2c6b036 100755 --- a/Telegram/FixMake.sh +++ b/Telegram/FixMake.sh @@ -11,9 +11,6 @@ Replace () { } Replace '\-llzma' '\/usr\/lib\/x86_64\-linux\-gnu\/liblzma\.a' -#Replace '\-lssl' '\/usr\/lib\/x86_64\-linux\-gnu\/libssl\.a' -#Replace '\-lcrypto' '\/usr\/lib\/x86_64\-linux\-gnu\/libcrypto\.a' -#Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a' Replace '\-lXi' '\/usr\/lib\/x86_64\-linux\-gnu\/libXi\.a \/usr\/lib\/x86_64\-linux\-gnu\/libXext\.a' Replace '\-lSM' '\/usr\/lib\/x86_64\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/x86_64\-linux\-gnu\/libICE\.a' diff --git a/Telegram/FixMake32.sh b/Telegram/FixMake32.sh index b3a601925c..0f17f8bc10 100755 --- a/Telegram/FixMake32.sh +++ b/Telegram/FixMake32.sh @@ -11,9 +11,6 @@ Replace () { } Replace '\-llzma' '\/usr\/lib\/i386\-linux\-gnu\/liblzma\.a' -Replace '\-lssl' '\/usr\/lib\/i386\-linux\-gnu\/libssl\.a' -Replace '\-lcrypto' '\/usr\/lib\/i386\-linux\-gnu\/libcrypto\.a' -Replace '\-lgobject\-2\.0' '\/usr\/lib\/i386\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/i386\-linux\-gnu\/libffi\.a' Replace '\-lXi' '\/usr\/lib\/i386\-linux\-gnu\/libXi\.a' Replace '\-lSM' '\/usr\/lib\/i386\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/i386\-linux\-gnu\/libICE\.a' @@ -28,3 +25,4 @@ Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a' Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a' Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a' Replace '\-lva' '\/usr\/local\/lib\/libva\.a' +Replace '\-lQt5Network' '\/usr\/local\/Qt-5.5.1\/lib\/libQt5Network.a \/usr\/local\/ssl\/lib\/libssl.a \/usr\/local\/ssl\/lib\/libcrypto.a' diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index b414fdb399..f507c4492a 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1053,9 +1053,8 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9024) { -// versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); - versionFeatures = lang(lng_new_version_minor).trimmed(); + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9025) { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Adaptive layout for wide screens switch added to Settings\n\xe2\x80\x94 Linux version crash fix");// .replace('@', qsl("@") + QChar(0x200D)); } else if (Local::oldMapVersion() < 9024) { versionFeatures = lang(lng_new_version_text).trimmed(); } else { diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index e8981faaee..1f6fd6588e 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9024; -static const wchar_t *AppVersionStr = L"0.9.24"; -static const bool DevVersion = false; +static const int32 AppVersion = 9025; +static const wchar_t *AppVersionStr = L"0.9.25"; +static const bool DevVersion = true; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 48739e2a3e..789cf25856 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.24 + 0.9.25 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index a73c381b16..04b48ea038 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,24,0 - PRODUCTVERSION 0,9,24,0 + FILEVERSION 0,9,25,0 + PRODUCTVERSION 0,9,25,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.24.0" + VALUE "FileVersion", "0.9.25.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.24.0" + VALUE "ProductVersion", "0.9.25.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 90ee768992..ba4d36601d 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.24; + CURRENT_PROJECT_VERSION = 0.9.25; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.24; + CURRENT_PROJECT_VERSION = 0.9.25; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.24; + CURRENT_PROJECT_VERSION = 0.9.25; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.24; + DYLIB_CURRENT_VERSION = 0.9.25; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.24; + CURRENT_PROJECT_VERSION = 0.9.25; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.24; + DYLIB_CURRENT_VERSION = 0.9.25; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 5108f1ff6f..ba8449dac8 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9024 +AppVersion 9025 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.24 -AppVersionStr 0.9.24 -DevChannel 0 +AppVersionStrSmall 0.9.25 +AppVersionStr 0.9.25 +DevChannel 1 BetaVersion 0 9019002 From 4716c258756e65eecb8cda9f2497c0b1854467eb Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Feb 2016 18:41:17 +0300 Subject: [PATCH 106/316] build script for linux32 fixed, 0.9.25 dev --- Telegram/FixMake32.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/FixMake32.sh b/Telegram/FixMake32.sh index 0f17f8bc10..24d5e677f9 100755 --- a/Telegram/FixMake32.sh +++ b/Telegram/FixMake32.sh @@ -11,7 +11,7 @@ Replace () { } Replace '\-llzma' '\/usr\/lib\/i386\-linux\-gnu\/liblzma\.a' -Replace '\-lXi' '\/usr\/lib\/i386\-linux\-gnu\/libXi\.a' +Replace '\-lXi' '\/usr\/lib\/i386\-linux\-gnu\/libXi\.a \/usr\/lib\/i386\-linux\-gnu\/libXext\.a' Replace '\-lSM' '\/usr\/lib\/i386\-linux\-gnu\/libSM\.a' Replace '\-lICE' '\/usr\/lib\/i386\-linux\-gnu\/libICE\.a' Replace '\-lfontconfig' '\/usr\/lib\/i386\-linux\-gnu\/libfontconfig\.a \/usr\/lib\/i386\-linux\-gnu\/libexpat\.a' From 640587665632025035dd3cd5a94f433f67db568e Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 18 Feb 2016 21:09:30 -0300 Subject: [PATCH 107/316] Document how to build via qmake Signed-off-by: Hugo Osvaldo Barrera (github: hobarrera) --- doc/building-qmake.md | 130 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 doc/building-qmake.md diff --git a/doc/building-qmake.md b/doc/building-qmake.md new file mode 100644 index 0000000000..37f091331e --- /dev/null +++ b/doc/building-qmake.md @@ -0,0 +1,130 @@ +Building via qmake +================== + +The following commands assume the following environment variables are set: + + * `$srcdir`: The directory into which the source has been downloaded and + unpacked. + * `_qtver`: The Qt version being used (eg: `5.5.1`). + * `$pkgdir`: The directory into which installable files are places. This is + `/` for local installations, or can be different directory when preparing a + redistributable package. + +Either set them accordingly, or replace them in the below commands as desired. + +The following sources should be downloaded and unpacked into `$srcdir`: + + * This repository (either `master` or a specific tag). + * The Qt sources: `http://download.qt-project.org/official_releases/qt/${_qtver%.*}/$_qtver/single/qt-everywhere-opensource-src-$_qtver.tar.xz` + * `git clone git+https://chromium.googlesource.com/breakpad/breakpad breakpad` + * `git clone git+https://chromium.googlesource.com/linux-syscall-support breakpad-lss` + * telegramdesktop.desktop (The intention is to include this file inside the + source package at some point): + `https://aur.archlinux.org/cgit/aur.git/plain/telegramdesktop.desktop?h=telegram-desktop` + * tg.protocol: `https://aur.archlinux.org/cgit/aur.git/plain/tg.protocol?h=telegram-desktop` + +Preparation +----------- + + cd "$srcdir/tdesktop" + + mkdir -p "$srcdir/Libraries" + + local qt_patch_file="$srcdir/tdesktop/Telegram/_qtbase_${_qtver//./_}_patch.diff" + if [ "$qt_patch_file" -nt "$srcdir/Libraries/QtStatic" ]; then + rm -rf "$srcdir/Libraries/QtStatic" + mv "$srcdir/qt-everywhere-opensource-src-$_qtver" "$srcdir/Libraries/QtStatic" + cd "$srcdir/Libraries/QtStatic/qtbase" + patch -p1 -i "$qt_patch_file" + fi + + if [ ! -h "$srcdir/Libraries/breakpad" ]; then + ln -s "$srcdir/breakpad" "$srcdir/Libraries/breakpad" + ln -s "$srcdir/breakpad-lss" "$srcdir/Libraries/breakpad/src/third_party/lss" + fi + + sed -i 's/CUSTOM_API_ID//g' "$srcdir/tdesktop/Telegram/Telegram.pro" + sed -i 's,LIBS += /usr/local/lib/libxkbcommon.a,,g' "$srcdir/tdesktop/Telegram/Telegram.pro" + sed -i 's,LIBS += /usr/local/lib/libz.a,LIBS += -lz,g' "$srcdir/tdesktop/Telegram/Telegram.pro" + + ( + echo "DEFINES += TDESKTOP_DISABLE_AUTOUPDATE" + echo "DEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" + echo 'INCLUDEPATH += "/usr/lib/glib-2.0/include"' + echo 'INCLUDEPATH += "/usr/lib/gtk-2.0/include"' + echo 'INCLUDEPATH += "/usr/include/opus"' + ) >> "$srcdir/tdesktop/Telegram/Telegram.pro" + +Building +-------- + + + # Build patched Qt + cd "$srcdir/Libraries/QtStatic" + ./configure -prefix "$srcdir/qt" -release -opensource -confirm-license -qt-zlib \ + -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \ + -qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests + make module-qtbase module-qtimageformats + make module-qtbase-install_subtargets module-qtimageformats-install_subtargets + + export PATH="$srcdir/qt/bin:$PATH" + + # Build breakpad + cd "$srcdir/Libraries/breakpad" + ./configure + make + + # Build MetaStyle + mkdir -p "$srcdir/tdesktop/Linux/DebugIntermediateStyle" + cd "$srcdir/tdesktop/Linux/DebugIntermediateStyle" + qmake CONFIG+=debug "../../Telegram/MetaStyle.pro" + make + + # Build MetaLang + mkdir -p "$srcdir/tdesktop/Linux/DebugIntermediateLang" + cd "$srcdir/tdesktop/Linux/DebugIntermediateLang" + qmake CONFIG+=debug "../../Telegram/MetaLang.pro" + make + + # Build Telegram Desktop + mkdir -p "$srcdir/tdesktop/Linux/ReleaseIntermediate" + cd "$srcdir/tdesktop/Linux/ReleaseIntermediate" + + qmake CONFIG+=release "../../Telegram/Telegram.pro" + local pattern="^PRE_TARGETDEPS +=" + grep "$pattern" "$srcdir/tdesktop/Telegram/Telegram.pro" | sed "s/$pattern//g" | xargs make + + qmake CONFIG+=release "../../Telegram/Telegram.pro" + make + +Installation +------------ + + + install -dm755 "$pkgdir/usr/bin" + install -m755 "$srcdir/tdesktop/Linux/Release/Telegram" "$pkgdir/usr/bin/telegram-desktop" + + install -d "$pkgdir/usr/share/applications" + install -m644 "$srcdir/telegramdesktop.desktop" "$pkgdir/usr/share/applications/telegramdesktop.desktop" + + install -d "$pkgdir/usr/share/kde4/services" + install -m644 "$srcdir/tg.protocol" "$pkgdir/usr/share/kde4/services/tg.protocol" + + local icon_size icon_dir + for icon_size in 16 32 48 64 128 256 512; do + icon_dir="$pkgdir/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps" + + install -d "$icon_dir" + install -m644 "$srcdir/tdesktop/Telegram/SourceFiles/art/icon${icon_size}.png" "$icon_dir/telegram-desktop.png" + done + +Notes +----- + +These instructions are based on the [ArchLinux package][arch-package] for +telegram-desktop. + +In case these instructions are at some point out of date, the above may serve +as an update reference. + +[arch-package]: https://aur.archlinux.org/packages/telegram-desktop/ From 0315568b80676906481948ee84d1e237460bf8f3 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 18 Feb 2016 21:23:23 -0300 Subject: [PATCH 108/316] Link to qmake documentation in the README Signed-off-by: Hugo Osvaldo Barrera (github: hobarrera) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index be9a159774..3c891840dd 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is * [XCode 7][xcode] * [XCode 7 for OS X 10.6 and 10.7][xcode_old] * [Qt Creator 3.5.1 Ubuntu][qtcreator] +* [Using qmake on GNU/Linux][qmake] ## Projects in Telegram solution @@ -93,3 +94,4 @@ The source code is published under GPLv3 with OpenSSL exception, the license is [xcode]: XCODE.md [xcode_old]: XCODEold.md [qtcreator]: QTCREATOR.md +[qmake]: doc/building-qmake.md From 3546fe421c09e2811d18186e5281baee044e4849 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 18 Feb 2016 21:23:43 -0300 Subject: [PATCH 109/316] Move all build documentation into /doc Signed-off-by: Hugo Osvaldo Barrera (github: hobarrera) --- README.md | 8 ++++---- MSVC.md => doc/building-msvc.md | 0 QTCREATOR.md => doc/building-qtcreator.md | 0 XCODEold.md => doc/building-xcode-old.md | 0 XCODE.md => doc/building-xcode.md | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename MSVC.md => doc/building-msvc.md (100%) rename QTCREATOR.md => doc/building-qtcreator.md (100%) rename XCODEold.md => doc/building-xcode-old.md (100%) rename XCODE.md => doc/building-xcode.md (100%) diff --git a/README.md b/README.md index 3c891840dd..4f9b406f71 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,8 @@ The source code is published under GPLv3 with OpenSSL exception, the license is [telegram_api]: https://core.telegram.org [telegram_proto]: https://core.telegram.org/mtproto [license]: LICENSE -[msvc]: MSVC.md -[xcode]: XCODE.md -[xcode_old]: XCODEold.md -[qtcreator]: QTCREATOR.md +[msvc]: doc/building-msvc.md +[xcode]: doc/building-xcode.md +[xcode_old]: doc/building-xcode-old.md +[qtcreator]: doc/building-qtcreator.md [qmake]: doc/building-qmake.md diff --git a/MSVC.md b/doc/building-msvc.md similarity index 100% rename from MSVC.md rename to doc/building-msvc.md diff --git a/QTCREATOR.md b/doc/building-qtcreator.md similarity index 100% rename from QTCREATOR.md rename to doc/building-qtcreator.md diff --git a/XCODEold.md b/doc/building-xcode-old.md similarity index 100% rename from XCODEold.md rename to doc/building-xcode-old.md diff --git a/XCODE.md b/doc/building-xcode.md similarity index 100% rename from XCODE.md rename to doc/building-xcode.md From 841daa2a6efa09277f1cfadd0a03dd2a52b5eb2a Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Fri, 19 Feb 2016 18:07:31 -0300 Subject: [PATCH 110/316] Deduplicate links to build instructions Signed-off-by: Hugo Osvaldo Barrera (github: hobarrera) --- CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 435e40e9dc..68c80c0a70 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,10 +73,8 @@ For more info, see [GitHub Help][help_change_commit_message]. ## Build instructions -* [Visual Studio 2013][msvc] -* [XCode 6.4][xcode] -* [XCode 6.4 for OS X 10.6 and 10.7][xcode_old] -* [Qt Creator 3.2.0 Ubuntu][qtcreator] +See the [readme][README.md#build-instructions] for details on the various build +environments. ## Pull upstream changes into your fork regularly From 7de5e24df538ff6e69a74ed91a5929d0f8acd827 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 22 Feb 2016 10:01:10 +0300 Subject: [PATCH 111/316] adaptive layout starts after 1366px window, langs updated, hiding tooltip on window deactivation --- Telegram/Resources/style.txt | 3 +-- Telegram/SourceFiles/gui/popupmenu.cpp | 8 ++++++++ Telegram/SourceFiles/gui/popupmenu.h | 1 + Telegram/SourceFiles/history.cpp | 8 ++------ Telegram/SourceFiles/langs/lang_de.strings | 3 ++- Telegram/SourceFiles/langs/lang_es.strings | 3 ++- Telegram/SourceFiles/langs/lang_it.strings | 3 ++- Telegram/SourceFiles/langs/lang_ko.strings | 3 ++- Telegram/SourceFiles/langs/lang_nl.strings | 3 ++- Telegram/SourceFiles/langs/lang_pt_BR.strings | 3 ++- Telegram/SourceFiles/window.cpp | 10 ++++------ 11 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5999c47f4f..9ee6576640 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -53,6 +53,7 @@ color8: #ce671b; // orange wndMinWidth: 380px; adaptiveNormalWidth: 640px; +adaptiveWideWidth: 1366px; wndMinHeight: 480px; wndDefWidth: 800px; @@ -1016,8 +1017,6 @@ historyToEndSkip: 10px; activeFadeInDuration: 500; activeFadeOutDuration: 3000; -historyMaxWidth: 720px; - msgRadius: 3px; msgMaxWidth: 430px; diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 8fb99d7d52..cad98ebe0d 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -539,6 +539,8 @@ PopupTooltip::PopupTooltip() : TWidget(0) _showTimer.setSingleShot(true); connect(&_showTimer, SIGNAL(timeout()), this, SLOT(onShow())); + + connect(App::wnd()->windowHandle(), SIGNAL(activeChanged()), this, SLOT(onWndActiveChanged())); } void PopupTooltip::onShow() { @@ -552,6 +554,12 @@ void PopupTooltip::onShow() { } } +void PopupTooltip::onWndActiveChanged() { + if (!App::wnd()->windowHandle()->isActive()) { + PopupTooltip::Hide(); + } +} + bool PopupTooltip::eventFilter(QObject *o, QEvent *e) { if (e->type() == QEvent::Leave) { _hideByLeaveTimer.start(10); diff --git a/Telegram/SourceFiles/gui/popupmenu.h b/Telegram/SourceFiles/gui/popupmenu.h index caf65492df..4d7968bfc9 100644 --- a/Telegram/SourceFiles/gui/popupmenu.h +++ b/Telegram/SourceFiles/gui/popupmenu.h @@ -133,6 +133,7 @@ public: public slots: void onShow(); + void onWndActiveChanged(); void onHideByLeave(); protected: diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e64facc5b4..574164736f 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6197,16 +6197,12 @@ void HistoryMessage::initDimensions() { } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { - int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width, hmaxwidth = st::historyMaxWidth; + int32 maxwidth = qMin(int(st::msgMaxWidth), _maxw), hwidth = _history->width; if (_media && _media->currentWidth() < maxwidth) { maxwidth = qMax(_media->currentWidth(), qMin(maxwidth, plainMaxWidth())); } - left = 0; - if (Adaptive::Wide()) { - hwidth = hmaxwidth; - } - left += (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); + left = (!fromChannel() && out() && !Adaptive::Wide()) ? st::msgMargin.right() : st::msgMargin.left(); if (displayFromPhoto()) { left += st::msgPhotoSkip; // } else if (!Adaptive::Wide() && !out() && !fromChannel() && st::msgPhotoSkip - (hmaxwidth - hwidth) > 0) { diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index f9ea8f55ec..1456713471 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Aus der Galerie"; "lng_settings_bg_from_file" = "Durchsuchen"; "lng_settings_bg_tile" = "Nebeneinander"; +"lng_settings_adaptive_wide" = "Flexibles Layout für breite Bildschirme"; "lng_backgrounds_header" = "Neuen Chat-Hintergrund wählen"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}"; "lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen"; -"lng_new_version_text" = "— Neue Optik für Sprachnachrichten\n— Sticker werden nach Emoji-Eingabe vorgeschlagen"; +"lng_new_version_text" = "— Neue Option in den Einstellungen hinzugefügt (\"Flexibles Layout für breite Bildschirme\"), um das Layout bei besonders breiten Bildschirmen zu ändern\n— Abstürze in der Linux-Version behoben"; "lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 2c0e037f93..4370b950bc 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Elegir desde la galería"; "lng_settings_bg_from_file" = "Elegir desde archivos"; "lng_settings_bg_tile" = "Fondo con mosaico"; +"lng_settings_adaptive_wide" = "Diseño adaptable para pantallas anchas"; "lng_backgrounds_header" = "Elige tu nuevo fondo de chat"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop ha sido actualizada a la versión {version}\n\n{changes}\n\nEl historial completo está disponible aquí:\n{link}"; "lng_new_version_minor" = "— Corrección de errores y otras mejoras menores"; -"lng_new_version_text" = "– Nueva visualización de ondas para los mensajes de voz\n– Sugerencias de stickers cuando escribes un emoji"; +"lng_new_version_text" = "— Ajuste para activar o desactivar el diseño adaptable para pantallas anchas \n— Arreglado el cierre inesperado en la versión para Linux"; "lng_menu_insert_unicode" = "Insertar caracteres de control Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index fac88aef7a..9babab03f1 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Scegli dalla galleria"; "lng_settings_bg_from_file" = "Scegli da file"; "lng_settings_bg_tile" = "Affianca sfondo"; +"lng_settings_adaptive_wide" = "Layout adattivo per grandi schermi"; "lng_backgrounds_header" = "Scegli un nuovo sfondo per la chat"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}"; "lng_new_version_minor" = "— Risoluzione di problemi e altri miglioramenti minori"; -"lng_new_version_text" = "— Nuova visualizzazione delle onde sonore per i messaggi vocali\n— Suggerimento per gli sticker quando digiti un'emoji"; +"lng_new_version_text" = "— Interruttore per il layout adattivo per grandi schermi aggiunto nelle Impostazioni\n— Risoluzione dei crash su Linux"; "lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 1d401e7e30..4164413533 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "이미지 선택"; "lng_settings_bg_from_file" = "파일 선택"; "lng_settings_bg_tile" = "타일형 배경화면"; +"lng_settings_adaptive_wide" = "와이드 스크린 레이아웃 적용"; "lng_backgrounds_header" = "새로운 대화창 배경화면을 선택"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}"; "lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상"; -"lng_new_version_text" = "— 음성 메시지에 웨이브 시각 효과 추가\n— 이모티콘 입력시 스티커 추천"; +"lng_new_version_text" = "— 와이드 스크린 레이아웃 설정 적용\n— 리눅스 버전 크래시 수정"; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 6f6d5dca07..5d5e5d0cf9 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Uit galerij kiezen"; "lng_settings_bg_from_file" = "Bestand kiezen"; "lng_settings_bg_tile" = "Naast elkaar"; +"lng_settings_adaptive_wide" = "Adaptieve layout voor brede schermen"; "lng_backgrounds_header" = "Kies je nieuwe achtergrond"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}"; "lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen"; -"lng_new_version_text" = "— Nieuwe visualisatie voor spraakberichten\n— Stickersuggesties als een emoji typt"; +"lng_new_version_text" = "— Adaptieve layout voor brede schermen toegevoegd aan instellingen\n— Crashes in de Linuxversie opgelost"; "lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index bc77b4a315..fb36ee6188 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -262,6 +262,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_bg_from_gallery" = "Escolher da galeria"; "lng_settings_bg_from_file" = "Escolher dos arquivos"; "lng_settings_bg_tile" = "Lado-a-lado"; +"lng_settings_adaptive_wide" = "Layout adaptativo para wide screens"; "lng_backgrounds_header" = "Escolha o seu novo papel de parede"; @@ -836,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop foi atualizado para a versão {version}\n\n{changes}\n\nHistórico completo de mudanças disponível aqui:\n{link}"; "lng_new_version_minor" = "— Resolução de bugs e outras melhorias menores"; -"lng_new_version_text" = "— Nova visualização em ondas para mensagens de voz\n— Sugestões de sticker quando você inicia com emoji"; +"lng_new_version_text" = "— Layout adaptativo para wide screens adicionado em Configurações\n— Resolvido crash nas versões Linux"; "lng_menu_insert_unicode" = "Inserir caractere de controle Unicode"; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 1209ffc3e0..0f10218b3c 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1229,12 +1229,10 @@ void Window::resizeEvent(QResizeEvent *e) { if (!title) return; Adaptive::Layout layout = Adaptive::OneColumnLayout; - if (width() >= st::adaptiveNormalWidth) { - if (width() - chatsListWidth(width()) >= st::historyMaxWidth) { - layout = Adaptive::WideLayout; - } else { - layout = Adaptive::NormalLayout; - } + if (width() > st::adaptiveWideWidth) { + layout = Adaptive::WideLayout; + } else if (width() >= st::adaptiveNormalWidth) { + layout = Adaptive::NormalLayout; } if (layout != Global::AdaptiveLayout()) { Global::SetAdaptiveLayout(layout); From a7b9fd2f2bc0ec3a0ae9a58fe6c72a37af4bb655 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 22 Feb 2016 10:07:44 +0300 Subject: [PATCH 112/316] version 0.9.26 --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/config.h | 6 +++--- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 2 +- Telegram/Version | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f507c4492a..c923078e84 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1055,7 +1055,7 @@ void AppClass::checkMapVersion() { QString versionFeatures; if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9025) { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Adaptive layout for wide screens switch added to Settings\n\xe2\x80\x94 Linux version crash fix");// .replace('@', qsl("@") + QChar(0x200D)); - } else if (Local::oldMapVersion() < 9024) { + } else if (Local::oldMapVersion() < 9026) { versionFeatures = lang(lng_new_version_text).trimmed(); } else { versionFeatures = lang(lng_new_version_minor).trimmed(); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 1f6fd6588e..acd3cd83fb 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9025; -static const wchar_t *AppVersionStr = L"0.9.25"; -static const bool DevVersion = true; +static const int32 AppVersion = 9026; +static const wchar_t *AppVersionStr = L"0.9.26"; +static const bool DevVersion = false; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 789cf25856..733bd0e84e 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.25 + 0.9.26 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 04b48ea038..af8188834c 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,25,0 - PRODUCTVERSION 0,9,25,0 + FILEVERSION 0,9,26,0 + PRODUCTVERSION 0,9,26,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.25.0" + VALUE "FileVersion", "0.9.26.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.25.0" + VALUE "ProductVersion", "0.9.26.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index ba4d36601d..30dc689c9b 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.25; + CURRENT_PROJECT_VERSION = 0.9.26; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; diff --git a/Telegram/Version b/Telegram/Version index ba8449dac8..bc8bffbaf8 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9025 +AppVersion 9026 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.25 -AppVersionStr 0.9.25 -DevChannel 1 +AppVersionStrSmall 0.9.26 +AppVersionStr 0.9.26 +DevChannel 0 BetaVersion 0 9019002 From 2a0a3b5cbb4562ba2338fc0ab587d99a6d409b95 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 22 Feb 2016 14:15:24 +0300 Subject: [PATCH 113/316] tooltip showing only in active window --- Telegram/SourceFiles/gui/popupmenu.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 5 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 70 ++++++++------- Telegram/SourceFiles/mtproto/mtpScheme.h | 100 +++++++++++---------- Telegram/SourceFiles/mtproto/scheme.tl | 16 ++-- Telegram/SourceFiles/structs.h | 14 +-- 6 files changed, 107 insertions(+), 100 deletions(-) diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index cad98ebe0d..035ada7e31 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -545,7 +545,7 @@ PopupTooltip::PopupTooltip() : TWidget(0) void PopupTooltip::onShow() { if (_shower) { - QString text = _shower->tooltipText(); + QString text = (App::wnd() && App::wnd()->isActive(false)) ? _shower->tooltipText() : QString(); if (text.isEmpty()) { Hide(); } else { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 27175c2f3f..05d65d9a72 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2854,7 +2854,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->mute), MTP_string(peer->notify->sound), MTP_bool(peer->notify->previews), MTP_int(peer->notify->events))), RPCResponseHandler(), 0, updateNotifySettingPeers.isEmpty() ? 0 : 10); + 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); } } @@ -3668,10 +3668,9 @@ void MainWidget::applyNotifySetting(const MTPNotifyPeer &peer, const MTPPeerNoti } if (setTo == UnknownNotifySettings) break; + setTo->flags = d.vflags.v; setTo->mute = d.vmute_until.v; setTo->sound = d.vsound.c_string().v; - setTo->previews = mtpIsTrue(d.vshow_previews); - setTo->events = d.vevents_mask.v; if (updatePeer) { if (!h) h = App::history(updatePeer->id); int32 changeIn = 0; diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 0d1eb87c25..57bc8ec598 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1155,7 +1155,7 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type 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(" admin_invites: "); ++stages.back(); if (flag & MTPDchannel::flag_admin_invites) { to.add("YES [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 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(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 13: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; @@ -1856,10 +1856,11 @@ void _serialize_inputPeerNotifySettings(MTPStringLogger &to, int32 stage, int32 to.add("\n").addSpaces(lev); } switch (stage) { - case 0: 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 1: to.add(" sound: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" show_previews: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" events_mask: "); ++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_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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1884,10 +1885,11 @@ void _serialize_peerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, to.add("\n").addSpaces(lev); } switch (stage) { - case 0: 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 1: to.add(" sound: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" show_previews: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" events_mask: "); ++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_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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -5133,11 +5135,7 @@ void _serialize_channels_messageEditData(MTPStringLogger &to, int32 stage, int32 } 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 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break; - case 2: 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 3: to.add(" edit_by: "); ++stages.back(); if (flag & MTPDchannels_messageEditData::flag_edit_by) { 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 4: to.add(" edit_date: "); ++stages.back(); if (flag & MTPDchannels_messageEditData::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 0 IN FIELD flags ]"); } break; - case 5: 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(" 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6520,12 +6518,13 @@ void _serialize_messages_sendMessage(MTPStringLogger &to, int32 stage, int32 lev 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(" 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_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 6: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); 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_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 9: 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 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6541,11 +6540,12 @@ void _serialize_messages_sendMedia(MTPStringLogger &to, int32 stage, int32 lev, 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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(" 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 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 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6561,10 +6561,11 @@ void _serialize_messages_forwardMessages(MTPStringLogger &to, int32 stage, int32 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(" from_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break; - case 5: 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 6: to.add(" to_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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 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 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; } } @@ -6738,11 +6739,12 @@ void _serialize_messages_sendInlineBotResult(MTPStringLogger &to, int32 stage, i 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(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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 5: 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 6: 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 7: to.add(" id: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 87a972c7e2..94cd2994a5 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -186,11 +186,11 @@ enum { mtpc_inputNotifyAll = 0xa429b886, mtpc_inputPeerNotifyEventsEmpty = 0xf03064d8, mtpc_inputPeerNotifyEventsAll = 0xe86a2c74, - mtpc_inputPeerNotifySettings = 0x46a2ce98, + mtpc_inputPeerNotifySettings = 0x38935eb2, mtpc_peerNotifyEventsEmpty = 0xadd53cb3, mtpc_peerNotifyEventsAll = 0x6d1ded88, mtpc_peerNotifySettingsEmpty = 0x70a68512, - mtpc_peerNotifySettings = 0x8d5e11ee, + mtpc_peerNotifySettings = 0x9acda4c0, mtpc_wallPaper = 0xccb03657, mtpc_wallPaperSolid = 0x63117f24, mtpc_inputReportReasonSpam = 0x58dbcab8, @@ -449,7 +449,7 @@ enum { mtpc_messages_botResults = 0x1170b0a3, mtpc_exportedMessageLink = 0x1f486803, mtpc_messageFwdHeader = 0xc786ddcb, - mtpc_channels_messageEditData = 0xb86fd3cf, + mtpc_channels_messageEditData = 0x67e1255f, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, @@ -4240,7 +4240,7 @@ public: private: explicit MTPinputPeerNotifySettings(MTPDinputPeerNotifySettings *_data); - friend MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(MTPint _mute_until, const MTPstring &_sound, MTPBool _show_previews, MTPint _events_mask); + friend MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound); }; typedef MTPBoxed MTPInputPeerNotifySettings; @@ -4301,7 +4301,7 @@ private: explicit MTPpeerNotifySettings(MTPDpeerNotifySettings *_data); friend MTPpeerNotifySettings MTP_peerNotifySettingsEmpty(); - friend MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _mute_until, const MTPstring &_sound, MTPBool _show_previews, MTPint _events_mask); + friend MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound); mtpTypeId _type; }; @@ -9080,7 +9080,7 @@ public: private: explicit MTPchannels_messageEditData(MTPDchannels_messageEditData *_data); - friend MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags, MTPint _from_id, MTPint _edit_by, MTPint _edit_date, const MTPVector &_users); + friend MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags); }; typedef MTPBoxed MTPchannels_MessageEditData; @@ -9953,7 +9953,7 @@ public: flag_verified = (1 << 7), flag_megagroup = (1 << 8), flag_restricted = (1 << 9), - flag_admin_invites = (1 << 10), + flag_democracy = (1 << 10), flag_signatures = (1 << 11), flag_username = (1 << 6), flag_restriction_reason = (1 << 9), @@ -9968,7 +9968,7 @@ public: 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_admin_invites() const { return vflags.v & flag_admin_invites; } + bool is_democracy() const { return vflags.v & flag_democracy; } bool is_signatures() const { return vflags.v & flag_signatures; } bool has_username() const { return vflags.v & flag_username; } bool has_restriction_reason() const { return vflags.v & flag_restriction_reason; } @@ -10551,26 +10551,40 @@ class MTPDinputPeerNotifySettings : public mtpDataImpl { public: MTPDpeerNotifySettings() { } - MTPDpeerNotifySettings(MTPint _mute_until, const MTPstring &_sound, MTPBool _show_previews, MTPint _events_mask) : vmute_until(_mute_until), vsound(_sound), vshow_previews(_show_previews), vevents_mask(_events_mask) { + MTPDpeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) : vflags(_flags), vmute_until(_mute_until), vsound(_sound) { } + MTPint vflags; MTPint vmute_until; MTPstring vsound; - MTPBool vshow_previews; - MTPint vevents_mask; + + 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 MTPDwallPaper : public mtpDataImpl { @@ -13214,24 +13228,16 @@ class MTPDchannels_messageEditData : public mtpDataImpl &_users) : vflags(_flags), vfrom_id(_from_id), vedit_by(_edit_by), vedit_date(_edit_date), vusers(_users) { + MTPDchannels_messageEditData(MTPint _flags) : vflags(_flags) { } MTPint vflags; - MTPint vfrom_id; - MTPint vedit_by; - MTPint vedit_date; - MTPVector vusers; enum { - flag_caption = (1 << 1), - flag_edit_by = (1 << 0), - flag_edit_date = (1 << 0), + flag_caption = (1 << 0), }; bool is_caption() const { return vflags.v & flag_caption; } - bool has_edit_by() const { return vflags.v & flag_edit_by; } - bool has_edit_date() const { return vflags.v & flag_edit_date; } }; // RPC methods @@ -16418,6 +16424,7 @@ public: 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), @@ -16426,6 +16433,7 @@ public: 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; } @@ -16489,12 +16497,14 @@ public: 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; } @@ -16554,10 +16564,12 @@ public: 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(); @@ -18448,11 +18460,13 @@ public: 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 { @@ -24333,7 +24347,7 @@ inline MTPinputPeerNotifySettings::MTPinputPeerNotifySettings() : mtpDataOwner(n inline uint32 MTPinputPeerNotifySettings::innerLength() const { const MTPDinputPeerNotifySettings &v(c_inputPeerNotifySettings()); - return v.vmute_until.innerLength() + v.vsound.innerLength() + v.vshow_previews.innerLength() + v.vevents_mask.innerLength(); + return v.vflags.innerLength() + v.vmute_until.innerLength() + v.vsound.innerLength(); } inline mtpTypeId MTPinputPeerNotifySettings::type() const { return mtpc_inputPeerNotifySettings; @@ -24343,22 +24357,20 @@ inline void MTPinputPeerNotifySettings::read(const mtpPrime *&from, const mtpPri if (!data) setData(new MTPDinputPeerNotifySettings()); MTPDinputPeerNotifySettings &v(_inputPeerNotifySettings()); + v.vflags.read(from, end); v.vmute_until.read(from, end); v.vsound.read(from, end); - v.vshow_previews.read(from, end); - v.vevents_mask.read(from, end); } inline void MTPinputPeerNotifySettings::write(mtpBuffer &to) const { const MTPDinputPeerNotifySettings &v(c_inputPeerNotifySettings()); + v.vflags.write(to); v.vmute_until.write(to); v.vsound.write(to); - v.vshow_previews.write(to); - v.vevents_mask.write(to); } inline MTPinputPeerNotifySettings::MTPinputPeerNotifySettings(MTPDinputPeerNotifySettings *_data) : mtpDataOwner(_data) { } -inline MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(MTPint _mute_until, const MTPstring &_sound, MTPBool _show_previews, MTPint _events_mask) { - return MTPinputPeerNotifySettings(new MTPDinputPeerNotifySettings(_mute_until, _sound, _show_previews, _events_mask)); +inline MTPinputPeerNotifySettings MTP_inputPeerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) { + return MTPinputPeerNotifySettings(new MTPDinputPeerNotifySettings(_flags, _mute_until, _sound)); } inline uint32 MTPpeerNotifyEvents::innerLength() const { @@ -24397,7 +24409,7 @@ inline uint32 MTPpeerNotifySettings::innerLength() const { switch (_type) { case mtpc_peerNotifySettings: { const MTPDpeerNotifySettings &v(c_peerNotifySettings()); - return v.vmute_until.innerLength() + v.vsound.innerLength() + v.vshow_previews.innerLength() + v.vevents_mask.innerLength(); + return v.vflags.innerLength() + v.vmute_until.innerLength() + v.vsound.innerLength(); } } return 0; @@ -24413,10 +24425,9 @@ inline void MTPpeerNotifySettings::read(const mtpPrime *&from, const mtpPrime *e case mtpc_peerNotifySettings: _type = cons; { if (!data) setData(new MTPDpeerNotifySettings()); MTPDpeerNotifySettings &v(_peerNotifySettings()); + v.vflags.read(from, end); v.vmute_until.read(from, end); v.vsound.read(from, end); - v.vshow_previews.read(from, end); - v.vevents_mask.read(from, end); } break; default: throw mtpErrorUnexpected(cons, "MTPpeerNotifySettings"); } @@ -24425,10 +24436,9 @@ inline void MTPpeerNotifySettings::write(mtpBuffer &to) const { switch (_type) { case mtpc_peerNotifySettings: { const MTPDpeerNotifySettings &v(c_peerNotifySettings()); + v.vflags.write(to); v.vmute_until.write(to); v.vsound.write(to); - v.vshow_previews.write(to); - v.vevents_mask.write(to); } break; } } @@ -24444,8 +24454,8 @@ inline MTPpeerNotifySettings::MTPpeerNotifySettings(MTPDpeerNotifySettings *_dat inline MTPpeerNotifySettings MTP_peerNotifySettingsEmpty() { return MTPpeerNotifySettings(mtpc_peerNotifySettingsEmpty); } -inline MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _mute_until, const MTPstring &_sound, MTPBool _show_previews, MTPint _events_mask) { - return MTPpeerNotifySettings(new MTPDpeerNotifySettings(_mute_until, _sound, _show_previews, _events_mask)); +inline MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _flags, MTPint _mute_until, const MTPstring &_sound) { + return MTPpeerNotifySettings(new MTPDpeerNotifySettings(_flags, _mute_until, _sound)); } inline uint32 MTPwallPaper::innerLength() const { @@ -30909,7 +30919,7 @@ inline MTPchannels_messageEditData::MTPchannels_messageEditData() : mtpDataOwner inline uint32 MTPchannels_messageEditData::innerLength() const { const MTPDchannels_messageEditData &v(c_channels_messageEditData()); - return v.vflags.innerLength() + v.vfrom_id.innerLength() + (v.has_edit_by() ? v.vedit_by.innerLength() : 0) + (v.has_edit_date() ? v.vedit_date.innerLength() : 0) + v.vusers.innerLength(); + return v.vflags.innerLength(); } inline mtpTypeId MTPchannels_messageEditData::type() const { return mtpc_channels_messageEditData; @@ -30920,23 +30930,15 @@ inline void MTPchannels_messageEditData::read(const mtpPrime *&from, const mtpPr if (!data) setData(new MTPDchannels_messageEditData()); MTPDchannels_messageEditData &v(_channels_messageEditData()); v.vflags.read(from, end); - v.vfrom_id.read(from, end); - if (v.has_edit_by()) { v.vedit_by.read(from, end); } else { v.vedit_by = MTPint(); } - if (v.has_edit_date()) { v.vedit_date.read(from, end); } else { v.vedit_date = MTPint(); } - v.vusers.read(from, end); } inline void MTPchannels_messageEditData::write(mtpBuffer &to) const { const MTPDchannels_messageEditData &v(c_channels_messageEditData()); v.vflags.write(to); - v.vfrom_id.write(to); - if (v.has_edit_by()) v.vedit_by.write(to); - if (v.has_edit_date()) v.vedit_date.write(to); - v.vusers.write(to); } inline MTPchannels_messageEditData::MTPchannels_messageEditData(MTPDchannels_messageEditData *_data) : mtpDataOwner(_data) { } -inline MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags, MTPint _from_id, MTPint _edit_by, MTPint _edit_date, const MTPVector &_users) { - return MTPchannels_messageEditData(new MTPDchannels_messageEditData(_flags, _from_id, _edit_by, _edit_date, _users)); +inline MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags) { + return MTPchannels_messageEditData(new MTPDchannels_messageEditData(_flags)); } // Human-readable text serialization diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 94df0ec3e7..8e4b7bf2f7 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -209,7 +209,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat; chatForbidden#7328bdb id:int title:string = Chat; -channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true admin_invites:flags.10?true signatures:flags.11?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; +channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; @@ -280,13 +280,13 @@ inputNotifyAll#a429b886 = InputNotifyPeer; inputPeerNotifyEventsEmpty#f03064d8 = InputPeerNotifyEvents; inputPeerNotifyEventsAll#e86a2c74 = InputPeerNotifyEvents; -inputPeerNotifySettings#46a2ce98 mute_until:int sound:string show_previews:Bool events_mask:int = InputPeerNotifySettings; +inputPeerNotifySettings#38935eb2 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = InputPeerNotifySettings; peerNotifyEventsEmpty#add53cb3 = PeerNotifyEvents; peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents; peerNotifySettingsEmpty#70a68512 = PeerNotifySettings; -peerNotifySettings#8d5e11ee mute_until:int sound:string show_previews:Bool events_mask:int = PeerNotifySettings; +peerNotifySettings#9acda4c0 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = PeerNotifySettings; wallPaper#ccb03657 id:int title:string sizes:Vector color:int = WallPaper; wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper; @@ -644,7 +644,7 @@ exportedMessageLink#1f486803 link:string = ExportedMessageLink; messageFwdHeader#c786ddcb flags:# from_id:flags.0?int date:int channel_id:flags.1?int channel_post:flags.2?int = MessageFwdHeader; -channels.messageEditData#b86fd3cf flags:# caption:flags.1?true from_id:int edit_by:flags.0?int edit_date:flags.0?int users:Vector = channels.MessageEditData; +channels.messageEditData#67e1255f flags:# caption:flags.0?true = channels.MessageEditData; ---functions--- @@ -721,9 +721,9 @@ messages.deleteHistory#b7c13bd9 peer:InputPeer max_id:int = messages.AffectedHis messages.deleteMessages#a5f18925 id:Vector = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector; messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; -messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true broadcast:flags.4?true silent:flags.5?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; -messages.sendMedia#c8f16791 flags:# broadcast:flags.4?true silent:flags.5?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; -messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true silent:flags.5?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer = Updates; +messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true broadcast:flags.4?true silent:flags.5?true background:flags.6?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Updates; +messages.sendMedia#c8f16791 flags:# broadcast:flags.4?true silent:flags.5?true background:flags.6?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; +messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true silent:flags.5?true background:flags.6?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getChats#3c6aa187 id:Vector = messages.Chats; messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; @@ -767,7 +767,7 @@ messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs; messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; messages.getInlineBotResults#9324600d bot:InputUser query:string offset:string = messages.BotResults; messages.setInlineBotResults#3f23ec12 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector cache_time:int next_offset:flags.2?string = Bool; -messages.sendInlineBotResult#b16e06fe flags:# broadcast:flags.4?true silent:flags.5?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates; +messages.sendInlineBotResult#b16e06fe flags:# broadcast:flags.4?true silent:flags.5?true background:flags.6?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates; updates.getState#edd4882a = updates.State; updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 69604e5017..16df19fcd5 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -163,12 +163,16 @@ static const MsgId ServerMaxMsgId = 0x3FFFFFFF; static const MsgId ShowAtUnreadMsgId = 0; struct NotifySettings { - NotifySettings() : mute(0), sound("default"), previews(true), events(1) { + NotifySettings() : flags(MTPDinputPeerNotifySettings::flag_show_previews), mute(0), sound("default") { } - int32 mute; + int32 flags, mute; string sound; - bool previews; - int32 events; + bool previews() const { + return flags & MTPDinputPeerNotifySettings::flag_show_previews; + } + bool silent() const { + return flags & MTPDinputPeerNotifySettings::flag_silent; + } }; typedef NotifySettings *NotifySettingsPtr; @@ -633,7 +637,7 @@ public: return flags & MTPDchannel::flag_verified; } bool canAddParticipants() const { - return amCreator() || amEditor() || (flags & MTPDchannel::flag_admin_invites); + return amCreator() || amEditor() || (flags & MTPDchannel::flag_democracy); } // ImagePtr photoFull; From 46e562c86e5c688ab0abf15680075e99a2dce692 Mon Sep 17 00:00:00 2001 From: auchri Date: Mon, 22 Feb 2016 16:55:35 +0100 Subject: [PATCH 114/316] Update qmake for v0.9.26 --- doc/building-qmake.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/building-qmake.md b/doc/building-qmake.md index 37f091331e..ad86748b08 100644 --- a/doc/building-qmake.md +++ b/doc/building-qmake.md @@ -53,6 +53,7 @@ Preparation echo 'INCLUDEPATH += "/usr/lib/glib-2.0/include"' echo 'INCLUDEPATH += "/usr/lib/gtk-2.0/include"' echo 'INCLUDEPATH += "/usr/include/opus"' ++ echo 'LIBS += -lcrypto -lssl' ) >> "$srcdir/tdesktop/Telegram/Telegram.pro" Building From aebe15acdaef117e53a83fbdd066f48206f914a8 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Mon, 22 Feb 2016 17:02:57 +0100 Subject: [PATCH 115/316] Fix last commit (Update qmake for v0.9.26) Signed-off-by: Christoph Auer --- doc/building-qmake.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/building-qmake.md b/doc/building-qmake.md index ad86748b08..ff6ac22e15 100644 --- a/doc/building-qmake.md +++ b/doc/building-qmake.md @@ -53,7 +53,7 @@ Preparation echo 'INCLUDEPATH += "/usr/lib/glib-2.0/include"' echo 'INCLUDEPATH += "/usr/lib/gtk-2.0/include"' echo 'INCLUDEPATH += "/usr/include/opus"' -+ echo 'LIBS += -lcrypto -lssl' + echo 'LIBS += -lcrypto -lssl' ) >> "$srcdir/tdesktop/Telegram/Telegram.pro" Building From 0ffc2ce1413673aa4c1c5e5c1139e0c43eda3a21 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 23 Feb 2016 12:52:18 +0300 Subject: [PATCH 116/316] applying flags from dcOptions --- Telegram/SourceFiles/config.h | 2 +- Telegram/SourceFiles/mtproto/mtp.cpp | 19 ++- Telegram/SourceFiles/mtproto/mtp.h | 22 +-- .../SourceFiles/mtproto/mtpConnection.cpp | 139 ++++++++++++------ Telegram/SourceFiles/mtproto/mtpConnection.h | 19 ++- Telegram/SourceFiles/mtproto/mtpDC.cpp | 12 +- 6 files changed, 141 insertions(+), 72 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index acd3cd83fb..205e87895b 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -55,7 +55,7 @@ enum { MTPDownloadSessionsCount = 4, // max 4 download sessions is created MTPKillFileSessionTimeout = 5000, // how much time without upload / download causes additional session kill - MTPEnumDCTimeout = 4000, // 4 seconds timeout for help_getConfig to work (them move to other dc) + MTPEnumDCTimeout = 8000, // 8 seconds timeout for help_getConfig to work (then move to other dc) MTPDebugBufferSize = 1024 * 1024, // 1 mb start size diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index a6847bf34f..6f443783c7 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -622,7 +622,24 @@ namespace _mtp_internal { namespace MTP { - void start() { + const uint32 cfg = 1 * _mtp_internal::dcShift; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum + const uint32 lgt = 2 * _mtp_internal::dcShift; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum + const uint32 dld[MTPDownloadSessionsCount] = { // send(req, callbacks, MTP::dld[i] + dc) - for download + 0x10 * _mtp_internal::dcShift, + 0x11 * _mtp_internal::dcShift, + 0x12 * _mtp_internal::dcShift, + 0x13 * _mtp_internal::dcShift, + }; + const uint32 upl[MTPUploadSessionsCount] = { // send(req, callbacks, MTP::upl[i] + dc) - for upload + 0x20 * _mtp_internal::dcShift, + 0x21 * _mtp_internal::dcShift, + 0x22 * _mtp_internal::dcShift, + 0x23 * _mtp_internal::dcShift, + }; + const uint32 dldStart = dld[0], dldEnd = dld[(sizeof(dld) / sizeof(dld[0])) - 1] + _mtp_internal::dcShift; + const uint32 uplStart = upl[0], uplEnd = upl[(sizeof(upl) / sizeof(upl[0])) - 1] + _mtp_internal::dcShift; + + void start() { if (started()) return; unixtimeInit(); diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index 2e830ae69f..ed2882e241 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -68,20 +68,12 @@ namespace _mtp_internal { namespace MTP { - static const uint32 cfg = 1 * _mtp_internal::dcShift; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum - static const uint32 lgt = 2 * _mtp_internal::dcShift; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum - static const uint32 dld[MTPDownloadSessionsCount] = { // send(req, callbacks, MTP::dld[i] + dc) - for download - 0x10 * _mtp_internal::dcShift, - 0x11 * _mtp_internal::dcShift, - 0x12 * _mtp_internal::dcShift, - 0x13 * _mtp_internal::dcShift, - }; - static const uint32 upl[MTPUploadSessionsCount] = { // send(req, callbacks, MTP::upl[i] + dc) - for upload - 0x20 * _mtp_internal::dcShift, - 0x21 * _mtp_internal::dcShift, - 0x22 * _mtp_internal::dcShift, - 0x23 * _mtp_internal::dcShift, - }; + extern const uint32 cfg; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum + extern const uint32 lgt; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum + extern const uint32 dld[MTPDownloadSessionsCount]; // send(req, callbacks, MTP::dld[i] + dc) - for download + extern const uint32 upl[MTPUploadSessionsCount]; // send(req, callbacks, MTP::upl[i] + dc) - for upload + extern const uint32 dldStart, dldEnd; // dc >= dldStart && dc < dldEnd => dc in dld + extern const uint32 uplStart, uplEnd; // dc >= uplStart && dc < uplEnd => dc in upl void start(); bool started(); @@ -119,7 +111,7 @@ namespace MTP { void cancel(mtpRequestId req); void killSession(int32 dc); void stopSession(int32 dc); - + enum { RequestSent = 0, RequestConnecting = 1, diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index d35912658d..3604baf574 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -623,8 +623,13 @@ void MTPabstractTcpConnection::socketRead() { } while (sock.state() == QAbstractSocket::ConnectedState && sock.bytesAvailable()); } -MTPautoConnection::MTPautoConnection(QThread *thread) : status(WaitingBoth), -tcpNonce(MTP::nonce()), httpNonce(MTP::nonce()), _tcpTimeout(MTPMinReceiveDelay), _flags(0) { +MTPautoConnection::MTPautoConnection(QThread *thread) : MTPabstractTcpConnection() +, status(WaitingBoth) +, tcpNonce(MTP::nonce()) +, httpNonce(MTP::nonce()) +, _flagsTcp(0) +, _flagsHttp(0) +, _tcpTimeout(MTPMinReceiveDelay) { moveToThread(thread); manager.moveToThread(thread); @@ -647,7 +652,7 @@ tcpNonce(MTP::nonce()), httpNonce(MTP::nonce()), _tcpTimeo void MTPautoConnection::onHttpStart() { if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -658,7 +663,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flagsTcp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout; tcpTimeoutTimer.start(_tcpTimeout); @@ -678,7 +683,7 @@ void MTPautoConnection::onTcpTimeoutTimer() { if (state == QAbstractSocket::ConnectedState || state == QAbstractSocket::ConnectingState || state == QAbstractSocket::HostLookupState) { sock.disconnectFromHost(); } else if (state != QAbstractSocket::ClosingState) { - sock.connectToHost(QHostAddress(_addr), _port); + sock.connectToHost(QHostAddress(_addrTcp), _portTcp); } } } @@ -687,7 +692,7 @@ void MTPautoConnection::onSocketDisconnected() { if (_tcpTimeout < 0) { _tcpTimeout = -_tcpTimeout; if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { - sock.connectToHost(QHostAddress(_addr), _port); + sock.connectToHost(QHostAddress(_addrTcp), _portTcp); return; } } @@ -696,7 +701,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by socket disconnect").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; emit connected(); } @@ -788,21 +793,27 @@ void MTPautoConnection::disconnectFromServer() { httpStartTimer.stop(); } -void MTPautoConnection::connectToServer(const QString &addr, int32 port, int32 flags) { +void MTPautoConnection::connectTcp(const QString &addr, int32 port, int32 flags) { + _addrTcp = addr; + _portTcp = port; + _flagsTcp = flags; + + connect(&sock, SIGNAL(readyRead()), this, SLOT(socketRead())); + 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 TCP_LOG(("HTTP Info: address is %1").arg(address.toDisplayString())); connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); - _addr = addr; - _port = port; - _flags = flags; - - connect(&sock, SIGNAL(readyRead()), this, SLOT(socketRead())); - sock.connectToHost(QHostAddress(_addr), _port); + _addrHttp = addr; + _portHttp = port; + _flagsHttp = 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((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); httpSend(buffer); } @@ -838,7 +849,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by pq-response, awaited").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -881,7 +892,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, ready").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -900,7 +911,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flagsTcp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingTcp; emit connected(); } @@ -910,7 +921,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, awaited").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; sock.disconnectFromHost(); emit connected(); @@ -950,7 +961,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((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by tcp error, ready").arg((_flagsHttp & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; emit connected(); } else if (status == WaitingTcp || status == UsingTcp) { @@ -1064,7 +1075,7 @@ void MTPtcpConnection::disconnectFromServer() { sock.close(); } -void MTPtcpConnection::connectToServer(const QString &addr, int32 port, int32 flags) { +void MTPtcpConnection::connectTcp(const QString &addr, int32 port, int32 flags) { _addr = addr; _port = port; _flags = flags; @@ -1161,7 +1172,7 @@ void MTPhttpConnection::disconnectFromServer() { address = QUrl(); } -void MTPhttpConnection::connectToServer(const QString &addr, int32 p, int32 flags) { +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 TCP_LOG(("HTTP Info: address is %1").arg(address.toDisplayString())); connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); @@ -1955,34 +1966,70 @@ void MTProtoConnectionPrivate::restartNow() { } void MTProtoConnectionPrivate::socketStart(bool afterConfig) { - int32 flags4 = 0, flags6 = 0; - std::string ip4, ip6; - uint32 port4 = 0, port6 = 0; + bool isDldDc = (dc >= MTP::dldStart) && (dc < MTP::dldEnd); + int32 baseDc = (dc % _mtp_internal::dcShift); + + static const int IPv4address = 0, IPv6address = 1; + static const int TcpProtocol = 0, HttpProtocol = 1; + int32 flags[2][2] = { { 0 } }; + string ip[2][2]; + uint32 port[2][2] = { { 0 } }; { QReadLocker lock(mtpDcOptionsMutex()); const mtpDcOptions &options(cDcOptions()); - mtpDcOptions::const_iterator dcIndex4 = options.constFind(dc % _mtp_internal::dcShift); - if (dcIndex4 != options.cend()) { - ip4 = dcIndex4->ip; - flags4 = dcIndex4->flags; - port4 = dcIndex4->port; - } - mtpDcOptions::const_iterator dcIndex6 = options.constFind((dc % _mtp_internal::dcShift) + (_mtp_internal::dcShift * MTPDdcOption::flag_ipv6)); - if (dcIndex6 != options.cend()) { - ip6 = dcIndex6->ip; - flags6 = dcIndex6->flags; - port6 = dcIndex6->port; + 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, + 0 + }, { // HTTP IPv4 + -1, + -1, + isDldDc ? (MTPDdcOption::flag_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 + }, { // HTTP IPv6 + -1, + -1, + isDldDc ? (MTPDdcOption::flag_media_only | MTPDdcOption::flag_ipv6) : -1, + MTPDdcOption::flag_ipv6 + }, + }, + }; + for (int32 address = 0, acount = sizeof(shifts) / sizeof(shifts[0]); address < acount; ++address) { + for (int32 protocol = 0, pcount = sizeof(shifts[0]) / sizeof(shifts[0][0]); protocol < pcount; ++protocol) { + for (int32 shift = 0, scount = sizeof(shifts[0][0]) / sizeof(shifts[0][0][0]); shift < scount; ++shift) { + int32 mask = shifts[address][protocol][shift]; + if (mask < 0) continue; + + mtpDcOptions::const_iterator index = options.constFind(baseDc + _mtp_internal::dcShift * mask); + if (index != options.cend()) { + ip[address][protocol] = index->ip; + flags[address][protocol] = index->flags; + port[address][protocol] = index->port; + break; + } + } + } } } - bool noIPv4 = (!port4 || ip4.empty()), noIPv6 = (!cTryIPv6() || !port6 || ip6.empty()); + bool noIPv4 = !port[IPv4address][HttpProtocol], noIPv6 = (!cTryIPv6() || !port[IPv6address][HttpProtocol]); if (noIPv4 && noIPv6) { if (afterConfig) { - if (noIPv4) LOG(("MTP Error: DC %1 options for IPv4 not found right after config load!").arg(dc)); - if (cTryIPv6() && noIPv6) LOG(("MTP Error: DC %1 options for IPv6 not found right after config load!").arg(dc)); + if (noIPv4) LOG(("MTP Error: DC %1 options for IPv4 over HTTP not found right after config load!").arg(dc)); + if (cTryIPv6() && noIPv6) LOG(("MTP Error: DC %1 options for IPv6 over HTTP not found right after config load!").arg(dc)); return restart(); } - if (noIPv4) DEBUG_LOG(("MTP Info: DC %1 options for IPv4 not found, waiting for config").arg(dc)); - if (cTryIPv6() && noIPv6) DEBUG_LOG(("MTP Info: DC %1 options for IPv6 not found, waiting for config").arg(dc)); + if (noIPv4) DEBUG_LOG(("MTP Info: DC %1 options for IPv4 over HTTP not found, waiting for config").arg(dc)); + if (cTryIPv6() && noIPv6) DEBUG_LOG(("MTP Info: DC %1 options for IPv6 over HTTP not found, waiting for config").arg(dc)); connect(mtpConfigLoader(), SIGNAL(loaded()), this, SLOT(onConfigLoaded())); mtpConfigLoader()->load(); return; @@ -1998,19 +2045,21 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { _pingId = _pingMsgId = _pingIdToSend = _pingSendAt = 0; _pingSender.stop(); - if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2..").arg(ip4.c_str()).arg(port4)); - if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2..").arg(ip6.c_str()).arg(port6)); + if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %1:%2 (http)..").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv4 connection to [%1]:%2 (tcp) and [%1]:%2 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); _waitForConnectedTimer.start(_waitForConnected); if (_conn4) { connect(_conn4, SIGNAL(connected()), this, SLOT(onConnected4())); connect(_conn4, SIGNAL(disconnected()), this, SLOT(onDisconnected4())); - _conn4->connectToServer(ip4.c_str(), port4, flags4); + _conn4->connectTcp(ip[IPv4address][TcpProtocol].c_str(), port[IPv4address][TcpProtocol], flags[IPv4address][TcpProtocol]); + _conn4->connectHttp(ip[IPv4address][HttpProtocol].c_str(), port[IPv4address][HttpProtocol], flags[IPv4address][HttpProtocol]); } if (_conn6) { connect(_conn6, SIGNAL(connected()), this, SLOT(onConnected6())); connect(_conn6, SIGNAL(disconnected()), this, SLOT(onDisconnected6())); - _conn6->connectToServer(ip6.c_str(), port6, flags6); + _conn6->connectTcp(ip[IPv6address][TcpProtocol].c_str(), port[IPv6address][TcpProtocol], flags[IPv6address][TcpProtocol]); + _conn6->connectHttp(ip[IPv6address][HttpProtocol].c_str(), port[IPv6address][HttpProtocol], flags[IPv6address][HttpProtocol]); } } diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 5674fc4012..1d2d684cf7 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -113,7 +113,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 connectToServer(const QString &addr, int32 port, int32 flags) = 0; + virtual void connectTcp(const QString &addr, int32 port, int32 flags) = 0; + virtual void connectHttp(const QString &addr, int32 port, int32 flags) = 0; virtual bool isConnected() const = 0; virtual bool usingHttpWait() { return false; @@ -181,7 +182,8 @@ public: void sendData(mtpBuffer &buffer); void disconnectFromServer(); - void connectToServer(const QString &addr, int32 port, int32 flags); + 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(); @@ -228,8 +230,9 @@ private: typedef QSet Requests; Requests requests; - QString _addr; - int32 _port, _tcpTimeout, _flags; + QString _addrTcp, _addrHttp; + int32 _portTcp, _portHttp, _flagsTcp, _flagsHttp; + int32 _tcpTimeout; QTimer tcpTimeoutTimer; }; @@ -243,7 +246,9 @@ public: void sendData(mtpBuffer &buffer); void disconnectFromServer(); - void connectToServer(const QString &addr, int32 port, int32 flags); + void connectTcp(const QString &addr, int32 port, int32 flags); + void connectHttp(const QString &addr, int32 port, int32 flags) { // not supported + } bool isConnected() const; int32 debugState() const; @@ -288,7 +293,9 @@ public: void sendData(mtpBuffer &buffer); void disconnectFromServer(); - void connectToServer(const QString &addr, int32 port, int32 flags); + void connectTcp(const QString &addr, int32 port, int32 flags) { // not supported + } + void connectHttp(const QString &addr, int32 port, int32 flags); bool isConnected() const; bool usingHttpWait(); bool needHttpWait(); diff --git a/Telegram/SourceFiles/mtproto/mtpDC.cpp b/Telegram/SourceFiles/mtproto/mtpDC.cpp index 899e21a2ca..0cb0c3bff5 100644 --- a/Telegram/SourceFiles/mtproto/mtpDC.cpp +++ b/Telegram/SourceFiles/mtproto/mtpDC.cpp @@ -258,16 +258,20 @@ void MTProtoConfigLoader::enumDC() { } else { MTP::killSession(MTP::cfg + _enumCurrent); } + OrderedSet dcs; { QReadLocker lock(mtpDcOptionsMutex()); const mtpDcOptions &options(cDcOptions()); for (mtpDcOptions::const_iterator i = options.cbegin(), e = options.cend(); i != e; ++i) { - if (i.key() == _enumCurrent) { - _enumCurrent = (++i == e) ? options.cbegin().key() : i.key(); - break; - } + dcs.insert(i.key() % _mtp_internal::dcShift); } } + OrderedSet::const_iterator i = dcs.constFind(_enumCurrent); + if (i == dcs.cend() || (++i) == dcs.cend()) { + _enumCurrent = dcs.cbegin().key(); + } else { + _enumCurrent = i.key(); + } _enumRequest = MTP::send(MTPhelp_GetConfig(), rpcDone(configLoaded), rpcFail(configFailed), MTP::cfg + _enumCurrent); _enumDCTimer.start(MTPEnumDCTimeout); From 9c8ae7f32b3562971b5a7a40304094882aa491e8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 23 Feb 2016 17:31:06 +0300 Subject: [PATCH 117/316] improved media caption edit in box, need to make post edit in message field --- Telegram/Resources/lang.strings | 3 + Telegram/SourceFiles/boxes/abstractbox.cpp | 8 ++ Telegram/SourceFiles/boxes/photosendbox.cpp | 137 +++++++++++--------- Telegram/SourceFiles/boxes/photosendbox.h | 12 +- Telegram/SourceFiles/gui/text.cpp | 52 ++++++++ Telegram/SourceFiles/gui/text.h | 1 + Telegram/SourceFiles/historywidget.cpp | 8 +- 7 files changed, 157 insertions(+), 64 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 30f567731a..e89b8be690 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -124,6 +124,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_flood_error" = "Too many tries. Please try again later."; "lng_gif_error" = "An error has occured while reading GIF animation :("; "lng_edit_error" = "You cannot edit this message"; +"lng_edit_deleted" = "This message was deleted"; +"lng_edit_too_long" = "Your message text is too long"; +"lng_edit_message" = "Edit message"; "lng_deleted" = "Unknown"; "lng_deleted_message" = "Deleted message"; diff --git a/Telegram/SourceFiles/boxes/abstractbox.cpp b/Telegram/SourceFiles/boxes/abstractbox.cpp index ca02a614a7..e9d1783ad5 100644 --- a/Telegram/SourceFiles/boxes/abstractbox.cpp +++ b/Telegram/SourceFiles/boxes/abstractbox.cpp @@ -178,6 +178,14 @@ void AbstractBox::resizeMaxHeight(int32 newWidth, int32 maxHeight) { _maxHeight = maxHeight; resize(newWidth, countHeight()); if (parentWidget()) { + QRect r = geometry(); + int32 parenth = parentWidget()->height(); + if (r.top() + r.height() + st::boxVerticalMargin > parenth) { + int32 newTop = qMax(parenth - int(st::boxVerticalMargin) - r.height(), (parenth - r.height()) / 2); + if (newTop != r.top()) { + move(r.left(), newTop); + } + } parentWidget()->update(geometry().united(g).marginsAdded(QMargins(st::boxShadow.pxWidth(), st::boxShadow.pxHeight(), st::boxShadow.pxWidth(), st::boxShadow.pxHeight()))); } } diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index 4bc63c021d..a64a17f357 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -360,12 +360,12 @@ void PhotoSendBox::onSend(bool ctrlShiftEnter) { onClose(); } -EditPostBox::EditPostBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) -, _msg(msg) +EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) +, _msgId(msg->fullId()) , _animated(false) , _photo(false) , _doc(false) -, _text(0) +, _field(0) , _save(this, lang(lng_settings_save), st::defaultBoxButton) , _cancel(this, lang(lng_cancel), st::cancelBoxButton) , _thumbx(0) @@ -383,7 +383,7 @@ EditPostBox::EditPostBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) ImagePtr image; QString caption; DocumentData *doc = 0; - if (HistoryMedia *media = _msg->getMedia()) { + if (HistoryMedia *media = msg->getMedia()) { HistoryMediaType t = media->type(); switch (t) { case MediaTypeGif: { @@ -489,45 +489,51 @@ EditPostBox::EditPostBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) } if (_animated || _photo || _doc) { - _text = new InputArea(this, st::confirmCaptionArea, lang(lng_photo_caption), caption); - _text->setMaxLength(MaxPhotoCaption); - _text->setCtrlEnterSubmit(CtrlEnterSubmitBoth); + _field = new InputArea(this, st::confirmCaptionArea, lang(lng_photo_caption), caption); + _field->setMaxLength(MaxPhotoCaption); + _field->setCtrlEnterSubmit(CtrlEnterSubmitBoth); } else { - _text = new InputArea(this, st::editTextArea, lang(lng_edit_placeholder), msg->originalText()); - _text->setMaxLength(MaxMessageSize); - _text->setCtrlEnterSubmit(cCtrlEnter() ? CtrlEnterSubmitCtrlEnter : CtrlEnterSubmitEnter); + QString text = textApplyEntities(msg->originalText(), msg->originalEntities()); + _field = new InputArea(this, st::editTextArea, lang(lng_edit_placeholder), text); +// _field->setMaxLength(MaxMessageSize); // entities can make text in input field larger but still valid + _field->setCtrlEnterSubmit(cCtrlEnter() ? CtrlEnterSubmitCtrlEnter : CtrlEnterSubmitEnter); } updateBoxSize(); - connect(_text, SIGNAL(resized()), this, SLOT(onCaptionResized())); - connect(_text, SIGNAL(submitted(bool)), this, SLOT(onSave(bool))); - connect(_text, SIGNAL(cancelled()), this, SLOT(onClose())); + connect(_field, SIGNAL(submitted(bool)), this, SLOT(onSave(bool))); + connect(_field, SIGNAL(cancelled()), this, SLOT(onClose())); + connect(_field, SIGNAL(resized()), this, SLOT(onCaptionResized())); - QTextCursor c(_text->textCursor()); + QTextCursor c(_field->textCursor()); c.movePosition(QTextCursor::End); - _text->setTextCursor(c); + _field->setTextCursor(c); prepare(); } -void EditPostBox::onCaptionResized() { +bool EditCaptionBox::captionFound() const { + return _animated || _photo || _doc; +} + +void EditCaptionBox::onCaptionResized() { updateBoxSize(); resizeEvent(0); update(); } -void EditPostBox::updateBoxSize() { +void EditCaptionBox::updateBoxSize() { + int32 bottomh = st::boxPhotoCompressedPadding.bottom() + _field->height() + st::normalFont->height + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom(); if (_photo || _animated) { - setMaxHeight(st::boxPhotoPadding.top() + _thumbh + st::boxPhotoPadding.bottom() + st::boxPhotoCompressedPadding.bottom() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + setMaxHeight(st::boxPhotoPadding.top() + _thumbh + bottomh); } else if (_thumbw) { - setMaxHeight(st::boxPhotoPadding.top() + st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom() + st::boxPhotoPadding.bottom() + st::boxPhotoCompressedPadding.bottom() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + setMaxHeight(st::boxPhotoPadding.top() + 0 + st::msgFileThumbSize + 0 + bottomh); } else if (_doc) { - setMaxHeight(st::boxPhotoPadding.top() + st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom() + st::boxPhotoPadding.bottom() + st::boxPhotoCompressedPadding.bottom() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + setMaxHeight(st::boxPhotoPadding.top() + 0 + st::msgFileSize + 0 + bottomh); } else { - setMaxHeight(st::boxPhotoPadding.top() + _text->height() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + setMaxHeight(st::boxPhotoPadding.top() + st::boxTitleFont->height + bottomh); } } -void EditPostBox::paintEvent(QPaintEvent *e) { +void EditCaptionBox::paintEvent(QPaintEvent *e) { Painter p(this); if (paint(p)) return; @@ -552,93 +558,108 @@ void EditPostBox::paintEvent(QPaintEvent *e) { } } else if (_doc) { int32 w = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); - int32 h = _thumbw ? (st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom()) : (st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom()); - int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0; + int32 h = _thumbw ? (0 + st::msgFileThumbSize + 0) : (0 + st::msgFileSize + 0); + int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0; if (_thumbw) { - nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); - nametop = st::msgFileThumbNameTop; - nameright = st::msgFileThumbPadding.left(); - statustop = st::msgFileThumbStatusTop; - linktop = st::msgFileThumbLinkTop; + nameleft = 0 + st::msgFileThumbSize + st::msgFileThumbPadding.right(); + nametop = st::msgFileThumbNameTop - st::msgFileThumbPadding.top(); + nameright = 0; + statustop = st::msgFileThumbStatusTop - st::msgFileThumbPadding.top(); } else { - nameleft = st::msgFilePadding.left() + st::msgFileSize + st::msgFilePadding.right(); - nametop = st::msgFileNameTop; - nameright = st::msgFilePadding.left(); - statustop = st::msgFileStatusTop; + nameleft = 0 + st::msgFileSize + st::msgFilePadding.right(); + nametop = st::msgFileNameTop - st::msgFilePadding.top(); + nameright = 0; + statustop = st::msgFileStatusTop - st::msgFilePadding.top(); } - int32 namewidth = w - nameleft - (_thumbw ? st::msgFileThumbPadding.left() : st::msgFilePadding.left()); + int32 namewidth = w - nameleft - 0; if (namewidth > _statusw) { - w -= (namewidth - _statusw); - namewidth = _statusw; + //w -= (namewidth - _statusw); + //namewidth = _statusw; } int32 x = (width() - w) / 2, y = st::boxPhotoPadding.top(); - App::roundRect(p, x, y, w, h, st::msgOutBg, MessageOutCorners, &st::msgOutShadow); +// App::roundRect(p, x, y, w, h, st::msgInBg, MessageInCorners, &st::msgInShadow); if (_thumbw) { - QRect rthumb(rtlrect(x + st::msgFileThumbPadding.left(), y + st::msgFileThumbPadding.top(), st::msgFileThumbSize, st::msgFileThumbSize, width())); + QRect rthumb(rtlrect(x + 0, y + 0, st::msgFileThumbSize, st::msgFileThumbSize, width())); p.drawPixmap(rthumb.topLeft(), _thumb); } else { - QRect inner(rtlrect(x + st::msgFilePadding.left(), y + st::msgFilePadding.top(), st::msgFileSize, st::msgFileSize, width())); + QRect inner(rtlrect(x + 0, y + 0, st::msgFileSize, st::msgFileSize, width())); p.setPen(Qt::NoPen); - p.setBrush(st::msgFileOutBg); + p.setBrush(st::msgFileInBg); p.setRenderHint(QPainter::HighQualityAntialiasing); p.drawEllipse(inner); p.setRenderHint(QPainter::HighQualityAntialiasing, false); - p.drawSpriteCenter(inner, _isImage ? st::msgFileOutImage : st::msgFileOutFile); + p.drawSpriteCenter(inner, _isImage ? st::msgFileInImage : st::msgFileInFile); } p.setFont(st::semiboldFont); p.setPen(st::black); _name.drawLeftElided(p, x + nameleft, y + nametop, namewidth, width()); - style::color status(st::mediaOutFg); + style::color status(st::mediaInFg); p.setFont(st::normalFont); p.setPen(status); p.drawTextLeft(x + nameleft, y + statustop, width(), _status); + } else { + p.setFont(st::boxTitleFont); + p.setPen(st::black); + p.drawTextLeft(_field->x(), st::boxPhotoPadding.top(), width(), lang(lng_edit_message)); + } + + if (!_error.isEmpty()) { + p.setFont(st::normalFont); + p.setPen(st::setErrColor); + p.drawTextLeft(_field->x(), _field->y() + _field->height() + (st::boxButtonPadding.top() / 2), width(), _error); } } -void EditPostBox::resizeEvent(QResizeEvent *e) { +void EditCaptionBox::resizeEvent(QResizeEvent *e) { _save.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _save.height()); _cancel.moveToRight(st::boxButtonPadding.right() + _save.width() + st::boxButtonPadding.left(), _save.y()); - _text->resize(st::boxWideWidth - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(), _text->height()); - _text->moveToLeft(st::boxPhotoPadding.left(), _save.y() - st::boxButtonPadding.top() - _text->height()); + _field->resize(st::boxWideWidth - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(), _field->height()); + _field->moveToLeft(st::boxPhotoPadding.left(), _save.y() - st::boxButtonPadding.top() - st::normalFont->height - _field->height()); } -void EditPostBox::hideAll() { +void EditCaptionBox::hideAll() { _save.hide(); _cancel.hide(); - _text->hide(); + _field->hide(); } -void EditPostBox::showAll() { +void EditCaptionBox::showAll() { _save.show(); _cancel.show(); - _text->show(); + _field->show(); } -void EditPostBox::showDone() { +void EditCaptionBox::showDone() { setInnerFocus(); } -void EditPostBox::onSave(bool ctrlShiftEnter) { +void EditCaptionBox::onSave(bool ctrlShiftEnter) { if (_saveRequestId) return; + HistoryItem *item = App::histItemById(_msgId); + if (!item) { + _error = lang(lng_edit_deleted); + update(); + return; + } + int32 flags = 0; if (_previewCancelled) { flags |= MTPchannels_EditMessage::flag_no_webpage; } - EntitiesInText sendingEntities; - MTPVector sentEntities = linksToMTP(sendingEntities, true); + MTPVector sentEntities; if (!sentEntities.c_vector().v.isEmpty()) { flags |= MTPmessages_SendMessage::flag_entities; } - _saveRequestId = MTP::send(MTPchannels_EditMessage(MTP_int(flags), _msg->history()->peer->asChannel()->inputChannel, MTP_int(_msg->id), MTP_string(_text->getLastText()), sentEntities), rpcDone(&EditPostBox::saveDone), rpcFail(&EditPostBox::saveFail)); + _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)); } -void EditPostBox::saveDone(const MTPUpdates &updates) { +void EditCaptionBox::saveDone(const MTPUpdates &updates) { _saveRequestId = 0; onClose(); if (App::main()) { @@ -646,7 +667,7 @@ void EditPostBox::saveDone(const MTPUpdates &updates) { } } -bool EditPostBox::saveFail(const RPCError &error) { +bool EditCaptionBox::saveFail(const RPCError &error) { if (mtpIsFlood(error)) return false; _saveRequestId = 0; @@ -657,8 +678,8 @@ bool EditPostBox::saveFail(const RPCError &error) { onClose(); return true; } else if (err == qstr("MESSAGE_EMPTY")) { - _text->setFocus(); - _text->showError(); + _field->setFocus(); + _field->showError(); } else { _error = lang(lng_edit_error); } diff --git a/Telegram/SourceFiles/boxes/photosendbox.h b/Telegram/SourceFiles/boxes/photosendbox.h index 462e8bc503..cc5801b7a7 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.h +++ b/Telegram/SourceFiles/boxes/photosendbox.h @@ -83,17 +83,19 @@ private: }; -class EditPostBox : public AbstractBox, public RPCSender { +class EditCaptionBox : public AbstractBox, public RPCSender { Q_OBJECT public: - EditPostBox(HistoryItem *msg); + EditCaptionBox(HistoryItem *msg); void paintEvent(QPaintEvent *e); void resizeEvent(QResizeEvent *e); + bool captionFound() const; + void setInnerFocus() { - _text->setFocus(); + _field->setFocus(); } public slots: @@ -114,12 +116,12 @@ private: void saveDone(const MTPUpdates &updates); bool saveFail(const RPCError &error); - HistoryItem *_msg; + FullMsgId _msgId; bool _animated, _photo, _doc; QPixmap _thumb; - InputArea *_text; + InputArea *_field; BoxButton _save, _cancel; int32 _thumbx, _thumby, _thumbw, _thumbh; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 3939945add..b65e30f2c8 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -5049,6 +5049,58 @@ EntitiesInText textParseEntities(QString &text, int32 flags, bool rich) { // som return result; } +QString textApplyEntities(const QString &text, const EntitiesInText &entities) { + if (entities.isEmpty()) return text; + + QMultiMap closingTags; + QString code(qsl("`")), pre(qsl("```")); + + QString result; + int32 size = text.size(); + const QChar *b = text.constData(), *already = b, *e = b + size; + EntitiesInText::const_iterator entity = entities.cbegin(), end = entities.cend(); + while (entity != end && ((entity->type != EntityInTextCode && entity->type != EntityInTextPre) || entity->length <= 0 || entity->offset >= size)) { + ++entity; + } + while (entity != end || !closingTags.isEmpty()) { + int32 nextOpenEntity = (entity == end) ? (size + 1) : entity->offset; + int32 nextCloseEntity = closingTags.isEmpty() ? (size + 1) : closingTags.cbegin().key(); + if (nextOpenEntity <= nextCloseEntity) { + QString tag = (entity->type == EntityInTextCode) ? code : pre; + if (result.isEmpty()) result.reserve(text.size() + entities.size() * pre.size() * 2); + + const QChar *offset = b + nextOpenEntity; + if (offset > already) { + result.append(already, offset - already); + already = offset; + } + result.append(tag); + closingTags.insert(qMin(entity->offset + entity->length, size), tag); + + ++entity; + while (entity != end && ((entity->type != EntityInTextCode && entity->type != EntityInTextPre) || entity->length <= 0 || entity->offset >= size)) { + ++entity; + } + } else { + const QChar *offset = b + nextCloseEntity; + if (offset > already) { + result.append(already, offset - already); + already = offset; + } + result.append(closingTags.cbegin().value()); + closingTags.erase(closingTags.begin()); + } + } + if (result.isEmpty()) { + return text; + } + const QChar *offset = b + size; + if (offset > already) { + result.append(already, offset - already); + } + return result; +} + void emojiDraw(QPainter &p, EmojiPtr e, int x, int y) { p.drawPixmap(QPoint(x, y), App::emoji(), QRect(e->x * ESize, e->y * ESize, ESize, ESize)); } diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index 731e996217..7e270d81e9 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -110,6 +110,7 @@ inline MTPVector linksToMTP(const EntitiesInText &links, bool return result; } EntitiesInText textParseEntities(QString &text, int32 flags, bool rich = false); // changes text if (flags & TextParseMono) +QString textApplyEntities(const QString &text, const EntitiesInText &entities); #include "gui/emoji_config.h" diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index fd713cf661..bba4594afa 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6637,7 +6637,13 @@ void HistoryWidget::onEditMessage() { HistoryItem *to = App::contextItem(); if (!to || !to->history()->peer->isChannel()) return; - Ui::showLayer(new EditPostBox(to)); + EditCaptionBox *box = new EditCaptionBox(to); + if (box->captionFound()) { + Ui::showLayer(box); + } else { + delete box; + // edit post + } } bool HistoryWidget::lastForceReplyReplied(const FullMsgId &replyTo) const { From 4ec579112c4c1505cbebf3168899323c8eb4bf3d Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 13:32:31 +0300 Subject: [PATCH 118/316] beta 9026001 message/post edit done --- Telegram/Resources/lang.strings | 4 + Telegram/Resources/style.txt | 1 + Telegram/SourceFiles/art/sprite.png | Bin 180813 -> 181268 bytes Telegram/SourceFiles/art/sprite_200x.png | Bin 243908 -> 245187 bytes Telegram/SourceFiles/config.h | 2 +- Telegram/SourceFiles/history.cpp | 15 +- Telegram/SourceFiles/history.h | 58 +- Telegram/SourceFiles/historywidget.cpp | 576 ++++++++++++++------ Telegram/SourceFiles/historywidget.h | 28 +- Telegram/SourceFiles/localstorage.cpp | 172 ++++-- Telegram/SourceFiles/localstorage.h | 13 +- Telegram/SourceFiles/mainwidget.cpp | 8 +- Telegram/SourceFiles/structs.h | 4 + Telegram/SourceFiles/types.cpp | 2 + Telegram/SourceFiles/types.h | 16 + Telegram/Telegram.rc | 8 +- Telegram/Telegram.xcodeproj/project.pbxproj | 10 +- Telegram/Version | 2 +- 18 files changed, 660 insertions(+), 259 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index e89b8be690..cfc0023038 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -127,6 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "This message was deleted"; "lng_edit_too_long" = "Your message text is too long"; "lng_edit_message" = "Edit message"; +"lng_edit_message_text" = "New message text.."; "lng_deleted" = "Unknown"; "lng_deleted_message" = "Deleted message"; @@ -653,6 +654,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_comment_ph" = "Write a comment.."; "lng_broadcast_ph" = "Broadcast a message.."; "lng_record_cancel" = "Release outside this field to cancel"; +"lng_will_be_notified" = "Members will be notified when you post"; +"lng_wont_be_notified" = "Members will not be notified when you post"; "lng_empty_history" = ""; "lng_willbe_history" = "Please select a chat to start messaging"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -712,6 +715,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "Open Link"; "lng_context_copy_link" = "Copy Link"; +"lng_context_copy_post_link" = "Copy Post Link"; "lng_context_open_email" = "Write to this address"; "lng_context_copy_email" = "Copy email address"; "lng_context_open_hashtag" = "Search by hashtag"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5638278665..2068c1fe5b 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1429,6 +1429,7 @@ replyTop: 8px; replyBottom: 6px; replyIconPos: point(13px, 13px); replyIcon: sprite(343px, 197px, 24px, 24px); +editIcon: sprite(371px, 286px, 24px, 24px); replyCancel: iconedButton(btnDefIconed) { icon: sprite(165px, 24px, 14px, 14px); iconPos: point(17px, 17px); diff --git a/Telegram/SourceFiles/art/sprite.png b/Telegram/SourceFiles/art/sprite.png index ce32997180845c214bfe77e720afd2f259214f31..11d3fbb61b14acdf5d354db367b911179094fe38 100644 GIT binary patch delta 15980 zcma*OWn5KX&<09_G}0-E64DJ)A|=w&UDDmnrjb^xayLD&I9o?xc|ZR*&*|}Y-U5Fb*|MxrxJ*m@VD@fW)so@0zjIHJ?*m|e&HnJJh~pv@5V@n9DW2L5;1i(YCI*usP2gLG8n~HXO$+F z$f&2A9EM3rWKE_lw!jSOjMCW{e0jtt`{LJxCuPA(eR>alZ}$;;_|duSH+l4noLsi zq<7GM66AnCtnd4VjFlK$8wUpSNeC_Lo$RI#iAMi$Vt6EXF(wHgJ5_c}{EfrI-F%JT zPg6KD#%6zhNW@L%@C&D;(#>mEM?F>ANV+Z6BxD8Iw%jomzXIDfYWL@C$!?J;8ZtMl z^AJD|xgxoqyyU@_#d33W?jLy?Kci4uUW!ptGdPH{Queg*Cy+868@af{^SY@cb z+MRES{jPGO`zs!;KN)IvdVfSdU27hoX+p_8*VJ@i#Lq9^7|KO|D6nn<5g{BqaR{HBJ4#Lt%}2Bod~ZDWw`ZAP zAfli)UbFK!xB%`iI*>&cZcqx5Q{agab1^_WV z%o+2uU9?;_hvjlr)h(Pt<@V>jF36-hYib^bdOaiOoa3+YE$R)AA18z7mLU==e&i z;y*Dx{V!GQ1ghZTG`_q%@{3yXi<}${506?mfNqpkSYD3VSUG9aFtxlaw{FENR%stcS#Zdtn_9|N*3+DR#OW%_PZLyXXWXHBqMiCl0CCm*O6b11vsId^DCL=17bX z?FjkWtCrE`(EeZh^taLQ&xlq-u3W zx-kEq_1{%hzl;W=ZvDrNjg8sd&%W>Zh2Tg=Q{-i5ch8M3EG*>a=IYn&lmD99%gxI2 zySwusAtg1pvU(&{NLC>$m`b3_qyF<0c}n z@a-PHCF-ibPh21@lZ!NU{b+Z4bO%XRb;&qAH3^E9tatgDS^C;m^-q{uWh93yE_&qH zfoNvt{I`?s;?I#pO5bVH&ac#tN;6`fe?r+7#f{)k6;_^#)7y?XHxM>E{oto(W?(($ zLzb79DU7z**x1@<79^tqimmZ1(RL#-&S2#G>yv`|dV<}E_p@#3Mn*_t)5WfCe4fbdCF=@^B-YWt|- zt`&?YTfcfbiVTmbN=BEfy3HT2(QR`z#1-l2=qRbFbLJlL#i@9B5^rwYt_~MOb#%y! zii&az3aG_cz{sDToz130RVt7(9!X;Ju6NYcrGP@AhbwKVi;J4yl$7qhgn}7l``v)A zZzyC6@>1uW-?{k zLwn2LADWRZI3=|>86!RYKCUe(y10-19@8LuWxRv)o@i!f#shw9D`;08MSC*P~9Z~pdxYCVs+c^baHlI~z77ik7=ExGXGJ)o@0F#hlNEy^g19>&g<~@s| zxMHV3gy9*9BT0$x*ELO~W;vs^Lvhzz+ zV_hSn(BOoI4hyE!)lP=pES_MJ2K(dZ(Ive)Zh)+cNRc3TPMU_FzeUe)A5WZ$mNq0T z3>7>-Jsytu!I-u;(6qEP*t&B+cw{p(GooKd+DZA}7XBGbDH6uUlsz)<81*b!Xr_cA z!45wdW+W$Ge{?fw2)K?ej0jcYoh`rBwr9yO!_=hdG_A9_;%+o|_3J5{IQAE1q9FOm z31l!i+KutqFSAY!9kS6pxpWTxQpKu>=TDBwcF^=VIhL9AX~onES;Jpc$8Kl>1N45^ z{CgtiL=F`5^!j*RNFq<)O-&uES8%q4MpV@@`q1Tyf}gD0^CBdO&tz7m>E(QuAYKg1 z*7lTnV)z{|ARsWFOW&H%(3HfHxl{w2jUhucSg#0z+!tsFA{%Z3snnBGEiTlR{2Dz{ zRHDfdM~2xHSC7|OwkW`GB(CzlK15FK;St5;_PoQ(MnN5TApxsM39!=Rf<dNOruFihS=Qo_x4`2pr2H&R0r<%kTN+@uJ=iL@XO1n(hsp#0gsKTbuDDe ztQ=kpo3}cc`%7G5>@w|$E?q-u3Hj_yO!<1oPj;&4wEUcMF1zQ{E{VrwaTF!2JuC`Y zJ@6-QCdy)saYw%QUEAm!3+}B4LDqKwz@Q=aKu(EHhBRfuBL^P9b*lmGW_6MF@7%BH z6QG9A1DBaqpz_$6`alP~j^J(3l%2wsU|unxGv8ThGHH(I=czkiS0q%$H3&L$vq=oV zifaDBwzq|Dl3WZ&T=lgA?G&bdrlrVyD(Jh0&njg0q<+4~q3F^fccusY>+PzzXlC); z?z}KEMMXwTCRQ4f3?dEermqzxhBq7KZh14UpXM5?0_-8Y%NB4{QA`qHNyg@HP^W3% zq|KWy$4DUEF=WR})(+aM*RX2M>0@5{JteK~x~DkX3rhksvt8qQ@n`9ZF1S>35|$I^ zGjOrRaH|YqR0AinKCDCNNADH%sxVID2NQl~4`Zr?tO^QCP`IDjLrAf)~Wp=k~&_hB`m?=Y+V=}@F7%hBG~VjaFfOJo2xZCx8TJMFi@RsNDMcgy!aEAJ4DuYOvw@ zVy^siU>?-cTC$Zd%8`t|8zR{Qk=*d1n^zZdpzoNT3IahGR+9(hIqb7#r!#(lhKX$> zm$&XVNr%+wlm0h-hw7pJp5{8o2{EqR2+wX5yoiVhbPEd$GaH*LXPR}p!+Exp)Kn?p z%NI(1eyxlMx);y}bMN@{w3w_c2AFJ*T=_%pBhb~VH}Gsy$Tx>O+IDh7nzA zIGLDQAC>|XO<2!jm3;((HQV!IIL8{+Om)5xXG7r>v48e`9UtiDVx*Yo&oOeCb$4hbKbgK%!$Kwzihy$m?QP5zyl|H8J_7puk#uU^8IPQxWf4u6T1UM2j1%B6nicmEy|o=|ChE z3{vac)57pY?np7Tv`kZq@!m^?Q{B379)>g-SuSXLvMSyM7r$164Th&;#nRDL(5$e- zKNQF95oj5_#qPM9nQL`YiAG?)ImgRIDi8CSy4=pomSBgV>0oC_U8mb!%Q; z5NKay2oDvN-^j>_;&VSA89g1{sjPoPZS75Ps(+oMs;cU|BL#I(u?g05sgt2A4r}1G zFoRC3&eq#mbiE8S1213q5NBkahnmSj*&3rHu6$Q}dyloI^t(kg;401O_XpH-M;S#8 z`4g2EHO~Kpn7kBH1w8%Asi$xav1`9(tQWkJ0LKC9+tdB6A=yR_s(=4Kc4ic``BtFylrsVlJ z7B|}j?zU=-zp)By!p*={zUuUw!~B9MD~KEJC6glJIi%rI>laSAgtE0R$*dKC`T40_ zd@O_(Qrp4_mT=mvqumP&+rH`h!J^DDWvEKuRKRb&gFjspqK#AU(`euqmtfuZ8m_du zQ@skR2;fS6S*4(0y1dYBZz8P28$QqmKglZ`mRcKs&L+5paxkPN8=H7Ehd$qm5vBub z{7r5aH&L)J#zC)YBm)FJ%JALvL95(^_W!A8g>$Cs{sVFWtzKaiW7=iG-nWCrm7Tk_ z!XNkZ`&fjI?oP>~3yk@pt19RBe`hMXpHX_cB*c zr-&T0&;c#dSj>vFRj$3-6v* zj`s(D@Ni?5rkRC(YrY3*{<^2BbYrRyjsHD_0uq(pSp{b7{ z&G-r(T6ephL< z6k#;)2O6)%Z%JIOs$Fp+FJQVJ&t9uUEkT4P+ys7@xlvCd;k$OkuWVr)GaIf)O9muf zIsJwO7Upm`Np+zjwBp3u%vA*mvaF8X$Iv`~YkLc;B3IHbtn?%mZ)-`Buuyf5ha=yb z5Oudr9rqn3q!ikLR3NXZDLFvm`?(*|M*&D9uoLiieL#e*cf&!H5e^alfQsZTkw0s9 z@-KspR_z)Vw^e_#Sb4@zWBLu01HB$bPzd4qh)(v1N0VE2Q1zyb-oO!Vqz2o_l~$K` zb&jiiCd6WMoZ+iK$CfYQ?^ERnk3h_a#GNi1trdE7(KMaHW7SY*NJ`u%Xv<2?#bol!(mxA?Vr5L z>kW=dN>jdPnrW!5e4N2b{E6hQuEb-{yM?LYXIzu$4Ud~Hk+NLr#t8*C0r-mHhp6`IAj5^By&N=h86eg+Z@prEVF$6_ji&+O@tAgl+B+VE&b-b5+XeYVX`6RBah0iwHYw+nXA%%YU!1#~{h;s}a<<`PZy7 z)8%@E+9|gW5G|>>7TCSKyv)tZV>9Rur07w8G`4ID@8-mnrcw8DW=C1rZZotO|B=vl z_Ofnh^D;>JBS?8(N~n~Sl=*gV{@dHzcQiB-xr#{eiNoU3(r79wDzyy_v1w_`6#`Q^ zkB$d(?T?5z!anoU*CXhVj@4DA;=ZEWZALif z4Gs>E%m^Lc*$AxwkZjo`;|7Qat=i1?8ER(_jg5w3&`;@!6o-~wmcy=Y{)-!@iC!&n zfo@Ppj;le>B;-GhRWK*~U^A_9KR3}ETGLPHy}LZPCySX3xxa8+>1cxR$PkXiGy(?R z(!8SIo(!Rv*nJyXV2WxpMAviAp6!P5&bxXkxhyOUua6-;`(P!LvZ^Y&AV9$`4A{~M{h{wg)o@Z?+Hzpks?l{k+dQ&xXt}G!+S)S~ z6cm&u;2zWFd5r{_V|eY|hVH(@QvM;rU`&dq;t)e<;+aGAoqyA&iyr?(rU9Liw*=M{ z%RT}%H+RC6ym0#dz6D4$L1@`?jyP2|KavpW7*AQ&W?-P>rr-F3?0f%k(bUZRe3-h+P17h!9P9u)SEiwR;c#tGSV(}*G6@@v`5na;yG*y_ zvv-SxcT0G5RC7{VwkO};Kdkn*%4oJK`{@vX$Pna~>%bm6GQMoOx43Onjl7GQK&?1o zIG6xQO*Nz{>5`OhB!glH8iHs@=H#NYswW@?{5F(^GN`K`1@l8zck7L8X00aX>~j0) zIGxM{dkqb%zpAzdMO!Yn4_=2!U@>EfoZH|L5EwQrEws4WRwRh?YO9!SH9~qAJo!E9 z7`w&b0RfN+=wS*F`>Qj8NfJz%iVAaF8X;6D)N%gGxR*!iww=f%f~61hqtV;Fc2F_t zM3g$P!Rzj3DH$y=ucRa^(q|Y+MWCdl0-lh~RK_O{KV6%`>|a(YH(iJ7J}ph;l0>@o z#o4CNVJQXp1U^1-V<4v>9NSsX6vtMz5il$cDj2$O#|S|ND{6lv^@#9rqo;>k*g1m; za(?c$RqtOo1r7rbH@*j~VC-Vvxazs_KjK?9$fJocw%3`sPe_9s;1M~&QT{&ROBta6 z7F!EVPL1nXW#nY$N40N@wFF@M;PefADg7XQ8L#X0K0E12rDrAXRm+_G!P>$iO-|K$AqR(iO(yyIE;dVZ z)@+$`;bXuJ2q2*#ooCL*CM4XsKYVT=wB>b*9sF0L|3Hq@PrH|4{FMC@r{GTL{u#26 zkuo-U)>C76bcLn{rpc}pU`xCM;drm7`X-j`WSwdrjsyo?glGZJI0>$u-nDUEV>40{ zK7-j20WZ9$$RcrO3T9x@GfbS7XS#w={id3VMBeIvwc7!~R3bPuGmUtzAiPvO=mftn z7?0+$lo7XKG!j}?h{-vf3o|Fza5q_ZY`N=^uBODl(7C>Zqy5XSsuX!sU4=E4Kw zY^aY$I2`f&mwRY&hjSLJ9{f{1xYDK<-i)fgaHN2ID%(@7@RH+OpT$@a4C2nxiD!L} z%eEpZT*zE&9+O&z(}EJ!Yq}duog#_WCobq}vwj36RygBEZn~6>8PqO~Mo}{e+0Dg) z`oXP+eOfX;aA)Qbqq5%puyURGGq>8UwO!u0;qFx8BQp!jNrO@F@YY$->e%3*fo_yf zc}D`jSC7K_iEj33X7F}G7dTOu7_)-aY|k7`_Sp}+U1LdgkS zMrbp_dPkBP)!b5gdPNwH?`ZgEk9)oBgWceFG&Eo!rDa6pqHhlM;x?v&K)t!Q5>-OA zb;#OufXz~7PR{3BSg2kG`9N;mDg2c;{p#m1l|3%@L$!SMFZCbNmi~(Ku&_jfT?4RP zaPu!#zObYOjeaS^m8iJ9JPM@bf%Wy=uW@k)hle*G1O#`!$fkyP3Yizwjs^+#-Y~f| zNC4*P;hw_g1^Kdi*A70qgk$BeI%PIbtk#%%CU4%K3U^*(%xP4p2bQXT6%`Gj5ia>9 z{q<`YoZY`aIOaRQ7}1-W+B3#ezfEUSmr;PNG=-Jj9a#K=->{cH(D?lPVlPh#`6^y~ zv(DfExs_5oJKgf23Osc-jJ0Z#kF`P^Q|UmZC5Rq$5SIhn{x;?Wxo_XZ*pF{HgrqKw zm(TOfbgEqL<2#2TE=MrT+BL0aIaSde#_O-PB^dmv{HY>7cb!&mHm1r-LJm1*)y+Ot zt6T?bCK>IsnNm4zK;3w~Zdkz%Y;ApgaM~0)+A0G~(q z1i3{FM52Pu2QEkU+Q5JlhT$P zT+D9Jji5(X^hICQ0E&PXPOJXby@+P*y3@0Bpws8%`&C%ol8TdUp$`>7usTsUN)0QX z`0a5~D}n6P6YI{5Xu*a1l1JYS@Dr)x!BI6(+REy%&~xQ5L!497kL3PW@Pvy;R~|*=ARu5%a2ItFisFSMc9J@6NAse44caukNwC1{ z!bULo9t&@U@FZu-+OBWNhIT`UZEID`!x;YfE%Idn7XezfZO(VckQN{*Hr7Z`WsX&t zKY?o}imLwPOCSIsnZVO`>iLaO8Y-fc@?622iDlN%#S##LPtJPtutC_7RBtg;Oj;nD z%I&$?AGykhKWFEnijI}e6O4AYag&Ki?0xjaaY0uGgSd;MT?Xkjgi|=ArLo>!QAo|} z69>1ni!A(nJBD`Bw3CrKVp21+<-n)swjSgfa!0al0`#5!A!G;TLZ?P9UC8R>9MzjC z;yQeNoXY+a$0#a-&4@9~wGz{JjQj8aim0m_cCq zEUaE-*f)KD+%m>MP_9yDi7FjMXlkt5&W+RO3|vO(EB<#)q>Tjg243|r1-ITn zIK&2!)6@oIAP`2|72>=JY;JDOtn_X?-Jf(USaA;!8A5M#Tp{?1RY@7MomgV<=o%CL?uf1<(yu}ycM^Wyzt{i4Y%#e1355pGZF2hZ1?9GWZ32u{NL*&7ur)|69fya8 zHu|IA2=_4%T(5YZoFGdx!W`N}rmmLk{9^eIIDo-C+&>Vjub3Qba2eVsFDyV|U#0%= z^)}rpm~k$wg0Zn?pl;#l?B~mo|Li)!>$E$r>kEpCBbAzERTR+!bzlSuFZBN0ql`Qtl;bNIc;;~%;s6#Nx z7m?TS!}Xrd5;L)8xaJ`wJWnl3oUMjc_NTqw7+&y@zq3r)Al#yScFTs^iHrA@gTeAV zn1vU9oLyBkJIW$N;#75G0*yyxA=J}2Wj~e0i9A&xAtCv`VTuqN6O#=CN{C{M?g+7| zsR!pA-|)6t3eGe+W$$~^)BvpX$sOwh{LOe6!>ZPsA%DV_&_S+F&5J`1SA0DUJJUi( zA`tcr4N&|kBM_QH`<%h9LFc?ny826>0))4h;QM?+#9ZT=g~cP-a1(!Ki%|Kw9abP@ z^=I64+RNp)BsyZEy>Gp~uV+xAQ0sCMbbP}ED-_56)gS7>g(z#QE@$_j-&Z3XEnZi5 zo=G3o8Z>=5#vRFb;9h-V$HwY~mFo8ybfUnueCU}^5I{*Rhn4loT-uYV*n>@p>`0xM zGOH)OZ-A5Z9rI&a$jg&+M-3DbGb)3&hN^=;L!crToSNtQWPzuf37320Ew?90j8SKr zar^ev&BYwpdu8rG^~20*frbmWKU#STX+TF)G0usSRIte-ctYwuv2FE=*dgYobrrE0 zOjOQ5NyQAOtj{S0$#x_%$%<7TP&5;bM&bn#AF`BnVm07kqox zjYApH$FTTiBM7Bo*{!5fgv&fDZbmX*UJvP=i2eDI*4Eapx(jH1{R2k>DM% zs}#m*8%;5LJX2oP(uJMXb62W_hTq-lDAyNJI#Z*7T86TU$}doZ77-E2ToSEg9i{n5 z+bC)b3r{wzhSxWpd6Mn>?pEUq1VH&r33guWTOi^D%xj-L7K38!Nk?->{Am`YFqLsrH`|&ExLH+JIXW@y zc_*&;R4OW&YIyIF zIya%UY5S>49PHEomTaVfL68ct&2o(XyrlHU76-dFQ!6VJSFVDL=+yg%GH>yYH-|xF zRF<8J!yx5W2CrupGn##1RZ@&A40R|m*G$c(d!&#Co0J2y6?#BQHl1rp@!iaEpX6|W zd4>=q=4x8W=p(n4ne7wgBn2WFEg@Q~4vl#&!IhVn$4iC@VYAGeCP&-idXisT8wcjPw8_bD zE=P+&J?oSJ3rocqj~xq+j_t(a;yyy-)7`-i9wDJ#i(y|FBB)^%6mu|;(PNYsTT~Yp zTl}ylA#cVZEO@tUCpwulr#BYSw)-}em%vXLxs+{8B6@#Gwqk|7jF@T<0h68&G^m}L?A!YdV(wuiG}QyXv)<~9IJsL^UN zSIS(}IP®wn{c?A~&{4k1J^s+19y=I+y7SLx8oG6V!N1mYW|St8$@H*^@&cIxXY=ti_h1`#ItCinps99wQ^mT(W@D>Oyo2^tyt3i#*qIfp@ z;;c4jt8<=*3Tsfe6oHIgt+jEzxIhFhXg_Hzu5BBahEJ3~_9KA=H@0grGo`Sw@a2T$ zo3`B-vb52S#=`gm)Co(~{_<|>!n7eiy0ILdljT>|$J)DrGU1q9QvYAjGfdC2fy{2VJ!B*8kN{U*AO+sc4 zrC5jlcd@^Hg~c8-Dr$e1D-C+iK+>C@nVL$vXAq`)qB2#RNjz6o-Pm|@xv{Zf)w4L? z4DPfnSm8S%Az?>(@&4CmqtC~bT-Kc{%Ak}-YKyYSWYYlLe>}++Q&GY7OE7@`a~GIj z^{P3V&r6(b5PEbf*|sw~bHoeW?MKg*SP}k_+gDG{UmgIb};`IFC|a?xama zQvmR`7*g^f#pasxKGtE`wH^W)!fv7gFpL`2->pHLnRdpeuMQ^zCA6ctY;%oksdK!DqmQ9ciG7@kkL_FSNBLsqEt7V;l6DX zJg@YjrPj&ni-fpNdduxE$&{n#8_9e6;*5MSm+nm_qU6Le``Z^T{2jtdF|&7>`2{Ly z_z*))Y6R_BLYOD@+u2_9Mc1`ch2Vn#z z0W_^Sk+KTuPXc_kY{1;fYJPmB)kLU>p6u#h^j+gP@?G!B8B% z`Q-9Mq~)rR>G}RlWE7KDnxd0N*(AHaKDxNsI$$bseGq-;YX_3?^F_;wBd^`85FsWe zCc(uqL$b3ZbO(NN;p5N^gs=XT=rA02*b>TU{owS~{&DL$FdB)2qB%dC84#?Y-=%a; zaO7Za4ctm=4I4#sN!o|aa^DW3b$24{sbGbV&I|&ndRXc*g1&V|>r}iJvZ&8wNDz22D+vdJsdbvgetF>L~vyf!=e)tr7=~D8&(Hn2z zVxlXaL9M;PezX5;3q(jcgTcEm3)Pjkh+rPh3&HDe<=1S#$Xzz0cLQ!}oWI42MTp9J zweS|xNUY@|-NHYswtm&oTC4k}0rl`n;ih)_(uxx?o?4e5Lq!BsfC;m4FF*C^Hon4Z zYX*2c(AyHFBXHTIxF2R)(^;cfV;2Rq(fq=#xR<`_JK_lvBKuwc+nETsu9lX@`pSip z6Ti3D>|J@CyKaL*~8aq`nAIDo@OK=435ddE;(;wPe z)A=+Aw!dpMZk38XW6cY zw4(jaVgaVd9Ubq)JE-RiO4lPp4$~OXR!1yT=h37N3Y^#Gh1)S?dZeUfiEn&uJ6Hqy zZlF*nFuSOyCw6J^rnG;Zzdu}_l~dM{KCBwv+e(*wH|P-xCNw|*b$H6yw+GqXOOsEXoG#j(Ov%C6^P7W;d)zTA3a+Nvq zDUaC&5k$cPD=ga!Nn2p#;2($V6y{*gx)Fjo zGtemZ z6a07UZ=i{l8sSMa#IsaL*;31iH+(SGFD!x``12JV5lH61B_OiOq$1$SbZGRym8=L@_l%v{b+H`ux) zN&si{z>%CLK2bgSHcK@UL_|ceSUN@M!Hy&mS6tx|l4vnIL|mESEbG9L64hXcL63vO z-BQFwFyNhh^a-2VJFG6t&kwE{1B6n0dwVGcE}B-lQHrWyy$fkI7htVWI3AF} zb*c7z{ex%{X!l3&9ve-CLR17h7~b>haPKX_lj=Z*pl5djYqJK)$?t;3i2Be|*MsUqi^1b0&{e%*L52{$65sn>M=8LrJ zVd7F!gU(bx#I1a-Lww`g$j*&Y|6a8V1cQAN<&j6eKkC@7Ulilucfm>fkX;YgoPl7H zKVDzy49e3*>MIbgU{^Vgn_hVX#!w~hR9V${G=EC}iEz6^1-w4e_1RQqI_~Z{Gs$b; zMYO|XNy@I{+AHWIbubqW3ePFr>Fef!IEYD&ls>-*wixSYJPg9-#7RtX#k29YA7>M7 z(HnOfRxK0eYOwL^9>SMha}zyZ5H_6G2B_lJk>rLpslm35#B*N`Ng)y-1oD0IKN5O~ z>9DzQQoHuytpyANAK!bbVTo}I;=P)wN3d5exfPvI|F-|amUEBoVwO&mallT8r2S`rP{qm}8P#7_AFu?G_ zF{vSr9tarD<4@`DL%fzc^VxySS#e+Eq2v5_g9HtzWW#WBa>Cdxnin8KUP=zVlPXv> zk8raeW?&nn`irdW%>8v3Dh$|s>;cJ^*KELCOcIwRfl+_NUUkLw{O>FgG0y)M!Y7jg zaE5~F5jbBq2x|Q>e?XxNr0H|-a0rq!0>`oEVS|&FQU0rEX^e|(OZ(Y zBw&~^qM}_IBZIvLD@Zebh^Rb#TwI(OIKBph84^&Y)$q;c;&H_YCN6#TCOH3+%~5FF znWU~l8_he7+I#OSqtP7@Wy}J2lSj|q^HFHjr%d%<0O|d8V?I#@(dr=#9Rl(GrGb96 zMWsEU$iO-d6ZJ-T^y+BIo|lX+?6ZRdJ1Bg@yo|$4PY3?@%P?VKVSoPoIlYvn5--7* z7G(s@DS<>xOq}L<-1OblG{>9-9M&WgaQg}VGQ;Hj{EvKd@LRwUthDdK5wRuQ9RJtC zNCe?Q3pJ)SPJ7?B$1+crgn%b6utFL-T&RKHzQkmB6Z`}GfSp8SaYe5lMHp}$bYD*u zp_Psb|LcQ~iuaB`|L3N+|7R?jIQ{1YCaru%t$LX~>rB{J|ML_8#n9l#f1aZh(`Ef% zzpQ|Ue3uBqNU+%deKk7*r^^gFfc$kA_5}DrFi<~tUeg0Hsz~(z-hpm8ioC)^Pd`Zd z|K7xbcJn(o_q&ID*Dm#)g_xMp&(R4LPNW^Or|c|@ZwEhsmzV)x7bgQgy{R}i_g^`9 z&Juk?T8?6{TJ^qttL_AHst*<|xva52I@$iYkYZ4qY&Cwr2ooEP+)Kv+dXkyG-MaJD zD11gYO7hd6>Y3$xEdCTp(m=;uW0I_i_pMEoC;?QjgF3H$hkd1}C}xqg&1)7`5EO>W z+cimnL$tq*-%lAfNmIPX$9@@i7>$oXHyU<+=!5c>RMsDaSs1m64s#U3Q$Y~kBEGp? z&MbbyeRr#LKgpHLq80j{nthAO9awdHBS9iiN00hw z`$IMrN;gU!b35FFvTqs99KSA>TeR*@r2wTd=ZhP9&f1`zi*?dj{$bbp})q#B|jQR%#1Y_1B*T>Jb}z zO={YRc87Jn9mGKt!VV@kf=&Gkn6z}8)EuF2HhSp)`fH*^XcZzvX#avFAhMNLE?Aue zFLA-|fDe)PT%yla0bWi%N)LR6q*Bs=@{(1(5dXx_#L)j%8e!8N#_$$20hmgtvcV7N zLXDSj1>g3+Q7iJJRsX+-N3eGhnbEXT0NHGvXU*ZkJexYXVm%z4hyMRTiwRne$?qU1 z+(_8OIay95ZC#!TB0Km0E~$383B5+V4V4fZI>(Lt5w}B2f!c(7)yo{-hRC_ry02d9fh?pGBP*@W+DNY;O{vK)?hr{||Iy`ASbop-F_`8YRlm4fIK zzQE}Yqg<%|pWFsYl$>FuvkXQD@m;9M}_{>96| zVsO_G-SG&wbBDQ+;yEy~_k9d@_)?q&5rm15SUY58T|daoG8K@!z(v~ZuLPx05YFcFR}+p46a*{xqfC3^edzGH&t88#>2xtI!%2<{Z=ZlhIy1o`QhmH;y+ z;wcRAg2K}xoC={pjPZZe`vn+nk)2-GRw@!i*efR1c4=0jmWdt4X03Oo*zL&5pnTYK z($X%L)1ofsL>`PT1-$a7bb24tg^bML_wDz3(Wityey8monE5|2X9h1IOnLDS7#GZJ zjhk%J%^~6)K53ch1Ty_CF9;*`dlYbVLSBSHf9!eoQyR&$GnUO~w8wfu>62G+a$Nt3 zcIdD)YtQ2x2Xzx1;s>jH{Ne{i5@!bBbJ202!JkU;|M#rfpnO>>WN-Oz6M+heM_q7| e#5ZTp$S@u|CR;A4hwos(KT_gyV&$Lp{r?~OJtfTm delta 15516 zcma*ObyOB_)HX_YN_R?kHzJLIBHi6BokK`Ilp-*;* z%LOy@%pH60YwzpYH$TErhrgm$yuxB}vT|^$ad8WAatrZtFmnjRW5V(M-xt;4glGkL z1UO7g1uR$vxH!#NdAPVZSWP&%%~-kk1xz?Cj0Mb1xdf}L;WXj?e?1w`hAi-ZkJE%W z82k>U{v8T5^D5)<9J zNc#kJZTqxU3hrhDd1h-(x3{fXyXU6IM}JdNTr5UCR$Nvt+wyvtXmxN&9inlRqcLMV z833^(W7~`*efsn#r?LdW{Q_fVZnG@png*UXrSv{-)i%H44CAP$ehyktVA`F&gZ8hY z3}uuLzCGF||K;5(Bz{V|HX*^FtiECQVnfLI@`eRpg`V)m_!pyUfs`Np#BX!;1n|cS z%Te;wv@~gsF1uap$%5!6_e?%};%4{b1Hi4HM`upsbo<+=(3y1w?c!fNZk7xo!+ZJ3vwd~T)_{nA7$&Y1Xu%csidrD3QikdFO+fR64hgJP7XcDnsW zuNSAC$QG5ThVlK@S#t$nY;T=6J4Vt9qGRdhcWc#(6ht>UTQcv1`K~~8#ps4yU{P$- zK1gGb6r@4VL90L<2lxAg5ZD6dsx>jGdpTDd2Ll=*je1g&TE{A(#I^~_k1@)QgwsG)@BL)w!Dm8T4 z<}D}Zx2-L+@A2{Zh!n6qyu9Ocb8;>&E|k9EJtkC)j1gN~Th6sQ?N#%AyM3)@e;9p* zyJD6{>p#|3wT};hmjXusuZkfwUSMoJFH&=fGCsfUu9(&jTIC7t{YAQ;LiY^pkPXRI_YOs)jr=0 zU$tD!=D(vH@IuRS5uE#d?Ji^8JH#K2c4}=?%6~L^?fy(lDAc;s3Cy28)*nj$KGoXY zo(Jhu)y|FOXI>7xEd0aJ;8)Su+Z{5=lGk@5LOZ=4f*!Wi8X1!19^2b1Nlr(v^{8*D zFSRM>=D%VZ5WNDpKxA=90{gyTs*&wmhjB6z^78VkX=uP0)#|`<7O>!>M&_)2X|%Gj z*_f*|4Wx8UNl8&m<5TipQ~5KVEBpJ`FQgh54GsK(fdQ>jZ`m#PW@|gUytcN?f&#kK z)YSgLL27YvKymhicCG_9%Lw`0s1LZw9vI$pi)*M2S?&PqWhoOsIYo=h*s?r__X4?| zg<(w-Z|3}V7f#LLt%dHqTUQ?mo&)*HiiE-U$l;PWFo-^Kd0?YOj~;YqW&I1?s`t@^ zlWU3syX3zX)HAYff1YzLNSo4}8Jz?c>9-#9?7-!=w4^sR3BAL7jEj$-v@a2%qob=3 zdfXe&1xSTl8JwcRd-v8l0%50SW?<+|Bi!tF=jOED;NYb2Sig~tAzfeV3=TByt+Gnz zNHost37tK6%jom8$S42EJXAnoxLRh+SyX46VmML_#}eUGhnO@^;Hcp(FyZ}~b)=ui z*(No@E=^(InO%u3dNkIH^EZc}#4#PAL3Bk41X#;vJf#$_+#&zG`S6Zj0r@wvw{$59i`2E!c==k>b ztdTh!eh;p6ipgV^!n->=Ce`zE)s~pGwY7P9c~|$oQ5vby=Pz4gBFV~1+?9_~qoOuI z%X;9{!3+$(%q&;C#+VmFQTcJF`AtvRPg@8#v!2c`-I(8%DD|w7J;i}Vd*r{yN$tlg zcut@X0#0S-w?(7HES+i7Gx~lQscC8+qW?%EQL&5zCuLwjo{*3*H8mA(6!qOblgIjV zmI=0^jSZ7(fns(}PEf9FY>akiI5#r@8hb%h=VvfR5Bq5NzKh&1Tl&@7zYp%{=>2Gw zk{OW*t2j^4F>RHSNuMxH!L&Ox8tzk$#PEViRI2`vdsh+0 ztD7!T(VE-G<&#r1-?ywQbe8SBn4>k4Y9%vi=EWW=Mjp9-06|F)`tOL5DIP@!W zOBA`cX~Q}3?#n0$7C@vFz|#98Wc~L0z~JD4=1(DMmHv^D0&s&03JStk^g`CVDf~r* zg?-)~>lqj*o0@JW+wFF#C4kv5E!I0Z)$G_qkb-1IgZr~O50dr{fy;19&1lc1k6sHP zW&S?BtJ0lyEz+kG*Co~*##iUi+%PxE9kZc@_?TQ^Y9qH&ax(?^OyH4)*XLGU`ZvvJ z!*Saorslyj|F4pN)!=XI)@E+)$8#Y&vQSMcQ;DUSgQu3;@yY%&(gN8{vb9tFZojAx zooD40w3tcg{*_QNd2O;UvqD| ztEy3;{zvl>IrWrp#FOP*01tm?C`NQBhM)hR{qfd>2@^aEcz7n)`?Y79Cby~sT<(;* zmC_+Ubg|4;9Iuz#-P?x72epu{sdb`KexWn|0Ddq{>}2oK8lthlJv0|JAm8DNmL4F! zY{>?90?97L(>&PTSHvu1>l2>VS!tND-k*Y}a{itfz+B@kLJ@qd{)(sX-XQc;cF&0bxteHIe}{LL2_566t#hVU#w*vrRys;ZLq_V(?f z`7z|8#0<72E;0oX10OcE>PLHKgxICSL~zM2u9{x?QA??2)zQpTTGywqyi%Bh=sF*R z4<{fDP(eH2DtK^Yf zKGf_g+p`eF7rt_)3XY*aT_pndRM8%tP|N(Q>rS84)unxXediM2+uAa3Z*Ma}txeR?;L9lRR%QE#lRC}%8KHj|0_r&m>R`HE41MZ#up z(_REW)6!G*L~za?kB-Vt@__b*`DR;PT`jMqbUZU6 z8%vH}<02yiAi%@JZ#JE{liyw_%n$IQ04t{!3f~8<{aCavKU#c*P!5cN1_$Hu(_+Cl zqd*szVc66La*UPYn=_e^w0%apvJ87^3B&4YzsH+!f@|;Am3LOpG_o-qz{^vI(9d3s z=&-ta7ltnQP%?w)3p(~~B?B>mjh%vf=e$2?qh>&qSBX2_i~Lz)B0dJGz}RNn`T4n- znOW2$|H!zUgoK3Ao0k0iw;W4Ts=}5Q7BV8coEpEr+}&B`lN5%pMe=7+6O5q|HTJHILU*mf3jF z4;BE?5`mt-jL2|*x-6 zA1e!Z4qI@8@eLLt{a8~B^xWL>fB!1l*aEiJR#r%P8`t$NpFh6=Ex7p*@)JxZG8T|l_XORzyq+`dA z@3OY08_6;`<}o&y+}X@v;`bqLsqx{V>n%>_ALvTa-igaN01M&oB`EidOgNjsw3y^i zLaot$VKWPh?}>@MiLAOXM3lGj!&G6hENO$Kkc}=K z-3|JY5-0D1loV^a7as_l&})&qOXpR#$0cuU5{5M4qM5mQ#NF+?ePl=eO1T;)7EYn# z*cfkXWLm(^Rjou z8ucGHCv`C2x{{~$tC~c}`}XSoeOcq=nVO@I?Ox9MiK&6-=(9m}cegQW(HyxI*t1kdX7;O9iF2iWn zD2?aHMqGE_3WB52TcM6~cf+;nSI5_OFdiypg3&bn<9=0fsHyktUanu>H#KHS3%`Wf z)acjOT+TUKqEiEd>c@x1t3wLAR0%D_frHS;~X#hiE!Ixel%dafe!@1{+r5UaH8-D>5%nX82L|M@mgOiO2JmkRk zXWW9+yB?zMW+cucI2w>)gG`PTLza@i$4X-3ll02J>;XGy%lYQc#VV@6oelJ4p3K*A z753d->pWtI$G!~WG+Sl&hEs}jC-<0$l;6u?AD%9W^`$qjzwj4YCR=^6K0>B~iG&%V zPigc8WOk+fUs(KL^YfEP*CTUwSGAI@cb081%afX|QJhz%wDL78p%_?Md%%RIr6s4V zjNwo(yrzf~iN~yQ<#jyz!`-QWeRHCVaAc5k@?^&9&|K{lTnEh!i*&vbnB}-EN77X; z@pmupf0dNrb|S^+<_6uQ}?Gd+m>aa zB?QY+GAGUP{yN4b0d|Bi-OWIIGBrV8T-xHla=a?DCp4lO+fghy@KiI7bAJ`eGyEE^ z5@<*}O1drvEO^#lZ(K)dT=RNli<@sn_O7q5^9l;S3^EqFk`x@UFCL15+pOgr3B3J8 zKb~qYRs?4{ktYxGlF6l|zq?t0GRUBik&%NZ7$gJxHna2dLyC%+78V!f6%-CMGxyJX zw+7;^9UKaN|Be_HdyM+6S{M`QUiRzP&(_uqP!gg0m?>g&;N#wOvPyBpIK445HzwKf zE=}9m-TO4Y@&kS9xy>in{%)m9z_jAm*X-E^8gopc&?XTHD!QjVGW` zqe6g9`Br84d%t&kdY9Xs^iaf(hkp61{IqJhzq!q+Alp-Vyy?zSgoTc%&N~*U zR6XKHl2*S+jE+H7mSAc^!~Xqd=EDOaTW)57R-Hn@wC89))KK8Av7#a_G!)_HcyV^K z&Hvlpp?SYJ;H+(o=0gIsw6v7(+Qo_UOXakmG?*%Yf~=|Fam^&C&GfE2jZI8U91^aF zr&?NYgXW;6qx+tg#>|9eEIgXZ3+WES1kEMFwBS{v9Vb3FC-YrBo3iK6Lm`0Sq34_jY5mmrLUy#DqH|Io?ysVonmi9;0zt2j^u!E`)blXWpo zo|S!pbgAK>at+%R9|DWJ^l8aygiL>XJbnJ z=zVyVDBPSax!Gyoq=lRJOHX`Op+&kguS=Y1Nu-WOWW2$~0xdylMQqtw65I6i-H0{k zvWD}iz|MA{{R43fD5>^hl%{Ec{BNK}8`Sy$l4RdkJLRbx%g1E}yPRn;6)DR7cmUc3Vh92#=InW^8cw`ln{*OF<%8PpZ!Se^qz zF`ANzf~?xx@8ZkjvE1}6jk%e9U7AAZKU{mECt+d;`HCWFML{5@=Nml&q%i?*>-E%h z%ISm`r)_evs*Qe?(IC>>_lm@?Mhf`k2yU&?gs>1}edQdSh*%a*!eAF^Xbq+*r7sOX zz&Dhugwi6WmNU|Kc+`S2a@s>6^7I2_R5ms? z^eW*H2&yl}%VMlJY14oiiWWy_3{pIf+h~=M3OHxjtl(F%`AnUTi8q~C09^L!UwQrz zU)7VdF795ES_BdG0~AJZ>!y^~`JiHIJqRF~OP|^ejMkY$twh>#yOD;*xvM9Xp02JM z#PrQrnS23dJ1yghQBdd_>Pqg2JoqH3gyJ-~3i_G;|EU3q2qat`Xy& z%y6>F>t$fjcRzIOZBR}6zfOcA8DrKP3DyH_!>vGm}^%g57&jO_c(4et>1%jyEP z6)xT%qcpX?+pjOlcc)G2!b!qO63PZqMd^o1a+r~YQbuuZY;3fNf8U+uImW!4B_mcD zUw9cFFm}sSE_9(JyK3;MGn>%Gg3ESv_T=E>yII_9CI15!t`d9tEGIAyFfEmpm8{Bz zm*tzaZ2xmzo5dgcDd~J1&eswUnGHhd}3*E1dt)XrUd})u+@)Pkj4((fZ;hc zM=gBBy#Ma*A=WQ_8Tu>gbMwR?EW9Z6dA34;IT3Lr^PS!5H>6jzzp&o}H3Or_|KwoJ z866>xeHF7*VPa(i$9yk-x6KX+nhvM(&WJPP(1&XIGq6tAu9Xgh3m+j*(!@WdVeR~Hu@9Z>{^yXc=F_%Egz9;_Yfq6A zurPU9UT+HxN#PWE3PA(gOdzRsL)3W?+A>{h`Z+ojfEXlZNn*k|aCZdLcHkiL6f@8x36a(`diKO5uh znYfUwuk85#4)7~T4^L2MVjO*UCD5~=^)&N({_Xi5BLAxI<(1EA>nuBdCa>*`2+(FR zoNAnbBqrKl<#f;E|Io=PRuUmV+epxWGH2~u2UUpR2gFbA`)cUu!AW9$#nSV;o{qQY zOIt|OTJl)+<4+ylA(UhxZ@wH6MpS39D7eY|a(xA^==nW@vxPp3|HTWZ*spz$mq@y` zH?AJ@MklU98L|C1RR1i6k#!w$r>LE1Uft7V_)*HUfEv>o`;N((dG7l?H09a{Occ>JF>DG2_XxeiNWfEKXi+(#yi_()uqocXRq z-gw(gmw#M~gDO~zav2qEr(mjta`NVN z@GZ{_Yme(pN#QI>wWC?d;Syga1}Ev~={weAazAA5;lyRusNrheNw!=zy#FIiiUr(= zrpVrG$*>z}u7QSMGx01``?epL3-*V*;qY)?@a_H1vo}nNri%) z8wMP4(`2w{hhOXeMl&&Dnw*}V9+34dhhdduz;>Jm_#f08-?e|_r)Q@6v#}_hgx@kI ztyl*2@-Isqu1`Qvd#=qr$t$asN+0az11x2`6hW`PCQxKo9{(;mUS-1I( z^3{5QWm3DIyEzi`mcp8LP-tG>&VP_MzDG+;jsJ}X^%g{@%bd!mZLYCh?o5F9MdnWq zMbP?f4t6g>ZDH2Re)Z~Vx9bF#E);CFOs!3DSGSjs2W_+ ztuP*zMh31@#X5|ij^BOEop(4|MInV2gRL`9_|dS3Wb_9Hh=tjWojkas zck`i~VPuY?%xz5yFnU(LeFnW4XrEd@_MHyR+E@{KMfx`UO$T~I@jOtWT zIH4vd$`QY+HC^$c31AAjxlmu#HkSyPBCF(7aGg<4Mp&uwGb#w(sFAvy{=JwM_Cw%X z6?e?Ez*rt7+wVJH7bZV`gb^d?M6x#jJHW(fomhnRr;G4Cs-(&f!0xJY?X8Ly=ZAoV zUS5<6#XmW+%%&-7!IW27V)U)(n)5E>qCayI<^$AKes~~G!rxxc8fF<)&!0ezaP!&Q z*xEL4cA>J1;P<#W7l_QX&J5drMh_YjpW{iw+~`;7WVxlFSwTF@JtyV_H;;10Mm^ z>Y}2e{-L4VpFe+&9VTE5A^Sz5393LUe}9BFbe>Y?%u$a!MPbAY451v{Fatp?x+ zx)xS;Ns=lV9M=hdrG-T1kVe<__>u5Cw0xSZX&xt-m1Z&lz32{^BDXFkGFORN!Vkqio8t>JrMC87Pv`ihwY)m8FDZFLSiRg}e-v5k&AJ_CpOhh# zSxjKl01t5Tc0nWfRY`sNg^f>94R;%uEjN7KDN--SATn`I$YJ=%6!|8XVNh>v61$PP zTDwx;S^E7^Qk$9W{qrf=G4O0lB4$`4igP|;j`Yy`@&fxay77})fPau%CyX{GHIj;ykB{*2 z@i8_qJKV*QGcsZk*X8HC&1{%bW}RB)yxAKG%4FXLg9>1(@uVYC8R}CDY8fLZPAgrr zMm_96y`YdO@=H=tk>Rn9Z;eRuP6{{c?~h`F*`}Ml?tQOMvE4pbRyj zfuNyn@DM@P(UDz=1~Xd{1nky;Qh7j+$@)?CCeFobPjE#k@PC zh`8yZjL6Ur{G_2Zz(5PdLKPq9KFVSE!(vFD^pezWM*DOYhOA(BB-i)+y}`7r!2;A@ z8kQYyj^-uh<&m@eZiwE#eS5UhN&+MeNjo?=WI3++Be=Cn+u9bB{L8Em7it_9d)J6;#=j+FoBC+g*WS-r2u~t=`wo zj_uDkfncLx)(Hi~lE&5$bVfF|88Co#>g==?XyFM62yCI;oAp-=9^W+oRaCuL_9$Fv zJ4a92^k}zrPfEnN{bU|h6U4D1|KS4-D{CpxZoK)*h~{6=;_x>^nBR7}$;}XW*e_%k zIV`DGCh8T6d@I7Q0qlPYg&umkpQ*9T%80uiF@r9hjc_t*RO}M0|MsL1{7-S2|+3!dQ|kV05>5&)V?S7;&#aRs0Ozvrkb zL+_&pdRuR32~UY$v+TpW&|8su(K{a>V#zRk#SE)Q3H(q=A0Tfi%IWj~zt3H)^|S+{ zDp)zIUHvc{G6ygh7Z;z&y|%tx8u}d9I{M!a8M1{(N0Sw44hw7=NP6f+UIZFLFT+%P z*&gKQRcfXN=Df#vO64bOm^I4u?k&#RUQEM~2{`(8FI)K%$)%*#w`UoUa^G=q<*dI? zWYhN^6n{C79m?|BNrB+A=_PYZ74DxKB(dt&X-w9T6&3ks|N6DZXSxU(N@V?T?kR#Q zLOvQ~K9rcxqFZ+)9gvfgv#6&298_Q}43fb*zM~jGMa2%*hC@B0!uS3{e<+E)U23u> ztQmilk_C-axn@Sga40vHPk5%xt^eOL4LK%qcTCjOTaT)SEF6~_&KGTGN(A}o=`Ab5 z7`)hWP0L3G23@Dy3Uk9Uv2eaO0_g~DF44LCgF~IV^5HfoJ@FG zZ1{Z8@`1h8b;R#>`F5STyrt?9Y$zQEe{wCqZ30)~0gkT07Mo(8GOl3+ zsT`t~RvGz(+mmChQ(9oXs?+8R+zWrx3&>$0uuXM`6j)1qz|tn`4@7jl&;VEgZ^7*Cq?c`6Xbd!Qmr`Pt0K;hebi!{f;6D zGJbyFdqv@$fk;Y1M(O;C2<9c@Z=|;PD>Z?}vo}x#5Qf z5VbI$zZ^Y&(A8bU%;i+KJ>D-oHBJ`IuToH;3pH1pn)V{Y6hCr$*`zq8Q4<~3e*2a? zpB=lGF#~Qhu6yVJGu7JJW9Azir0dv{o>Q<=*U3^E-frACEHdYxd4teN_+AVHwy;e1O)oF4S07!?q`q$J^6-u)~=Da%@oUvH$Y?SPHtss|@b$^^MH3>cV(- zt=Re3&AA?e+1Q_2NI_VCT=MOg|8zOJiD)k1Ul4MGfXHvjm!_nt?>4=J%GN*$0?g^_ zU0L(VK`gVa)a^s-soyBN9UB`Pf>BQ-UYe|gdMz~YTgCZps!U&R^l=O#xszvcajrza z?}QRk&`6o-Nq9SnTX8-plWtsIUaICd=8}xQJUjF))GC$PFD|LLYL`xM1sS19TYUp8 zWo{2+9|D}f`ulc}x%|lctP@cjZ21W;jGE|OB%?VClZl@|HsBP3DAAy}AFyQ9PqbZ|c?iJ^ z3k!)L$-50sGW2h}0;}ra$_iT%77UV`#vriL5f@T8=%o?&k|0br;^B(wMC|s_zV%WGL+STw9&#!^%;d5A<69a%Kh_Ja56ehhpOAac ztr`hmQz1Se8|scG;nzUxWJLH<{<{OtsOnWR)mx&7C%(WFo?q+E?110&FuB% zxew7x-Gia4b(Z$(UC1Q*kTI1LhF^2BOt*qb!~m@u4U!}sVeLC%8r;g6btk}8*`;Q;3f5jsPn4OTBRALMSVh?+XVdUO>@gVMmV*e`kOD#~Bt$4*)BfF~D5gu#J(%GLM>V0EA+AG>Y@Mmz( zOn-?6e7hwIFv;>`s_EWGTlkWj_3vnn(azi}f&yn61U-Hl*8js{s4~xoTKX(l>%%UMOj zj=yux^oit$FEn_vLunQiQw|SjN}0)w1Y!d>+RNn#QK=dL^P24-=NI95geAJ=5Xz2( z!ubZv>R>mY1xClKFUxu)@|-sG*;XfK=YL}O#7dpvW6p7~(3B=cB6E(UDAF_$y^R4- zEdazJK@aE9!q1F~G#xw$nbGcRx*aZ?T0C{otAk98-$+S=p#Bb2I30eMBA=fbEaYXY zn{G-@HK7xiP6~pJCTAiR_2iX{RB1Gp5OLvBj%o0CgP=6&4zt+z>Di9|#Jc4R%yRHy zY*e`(me^)yd!qX1FYlX>CH7c|+pFoTJ#zrOas+d9@|7~D3-^%tDg=EN{Esyk!aiT< zEBDNdUA>so;LKt!ynl0_n73@gIq(XN8A2J7)8MNyv~=ip_<;!gn70p4#e<9=l14zc zHvKbayxact(6(SUJ^s%WE_VU>l6ezyXn}PYuJk=_gVB%Kfx>@GOO~cXY)xoW8d%da zB7d;C@w}R<#lM<3C-U~Fb9ZvZ%$X1D|d%>ig$KR{xh6l5GO6Q9Fynv1D|8}t2f9efw@rceh+MjUA)Um0QNVzFsfe8vyI7<#5h4$cK;B)}2WI);8Rk&dE8ec{( zI(ko1bbL_R$n@*FI0GA79kIrH3=ZZfNrPia7Bw$4cnL!EqvhuMcr7?xGN0R%=%ubb z6YG}X%nhyux-S0QQSGmyXzF@;b}((|OLBLR1qbb-Ay>EZ^g%bDsDhL>tEsNS2q8}l)IWDvO*uBE`E( z#eaV~qBP9KS%$Tts3@ceglnEy=)1)vnUMk=@3I53N3N>eyv!DO{7-#BQsoiZGf)u5 zlOB-1r5=>L6^lHytUQ(})Q4A-Ie4BzG?c}p!H%2_$oi@hN?;Y&CyND#9rXf{<^2Sp z`~GB5AdU-ZLlGjAgMKr!+lye*Q4iV;)aY*a<~W(s=7#r;`~|SPI%~)0L4XFzZ|D+Oy>#GFJ18DLJ{YHi z--R~~<*&l8V9_pFc7;EVH4dI=u>;Rd=iHv+;Xx@Ta|AZJ>>`vPw!h`{IMMrebQq=2DqlgFFmA4GobuY^$M zvk96uIuzWyu=<56j~D7=eS#AjWxZV4ue(~;8^G+jb!*nm4k!KBo9cQU3UIb ziHeGj@rU4*YOtVJ@_;c%l2=&hax-rkpO6qzU=98eh4a~(1O~Z?oT@5LYQeXJ1fXZ$ zG7Id2y@OjHmgbTA?=xB~_&dXCeIRkrZt-+Bdfe!NXg7X&d$}`=nldY#<4Z_Q{GS=g zaHWyaWT9#4>2n!GVa9s$9sww~S-_1UK+{fmHGke4RGIjXrEx+N5#ON5A1ltlyP}8pMH1 zt%BrB(EyiBykl(Nkq-hDI#mAE#ZWDf-8OcG8rH^DHkB^vAEUT?4E|5hCT#exAJK^$ ziM9s4#`VCDz7E~ySihL1p}^j*M`9I}XJlj85>%sJT$zWd?DhW+Z3Qn)k=Bf90{qW$ z#v~;-aTo?zU#;*UFl%H+gHVu(fMRvRC;0=MLqw1F554t>fXBuC&Ft+!dLSjzW@pu$ z0Fnvx8Ri7+UBBpmgpD|? zy+T8vfV5?Y*xJQoYxic+-Z}gzgr`3a^{XcJi?A^&RF;3GL5IYWDRpzksOY%cgEc^C zv#MYGSiN}MUb%RjHFtb-!xjeLoYE9feB}NJt3Pxy-lG6|Ae^zPEKv;#1)2 z7|aW-z})H}$IvAuNK4<~oKaT{Vnuw2IxZ)Ee?fhw-m&B~A>0qrJFZvYv)fOoL z=BXm<_6)b83%K)nd&Xk)ua77}D1y6o+tH4wO)QT5K(g6PA7Ja_wYh5HTSy3l6=MYl z39qC3NjhQoJ=l9Bxg~s$wRCQ1@w7->^Gs~Int3M~7qU(eeJV|fFHU)p zU1G%NasRX)pr*D1_6V_r&Lyw1X~oTZ)4W>G1-thEPt>5Bd+f72s1V9GmEmR>n~XxE z#%d8@H-#9zIotq{)GR_h0Kc!@NTr zy7;_tc<#m-^N}5a@5>kEZuoRZJBSny<%KcBzlXkJn_!%g$B|Cmzmil?z5iwn(+1@W zkOx}5+j7CDp(fYyo&J zOo6D^kN`YG%m;Q-U_fgUWI3E}T< z#NW7n9delE*MsnoG6YgK)#y=i*cfPA8kSxBwOxshie_kgpBhQ?|f|^c} zWN+OFpJhVxK$D&-atTe!OJtnXBLU=_3RgAAFY76G?wuy zbL)Gd+BI-ZEZspQv04iM;sRI3sm0?>97;UpM)=>r*{ra@7g}*gqE|rBYLWXY^PP1b zHtIhhA>@Dtq(@6;Wo~gxfx=VVQkv+k?td;%MrRlLt^|68zb*rI$pT4kv4N}ke~u_P rVb$v-t#!i?CyjT*FcDo{ydpxC^nL^2hz?t!z%O}eWvR0FMnV4%!|5}Q diff --git a/Telegram/SourceFiles/art/sprite_200x.png b/Telegram/SourceFiles/art/sprite_200x.png index 16b454f0570083120156ac334862d07f4734f772..daa7b16f35a39439cd138bb9030cfda00ecc16d0 100644 GIT binary patch delta 36648 zcma%jWmJ@1^sj(`N{Muz>#lXbT)yxy3~Ns8z0dx|;qNYC^EqMBHP(GTPCfy3USSblmb!_0E{o zyMjc|IC=i>&yRU}rzfz7xUz>BV{Ym;C#kDaY}pnD7iLdq$ifyz<-!(b`EzJ~9)@=j z30Z_@Y7|$S=~gVV9sey({;2*~H2nU+(?{YM54Iu#@f>FT=bexka;L;EL|fTUN%rzHn8;?eZ0OH`wKNb-p{}PY9E!|cq&GRX0XiHW2B;!|CFb*30x(bW&v31Q-0 zsxbT&O7$Ltt2w5>w&YdJl3!k;usXk3W($zH>+o0O9_3^3^_fPX0?UxLZ9Rlen)fcd z=es#wL|sG?k0InOjw;Z9y7Q|?9GJu=icWcJnv;~ z?az=?(wID1bP;i^(u+C!nVXwS8JyOnaw|SQUWz5J0;B~uEWI)5!!WqAbo8vGC zTRk0uX-h@+^}j?J(PKY0>KZO4{D$dUQ27iS7*rZg5#Kpxy(m_PGBjWij-)L#z){@GZ>G&&bVXEnIVU zcNapTP++74|Gk6Hc}X$343Nhv0M*-5FPC?teGc8<8w80M&e}-{C^oO0SM#B@$7H&PhljLc9y|;C^74@U*yfRZ z12I)D>$G)wiBTiw-rk-Irm3QS=A44QJ{>M0EoHF;%abQcYrL+muHiZ<6r4JlXSBF4 zT%)XQY~E7jI^GUzY+xaIsK?PF^whf~k;>cOwb-g7M_c_ubfy*|!E3tlcyV(h^YC4R zPvLO{TKRC*BZWOL=fdY&$hr~wl(x2JotK{0m8rgYlTH$Ui-D>A+p)L_zfvyNiG+hT{`C1Uf`}3#X2Ij8>%B-m z;`U98UM(JJ%MU<5HTwJN?c2Aii1zk&qyBUm-iEt(&y?mJW*lJc-QDJmAF#pBz17uK z0DFW)D*fAA>~wu$J~6tCbl^2@#V6-BpnZ2(1>wsY7|`QUaAj6i#jmZc1)NO{4Snof zG+F%jT_o*sv8x+C+8dG%n?5#ArHtke5hb;Sn` zu4Wb%68blX5Dg9uy;M^p78VxH>wU~e^%JW{=_8iw)}-8g3&jwG>w#}6*<3) z&k;O22n|Zx+jG-LvTTeVtL%%I%Fd~ria}RCdR!EooSgplSqaG9Cus*N4T(`vjbT*$ z?HwKcK~H$|d&9%S%PK1eCnptDR8;;RdV(-Dv#?b{;Jphs-tdo{Ebm{NNDWEvhAIMK;nSJC#R=eT*@myLT87Dht)um_J?af3~gxw5ySfQXyPl?3msH)-=4M!(|6Y~U*|Z!9p8G=4R`p*!JhB*Tk-oLNd_&?O(|lX zX>&XdoY-W@M4u&-h+eNJ`kvVd&e%XQWZ#Kcjlz~=XZkZhP(`j1!JVA=!1j@nl7f8C zvZeAAqfY=6hr_cCN0ZIFj}b zt8#NcFD+S!h={bRYp$-Ya_Avc4?Q1XwFW%nR-tp*^^3vXri5s;Abgla@4q0t4UVp) zxTOy-g?o1MHuv^A?RG))AlAjKrp@=EnXkAC@uCmbs88LP*=T2sWu9- z(u{3nW5ae2+6RY#eB-P`jznadglKXPs8ZwOAbQ>v>gAq^HDY9xk1kyKDo+<4zdVdn z<|uQLk$*6*Rvn`FZ9eP=+ID-spgK*`riAQjnH2Xl;;#y2KOyDSSI0*?{K!HyzGDZr zPgPF(Ual(5Q=_o-nwms9QMZ}HvkAMHm>BI^4_=6hii$1iskN=`!c1cz)?(7npFMdR z`RY7in8U-vEk~P^foskn4A-2$2?_`}%pe0&&wQpF+j5PVpBmMA{q3&v);p+{wtpss zYU&a|YXy_$Z`*l^*B2AI>N9I3r=2tZ8pAI%uwE`3pQovaf7(XHnamZ#&@f1`7k9mg zfXtLRlE#SmrwlyI8e-mA`#xF@8-FHIKNi9Hg+PLYnCIfrd0#8f zzK7dtx2F%7Sy)P~huJpVu-B~CuMa#%3-#l&3=1v^Jctk;3v^ zN(zIOm33pP$~jd+NJuCqF)_dC^W(vf(D||OxXYOM#(pS2XOdWFD=U9N=D1uv?uJu* zt-|>uHa%OB4f>Vf zqYGn-XLvq7jxR2zy>G*)v{EPN4J%u(oC7giDZ#-H`W_70#NanVj3g|KjDgVHoCzVF z$nEFm=D#q5b0k=DsQ4{-psR}j85lb|I~h-UyG_%!`@!xK56XUoTuT__oGbP$B=XZj z2+;-tL$K5vcLF&wPU40;?k4Q`#jrfWlvR^i6cr5p!f?C3kecBgJx5-S zj~s?6El5Dz`kwA?4Td>+RV}Soc6OY~+0HY;s;GBN)Cma*AJ$57=v8WOI;ppBZ>n)+ zW$e+>5i75_`|o(9eoc}ze1a24uS(!^xO3Zawy%D`cUNr9XYZ<@D(DZ13X)(g(UpFK zoFzp&{v)qU1pfohI_5|Qhh62m5QE5$Bp1AWK8~&wV`GavDb12?Lr9@Zj$+JeRd9S_ zrggQKN@kV3P{*1DB~h%zq0bd#(A&3VRR@pZiWRoDQA>-S&?yJIF&q(P=T@uWE1#37|z|H892XRu%J9+bg-t( z?X6Syt^IwTAp3LfQP0=d=PISA|=g$2XkuQd?;zVvuy#vK4 z%b!;{fIn?zu%{y?Awguv)!n`F-plm#25-{TK9SFux_(%ep)tkd&`@W_xxQ2+XJ>`e z;2IND!eXTKX^x8g>hQ$OuL0HZbHtRBIC9IqSfKOY9EZXS21~@xe3$)$M-+5DQOo^S zTY~Sm4vR9zn~yArQgovK4%mh^(2V^hT-gE%qq9EyOGikM5kJ`7Yqmgy$bQ%}E(Sgu z_LwHSw<6j)w3j>_z<^O}axyf5k8T5o$r`kE^FkA9EPd}@_ol>AM`(8z$20Bd=;(;c z$1Wlo57W<*keF>%2t6*cc9@6a$vl^(YRcIZX&{ZJVwaM4!-g4nV#fAe+d5?ESwy;5Tb@7%rs7=>k{cz{k4 zr6uGb$GgE(cZ>2=W_S~_EcCyx>ZhEaoqbqyhQyU`z|>ERpMP8&Gucm;b_ZJA?!9Sl zAT;>x=6noi(Ztg$7x-KXEq!#SQJvvIxD+Rgy3?NbEx(G5RSMBhGPI36bBxenY7oyV7yrQ z>ouTaQTZfAd1X&a>l!ko=*Ek&F0;M?2d)JOpBn$iGkTZLptvbRail(Yk@ynx9rBff z!5@&gZaO+TR-m;!BxxENQU`}>dr!|us%sSNcdwnD9q8%%1_mBz`htS+L{wB41M`1`fM3XOa-N$MB9BdslZ+QPqSvliqEwf{|{yFPlsZT$zH*A(-3 z2M)W_?=dQh-?uA#zeETM_ zBl%oKg$V4~*49=k*S)&Bx(#$g3ZqMi4Tr)NPKH; zjrvW>@#dr)sNzsdOAF{*^Zc{Fj^cE;9?S|?#3}M8z=dEo5#eoYdQxp8(ELx(-zDgU zG%jmC8C>R#7j5EDI7Bf=eyfqCGo9s~EoX!)C!2>(uuaHS*NMGbeViapRL2Y+Ogtlk z#^3J>D^`LQWIREpg$l{}Jit#>@e|I>^%pj_6uNbYkd)`aCjiQ}r|YCjbpz~w{J4TY zAPh16>wDmyZ4HOhulV(YKBQ2;CQjV@+5S@ZTd7dRH@?$#-p60hK(`{Hnu2AiPNNLD z=VfJO{ntHp^dyV2vazKj5L(#c*aF81Qu&&?_%L6$jVqrNiOE(HTs^En#BrtP`z=8T zw?1M4rt76NeaQW-vJm;Y=jmXjY>98qJig@@EiAMLq3j7QdND}uSQJ-B9;cMDUNiX0 zlBnE!e0pQ{}Pj3 zUScpx-OvyQ2FiwpXrw7&NZ{NYWKvR6(lp%*paqWRSizq^*(D`TsS2`SYXJMepm?2MLhDX)_r^WKNjS*qa*M5`0RB-S63GkKYt819yti@wlwJwoHb`9B?5hYeGdI< z^+VytOdm*_J`>xqNET(o$Uwc{^NX=; z>eUi}9{h0~u>UOTSx-IsV(j&&a*|}v9zsF(jatT?_FhE0GYBO4xniv&? zN8xm_+a^cK1>vxBa4dWzQNFWQ>U*%F=C(DJyUHZP{0abSQMZjddA*?&+!oylg2X|g zjTSvg9o4SuAIOQtybhjDR@%SwRdxsnZNqqEpTjaZV+!kA3O|8em-JEz@KpECdvoYa zhKTf7<*e`RIe4ykeYXuNT^_G;i4wO$9`smnL-`K7kaA$iaiZ7;eAgkhTR}foC_UGu zMxQxkf*HOw8MtXsJ+*5n1SWNTdn)*kLS&cSD(-!R@5A=KSnDY( zE7iNAJ7$%WH(mAn_wUs;HP8GUUENFFw+%FZYX!8VJ*^cF}7z zae#acO3dzp_tT2FSfxsUEJ)PI*USZdAS0?#D0+Ui+T^5WlM?A6yGtk$Tn*pOnZ$oK zUA?S1p&Ci`t&UlFxn(n(zG$m@%3wqUw6} z!IO%-Q2Pg|X1-Jk?nDxa(B^)>M2tivBwQbAw)dh{95j920gx0{Lt7H-Zg`akOhBcxJy;R1}A=k{CJ=*oU z{N(+rvb-^EDcxU?n=8(~nYW2;TpS()PUp&XaTi3Bs6;Ol2kZPUvohT-n)3P%x-9QO z{INfS48NYg4$s`gP5f7@9Y6!ZQO>C4#l_h}FJXt7Tek=Z2o@F=6knwh$HNI}VbAUD zx1akO)cc%f4lQ4vL&sREhK7X5Fa z+JyaiDnDn5VagU=;Lu%?nPbPWYTEjQoJ^4@PT0mRA*lC{vWdcX znplcx4x>tcl(mr{(m2p3BuFNn{NCHcs%_Yd)>5$Ey8gXsP|Hcvp;)~u*Yua82r`~I zbvZd)B_$;+G`Dt%*&Ff!wx>^10cxwR7P&=8FV^nZMwcy>{&>D`dYWGSh5=zNkZ^Z( zbzEqV3iw)T(M>(Pe0y-7us)e?b#TY3+FNBM=mdwMdBzlf85V1yd(xO2QDhnP#pT=~ zlK%lXkvO5cG|36cjP};E4{3+%Ct~dRSR?&BnDsm^pXKwGAWbzd!bh0ecO!SpkiCeDaQ!8YPvUaV{J`T zY4-UXt;LY+wWR(u2{9ib78<*rfL8T0z9Z7`89F(~Ab{jSt=cKeUGXHP zXGzh~F96@9oEOWty$4o zmVFfIdF5KASRv>MEADIk9Hhx1%NM!ft~N?GrT=d;NGSxh@&3?h^|AL5`EU#`Zum`q zy?wg^E0*8aGG644*qtdu01%#0+2@dl!R8OWK(!G*>f|v}KJOrh#+(MGrhdmT@&%vK zYPrw-lE96?jXDu>?n9#cvn-PF10wm%wh0n-{F{xC6UedZC4?CkyGb{nS{V# zuz6h9o8j3-_sR2zf$ecCP8koY>Oyj#6D(Lm^6#6C3lR|& z#my=PYC~uTl%0I(>#F+^Ho++0d)5hi?#=d)T}jUlT|~NG<1E&&o~B9 z;kBa8sRkYE_2!oh|9PGCB-YVdGl+jxclSEot?|8>l=SkbY8B6##}9dbro(t9rt0?} z+JV*WwEIy+emfsQw#)M(-fKKC)KBcH4NE)Ug!WH#`27x)8M^E4Q90fhm}UjcxX6yV z(V)Odln{m?7x>ZZ1{B9!E&=M^5)eu_^$~{$MI9X-Sg1@u6Z-o4@)C$W{+v};Ck|u- zNQgDIQ^wxjUJ)zuqrHr>gHR%6t~41&jJBes;Ql+EHjaz`~Qj)@Shwa{tf zWSw56*yp#Flfn3Y&jLmx5LMolB-zVjHoZ?v!q;Kz)wQ6DIq*mwwHw$xBEa8vOFTGf zkmy??pys#&$Sl_lVN_4oytBFg!e^kslyfYc zRR5^wPH*tZEp^7wOXnZaHcjm1a4tfvE<3)uH|wo5I{_Ezik-+Xw=1;6 znJFan_ud@Kg0Aq;79C(mdqcO3>_?gK?HxU{{p$A6pRUPHYyiF@c%FNWPP%B#5~lZi?~&8^fwuKx=J9eu=6QLBJ_DQb`N*O zuIgzqO=mVyRa`RMVeNOv>Dw!Sh#*N)A5(9?;&7(UlZZhRU;zGS>Sj`INL@2>K_wD=Jg(|Yt=DP;3&?e+Gn1t8pW*7h4u)8 z$I8b}{$1R4T^2Dt+9{Piob2D2ZBNa$k>o?ulUBE8q_r*d)+B9M$Da`0sSxr$8RTLa zEqIlVc)eVTZv;>{ED- zdi}ACigOwjULIX?_9X#8Xuk`qUwx!s+jD@ z5Pf35aD3}{h=Z*M1JcA`4_JJDx9IjKxBW8Qr?^KLH37-U2#}UPUb2Z|hk1xTsxZy| zyBTrGmlM!--^2DXpGeK+m{NEr*?I0LR^+3dF(#=i39Xr6GWm<0zPE z!}4YhpQ9{okyLz@ud%WIgS?Arxvrt zn7fCD)VLk)9v%*QzqxZwaHVhs-2y}9!ub+V^_*Ds4(To7=geOTVg6T!2(DDzmD>~k zCFXXs#IqzXGy8YN5Ll#7GW8=zyFEz z1aX~M4C%bPUq@7FO3XDkTQ@J}qK^5U?Jjm0BKAMp%hJ*kNXqMn1H+4nt6e6=E5R?B zUVsxXulIo~1xJx{<|J+0G}+Aa#Mo=k{8)DA2Xis+YpgFq@2YN?$lg@P`t0r!$41Qa zZ^AuRR-63esI@0M_a($ws!M%PuF82_erm|C#T{K;Vn=wL=xAbgxk!3~YPB~hc2UKn z%RhenK;-sy4mJ1H zU$OL-?ZtnWH|8Y&3buw|Tgc05L*j__dcYQsg?x=%fs}_yd2G{dU~q7CW8<%Y5+GdL zJ3B)=ifM(N%x2b;l4z4@qiz@W3JMD5^}hYo;@|t{wS{bSj8aHo+j`yP%q$9rD72I# zNo=r{)wrv6Xpzq|qoc00>1y5Tdyinm>&zMZHRA zfBKX%rx(Zvj%q3U`}?jYS+|<~*<+d2l8k4k>$toCvWYp5^a5OD2juH*1P>01&&A=7 z#*Z$j7u}YKl&=}gES${DV{~CSCrxY|R@jstiHfss6J9!7s4qqV7~0Li)vj_{gg!Rd1I^_8 zXcJF_u=^P!p9FA!WYyRErAjcs9Q=X4t@7G;y2jnU&rxv%m+S!z9zUngdnG=(bHy8S zAds1x%#L0!ql?eF5}B^Zp1;oln6GEXHX2M5j=`>s<^gz1ZI+?PE&;q0!-8V+bpJ@`Jkal4|J>6Bv(uB{eG|C3d_ z)C0AFtV&Lo{RzZ}C%;9PQBRUEh!G5c`XWcy%^{%MszHB1_yU#PQ6$;l{^teI(2dG< zTpzzoS5E;SF4}ik3`jTNeu#dez?>_K^7U-4T&9|rD;Qis{5oWoi8`}cRPt9bAOqoW_V{<{CUMA&(0#ziDIKOdsW=>>fj zhfdkkyhGul#U>v7ADp^bXB>}7(km-RX=jCja{*AXze-C3pCjQI|%~j zYjU!ZvGHtNjZ5W0Lap|)iG6;^gfcfB7m52fa&DChYO`$0g)B;r?g}T9v~V%G6$`|- zZ@IkBWic2rx>6(=@`qnTfM}XoKPz%xR$l5&QIV2rj60qj9F)Eh*}IjYAbr420Q(P{ zN7UUSU{3k1xsI$R1uTXwx<2`ac+%2>EnT{~yT3IwWGM3sAGS7M9ry)WnwexTqFx3! z#~f5BMpti{gI{qn$=-1F6Ey<58;0`i%&V(7VvZpQYMW03+=@=tuOy~(-RG0znlpP%-;A2S8O0V&6u&5F>i8T4L_(P7YoZE3THgvb=CPj^ z1AznVGDrcXS_5wIkeZbhoSyy|u-8T7O`^$w76ZifZO+<7m2M8*3XY90tdC9epR778m!gS9e6(EA2)hm5fp=0kU1t`I^a=Nt2(%f_vJJVN z3C7)l4`zS4m*_l8_GN2!YN|gV^?{*K_wEB7{adea@kEJ^skW{GGc%G$(X820mKQNTUjQmD3RrL6C zIkt5gl?vjdrJ_DS=9~k^$2K5Yft-LK6F3X9YHNL(bU2&tCD9YzEWxS^pZzpcYg{?* zGu9Hg==*nvXLUbrswyM)nI+$HSEAQ?^vWNV5ArH1%ZT}ijN;-bkP4|qeQ0&c&p;#v z47b>O=e^KZ4!#DZ7J%g;0BH>ne@{-`e7#+XmW zA>vlA8h^8i6P-cNN9_$MUTp_T5SB+ysnr9%ET8D?WNx=(4Tn6)p`T&nCv0Y}Z2Z|C zU7HRc;NAmUosWP^DkCT7)6|q62sd&Cmn@8ZueyVSgTARLMJ1)~ujeVi{1cUwB$m0p zI(Z1EpBinOvE>!*Zd#Rb(_GZ)aMvo5d0)X-NkQ#hyJ2+%?Ys_Ww;FaQ@$fKY(C)xt zA(wSi@Y_dCX1FF0ATd2|bJLtLFCkvGkQ4zXkBXc_BO|adzkel6DY}LBI<(u=r%$qKIR%sWz;AyNn*SO^u+s zL`Br+1cw1^d4(R45J{T#y|7Ji80BJNS9br~{n+C(H5aCR7}|c%;Ybf{X9n1g8n?}R z6Rjr2zzFsNSaX7jFX7hYp+RM30s{lkK%A&M7f7-jL(%2dRJqOQa|NE0R=o?)cMgam z-I=#fI+C=_+W0W)R&B}SzFQb;CIp2$Z`NvU&du)C2S_b2?=0*40#UWqS~0iAb!cznYpk#3erNcDJuY`E6QPVz!c+7HhSGm6McY_%o^i0iGEIKUS#c zAw)fK{ocaM>+HEXY1B!6FE%#zjRytLh+YR)T8F~o;`%`>w+;|DMgTJ#=^X-N%@QdX zs>@rP+0eTxq(Vw)YyIADA2;&{5j<^tv|Bq)OfzpMuD%*acXiC;Q-zCLyqrxp3>jS5 z^b*SMr9Z7`+YG9N)=;%?x6|{Q6+#A?#w}E5cDir53@Cb!1>`rsFDY;AuFs&Su2B-v zXU=tti?=qGDGV>i)_n7OS6IR<)1m*5_zW$mr;=7(K`kc6fF{48I{)ob2R8zzgS>)* z>12f+)}!Y6T~z}EiK3#_jPvsqyc~RBP;d+nTojIpfy6j*fE;IOkq~4EU#Gf52S>-A zFCTq(+yiAqk+#vV>#W+!N_Qi+OTQb(8Pu^|1p4P69NJAlQUZp${~DxNu4vDEiIe6d z6)yRoWe&tvpe&^H%!8%x#KKc#q|l%FH^spq>F(ppgj4Q^WZ= ztx+~?;AM`=UFsG&E}DI;1K_V`{xpdu><-zjRvJE_07r@}nK0Qg-Y$T$2}L~9o8)2r zi-F8S-a05yMS~6l&$_oI*TBN85U}5N1wt+gCFhwRvi>eJY+|{g7puXiAu>4-egOni zU|acSrmL0o-rO%MD3dpW;f|1=&+duY4~z3@;ECh1QgsK1gY#0?XKnpBeoI1-YFMUx zXO^)O%^RswD5!K0^pGrWf%%eRZKL{mkYe!rrb$<>FD0}wu6F`vO~mWrYK#TGM%Y&~ z*VU3{A8S=PZmi8Oyek{|?{3c$+SEj41#J>h*^kJ$)fx;64Gw#ZNl)!wTz-vdYsROz zOrl4a%5mG{`aJf_L3Q>{uYX1aEq03txo>aLxz@OY_y+;#~lcUe|Jq4Su`SfCFgn6OB1)%)1Vga75r2g#52z>KP5v(xL^dON)8 zPHf8#opfqr8!W1Y^gh?ft;p~PT$s+y$w=2q!y2!@_i}G6=25pP;6gcv*qS|@75oqs zybV7$N{n45s%g6SbhchjErHis>r>eiQ{dtFF}>T(D#C7O)ieeTHJg(4@NV|nG%>gz zMK3$>uy;4vORh8ux1KkTMk0i{dc`wkm{i@q@bU!pz7k{JkX$prR^wJbqfd;tE_&Me zTK-2+OS4NpwGHA{aF<(bVj|7{8P5qs3CPggM~FikbNGhb#h-uWdq&7(!Q|-Yi zO7~7lO!GOy{e8uE^+c)4$uOPvF_NGyLw2WNoUn#1_Xr!#+m#eoMH!LNw(L;%JpOYa zgq0K`$(@oq0jjC|nbg$0$mLf4@`u@4wbEKO3fMZ%CA#57u+A4?62SZSQ)GquE#j6# z)rUVcAc0J=!vd10{opiR%il7TP#|V&KVB9DnbREhMJm`amItc$G zfuYc^tN2t*h(D*Xm?}jq@X8&F1p^A@(Yw7ALM$Cz{Yrl7?nWn7r-deQ)XU;}hlRw0 zL+p`9vyc1amL}!&Sxoff_75gG9Q<}yCS?co^Xk2QFc^D{i#SA2mh)E+O0HKS!$j3gD@An(FfWNK64ZN@n{nmDj3SEacbvn`ANpUA?lo`70v> z%OAK6-@JJfTn0N(=|?qmJ46zB*FK}U@&Cq9X;V9V~wic=M+L!01T zD{!h?_yZ@Y64@3KW6d8&b9KhY6+w_waT54qW|(&D&Fm3+lIW_Tp*#cXYI*zIm{j?F z2JpFMW@iK6IL^u0wmI+?s4`2ryB`<7j!VeHjLHF??ip|e01H|G%C|c76fhRS#>m(R zmAOKc@-%gp%)=y=8j6o&OAGOuaIGlXe)SwTyc@`QeeT9hAik9IXg-3j-tm6g3t5YS zG2PNwGi{i2+#&bBNUymqG1-B1lUpq0I@<4MW`0o%0S{S_xUxk_bIWXVh_KIzL%YLQ zVB`fNGLD407;wBo04Us=*(mL$ALH8DodpM4DI8VJ%dm_WqF?JUCY)I_8FO{LY@u~> z>`M6Nl7#BU@)(2bGrC1*$)Fqa6#NY+zg6b?WBMJK%|TT6xw`z3##E2=5SO#fpY4OT zb}RJo7oN_9ru|f>$W?>CIs+t4?sMjV_X)tmPUH;{zEn>k`6Ge*qkL`ucC66MuJT_` z{H<#0LV#@l{833m@_NBmKzSV^K$v#Vqm`#aPpm)=gHjSimUoI+S-y^Z&o%t>N z%+IAdP=%|QXzHR>0pW3satFe#p(_*48x>O%5~#hrynLci@OSx9FO|SAz>NTZ``KR~K410Mm=TNTEMZE z`C_9^;$I{o6zEmdtssBYp28Zu)&m`A)`bwp#^{bPldKjYHb?`nwNjdh(5rNZ!G4)P z@JA`JdK&&H5emb65g6sg&wiS|EP#mqNz>k zI8ft_k2Xvhe%7Gi)YR0iL%w`P=BBmuW20>n*QCXSiH$d<)Agv>6k2mjw6$@VFOs9@ z!qk1%+Wv0`m5zxECxRCj;rgH@b%*Ak`+aL_X#-97Vd6~{a|2Z@XG>`|51Ah-#{&hZy)T&N>f<#@&?LBRiJ&e)^vuUU9v-46F^o zqo|OYH6iGyaqhq8gYPjYIi`oV89odsB%FjzplzPa1QJ=<+rMjksVyyy1v-3ct6*S+ zXJKKH!)8Ogq|FztVsHbXqhdV@(Qd*noxk1bjt=AH(!(+|*Q6pTpr?fJsaU zw+Ks8W&x}R@Y7?X7PL9Y%MIE;4le_u0iR#Eq?K9mO)>+DM}a)A;h{AWypC-vN@Cf1T&j)(#YA#m?6pGmhy2Cs4rGjR1h z6>-zuJ0liy-*UkT!VAT?vGQ63)D_SJ8~zw44t6e1XK4XPN5w~RN^!JtADLwVr7&wh zkvQ;{7T(!!0-lamdj8*<*{YcDP9n_lTC9$6e*dIOa$Gb;KB}b1pYn?K-{Qbsnp#t-OoN`b!@0J~ z_BNI2O{%@I_ocSd)yCn-hqbv@xbC4|9It27Ss&_YU8FTRffP=@lDS33(+bh>MTl;} zB4~x1fOA0oA<1s2Ya=GuOO5+{tdC3qq5>Ruj)clrkhV8hz{vhGY3mx9+cf`;U-byuo9K)O z0#xEGOj%Nd81T{}6skhOi-`aUq4#R)rSt?e_3nrDSWkb0z8pSReLWi4Sxiv#$U^IQBYQ~i5n zb_U9XW7`g#6jXv^$ia4FA;eL zC&C^lU@&sG%$VZE__&XY8yJZ4Rq(#LJg1aH@=(<;rb8I@$XqLxCZSYOYTtnbf4mUr zE`_lgk`gPVxe+kB>h~YN&6Ma(7JY~P=x(x{xg(+QJGbfM%v% zNKoj-tdV`bWf#VLx-q6~=5XSyE=O?Um!rGsFfzO62p&cPs{gK_zJ0_oiC^#G!v|D@ zqcShRWRd>T)k?NmOsR00r&k>k(sn0p~yg>DAL$(M5H zvQyihEzTv9Jl zZ!uIV#!{P-(Pp7ZEZ6FD;XAsZ~Ke}UYQsX5rN2go5Cf(#Ik+VH~(yWWW_=^Be9AKDD#2z zmGT;LifyZ5&&W3Cp9@$FS>5KsF<^lZy6V^157dD78r&w9e^|xZ{0Cjs(A{~psZ1|9 zvy}G>u!i(C@AVCh7BA-dgkl(UjTrXi4}s@$YjQm^P4vK5W*Rmk4-#O8h?s)l% zYKME+%VR|IhidWhQrP4Pz0ZNc9XD%4yl;u_*+CEq*O`7vdk>&Ybflr*j&J&x8g2NN ziXQM3#pj)8eBa!O~fnV;gy2Dz>wjvS`zvJc>hxUR2`!zE@BE}pqoiAlSZ z;LgN#b!&il*W;VpIsC!7pQOP>Ni%kzYNpRnpr79mug%DBW6O{C4n5RA)HF9ioa?j##~$O8YiX=TCLh6G?Y#+h6Bo1l zVK+vV_Cj1jHlS2y{MPa2XyMVc&+!raryljP0_3m2CYfublPGaSo$7xZ_Z*l60svFu zncLbuOUP{~@hF~3zFtLtlw3<&v z8IQ9*|C4$7@5o-8vL+ZlvH^=i`T}&@BD3qF`w59 zvEts%=iM%~bRH3*R~R^2yX$4zP}n|m7zS=kR7kZfMg%UZoZ*BQRT4nZYyGQ4-y4Ef zk~Q`05MvbcIDB`LX1BnZ7pCWN$G~0sCjZUyI^8KbdhoA%-SuN*C#Tn&1)B)I4`Nl? zZD!PqUN|NJd7C)A@eUc+6>FCRul6HG{_&aoby`xz=k0(*#%mMR`oVuRLXL%wOW00{ zZgTC6X}{NhFZw%V`%xTg2$0{)dBN@RdHkBibo97$vtgxirh}u2@q*AK2_3{&5={WtUQT`b#l}B#0v|5X*!XX1 z<)FKg(qV*_MpC4kxQzNtOTV^H!Zx-b!LBIiIWUZmoV}CxzQkCx1DV@S?oVPntxiKYlXhUs26tH^ya^i>`;H@)mnWAtx_ zmI0>dwyO0j40Q9jl80yC zZ}ZOJ28lBUF+xKd9HdY{%E5Iz@kc03b_R3iiR>2n@bz_Eq9^Iie_ePG*5aT4qJ4GIDa0+j{t*dshc8`QLER&w-vvc&E;ol9Zer0?H`oN_WJHebD&%wZ7zwcB>{KvdwjTv=gr$UTfU) zg2w+Of4);ek~Zmh_%@KB?ME4EcKu3w#OFjPnpu-g@obC{z+v7T912CeLEK?6dznEK zhQbsoRGuA>k%x?f@}9FSOrD&5j*!hF6DvPDd-0upX1%>ymb0tO zVR2wbNBMOLhty!=QAp@vQ2#cwfL^;6tocE|(Mc2~5*si2q{)%h81+{dAK{_);M&LM zUdKp>c3ihHKf-GEM3*<1W=EXcbiqjv2*{f2#rtcAUgH&ZG=P4N8PNYHpp=)FH&$V% z3-xhmYW}aTz5^cW|9_m5y+ZbiM9UFEStT>zZ0`QAqtEB_{r$Th9_Q`uwVvbk+|MFn+BzMA5Occo+HCU@(GxMj-wzkgH%W7B zNG|G1%F>G9qa-D3jR|GGO~zmagf8IPtVPl6a_5t4E%~;xZUeN0Y5{O zc5>a_RvK_4K@_MS5R&Sq`ruoDXTZd`LNEe&fTj6;^#_+)Sz60_XD_~8TC3P8i*s-6 z?LG+Fd)O2~YEdJ2`PWV@&$ zts${Jvuo!TRGM^sX@WeGw>u}A0tx@}Cn8Rx4hsS19xLtM;(RaulHIG}l-pU3F@Z>` zdd&l1?*i`6Un@}$>q1LFxZcpSvvxw97eBJOupwQ_vm5!nz2;t)*W42_pXk#{@xPy& z;+!gy%&lg6_QHi%rKL%rjz!){V(JbmcrVi1GUGmQx4bAT^XQloVH>``qBZkr4VC8w znT$+NhXn_V$3!_|osFn%<9jr17MC%&k_4P+qK?fTIl;>pA<8!49Y^ExiNouML?WMp z6A&@ZN=i!pt_g8c$fhaG0OZrLH?6XzjGQpzGAR5u0P)|=!$(ReW_z)m7xC| z54Q68+R!3%o8GWlsj@bqcf?lHucFE?sg$GLfQLodvnv{30J$0I(kiOHW=xWf$kHcKl> z1qPaksvD5T!GDQ-45)p;1w(X5fZ)+Jo*S&p4S5$q;RX=J!avylJmoHk z;nze6DKdIpM-K{@ky*vH$)Rbt%`ODOD%soFI%!3K!E^Wl)Z56vWy)xFcxlrBA>--S za{Vjn_5x2rD?;mVC8z_^)p2mu`x5U`^i>=CU*&Ag2_JvEXa9De`wbmngX0}9DJOh7 zu4&B`E+FCah%4NNqfMvpqlI?gz5+TU>RrLcN{wr7Mp40OO^yr}WdH;fmBU+3Maa!G z3sG#<{;vuj~iZ=;XKS84J*wMtO)M`hTK6{rw*2>8J(J+j76 zGRPp=1oTHVDJ%5suvAfWhlV1>J}2hGhi1oS8KWgP)_E zk>CqnG84U{#4&iRX`!34P107!mi7PrtPqADK9gA1EfZ!{^yX;QcJpOAXhq4eZuAqT z>K&%l#&aMDlURJ|`4wpreiF%iWRDc~GJ>q``VRf74{PJm*=h5#lR=cJQ<;j=mudF2 zDRR&f>q?Ep36<)-PwEGE0qmZ3i1rUpr@xTh3L(7B;;YCx~S zK0r9%0TE{afE~ZC%)LsH$PL+@D?P!^F4jQ6?=?R7M9!|=^*A|g5~5`nVH5IFcO>;{ z=a(=h1!osRV!<(ir$b0yv%K6ST{^MwWctT5(Zd6lnA4TVwQ%;xuYWNCaZNO&ASASs zAF=w$kzHc#R`IBQM$bN-)tfWkrXRgP;e^~Ulk4&htuktNjgIZ@U0mH^%E3@rka#bA zW;+Byj3yHD-yCvi%t%RLk*d@OV&$egv^U~hV2(6>Y{M8>|IKE4L}Vu3VNe%)3+oX* zD~T(4m(AaXLXq$9QT42lekC9Fwm&*eZQxWH=sp}yLe_%hLsiwKI|0+rpe%;z$C-Dh z6DuPlX+z)X%3u)r0rl>^REYR*B{XqR7-i@yrcIEH0IB)ok9#B%8jh&L?m@Ok6E$a# z!qzBptM}+x;GjO&@0Yo#wa@2E3>tVIJUN)S+xE>ve{6cDjh*|=O3Y{3ImXZ;YK8nh z3hd_b9!sSrFOn*}hknU<^Fx9V5}vr*SD<4B3}?L378VaWPb&pObFb41RFTL^soV&G zrqS!-tKde}j2h3X+836J60`E$!1`wB|w z*x?`(DHHzj*OOe-_GFwWSX@Pl=&0ww>cq=?cR{A|3Mpga>i!as`N-rcbTD1^r0+>a z7(aP6fCKaoAp9pH*ilb1Gv$KPJ$ezHr_)BIgPT-I<0PUY;n$AnYVWsz&Uxo@xa|Z zrCvM663lThfz^nf^$H6L{c*epk_*#=iOv6m5JpI30MY~0sOUuu*{2w;{Df`SJ^>56on}?d0RXPSr3o+l6fXE~12qEv5L(i~3S({l8Q>x{d!~##{y|7c z2v~8SPNwuFohT379#d1RLl@VZ=ldSLD|Zk@UQttBXnvo+n5VM%!$7Zl7#QIbK(eSV zZ`T4Sp7OjpV0|X@`lGl3y^ysOY9=@hk8ud%2Ap%Vd<%vb7aTo z&*zQ-Lo9R;*Cp17SZ|7;<(-I(0}vBqXJccaW(WF8Nt#v2j$UrS%=0!CYW7x6X%gdK zLO3u>3g5ks-;C^C6;WT;%rH~5>_*wk{=3N|tMt3Rj4bf4hTX@H=1HOC^T$epfUtKbz#P7>nr0KR?z!jq5!wrWozFp079j5jEo)Gd3pRff_1DL@rX#Q;>7xP;l z1|Q^(#qH)YU`5qsZoKSuzoVmUuc)gMzdQ80RRhkjJ))Wzac%!IbF!;@yTIbS+&1#U5FCYLy1@BL2fstD)zg{^%3y!}b z0NCV#GDzH8wMY)+|57ozYr;Azj@!!RRY3Ysf;pgNg#T)$5}$&-+jOhB&y9o#5amHEfwP-TJ*;U;&R zPA?+23ts0k0J!M-Gobl$hUbECMYp)tyWGMSA1s46pnj#`#qxGx1&j28ouJT5j7F*( zTO$uSeV66W=Z>COcsy%yho#Q`_uT#Y4f@}TC&E3-mkhiTG@8g)F?e@^!}@fb`-T$U z659xhND_Zzm9kTQLryf=a0UG7RZp_;8}q3F4oPpik7qd)Ek0OzbziD!6|~TP6~2T@ zjfYZEFGM+C0CKTU0K}inaRN?)cb*F0YplY3I>69Sv6B!=QvZ_X8~WLQ6!A5gr zyiHT99$~Ylv0tb4fvmW42M64OXVK%d8It5TiS!*_`Th=xZBoFL?HlinFx&XVA9n_Tzh4UeffaOPh}5Id8DGFGT&k6ck@xi$J$ebD%8^G`|Dzym7^Rca z`tzRsVkJ8eB7!E-$)!c|rzPJMPb|N5qjC2w9x5J3=Gv4B$3xoT<6DmED(5p`low!IyzMzFCGh|sP_Gc6%yAmI4|L&Js?#TbMIxr zTOFzJ!neH6NRAIl2BEW|@z?YmY0Nphey2ZP}I?aG+wSU*5kkCMM;J_5V7z_`SKuP*rC_j{YVbe@1UaMEKCrv$SUv< zI1&YEI04~02vT$6U32x3NBoE>BL1epsp3?+DvP6WqaQ&m65rKnIY}o3Ehm)!ip8Uk zJ$J&Fm6seX8dho5CzmF!4PcDM1tAOCNE?o~Xcuc?ko<+^E^~@movq$!RyU4zt&g;kg3(`9 zxJmgVqhP3{OKmcqcU#zlWrA@nwWX58|M+%;lE%ABfE$34draqO!UDEy5nsqFL?&EC z@gxRR#hZ}QfD?xr>rHYVX`RYDX^&e>1y(5$;WhU2lA%3hBCtU+opa1gAh&`_$?z8} zZZ+7chD0MKy!rDcL5|_~CAz7TC^uTx0!QhE2TwGm`7t8HT+SB{ipg_G-jkd&;t>>l z8G7+S*_lr=2{X*fepa!RXVDJ`jrox_PsyeW9GCkb`_n1bY$(pidqrmoe9(wvNGjQv zlR&p1kH_9jUToC2qPTDxx0~!Ru~1PqE*{^2=CiJG%m}V+v4edfSvEl)&+C9hEgrc) zp#hdEteUD44`mEt}Yx;yL&!kwOJr-CJ zKh0N0A)8~na7)`>E37rr<^rtxc|m|_T6Vm?z-sO}3hD`^uvwf=5pc#BXubS!ll%D4 zFw+!08$+|WE*ZQ{hAh^H%kqRVp$7q#+i(H!ESm2{RbNqV;6{Hj-dQ)WI@Hn^!M$S`o0%&Mkvv#w4yt z&k7q3vw+)8xZA?zt@_Nne!H`VbRcZ;G#MCh2)%<=50z)#I39qnxC~*ej0Io3B1wD0 zA*9XD!cUtL8yyW(Gi+A9=)vbv5$kU#LN>e8rEMoW`?8#!8O4cr28*+EI!4zlo;ttMfs0+_(j1XCk~-^4DzaEn^J)vyQEQI2 z%f5BIp%oPp+I^$PMyqU^BlmpF+D~(*m)w0!)lKmrl#MkaI$B%0S*pF!Eea}l!$|h_ z-1j%XDeyKKGnu%+P$1gEkMUKSUf}0)lq((Fqwwg2+7h^{wg)+Wlv)M}t|D(Jw_%?& zm6&60T?8Xh_c^~%fVv`@RJ~ur_&3vBM+4S6Mb_z>{T)AekXo0UD%x?hY3V8Myt>EC zoq72jj5A-5H7q*1r3nd(1Oa)^Y1moVB)exjC?{XPpG`2WjlJqk z{Kiv84*Vr<-RqUAI*}IG5B|4Bn#JRbY;nVm+O!2R?|A`Q43joD&i^_4#(mo^gDi_# zAsoRoV22et>4afRj;#gCe zDuap9(JIBDoLpoi1qlre4T!mlncvi>q5 zb+_|#g@0yd!D4+h>_YWe#58dme`{DdrD(KVZrWW6z9 z^Ag$ZiO^>3yDOZxKbtG|C1`iT=#k( z^*^-Xh$J&*ye}I5vx{tiJ5t{v<6cs%tv68%>Ts&U7dd7)r`Lzf1xMPrtozG1UYX7E z%Awj)HLrHrNpOTR(l{f_horj2-e(BsDw|hSijuq?ypx%;)|+(Y3WSSG%qh&7|0Lx@ znv_kfNL>KxKfN#G<6hX*r{+MLS-;jb88xN;0V{oXMr{)S4bgV5^57HyQ<1%;p7J4= zS(o7tbCO`juh9#k@`U|$T9CnIwNJ|evj8{=%R@l5*^*jr?|s_*P$|>M{k0E?ge}6b z#Ypu>@6$;!#2Y}{0EGX5K$Bw%sW~}(RZAeWM{$?}ANJAN=iTI2Gx`j^Y#R=xxE=b+ z*0sJU{t(%-Kh_WTey`G%zh0u2u=i>%aCz~(@lUVidP%YMAWYYX6DLf)FR5z-;ROQY zYo)pHyAJfzHcT<M9rB*VSql8XOcfrMwb6&h$J7m=I)_ zKJ+!^u%7$A)Xoanv?(=DY2OK`CQ*hize%b)`&{hA^MWAcdZGNS3X#Gz_Br2Lt>3VAtmjVmjgbsDZ?^I== z1TR!$R$|WdlwV3OGWbm!j`tGA&2{wYDP=c+-C#H)aVb<*MS64B%gsD30v(-} ztq2*pf&E5rP5Xbob5>VTnUuCB=?ZJbA+RFZ-nS;q-5Y$G^OF<vDPQpUg7qlKdtQ>M_d!2Tt_ICvP9pu`4QRy9p?(jAVqt~(xq}8VP zxFYpmJxRx6DA#94DnfR;vWjyF@*~m^O0j{RDcP~4zMiLML?k|47@11ree1X zGEBLtSV6HiP=l42^a?_ov>>_Iq)WF3=U2KD@~&${ro#5xsW<=06L(3<`3)tu{aP+xLXC?!9%$=Rh%^lvU!}$D>-@Pw0?kKZR zYUT;JML9r^UXae|?7V=s1&S`v3>{hq?Lm~Y_uTd{*TY&!gEKODp;1%kzC*UpKo(Kc z7?xW`PE9%vxH`oUcoK(Zx-%gYW8-_N&z?Oe+GfU7_*d;3bG5}%M=iSI-9scLXUBuq zpXkbddJhD(wD>{NnaS9R##A;Ecby+!b^5#$eC%ENq%7af zGdE)@gxp7eYh2m*@pL(8WofZ?;XS;vX3+2xxC9LyYDUh&;RQ&f|E=*J=Eoj1g?G`v zO>W(Kvhj(MfAr6&7qCILnoF{6_e`ggsbIGn2?r~bQ8D3Dven_Imdr_2gik{bvOH?T z2{QM7DQudCeBPNYd_y$Ts|^ee%2bDvejzLP!*5>H@01m^{IQj&vsTrN2QEYv-v6e7 z%k3(sh%d7r@V_ZUXC1XiFvdwcd5;K z#}+om9Wx3X=q8##^`I3VM@%@zoC21weR413lICRy?=>E8?%w_3*DupU4X&+yvawt% zTbDE+15#-XWZcIQOT2!gxL#1%tUKohX)~mI>R!f7SGe1*40J36`g(cR1&CUVwm(<+ z!TT)NQ%gasL2=sS?#i@@T5!$opncr_hn^5=9dh6#k@yOZg`%R+S)kamuG$)qM{dw$ zjL7?J!4l3PycgHSr1tgsyi9x%f5`Sk-fcgS*^BRA*g!EYD>mF&;RdPp1g`C$&5TMe zmvq+Wq2%$PcdLO7QQCb7(?++++~m}InuI3ydmNpekvE8D3rT`celT>d!gh6`-yCu5Ipl@O7W+p7#48TIbdc@IeX7LfAx#NFOQ zRv;`suun&ZoE{4jRPn{Fcb~JAS%M<LAOC8^z42hb9Tbu`SQsqLO+jC?m7o2yjCQAM-rh{nQ{?9;Zq0xAX<6kcVp<$ie&cb_eV#+G-nWZn0L!O^Q7ELfj-bLL?;C}zL3 zRD;1Ug3&^L(OPXcNvEuy69wpjMB8o{t}X zlAU)vm93Np(1zXOg-DxUBs<{3&VKOuY$c$F67J=Ot#LhJQ)e|4VN`7qP@V!6Lg}|M zkYL9v?7Mo}f^HJ!t>>+GKl*=b#%wh@{NRjaTE86zf$C_0y^mCRPPJ(P{HSU24@h&G zXnEi|GUM`bxwZf}MCx2)BjVh$Et!~NG|?mvsB+#LQvlhj4Oj-NCjY&NvQJ*iCyXX` z0)ZX^Nu#;k-uVb%KF{RG_vPYG;C{S?cKdQ~NxP5lm)UU0P%18i&x{};&nZUXcgMB+ zyjylv(hKG^ZroU7FlfWb=&Zv^2S>OB(|?jCIbmB?rKS9bQ5z)#sXd5-p(?Lg!$s!l zf!l1L|H#;*dv7_KKpti`0w^^Wo50u=jOc%7RLOkue*D5HNY1x%&6qL2#vb3g76VH8 zr@9YSOvid`Rf4Ra(R|0I7MIuPL&9+YgXMnkEFo|KS1pp-npm$OI zot5*=$LLDJE;5Cc7Pc?eP9-K5Xu%y95B4xYMnv~zuRRHOm?ZObC@{ZYc5YAPm1%7* zuLmBHeyf9d6B*aB+6|8^w!y9fM>oD625Hw}kh2R_;lGNpM>GO@zz?_qPiCQEaC2Agc#jUXc zYBn&C}+%A^IW@8m7>u7iGHW+!BUo@NKA^u>4ekf)+A}L z_Vd>9I#yP>vxANJjS-M&gISiP<66lq*r~xS+krJlMB0qn0(DWpc5d7*W9AarOmS|! z^3VDJFZk+htQ}O7-$})$+b4zj1NqBCvMcrLW`a~IGNu<&X#oxz5ao5t4d=mS5E-qs zg$jP3$bayrduKeT&(Ze`(Xvk-KS8+qCt#;_0Df*nZCS@W%W+D}xi3ALXY+n+Sg0p` znFgsX0%So1DeevRC>k3W^l__SBZ|2}Fa7iJR%~(8byGu8g9{Ci&s19iA%B;jk31fS zla>jRgSP4tbJY2l+T@mmqloTaun1|3{nc(=uDWLDFFkryYa1zj&GeiU+iljb<}Ko_ zLPAheF(Nt0$sP#5u1ai>krqLlALu3n*o_ikME-qJ5C@XOisQx0VM4|fD_pQ(gQKl! zNxF`(2Bp0xBGK=FU&(VEaFVRr9HamocKaeu8`ur(2t2zfH zD@CLuIOC{BT!OnxjHk2OkDd}JtCbQh1857u-~qIFV9+QRIHQ<3!`3HdMSf=-FhyZY zPTPWO9Zd5Y0Q`M;{v=TfFCB@GIAH+2uib-B9gLBCK6o2Cya5wSB>wioC=C#1ckV*3S^XG>dzocD$mg$>3 z)E3@)aebLML&M5+nvX3o!AQgpI`6e@41178l9v@BMbym9GM3~pJ6~_>$wRo7!n;x> zC0|`9`;>$7#p`P8d6fpjk^bwo`+W-4^z7CK$_;+-XPgRIX_tvCOqk8O>Q3~fXy zc|X@JRD8}3KC~X%8&&Wwp_Yu2;e(ZTuPUREh{%YoEM!zdQ7?>|3ue$s8F$E;Ti$LJ zyHZb2&*i|xSrQJSA}-Q$C|pgA6}$p;_`UZ)08$5Djv&9~(Ey>gs6NTt?uKS&PQMq= zTdSlv55i4m^`PMy#EL>yOF}|za!jt1 z0}G&5J;w~|ZHad^ABRSEx~!_V?^5T*w2mIT|Y~})04Q~{_wi23qqQ&J?OH_e6eo%3^o{Q}8_VM{h*lQ#Nd4a+! zOP~QmQVZ^d@Q;t6j++-rW!N-2Ds<=d>(?fF>s>kq^l?NGXd**B4O@@TSUD%PkAjk$ z6Yhv9Zu80eS*;qAo1;K-w}%CwacDEFiuE%k>pvqUMY_4lhu?%W>qC2C{-klSr#=9+ zL<)Eur;|VgcoF;>!_b0K4eq$`_b?Z0QV*Dium{ECQtns!j<211t4@KQTdd;ReJ&U2 z@|n&UdeZg({Q1)hC~t~)jEwqIu1>)6dZoHGftg5LpXvmu$kf982e$OmB1dg0mh?mW zPYVqPp1=*A5Px_%Tek=Fq$#RdsarvfQGe%kDvQ*lV$sAe+$&I0$%-p2>a(!Crr-A( zSn7Zt`y`q)pU<>pay0;`MMaIf{iSX7XOKHIAPX;uP&0~!0Q&$S@?d>7slPqU&QPCUQX2Pjt#+GMexKG%dIo@Of zh7U1lxVO8gKbRy-TIBhH$?LXX2fJiyqTgcOPcDDx8y+6sdMy?_HwSXXs+NA1Pjwh> zC-2XC7w4=;#cCV%r;n5#t(Q3wpLu{U6}e*lC{T$z)G=c$(#BAyCKQyZ>ZXMF5guEv zHDjAIC+?S18QN#eq*M6snu~qCI+io3DvBa!ad>k^2)1-JA@&+Ts84ME1~fb}mLaP| zO|63+wHo07P_p6O+3l%>Ers2uf`N@(_iGQPoUTIH11SX~B+CM-O0)lYrSuS|s!K_5D|F`YLoA?)@0=7tC zQ?<*`)T{V5C+|Cpnf~+S*@Fu<7ka7^E?a}2Q1nbq@x+l)L}@5sk{dnf95 zW-@ad!0pc;IGgSFuFy2?%~eV;aLy9hG8u{_E5W@xeq|mSRMyaYq1q>ea3fp-NY(cx zD<0e9wFT73;;J z=S${J<_T&&s1rtEa=bEuc$3Fb(NzvEB3a0g{rl3`XHJu4-8 zAjQ>S9NqcCZcPTREZ)Sv86gAtQ?m7oj-HGGD>q5=VX`!KIuXj_wLZ?xK7*E9+ljn# zPKBL5K0hD^+t)Py{8ogO8eEm(4@L$Sfu9@BHY$E+tu>Af0xPz5duTE%5A4oc-v^z{ zl*Us(ZB0rvUe`8Xw>S6CJ{2qJY5~F$A?b5Tb0dClwiswQfENRp4-?(H!yg%$m<$H@ z8<{9P05!3Dq-fYlfVV#1r3~1=w$wJ z>n``QFe`?OO6?`96H&CGRNDU3rKhm*34or zh}5=F1?GP+2%?;{Z3}xeCx^%y$S_K%#x#T2CmIa*+cc`VEE>-}`yPN=z7=FX_QQ9( z&G5_DvI?mYX_uNap^8bJQ_x;eRJ}u<0BJL@qeR*)lBb@&aV=1u&+FeS{(0o5mzXG$JfZHxhd+u&Bk6&R+masPvC5G+2f`&l;(b3ky`BW%Z}Q(Mb+2C2Elk6>E=+1I ze2;Q5mv6p-i|t^W+8e8WpEp1o*NTn5{D};GJ(#&xM4txo1Wn4+lYq$slj}Dg0A;j+ znD?*G)s3X#h};<0w@+FOmm8&t_K6J_qbs4cwQF- z>3A2NQBgUDwT-*=b8wO&L*L2Ep1)h+j-nsJ?55vak3Rw0%ZSD}SNcyAcW=MXP7>v+ zeKcMs3Xo-!RBoyqP1lV5Dz`G~3)Cj1)$OUImF$@kwgcbYp6A+()7!P09}Q3R<#a)! zZ;Z55R347{Tbyfs{>hbkgv$bPz`s-v1+;K(hK$Qk{#qd1=Vyikv>f#xT^%cOIW_iS zk~^wgDu;$B%B#E86CA?Dj?ah*P3c%TI9zU`AS`Gj&CRP!o~y=xZ8fTTf^br^bTpLg9hgOA_T2e@+7qbrvm;v4S|%Xdom<%9Cl92ixqd+a~@y2-=6k)iqpby7NBBB+QyA;pFjC3T75 z1{gwR!#l7)h;SJ=@0g%ueX#7+ewMzE9_6;9d$k_r;iWn0ig%Hr$#ohVBNQjdK3-Av zd_4rYsW6bTlUh-rLTj~kjNsTBG~xP`JMcCsgP0>5*B99}iL%#ygSm7ApG5S{3VD7n zeii0sn9q61I=vtO*b__8m#{5vz`}wt?37?{4{~`G5J%hbFy~(U~Mwpt6hly z75Tn9`L0rv2Z<(WqYR9Fr%TA&uh@{;Pdgfl`xZC&eEZ&m`N8gTPbS?w0$C^nqO!q< zbUBnzhtrW9S%!)!thNgCYwc83?1qogHP(dkVC`5fwd?1UC?#}GxFrPYA@ge^iIxGu z+k!(srF2*@Kca&Sy;Iy6S0f2LfIUS=3x%LpqvDORK6z%XGLG-U1`q6&jNX=hguvfA zPFQny#cB5ygY6h0!qux3+gh9`?p)HTd~j}G90&=T+rqSGng$7&Saxi;)tSkttuQ zU5CD8T#5q)%RA{on=V`q@PA3?oxr$UWL6kMYZW-6(y*VJXe?;=#ZalVU>>Fzfx^B{ zN`Ayub@leLo*IzMHavU-^e1WO_2U7O4AT-uVw_A$XWbRc|0w6Hej6JcKOr`vvgM3T zqG2a40LKKcb{pf8us8<#`&lmxl*nd(J(^tjW@ITu>}f!Gb4ILB)5OedK4t&~w3!fk z#GOJzaG*kppj$y^PR{C}^YYxB&DL^9;DY%}pEA7ONDY?z=>^+9I+vL6)Hu(mco4Z3 z7Y6m7WhJhe5m?nhu|1XjT432WGjGoQ@`J5Ad^4%@H@Pm^%x@{RS6mnu{S@iE5lCsZ z_IUaNBkS|4!6!DI$?;+|QR%O`h+)z~S3tctpf)WoE_MPr@^Sfyc)T0-g!OY>d(%y< z`Rv_W1uub2ym#D#e)S@RjIL%Rt;{dWmA2#}Zo8LB^L&f{9p}vG@U7C6-sQ$?^0y1U zRNN=cUj#L=_k!M9U6dgt2*~Xr#>w{S=6XGxkqFk`zZVuVfwCn$Pbscb*)JaN5XOd8 zIjL88NrPoodNtKCV@Bvv+z#6ODqiTorFWIv64=FnEZi!QEGH8@ek_N=_Z^aQ@mLNZ zh;B_9_RHvT@RKA-)rOy7X=XP3QVXQtsel5Z$UM*E{xm^me-JD&)I_ z7}DXQq9x?Z-0kpX@b2LKyF!4X8k6NZ1KhwrMOIG?mjK>>zB1jE2b&}-WFy*r^77B! z7x}*h-#y{`jB{dB2Ij!Lb8^j!RHn!Y$RQvO`4P7i16dS(^Ba;xvQ%B1#5gU&I^$k( zZS(=;b>jN1pEtC$f&knHu;!h6eKz&K0Nh!e-gCFyM0%Xl!goLZnE3e?pHN_m%4{&dZ_XT`%~aDIw^^x!@aZu(8FEX>Sm zxwp-L7W72P;>#+(Ns=<~uY>S_HkD%uiq_m^-M~v@9Ye4(e)x1sKab~(jE64oB z@h!GWkhIRa1Hkm=9TBP^dPyAiP)!o$Xo-=a%RinTRZ75HoRm|G>ZdW>A@G8b6~%Eq z53pLT+qZ|J!XTCH?`+sCP&J|C-62{$StYf-`ST6sd{_;Avj+J+GRZLIJQ55?`2Etk z339G53IY@~NLp3k=qoa;37{SP7962GHtlNXnanK`B}z9jfD0x>l443e%Pvk4k>G}q zlmao8U&P~iPEumh6SNWG(S2cti164HQn~hlu~iayUJrDAjNW@PbLb5{COsC|KnlOy z_zpD2p1r~Z1zIGBDeZ}!-1nr_lbOA9kSjqs;Bc?Wl=1WYgr8aKRi&r@Fxq4Yt6S|{ zyj=*1PUv-%h!GyIMD?gIG=%Io37~v8_ut-Br#r|X#^Y1xz78Id zeh2MOJtAD&eOK-I=UEHk^7!S71am9AO%s7 zsC;RtG75xO08IQ@>7e&z+}+yxgK{MC1)#1mc?C3QDznnt+#~Oh$!}wM->ER4VbKpR`-Mke`xXHJzp&?tVA}DaxnQ}#L zwc$EkxA5OFpU8s1`f$|B{5;KW$mZgZ?f4dPC_ija5^}fdza`!6`0|Br7X?DyfA4`b zaL^cq6&K>rouR6x))u|TfN<}+FK5_s6TFD015|C$sDnwnk1nwI)hjyN^k>_ut_AU7elOT(lDpKE5d_p(hql1Of3PkNTg06y^)MvJ=NHq+&a6 zg8GG06wRO;6bRwJjV4ZYG+7K39^MR!{NnuOuO;0sF$TWXHsFN=eUSu3MP0EULG{Jh z*jQ7jF+`y&RkYcuilSj)3J2VhpO`Rx%$=m??aqJ~k=$BJfzuF}Gtpb{v^dbDjG@jI z+A2)Zy%O{N`z^pZE`$6AwM8{xll}_i>t^vtI+7Zdz;861#1|2@aGet##FmD6?V!f% zSurvGEmT)m7ij3o5atg!9B7e>F7< zV439Dyp)RLLH>8h(7xu48+SqJlk3WnpbHgfB3Tde3qTzd(BVwk!C@A?4(#gSD!Zw# z|LJ^beG}+I6FE*(Me?iCdKE<@e~lP@7fhY*8L2i|Y3~-@>+6HZRy)1UxU8ly|GXicyh^57y^7pxsA*wL|#~*S$uv+oH zG6c$CK90b(os*NxWIb>Eh=!dazLGpY*GytE&g^i*#}J~NAd{Wbw^-#BNO|hXxa6!{ zZSkj4WdY0j->LM0Myay67MABS?svZ3MdX){EP!rpFmlL7Dc1YX*i}%qj4(OX{ zOm9GKfNgq?|B!;_f8NJ5b96NVHk$|8j_GOt57Bh|xEIr!dG24_J!4J8;v+oPKu{bq zi9njjZ?2o|IaiU+F3O9H^Ec6|L-ZR z{+6+^vHbsidV%Z?kW=K`KL5|0$?0ccczt8z%?ZHQ|HI?Eg0%kC;0|ChfLot|{#|;D z3eDFxRx}+3?4v|VsWL} z3ee9hFEM8U9ZML2!?+!K*P2wEF`XX4AuAJ~rbKQ*ye}1A!_?k9PQFii%CJM@LnzZZ zJ0UYPhk)H-9JGcYWh^sRiqJR(3iJ9KFNN?T%K%B8{y~wda^Z|mTCCVS{4^M!SthLM zjA`PO(6Gk=!#e-8E2%L}F8Ob0>AAtr2JGjKr=`+9=ymsZC`j__{NN{YQvS86Cs zsK>JTS(P~p{_rIBx_b1W?c8Q1;p?`T*Q=K=0DG8~J4$A8el z<7Qmo4=y@>M!At&^~jBBeg?U?TlL#G+9>7j#1mrPWMag<-7XUkbtkK7>l6qG6$3qt z@%*8u$Lly-gSKAyuduyZRs!~a1{LF$P;H2c(I z`nym`z;=`9j{S4zF~zt8G)N=E4ah+39%hb?bMNt#5AP-4`g<27Bk9=VLgk`MaYdyh zg=wj&#^j2!b{S@WuS}*GIRd3!OD|5IG|L4f>ExDcKDIV9`jDLQNmEVT@V%Bcr=Wb{$8|q zU9J9oN-w{}q)#@;RAwq&umhRLvQ{F*o8RtA9jWQ@Pn&#LQ7k!@*IL8_`QgJ4R!9&n z8w!!)F=zHRU@~CY_y-@zsGLu)0M6HP!R`kJntn3^z{XPf*z?o%Tt1)7jY{Glh}<>b zZOW?rit#fw+9kkOqv@b^chXH*T=UO;ODrE258xL`g_*s9MKMWx!UjRx21Smq_zM#* zua<93ejAtfG4ASufk$CI|O z+-dqiWDT?g=RZIlNC?aWNbc<=BvzqPamee4m#KC=P?Wr}FRw9f!IUW3z{DX{;A0^$ z#t9PCCHQ#4pNLcqtGq*A1o)32%d*SKenJ)ZHhmd5lRqeyL&>YF-dSJ zR>0W0p=RrldVf*nuNbGoEdAw!nirIMe@Ww?M=i|V*=PTGB-M+cW`G91s(0u&~iyW2D?X(nb_N9lsls1rnm*{T3Y}4b8aZE-T!j> zae-5AiDD`p(V0`UOcIkb+eZgmppHheY^(D`#UrnvY?Re3croGvr`{*(2|$N99!nX| z3hl(PBWe6E@?BS(V8!_%!UU#Pasy8;CyI&N?N3WOPcHv67#!5mAn~;fcul^|v&w0G z`Z3=^c;=CSafvJskKdL<{rc$Kab?U8!7l%24k?EMxW76kiE<+$qQ9pf!gqJ>u>OUz8a7L+6JFg(mP0lGOF-X7zdzFe zF|V>?r|{edT_OT@7BKnW&`Ki=GEqA&@sd{@MY-<~J&R&QXdR|dsxY_mV0{RL179)+ zvMT(F1DV)%xJIKB_5^{@OT&I3e8mo!21Ak`#owohrwtQPADVe7Ui~*EB)#j{9SUQ{ z_0enA`GkdT^h2BKA%?7Lzu`s`+q537;z@dj#EhUnbr^mLNLbR^h4hB{PyyY~<8ibt zFRu^}M9}62jE|lPzDgNe7pfFN#lCH|cRxCF!$aZAY6*oV{-np8Py}ru!Blu;_l&Eg zz>kNA2slwTxxnm=qZ*Nd749~M&||jaZ|0D|$>eS2bF{)J)sQ%X)M^bi1AB74x|F&2 za9F%PR6R#$n@RnGSeOFnNbO?k)a+y1_bv^u5VkH7Y+qRX!pxc;bVK3%?@mvVwhcaE z>h@rAU3paAJyKqK^C&6CPRfcBAMj{48_&IlcD#>i8C1Ubo#Z#Pxgs~NtR^2t8=9-? z$bAH$=ia$wA>vKz!l(#@4E_2jWJO~If+9rP)bef7!fr|jWA-6 zFAzQNvrlk8cICCnbSF{bu~!1q`8@)8+-7n)9PQ<5w%Tnfk#RAm_g4h5_pm~QE%yoM zkNy&=>xn-I0XGoDLg(iAV;S`xX^S^(326>pVZ;};~ z(oZ2uVOS$;0KE9BXF^XNlcva+|M)=7kx>9#Cn_q%cy3&BlWIO8vQdC$We|%onW7qT zS>;dh;aQO!K2eR6XDvC}tx&O*#F`mXSdq87mTXb5)#q*FJw8!8p+Mv|2P!p(fzT+5 zjyTGLV%C~~ioYLFgOpj9Gw!=v3du#mQQQ*Dq8127Os&A{tF;8Hv#3krsKTQf0OhNk zP3Euno>R+5I#9V+tt|M|Qdm&!&r!t>v-N>IGE{F6S^qAz!?R^8GQyS4_Khz6ajy$tDJ*c9 zj-koh`(Fk78SLUKbSTA7v9YHSL(M^uWiEd_GaPv9IKroPnNQWEzk*?sZXrFG1AX7B zICgUAY5b+eH#p(d@~9E!<6o77a&^Bw#_4j5)R!D>C}kQlkC#_iG>V4;f0l1Y5E`z} zZSn_6HML?mg0tiO={c3+zDxf-ELL}z2}uq}@`p|3@<}sWIsC%0^ARp4N#g}aJ$l8s z1g3yN$XIQcJtle6>pZAvq&|OcGngQK@x`@qB2D)Vf;32~F)Pfm_coIbPikq94o{~b zBsE6+RxcfUZ=mS*y-&ONV`+U58HRov|Nr6gQO$#nKbt;SNZo&&+M=nYBm&2Ty{MKm zJ;#k^6cM)&0*Qt^@X6F8JlN+yRXU@PI%m_&^ws-gBPrgVxk*(%D&Cz8qxm#W^9TWp zA#{Fx{bS2h9_PxGZmfLd@Tc$Kx5*RklqBJDZ=>_-r#D+r|g&Vp0zOCOA;8EfVC+_ENz7m zGIal;rO3KZN{pEFxSP@>kkFqG70nm-OF7@t8s`%liqwY&MMMNF9&t-3Ui!Sy$ZpdS zEo6b9vofhT!ufJk=#N8OQ;B5xN~hOIf*1XA03Gmbf2ZnEmoP9oydGG1;4u0@r?oSv zRzj9dJ>DEmP`L=m!HT_j0+G9FEPq%Fk11KxCz&8Te5FZxqFDdpuo*WWqEc0X=~Fp* zWPA(*J4i3o0J-%9!9QkfnAVyBRav;*pVmKcK{eWCV(|vzn&W- z#Jj8FG)|L3Fut5e9!wk(isTmTHb{=Mb}Gzp^k9YImCw@l@uR#tM_{`voYjvKJ0?vZ zxG#?=VV<&l9rTWxjx!llG4MTU`_%PH=uzQELFQ6H%OyFpB5ysT8kjVJkW3?D?HyVE zmoc_z3qeJ}*S(GBQYYTVJteM7oBAxeFMkw?2koWfB-KA&LmmIEpPbm)&JlbS@r5G5 znfK_TFcCu;M=c5DC{c})Sga5NWk(M7ZX!AAL~uH)+@H5>S>d1vF%j#TKVC*J;0b$6 z6kjQv4lq3wcSuqxT@2{6nts#HY5JSPVQv(5LwbC?__Adi2GTN@aGEHWV>*nZ} zx}PbJy=+}V_(=cA?cniQ<-=kzDs~rqvD~z)urkkdk84-o_>*GNX(Qqs|IRANe97rk vnl+M)HBApmMwzCBBy%SIkmlrUBk+@WwL7b}3tR{$0sk~rbyeOgTR;4N8Jf&| delta 35380 zcma&OWmHw&7dI*(pri=Wp@c|xmz08%64Kq>4I89H8l>aU-5}lFA<`|<-3{;J`M>we zyEnsfeQosJuf&LfPn2ZR?a49qNwES$XTY`ko2bj;k*m`^$XzduxZ z%1dczV8p^~pr^;cqRV2$z|N)1&A`pf#=&5~sn5p3smp1^sc%qO`E(8S|JO64)1Gr+ zbAmVjf4@Kdvwq)UteRmgxWDsHa|Luy;;Q!H7~%T{1OM&A)%@Fs|Mec~Sf$0R!h9HJ zH~rIKFi@?rhJru$K2JCvSHy(I4@2^GL(&4hWV1o^uGQ?@nV;xeN$^BbPu~2D@O$~A zTznIs8EKwsCU(NzdVKhzC&VDM--I%ho$a^1b{wO+!f>+di0j9VgqpUlrIxGRdwh2y z4&JEf)t#NpE#!yF%&npeND--Byr@7PHQ@XA?-CvXA<+G;wf5z!`-!F+_yGiGvNoYK z_dzRpmW)pyS)_6#FV2m(F8@)}`n<9&>rq0%CkKxsBKAeZdqctzGJCWx`l5fDLC}gw zVc6eGr1SmkE77m_&!<{rxn~TSOVZ9J6_*lBvf%?9i}PdvS5&-h35G*-q9;X5NE?h=v6oK>>HIhO|g6 zsT&V6Hw;|L@RGJ(Qm>fBz~gV<26WS|w@j~tT}Jw_ybu4H<1m6Tjr2k1psAH{x$9ub zuF{SDME)0v76MhOl4xtO1pI_jxlCaignzP@# z1s=M*A2M!vgnV4MiccXL;gKJ?u(&lX<57t*@sLS#|>~4mL?=87hMxm<1%V+ulo?*@>wPp zEJm}qEE*dabXp=_g1f@(P3Hq4$b=rQYa=%!-)`M-!AO2Z7aEC=g?rQK-Rn@kZC0+m zSpG;}PBXrfeG)0;=nNg5FxVH(-es3%96QOOei$^hw$81qODHK}L_$K!sAqy?a-*}d zD8DEuNXp9gY&mQ{36iQ1j!%!{ zMs#`Ra(2?r?j%qW(zT&*dJwV54AnK)9Liy-?t(pBs4KK zZQD5MlA+q%$t*1mkByB@Z-wOL*D_PeyGLn21J6J%*Ah2pVsKNyLSrgVGot;8r%;d691YT-qGh-Lu)5v z3Ywy;=u`K<`JGNZ?b$UPkixQC?(>5c9XQz8ZT|H}+8#J_6Ho7*L#iz=o=@Od|58(} zwjki);o+7XBuSTuqWsIPpHpPOske%+|og)*^$&#Z-)9~Oq;7@7E? z75|Ed0C`1^<6d~Ca$#^9*&^)2=MO_aGPL3Fx=wu(^zdl3ow+Q9ZnnnnobT;QWP5HL zbj8=Gks*214>(F+zd{O{nj{YDc6O|)s;d9~{fmf*crkIe19oUlO&oX=HFfnP7yc(M zOA^_cINFb>7ai2_z{_bfkF7}YBXK6 zs=E4%hDH$r0kSq_Z}Nq72Agy~_9d>35{}kQc04A2v<$9bJ(PM&lmfd~q&m?r4v!0X z$neIZ8X6iBULoh;hA^pLnNMwd z_cxY~baaTTsS(nBEeXlL=I2JDpr#I78;BeK{aeJ*@l4Ls%F3#H&#BVu&W%Jaa+6o+ zN2#aQPpu0?D2-5s9S=k2VZX-Y>QHH9<%A)Ldc(qT86TrOk94GYcvuE3JkV>Tzh7^m z-jT(Tg*8eS9|X##{W-OqiVC-bJ6JO^Cg~sH7}vtgOkdGJ4D`EHaH-d4JF6LjFo)lg z^lDY_Hk*jKZQdg*QP#6&T+VKdxs0{{=%;vZ3N?~(%ZehLO=;Zi#A0g6^Mtn}zBgUQ zr_~YrEGvs?XlN+fLQO?gZnxH7OAum&j}(l@WVH1=TeRlauV4PeAIVwcc1{j$B7gqu zEKn-^TOi1!TH$9n5cWV~VQGoZ6DB5R0Mf~)me|Aq18wxW64o?p)14o)m{O|6J`$G1 z11WPWw#JKVYHBJfDxwve>(k{A!1on9&!IUKl#+9-3-N4nhr~vyNRcoBBQ7i~uyb<$o}T7*fRc3ai`0J6ZX?v?p6SY|d>>fLNKc15#I&anLd_5Jz!uB6swK~hk$~|jcbA>G_ldUeQ*F%uEDCo+;;c)bC&2( zCxz5_KSZU1{)GeyLXAR0iDH<}oWI0ny5SkW-^tAFoVbdOkH_y5OqYd=L)hrtK02zZ z8a+PHzArYOQ=n?~z{DFt4x4$WhOGY*R8bQXleFq;r~bL#{{D=-ymuw)jNM;AB~wzG z$YLA}s8pe+*R229*vOw^5}oGAoOAZkVOH}7EJvl8~xECttbnbovJAIFr!e&4~gNk?-hBA9TL z6$SIWS)dfmwsWWc{{Ea(WUe=Fe2R+bkB^UScvI}FLmIW1KryKTYhPFp$gcP#BVz*fSQq*l(e`n{2=ukVCug|d?YX9!g`phrnvkw`(lP7B@CD&mBs4zV}?%wd-PeCu6sWiqEgtaVi zf*{AxeT_;?ENBl(%Yky9Kdnir5=%0b9addS3vZl850kzcUliBf!Czb1^Y)g zZ>eU{O0+FE2K~p0stK5G2xu0pq7Rx_nD+%A#)FT8WW!>Hf3wQh`thvqMfAOjiu_fV9OmfjgXd^1o6-^zIvoM%(|ag?A~`Sj zj+#Ahn5CmZiwDu=P*Ef|yA-zu89|+F^KJVCt#@F6f`uir$^8OjVk0&dx1zFAi5trx z(dOX|-dva~)ZGXf*87j+PIEW4eyR{S<-~%P`Cn7whH>HM zKS-kYC$YgoOr3jM{-hTC6F!|3KM_|^%w1I`CoxHwTgYz#F#_65+Ak?0jH!;3$! zww4RS>Hh%RbaQ(fK1^0LKR7ZWIx+E+ygb&&a8l5JDk{Ffi7LWY6+!#@9LGqa=2!Xn zBZ_YxZ*Sd3o|J};-5DvQ#<1Z|PbcHu*Q|m~c7iv@4V8y-5j8bxZ0LT~Kdi1HIT_tz zt+Nz`$JMvm+c0qP7+qmKN{le^r%Ylo3V#3X)ue$M&pb;#A_Y^Qj_K@RIFYM!Cq5nw zdT!0-zDlkGwqvt=WyU7la&W;B%bE|!9WET^ob>E$!_9}8nVD@-e$?ZWllT5)l1+{gIl6*N!=w_DNQe6743Dfxo>hu z8ckZmqiZf7QcK1S=h9;4CFMeHBlR}R8%xC4cw_Xz-p)?(b!96vnw_0p0F(o-+!~RP zH&RzuM;oD9@c6%|0-Up>BaMz&>rz;~YdL3a!`QI{Dp!fE98Q~cR}EuzIqO3E0cP#D zW`C%BQdGF2?Ivz^qth#3=Y3KfGDaQGtm`dDnBx`q+ac15E5z>Ly<&{&7vNW zDTeQyj7?eL*eCtc@TY}Pn`E7Gg|Q8@n`2Elf~8>pY@-8O2nIe0!rK<1;xV5`HFrYdu@hPN&jw#B^=Q+zYHVVI;nu_#;-Q*wS{jnAK2TWB0}p@xywTkpgZK14iKLC35;eHaynE1~;cia`4=qvX7MSl;6^> zJ>psZhzxtJ;liLs6=uH_bFE<$#iqKmwvKl9rVlpP4MCVyO<(CntxMV9D;&mTPT!a< z+^9Vy+>WI^^M8DN^DC>l)|iKoyQYf=o4XbJY2tj-NEdV$sPU$wOJZU{a9?Qi@4hD^ zp}W4@%l0KW=N*ODX8Rb#zGYjbyTq$b4S|#K_>J7oyeTU5xKRK}{nb%|t=yO-CORsu zJA0Di<3B4H@jc__;ZZ$vO?A!rEv+eg*tHr%xA%|AA0p-dy0>z1qp8ARvtWk2!H9Ce z`g+9FW)1qp=e);rpDn8y9&Xt)uc2WOe(5DMVQ_9w&T#j(#lzYA_`a3WvZoC zyJWm|&-a>?jE|_%qSTI!S&!Zwl&dZ^Odc8Efw+;u*6jeT=!SEogAIeGvE^)i9dFqp z+4z`Mc2&@~j6n7@_=qfvcoGiof5fzL2BR93CD{6k`ET;bMrLJYG#GqlXJ_Bu1~Ajm z1c6q}%ErcFqDhIgV-JSh;^Ja3(g!HPDl04d1_u?nhIxk9d~<1id)PE8{tPFezP&KM zb-ua7TO@@&Jggw0d9&e7=k0M`&5f;YtVMqmNUoU<>v%bHmmFpTme)iYy>#FVp=(xA z&!JBmtJj)H9u}-TS5`?j({=x4tXPY`zov$HKv%K)-G(V&CazD^u*B3qSlDn+kd)Tm zwnGisG%OyCpvO!ZX94jaJoS!(u5u&dypoE%t3`#ZV(WJWt@nY`zv~{E~M#q^6{CxWDQ{(Q2pW^_!Cu#KHQ(s3_Wf^T9L(lW+ zt>qXu%+f!uB37l@OaCU^FgI{Ml+a6!3#m_*H6Q z#<@eecW~h*EcsbOiZ~YC1DvEz-v=1ra;=HzN>YO4HysO-<=Oj*VxSu_f#>v+nZ|3r|KcC4G64U&up%8V{9{Xiyz*D5gx51)= z6@Ny}k8Kj%+gWh6u(e7~Y`WpqJC(;ucFv9*vXdmv`A-uL!56<&adF@FtTQiw7Lp5Y zPBuIY`S^5;nS#*gfdNzjvjQTy*6$QxPVz;@M1qE_5bsshkQyYpQ-&kv@ONbCHM#tW0&aA)<#rMN$Dx78 z!ny-54J|D>1qH?KURHKCdNEWsH#+*>&~QyIE@XCA4Ge0kzsz1K7b^KPvihD~Ew}j! zpYedr2-d~Q*72a8keVvv=Ege^%a92eg3OQMV5$L0?&jvE(&YAQ+dg@2?&Un<`X7(E zkdjR1$XzjCg%it0HK_5Io@}u5pX^Jq8`r#{9un&_%uvls1s=%b{GZqlHU=!$TbG-w z#b=HRZrQ^f!vRMP)RujfQ6_9I>D|81(Og!3xyg#bf5;v9w`X(^LbB?d*kmzW8MXa= zA&3$XW(WDI@&<_aN^dAKR{r*Yguak+7ER3I!~lS?!g{GWEjSXOar@tr)Y7yXAwOZT zkv?h|@gL&`sHrIh%w}f1l92?z$Hv-H1>C{Z)*nMRQ)|1L)!rom*cXe%MjjKaw)1nR zMb8UO&=|Npj<|K^QMYHXG^&GJ>fO5NV%oe)%1#^9i?xt zhPCxJ`d^)=!Hv7Cd)(Hw4-tiGEn1ydv`h@FU_fMN0?m@r*>gLbJhLqJ_DiH&r(>%@ zclGk1L8&ie+-kZRxDopB!5i{gnzenm1*0(l@;aO9lEGafwzfxA-@0s^8d4r7>f~f8 zL&NL`-@=+Wkl7Vh3%vBWhH{Y-Tl@P)5BGP%XRc@46XPhj6gwvXs!PbotZ$BGLZWA` z;Fpi1_Zg4O#2J#dgiP+v53J2<{U_rDU3_+A+wPv&f<{^8ljhHU1#}pYk?niQ#LgjK zkT{I*kqTiYE12jj>DacQ^C)Yfgh+2WCGop)bH{UABAH@<;b|p+Bdkmf9jS42C9%#F zHirzb=lZEk)C?-Y#h;>g+Ys{obM)I(yPQs;^}p#7mU57#UVP8$3gB-<@hHH`9Cs$g z={3-5blTvROEd@^-mts)kdw11z_=`?UzFQmImrLAdDGR^1vsDHNDAI(wgsl0@Fw@= za0+bPucwL6AM$$%$}xvL*Rw7vZ9>|{gGJEtQg>H-=0>(arm;Zl2fW|D8;ldG5ndeclf*BktAEIh$PsFcR(utQg$_GOVx z2jRy~(#PO$2g8#!svQ_M?zk7OXe%-sP7kW0Ml*OEKSky%;IH*uF7sZ1cPjLmc#?~5 zmx2o*bFb|0i{|lX1hNxF@5~SdeQ;M%r`Rs1>ZS>{AapvN&OAVeJ{B@B?O$dSMf6!Q zad985t(nfw&YlqS*!f}0^2_^*iRYwORpI|^GtdNbt;|9%mx>7{?{Agt#4A@|hI}d-DxS#Roto|1Y zm1tA1sqpAd^AdKKJ>c_pQ4p{?O%}Z?KsNJMS0sP45DNM4>$8>Him%~waFfE{E|3_V zsP}XQ<3&eAJZWuh1)(P7qhclLXduGH#f^%I;V>_4GU$s+yPh8%O+$ETOzs&;%*l2; z8g0UsQw38ELc*gjw{3el=clVn8%_q93*}ODVMxBIF6Xzr9iR=iz3suj9orJXezS^y zh`wyzsvFb$E)c=+Bs2j94+Wp4pt925#LAIZo&;{FwM4ou46B#wTld+-h@bwB-pN(8KLsc9rB^yCxc$>RtTV^`)bgeKgfP@jQkG(~k@suYh&qef+h3DY5?4abRdY(7ORLhBtU z!z7hQ-$2=75rlQksI$m8)G$7orqy=k* ztFdJev+{yY06q60y`*4<;Ud`~FP?0GHVE;kuZX}=AUQfaV@m4-nSnUQnh)8~*ckJ! zB@@aNMgC|&_}JC`A6ewRfkQ+NCD`h~vKxvo#xM8GW?7KRN&$wSZmvW^10mYI)t%Ba z`zrgt@4qbUt-4!d9F{@{tNw%|KhN2SbGEEQ@ef5*8^S;KFVsFV3rT?kx8^zqRD|=@ zZEYKzRArQor%uR?_md$9%`ERfw?HBv(4K~JfeUYW=7BWLiMe>pxy%M4r%exL75!>$ z4b3b)sjpwBMjtW-1S~{E+U2-tYUYMoTi+`pgiADT?e0Dj&ePKUdrsp^OJozR6f5d+ zujYr=&ybkNv<#z2viCnS+}(2!iR|gu-duqz5)AJflZm!&SsalzCxMd7M>)+7E1v@- z|A-H28+%~xPU)6vH>yjknb}KOBd7q-YK22OE~PzLOotC0B+Y4Ue`SdsqYVN-$Ih~# zJ#Y%O%(QFM&Nr&;JXf(v36xbiQm^ zxkxzFD-Ik8WLW1+(kePzCOY@O{oyb$8X^@WZ3ou zqv~o}YmH!HVXKpP=jR3X@&N~FD*tv)y0cv|Dgee1b%@IzPD9(7IdRcQ^>HT_*DI2? z8{V0z2m(w3fmUA*x*w@e7?Bv^8DD!*pR*p-sPLonzZ%j3*Pf}t2<{3A#>YPw#x802 zXoTc1Q&$|{;p4;5(5%rzVG?8xGCfzpi)|&rLK($m@ z9D#O}=S=rcY|Hj85nV0A!`(4!MfQ8PrBJ6zs%2e;kP&(fm~PQ;QMVXKjS-Kc?Td-` zPD4@fsn^7u%4*zk18QnL?OU`E89N`I-sS^*>-t`D*;qcg(cdf$=N%Y#=dnKX<*?wh zbngf(RuiHI>!L3OuH3vOFBoBUAJ#CTfQD>u$(t-&|Mg{73SsUpg}Hq*`tivgUl?yc zdO@u zMlN2+!@{n2ocuxs>r1p@b>g}M`=o2BRBqOj)t@l#zoZ81Jw<8EQKLyPituybm%55da0q+*7gpoqFOe7*;vy_iYs6w+hc_8B%Sf;Kb4mW z&h@*a6k%7-`c=Z75LFZx4L}vYH&{%!*|wZ+dNfbnq}=B3kMNtUqDjMp=5`K-9nag# zjYA2ma=Sh+e9t#us`*2TQ=gMrKJw4`Mq}4J<%;RqqUF)?oF}7|+Q#b<9!RhStSo#P zHhFddQfKl>?vo@R>DH)sdy_0Wc!zHf-2mqGQDORs7=n*&zQl|H4SOT#l;^d57CTeT zSo=ohq?L!>?CqH~KU9FW^K;7i*;fTvAH`Z5-X5TEG|Da0fuTEm3-W727si7JI3>x;YH)V=E?WHDm$-*Oz%A=t z?LV~(V=y<*OF^_HuAt}^Ox#+-6yJl!F(G!BI)F5}+%@N&zWEONCDc8!AUbU6KFn8U zK=QCi(I0$O4DcL9alzcjneV2yAdWI-erinnixAffc4forUF$Qui)OgyT0<{c6s+1- zNbnHhJ)jH7)1IlI;lN+LCyhYNLZI=+#=mWKMDTpiH40Y+ANn3a4nYwv22{%!+XvU| z@ZIUZ4!l4lM7U)e6>~q^RY^kpNV&LuqT(odrkZ1>6yRT|JniZ-U2}>&+jzUX2WO=L zt){(WsQCIjMpMwMWvOcg%Qv=EP1o4)I|tQYaKZUi{cP<1jF-lLW|Q&im})Yy81+_u z>GL}%!pG1)M+}LN`}vdo^kIL0KW{%6a2UBgLgNWtdSi$|y_8hc)P;hdJ2fi?Wi(59 z*qi8DS1`yPepSNEmHDO#)8V@23i;ZGlB$IXzeg^F5*PSLXwx&0F z?(Q=`&S28zzI{^A_ea@DGe)yH9Tx|I+gjdbe1ACW2D3hIkH9@~#-9dh3WrZIQVdRC zuy1IHWLria$X_w2QK_k61`6X{dU2STJou zaJl@6?-hv_;m0Cntq22~iBFzL-{HF(^?`<8Yx4#ukwo>}5>irVgii#cfhOVGyr)rX zlaBGDmwnq_SNBbfk18@9E$#oF0fDEesVTxXdJCDQjD?u63~J$c-wSeR86Sg|}aezk5yP34<02n~87L#&mb#8jZ5m3yT?uo9p}Z zryT~O!^EIc=H1=>0Wd^B#D9bmXFF3Pmpe|*&i0$5>1lVP77!cxcqJfN9s$wz35X2O ziXXO7wjde53$uxk(M~W*P}tfQu3!_3&pBN5*KPjB@!iafj$rq1svq`nRU)m{{D@I= znaYNy)m|M{!*n$zRF|W&%V)^tA}m&-sZEOfK_YwW;?rw4C*R#%=qJ7f%G~3X7!Je^ zO`D%Xr>9T-QFF&7b#>D*0wkXP5BoPb9{{ll0J(uUCfL}u$8xJr+I6GJ7&%FZD>+5m zvghZ$Mr)c{Pr0ep%;u@A0mI*9_@T)r91@QBIFtnR64g32CPLyMX@@_5{;UtUK1C%Z zxY5y3?~x7tt{<{8?En`PLU{Wo0jb1Pv7OC(_c=Ak8W~u8zN-t$?C{ zZdS*P=KJ@ro@4flpfd4b+!edJywXy#f)P(o&mxs_@{BWA7ihpA2;i!fAI?<8jKmSBX(M6NPW1xY3*}uf^&w$3}%+U3tK> z;}uA{gy2f29*qrvM*+gFoIE5i?Byj0Y#Wp;EG)Y^N4dvv;B}Uh5*7?v&A%+^e_29s zS8oKYO&84-PzPCcWiYG1wthzl&@D6Qdzmal9f(QR%`OedQ1C@gPENr88~|lA?R?3P z?@?Wi#L)OkVhDuz?d}g6a)rVXadB~=*wWI{25j4lL*j@N6BEEl@O^i8SMooF5HQ3a zCpG}@kuNw90V<)3QKz1B;H(F+8PW3H=RFS-B@Y?RZH_xUs~dGs_S0(sINZLqfsrwH zOvPfZ2BskU%R}9$ z=xET6s99LBl7>D2R5FVA?6QSsZ*x-zJpNPzjSJjv(`h^oa#jIXS650ZDtRp}Qbiaj zJb8I}uc@f0imvCEmV_W9PpxK;y6s9d*QPc;S`D-dp!gKBG9>@Ru8R%1!KhV<(M>5A z-|%?5n|FQ)#`8UdOs1FG`M!YzXjZBlItr<3COO!QUKQ>-CS!uZaAYb*8$VuUB5Z-W z`;Lw-sa!d@3_f>i0PuP?bsF@5Tp#SQ5L#dNsesFy*iDld;LC@26l126|v z!MoG~4~A;JL;iMU$gxzmdwUPR=2nnOt4rqCK&29?lcKw~-}k_f9Kq-ZPh;=Qlyts+ z=LTu7b7=UJ^*-XSHPDb6K4Lb2rVy&JaTFT@HbmM{vM-1<4Lv<2A0JWfcu?2N z1k+ZKY+wgJrmunm+xGPa;K~5@57~CRcJmEH#z1FgRi~G#woy(`L7!0u43Gs@V)5Xr zZ;l|DyINzT$|{E1*}_v&UiSANzO_L#SN1zm8gLXcYwPR4;Uo>b3qWXbaB%Pwu<2j1 ziHM022ZkF{Q&U>0$ae!k%m&7$^>riASAdlcrsz35Jp7iAPyI~wN#6FkZQ0OASdW2l zg+I1^5%E^?r3dfqR>zvJb7JG4vrCCGf}*}EfPjy`ssSx9knscb3o?G4@n#i3#)lb> z_i=QMr7&si{lyKv1=Znr)u&8a9bJd0t2IeY$t}|m!OYUq2vFO9v*5MN;Sn?L;$BMF!f)WrmJhzS z=1oGxrBqjmuz+-T^!P@U8eH=%bWC2{|3+oKM^`a@!OVgq9cwxMY6pk9WO^Z@bdWGt%EP#b*-$@x-ox)z|AT{l*ADi+(DTWYlZ2%|`u- z5y`PmO3V7tX0m-WPJonb*W&Q-gKrYRGn$OiPm_dG$Au6^^AXR>5WdC@7<|nP6y4KG zbd#=Mcq{1yxRWx*x$Yc(x}eGF#x%6Y7sKE~T3cHa)@P*0MFr_gNk?a{d_Khtp#h7P z6o?*Zd88-=K(YeHoOFL_G8!@+9Tmee)n#o?UezQHzP@q2R@dM?97^@et^MZo2$p3I z*IEnjIhlAq{dFAX_0cX#Bcrzo2??}lkvwuR;~mV(L3BZEuPS$MQOitq+HOJ^Gw!&7 zV(k-`%CXNi?%vQ`vIMs_B=*(evU|Qo8(EDthmaL`4i5ODG4TNPa>H%Da(QuJdSrLt z1E+TV?V@GM((aF?UDbHcc#M_IVEIv`9`co>K5{5VT%UHoCYUWr1tv_%6rHYJiWfT& zkkL!j)|Q+6S1ww(d};`rc1@4I{4@eo&O_3XME6gdcK;#x9Rvt(?e6YQRACEK?U$L7 zqF~3PF9|3hz)?qBUkvs*Fci2+=opJ0a%W+dev1EP!!ln_Pe-O2(@KUxdVqWLAu|y3 zJPBtwG9=v_cy?cIXcbf?temxDsXuZ(9;yx1 zXI=T*sT&Pf_3Ia+fKg7jhTj15Bd_U;lnhLUw%*Hai^e0P@xeB#Xb*z?Hk&SV-9DTL z$yZWeT3-MMwEc>c?`)LuT01%4=keRGb02v<`0WQtl;1zU;6RBEecsV-APW9~srYU@ zNx?z*c+*cFgqbNC4XL5mQckr*Sn*2l zbE@N`C=O=dpTBNg3Qcbq9{3v%qykNB_C49E^dKX z@L8pZ8*_DTM{c&XTr}$k1q%#yoTI7N!&ZGJN8$7@k1qR7l^+a5h>>zPNj(NtYQpPUIEnJ}^T!uQK)D{e6D+8|rC!{YqT>ld znxRl5R=f6KM^-CQ#^kf=fULhP+cesgb6 zK}2LKu3D5s~}xZsz9&XsFOeNcp|Es{1Z_UW!!k z4>&;d8``HvZdO%Y;4g(NnC)lgbA##&*+!PFD#Iv-ZpSgv_H)4QqnL-wtaRaCFR={az5aHxJ(r5 z04ul6fnr9iorbqYvg$}+rd3ANFh^(lFQ7sf4v2jJvT9P8} zSuQDD>6c)>{2MEFoQxgl+ZJ(Tb~jy&vf@!Fv?zGH8uVO0%-m!Ysn)T7^M;YgQ2$A;Iyd_yKw)5mYE)eK%{T&;$VO6VilTy z%<$Mi_@(0)5gje+==kfwH!nYEeqICMctvKmJTU5mO53`WB2xU}B@J+GJwm*D|2QxR zD8h_Y9w$dn<-)PSqlCkb8l-pTWH<0<5`p1=2S=A^!lqJ8jeX-7Yl250>rXlr9e-J| z(eEuklP|euLhY#6ats9fG)T!0H8i^OZCmBsX->R1|H@jaKJO(r^mb!^=Z(cbAW+J1N_SHfXH-1v!naus;Y3DM~?QnNA`Xmrup_A7ViHyO? zrn`Oh=Fbkx%)(}yDGUNNZ?S>}mWN2;*V!qCORvIw>MkzcB}Zlz)CfoxGc&UQFYRiJ z1Qc;{HCW(-E*%roSI^Ww)a?EJbS9H0kM>rP1Yuw{=|;zUGD4i>f*zDh+XD^WD>LyC zHe7=Po0)S&06TaTB;D3if=#1+7@h85e#=#lW zPl+**>6D9>fel0SjXt>Se`{-zU`YS;>4#Bf0yzNwz}o?2T46j_++guyJXZZP*R}qb zM~A>WgWZ|Rz}s67U^tbOmR9miHS#PeE+$ceeJxT+hfmZcDG4fVC4=bg6(;vrGstg7 zz4s|n1XBx=xiy}QlfF+Tc}B2AlG*S_ro(>L;I5J{(!j25o9Y;&OJiYUg1k* zz`^F>wm94ELt>F{h2moe2c-almj+2Uic^F7MpOnsIgd<) z9_dp8K-$=$pr9zes5AgpTg^~5z8n*KEdxe^3Iu)D=93RX44&(?40seBUDSd8!M#5d zLXBw`SR9EdW_lpr75KEGg`O=`@&{4@Qdzm3ZWSL&Vtq^f%S3|li5-?eB(HEhiFTGr zPG#fayV#eAA(A%S#5k{BMFN%oGxVQT9ZW9fX`Af*0Mq#Y`J)Jow)%Q!vI*K7OW?rE zyLa!>z|jW4SOLaW5tge81E*TR59K^l4Ri6PFWntCeHO>dIS2Y_5F;Dj^~jyO!yOh}Pnl3V28t)CdbweO378YBR-+=&G(LjA{ zlbu+RX!xK{lBw)JxkYHxE=iij&uX)Lr_<{P$QCftei8mY72QAr^CUcpo^f3i+fqAnbRFu_sp-mD7PCmGktTRQzH;uYm@k1O3G>&3m&ZsY?A()i@k3G7;vJlN)J9lYh3IAac| zc}pzl!EJ=>RytgTQT*p_S~o5yL+NowPJr%pKQeI!3p-`BeKYX=i$+KNPbJXkRyElS zBH(!Ds9JB>&d4#hkQY@Sx9_Zq|1rp;&FdWFf)r~Rg15Y&NpRx81uF9jjyq5 z&nbMj4&8^ZU-7J4?l>RqItb1BR601wkQz%ty~pkCo|mB7?lZzehW}0;+TUQ-bO|+? z0dJ{F9Q20Q8(3+p8Ov?W?l-$87-=gM76o6}HQ>DpZKeeGRIMq{xR9TCAD=|-OHN&^ zSe}jTHmGKP1n2~HGN@BUlFR!|ck(=`z-MS|sqAu)Iii2u#D$!qmI?1(TRyy z*pAzoUC%uph8`29A&Gz2>bQ)1;@h~<=mtyv_VJeQ$44+_u-`93?0y$;j6t?`P=C3j zi#b(XUHRtbQhX;C;-|yI3x!y&d<@U!mlRvZch{PIfd{zf;Rl~F;SQxA9^*5=?+NGx zK*W)sG}`Ezok>wL0|an54z=IiWy3{XK+dGV{0b4F=Dy?-)_`6lo+fCWX>+v%l zvC8*OKg2$y9ubctbzo#eZb0JB9qo2BC+3D15GY}+t_0nit!JKi>(B>oV7v&phF7z6 zQA6q)ZARemm?quYr{nS+DV}p_3>x*;T1mq@3JB8j8X5C{DCk&*aq*T1s`>#zh%1Nr z6?EjX0{^-V1q>#K!OlHa3wEyQ6$4yV%&UrkB;~YTl+xBF11D|3u#Jou0UR3gJKFT1 z1`iUXcQ*)-w=I|gB#}~edc{4xp6xo_`7Bt0;U8t#zMIQB{9HVnNT_qe|JIZB7i~wb zCQmN4^vI@YpvPE7=Jn9Z!zAPg3a<1U+`Ju!g!yuF?|$Y6KOAGJ`*!<^6}@VafFXDo zFHIyU>mM~o2AzT=%Ls1=B!i;W8kuLT4*iFo^J}c<=p};EJaAS=xKoSJJTRAw#~gqh zYSW_~axvX!q0cM48p7P8ZNSH1z}L~@DLD2F7Yi$r+pe7wX@PVPIz3vlMjKsAba`SA z%#CxU7l9;%syqizNqZ!z$EtyJ{MoFlH%&qvpI?S_b8OxLTgK9m?6l&h45 zzGIX{Lo39`XK7!AI0H-i|2r`JSE6KG$I$H(YTj}8m_M3)vi|~4k&)>!C;^Ly#$VJD zbQAvIha9zc3HcE)8qpbKQR919RYo@wJR@*I_1LDQHm}H8oYh+N~R$oZVW*MAlqgght@LPBY;74r>$N*Q2LD67tb4)2Uk#k&!xwS3@!= z6tzeaQA5k;(J4hEVNy#T!EhS@m@crT2p6WyPOJ^=={wDskujTY6A8KGWMw_oX0NFd zgC5#FI|Tvd8^RkqrgigF=i$5OJE;V|IB*Uf9Kf~(PF5mB$>^KvlR7iZo9<2H2boH) zBDjSP2B~U45;Uzao7(uHh$DXnnI9C)DqI3>%O_Z~lM)zo8kMuc?d)6v+{^CtYj5f$ zLx~+U)zyPd6Xgqua!kLdtMi$WO@+LJZt%<(MD<-W+Kk&#DU2A@*#eOQ=yV=;;2fDX zLW%ln{OQTQzzYxgHMW)J7YszJbzY$)6d@ibK*?<|daW_2+>3AF$V~-p+y4a?hr?`! zVFFDofd$==xh~U+HJ-^tVnguuYa1K-XnX`fN681%h}uG4etvpGgZn1r{GXF;hGs3Wah2TdA9hE=dXbTwEX^y@&|MCoua8Aa0UQ_gcrv_9q0uzxexdjeW)c&n6c;~ zeD0G{vw$-25p7dIuyx@7^XFxAoDP_j&@eawRj};ll3$d^i1-k^p#g*C|hEr2T>7=CiG{_{i z84lzw{a~5&KA_4^AFu_7j#Y|#!V7_Xcd@^q`1R|^Cuf>*_WXhZJ@CD7rHU$0p^DWw zPHzI0sh*NxhGTlwH-xu*ZAb{!(#(0zS1^C;;H*7Lul!uu7qj?NyaG)6f9cf^>H3T$ z^B?`p?ueaihZrU>oCKV9i|7D~fnL`U7la5%?=g zakBltj$pY|<+S>@7m=wthY8X$jGF5@)f-P~RShV(m@B_3|NW!wdFg%dluo0L)xqZR z-~l*9EL?NtA&5cD-C9`M4D|zK4>*QUlj%b@KslV+>`t?2d7dd@kn(ez{g?+bRAhWS z_o=&bMw|4`%Wq-9!1_yyzieK5UU3(nbgf0U_$(k4u2d3um-c$*J@zKF_Jz1#;4q>s z=Qute=hZ6jHL95dPAxR|Zj?}5Q-!N%C60=s{$Kl(O! z7X$0o(OFOyZ-#UErCC#83(1kqkeR!R=1g~GW!r#npvHXJWSgX}jI%pf9*_qzczfMP zfw=k(qNOD~X$Du$FUR@5%6YtXserYy>m7@&6(u_Ohz0O3=)@cD-dgX$X0*$G0^8Z0 z*V6|bW*YE|+@+742sjJ|^Tk`qvl|zd;+oT^{viyI0I5Q7%a+hy`hUV3!LR8Bi*mK% z|3`5PcmJQ@wt4YkW5fvhHnAM=>v^*B3w}m1Q1@_{#VC#7yVE?2we|&;b4rYFCqpvW zQ3bIJM2bAi!DMn~o^!!aJ17fS>z^?(W8e(4c`-qNZbV#M4_ME)dU5~X;ADZ#%oA&N zH=|;X4(3~gdZ8+_T`PHzaT#DVWx-=^UGm=m_CT;(dZ1*ucU@LG@B;f|Nm?dxFsYd-vF)$Aj@Q#ji1#M;N8@kl6)<- zK*4aR8~h&HQAP;*)H|v2GT!n2SP!DQH%7saRPAFd`@C5+fT1ZBmkAuB0q0$-pwk2w zsfR&6r(of*aUCEW0d5sknt$9ev|<^CB~Q_kFtWdY@12j?VSlG;kZBOvFY*{8F|l=l z-0`cvtJ{0&@mr48ZsfvsN7TLjaC+tOs7~~u=U@Z}kN-9q`AfEtjAFwkp5xnJ`c}rA&#B~>7f6{jqkm+f+)A};A1z++2Qcu1C#fH#P0~?E@9e-qAv||N9`1NV#Ez`)Az$r>if4hjRP>$5^w4n6bnSQQ3F0 zX6=R)CE2&gK1g=YC|h=^ED=#uvSrUU5ko{}&o;=GeIMJ*{|w#ly}y5RUtNvoInQ~{ z`JB(^eLlMeUwPUpej@|C6Vo*hGb{Ljff1s^h;G$DmHDg+yTvXpss3UOJ*yZNfDPNmx;a z6y-1<^&+XJSr#^|M^y^F z)m%8v5;nqSDGk%01KH|1{COvgx7g}=*2d%RcAl0ag*ezQT!k%X%*ZaGAL7ikS~uWW zhXW}{=h4wMZHocjfn&*@n{(g0Ed%CX`)|~6d1V?eE6F9CJ0xB&B(clbZ=g57*bXhR;~XD+l>KaH**bo<*GW8X8LS_+dl+;gVj=g(J5gcl@{ky=n6`t#R2qGsP2{(pu9U4aI(r_}g_Q z5G|-N(#Tm&KG&Cayq{ryid^e8G6)tG5)!)Wko)AxlTIuAdWu|U6@)Am?&H1}*wFK3 z;A(q%SDpp>DZ12i*#Oh{?!G%>c#jcF2(KoPAkTbz`M{w#Tu*3UWQ_0g$` z{#g#ExtKQjd0*55JEWbzf#Qkt9{+k~8TN)gEXFx=h^S$Bd9TyJhb!Io%|X6X>cnKU zP!aCaMz^Y}SW}C|*&1OULGz%T@}#}7sH;uTrX#lC%rZd-o25OneFiJq%5!dv&YbSa zLMPjiOs4q=X5KUWUFkNgqG((_x47uq02&Ng9r5n2=-TpX(c*Rl1oGySK z_nDvDgRF{_asHqFU#T7hp>#*c%i9}63s)VibTiusqJ}pzFo~*I{=EEkF*4@T&ZJeQ zB3Bk^NbWzP_oGXGDmGR*aC_t21=|*49>0yL9Q&cUrMJo_Zq1NkJfQ694E}q}XkoY4 zYRAblcH-vmPZv+~-fwQn&Vu=pbi>Z#Y7PFVU8wh9S`2ck#_uga;>K-YXZ`61+$w0z zN+%)~6qPYV#1Lg`UuMAE8#9%lI)*TqMwWLp3tr*G(6MuV;5wMh_GK(H-d;WF&!K~`Q zxZhNqFUWd}KfxXz9^R1!%E=*xoe}Rcq750QJ#nIy4nAN79iC25*}JQul+v6eDhH%R zvjYJlW{Yu)MSk}@ z+!`QY#h~4e_mQ+c(hz;g+NXC>Aq^tBP?`5YO^v;vsm|!^cG{pwE~AcjBc!(T{ajeg zD9>$IJppqPEBb>ytKnkH-KXfKaT2@~a(|%8s^0LDhC`U?5fn<&;r4&EocG-QBjA-P zcInmnG&qs75y9zR&BrleD{y*#v&z1lA=bSeA!a^e`t#INqy#%(69pP_4~DW2R4Y}k z;dz?Dzi;(DK68Xqn3)(=50Il@<;Im9+JHegz;;7;??ZFp$mTQZttJzbms1qS08tRU zM0r(e-A~B=c%n61A2O<#1a5%)zJuH@hc>XWSgKoV2}Wn#*N(CLjBAi4b%_vuL*}TJOmsD>IJbqZ_xGbTBO9A_sw4g31gRUXAk$9 z)51@%OPWdR7hdM-k*?tN#<=Pmae6p7r~mYm@=E{tHX?>;SpKvh$K}(WDS0JNo&Ipi zaXr$kCaL%{GEq%hVNK!c5yyDwoVlj7`MINCK>*FgwnQbl9jmLT&oOB9LUBU10;``h z5I#pepW4t_m2k?ym}6Y2-dd9AIdiJ11yrLQ+uEE&3F9_DFUd1}tAikI=y(VQLg|CDg-b1xqB>Yd zVFjtpbeI}@39TQyAJg5wmnV~`!(+=L53P<~(f*6iz9Civt?+I^LX33qB(8=D>S)_Q zH>0OQ$F(%`m?aw;pu^u!3G^jfq3dBxRYK-OIS#v-UrdE(GI>84wJ_ypiJjF&i-iWR z`PMQs(a710D{031)?R+ap6Ap`crG3*d@!mexw^w@Fy&|EC5ZQ+TH;!PEz=*oK6=}5*sa-1A=Fq+?#BLRF(%=DfE4{Q+H z%q1t!k*tR*9l(r5l7q%8)o^WySqYV9@pP1SHt8EGXZ@bVJ|{kjR)!$<>bO-Zf8B%I zlu9HA7fGr1Z-!AbFa3$lWC?dUZlk4ctizcV0vb4Qfr+lrVDITGJq77tl zoYEujnYIg?prDAC;TNL)PmA+Vio$;1;Npdd59GSQOa}k$g6jKhrMgacV8K?2i10iq zPqHYd@2!@f+KH0JhJ@3So`B6Z-N6aIB}O#HNt?y#s7h2;%e)w#IKy2@zqm zrJ0BAz+tSSV$X^o3Zfy<7*B(VAk zT?0V1q#P__!j}V&|Fm#(M57f{ONhS#!3yLjxYQj*wNtt)M-Xa<#ZV{MRl=*S@0#!f)UCab%S-` z$sGtb3%nOn`Wst*gA=C}@0-I$Y!R&#_iIn1e*7>5b3-{2Jmx<;THJh5Bn_?3`cUtO z`d_qnZ(avZ0aqzK@4bcl0Yz2zdfVv?FE5;Txt^AUEc4OC) zqG<4=PXQYt{XvBO^Q)xzcaIa#SMx#xMNsAiN~Rt6XdEFL@gcZOgKV2$)$NWA*UA%Qtl5zLD!nYMLnZW%~sOM7x6gH^Xo7gF9| zESohIex@rJoO4?^MTPj!--%aEqodXCErXZLU_^wb4rR0=ARFOFt=_W|aURD#bOL@Q5P&BG{v;h+TU$*Yo>CNP#)*tP z4K|tliL3z?=bi!3R2;acboaW0vCy+vx|rhEE%_Qn-Z}sV=NA^nS=8R2*a{#8>DP8W zdHR4rPy5#z3r%gz6B|Sa%IIEO&his8-ZchnLOA z4K1TXVH!51=!GpWP<;`l9Kvf;VU38GAg?4b?f7fY3nda^)B8McD1R~)>|KUM%S;Oi zuIV${4#ie`VByx*Tds7AR%0LNGzb3x2}~h2=`%MYY+U8^H>_kklRaLFq@}T;UU5Pm zdVdEI_A^IScmKXMK9#UzlYTKY|EdU3$Qw5d3=B-F^taZSXb@-t>w1P;ohFREWMXg6 zsRwQkIjTC84dKO3K5^Wi7AqNYg}V+{F4@7&k(b(h)L!_{q}?$t*kTL~ry(tp(D!D) zCOaOVc2;pXeS53eQNFn0V$A}C&u@n61FOs&*Pq;_i->AddI~rkZr!@|%?;$HFa;ij zK^=ktYSz}v0;k`lmi_%OPtXC;%9tDS$+h$V`!bT-E7q5A^zK8hEAi&+%B!_@4cvl9eZCdqCb7y@b~ptS@YpF`c>~Y;-S*7dW8KHhSFU8# zHxhz81DltE@E1uOY`Q zW%wWqC@M(K(U4yZ6B90f4b3X1rTLCNy<=AKC6D=g4FuLlso;&qnJx5hli>;d=dvOS zQ?XLdTz{7TJ;iunoJ)!;?ZP+g)ECoOgUTvGw{yiauv#C8XBC_`!(a!?&!5?6gxd7? zy9s(#_II3uB8W@!(H3|+ZT0t-k%uqdtF|^bNivE-hPGYZ8~xr=@jM z`7Z*T@m-mU9{#_Qbc$}dPzu2?KrOxNnGYJUEgg{!pLKrs{gKM&A3Y*(v-Zscwlx^1 z1v32e9#j(hMha58221UziW~MWWM)E{EGiAPwa>vODRcHkV0?OdIy()*W%4D~Rra~( z^wV2Ken8ZV>%soeAa(YVUEDjvSW6N!VTuTwQ}6g4a2wY1hGwk>Q2NugDIUk4&qVvG zcEBVRKYjXiV$Bb@YwTycG6CmL{Qe*){ILvNk^uxypc3QBQ+*HiqU#V8M&Eo+fD&UF z21<+4klo5V=03R9iLL_R6(KF?a~=l1fS~6MJ{2~ImOLkJ!>8#+nVLhbTV5>No~9yc@kzR|e_C}B+h``a4Fv1*N~Ef7ZmS}U=;qqEa~ z>-T(x47pE|Bpsh3GKpiLOL=ERtGI6cOPueRKQueN@qW1X9a-%l z(A{4hlhD501BD8 zSUY+Z5Eg>Usj~HeXEro~kSJyBCGg_xAhEB@%|P{V^Q(8AjNNUl$yEh4I>O;VBYvw* z+|!<8|2}_jC99gfu~!68DdPby&Rtgc$IpRp^U(!jECBijs1ftn#8GF_8F)LF3ez~? zBr2JkPO)lO6SCU<5;%MJ+hsbgj<=MtGuh=ITyHN&?N{mB4G#+p-YDxWP`_lP-{6Jv1A>`1UE9<4qC4i44p=-^CzkN3>|LqBj^O;AxIy4T37e|Gw%>;>r0lhfAG*-XQ0{kd*ao(?F_@szUFKjhPPv#KzBDn+3-R;i=6;jal zZcuSVt$tSbjx)&UQ)O&i0*2~CdY*sqn}HWXK`P_dd!%`OVDuNI9w&>O&w}=Dq$ed> zzmXqvem#;Q*xU#y}o-{&Ww~e;3(3Tfj{mEiIrgczE!s z!|t_TEdUqv8u>DHF5;(~YYuDI7ORc4cp5HG1R5sryaF4}9N6&sPbwJ_vAo4Lc( zBVF95b2X?W3qn5V?<8(09MEmIuH#?$J;KE%X;=ZTcw*?guqwrRME+VS@qsoC4jLT=Tm+_R(iS(4%2@20zgq zyjY5POxKJveKU|@CrQKxzrg&jg!D)oKpVS3IyZZ4lZSey7Vx{>ilZxax$Iwwqj48` zI#!8Qi&(jNwh`!G9tf!8-zr;g4U~8L%{*?l44I{_OKb(y`;u0f2|wc}iD~)p*ZK4F zjA&Lq9!|uqwc_NV5JSTsM7#Rn(|E9ol?PU4_QDDpjbfQo01M~7%0?$7#fb_OVe4Rh z=OocIo4c}x39JQ%SJcX-z<`2iZhhFA#Xq3TSz89Lf>lPL=(}7uJr=lfh|H*P_(d7N z^vc3-B3uXML6Lcmtz%m8{vvMTp06`7m8#_?!YK*WyJn#SvGUF0IVwWm+JdWrw=b~L zeKg>8_w0Ux_=_Gjlop53U3W6@hg-I75%;5azzPZQR7 z+zNU2O=1F9#%c!7e#y-h288?{slQ&62osc&l9~Y0S@Zi770&@Sf}WG@^QCX8{iVR) zRX-;EHS>~SY|Hvfz*3a5G*~*7j;t!P!^FFQQY&+ZQWF*F$)-R@508~CDRYRD$_^|4 zq<;O2(30J#C)nyJ&u{F?;({9B7;1zm%uayJ$|`Hfdp6VJ>n-!|y@aa9tpXq&n!Ft( zm1K^X4u)c@#t2@R9%~FI&5gcrxR5IxSHg(JGb3S}(gUF93 zdM0mjMtBxuriLJg3e)FR?xTAQXrP@9HUsJvWS=jQf%UbNnePx_^!sgQAEnC8*KiaP39h7ZlZZ@2v|HFDq zk6{x%J0%Wd%|CCVXXWl*wDDbsr+&t_aetK9V9e8STD|~R;v`xDqru-J-6$0#(IBp_ z<%3laJa4X--fx$BA_22_*vu1%%j)WMX7&DW=|yMK+smD0zS`BCA10C^E3>5`?J(rXs) zqK)p(t7(@0nu3CZ<^56LvGs}5$#s7Ex>a>(hY=c_RtUJ)(48ZlT?Xu8#PIl}jmO5X z#@Z2Rc+mlhiL4l^EP-i1h*tdY-nhVXA{@?^3AChK&`RKV;My97N0s??wnQ#Q_9Ry& z>62&AC}rA#ne#XE5omK==TiPXkDp*vq_Xt81n&nr%g*oheQVQhdO2$olG^A%2Yx}p z;RgIxan}A^ZbAtEm7br!2U}G|%H>GQ@*&K?)4W?Vv|JaOzoXN`ns1(h|_ywKIb!MviXR zF5lXBn68m!-C8^^D%y4Jd>en-g$Lh>I_@H2zfn=?&K=W2)7f~C;f3JDLmoA!q#Y7F zrq@FV`{U3waOIzWKAqApm%3JLrX{`@R`ho59$_=z;;>sO_tOgT3H%YT2s2W<8BPBR z4}H%I-VcTb9FHLr;m|5!-fRB3KL9oeMg;8cyPr{tfH-^hPKw1gCM=9R@KpZ0KGXnC zt})@I(+|S0gY# z{C)Qv7Q(@S7<8wDDPk{stqjjD<3BN8H20`~{jB=!bva3}^)W@y-IUPF8d#87soxn3 zR^4qkxUcQ+SwC^lb;@eI&Mzg8CPFoL&(t(%RQ1paavZly*s^&i_k`%*{%nW-riOO< zS>x^4taNTiWAL!ob(Kn)xIojXV zqP`c|Qg0Mj47d=tZ^x@cLb{9hNvd+?>({U6)fkY>B{cFBgD0sG54RWI_f&n$A@1TP z#jMN8RM0t-h;g8^O^YB9-;4y6%C~p~YZqy`hE1qh&Z`NO(8;sQQ^|9-^-=r?D>tl| z8v!$lJAnY+SB{A9-zsqS% z-jz9Bk!DH#=k`#DlU4jdjk)MbcgS|xz)I~3@PB*$IPLtZ^)@w2JlfyrBsCL!65MLy zcZaor=zvly z?H0#Pa^P?2@Yva0H{2p2aTL9RouU8xI-mqVU8gOd;E7UP0lD||L3=$}A+{h=ei{%O zynRmVaUQ9c|9f8T&E;D+<34(^h912rlFo9G5fA0TTK$S0VdDB_1LCpocG<+0xD$5K zFvi8ksdz=p=P(hr=9_7Gkiu)y7oq(zW!J0nO|FA-u+P%0;d<(V*K%!%?!6NF#&Z-` zGsHX&p5C&2yWg9yvh~Z%qyDB0)%e)GaU;3J*T0!q^sqM%U~^hcTh3VGJo$Gn!S+kS z&v_-km)^SScDjFrf8mW=B#U@F>7m-BxhNoF|NTM;Y={z6vbrHjon|cvYtqUo#xXAO zqEX1Y?bMN*)X|WO?V|;z_#n_+MG`PE#R3(1o{IQ)_IRLq!}Vh2yK_*UlPrnOjB_ZU z3$Jl+JlxI~Z9G_~A_hf&EA*druI3B1WA9)f-672)>%ufTw90LkiWgzN=QuH|7+^Dq zeT5vZJFogy$c%onnapURF&f)$n~fjYULB~6tCMe0HTsqT5WrU=n$l_9t|(TPi_~ao zvqR`^!-`?Wq_wL%v>u`Wb8_OdK|tLhSU9$T<{X9SwdNz`rD4$8~orHehLuOq=2xgMDYX`dEd_ttk+~ z+Z+J72EAR$8}F2nbh)oj_;Esnm4UUY8`80KEK?;5c4uDIvWnX?&qjksVNgj-Tx6E- z?|Zgf5Hy~`xeXNR=6vkXy`$ro$rt^@&Adv~PxeCb{P?zC@#$0IdOfZZbWkoGA)U&z z0MwuCd|W6Btgf#gRV1E)0%8^-We9=$6c0X&S~Gq#20*&-w=&-g*ciEN!8!ggIoQ!N zH5R-VFHMPmv{12p!+{++i>Z|x5?S3fGOC84@h}l~q9~_VbY+K5l8D`)Cy(2@>}m4A z^opyU#j8mx*rzC{O8qnfu^O^JJRUMZG<1>%A2leZo6)7u&$FVF(Ho)S*I$cEEHscQ zwU(3`@iybgW?5O+0G34zJ2J%?Oc0c zcY!U>^me8bXPMb4G-}{i@$_M?rFZppQedhzB5b(Gq5jXhmjdc7y#aW}0242^lp6WT z_S>Z%X-1Gr-DqlP=#}-(?M6Mt0YkNx))_mT1(u5_H;ao}G)mt0NV2+B&HSr6Fva(G zR_DK-&*e6I;_&+J=r6XZ{l4WF+5NOJE!ah^PcSrQUtm+M?$jjF89>a@va$j|tT7Y9 zOxViCr`@_KD-aZu=Jxh6?gpE@9I(PKI&?oE=cBPV1;^aHHZX_vJ!9KEJ3H&{$%=E8 zy0`crr<~$C?>eOfsg{tMuor|6^!E1pE)-VbD*!78VEhf<+Bh)3z{n+)wjU5`Kmx%Y z-{d0OB=34;Neu3g1X*kGMw%*Lf~2mv6?0|3?#2jSy~6NYlr^5TxZT2Ir=(Uw-u!)g zBv_}5K8%Nz|xf#ut~l_{&i(CUnM!oJ0es3 z=5CVpSvfH9Vcx5y`@7W(OWgSC#)L991(W1Ed?KHkCeiBtH!UnLQU!q(wrX1;bhoZ$ z73tZ$$Nz&_IGGla2RVHNkqs(H?tB4*k={Dl3fLVPUhmX3fDMrPlFeU;_XpXJ9W4bH zPB1aC8(dF+YT$8Yrpq_r;YVG1%D8-nosHg!b~kVR%1ko@E>&|hd5=YUUJabkDu}N}wS|Ev2Q5E2C2BFBv0Vv)|NZjLe-%atKlw4HH+xi# zDX~!Fl#wYJM*G(}B>O5m*62+~ulY1(2+aW_2hm-dd~f%QrtI|a(Ct}{s)ZgCpeVac ze_?wm;$OPoU`Z3VPR;Z06pyt)Q(TmmxRc_P&Vdze7E@`YQlbuGtxl9T7dC3eBPc6L z$0-@!Lh?Y?-hon>+Zn%qJ#4wUEnBP5JM*&cYx7HEgKtyOWv=f#%dclR(VD(gG_Mrr zsiHNZen0T?5ltWrqiO#t7q>rC+^p&|e^xC$`mCtWWL7+m@J*8egmZ0xX3&_J=+FQ8 zV0r%lRD=J#Z$eylAd))<;=5d@AHQ*?9D{&;GSE76W)Y@B8^kWpBM+B{nY_z+w2Q(? zu5zske=Ft%%gv9)ot6@~KY<6r=injj*#Jur$B2r))YQwU#Em0uBZ*$Cx}1mg7`;sL z7|@-!H{&bF9$MMRlVVD`<0fJbUQ31ezUQCx)r)$*1}~Oc>;5JECS_`h*BlLD;UpF~ z$G`!D!Y`pD)o-ZFMvVQpHeV5FfO-QO71vDQWO)CECxR`hKPc z(K(PToa|rXlrDgO%f$F*&S8`k+lQ7Q=GZblBA}S4+1=1WY8BBQ{WoC6{G$CyxUHQR$UN+PH+y6P3t48vrl)JHusYP=!xMVnc~#s3c;gA6&VbuK!Cz) zQ=&(NCYFwi$7*7g;u*=Gw*4lvl-Bnqa8a|(qkYhrQ2mSLpi8{p`v9LgI8$sufZX@- zP`zR@1ua`*R+eflDc?!SF-f{+$|u+?5pCXlxF6W4S3#3XCMKbrp@i0PucKVv>%Y8e z{AM$KftBXiz=P~(fPUY+dp8N{I6qGy^_=&g%`ay=r5D2>$AfvUJI)i6D=IVF5qp)9C<<*50)a? zsR=vZ`fstbt5`Z zF%BEyFxW?fN9epCg1b1gQ18@(zt*!zs|uWn({au^j8i(E6a(%gxk_%_y(XzbU1yi> zQ2sIM(2iWga1iXE_O9sa%1v6eL;JZlO4IDvM%^n{UKmvnpM4#jdga@o3qqUyD7_*6 zsha}6lr2!d=bo0Q>KOdxl9KX}AbIOGb0bsJJ$fwLL7A=yWrms{lH89OCsd;PxF9O# zXvNTiNt_@9GH=HNva>(37XX&0j-Josww@$|9_ce`bc;ruP!G?@AxP=}yYEJpxuM|) z9-KNr>3k7D_+qvG_U-Mm4AiI&8$6ioocj%f< z3QfHS<1cWNDE&;2I#3eAcgq2Ls!zTRf|$c{xC4i!UH@4qn|)!`yHomWgo!GeIITcQ ztWe-p+Vd;P;2@iN(NKnXe^NCgg0D#%_Kl>@{XdB`c67Y;d6A5F$v9xe7L2{=c|)8Y zR5h<&{o4KU1Nsqz$|3{jTh=k+Bvx}lUnp-9n_^1yCbiQXoNH0lFxthsMcCMr-o{~E zUrq67W{~ku@Z88C8B}Okj({U!uu$6Hmf4(yPVLh;%#Cs&v5v-%0Vwtt5O-UwK~JLv zvc-|U^d+=}*sH}YgVPJ|c35qK1CtLB+t8T@IB$0eKdn80cih z04E2cF!3e$9OTvmf?Zc4n&Wt_NKE5nPui<8^z>${uQR?pnjC7-vJ3JvDsnC z@06@Z%^tNXX5HJ@XOr&m%?(6~a+}o80ngkiIGkz}M4#W>ekZ^x4xUf!1o3KHD`R8h zZzj}L!}_4y^qU=^$r8*8@-h)&r)3ky{z^7zwWW!t1BV`7vJ(f#pa8yg0H6MS(^3z6 zq`cQJYRh7|IoX1~FMz9n7@Gr0slfZhIGO?i`+#~A#1m}3rpo|M!|YiAy1~h35c9f> zNb- z!bU^Yf364lN0(hqiC_B&0pdX-$)b)=%8AH@z;R1U~U^2gzGjAUr0619DTrG z@!u~rt8%{~mk*fWEd8fh0effD*i}H90d}<~h{tDE<>%#r6DU4PWZ9*4#S7V=10T@0 zsL$My&7Xev73hT10TOfIvWGw<4*vGdo9v2;rywf(a=*5=)(He@b8;SlG~^`USB^8S zPy{C+g4Bg6qE8rQ zKER*KDQ1ok|H>A7$+%kybgT+R?7ZXLaSLpBRCo4sV-umuh-p{*_N#BXF`TM5On4U)DAG zD)}lnJTWRZHuib~p!dlJKPO+k_^7PwVhlKjG!abv_JRp-{nUR%PDDs3hIpz8NGeG9 zxB^7fVRwBR96O=!H2f@W@INB8+b(Iu`R_Wqj{a8-xFrq#cfp?ck4Q7u{%6KPTIs(p z8iFv|1sN(dduhM#gDB1MN+vF%8ChLv%Nzf@@V_@{+DciUO9?H6u|bQJN5Xz2?w~5{ zU(r{{E-&AF1pv`21^9nj&6%Xb4uNkM|G#hVVOzkrIsf-tTl!T)fQ=q`ivkLif5c8x z>&)s7xOS(j2K5s9SI4okqm6(m;Ys)Y@9SM)4pjw*^Wu9l{=34j+fal658>WdpfByN z{KgY6;Zb-ZMNVE+FW;!YQoRzi&to3qPiU9^7zzInM{^u z_gY*4N1oL_A?k@v@)Lnzq$t1u5X^vjfN_zBz=F62CBGs`@f5q3Co2BRI%`R5@W1J_ zKW8F*UPRUHjuJGUTR>Ox$z%?qKNsC0Y*9tHjO60yd39W(}vDsOcTXK zG1jq9Dn0qOTcFx0Jo(=ybxAHRzAcCQgCDHI%Nud^5{_oktVBC$*OhZhs9|UE`MuGM( zams%*oaSUx6$*M(8vKr|3pDVS^LS+tEgb#3bqpYZ4rB-h7}Cz zd`7{U%O+WL_;s0vhsC7yqUlp@+9i;g5)~V~=0VCpCe-YQdk!iu4?$yb$w8Seq5JAe zpDCab6GOvwHTmJPu#LZbQqsA7Qh+vQN;+Td_W&tDa=<-E1fsy&{lX;E!)@lsL;;aR z*y$sMKpa5({!#I+rC=Q9&MB~m8o2>3c8RcTBs~XI(vV7;;BA2o>p#YnDa{|u>v{AY zKKEs+5ISKoAPVLX81!bkP(mJCqQJvLX=zh}<3A@HT5= zAcU6idt}{r{fGbPK$Nl6*|@juG}Jn8Ja3a`tJguo{tux2 zi;ip4FN8to?*W7@#>`o!Y0LKyAY-nw$rE`zT&C%)@y}Ph&n~;`5tl7-xK4@lUitTD z&}@op8H}1;7WNNd0Q;4HHRa{Sl(;e&92%rQvIInV&p{C};V~-YE#>^*Jp5nnE_c)j z(Z+)u`u~BEsL$?4x`Aj!lWO4NAMKRvHG>HP)a=*C8)?+Fdv}0(Ac~WgpIK|M@fi{E^IdW}()en+&CSs%v*Hj?16nbJ+ICNMw@Q&p!gIAhEX9 z0zGagZ~wU$AIBtV>r7~+W|yddjxnpZlJ)!jW}YD6C-5#sNUj$@sz2o9mc(x-skV;b z=^5D}++b_!u<9`YtLYHehgeX-1C}nNDx^VlCXBB%180B8y4!z;H&~NMkMIQUryPNe z-JO-kRH_`_`&ECmIX%h+DpQ=<_LzE1*MP(uYV=(rz8nK3QL8Z}{e6)hN4d(BZI^+0 z1!E+$BDIWJT^J4>r>G>P+z#lzMLxFj73IR*{Tyrye5?`z-_;lr6iuuZ|s3JIQ{7K7$)4XE!e*3hde}f3H#;t33w5@p|etiDWEg<8Z8mrMujy;H|l!q!p;a(!}+$E!`Vf%?EMYTqK1 zc73AfTSG)+IBze>97N};*srcF97&7f(VmkyF7lRK0Ai!~`A`5K9#j?QIo<>Go)6>R zeXNY_S^Lic)g*+)YvZ5_w<_ufonbby_5*CI8ah@P+bSdcI#W<9dL>Y%7#ZR8WQZ8P zKVB!lv^WWoECC2%1lWGo(p8_9ms#DvdLRN%(As$Qr*Nkhflt_Xwg}{ zRy1t7y|jNNuj=QH<{7@R<`$~es?B>8A@@mAE*w|NONWf@T^LoR!uvnlS;%Lpo4H}U&md?{Cud~wnpYv_#<8TL%I{{FJAZXebGiv*oJV;1=qNxQ}rrV;c+j>tu`cJQ8#o~9AN1maOY(Mw!W<NilsQ2so>01BvU}_pLRaGpk+{U zpY2qj7UJcxV$1;t;c_M2EOCw0a^`f=nr%2{{IjRmRFj#U6|Fw0vbwz~vK>F6Byd5x z&5Wq&@E=)mtW!G!a-p25yJ@eAV9RONs_xCI$v60$wO+lT#osPzkZGRYyou#(4r%=V zMEQu%7nJsZl?M5OrG{qh95F?#!0_sGw_h}n2RTwUYbk}rCQa}ScST7eA${J4MYtH5A&o|HS24vzBmp zY&EC}JeCCWi>qWv^(agoZ3g{4&0QG>N%PO@ZMcBHtUsUDHxeRB%fpK(UDWTB2@0f; z?*+`M$`xuQxf|7Q7#20kn<@056T=>)1cj`o@Z&j%^$CTT@Q?(2N`VnaKV=}K$i}yt zam}J6ovheG`BSBe672-`o!CEzsj3tB`L{>wRQa2S)sw6xaKsSz<6bd9@tq!_bTQ>+WTrqV-jK}241DR(Y zOk>fr;ME||Z^;5tT60Y^4JCmLnF|7@F3mAe9 z>G1^bjkZ+1Y7(f!u$?^N{MmcH(!`W22y6nisChannel() || (peer->isUser() && peer->asUser()->botInfo)) { outboxReadBefore = INT_MAX; } @@ -2674,6 +2674,12 @@ void History::removeBlock(HistoryBlock *block) { delete block; } +History::~History() { + clear(); + deleteAndMark(msgDraft); + deleteAndMark(editDraft); +} + int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem) { int32 y = 0; for (Items::iterator i = items.begin(), e = items.end(); i != e; ++i) { @@ -2926,7 +2932,8 @@ bool HistoryItem::canEdit(const QDateTime &cur) const { t != MediaTypeFile && t != MediaTypeGif && t != MediaTypeMusicFile && - t != MediaTypeVoiceFile) { + t != MediaTypeVoiceFile && + t != MediaTypeWebPage) { return false; } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index d1e410d1fd..6bf69c08f5 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -149,6 +149,42 @@ struct SendAction { int32 progress; }; +struct HistoryDraft { + HistoryDraft() : msgId(0), previewCancelled(false) { + } + HistoryDraft(const QString &text, MsgId msgId, const MessageCursor &cursor, bool previewCancelled) + : text(text) + , msgId(msgId) + , cursor(cursor) + , previewCancelled(previewCancelled) { + } + HistoryDraft(const FlatTextarea &field, MsgId msgId, bool previewCancelled) + : text(field.getLastText()) + , msgId(msgId) + , cursor(field) + , previewCancelled(previewCancelled) { + } + QString text; + MsgId msgId; // replyToId for message draft, editMsgId for edit draft + MessageCursor cursor; + bool previewCancelled; +}; +struct HistoryEditDraft : public HistoryDraft { + HistoryEditDraft() + : HistoryDraft() + , saveRequest(0) { + } + HistoryEditDraft(const QString &text, MsgId msgId, const MessageCursor &cursor, bool previewCancelled, mtpRequestId saveRequest = 0) + : HistoryDraft(text, msgId, cursor, previewCancelled) + , saveRequest(saveRequest) { + } + HistoryEditDraft(const FlatTextarea &field, MsgId msgId, bool previewCancelled, mtpRequestId saveRequest = 0) + : HistoryDraft(field, msgId, previewCancelled) + , saveRequest(saveRequest) { + } + mtpRequestId saveRequest; +}; + class HistoryMedia; class HistoryMessage; class HistoryUnreadBar; @@ -184,9 +220,7 @@ public: void blockResized(HistoryBlock *block, int32 dh); void removeBlock(HistoryBlock *block); - virtual ~History() { - clear(); - } + 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); @@ -284,10 +318,20 @@ public: typedef QList NotifyQueue; NotifyQueue notifies; - QString draft; - MsgId draftToId; - MessageCursor draftCursor; - bool draftPreviewCancelled; + HistoryDraft *msgDraft; + HistoryEditDraft *editDraft; + HistoryDraft *draft() { + return editDraft ? editDraft : msgDraft; + } + void setMsgDraft(HistoryDraft *draft) { + if (msgDraft) delete msgDraft; + msgDraft = draft; + } + void setEditDraft(HistoryEditDraft *draft) { + if (editDraft) delete editDraft; + editDraft = draft; + } + int32 lastWidth, lastScrollTop; MsgId lastShowAtMsgId; bool mute; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index bba4594afa..b21d9f3cd5 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2609,9 +2609,11 @@ void CollapseButton::paintEvent(QPaintEvent *e) { HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _replyToId(0) -, _replyTo(0) , _replyToNameVersion(0) -, _replyForwardPreviewCancel(this, st::replyCancel) +, _editMsgId(0) +, _replyEditMsg(0) +, _fieldBarCancel(this, st::replyCancel) +, _saveEditMsgRequestId(0) , _reportSpamStatus(dbiprsUnknown) , _previewData(0) , _previewRequest(0) @@ -2661,7 +2663,10 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _field(this, st::taMsgField, lang(lng_message_ph)) , _a_record(animation(this, &HistoryWidget::step_record)) , _a_recording(animation(this, &HistoryWidget::step_recording)) -, _recording(false), _inRecord(false), _inField(false), _inReply(false) +, _recording(false) +, _inRecord(false) +, _inField(false) +, _inReplyEdit(false) , a_recordingLevel(0, 0), _recordingSamples(0) , a_recordOver(0, 0), a_recordDown(0, 0), a_recordCancel(st::recordCancel->c, st::recordCancel->c) , _recordCancelWidth(st::recordFont->width(lang(lng_record_cancel))) @@ -2697,7 +2702,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) connect(&_reportSpamPanel, SIGNAL(clearClicked()), this, SLOT(onReportSpamClear())); connect(&_toHistoryEnd, SIGNAL(clicked()), this, SLOT(onHistoryToEnd())); connect(&_collapseComments, SIGNAL(clicked()), this, SLOT(onCollapseComments())); - connect(&_replyForwardPreviewCancel, SIGNAL(clicked()), this, SLOT(onReplyForwardPreviewCancel())); + connect(&_fieldBarCancel, SIGNAL(clicked()), this, SLOT(onFieldBarCancel())); connect(&_send, SIGNAL(clicked()), this, SLOT(onSend())); connect(&_unblock, SIGNAL(clicked()), this, SLOT(onUnblock())); connect(&_botStart, SIGNAL(clicked()), this, SLOT(onBotStart())); @@ -2745,7 +2750,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) connect(&_field, SIGNAL(cursorPositionChanged()), this, SLOT(onDraftSaveDelayed())); connect(&_field, SIGNAL(cursorPositionChanged()), this, SLOT(onCheckMentionDropdown()), Qt::QueuedConnection); - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); _scroll.hide(); _scroll.move(0, 0); @@ -2897,20 +2902,20 @@ void HistoryWidget::onTextChange() { updateStickersByEmoji(); if (_peer && (!_peer->isChannel() || _peer->isMegagroup() || !_peer->asChannel()->canPublish() || (!_peer->asChannel()->isBroadcast() && !_broadcast.checked()))) { - if (!_inlineBot && (_textUpdateEventsFlags & TextUpdateEventsSendTyping)) { + if (!_inlineBot && !_editMsgId && (_textUpdateEventsFlags & TextUpdateEventsSendTyping)) { updateSendAction(_history, SendActionTyping); } } if (cHasAudioCapture()) { - if (!_field.hasSendText() && !readyToForward()) { + if (!_field.hasSendText() && !readyToForward() && !_editMsgId) { _previewCancelled = false; _send.hide(); - setMouseTracking(true); + updateMouseTracking(); mouseMoveEvent(0); } else if (!_field.isHidden() && _send.isHidden()) { _send.show(); - setMouseTracking(false); + updateMouseTracking(); _a_record.stop(); _inRecord = _inField = false; a_recordOver = a_recordDown = anim::fvalue(0, 0); @@ -2931,7 +2936,9 @@ void HistoryWidget::onTextChange() { void HistoryWidget::onDraftSaveDelayed() { if (!_peer || !(_textUpdateEventsFlags & TextUpdateEventsSaveDraft)) return; if (!_field.textCursor().anchor() && !_field.textCursor().position() && !_field.verticalScrollBar()->value()) { - if (!Local::hasDraftPositions(_peer->id)) return; + if (!Local::hasDraftCursors(_peer->id)) { + return; + } } onDraftSave(true); } @@ -2947,30 +2954,77 @@ void HistoryWidget::onDraftSave(bool delayed) { return _saveDraftTimer.start(SaveDraftTimeout); } } - writeDraft(); + writeDrafts(Nil, Nil); } -void HistoryWidget::writeDraft(MsgId *replyTo, const QString *text, const MessageCursor *cursor, bool *previewCancelled) { +void HistoryWidget::writeDrafts(HistoryDraft **msgDraft, HistoryEditDraft **editDraft) { + if (!msgDraft && _editMsgId) msgDraft = &_history->msgDraft; + bool save = _peer && (_saveDraftStart > 0); _saveDraftStart = 0; _saveDraftTimer.stop(); if (_saveDraftText) { if (save) { - Local::writeDraft(_peer->id, Local::MessageDraft(replyTo ? (*replyTo) : _replyToId, text ? (*text) : _field.getLastText(), previewCancelled ? (*previewCancelled) : _previewCancelled)); + Local::MessageDraft localMsgDraft, localEditDraft; + if (msgDraft) { + if (*msgDraft) { + localMsgDraft = Local::MessageDraft((*msgDraft)->msgId, (*msgDraft)->text, (*msgDraft)->previewCancelled); + } + } else { + localMsgDraft = Local::MessageDraft(_replyToId, _field.getLastText(), _previewCancelled); + } + if (editDraft) { + if (*editDraft) { + localEditDraft = Local::MessageDraft((*editDraft)->msgId, (*editDraft)->text, (*editDraft)->previewCancelled); + } + } else if (_editMsgId) { + localEditDraft = Local::MessageDraft(_editMsgId, _field.getLastText(), _previewCancelled); + } + Local::writeDrafts(_peer->id, localMsgDraft, localEditDraft); if (_migrated) { - Local::writeDraft(_migrated->peer->id, Local::MessageDraft()); + Local::writeDrafts(_migrated->peer->id, Local::MessageDraft(), Local::MessageDraft()); } } _saveDraftText = false; } if (save) { - Local::writeDraftPositions(_peer->id, cursor ? (*cursor) : MessageCursor(_field)); + MessageCursor msgCursor, editCursor; + if (msgDraft) { + if (*msgDraft) { + msgCursor = (*msgDraft)->cursor; + } + } else { + msgCursor = MessageCursor(_field); + } + if (editDraft) { + if (*editDraft) { + editCursor = (*editDraft)->cursor; + } + } else if (_editMsgId) { + editCursor = MessageCursor(_field); + } + Local::writeDraftCursors(_peer->id, msgCursor, editCursor); if (_migrated) { - Local::writeDraftPositions(_migrated->peer->id, MessageCursor()); + Local::writeDraftCursors(_migrated->peer->id, MessageCursor(), MessageCursor()); } } } +void HistoryWidget::writeDrafts(History *history) { + Local::MessageDraft localMsgDraft, localEditDraft; + MessageCursor msgCursor, editCursor; + if (history->msgDraft) { + localMsgDraft = Local::MessageDraft(history->msgDraft->msgId, history->msgDraft->text, history->msgDraft->previewCancelled); + msgCursor = history->msgDraft->cursor; + } + if (history->editDraft) { + localEditDraft = Local::MessageDraft(history->editDraft->msgId, history->editDraft->text, history->editDraft->previewCancelled); + editCursor = history->editDraft->cursor; + } + Local::writeDrafts(history->peer->id, localMsgDraft, localEditDraft); + Local::writeDraftCursors(history->peer->id, msgCursor, editCursor); +} + void HistoryWidget::cancelSendAction(History *history, SendActionType type) { QMap, mtpRequestId>::iterator i = _sendActionRequests.find(qMakePair(history, type)); if (i != _sendActionRequests.cend()) { @@ -3374,16 +3428,36 @@ void HistoryWidget::fastShowAtEnd(History *h) { } void HistoryWidget::applyDraft(bool parseLinks) { - if (!_history) return; - setFieldText(_history->draft); - _field.setFocus(); + HistoryDraft *draft = _history ? _history->draft() : 0; + if (!draft) { + setFieldText(QString()); + _field.setFocus(); + _editMsgId = _replyToId = 0; + return; + } + _textUpdateEventsFlags = 0; - _history->draftCursor.applyTo(_field); + setFieldText(draft->text); + _field.setFocus(); + draft->cursor.applyTo(_field); _textUpdateEventsFlags = TextUpdateEventsSaveDraft | TextUpdateEventsSendTyping; - _previewCancelled = _history->draftPreviewCancelled; + _previewCancelled = draft->previewCancelled; + if (_history->editDraft) { + _editMsgId = _history->editDraft->msgId; + _replyToId = 0; + } else { + _editMsgId = 0; + _replyToId = readyToForward() ? 0 : _history->msgDraft->msgId; + } if (parseLinks) { onPreviewParse(); } + if (_editMsgId || _replyToId) { + updateReplyEditTexts(); + if (!_replyEditMsg && App::api()) { + App::api()->requestReplyTo(0, _peer->asChannel(), _editMsgId ? _editMsgId : _replyToId); + } + } } void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool reload) { @@ -3441,13 +3515,22 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re clearAllLoadRequests(); if (_history) { - _history->draft = _field.getLastText(); - if (_migrated) _migrated->draft = QString(); // use migrated draft only once - _history->draftCursor.fillFrom(_field); - _history->draftToId = _replyToId; - _history->draftPreviewCancelled = _previewCancelled; + if (_editMsgId) { + _history->setEditDraft(new HistoryEditDraft(_field, _editMsgId, _previewCancelled, _saveEditMsgRequestId)); + } else { + if (_replyToId || !_field.getLastText().isEmpty()) { + _history->setMsgDraft(new HistoryDraft(_field, _replyToId, _previewCancelled)); + } else { + _history->setMsgDraft(Nil); + } + _history->setEditDraft(Nil); + } + if (_migrated) { + _migrated->setMsgDraft(Nil); // use migrated draft only once + _migrated->setEditDraft(Nil); + } - writeDraft(&_history->draftToId, &_history->draft, &_history->draftCursor, &_history->draftPreviewCancelled); + writeDrafts(&_history->msgDraft, &_history->editDraft); if (_scroll.scrollTop() + 1 <= _scroll.scrollTopMax()) { _history->lastWidth = _list->width(); @@ -3467,16 +3550,14 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re updateBotKeyboard(); } - if (_replyToId) { - _replyTo = 0; - _replyToId = 0; - _replyForwardPreviewCancel.hide(); - } - if (_previewData && _previewData->pendingTill >= 0) { - _previewData = 0; - _replyForwardPreviewCancel.hide(); - } + _editMsgId = 0; + _saveEditMsgRequestId = 0; + _replyToId = 0; + _replyEditMsg = 0; + _previewData = 0; _previewCache.clear(); + _fieldBarCancel.hide(); + if (_list) _list->deleteLater(); _list = 0; _scroll.takeWidget(); @@ -3552,39 +3633,20 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re App::main()->peerUpdated(_peer); - if (_history->draftToId > 0 || !_history->draft.isEmpty()) { - applyDraft(false); - _replyToId = readyToForward() ? 0 : _history->draftToId; - } else if (_migrated && !_migrated->draft.isEmpty()) { - _history->draft = _migrated->draft; - _history->draftCursor = _migrated->draftCursor; - _history->draftPreviewCancelled = _migrated->draftPreviewCancelled; - _history->draftToId = 0; - _migrated->draft = QString(); // use migrated draft only once - applyDraft(false); - _replyToId = 0; - } else { - bool fromMigrated = false; - Local::MessageDraft draft = Local::readDraft(_peer->id); - if (draft.replyTo <= 0 && draft.text.isEmpty() && _migrated) { - fromMigrated = true; - draft = Local::readDraft(_migrated->peer->id); + Local::readDraftsWithCursors(_history); + if (_migrated) { + Local::readDraftsWithCursors(_migrated); + _migrated->setEditDraft(Nil); + if (_migrated->msgDraft && !_migrated->msgDraft->text.isEmpty()) { + _migrated->msgDraft->msgId = 0; // edit and reply to drafts can't migrate + if (!_history->msgDraft) { + _history->setMsgDraft(new HistoryDraft(*_migrated->msgDraft)); + } } - setFieldText(draft.text); - _field.setFocus(); - if (!draft.text.isEmpty()) { - MessageCursor cur = Local::readDraftPositions(fromMigrated ? _migrated->peer->id : _peer->id); - _textUpdateEventsFlags = 0; - cur.applyTo(_field); - _textUpdateEventsFlags = TextUpdateEventsSaveDraft | TextUpdateEventsSendTyping; - } - _replyToId = readyToForward() ? 0 : draft.replyTo; - _previewCancelled = draft.previewCancelled; - } - if (_replyToId) { - updateReplyTo(); - if (!_replyTo && App::api()) App::api()->requestReplyTo(0, _peer->asChannel(), _replyToId); + _migrated->setMsgDraft(Nil); } + applyDraft(false); + resizeEvent(0); if (!_previewCancelled) { onPreviewParse(); @@ -3755,7 +3817,7 @@ void HistoryWidget::updateControlsVisibility() { _muteUnmute.hide(); _attachMention.hide(); _field.hide(); - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); _attachDocument.hide(); _attachPhoto.hide(); _attachEmoji.hide(); @@ -3812,7 +3874,7 @@ void HistoryWidget::updateControlsVisibility() { _attachPhoto.hide(); _broadcast.hide(); _kbScroll.hide(); - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); _attachDocument.hide(); _attachPhoto.hide(); _attachEmoji.hide(); @@ -3849,7 +3911,7 @@ void HistoryWidget::updateControlsVisibility() { _attachPhoto.hide(); _broadcast.hide(); _kbScroll.hide(); - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); } else { _unblock.hide(); _botStart.hide(); @@ -3857,11 +3919,9 @@ void HistoryWidget::updateControlsVisibility() { _muteUnmute.hide(); if (cHasAudioCapture() && !_field.hasSendText() && !readyToForward()) { _send.hide(); - setMouseTracking(true); mouseMoveEvent(0); } else { _send.show(); - setMouseTracking(false); _a_record.stop(); _inRecord = _inField = false; a_recordOver = anim::fvalue(0, 0); @@ -3924,14 +3984,14 @@ void HistoryWidget::updateControlsVisibility() { } updateFieldPlaceholder(); } - if (_replyToId || readyToForward() || (_previewData && _previewData->pendingTill >= 0) || _kbReplyTo) { - if (_replyForwardPreviewCancel.isHidden()) { - _replyForwardPreviewCancel.show(); + if (_editMsgId || _replyToId || readyToForward() || (_previewData && _previewData->pendingTill >= 0) || _kbReplyTo) { + if (_fieldBarCancel.isHidden()) { + _fieldBarCancel.show(); resizeEvent(0); update(); } } else { - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); } } } else { @@ -3945,7 +4005,7 @@ void HistoryWidget::updateControlsVisibility() { _attachPhoto.hide(); _broadcast.hide(); _kbScroll.hide(); - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); _attachDocument.hide(); _attachPhoto.hide(); _attachEmoji.hide(); @@ -3961,6 +4021,12 @@ void HistoryWidget::updateControlsVisibility() { update(); } } + updateMouseTracking(); +} + +void HistoryWidget::updateMouseTracking() { + bool trackMouse = !_fieldBarCancel.isHidden() || (cHasAudioCapture() && _send.isHidden() && !_field.isHidden()); + setMouseTracking(trackMouse); } void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) { @@ -4432,12 +4498,84 @@ void HistoryWidget::onCollapseComments() { showHistory(_peer->id, switchAt); } +void HistoryWidget::saveEditMsg() { + if (_saveEditMsgRequestId) return; + + WebPageId webPageId = _previewCancelled ? CancelledWebPageId : ((_previewData && _previewData->pendingTill >= 0) ? _previewData->id : 0); + + EntitiesInText sendingEntities, leftEntities; + QString sendingText, leftText = prepareTextWithEntities(_field.getLastText(), leftEntities, itemTextOptions(_history, App::self()).flags); + + if (!textSplit(sendingText, sendingEntities, leftText, leftEntities, MaxMessageSize)) { + _field.selectAll(); + _field.setFocus(); + return; + } else if (!leftText.isEmpty()) { + Ui::showLayer(new InformBox(lang(lng_edit_too_long))); + return; + } + + int32 sendFlags = 0; + if (webPageId == CancelledWebPageId) { + sendFlags |= MTPmessages_SendMessage::flag_no_webpage; + } + MTPVector localEntities = linksToMTP(sendingEntities), sentEntities = linksToMTP(sendingEntities, true); + if (!sentEntities.c_vector().v.isEmpty()) { + sendFlags |= MTPmessages_SendMessage::flag_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)); +} + +void HistoryWidget::saveEditMsgDone(History *history, const MTPUpdates &updates, mtpRequestId req) { + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } + if (req == _saveEditMsgRequestId) { + _saveEditMsgRequestId = 0; + cancelEdit(); + } + if (history->editDraft && history->editDraft->saveRequest == req) { + history->setEditDraft(Nil); + writeDrafts(history); + } +} + +bool HistoryWidget::saveEditMsgFail(History *history, const RPCError &error, mtpRequestId req) { + if (mtpIsFlood(error)) return false; + if (req == _saveEditMsgRequestId) { + _saveEditMsgRequestId = 0; + } + if (history->editDraft && history->editDraft->saveRequest == req) { + history->editDraft->saveRequest = 0; + } + + QString err = error.type(); + if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) { + Ui::showLayer(new InformBox(lang(lng_edit_error))); + } else if (err == qstr("MESSAGE_NOT_MODIFIED")) { + cancelEdit(); + } else if (err == qstr("MESSAGE_EMPTY")) { + _field.selectAll(); + _field.setFocus(); + } else { + Ui::showLayer(new InformBox(lang(lng_edit_error))); + } + update(); + return true; +} + void HistoryWidget::onSend(bool ctrlShiftEnter, MsgId replyTo) { if (!_history) return; + if (_editMsgId) { + saveEditMsg(); + return; + } + bool lastKeyboardUsed = lastForceReplyReplied(FullMsgId(_channel, replyTo)); WebPageId webPageId = _previewCancelled ? CancelledWebPageId : ((_previewData && _previewData->pendingTill >= 0) ? _previewData->id : 0); + App::main()->sendMessage(_history, _field.getLastText(), replyTo, _broadcast.checked(), webPageId); setFieldText(QString()); @@ -4658,7 +4796,7 @@ void HistoryWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTo _kbHide.hide(); _cmdStart.hide(); _field.hide(); - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); _send.hide(); _unblock.hide(); _botStart.hide(); @@ -4846,7 +4984,7 @@ void HistoryWidget::mouseMoveEvent(QMouseEvent *e) { QPoint pos(e ? e->pos() : mapFromGlobal(QCursor::pos())); bool inRecord = _send.geometry().contains(pos); bool inField = pos.y() >= (_scroll.y() + _scroll.height()) && pos.y() < height() && pos.x() >= 0 && pos.x() < width(); - bool inReply = QRect(st::replySkip, _field.y() - st::sendPadding - st::replyHeight, width() - st::replySkip - _replyForwardPreviewCancel.width(), st::replyHeight).contains(pos) && replyToId(); + bool inReplyEdit = QRect(st::replySkip, _field.y() - st::sendPadding - st::replyHeight, width() - st::replySkip - _fieldBarCancel.width(), st::replyHeight).contains(pos) && (_editMsgId || replyToId()); bool startAnim = false; if (inRecord != _inRecord) { _inRecord = inRecord; @@ -4862,9 +5000,9 @@ void HistoryWidget::mouseMoveEvent(QMouseEvent *e) { a_recordCancel.start(_inField ? st::recordCancel->c : st::recordCancelActive->c); startAnim = true; } - if (inReply != _inReply) { - _inReply = inReply; - setCursor(inReply ? style::cur_pointer : style::cur_default); + if (inReplyEdit != _inReplyEdit) { + _inReplyEdit = inReplyEdit; + setCursor(inReplyEdit ? style::cur_pointer : style::cur_default); } if (startAnim) _a_record.start(); } @@ -5204,8 +5342,9 @@ void HistoryWidget::onKbToggle(bool manual) { _field.setMaxHeight(st::maxFieldHeight); _kbReplyTo = 0; - if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !_replyToId) { - _replyForwardPreviewCancel.hide(); + if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !_editMsgId && !_replyToId) { + _fieldBarCancel.hide(); + updateMouseTracking(); } } else { if (_history) { @@ -5223,10 +5362,11 @@ void HistoryWidget::onKbToggle(bool manual) { _field.setMaxHeight(st::maxFieldHeight); _kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard.forceReply()) ? App::histItemById(_keyboard.forMsgId()) : 0; - if (_kbReplyTo && !_replyToId) { + if (_kbReplyTo && !_editMsgId && !_replyToId) { updateReplyToName(); - _replyToText.setText(st::msgFont, _kbReplyTo->inDialogsText(), _textDlgOptions); - _replyForwardPreviewCancel.show(); + _replyEditMsgText.setText(st::msgFont, _kbReplyTo->inDialogsText(), _textDlgOptions); + _fieldBarCancel.show(); + updateMouseTracking(); } if (manual && _history) { _history->lastKeyboardHiddenId = 0; @@ -5241,10 +5381,11 @@ void HistoryWidget::onKbToggle(bool manual) { _field.setMaxHeight(st::maxFieldHeight - maxh); _kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard.forceReply()) ? App::histItemById(_keyboard.forMsgId()) : 0; - if (_kbReplyTo && !_replyToId) { + if (_kbReplyTo && !_editMsgId && !_replyToId) { updateReplyToName(); - _replyToText.setText(st::msgFont, _kbReplyTo->inDialogsText(), _textDlgOptions); - _replyForwardPreviewCancel.show(); + _replyEditMsgText.setText(st::msgFont, _kbReplyTo->inDialogsText(), _textDlgOptions); + _fieldBarCancel.show(); + updateMouseTracking(); } if (manual && _history) { _history->lastKeyboardHiddenId = 0; @@ -5414,7 +5555,7 @@ void HistoryWidget::onFieldResize() { _kbScroll.setGeometry(0, height() - kbh, width(), kbh); } _field.move(_attachDocument.x() + _attachDocument.width(), height() - kbh - _field.height() - st::sendPadding); - _replyForwardPreviewCancel.move(width() - _replyForwardPreviewCancel.width(), _field.y() - st::sendPadding - _replyForwardPreviewCancel.height()); + _fieldBarCancel.move(width() - _fieldBarCancel.width(), _field.y() - st::sendPadding - _fieldBarCancel.height()); _attachDocument.move(0, height() - kbh - _attachDocument.height()); _attachPhoto.move(_attachDocument.x(), _attachDocument.y()); @@ -5454,12 +5595,18 @@ void HistoryWidget::onCheckMentionDropdown() { } void HistoryWidget::updateFieldPlaceholder() { - if (_inlineBot && _inlineBot != InlineBotLookingUpData) { - _field.setPlaceholder(_inlineBot->botInfo->inlinePlaceholder.mid(1), _inlineBot->username.size() + 2); - } else if (hasBroadcastToggle()) { - _field.setPlaceholder(lang(_broadcast.checked() ? lng_broadcast_ph : lng_comment_ph)); + if (_editMsgId) { + _field.setPlaceholder(lang(lng_edit_message_text)); + _send.setText(lang(lng_settings_save)); } else { - _field.setPlaceholder(lang((_history && _history->isChannel() && !_history->isMegagroup()) ? (_peer->asChannel()->canPublish() ? lng_broadcast_ph : lng_comment_ph) : lng_message_ph)); + if (_inlineBot && _inlineBot != InlineBotLookingUpData) { + _field.setPlaceholder(_inlineBot->botInfo->inlinePlaceholder.mid(1), _inlineBot->username.size() + 2); + } else if (hasBroadcastToggle()) { + _field.setPlaceholder(lang(_broadcast.checked() ? lng_broadcast_ph : lng_comment_ph)); + } else { + _field.setPlaceholder(lang((_history && _history->isChannel() && !_history->isMegagroup()) ? (_peer->asChannel()->canPublish() ? lng_broadcast_ph : lng_comment_ph) : lng_message_ph)); + } + _send.setText(lang(lng_send_button)); } } @@ -5896,7 +6043,7 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { _attachDocument.move(0, height() - kbh - _attachDocument.height()); _attachPhoto.move(_attachDocument.x(), _attachDocument.y()); - _replyForwardPreviewCancel.move(width() - _replyForwardPreviewCancel.width(), _field.y() - st::sendPadding - _replyForwardPreviewCancel.height()); + _fieldBarCancel.move(width() - _fieldBarCancel.width(), _field.y() - st::sendPadding - _fieldBarCancel.height()); updateListSize(App::main() ? App::main()->contentScrollAddToY() : 0); bool kbShowShown = _history && !_kbShown && _keyboard.hasMarkup(); @@ -5945,8 +6092,12 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { void HistoryWidget::itemRemoved(HistoryItem *item) { if (_list) _list->itemRemoved(item); - if (item == _replyTo) { - cancelReply(); + if (item == _replyEditMsg) { + if (_editMsgId) { + cancelEdit(); + } else { + cancelReply(); + } } if (item == _replyReturn) { calcNextReplyReturn(); @@ -5980,7 +6131,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, if (_canSendMessages) { newScrollHeight -= (_field.height() + 2 * st::sendPadding); } - if (replyToId() || readyToForward() || (_previewData && _previewData->pendingTill >= 0)) { + if (_editMsgId || replyToId() || readyToForward() || (_previewData && _previewData->pendingTill >= 0)) { newScrollHeight -= st::replyHeight; } if (_kbShown) { @@ -6163,22 +6314,22 @@ void HistoryWidget::updateBotKeyboard(History *h) { bool changed = false; bool wasVisible = _kbShown || _kbReplyTo; - if ((_replyToId && !_replyTo) || !_history) { + if ((_replyToId && !_replyEditMsg) || _editMsgId || !_history) { changed = _keyboard.updateMarkup(0); - } else if (_replyTo) { - changed = _keyboard.updateMarkup(_replyTo); + } else if (_replyToId && _replyEditMsg) { + changed = _keyboard.updateMarkup(_replyEditMsg); } else { changed = _keyboard.updateMarkup(_history->lastKeyboardId ? App::histItemById(_channel, _history->lastKeyboardId) : 0); } updateCmdStartShown(); if (!changed) return; - bool hasMarkup = _keyboard.hasMarkup(), forceReply = _keyboard.forceReply() && !_replyTo; + bool hasMarkup = _keyboard.hasMarkup(), forceReply = _keyboard.forceReply() && (!_replyToId || !_replyEditMsg); if (hasMarkup || forceReply) { if (_keyboard.singleUse() && _keyboard.hasMarkup() && _keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _history->lastKeyboardUsed) { _history->lastKeyboardHiddenId = _history->lastKeyboardId; } - if (!isBotStart() && !isBlocked() && _canSendMessages && (wasVisible || _replyTo || (!_field.hasSendText() && !kbWasHidden()))) { + if (!isBotStart() && !isBlocked() && _canSendMessages && (wasVisible || (_replyToId && _replyEditMsg) || (!_field.hasSendText() && !kbWasHidden()))) { if (!_a_show.animating()) { if (hasMarkup) { _kbScroll.show(); @@ -6198,8 +6349,9 @@ void HistoryWidget::updateBotKeyboard(History *h) { _kbReplyTo = (_peer->isChat() || _peer->isChannel() || _keyboard.forceReply()) ? App::histItemById(_keyboard.forMsgId()) : 0; if (_kbReplyTo && !_replyToId) { updateReplyToName(); - _replyToText.setText(st::msgFont, _kbReplyTo->inDialogsText(), _textDlgOptions); - _replyForwardPreviewCancel.show(); + _replyEditMsgText.setText(st::msgFont, _kbReplyTo->inDialogsText(), _textDlgOptions); + _fieldBarCancel.show(); + updateMouseTracking(); } } else { if (!_a_show.animating()) { @@ -6213,7 +6365,8 @@ void HistoryWidget::updateBotKeyboard(History *h) { _kbShown = false; _kbReplyTo = 0; if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !_replyToId) { - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); + updateMouseTracking(); } } } else { @@ -6227,8 +6380,9 @@ void HistoryWidget::updateBotKeyboard(History *h) { _field.setMaxHeight(st::maxFieldHeight); _kbShown = false; _kbReplyTo = 0; - if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !_replyToId) { - _replyForwardPreviewCancel.hide(); + if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !_replyToId && !_editMsgId) { + _fieldBarCancel.hide(); + updateMouseTracking(); } } resizeEvent(0); @@ -6271,7 +6425,7 @@ void HistoryWidget::updateCollapseCommentsVisibility() { void HistoryWidget::mousePressEvent(QMouseEvent *e) { _replyForwardPressed = QRect(0, _field.y() - st::sendPadding - st::replyHeight, st::replySkip, st::replyHeight).contains(e->pos()); - if (_replyForwardPressed && !_replyForwardPreviewCancel.isHidden()) { + if (_replyForwardPressed && !_fieldBarCancel.isHidden()) { updateField(); } else if (_inRecord && cHasAudioCapture()) { audioCapture()->start(); @@ -6285,8 +6439,8 @@ void HistoryWidget::mousePressEvent(QMouseEvent *e) { a_recordDown.start(1); a_recordOver.restart(); _a_record.start(); - } else if (_inReply) { - Ui::showPeerHistory(_peer, replyToId()); + } else if (_inReplyEdit) { + Ui::showPeerHistory(_peer, _editMsgId ? _editMsgId : replyToId()); } } @@ -6615,16 +6769,25 @@ void HistoryWidget::onReplyToMessage() { App::main()->cancelForwarding(); - _replyTo = to; - _replyToId = to->id; - _replyToText.setText(st::msgFont, _replyTo->inDialogsText(), _textDlgOptions); + if (_editMsgId) { + if (!_history->msgDraft) { + _history->setMsgDraft(new HistoryDraft(QString(), to->id, MessageCursor(), false)); + } else { + _history->msgDraft->msgId = to->id; + } + } else { + _replyEditMsg = to; + _replyToId = to->id; + _replyEditMsgText.setText(st::msgFont, _replyEditMsg->inDialogsText(), _textDlgOptions); - updateBotKeyboard(); + updateBotKeyboard(); - if (!_field.isHidden()) _replyForwardPreviewCancel.show(); - updateReplyToName(); - resizeEvent(0); - updateField(); + if (!_field.isHidden()) _fieldBarCancel.show(); + updateMouseTracking(); + updateReplyToName(); + resizeEvent(0); + updateField(); + } _saveDraftText = true; _saveDraftStart = getms(); @@ -6642,7 +6805,42 @@ void HistoryWidget::onEditMessage() { Ui::showLayer(box); } else { delete box; - // edit post + + if (_replyToId || !_field.getLastText().isEmpty()) { + _history->setMsgDraft(new HistoryDraft(_field, _replyToId, _previewCancelled)); + } else { + _history->setMsgDraft(Nil); + } + + QString text(textApplyEntities(to->originalText(), to->originalEntities())); + _history->setEditDraft(new HistoryEditDraft(text, to->id, MessageCursor(text.size(), text.size(), QFIXED_MAX), false)); + applyDraft(false); + + _previewData = 0; + if (HistoryMedia *media = to->getMedia()) { + if (media->type() == MediaTypeWebPage) { + _previewData = static_cast(media)->webpage(); + updatePreview(); + } + } + if (!_previewData) { + onPreviewParse(); + } + + updateBotKeyboard(); + + if (!_field.isHidden()) _fieldBarCancel.show(); + updateFieldPlaceholder(); + updateMouseTracking(); + updateReplyToName(); + resizeEvent(0); + updateField(); + + _saveDraftText = true; + _saveDraftStart = getms(); + onDraftSave(); + + _field.setFocus(); } } @@ -6652,37 +6850,77 @@ bool HistoryWidget::lastForceReplyReplied(const FullMsgId &replyTo) const { } void HistoryWidget::cancelReply(bool lastKeyboardUsed) { + bool wasReply = _replyToId || (_history && _history->msgDraft && _history->msgDraft->msgId); if (_replyToId) { - _replyTo = 0; + _replyEditMsg = 0; _replyToId = 0; mouseMoveEvent(0); if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !_kbReplyTo) { - _replyForwardPreviewCancel.hide(); + _fieldBarCancel.hide(); + updateMouseTracking(); } updateBotKeyboard(); resizeEvent(0); update(); - + } else if (wasReply) { + if (_history->msgDraft->text.isEmpty()) { + _history->setMsgDraft(Nil); + } else { + _history->msgDraft->msgId = 0; + } + } + if (wasReply) { _saveDraftText = true; _saveDraftStart = getms(); onDraftSave(); } - if (_keyboard.singleUse() && _keyboard.forceReply() && lastKeyboardUsed) { + if (!_editMsgId && _keyboard.singleUse() && _keyboard.forceReply() && lastKeyboardUsed) { if (_kbReplyTo) { onKbToggle(false); } } } +void HistoryWidget::cancelEdit() { + if (!_editMsgId) return; + + _editMsgId = 0; + _replyEditMsg = 0; + _history->setEditDraft(Nil); + applyDraft(); + + if (_saveEditMsgRequestId) { + MTP::cancel(_saveEditMsgRequestId); + _saveEditMsgRequestId = 0; + } + + _saveDraftText = true; + _saveDraftStart = getms(); + onDraftSave(); + + mouseMoveEvent(0); + if (!readyToForward() && (!_previewData || _previewData->pendingTill < 0) && !replyToId()) { + _fieldBarCancel.hide(); + updateMouseTracking(); + } + + onTextChange(); + updateBotKeyboard(); + updateFieldPlaceholder(); + + resizeEvent(0); + update(); +} + void HistoryWidget::cancelForwarding() { updateControlsVisibility(); resizeEvent(0); update(); } -void HistoryWidget::onReplyForwardPreviewCancel() { +void HistoryWidget::onFieldBarCancel() { _replyForwardPressed = false; if (_previewData && _previewData->pendingTill >= 0) { _previewCancelled = true; @@ -6691,6 +6929,8 @@ void HistoryWidget::onReplyForwardPreviewCancel() { _saveDraftText = true; _saveDraftStart = getms(); onDraftSave(); + } else if (_editMsgId) { + cancelEdit(); } else if (readyToForward()) { App::main()->cancelForwarding(); } else if (_replyToId) { @@ -6717,7 +6957,10 @@ void HistoryWidget::previewCancel() { _previewData = 0; _previewLinks.clear(); updatePreview(); - if (!_replyToId && !readyToForward() && !_kbReplyTo) _replyForwardPreviewCancel.hide(); + if (!_editMsgId && !_replyToId && !readyToForward() && !_kbReplyTo) { + _fieldBarCancel.hide(); + updateMouseTracking(); + } } void HistoryWidget::onPreviewParse() { @@ -6781,7 +7024,8 @@ void HistoryWidget::gotPreview(QString links, const MTPMessageMedia &result, mtp void HistoryWidget::updatePreview() { _previewTimer.stop(); if (_previewData && _previewData->pendingTill >= 0) { - _replyForwardPreviewCancel.show(); + _fieldBarCancel.show(); + updateMouseTracking(); if (_previewData->pendingTill) { _previewTitle.setText(st::msgServiceNameFont, lang(lng_preview_loading), _textNameOptions); _previewDescription.setText(st::msgFont, _previewLinks.splitRef(' ').at(0).toString(), _textDlgOptions); @@ -6818,8 +7062,9 @@ void HistoryWidget::updatePreview() { _previewTitle.setText(st::msgServiceNameFont, title, _textNameOptions); _previewDescription.setText(st::msgFont, desc, _textDlgOptions); } - } else if (!readyToForward() && !replyToId()) { - _replyForwardPreviewCancel.hide(); + } else if (!readyToForward() && !replyToId() && !_editMsgId) { + _fieldBarCancel.hide(); + updateMouseTracking(); } resizeEvent(0); update(); @@ -7035,19 +7280,28 @@ void HistoryWidget::updateTopBarSelection() { update(); } -void HistoryWidget::updateReplyTo(bool force) { - if (!_replyToId || _replyTo) return; - _replyTo = App::histItemById(_channel, _replyToId); - if (_replyTo) { - _replyToText.setText(st::msgFont, _replyTo->inDialogsText(), _textDlgOptions); +void HistoryWidget::updateReplyEditTexts(bool force) { + if (_replyEditMsg || (!_editMsgId && !_replyToId)) { + return; + } + _replyEditMsg = App::histItemById(_channel, _editMsgId ? _editMsgId : _replyToId); + if (_replyEditMsg) { + _replyEditMsgText.setText(st::msgFont, _replyEditMsg->inDialogsText(), _textDlgOptions); updateBotKeyboard(); - if (!_field.isHidden() || _recording) _replyForwardPreviewCancel.show(); + if (!_field.isHidden() || _recording) { + _fieldBarCancel.show(); + updateMouseTracking(); + } updateReplyToName(); updateField(); } else if (force) { - cancelReply(); + if (_editMsgId) { + cancelEdit(); + } else { + cancelReply(); + } } } @@ -7061,9 +7315,10 @@ void HistoryWidget::updateForwarding(bool force) { } void HistoryWidget::updateReplyToName() { - if (!_replyTo && (_replyToId || !_kbReplyTo)) return; - _replyToName.setText(st::msgServiceNameFont, App::peerName((_replyTo ? _replyTo : _kbReplyTo)->author()), _textNameOptions); - _replyToNameVersion = (_replyTo ? _replyTo : _kbReplyTo)->author()->nameVersion; + if (_editMsgId) return; + if (!_replyEditMsg && (_replyToId || !_kbReplyTo)) return; + _replyToName.setText(st::msgServiceNameFont, App::peerName((_replyEditMsg ? _replyEditMsg : _kbReplyTo)->author()), _textNameOptions); + _replyToNameVersion = (_replyEditMsg ? _replyEditMsg : _kbReplyTo)->author()->nameVersion; } void HistoryWidget::updateField() { @@ -7076,9 +7331,9 @@ void HistoryWidget::drawField(Painter &p) { Text *from = 0, *text = 0; bool serviceColor = false, hasForward = readyToForward(); ImagePtr preview; - HistoryItem *drawReplyTo = _replyToId ? _replyTo : _kbReplyTo; - if (_replyToId || (!hasForward && _kbReplyTo)) { - if (drawReplyTo && drawReplyTo->author()->nameVersion > _replyToNameVersion) { + HistoryItem *drawMsgText = (_editMsgId || _replyToId) ? _replyEditMsg : _kbReplyTo; + if (_editMsgId || _replyToId || (!hasForward && _kbReplyTo)) { + if (!_editMsgId && drawMsgText && drawMsgText->author()->nameVersion > _replyToNameVersion) { updateReplyToName(); } backy -= st::replyHeight; @@ -7093,27 +7348,32 @@ void HistoryWidget::drawField(Painter &p) { } bool drawPreview = (_previewData && _previewData->pendingTill >= 0) && !_replyForwardPressed; p.fillRect(0, backy, width(), backh, st::taMsgField.bgColor->b); - if (_replyToId || (!hasForward && _kbReplyTo)) { + if (_editMsgId || _replyToId || (!hasForward && _kbReplyTo)) { int32 replyLeft = st::replySkip; - p.drawPixmap(QPoint(st::replyIconPos.x(), backy + st::replyIconPos.y()), App::sprite(), st::replyIcon); + p.drawPixmap(QPoint(st::replyIconPos.x(), backy + st::replyIconPos.y()), App::sprite(), _editMsgId ? st::editIcon : st::replyIcon); if (!drawPreview) { - if (drawReplyTo) { - if (drawReplyTo->getMedia() && drawReplyTo->getMedia()->hasReplyPreview()) { - ImagePtr replyPreview = drawReplyTo->getMedia()->replyPreview(); + if (drawMsgText) { + if (drawMsgText->getMedia() && drawMsgText->getMedia()->hasReplyPreview()) { + ImagePtr replyPreview = drawMsgText->getMedia()->replyPreview(); if (!replyPreview->isNull()) { QRect to(replyLeft, backy + st::msgReplyPadding.top(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height()); p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height())); } replyLeft += st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x(); } - p.setPen(st::replyColor->p); - _replyToName.drawElided(p, replyLeft, backy + st::msgReplyPadding.top(), width() - replyLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right()); - p.setPen((((drawReplyTo->toHistoryMessage() && drawReplyTo->toHistoryMessage()->emptyText()) || drawReplyTo->serviceMsg()) ? st::msgInDateFg : st::msgColor)->p); - _replyToText.drawElided(p, replyLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - replyLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right()); + p.setPen(st::replyColor); + if (_editMsgId) { + p.setFont(st::msgServiceNameFont); + p.drawText(replyLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->ascent, lang(lng_edit_message)); + } else { + _replyToName.drawElided(p, replyLeft, backy + st::msgReplyPadding.top(), width() - replyLeft - _fieldBarCancel.width() - st::msgReplyPadding.right()); + } + p.setPen((((drawMsgText->toHistoryMessage() && drawMsgText->toHistoryMessage()->emptyText()) || drawMsgText->serviceMsg()) ? st::msgInDateFg : st::msgColor)->p); + _replyEditMsgText.drawElided(p, replyLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - replyLeft - _fieldBarCancel.width() - st::msgReplyPadding.right()); } else { p.setFont(st::msgDateFont->f); p.setPen(st::msgInDateFg->p); - p.drawText(replyLeft, backy + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - replyLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right())); + p.drawText(replyLeft, backy + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - replyLeft - _fieldBarCancel.width() - st::msgReplyPadding.right())); } } } else if (from && text) { @@ -7131,9 +7391,9 @@ void HistoryWidget::drawField(Painter &p) { forwardLeft += st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x(); } p.setPen(st::replyColor->p); - from->drawElided(p, forwardLeft, backy + st::msgReplyPadding.top(), width() - forwardLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right()); + from->drawElided(p, forwardLeft, backy + st::msgReplyPadding.top(), width() - forwardLeft - _fieldBarCancel.width() - st::msgReplyPadding.right()); p.setPen((serviceColor ? st::msgInDateFg : st::msgColor)->p); - text->drawElided(p, forwardLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - forwardLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right()); + text->drawElided(p, forwardLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - forwardLeft - _fieldBarCancel.width() - st::msgReplyPadding.right()); } } if (drawPreview) { @@ -7153,9 +7413,9 @@ void HistoryWidget::drawField(Painter &p) { previewLeft += st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x(); } p.setPen(st::replyColor->p); - _previewTitle.drawElided(p, previewLeft, backy + st::msgReplyPadding.top(), width() - previewLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right()); + _previewTitle.drawElided(p, previewLeft, backy + st::msgReplyPadding.top(), width() - previewLeft - _fieldBarCancel.width() - st::msgReplyPadding.right()); p.setPen(st::msgColor->p); - _previewDescription.drawElided(p, previewLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - previewLeft - _replyForwardPreviewCancel.width() - st::msgReplyPadding.right()); + _previewDescription.drawElided(p, previewLeft, backy + st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - previewLeft - _fieldBarCancel.width() - st::msgReplyPadding.right()); } } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index d18f081035..4c82a86312 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -505,9 +505,10 @@ public: void updateScrollColors(); MsgId replyToId() const; - void updateReplyTo(bool force = false); + void updateReplyEditTexts(bool force = false); bool lastForceReplyReplied(const FullMsgId &replyTo = FullMsgId(NoChannel, -1)) const; void cancelReply(bool lastKeyboardUsed = false); + void cancelEdit(); void updateForwarding(bool force = false); void cancelForwarding(); // called by MainWidget @@ -595,7 +596,7 @@ public slots: void onCancel(); void onReplyToMessage(); void onEditMessage(); - void onReplyForwardPreviewCancel(); + void onFieldBarCancel(); void onCancelSendAction(); @@ -689,12 +690,17 @@ public slots: private: MsgId _replyToId; - HistoryItem *_replyTo; - Text _replyToName, _replyToText; + Text _replyToName; int32 _replyToNameVersion; - IconedButton _replyForwardPreviewCancel; void updateReplyToName(); + MsgId _editMsgId; + + HistoryItem *_replyEditMsg; + Text _replyEditMsgText; + + IconedButton _fieldBarCancel; + void sendExistingDocument(DocumentData *doc, const QString &caption); void sendExistingPhoto(PhotoData *photo, const QString &caption); @@ -702,6 +708,13 @@ private: void drawRecordButton(Painter &p); void drawRecording(Painter &p); + void updateMouseTracking(); + + mtpRequestId _saveEditMsgRequestId; + void saveEditMsg(); + void saveEditMsgDone(History *history, const MTPUpdates &updates, mtpRequestId req); + bool saveEditMsgFail(History *history, const RPCError &error, mtpRequestId req); + DBIPeerReportSpamStatus _reportSpamStatus; void updateReportSpamStatus(); @@ -747,7 +760,8 @@ private: void savedGifsGot(const MTPmessages_SavedGifs &gifs); bool savedGifsFailed(const RPCError &error); - void writeDraft(MsgId *replyTo = 0, const QString *text = 0, const MessageCursor *cursor = 0, bool *previewCancelled = 0); + void writeDrafts(HistoryDraft **msgDraft, HistoryEditDraft **editDraft); + void writeDrafts(History *history); void setFieldText(const QString &text, int32 textUpdateEventsFlags = 0, bool clearUndoHistory = true); QStringList getMediasFromMime(const QMimeData *d); @@ -806,7 +820,7 @@ private: bool _cmdStartShown; MessageField _field; Animation _a_record, _a_recording; - bool _recording, _inRecord, _inField, _inReply; + bool _recording, _inRecord, _inField, _inReplyEdit; anim::ivalue a_recordingLevel; int32 _recordingSamples; anim::fvalue a_recordOver, a_recordDown; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 1c0c7f5540..fb5ed2fbda 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -557,7 +557,7 @@ namespace { }; typedef QMap DraftsMap; - DraftsMap _draftsMap, _draftsPositionsMap; + DraftsMap _draftsMap, _draftCursorsMap; typedef QMap DraftsNotReadMap; DraftsNotReadMap _draftsNotReadMap; @@ -1672,7 +1672,7 @@ namespace { } LOG(("App Info: reading encrypted map..")); - DraftsMap draftsMap, draftsPositionsMap; + DraftsMap draftsMap, draftCursorsMap; DraftsNotReadMap draftsNotReadMap; StorageMap imagesMap, stickerImagesMap, audiosMap; qint64 storageImagesSize = 0, storageStickersSize = 0, storageAudiosSize = 0; @@ -1701,7 +1701,7 @@ namespace { FileKey key; quint64 p; map.stream >> key >> p; - draftsPositionsMap.insert(p, key); + draftCursorsMap.insert(p, key); } } break; case lskImages: { @@ -1781,7 +1781,7 @@ namespace { } _draftsMap = draftsMap; - _draftsPositionsMap = draftsPositionsMap; + _draftCursorsMap = draftCursorsMap; _draftsNotReadMap = draftsNotReadMap; _imagesMap = imagesMap; @@ -1860,7 +1860,7 @@ namespace { uint32 mapSize = 0; if (!_draftsMap.isEmpty()) mapSize += sizeof(quint32) * 2 + _draftsMap.size() * sizeof(quint64) * 2; - if (!_draftsPositionsMap.isEmpty()) mapSize += sizeof(quint32) * 2 + _draftsPositionsMap.size() * sizeof(quint64) * 2; + if (!_draftCursorsMap.isEmpty()) mapSize += sizeof(quint32) * 2 + _draftCursorsMap.size() * sizeof(quint64) * 2; if (!_imagesMap.isEmpty()) mapSize += sizeof(quint32) * 2 + _imagesMap.size() * (sizeof(quint64) * 3 + sizeof(qint32)); if (!_stickerImagesMap.isEmpty()) mapSize += sizeof(quint32) * 2 + _stickerImagesMap.size() * (sizeof(quint64) * 3 + sizeof(qint32)); if (!_audiosMap.isEmpty()) mapSize += sizeof(quint32) * 2 + _audiosMap.size() * (sizeof(quint64) * 3 + sizeof(qint32)); @@ -1880,9 +1880,9 @@ namespace { mapData.stream << quint64(i.value()) << quint64(i.key()); } } - if (!_draftsPositionsMap.isEmpty()) { - mapData.stream << quint32(lskDraftPosition) << quint32(_draftsPositionsMap.size()); - for (DraftsMap::const_iterator i = _draftsPositionsMap.cbegin(), e = _draftsPositionsMap.cend(); i != e; ++i) { + if (!_draftCursorsMap.isEmpty()) { + mapData.stream << quint32(lskDraftPosition) << quint32(_draftCursorsMap.size()); + for (DraftsMap::const_iterator i = _draftCursorsMap.cbegin(), e = _draftCursorsMap.cend(); i != e; ++i) { mapData.stream << quint64(i.value()) << quint64(i.key()); } } @@ -2180,7 +2180,7 @@ namespace Local { _passKeySalt.clear(); // reset passcode, local key _draftsMap.clear(); - _draftsPositionsMap.clear(); + _draftCursorsMap.clear(); _fileLocations.clear(); _fileLocationPairs.clear(); _fileLocationAliases.clear(); @@ -2237,10 +2237,10 @@ namespace Local { return _oldSettingsVersion; } - void writeDraft(const PeerId &peer, const MessageDraft &draft) { + void writeDrafts(const PeerId &peer, const MessageDraft &msgDraft, const MessageDraft &editDraft) { if (!_working()) return; - if (draft.replyTo <= 0 && draft.text.isEmpty()) { + if (msgDraft.msgId <= 0 && msgDraft.text.isEmpty() && editDraft.msgId <= 0) { DraftsMap::iterator i = _draftsMap.find(peer); if (i != _draftsMap.cend()) { clearKey(i.value()); @@ -2257,8 +2257,12 @@ namespace Local { _mapChanged = true; _writeMap(WriteMapFast); } - EncryptedDescriptor data(sizeof(quint64) + _stringSize(draft.text) + sizeof(qint32)); - data.stream << quint64(peer) << draft.text << qint32(draft.replyTo) << qint32(draft.previewCancelled ? 1 : 0); + + EncryptedDescriptor data(sizeof(quint64) + _stringSize(msgDraft.text) + 2 * sizeof(qint32) + _stringSize(editDraft.text) + 2 * sizeof(qint32)); + data.stream << quint64(peer); + data.stream << msgDraft.text << qint32(msgDraft.msgId) << qint32(msgDraft.previewCancelled ? 1 : 0); + data.stream << editDraft.text << qint32(editDraft.msgId) << qint32(editDraft.previewCancelled ? 1 : 0); + FileWriteDescriptor file(i.value()); file.writeEncrypted(data); @@ -2266,75 +2270,123 @@ namespace Local { } } - MessageDraft readDraft(const PeerId &peer) { - if (!_draftsNotReadMap.remove(peer)) return MessageDraft(); + void clearDraftCursors(const PeerId &peer) { + DraftsMap::iterator i = _draftCursorsMap.find(peer); + if (i != _draftCursorsMap.cend()) { + clearKey(i.value()); + _draftCursorsMap.erase(i); + _mapChanged = true; + _writeMap(); + } + } + + void _readDraftCursors(const PeerId &peer, MessageCursor &msgCursor, MessageCursor &editCursor) { + DraftsMap::iterator j = _draftCursorsMap.find(peer); + if (j == _draftCursorsMap.cend()) { + return; + } + + FileReadDescriptor draft; + if (!readEncryptedFile(draft, j.value())) { + clearDraftCursors(peer); + return; + } + quint64 draftPeer; + qint32 msgPosition = 0, msgAnchor = 0, msgScroll = QFIXED_MAX; + qint32 editPosition = 0, editAnchor = 0, editScroll = QFIXED_MAX; + draft.stream >> draftPeer >> msgPosition >> msgAnchor >> msgScroll; + if (!draft.stream.atEnd()) { + draft.stream >> editPosition >> editAnchor >> editScroll; + } + + if (draftPeer != peer) { + clearDraftCursors(peer); + return; + } + + msgCursor = MessageCursor(msgPosition, msgAnchor, msgScroll); + editCursor = MessageCursor(editPosition, editAnchor, editScroll); + } + + void readDraftsWithCursors(History *h) { + PeerId peer = h->peer->id; + if (!_draftsNotReadMap.remove(peer)) { + clearDraftCursors(peer); + return; + } DraftsMap::iterator j = _draftsMap.find(peer); if (j == _draftsMap.cend()) { - return MessageDraft(); + clearDraftCursors(peer); + return; } FileReadDescriptor draft; if (!readEncryptedFile(draft, j.value())) { clearKey(j.value()); _draftsMap.erase(j); - return MessageDraft(); + clearDraftCursors(peer); + return; } - quint64 draftPeer; - QString draftText; - qint32 draftReplyTo = 0, draftPreviewCancelled = 0; - draft.stream >> draftPeer >> draftText; - if (draft.version >= 7021) draft.stream >> draftReplyTo; - if (draft.version >= 8001) draft.stream >> draftPreviewCancelled; - return (draftPeer == peer) ? MessageDraft(MsgId(draftReplyTo), draftText, (draftPreviewCancelled == 1)) : MessageDraft(); + quint64 draftPeer = 0; + QString msgText, editText; + qint32 msgReplyTo = 0, msgPreviewCancelled = 0, editMsgId = 0, editPreviewCancelled = 0; + draft.stream >> draftPeer >> msgText; + if (draft.version >= 7021) { + draft.stream >> msgReplyTo; + if (draft.version >= 8001) { + draft.stream >> msgPreviewCancelled; + if (!draft.stream.atEnd()) { + draft.stream >> editText >> editMsgId >> editPreviewCancelled; + } + } + } + if (draftPeer != peer) { + clearKey(j.value()); + _draftsMap.erase(j); + clearDraftCursors(peer); + return; + } + + MessageCursor msgCursor, editCursor; + _readDraftCursors(peer, msgCursor, editCursor); + + if (msgText.isEmpty() && !msgReplyTo) { + h->setMsgDraft(Nil); + } else { + h->setMsgDraft(new HistoryDraft(msgText, msgReplyTo, msgCursor, msgPreviewCancelled)); + } + if (!editMsgId) { + h->setEditDraft(Nil); + } else { + h->setEditDraft(new HistoryEditDraft(editText, editMsgId, editCursor, editPreviewCancelled)); + } } - void writeDraftPositions(const PeerId &peer, const MessageCursor &cur) { + void writeDraftCursors(const PeerId &peer, const MessageCursor &msgCursor, const MessageCursor &editCursor) { if (!_working()) return; - if (cur.position == 0 && cur.anchor == 0 && cur.scroll == QFIXED_MAX) { - DraftsMap::iterator i = _draftsPositionsMap.find(peer); - if (i != _draftsPositionsMap.cend()) { - clearKey(i.value()); - _draftsPositionsMap.erase(i); - _mapChanged = true; - _writeMap(); - } + if (msgCursor == MessageCursor() && editCursor == MessageCursor()) { + clearDraftCursors(peer); } else { - DraftsMap::const_iterator i = _draftsPositionsMap.constFind(peer); - if (i == _draftsPositionsMap.cend()) { - i = _draftsPositionsMap.insert(peer, genKey()); + DraftsMap::const_iterator i = _draftCursorsMap.constFind(peer); + if (i == _draftCursorsMap.cend()) { + i = _draftCursorsMap.insert(peer, genKey()); _mapChanged = true; _writeMap(WriteMapFast); } + EncryptedDescriptor data(sizeof(quint64) + sizeof(qint32) * 3); - data.stream << quint64(peer) << qint32(cur.position) << qint32(cur.anchor) << qint32(cur.scroll); + data.stream << quint64(peer) << qint32(msgCursor.position) << qint32(msgCursor.anchor) << qint32(msgCursor.scroll); + data.stream << qint32(editCursor.position) << qint32(editCursor.anchor) << qint32(editCursor.scroll); + FileWriteDescriptor file(i.value()); file.writeEncrypted(data); } } - MessageCursor readDraftPositions(const PeerId &peer) { - DraftsMap::iterator j = _draftsPositionsMap.find(peer); - if (j == _draftsPositionsMap.cend()) { - return MessageCursor(); - } - FileReadDescriptor draft; - if (!readEncryptedFile(draft, j.value())) { - clearKey(j.value()); - _draftsPositionsMap.erase(j); - return MessageCursor(); - } - - quint64 draftPeer; - qint32 curPosition, curAnchor, curScroll; - draft.stream >> draftPeer >> curPosition >> curAnchor >> curScroll; - - return (draftPeer == peer) ? MessageCursor(curPosition, curAnchor, curScroll) : MessageCursor(); - } - - bool hasDraftPositions(const PeerId &peer) { - return (_draftsPositionsMap.constFind(peer) != _draftsPositionsMap.cend()); + bool hasDraftCursors(const PeerId &peer) { + return (_draftCursorsMap.constFind(peer) != _draftCursorsMap.cend()); } void writeFileLocation(MediaKey location, const FileLocation &local) { @@ -3795,8 +3847,8 @@ namespace Local { _draftsMap.clear(); _mapChanged = true; } - if (!_draftsPositionsMap.isEmpty()) { - _draftsPositionsMap.clear(); + if (!_draftCursorsMap.isEmpty()) { + _draftCursorsMap.clear(); _mapChanged = true; } if (_locationsKey) { diff --git a/Telegram/SourceFiles/localstorage.h b/Telegram/SourceFiles/localstorage.h index 607ec9d0ff..58df7dc7df 100644 --- a/Telegram/SourceFiles/localstorage.h +++ b/Telegram/SourceFiles/localstorage.h @@ -106,17 +106,16 @@ namespace Local { int32 oldSettingsVersion(); struct MessageDraft { - MessageDraft(MsgId replyTo = 0, QString text = QString(), bool previewCancelled = false) : replyTo(replyTo), text(text), previewCancelled(previewCancelled) { + MessageDraft(MsgId msgId = 0, QString text = QString(), bool previewCancelled = false) : msgId(msgId), text(text), previewCancelled(previewCancelled) { } - MsgId replyTo; + MsgId msgId; QString text; bool previewCancelled; }; - void writeDraft(const PeerId &peer, const MessageDraft &draft); - MessageDraft readDraft(const PeerId &peer); - void writeDraftPositions(const PeerId &peer, const MessageCursor &cur); - MessageCursor readDraftPositions(const PeerId &peer); - bool hasDraftPositions(const PeerId &peer); + void writeDrafts(const PeerId &peer, const MessageDraft &msgDraft, const MessageDraft &editDraft); + void readDraftsWithCursors(History *h); + void writeDraftCursors(const PeerId &peer, const MessageCursor &msgCursor, const MessageCursor &editCursor); + bool hasDraftCursors(const PeerId &peer); void writeFileLocation(MediaKey location, const FileLocation &local); FileLocation readFileLocation(MediaKey location, bool check = true); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 05d65d9a72..349568c2ba 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -516,10 +516,8 @@ bool MainWidget::onShareUrl(const PeerId &peer, const QString &url, const QStrin return false; } History *h = App::history(peer); - h->draft = url + '\n' + text; - h->draftCursor.anchor = url.size() + 1; - h->draftCursor.position = h->draftCursor.anchor + text.size(); - h->draftPreviewCancelled = false; + h->setMsgDraft(new HistoryDraft(url + '\n' + text, 0, MessageCursor(url.size() + 1, url.size() + 1 + text.size(), QFIXED_MAX), false)); + h->setEditDraft(Nil); bool opened = history.peer() && (history.peer()->id == peer); if (opened) { history.applyDraft(); @@ -2039,7 +2037,7 @@ ApiWrap *MainWidget::api() { } void MainWidget::updateReplyTo() { - history.updateReplyTo(true); + history.updateReplyEditTexts(true); } void MainWidget::updateBotKeyboard(History *h) { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 16df19fcd5..86dd227bd0 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -1217,3 +1217,7 @@ struct MessageCursor { } int position, anchor, scroll; }; + +inline bool operator==(const MessageCursor &a, const MessageCursor &b) { + return (a.position == b.position) && (a.anchor == b.anchor) && (a.scroll == b.scroll); +} diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index ce77262ae4..0b16ead7f2 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -35,6 +35,8 @@ uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; // Base types compile-time check +NilPointer Nil; + namespace { template class _TypeSizeCheckerHelper { diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 97a1fe7423..00ef2c51f0 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -36,6 +36,22 @@ T *exchange(T *&ptr) { struct NullType { }; +class NilPointer { +public: + template + operator T*() const { + return 0; + } + template + operator T C::*() const { + return 0; + } + +private: + void operator&() const; +}; +extern NilPointer Nil; + template class OrderedSet : public QMap { public: diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index af8188834c..878e146e64 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,26,0 - PRODUCTVERSION 0,9,26,0 + FILEVERSION 0,9,26,1 + PRODUCTVERSION 0,9,26,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.26.0" + VALUE "FileVersion", "0.9.26.1" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.26.0" + VALUE "ProductVersion", "0.9.26.1" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 30dc689c9b..c7f7c5580f 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.25; + CURRENT_PROJECT_VERSION = 0.9.26; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.25; + CURRENT_PROJECT_VERSION = 0.9.26; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.25; + DYLIB_CURRENT_VERSION = 0.9.26; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.25; + CURRENT_PROJECT_VERSION = 0.9.26; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.25; + DYLIB_CURRENT_VERSION = 0.9.26; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index bc8bffbaf8..7e97206f14 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.26 AppVersionStr 0.9.26 DevChannel 0 -BetaVersion 0 9019002 +BetaVersion 9026001 From 0a9ec55b43c751687f8f1a1a3989ebce237c139a Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 13:33:40 +0300 Subject: [PATCH 119/316] fixed gif start bug on retina displays, langs updated --- Telegram/SourceFiles/gui/animation.cpp | 1 + Telegram/SourceFiles/langs/lang_de.strings | 2 +- Telegram/SourceFiles/langs/lang_it.strings | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index c5c1e02c4a..c667d28f9e 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -378,6 +378,7 @@ QPixmap ClipReader::current(int32 framew, int32 frameh, int32 outerw, int32 oute frame->request.outerh = outerh * factor; QImage cacheForResize; + frame->original.setDevicePixelRatio(factor); frame->pix = QPixmap(); frame->pix = _prepareFrame(frame->request, frame->original, true, cacheForResize); diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 1456713471..f1fad4804b 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -837,7 +837,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}"; "lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen"; -"lng_new_version_text" = "— Neue Option in den Einstellungen hinzugefügt (\"Flexibles Layout für breite Bildschirme\"), um das Layout bei besonders breiten Bildschirmen zu ändern\n— Abstürze in der Linux-Version behoben"; +"lng_new_version_text" = "— Neue Option in den Einstellungen unter 'Hintergrund' hinzugefügt (nennt sich dort \"Flexibles Layout für breite Bildschirme\"), um das Layout bei besonders breiten Bildschirmen zu ändern\n— Abstürze in der Linux-Version behoben"; "lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 9babab03f1..7563d169ce 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -287,7 +287,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_section_cache" = "Archivio locale"; "lng_settings_no_data_cached" = "Non ci sono dati nella cache!"; "lng_settings_images_cached" = "{count:_not_used_|# immagine|# immagini}, {size}"; -"lng_settings_audios_cached" = "{count:_not_used_|# nota vocale|# note vocali}, {size}"; +"lng_settings_audios_cached" = "{count:_not_used_|# messaggio vocale|# messaggi vocali}, {size}"; "lng_local_storage_clear" = "Elimina tutto"; "lng_local_storage_clearing" = "Eliminando.."; "lng_local_storage_cleared" = "Eliminato!"; @@ -438,8 +438,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_songs_header" = "Panoramica file audio"; "lng_profile_files" = "{count:_not_used_|# file|# file} »"; "lng_profile_files_header" = "Panoramica file"; -"lng_profile_audios" = "{count:_not_used_|# nota vocale|# note vocali} »"; -"lng_profile_audios_header" = "Panoramica note vocali"; +"lng_profile_audios" = "{count:_not_used_|# messaggio vocale|# messaggi vocali} »"; +"lng_profile_audios_header" = "Panoramica messaggi vocali"; "lng_profile_shared_links" = "{count:_not_used_|# link condiviso|# link condivisi} »"; "lng_profile_shared_links_header" = "Panoramica link condivisi"; "lng_profile_copy_phone" = "Copia numero di telefono"; @@ -568,18 +568,18 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_media_type_videos" = "Video"; "lng_media_type_songs" = "File audio"; "lng_media_type_files" = "File"; -"lng_media_type_audios" = "Note vocali"; +"lng_media_type_audios" = "Messaggi vocali"; "lng_media_type_links" = "Link condivisi"; "lng_media_open_with" = "Apri con"; "lng_media_download" = "Scarica"; "lng_media_cancel" = "Annulla"; "lng_media_video" = "Video"; -"lng_media_audio" = "Nota vocale"; +"lng_media_audio" = "Messaggio vocale"; "lng_media_auto_settings" = "Impostazioni di download automatico"; "lng_media_auto_photo" = "Download automatico foto"; -"lng_media_auto_audio" = "Download automatico audio"; +"lng_media_auto_audio" = "Download automatico messaggi vocali"; "lng_media_auto_gif" = "Download automatico GIF"; "lng_media_auto_private_chats" = "Chat"; "lng_media_auto_groups" = "Gruppi e canali"; From fe71cb962ef0f87e4274924290c71e7223f2ad34 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 14:38:33 +0300 Subject: [PATCH 120/316] build without resource recompile added in os x --- Telegram/Build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/Build.sh b/Telegram/Build.sh index 615639257f..c0efe0de8b 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -1,5 +1,7 @@ set -e +FastParam="$1" + while IFS='' read -r line || [[ -n "$line" ]]; do set $line eval $1="$2" @@ -189,7 +191,9 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg DropboxSymbolsPath="./../../../Dropbox/Telegram/symbols" - touch "./SourceFiles/telegram.qrc" + if [ "$FastParam" != "fast" ]; then + touch "./SourceFiles/telegram.qrc" + fi xcodebuild -project Telegram.xcodeproj -alltargets -configuration Release build if [ ! -d "$ReleasePath/$BinaryName.app" ]; then From 1313cd1a337b2e1909a791082264a762b37298e1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 18:05:36 +0300 Subject: [PATCH 121/316] lang updated --- Telegram/Resources/lang.strings | 11 ++++++----- Telegram/SourceFiles/boxes/photosendbox.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index cfc0023038..533f036b5e 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -561,8 +561,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link copied to clipboard."; -"lng_forwarded" = "Forwarded from {original}"; -"lng_forwarded_via" = "Forwarded from {original} via {inline_bot}"; +"lng_forwarded" = "Forwarded from {user}"; +"lng_forwarded_channel" = "Forwarded from {channel}"; +"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; +"lng_forwarded_via" = "Forwarded from {channel} via {inline_bot}"; "lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "In reply to"; @@ -653,6 +655,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Write a message.."; "lng_comment_ph" = "Write a comment.."; "lng_broadcast_ph" = "Broadcast a message.."; +"lng_broadcast_silent_ph" = "Silent broadcast.."; "lng_record_cancel" = "Release outside this field to cancel"; "lng_will_be_notified" = "Members will be notified when you post"; "lng_wont_be_notified" = "Members will not be notified when you post"; @@ -763,8 +766,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Could not send a file, because it is larger than 1.5 GB :("; "lng_send_folder" = "Could not send «{name}» because it is a directory :("; -"lng_edit_placeholder" = "Message text"; - "lng_forward_choose" = "Choose recipient.."; "lng_forward_cant" = "Sorry, no way to forward here :("; "lng_forward_confirm" = "Forward to {recipient}?"; @@ -851,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop was updated to version {version}\n\n{changes}\n\nFull version history is available here:\n{link}"; "lng_new_version_minor" = "— Bug fixes and other minor improvements"; -"lng_new_version_text" = "— Adaptive layout for wide screens switch added to Settings\n— Linux version crash fix"; +"lng_new_version_text" = "— Edit your messages in channels and supergroups.\n— Share links to specific posts in channels via the post context menu.\n— Add admin signatures to messages in channels.\n— Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting."; "lng_menu_insert_unicode" = "Insert Unicode control character"; diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index a64a17f357..934a8a41ce 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -494,7 +494,7 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) _field->setCtrlEnterSubmit(CtrlEnterSubmitBoth); } else { QString text = textApplyEntities(msg->originalText(), msg->originalEntities()); - _field = new InputArea(this, st::editTextArea, lang(lng_edit_placeholder), text); + _field = new InputArea(this, st::editTextArea, lang(lng_photo_caption), text); // _field->setMaxLength(MaxMessageSize); // entities can make text in input field larger but still valid _field->setCtrlEnterSubmit(cCtrlEnter() ? CtrlEnterSubmitCtrlEnter : CtrlEnterSubmitEnter); } From 2b6e30bcb58f44bb3f0d55446c144630423762b9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 19:19:54 +0300 Subject: [PATCH 122/316] silent broadcast done --- Telegram/Resources/lang.strings | 2 +- Telegram/Resources/style.txt | 14 +- Telegram/SourceFiles/application.cpp | 4 +- Telegram/SourceFiles/art/sprite.png | Bin 181268 -> 181707 bytes Telegram/SourceFiles/art/sprite_200x.png | Bin 245187 -> 247697 bytes Telegram/SourceFiles/boxes/photosendbox.cpp | 2 +- Telegram/SourceFiles/dialogswidget.cpp | 2 +- Telegram/SourceFiles/fileuploader.cpp | 7 +- Telegram/SourceFiles/fileuploader.h | 6 +- Telegram/SourceFiles/history.cpp | 12 +- Telegram/SourceFiles/historywidget.cpp | 176 ++++++++++++++++---- Telegram/SourceFiles/historywidget.h | 24 ++- Telegram/SourceFiles/layout.cpp | 6 +- Telegram/SourceFiles/localimageloader.h | 8 +- Telegram/SourceFiles/mainwidget.cpp | 53 ++++-- Telegram/SourceFiles/mainwidget.h | 17 +- Telegram/SourceFiles/profilewidget.cpp | 2 +- 17 files changed, 257 insertions(+), 78 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 533f036b5e..96f55498e7 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -564,7 +564,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_forwarded" = "Forwarded from {user}"; "lng_forwarded_channel" = "Forwarded from {channel}"; "lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; -"lng_forwarded_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; "lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "In reply to"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 2068c1fe5b..015fb86da7 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1395,7 +1395,7 @@ broadcastToggle: flatCheckbox { bgColor: white; disColor: black; - width: 36px; + width: 34px; height: 46px; duration: 200; bgFunc: transition(easeOutCirc); @@ -1410,7 +1410,17 @@ broadcastToggle: flatCheckbox { disImageRect: sprite(18px, 125px, 22px, 21px); chkDisImageRect: sprite(18px, 125px, 22px, 21px); - imagePos: point(7px, 12px); + imagePos: point(6px, 12px); +} +silentToggle: flatCheckbox(broadcastToggle) { + width: 33px; + + imageRect: sprite(354px, 242px, 21px, 21px); + chkImageRect: sprite(354px, 221px, 21px, 21px); + overImageRect: sprite(375px, 242px, 21px, 21px); + chkOverImageRect: sprite(375px, 221px, 21px, 21px); + disImageRect: sprite(354px, 242px, 21px, 21px); + chkDisImageRect: sprite(354px, 221px, 21px, 21px); } btnRecordAudio: sprite(379px, 390px, 16px, 24px); btnRecordAudioActive: sprite(379px, 366px, 16px, 24px); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 2d3a4c4cba..dc1f0baee9 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1051,8 +1051,8 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9025) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Adaptive layout for wide screens switch added to Settings\n\xe2\x80\x94 Linux version crash fix");// .replace('@', qsl("@") + QChar(0x200D)); + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9027) { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Edit your messages in channels and supergroups.\n\xe2\x80\x94 Share links to specific posts in channels via the post context menu.\n\xe2\x80\x94 Add admin signatures to messages in channels.\n\xe2\x80\x94 Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting.");// .replace('@', qsl("@") + QChar(0x200D)); } else if (Local::oldMapVersion() < 9026) { versionFeatures = lang(lng_new_version_text).trimmed(); } else { diff --git a/Telegram/SourceFiles/art/sprite.png b/Telegram/SourceFiles/art/sprite.png index 11d3fbb61b14acdf5d354db367b911179094fe38..33ee6037f923e9e8912229cd06054c9fb81832d3 100644 GIT binary patch delta 57485 zcma%ibyQSQ*Y_QA=#=hG0i{d2OG-clk?vBdflG^Yr%Ho}goJcUDczETpn%jMHAsEe z=lQ<%y??%IvDVysnYrhjefIwC`0bM(L+~w*pcVrQU(8rUQd(G4T0|m^5KH!d-Wp=b zaXhnqX7kL(PE=4r?7pp_sHn(&K^r^C`+}19ZSRXoNZ3f+6Benj$9jbIzxrm{T|610 z|34tV@cpz_+^-P|_)QAR4ayrgO_R=qxjSi%+2E7dmm7?(PgpklFkcV0U(il#dEOZJq z0Qh!d0A7HhKo-gX{X4$oq#E@g_;5Dy{gmj{Sn}6 zl%RF9*A|QtXoeSjl)755HCp8Lknu-7#puQX{;st7k+8v)f;)ia+f}Xn(U?xqgS_yo zhxGTGM4UGWKP+LTg;ZE1e6t6r#Q>3!L;&2Tn8W=8U9*j`iP{6e_6}vy*j403KumD#gN+ry56O;%T+m7&N#@9H0vmO{L)B z%N{QR98iX67*jBGMS!)VKr${;0(gMA@PmZf5rymt1UzBeZs&J6Nv)H)?bh+>5`Ohm zhKc@@;<~nxmTwnT_2T>a4~imswNxA!?_mb}wil*~TzJU4fHHt!(@DS16=s7i3yu6~ zyO<=3!$rNXWdv$zx=8?+Jk%RgfM#Fs)r;M^6$VmLR3@lmi-P|fK{ro)HifWH7*~gD z`pSD_;CkomBXaOioIXKp+${uIfjM^8!tXgf!cF4;yPgbJ1LPvoce}Xx^Ef;A!)_Jj ziWG~&`P*V~uCycA*RO9%Ba}Xif05EzJ;@(!%v^K~X}hR_-Vne(jtd8bal2OlGa*s@ zQqm-l3=_!+$N>lrC)N;E8ZwNCF`UEqXO1QKOL2fafQl+$5*PRIy4*R2nGeYew~sUd z&8jrEAy*#vb*KAYv=)$b%N*LBLoZ$mGn*B)OiO6n?4N|qU!9j$9IhPyB_B$O9=1au zyM*+upO5cqJBWXIDjF~iiced(__JW_g6}9=f>(!*VZE?+7}CM!Y+U@uzBs|+z;m0r zD>n4gLN0DXy6$PD`##y|9%JksxUG0-6AbZvXmCwHR_B0tuUZ4!ed)8RnHh~J9npsm z9}FxlSzdTlRjT9Cq+E=i6w=WxdR2sjTfvDcjXQ-oDrb3fSQyNJx7IF#-G8!6qrac)W zV?ySu{Lb4u?S6sQ?>dLZ=k*fOk9?zRT;q^Dqbqj4`?jN^3UI?0fOw-5!M(e z=}@^gze7EGS$~v!uh;=Hx&{A9+e>UkQpu1j$=KLf^!Ea_h`Uc(S@`%sd`(Twp^=f3 z-|g2a0(-csyi%44zuph{_z;x99!?t!V*tY1*|U!>CfQkC=;|Z!LW-Sf(ttP4VRo$j zeSlt{?yH6@Gf#CcS1gRj<;DtzhUCybjJ=b4tWE_y{bc6#;|rd#iAf=(-V-~PLIJc# zE8G?T)Th2?sFyK-56q=5$&GHZ^WM#uDAoI?uAOWIew!C?XW#&KSdS`yjnDmNTCP`0 z9Nz|kBVWh8$LCK%4qUO0{H4cy)jg;$l#;A=CsYP-!>S$606MHl>c0!@Rz5YSl9G~Q zfn%(%uUEftc`|`3s!NhZ{AbmPO6z9@s*3jOB-gA;yVxwKIci{doX!oO!3t4utyrH@ zT%{jXs*q)7waV_Pce2E7GK|?0BY5e$j&M(PAwq)4c^pf3e>{ZBETdC5=`sYizDR2E z#X||q=7+BdbIWW#nK6V2-Q6ta`C9t%L7BX;62nBlqLp-W(nXgibvQ>LKO^eNu+gjY zGWI*xDN$fYz*h=g+kT>3dRF4?A1p$Q%iQjrFIaoLJ2HsT)teV+A9<{hx2hS;Yd-Z} zi6k)pQdZIUU4WqrLcuSBy<*$H$GOdoj4l+d}WKd&HmdBkGAQC$g9t(y_m8f^sy03>M* zP0gOy6x?p9Wl@olEFvOgTxodr_FsKPV{^mMw7}fT<;0c9gAfUo)^YlPoA_Vt&DG$i zVWmhRF`}dUz(1TUxf2tpr)-4JOo%Jfbl?4=Fj;>ao(w&M;_mg+AiNQZzs% zSV!I&J7ofVgH>t#FwmMm@#wL_&pG3^3k)P|30ukQ=?sfe zdZS}SvUc}|laHT2XE=?U87WDOjg8IN*W2ra9!v4SVs=@Abq9FjZQKPaXXd}J$Af98 z(5t1;L2v#GmTsBPNeoiq>FJaW9xHUbyu2^gaz-8A$OqGLa&kWE*ZngK3UskHMn%u5 z(51$27bI6z!;f4>d0LlR#oD<@TCtJeU8j&?ccg@6b|T4TVi%LQLQg` z9j6OdhyAYi!j<`(FAD|mZ+Z$ ze8C8_y4KcKaVe<)F~H8wP6tj*OzZ|c!^cK-wB282Hm*bAON8p%UZv(;b7A^Zw38H5 zqZ!Wnk#TaTsk1(uS}b72z$jJ?@} zoosLM4^eEPVAs0Urtyi6i%MtBt%D!R^B>#jC?Z~Pd| zlK{6M)5=(CaGt(MpqIFNwNsw|OzuK4>+Ta5+j}`yB6JB|d85Cs8yg#46Vx`Q%k|#6 z{49H~-+dV*e*Jg1W-^iP--ihD(Nq$EsvtQS#*O=>ham0727&=QpI!+m6-U2fkvFVD2d8I}YQ^5Z z3JTp`X~PYw<k{(eGIZ|iw zJlDXpy$b^1$HFIDKc_~EOCDZw;N{+eceoABvxQolC-9p>FLms45JuTNC2VCfT%-ua zF?7V&;{P!M2B4emD}A>oUeL3Kl)Cfy6fg|>%*wBouSas z(2RV^}SdzO`KX=Y$BAp_}|Ndwyx8nh?irNojjYN)HsYu^0&8qyHa z@S1`JtA#8q5SgRu%RQ$Mz&4Djbm78+TZuhFC8j; z1K4?e1O;JVHdDZ6%3FzLuf8)znU{N*hnF8EFbjC_K@QEYRedZ#^5Z6t6&aVA_xmKW zsBXQu{%4tK>tBCk7c74#fn%b=rOPBFSTN@L3j5wqu5fBrL)4@pFaB z%@-K?E7X&ij?;(YVq%&}?z%Nls`e+*iMg~+`BK84Mk>&)U{A$3v(y1V8mj5-%FP*h zT0VI;xc|3DuX;Ey?P|L?2@0Kbr3by+{v02-{nOQf>+`kSxp><94x3wBe(RDRS!%_a zxBtF~I1P=)c{QFjE#Ov`Px*G{1qvDPj;ZfS9qL8DoW6Zqm{K$IcJHJpBN{U3vq_gm zI}3}&b-AFk8Fr${bwS%iHo!o}?_l{p7;=R!rc`}s9dcnWl%Q4|aXE~~3q*~~}Z*ZQ0}#VWW$1 z0bJz)CLTMc4r-RJk@zq}SylL6zTVe3!**=9GnW1mC)9d8a{&&zS6BuRA;EJRg`uc}2HWDO=sTxTA@FH-M zceimHFi<7ZnG$rXz+r>EB_Y_HG6j~Gl&IuO`Ic!3v#%&VH2#P}>A-5W^#)!shtOzD zH+*zp6VrBwU~)rptn~izwEhDk7P!*f42PI@4up+Zip{%M1N%*DR{t<(m4#H*&!$Pj z&U>Y(g~Ctrug~Q2>w4hnuW*z3aQ&@&Ux^-Q1&5L!;pJw&vqv8BE?P)3bn-+|o|@zr47$#QD?_J;@)Y zcjRlivGhj`I;)$v65U9I>~UltHxI&Ut$attBE;Pm6cTCg|C$hlMCH^MO=Rcd;sU}u z@l!cihfTGC0`Tl`t?NAVv4<2E&~E7qh{;gRAMx z1u|Pv4wbWk=#iZJ<}dW&irJiNQliYV*C*4BgncvGHSI5UP4!yw?mZzM(wDy|dA-pb zINLYka2&G3MQWbIY`M#hzr=Wc|2tcedFH6koB~>Y5u~Qx-I97RZ!!8SaQxf6`h%Y( z^nh3T#ukKj!K9?5!plyg9%q>XC75kO{0F=#`~9V|TxM|D*TFvlGh9L%VJ~P=*BYr` zwkL~87^I&&Jpgi{&8fqQ02G*I{k?7>Ga@F#3L~NyKe;p1i$6XWp4{8Q?ECyrl2t;n zI4&6a6Y(hEi|&Z2aNE^GCH%ETB63`g-#a$cMRWYJA<%y%p5S$`^%K5f3Zy*3R3ru981EeFuxXp9G|&MhguoN!Kos zZ2MdyIG2>odM>|;S`8rq;p@NP>28-zU-S)@BC;&cW3dbJ8On4C(KAk>Gh=UMNLCQX zqn9uwgb&+mkRu8Umm1Css8y5nt7Nc|^%qN45$t2F>MDySsb30<5U`h6AZl%0_c3 zl5ySG*m$O={A*_&IC>KjM2jom(yurEDVr>reM@Hek&Mh}!*jOXc;Q6pI} zVm6v%7Z(?)2a}jd-a=zr*#VF@6 zlAUj!NhCr;SaS*fUbdn+ThttL%dr!CY@bgZ_uazcv2FY1x51E?7ws`6>-=?24rl^I zH|EdLVvNw8>2m$w`QVKd0La)4B^#+HGW4Xdt2evWbevHRdhbOO(f=ioCx$8+!rV)Nx zT#UK$d|KBP!j`}H2ZB?; zEH%mY-}6BqA0IANH8rNwOo1!%Cvs*8~b%`~Tz!CGK4i;DJF;^Tge0;`)0<2>Up>xGZiU{{n+titZ`Q zTtRXkjPk9a{v}pgni3g>9qU4yo@W;6s!5nc@+JFBktT;G(yqhT=+DR1b@Yakm>Dq( zz54V70awo&2UkodmLdbGykGHq{v(uW<*ZU_Ns7HWz5<@=L-)vQhg6OvGAyzKaPR5H zK!OY=vjaFfeuc`X0p)&-BJm`Rl-s{r$NSPwpuZ1JlLoNuBiK zZY&-xKQrYR2EBLZYnW&LJ(LI82*?!@yvCB*U&}v)HGk42 zRcjntsBkd8_v>jI9e}Z|_&|+i+sK?d&@=3;E$z;{z zrqzE{TmazU=Jq=xGY1eSzw~>h=Go(g{WA$`b~KfmrR}+>q8bUqc`-VQFofAe7>bv$ zZM;4@e%Jj|DezvjJ_es_BIc8kcw<}A+6vQ`m8&htG}WPs>NiSN?0baAnR?|xU7Vep zkZ>=(c|Pj+UxNEh)V&?#pSwhn6%sLSxORm~J)umH-(f&Z4U#4PORVV8INgm%SG(+v zs~iS^OG>Jx66I+ZB}dgJ;SL9^WLvD6Uy7mWCA?<> ztx)5*k>~rNo0KDFfT+P;Fxysd5iFc^l26YrS^W;S2OK|QSBrmd_$oS+DB4CI3)P@S zbwILhxYb&t6cEh9P13Cd9QFoHQzCRINylDOj){zu*;sBJl7vZK%?mU9`9NzXMa&y0 zIPjUESJyql+cu9S(k0kd_Jc^yk)NKR#Ve=0ALXko>NKX6janQ~{_4gi_@T0La9Z@5 z2>1%x-Mi)%5OB+qc55JnB45lk47BOXz@6@gA!1qfr@nQhDa7($J#qY}DYv+@k^oY| zr=PqMy~=FR+?u4JDeDFXwyJ`CZ1UN?C3>vQ74E_wF7%Naj6aVzJlYLjr{Ul{v3-s- z`}_%f$sDThdN;QiE49{~dAiYc-f7(iQ}rPTB`1q!Hnm>abek@HP{brhCzV0itYwtC zMDpA4`|2EnUlxtk&5x}|dDGWH*PmqU$LHS~vmX%u>D06Rfkn_$-ouPtFr|Mt0FEY~ zBKX;vPOkQ-iwz$`_;En$`?}f~q7pCPJcW2Sib(n;99F4z8^;^a>OD-;HFSWR0N4h1 zyG1{}DSBT4JQdF)85|hUGE$lOu4JBRVl;IrVqDc7q+ygG$&RCs6Hr`RxH3?kGs^|0+tP=gU|`Zmr%C%A z=)92&%5>%VexpRpXYQ{{!~R9lazvk#abncrSSiy!DCpi$Tk8Hsz9Dhv%ddIiWe+28 zK3wl(aiC+~cLD7@ZzwFu)Y4KSGqAOEO(|zB$Ud-6${EIe+CObB4Hgbm#}@qyN?i*T zGdL0v2KJLZ{m#WoC>SaZ=)IPKLIEbt>E};eNOQ}!DDT{Hk4;RJ#{|U0#2$;$CENkD zw6x~58i;Cji#aQDBO?Wjm7L6`0Ki*8B1gy5Sv0r21akFlVIi>^biTl{AZc_9*&rQx z_idPv>Ry9YoCb||f-X4&t}&QxzWM0>#3WX$s*|_%yl}h=MdUhOm;y!TQ_$+8qK1Kj z5&CY)HXJ!KS**?uiR7v?xl`6siDvlW!-wUN7<{5_=B7liKW@X55)*G4>*{m`AWbE^BAgc zkna2|GALvN?U?dGJ!#?n<*bcF4=abTtu1V-QuWwuIK<|N=8~~uU8;CK*iVS)L<|N+ z**xp6Ttmwy0qyDIj?8pdHjM@+6mv?#!~hq9t&h*RvSiGjwZWM@tb}`TBcwF z&BZp&Q}PV%iHi^`*P38MBTQ&iBlxZEDGd%)9JWKfdB^Z5bqipHlOO;5tpW`z^6du4 zvUU-u3lGM?qE%D;h1o0Ovmzz(u+M3Q=279-k#G#uuAuie{eF@wmekd|ClR$Qf@amj zc*-O|<(#KpS`OQm{iu~}=o4+^1wtqHaea--7)%5-vm z9J#HeL>H(~kOdn|>FyQJy0~w~*!2j<|88;tX-U6bzQoACKn4Pgkzx5b`4}o6eS0+F z;iLn2pL8>X)!gn3y!K_%{~OgsmT+{OJ^6{)6A~PoEqoinenS1f?dskox3C%Gt#1n`bso@|7qOva+&@LxB=# zW?*81oi=Q&kNI%&qqp7yRhS?135I8#2WDs8v+M#zpk1g00|BdIK$Y4gVGM;kaz3-i zV{aA-Y3%>XDiV3N)b=On<(<2Ep>tTcpLe!?o_+i)SDo%H7G}-LN8YCbXk)RN6Ni+d zF<0M(sue3HG0A!T8ljz;nL+o<`D}KBRO_#cm*0uH(JU(0dD*{AO^s%-(P$)ywt?`_ zy#W_ut?t}0(eH!m!%j<|tE9ht*6~lfiNHc-6nsMLI;`RL2yunzFm#9|9J%&kYPfY6 zM+^q;Tu;#1_qQIKINc#flKkS~&A~)aMrcq8gcbs4Fn<+)(oRwb@}MYi91A?0$^9v4 z4k&18;S)1TKc97?>*OMsjOVz?I5v-2`{qnjR8ax3rFu#HpG^vtaI7)>&7QRyYSEE| z>nmsgEMF8W9v1PED>+?dnj|pm(+M}`fhhww?RHIM_wFy4^UwwJ-f&+|v`vk@B&=}O1^R%h|f8qsQ(ca`0mSZ`;?OZVFif;z~+1i_Grl(_WNzap}e!e4q; zL`Tc@nGiz{uI_vk$;1bKoRkRT$JqBd(@Wtzgk^qD;YcZDVH6%4^ouJ*$A zN-`7k!~&x#yutsOIur zNLM*(3-g2JLfwO*V@`7oZqBnjm0|-Wx;i_UrTHrxrv~Ty1d-06)m0crez3UPD{tDS z>&&P|N399t6ipf54_@!Tgullb3f#q3A-Bft{QD*bKK90#CLds?+hAqwH8iGXDxKa}r%rnuKWzakoLj9kJ5jTN`e+)*v zIna={yx5#5Rwwz#<2-474oQyKs7!}drOvDqA+_}t@8B!LY?&_o)?w5KRWw%TnH0K` zL>Vzh6a7i#f#$U>F$;P3eC?@oH?6sb7#RPi4BaDuo6HcWw=SAm9Dd}9Cwz3swtVHg z;mknThsWR}L#G6l&QeWS;AKPzZVG@+wDN-RF9nEIDOSnp;Vr+sA7TYT&Wg z^MbP9U|54i$~;lkBCHE0YRKxYIIm-&@8}&nJVcgSseH&d&tM_>eTy9pFoh4?G-fTbk}aO#n-Vs&rs*BbmIf4nZfdB3b|&4O*ZD3VT7c` zd+y-EJa%)HDC}MC718am_q9*K4sOg&A-iTe$&5W$zJLUqMDk!eL!wkHZP$MPSn{Sb>=`^?yQ;pcP-u3qn-zcxFr z*?-aY!l~xQs9ev)t|<92IB7YmD?xnVU5-A_Ul{}sa+h(+@A>>$W+kYI&j9x?staS3 zhR+!WhgTn1e{&W1QS0}z$#uTg8P-23@hzXp@Zp9AerYoKop|;Pjxu+?f!d6%Pn>Pb zj)S~4A~vq?$c_p_924u5z*QZ8`cO>ZhClnQ8s1W0Zzm?;@nTB>@|lifZ(8_94Bq{i zE9^krBXCPZJDwlqmu`|V(U5*r(caEo=8~5cW-;R+2r}1|Q$BYLc$XagYCO9mV#$7} zN`t1nXN&a@e+->^8|gdAGkSQuS=uYmw-UhyD!;rlW@1M68~m;X>J^5}Rwi`|EylsD zEq^`)j(X38(Zb6#s6-UWjLm9O?y%=l;@MyKrH2Pi?&^nL^KaHkShJbrB59=p`tQu* z>?k~NaLVVc)==h%6H&g@Nl8`pR&7+Qcv+d_J%e3Z*`E4{bH%7`q6+U`h@ z^5b;!Sk-x0($@K7VSx#e_<=J7ySUvWo9CCLN%nV4=st;o<1vvF-DMw^_6ZF!{|Yvz zs^cTm2$^tD1fi_GouU8*a0SSpQ1!08B?>O8PKEugbR&U!A_CiN%e*od+aXY%-xNOr z-DKJ=Il}*~|Ki_Fo}?{(iBmzw2z+(bo&DgjF5%TWhLNc3;ZAh`>+Tv|pHIaiE#o{| zRXhY6;)%>nhCVza)4BLLo}OviF?`U5iJZ41Oy1iS+N&QY^{=N}I(%H$3~6Vel~1O< z6z5~#PSSt6`0wS3qC^=27FgyQn#!ir$u2Z)-CIIM*B8|F3=>?D1DV>5X8BK|J~27d zGK6#)M3FuTeK2q@}O zNl=~}eWECYU0ZH$DTVs_h?`T|eqFI;v{2E#RUZqd7^jas>9|aAQg&EZu)G_s~xpKE(f&Jt1c^V6sf^^{m zR^Z;4!~G-Yu`nVno5LC&9P8(f{=O6U7GF7|E~Dt&#;OKlRP0S0lB}zH-?80))^}ax z(Ihw59pIjN8>SD{HxRQOb`aBo!o$05ynQG}h?~~<^T81Q+F-!BRJ?YpBE&QIBF@qjSkBwSnxo{!0zMi&|HwD5QA)uGDWs-aR|x_Tn|=MswDK)B0Ob?i!Xq}hWtUL?J>4068I&dX_~p`y-&*hjvqsLDzK)G;P12tD2JyXZh@4Z!fsB*y#FNi$*pC z!?Owh>^#j;iiOuWqDyG*nXdwwu%8TgIAxRDV{M;i^|FI@HmbB zBd_L}MTtP}IEejRN7ggPdo_$RWn^TqV_;ycVv(}s(n1s=u5gR;D`H!1Evvma*h z^v7Paz{58r6W@DwaoF7~f-gU(+{-To!Tkr{+|x(4TDyEAdjK?3ciQNB7z>_)HU;|1 zDM!0k@{M%@CZ_|3S|s}MiU)w6=|5lF_=+J(i({kv(o3otBuowfcZi?9nJ;Gh!#^4?TbP z==ONu_ZKWE3<}w*VSg~khxqpk+qxd1C&{m&^uYhNUmi$;kKAI15~9R9G*Ol9l|9r} zhK2E>SK$H;7W>aCXIUk>1p$T4JlN}6z z;`VdRVI|`KN5ZC^ivx(2T!nSd+FBuFv|miEkOrE8;{t4I-r2L;hBOzD%xZ*k_*)MMH4RZjXV@gady=p)0f0K#e-gW|e3}^%=B8xU zaJx^mj}W?k`1uboQR%gZyeJqUpJm!Vy~igYs0Xi4=SQLZ-{07n@}HJ%eqQp(gZk-Q z=fIB_36RSD7CaF&htrg8N>Zv4`Kr+L60Q;!D82r8a`OCWLlUU(arE(WH1Ww0wz=XF z6cl_CrlVIl5^R_=X8Pj6yd^y1XDIPH-M=vd9@u^|`%H>8`3{;nL@2FF+w?|q0^N0cQI$EA zggD9{^vW;0Lr~|L0`d?y2!ylPxi48%eXb78{O-1@PpZPteEU%XHgaC;2?zbbk(iT{ zlcuSuDJwU4&KMONgrNbx0iiq?F+@d2$V{cZuT>2f)gM1l3AqWW_}3Cg-bPKylgt-3 z7!s0ZThqxm8ZAf+saiKdZaFi_CAd-FLbVP+XPnFT)!Bdhi-m(z4Fl4KMWGf?!aji( zsI5bth7iX)*;VL_U9%26pG7D?mtMhz!C-w*1;~Nfh06cWFt;wl;Owz>Hbn1E5do5k z{KxD1T4{uP<1l!{J@uyMC|EZ4Nq+vjck04436&AI z97vPhzy2!~wkcDQyQyE7PAR8L&ui^MdRIKz3Q}iU5lEQx5X2#Zr&D=IgWRVSq|I=KAq4=C+tQRC27D z^VUohAQr_k*U1*Pc}=Pp#NQ|Us=mJ7QDek}`EeC!s;sKoPYyt>0j^l}Gu)3_GDVcg z*$7f-psM|2s4<#%N8WEUGb2MVHa?yKwpy_lBk<=R8N~UcE4cRS<2NygpQUeVqI#Z4 ze>%$1;mqx0LnS6Tz@mSWs=yderB$L{6$Dq3s_eo+jyN$O#IN`o6GLP(A}QM}jNkrF z78sG#J%nlPw8QEc{;vdyt`?6WE-|ii!l*+-CBsuiMMX%+*@CQbI~eBi*>XXjdsZ#Q zYzN}q3ZF1X+k{YD(>{`MhSGIG!)I_fJlnHtobk)Rz&of6DilhhUWJ>u!RO-YYWLV`D(P?VxT=)1FV)K7>1T@7F1hcR`OLdi*e* z)t}0smi(&s>qEc;E17NY0ntQwiB@$puSgvLrw8PtteP0ENq_qDQGO*gHw(B;gq?p;*QaQB2UjqR$S6jvLH!Hs-Zn zzueK%?e@5{l{A0tQp{$3?CK$xQ#|)`Hl^<$r0g7iGvoDkYkFGOjE4v&bHth`fM)vr z`}g{#&+b7GWZ>1{uY(Qskx_wlcIz6L53P%%RS}3QY@p`iyYmXS84Y1`YESDVGV%W9 zePHLe?WR~~)T^=WiY3o{4374q5{KPTt3ZMHU^&leq>T-z#2bKLXc10cLXj9IxgJ3XzxonT%HnE zxxz(^6=R*Q21NFGty_C3QJoq_2z0zW#Sdo@esQ@kUZGg#(Y0dlLYg9)n@9WgTV&)l zXJqYKA}L*zfXYHmNAu-D8wo*6(QhReY~R`ERi>A*vo2y#wQa;;_{WC<8bA|SwPzj3 zWBdNqT1%A;&<+M8vIEy-mBbi0qUviRw-kXZg$avr$9PvL1Yf?kc;N7*ucj zN1*=;7=LhnBXHkZP(BW`Hi3yuEJ2Nv0GQZ$&Wx$x?!NEtW9Pl(-ZWY}uW-dGQx(hA zU);Oa)m@I^^4#CB>rxgyJLo!lxkVKn)+Ey!)wvJ;`o9BSLIWCP(b+8~;`!Z$R*Zti zS}4KE`E1)u6@vH5cPjhO`OnH7d4}Xk(TQwmBcGL|WxxImRb5=^A_Q`c6xr^GZv#&o zP#2YD(s=sRn^l;?CLOP0Mew^7NiOHKiSD@%Mg~?WMh46468YS5rc2PGf_Pofg9H%x zHfR5h6RsqL=5Y{u{P`n^>O*GC&=2PCNl~@JR@RYzopw!qF2Ra4K-VG~?^M3^%Uj^) zs0i$sVbQL6@@We%)EANO-oBM%laUEh(b3Tfa*j;b zqT=gzti03rz6+MWvS=i#WmW~U$F!8m8y!{%aKX_1^srZV5e;RYZBqYs8rlKt9;{Oy zz+3&r&c@WTBF{y2rrC z1$fkI{YcaAFUvR)m7qlfH6pyPRr6k`Ou@vSnC~y0n=p3EdH40J0z`G{@yWjp^Qf8M zeE@Z*m@4i{x{2pm=Sh11@cd2ly&buKKkwZ;E0}zSx+LY?L@h01dP+sAQ0bNr)d|o4 zdh!$bj<}O%)B<3vnc8w-4t*RIwzP%*&-i*PA#Kw$EDx;CT_FiW+-%jGW)I|jvqVy+ zkGjAw{5m%jGJ*u-^zE01TK&^Be|S%pcU~Z;acI&UJ#4k5qnkh~Nn?NwZBbU!7?uVE z0_ca?!B)CvkvJcV1;?Ha)L8xy6@w2}nch=AzHg4-VJ0hQs+JMAJ!8yP~UULlHIh;*l3a@Kw$G+CEc)v}$2Jw>5<%q9H$1 zd6B!0Ulv`Hkkb*A@zyPNV~d*8kD5svyAuUeA_+)dSxO$L0&@Fjr^ai?l_c}aQZluE zhhr%{t+i&cTx@u$(+?v-wP##EHF7z2-#v`p_|Q{$_4Ry?kAKkAqKfBpc0%dw&x~kQ z&vBQzxUdomQIb)kU7#Ji6FG??Bo_WJWSYa{vcl5rxMZRazGYD1C2wk2V{_-zp$8x2-CXOO=-H?~5hs=vlRQr1zJ;qjL` zw@ROxTW??`xOB!$D_f=UqB22W6S}NfG0uf1A6X z+X!wBSYcTA{|37fylap6v;Lvb%c+y#jYoF_uz(imQV80%RMurn^6n9DeyT?`d9t>d zm?`gc!fvp=npQd~!lO%zux-v{;!?%J6gBB`e`}H1+1WB?aSb^c*opGAx)z87#}BOS zKi3V_WslHeQ{NvGxZG=u%?un>#l7#(T-#(WDhYrzvi`zFMMdo?6ogMzyuFWN_>I>j z(G1;usMAVEiH%DO0wgAI*j=xa;=%rU*%AU91*#VniqPbIwxI2PmGocfHs6VB`j{uX zAwl~oulrJ96O}}fap5|Aa>V05*rv+(Ebjpm__H2e5Hs{nv}#9{LZ$Y>8w%BA3ouqG zR$L=%>XUZTr(=2Z6lbwdgL6U``e{su#BurKnvuFoEe7?ceEJKPk3OHu^& z=31phcf1)O3=_o2PrcMeVGlcs7oQJfAPIoO;xM*?H@q}ZxGx7O>3=ZSr$TWPZhO}s zx2c1oO{ZDHX9%~e+Kw>P7X;KWcuZd{{)&@f4(2RT-b$C}&^@0aRdEF$SPSaq-<+;WW$_K8m*5CM76SGmkfFLd9N0`kH26p!C_i3SgWa?0D5DvO0vgE7FOXPMMYIJX+O9~zv(dZCz5oMB+jj;CU`~j!Bu90(wx|f z4#dcR$^)5<;9!Q|N=W0(aW^ zS877a1LNxbPjqQ~`tn`Fqg8+h<6 zw+O#qWQKmqON9zWVOouyKlg*mhU=CAy*QKLOkac3g+lR$b#sN*g*=kP1KTDn0eRnhq;R{#9_+4|zd#!BJ`qCkdCBsTw038^L#aNUe;n`|AKi2>^ zhiuVovfw?+T&~wKNQM1o@FM^EWM=yCRRxQG5i&ZrVuiMcKwj)mX7`bM$BcL z|METiL#ST#H}pKt5;p{v@07>`bfJ9Oo_>)2Q2^qgGxBe7SD8%&ob1lvq~cw1ZYhyt z(qI1k{Koh>=bpXRF}y`rcXp(0Yp1Xzv-LBl6Gf~jaVngEcq$=yz22lE`p=J3>rS*; zV%NLff}yYeDJ&ddiH$OJP|ki~f>~lOs5R))%;QHwu==iY_~%ay=VCAx5x%Rz*X);e zHH-fKeW1i%-u3Tb+tq>{eoNleX!87M{yLO;Z!(*8_G!8Hm>4Z0V8ITxqi%usD}@Ec z8`_^0P9~b=f@*mi8yR-@F-u(huQN7yT$pJh1Y6E7$&FxInaosdbhzIli4Q8csCESl z`2y8a`z{PYURMf8hb0}|;B}`VAEm@bxVfTI%y^MTObpfyPLuX1y@0F=6?k~9`IV^K zug92}&tZPa93BOdY*eBdP>xv-Wz9&lmuVHB9WJ^avf zZP50l5X_T&9+xF_Ih$j$m%X*u95MXm!Tzpo-Ge65vSclb(+Dl228-3 zll6r6i!X%+vcb;FjTF5hMvD6ow%2AY^le5RjMOPoJTG?U5GI_CfHg=-sj9=nd6M%e zBlPEgB<9MSO>`cRjrgAVo3q4Zb*m>6QN%<5hr8Q+ofPD$b-)ClT-fdb$jiyY{c6VQZj}xZ;RKtA+N}gGDTgA?>O{>n zH-MYUfgx2O&8l|$=xON7?VojD!_FetV@1GLc+HE+mwr@59InPYW+)3?N7(aHrfZ)UMv&T}~=TD79j>&%o zRMKYNO-;yFWRjIkXWomy)5xVwD47UIdh8{82w|{DB~FKJ#8{+pM%#RZ<4piXe^XHnK{(FdbA${+R zmdq1von!gRoIhm$l>9X=SN@q<4%7sL^Eczxd!(}#8|9pNI0+^>ehQA=&6N?s2B=2g zW()iF@af^1%if?j9HkQbpiN9+3*kFMca%*3WQ9j~tG?(g_^U9Jt| zc~0HuKIi^L{sIX^ihX7Dk_euJE`ia(ksopNbUhaJAfDJpGR7)yiSF$;INugFVor5+ zR<8d)S4J8Z?pxWYJlQs3^z?B#ZRxQp1n&|?oB*88D;=2viQ{MKG*5KcTvo4O%402o zVs)DxFnM|1$S--OMqp7nkXR8^SC=W;fWI*55M^|^D>@z-bc+SCrieV@zzq#Bx zD|BM^2Vk%OYjFoNaJY+zI-I@+R#|{>zY@*0Q;(I}E3*f)y1bXcVGD(ERQ`mR+oIL4U;xGT%5%h-v8K$aRwfRw@XzL5>ss&)MY<4bT zcbtcn>FgZADzEM%zs+?iX5PU}QTkkK-YEyu%m$iBx>NVLM%6^Ml$yUdy?=ok9*T0H z`QCN*r@~73y)loy=?jiKf9Csn|Ga%saF@@?0}*;ocb*zI@@5N?6kq)FB4z|XqgJ3S zgGlrN4Wnd=H}Ln#EW^)#XEyAl!T2Y380VNDeucpn!0w&uH5j@j^GdEK(pcz1~x z|1B~5kP6{)^dXNDeii!E-qbW*QAfLIONu?v{n^@#YwKIzGtpgHHNajjFRfBNZ{G}o zHcbr(#6~9Mx-ZW%F6^CK%#=RIHe~s8>9=PmHJ8aJLVE_Mmz-C8k`LmG=ypFa9Nz`u z$p42fF?2;7OcOqr6fQ+<80v6`c!_ILg;z46?)8^Ri~;w>=|L3UT? z2bfhmkn!#gE1ar!Sj%-SoJ>p9-$2LU9pfq_9f*N(te2HdAXa^wBsm{Mi6!m+S37|A|STCAg1p=C&vybBYZ zb~-+sNuN6vQ7*OuDNx_ZK0M!(PHaeeut;lWVJm~8S%cfY8+YT% zIu!$CT?*nnA2nAilTul`KGhDOs3_Nwx!%EV@I~8hmU5Od^!5)neIHucg)SD^$Dc}w zp5ee2_4&Q>`gTXf(Ca;viJ_Iis!tpR1!f0mBofb&a>(g*z8?tVEKbEE!O0XYzq@8m zh0Pgv!Qdo8b&Ci&iwkA{Ds`-Ms`xN7i#)AKnH(lMKP=YIWxY5#Sz09)4^WkOYr}bN zi4eP59vo>W6v%;YSC>E=ji)lC8TCvdR;l5Iu(<1#Qn~kubQ`xn2MY8~wG=27RIkJB z6!|I(lKHEL?ks1}K68*OP0;jjsYfbbEIjVioQIo{>0AD=cf&^2_V)ncE<+K*O_&fC z$AhkCFE-CvVi+s<^!DlDW>?kD`BN&1`HALgVnM_d6CPs6>pec$f4BjP zZ7vgHgQGXUd%SY^A>N%nS?~Z*XKQ6?Ts34mV zCN)oJJ7}%BR1K&b?rIuHyOgMjX`Gl1)X6#Au5dcTL5hceeGl!riVjtJAI`)1H4>H` zwOf|_C;r$3-(88J%Io6qzkRom|J??@C;>QUt>lT^^K=-#klHd}oOvm8xD7iSMY^@1 zcDa$z`6Y8y_k8db(N4H+mitlHUQj)U4!c9}L%mvyBtDE?>42BvwaCfKBeStpURFQr z^zBYBttstL2-i2~=ap~M4N_GIznXvbdeUL?G_o}_qKqEP#?nlYoSvazj3zw{j@cOe zZPr%fVWAoW8u7o!7&c*ZoAx>w;CM};hE0f>SI3BHsnPkc8Ytx`rON64&t!u&*fvYV zw2QEysNvK!_&=EL5D0Z~AjiSddRdC)DF|Rsmop=h5A#2nk3g~`%C9CI^+`oTg9Q4` z730YWYACSD@ngcn?P+5>;>N%c9puBS%50d4B18h0Rgok@nHM|UCB~MPc8sj9=B7B& z2V0{WAOi{Zx!x!ze*9)o;e#Y?X=7zYmUGgc7NgxX;!us0B7KaGx9h^eM-m5BW4^%I zkF{&Wl$I;mTXUYc*H$0SbUYXMlJoxHhS1owi`0|FS#CVHKa`|M(tUFdm8t59=~?3m zG^b6zQ-ssAJ(Z6z4>qwWxEjV*-@0KDO=_2|Fhten2fCttPh zPw2fWMrDnhOy{DFo`X>$QiqGana;+qd-{!khw+fn!8kFD5U`r*^YZic@R4|883ssU zxh!ni3{??v3or{h5BD+v*}*~ zK9cgMhsb99Xm(9B7%*JDJ3((w7q0$pSiqO85`7NT&g;2nL2y~!UO#HpWhk8f_VN7m zSUL~2^lVbd-{vBN_XGzAFX}fs8OQV0;PPjR*%Z)j!W;NBt}^+56W3}dt)@jI3u5m> zI9bRRpL1XafT^Z$HE_Ifjbh@y`A^FKbzRGF9;>1z*33y-T*{SkIvJNg>2N&F8|j7- zuzoYS(0Ymsz65f>Bp^q@F1<}d_TPg!vUk%D-{B-XjQqUd{4LqEQtRD~pdW$O{dv%v z_%O|wh?b6SMWRWGQAYFiZHZ=nQ7cWf$Zj&F9jJs7^I|)Z<%DY}Tl{L|a@y>A>p8h` zQ$J_c!2Ntkld!MC&1)>1I*5|z?O|w{fIzb(tyDglz(H2;9#mD6vq0T73#Rg&2pE2e zMf~s)C0PW(eyN*)LPu6%ZCG&QL!GPrIjc=R*j(%5 zS~3UwmkP%C28?kOGC8e4gm{~hvwGl&hDVH)$4HO{V*pj44}40bEsi}B1;I1`u#V^6 zfowxbRh1r=yQ=6*lz_bHH}+E$E^9-Jn^N`zvYulId1&o+P5@jcWCYm51@u62c-Vt8 z#cs_Ypo|dMYd!-i#(>4254+F~;dpddckv;Ey zTR%KIO33IOYhG?$S!8`lz0|qJZSYdLSDXUBtaAUM3lT7gD_^fzkZyDV$%E^g_Yk-D z^?%ls&US)5(;NzZ3FY z<>p5#;Qr8`KE|iDr8&FCMGErV-J#5)y!=?b+f~)*jonobEBJPW9e{P3BIcKU&)6zTZ)@_hDX$jr>ldnJ2APoUZ3-o&igE5 zxZalsnheE+!u zWh8rVkOZ>Hvq`*CnBQ|Yv|yh;R(+-167KlF_6y_lCZjPXLx$SM#xtNMO+n~sn!2uo zyzc*ScYalYJl&ARQ^c?FZh zs9{^3w);Q0{D>;2^i98cJBQ-#6RqQ-CXT^c&~gfe>BbT25DxeuIhq)`wot#C~fMqui1XOYX6wWwFRx(#T@7*7f<6D}^6ATB!yoofqFpoLC0ZALzR zEiHeB^z%6K?;xdVc`}`JR?`pe-_J2Dd>TvVNAE61vYQQ+eRLtl=o=e|PX)lT9^Qv;GE^SMs@%jF2;@2o4b-IlF z{WuP?J{_HyYMhGCMvYNBJ3IOS<)V0Z6s9dgYimn!7)8V`RLJ!8Cy2V<%e6$>wu$?g zM4n39xFl1B#zuV+qq)=Z@Gd2PrB`(d`Cr&e9e$OSL2B|>jD;lcC?&j_n#yZRc}9M{ z(!cI0K6%zM{d&Zi{*wC~(c1zv!(lg}sQdfU#u6$vW%ZR8pf98A`Oj0mAvE$pye##M zgR$W9N50PjH3_%ziHRzr*#)*b-@XK&Qjkb!$&KUkV-@0Q^T2<7ibd&UIe7Ax>QIZ} zspA49C>a_W`gV9^Bxk%-r)--+`M*9_Bcxw7VX%g^jg9BqK)=FFR-#-X|J$N~wLYh9B@~BN!ho`8L9u6us zO_e4pjo|voiS~O?0)sTJZn70ysXdn-q)YKj!?^#Kkh_FrC(kf_sgAep(y*f_b8q7g zAs+d-Ad3>S!#z3%HYN`Eh>IR$zS#M59zH>G>~+_$4!4e0j%ai;4Mo~@MmXg3OO5K+ zh)0z`+nfVO?ZJ&XS|OaRSFzj-!*+4;$;nLigjroSg$tR<$?ux`^cMdTN!~+foi9y~ zTgD~ecgUUPq$FvpZztJ{?JS4MycL#dqr0kz^w}&V#?h=x8W(6VK%wGM(aKYFapqRV zP3g_FUm}B|CgJCu-KnZo|dt3ihSe_otiLxk`Cs zwFN&LWB+K73z)ijzp?#T`|h*O-_I$k?8DhZ9e&nJY5z{j!;bV@K0eFBC(xelV`P?7 zET|j*;A5oQSp6ry)qCOmVNytiW5eS06zLRn`R|W^#~<#@v^Wrj^r6}Cq*{sT9EAm3 z#l%YWeoP6r<95(_A~D_ts5sAVYq(dfVWuP5;%<`Z4j(h(v$OAoD$6Up*~G=~=yNYd z76-H1Dm{WM8y?2iJPS1{NlC8K^3MVDhvGvtN>0?B@nQ5aZy3d#CQZ5Ser7BG5e>|* z#^$>tf1$pDT}jIfM4~pPoO}5C_3q_Y>ODXA|Ld+ezT`{#^hj~5cHbNp>2{f%G+B<| zAb&D4&sPj-$IIK=y1>`Qrd~cy39lJJ1|fca1|flFN28to?+a=v(ZBdKOn!?tJiI>l z(XN;&KTW+pjL-c+>ThZET5dPg)_*Rwzj_Ux+eKq?3uUJ&`LERROf4LpaXoN2eB33$ zCFO22Y!r>l6uYWz{#^?B6mBZ~W zXH+sm6(zGjN~QS*U3@KW^# zF-6Lh3l<;F$ty!ScCbDfs7cLTmN+@C=C>@2c4pL<*R;Iy#x5t)sZZ&BN2qKs6YS|3 zDG-AA%MKZ%j}lici&-tsl5YEQvL=%05KVBO#9cuyV^1?}HD5I}hEPpTc6q3HYafp9c4AstRDt zKolxt%EqWT*{A`WDj`Yo0Ra+h?4ODF%PT7toSdHH5%^%12o!yIE9)OwUC*Q*@DB3@h7k6Qt4GE>Z z$1p8@@=bC@<+Lb*4n~b|X%0fFlOEk?XcpB8cBnuwzba(*suQ8B3f#{~C<~17@ieuY z+P4yP>9PNm@7ONvXH;`>d|Qb;@NJc7`wIt8#~1You)f9L6ZXYY^(?mgx*o47XB_nO z^o)IxMfKR5B?5_l;D1$(SNCAKPq%t;#R4HRfJhCpy6bTU_h)+dSkyt|?qdCSCZrEKQ?=fZ11wyxDX3E6e|P5T(d0~BL=pgbvW(g-Zn*0 z1MudsYV0Jh#D#+^xSxFOBtO5OzjKHb@yQRW1!{;X zaeT1qeE^txo`{sr+2)W1#m*0K8Lj!|jU;X~gEELxG_>CZFDyP_Q^n`x!~wa39=7t~ z%Fo`S|awP>hOk>Q=Ks?9Lfj5#_8z#`Y8kjANY~3 zBAsZFFgv~x-Ln=BJeU|Cx6j1=eizJ?xD!5)gV5GsZe&^5C>ceA#&?-ctRdh*7)Q9G zazKy+y|T}`m;Nkn7jch~!5m2!MZV+r+$bI=Z)?8UUA(45n|5`j%hgES@kg4NCM^Q@ zt7`O|c-rV72kMm5PgD6?q(J7W&LslY_IybE!LVmYMCi$58eU^~nU zg)1~QGO!vdsnMc^@GCq?x(+08$=xUyRwP`#JmffRT1r3^UBzb!nBr`3BA5j`@MxL2m zaY72p{VPN;sF`${=&Or3K?pPWd>_2pudF)8xOLrH&NFKrUA?wv_@$j{s+!m)Xg>!n zvu4|Gj8C;W&Xo`G?9_>EyLoy(F$x`bSJUHWI=%?!EM;t7=_@M?z}q zN%K$u%lLATVI3nvQ@yH%2BS;dH-~iHBaROsjgnsy!w$Qvr_=+$mcqb}oH1&EM_gO~ z$Ch{TZrwss&;O{z-BHC{mx4WDy4FTxFjqR{?PTWkUMm*NLxjpU9i`_GQn8Z?L>qs8GnHqwRatSpt&$#oNJ6md;%MD#boQ&U5jBwl}FuseSoq z!EdL&x@$~Ze>qR(|3r>Dsx8`V7#L;pF<(>_6d>qqcX;UT{q&Dkjk|1>T~Yoki3=Nk@UknhcI_(erWCw%&}cCA1>m&_&U zbIbskg3H%or3dh2&(IgBTQV}f{Aa?1gcO6Sm_*2n1uKVoneDHtt5{>pXd?x^Brco) zx^l=pqg)P3O2Bvj^g{UBFYnpStI3@1C1nW-Mc1znZ*@9fg?giZYti{ZOTqW}=p!t2;qo#b-G5?ujxhf}f;w4fAsSkZ#W<(XC7Z zD{S_O5X$1ucjSSe&U|58Sc@ZHLZS{%#H@+iqn^mN5w8qOS16r;RjH zQB^IY*b_wj2n8YCdj(Wo|^V=psUz& z`NuX^FwH0sGZIN`@;-v-YHDhB);=XCPx6V+I1qwe8)$VtcUNvU_|6%xPSw2NsZ0sW@Ma+!yPmrMqC8I+1bnEhS&osTze&tTtJa?Vtaf0 zi@H*XXtH7Z{u`$=4A=%nYZVwLN;~EkMl{$kZwGKv838F(j4dqz>lm{uy58XOdsSkh zE~1C9KQ^?rRZrlu=75$9h~{AbHmWSd1r+MBuiDH&BiuS^XFlbCTwWXf-a{r$7&(mO zBwhCx#8OqlaqBtJ!RYLFGq>A$AXb-XHeXh+XdscAMal}f$5DgbRa0;8miz4_B!6f3q}jw~w>HVUJ`A$;)JR_3=6q=@ z{b^FkEN?ga{-j)p4(rI*waruE`H)&qb)VDnf$5=VB|?Ya*9a=OKVj$7qOuPY6BAJH zQ`6y6n@F}TTcZI(PXigsZTPMa#F$#SnBG?T`nQSZ?r_Z8-$Tg9mP$Pqe4hd}kdG@| zzJ!$%R$8_1(ilPDLRqV8+@O<;ES5*@)ZCQy+?V)JqP$hJ-ppqTbitMJtJJod)&l_=j5( zs?6`sEy3Z{8t6MjgImfg%g-<1zSQBA_eA%LbTbzpj5A~o8P%LoxuvIR;v?v9H7o9NudE8&^j36$J6LKPJkZSY%{^cM1?Q^Th@Hkj}12 zjTpNQ3nLIGbSNLSU9ajt7FO2pK&fN2P?ZF5IA-JffU+ z?~ZU|dcjY7F`?FEen>f7BS*p*wQKd1AY9q7!boG>1L=7Rf*6Y}c0K%#B04Lz5EFI{0|G$~FmsTtOeL}ZIp`qv8%tn2yvK5O zuqY6@{O2hdmi|GBeEUCJVu{y1tUrGI$aP-o@U)}_D)zY$c)IOEivUZhPqL|tHpZtt z4SdUwo%bDiQG@t;j>8*k)JfPo4=Ejvj?#Ae$;^GN9?h2@Ya@!HuX>-a6YIUU*3;FU zx?VlQ+;xjt@ol%=m&>RpHK)@{;3$~=2}E8g@n6c?6A6aCu@;9Yyf^ELaXjz>QQze> zCO%#F+cbsFjpe+ykGtU5e>9~DND<(*dkxASj=9YA=rA0LX%1|^?j9uZv`@_atyo=C z6ui9V`}Gx77aV~$2jX6pPJLTzmNHxPu_);INl7QSew4p@h$Lesz7I|%t%sAw@9{T% z4<`HlRaRGnX}}IT>sX3U_@b0e2q|U9f$_)gbceoZntQnMO7hWvRf7EEpQ^H{8rQS3 zR^!(T9?w@q_^IR@)EBM?r(e49)vzV_fBQ$5wIg@6ex~JIZoyDE z^zkDWXqC`FgS0iwb4H;{>);MD8|drCbHK8vP< zZC>51!G}wS+<<#hR+?o`mhdI$ee<1;0CD5-PvfT79x4M@f5_Fasdm?ipwD4y38t@_ zpQ`VOk8xxsgg&BVL^=kg|7uxKa$TiSdVNEaayTq%4nq-SR|@BNg1|vI`{Sv<<&ATH zKUyL!hRxj_IxXB^z4$xVF~hC=;?~-lNK%sa@l$k+qYILv@!l?KlJ%?WClnLOUs_%( zi^kGWCA0N68|_T>Mxou4K__U#x?ZYJ|NeDgk142OrZ!>XXe-rK7oaas_6s2GQbZ9{ zWd>kkKL$VMsp9`0Ko^L7wO-Eal+5G2)anrZ{=xPpMoh2Z%h*=%?Ojl-k-dwEaFp{x zX)TkKHdiUHlA-__**Ma2^_#)5-$tG4b~1^d6lcpm!Pb7O$t?1hLxzp&=f1u*-@Hn0 z);j7!$8^9<{f*Bjg!7*t6nT}&8Q(0FD~S}ySFIlx632Zr?Nt3h-Z0~5_1OMbvr9QV zZ%Ehl$fwJF-t%tfRjnbUqT*zIrn8$C?MIMO-Fk9&m$yNbBFZU3nEMwAb9bV7^QSoT z&iFbi^6r!1kSF=jg86o+?%oCEh|3N%`r!i-GV*{)ZPd=}G2iCN$=$8n^=&{jZSDE4 zK&CCj5-2|J&?`+A36B;TK2|^t&7N$RI{u>hn2aKxW+_;$UmKQj9xtbz8;bBCt$gAP z`#qVYY&`(CT8vLv)_oWo7}&7(h(!CI=}{ImbWPaR`X1sPfMfW;Nq9RjIy#~?B0?D7 z#B`dB66mKqk7=)LobXe>Yh{WNak=g$bG14f4Pb3w7<%~A?D+PfBx2OK*XlF&ue9^s z`JZO#htbHr0Xd={X%?6jGvxYa{tk0~wP(q(7y;iYlo-eDDk zQl3ViV9$bhtZx38dYjMakHTFqPOrLHx@3?Se_WG%PYoi^4ALFL|D8GGIabSvJ>oHXzbC_T(3TMh)nBWkV zCaeQiJ)^NMfbmHu-3Y}8T!Hqg161dj-D;)pkA#_iB6GU4$T)SDQVNFDZpAF-`l9^bl%6a(_-3i48$Trj>%H_&jLN#FxFmJNTAuIJck#X)C*feVG zQZaK<08h34#IhxF1HLeP*S(d#n6*BYwJA|Y?`sjC-GvYPdTGu_Yd$*5kOT z%F+T?Yr*ltB`m<89DiZ;FTR7-LKTY$VytI!xAU;{7Ohao_w);3e|5-I>5Lc8icp5SYVoBQc(&+=*7Z$mpWg3NXPz95AV` znMK*_T&Rc16vqGkO;RpXU}kPz7|G@cb(z($da0b}v#s46Z-`FY{Ev&oZ4Oft!jxb? zLX-SF#o@xsE?LGJOYs%Q;q$0SY0~2XJEYh>U0z>5e4S(eJi+jTG;XNukhD5Io^oGU z!#H)9f|*eSO3rg-<+({Was|OaUl6i&Mj1o`M|Mv$jawBFFkz!Z--Bup=J~)}YN4g? zp%A{8A?JF^%Dll&6FtSi^aUb8-YotV0Cq2vT6&BuscM{=w1fin-46)3D1r{j?bNbp z`8t0fS%shF);oRNh?kgM8UKm2?+%2(Pm`nHC(fJL%vu;zu=nX_^z?Fo6R_UvspJpH zsMianr@XR0n%3&lX6{X~Na&3RjjfD2#`O<-1=_O62ypa6pF83vpuZ+FcLd8$vL{u5 z5u93TedSh~4Au}0NNK0ntj<_M_mK?6>k0*vedS4(h_F=qk5|KMmsEC5qon^OBmyLv z(OD8L2Iu9d-nQw3z-4)BT$fa5JS2WDQ${RaiP_c!g5vZH`Q!8I7)yQ^-U$My6+io~j4rZVR)PlU%~ zk_|VCl=r4uPTMqWcdPmVqzYx+CCxhrBhy#`L;X(8YaxsM(1}6>pIRtPZ_Y>|^ke2q zZB`Qg&CP@`*zotn(>x1iK9+LKcPz#JRvP9<*SJ<LVi@7MK9fXO4!8#YEQaSxK$**nSki;zR~}0ps^#GZ1{8S@vFt z2wyRpx$wlPtG}CcX1e@c+KFaqmMHwe05L-VQXR!)LIc|=29g={ydIg!cILj%(^TP|qH>JU$lQ!|!Ntp{>M zOAlw4Q9(7*vn7aFl5<5L_{!`9rJr0i1y=7 z`fPeuAMZ%6aL}q>vhoxjSrgiq`aWpMrQJnC(~#WHd%f{cjOx-#8fBZ=4O1f7T}N7j zDdxOj$aYHEkViz=r>=X#oAP#rwvj4p{E13O{3gb~+wJ^WlFr+it%2am@W4+Tut0zs zb=>X$5yD(s12bKU#31Xr@u)bnH2W{|OJ3l*kUBL!Az;q64KujXc5b0LEJF?!a$B;& zvQH4}z$jS-RG4v>f7ehi#O*43rJHD=X=tFqIcRgXMy}jp4L@A&2h{4CcXm-L_ zm7&)77HvBdiY+7%bz)ESIobI4Fnf8~i)UoSq{!S08d~;>!z8{wzIn~p!MY*@7FfoMurynLb8xqc^vz3Ll(Ro*m`t;Y zv?7?gG!|sLse4Dm-H$SgKUqA#+P)z`lR(@fJ|wdfx1ZBO3yGf*^EpDlsfY|1c{}~Q z)E7eYE5%W1vQc5%|GV4CS(`YUtpBy3Q&P4(zR`&E^iC$5-O*xGgZi&Qg^_ELiFoX4 zX{m!{{YOwe&3%?daP!ENLFiEUnTB!Ini;7Y5&QAo#U;4zP_IwKmzDosbXUBq`%Y0l zG~7ceVxNAhVeM2ccZ%}}T3P$M-A;g&*FZJFK7 zSFYxP;!A}-uXpo;$<{d$K13$lg!{aS;!K ziQ>w+0FM+t6NL|#C6!TJynU{)R|cBeJ0(~>-19lDaTQ^s#7NRcIkQ%;T;kQwLH+l) zb?2aLincdvE9-Af?CW}z9J_b)nTl?@K{z6AGY!oID4UkrAHhV<%&$O)GVsnOyu@I0 zTOX>z1QpVPR9&Gjj_#pvXb&j8O)&QyeCQDR9ry7+BnVhv^~m$-3x5a!;E6F0N0JP3 z3IaTASb5ktry0n+BLCcV438C3b~K+K=amWZz@E^|?1=AFHDLJar83t*MPPA_KBjqw z{&Pjrr-g&k>uU32!>7%5YqyoUi|Sey)AjHvID{h;whOlic~#U0#`%nYD|a6(idm2N6Isn{hd<)y9>a zY7;-E9ej(LSG{8$btGreVNrvFCwk5z)ylVCe!EI{)g4(1sHn&yvXA zxl)Hx-TQj4u&u7x*rym2l66bdC20QTFFFe~s~iN9mhDWwzJuqpeEr-VY9n#^5_K5O z5--pMp>3_SVkOGgrBmy_=#r+XA1?YlILEY&Fc@v-q#e{8KW7a^SZlkEnAh`P(eXw9 z-Eq@>MoCD@U+sH*7U`ORhoqJW18gAiPNGlA1L=Qfe=2%rWWU>UOo#PtOXbnY$c~4f zcJu^5o@$Om&W1Rg?9W-N*3g0@oToc21~VFIG=%^1do_4SOet9~{2 zN2HvDZakT;O+v_HW-^-_WXOnJY__l)gtsAng>6ad>NFHx;vg=)XYZrtMy|Z0KVQ(}q{`xc&{#fte`Zcw-{;D{MZhhUg+Cd|r?*6~T`M)cHeqk(Hc&%_Zxj zD`xNs*(Vvt&#ifWRkJS3)A#X?s62~*HgIPU_5me{97?ZA<@l{vCV1y9#;5qsUqLHl zI{WdAbchwwa`6=H&n)2@xp0Z^l5ZbQ1{pCiKI?*szK-$Lgvm{SP)e2w47O|*6!ZdX z=bgo_?zK87Ty$J>VqwLaX`ruK=cj&||5QuX#eLYEXH@u~*Q~Ax1$VH9yQ2wfT-d6L z&yA%u)CBVG@OPMJy0M+6!k73pCqxYpQCH~~D%o#fORNY0oeuBEA zP6b(Q$CbSI9x8ABk50qdR14St3ILZ+N$8<@^WZihTos%Mg_szG`hNydffJCYzx}l1 zRPj4`9Z$8-Gu^3lXJ!?af1Ab!RV5#4H#dXLWrbn5{K~OAOa7)A(Xch z`5ekC&fl->I!QCUP%c98EBPmKm=KsRW(QQ_u@Y_*<6BjCsnjQ&sEzh6b(p?!!CGda$rdL2$Nsaha#6 z?I%Ypkx(qR+hnf5L+v#FeaKQ*j2&mvu1Bl2o+6u&nu?$tqhx}-fm+P{xMv;WoDbM~ z`QFFsv-IRJ9wi~2B9P;8>4Qd$r|)}rVxoa&PvGv&yS*`C)_`~|kb>9FjIS}VhFkrT z3<%h``YBdKLOvi3dx1WgCF3=xB7mvEzCI&V3Et`~l2VcpOK6PrKZI9R!Hc7@U$~wk zM)o|8-0VedRq6%*TUndlD4%%T9whXm$z3k2EYQ$DbzlJXAqe^*FOB#HeaSNWEKRIX zj@JCn%OP&*e2XfdHTZ3!$WA#$5kXX5M8qh3dihREK`|U9J-4cr6j8b$%0|bw8_zSxZazwu1pv~XIMg>#irgv$P|sQacDMIKhir%H<_Iq!TToLhxMM;NWxHvhGm@)~eZULyPW#@b}g zxl?Zbka&!KFq$u)J3N)G)bw@gzY6jd=PrH}WO+lv{Z46QS8KKpXWW*b+zV2z82D2_ zj)FLup5nO?-`UO&;2|E@cR*wx;}AoK%DUeFQ2M^?X303{U{g&33oc#1lIH?_{15rgrvp}CQz`qs?XV6|($0IRfJLxBV3Ue60UWF*5Eq+P(R^%}b#~wgly=C2fdf;zl=JbL; zQNF|LUFdeH2rQM`oU~XcU}iaAZoBi&CJCzG9}1WF)1sQ_^*fA5`MSM1A8xDh$*B}m z81p#T5R6Ac-hMLoQ}N(qQOn1 zLrc%=H#H6vX>X8l3U-%ja^vc{Q4Ye|B+nWh`0O3)@JpN5Oni((0 z{-#&U8=HKYuqc#ne=a{_svO)KB?||#_SQNFuNy4Hq8m9wGt$^~p`VsDq@2XjW8H27 z;Ht+;t>W9bWkdRtx;jB_DGGe3U_t?D`^hQDf8&3C*zSj}Y?f9mY`8#dc^>^)_Z7ctEX9Hf3!!7T5`$TZYd2Q>UGFJ|AL= zR1_)G4gJkspcar_ER%~H_HBHk=jS;krZ>gk3>70Ih_40O&F zd#Ku#dyke^OZEKaHKU@G|NlYTPmBEZ}=9P&a5nDR( z!`Q#l_pka<839{+Cyxr@ZJ9j#!RdzA&FO|ZqYGPjnPo=^S8L8JkOVIw3 zw|%r&?)&ai9(~F>94_UkWbtgome+au?4(akt8M^~ho4`$1PTSd&^bY?LJn4HGqXQg zsy)8sHdPlIHO|w?=7;@BCu2IvFD`y&hc>gHo=TohN-1sp0sI8@a<+Jg<<;=6!wtU*d;5>|2b{_#qojT2LJj9e>XTC{s?}^%dQ^B}_>Ot3x%Q-NuP^b4 zf2Y?Ze5=8dfE*SB;D4?kFPt~tXFdM3D0Y_q(wn}rigKepwf6nwCptZ^zI2bcOtoEf zi`FZ@Pi5*y@!DGCF7d4bP)5U8D`kIgB@Shv>gNBZT+#>?SgDYf+DDOM=ovefb5@lL zChJiQ36M3Xa9OVt5(`ZFka8wdVOXnO&1Fe&dO}8zbK$AvkBI}0Jxcs%{DlKAae$b| zA0`nLSa)!6$k~^+D>e=}5^_S*U0ZA%tSCLYiMI`}|Dddp1I$#MXsB*%L+Ke($ zVSg2BSzlBY{NYlHUUyscS*c`nsZGyT0WB`Eea)XNDH|q6KIlA_`Q@7Xb;+SNN2-7o zls_|=tyv{U5Rd#zA2WPqy>zKty{Dw2;&Wl|;GhcdUCVE4qg2Spd&I!RponB)1N?17 zbhNB(iEkM)g-j8lzP^5w%kmSnV5!!3d!rrxzGv7sq(G6ae_%k`)RacVa|a2>ez7U+ zyF;`GT)STbIrmS)e=xWrjEgF5IvGM3rIuo5siH7Jgi{9IQG$EKQ{=rRlat$z&D#7( zX$2DgF^KGa-vHvajCi?dF*4TL_LQCVFTJ^^?HDNxEMyx0`N#_XAD{bEOsv@B9M2CtVtK=hvM z$+^2vh;-CLJgnRJffu`a&VSaP!DA8ryz+sQj~{8wfU1W4nU2D0I?m?2yIec|ne-e^ z3qUNE`FD(03ldsQ^g))=Vw4LB0LD3(ZCS%dbBZ zv$C+t{<1kpwt?OT@DH@8yvN?w-&+SlkdGq(q`ks`Ku2*OKr8{6i%f?x-nW_>UO>&5 zo_^EWHUJQ7LY_N>Lb0+y$#S;NE(9>WQlPuv)_ird>~mZ^mHJA1P?C=sE56`Ov}oOIX-rKMHtrK-~axHj<$9P z2Fdf>@^Vbf9)OM@jf{*0W#oIyL^D#*gTRH64%poS#Xu)O3kGA2NzRWZk~REQ!F%Tq z>!*|ydhlJ~K!An~VJiSokLG{>#m>(gZFz`zY>i5PQ;sqtHEMD}08<+lSWv)F=P-rM zuhu%w{mFs5`=KE7ou&EQhk0-60%QxhiY-IPNBC*MaJaUCpt+Ms`4R3}&vwCLrm=o}*2D2TQ zf$nnoTdPS|0a=c&|Tx1BgU`BADFtdvB3cRRs37StSVhP&+R z>7G9yUhcXFNF`K<=-yy3pMe3dDFBsB*H~ek@6CMxzj^ug>clCjHw=Ts1^miU{+RuR)>VK# z>Fo+a+^wtG*|Db-a)A*M4Q4yXuEu9%L|gR5E(3y}C%|6nmJtD@+|O?oeJM+m2`zHg;0`H(_1p`(9E3E~sJvIN zUt8u|!CY*UYZZNbgn^K@jV$4LwLyiD*M6osej>$o87IfS8hXz>)PW~t^1W;4nS~4N zBUi`eiW*njVfPOpLr(;j%VZ8}Gtg$HSh@!ujcFCXSv~tND0O26^gij{UfkIfJ#)6K z8AY6i!DE@Ox4mG~G?^cKLp5J@O(8_a#-hmk=w@W)m57+g0>B*Q!0+F`e{2k8Jo-dW zm^gK|zZ6zNHG=f`UMnss%E{#d1Js%V+L)b0zGxtvyOaBZ6jP$PY<>Nh7G7ac-wnnW zIPl=4j9K!lvC{$Pr0H+;03E-xpQa?Cg+FP_4;E_)->NWuaAqcDu_Y}dTcKl&E;bXp zjViHm_o2Bx(xUL2aA);TAxv2!8$&P-t(sIx=pIsYZaez9Pz4-iqc(FOiL6zj!6j5t zr-y)Fts3h0GqyYjS|0*%_%V{%+1c6dmupFEtOa=W8DP^-;nz$ZNK=T@Y?*Ox-MFZX z!pvo&xHcy!AqcUS|AFWQrW*hYzOFN2n|KE7wgu(1UcEBSM<$I?$T$GraDWQNul$ECo#AcI-6I`P?+j4nn?3zI*$Yqq2E}94rqZP_IEl zdqp1e`e2$_BfE}v9V`KQV0I3k_vps=RlC?_f4=#Bdb|>;TamaT3mco;V`NB1+~22+ z`d;A)T&YSLs#BBk!&9{Ap~L;}ynayWlOXcGGez`ZQ((lpo&d}`RrO%?U`Bw+pymwR zZp9zFDN64@pLHASlFC5} z3Upxm0^`G-F~suxIf`;38alePxw*M`jC$lx8b(q*13Cw`_7z|3#O_~Ox--BIsbY%kDDCljOR}6620YR=W>WQY?B}65&|Ag>K0~ zV`(Q!gH{u-%Ok9>bk49fadl127j$%p_c!NiX7w02II=2nmqT0$tn{NJBRxRRDkHUC zuk1}#sCr(mHCcv$Tk(uGkg$ZrY>MFqX&rDZ!BN#qtpy8z_q23kVy2oUBl}wU5~KV3 zeq`f8d5fQRlgsvf8n2@tCFFi54eD6#bG@Ae{xPH3DD=o;Vn8(+YK=`?&c>QFD4Y&l z4hjM^fxbRb?s`oc%pGfprntzAn4xie{RDg^awjiF;ki%=j6J@UuTK-gGp^%hw*fra zOa?x(!VJ*2F(T>TXRZaS5i!azExuw?C@u^oaiT_KP<`?D>kmmS!~3A-UGgD|SF( zvr(D^vnLyPCO)q-Mu6o?HJKDMg~EZa2YrQHuT|!)P!Wxc`CBUs5h--mOS__^3t!_F z`7=uemo_*5_JYpod-y(r5eTk@N?GH+``?pzxIC)Aq!vN$PUm$EGs96MA8@4cR2qkk zxA}f`v$qi4U9A%V^8{Q_pD(2S^YRO8;}1h=es_FN?*tm|Ep(!B%r9tZr@#?T z9_^=2DZd5fj*#Xa=C5ydE+(d)hx^;OgoJI5<`SA58nj9Z*xeESUAA&f>b?;y9WoGJ~$FsOTbx7nA9Y)#- zX(s{18yu^|CDcNB1Z^l?dV>!_n?YY(cGTs9PaK#8we|acLrbVn1KMZ1JIBz^a+1X&lL*< zP%$6~0kD8_c6N4fbX3aIv+@0D=6w}G+w*_E=tfB&zu>b)+OiZvd|q@>r$C8S&}>qx z>Wz^quggCjKmSXT^f6CU@}kwI7Co_ygL6j#!(!RBGF-`=+tX4mHOb{S!aSGle$`Kz zNv>ZQyDX0}5#t70Dz6nCzs%}b282gP2h*ki8!l~Q^IE6DAsQ?e0TEGdeLWG-*Oalb zDaJCMA0eQ5iQ~+^1e(Hz!TLW%QF>rPeIt-QecD2Ri*9nf(spig_xu_;-wXicDR4Ff zT(wtUZX>W7xp^)@)C?8R`WOljeA`0!$na1W3TWPY%hY+ zPZuPDOm6q$8Yb)0l6WbknhFu6{;;%0o5}B`haR%Xm;VFf4BKLnOf;)%Yxq&RQ z{SxBvY+TpRr?{+a8%T)-ef|2i8K&w%Q&0*77zl4Jw(ohdXlDEp?M0cW_?(QEhYtZ- zg@UuFm58`qJ^wpi8r-$HF9Rtl>EQS{a6}*gE$q?Lnmz?WX<;uovBh!sewC$-j5a() z_oJhwktTmYb5|QGCuF_@3e|sGtw;XGY~GCH^ON`;Ldh(8hN7jbuXbV|00=5-YI%&3 zWnD&{03X=pmVSE*+5l#R)};{W9qy0$Mu!^QvlnZqryaZv*ptSSiYyB4snkmuGFy09 z=k%bu7`WvIfdYJ|ASBauvKKR3$5RABFRbOs0d)*fNd9=$6GwX~44Gg{|21P>WKuKw zvd(c;1~5zp{>dT60~c1q5~wx+wXBxbG=llKaQR7YHPC&Sp8VJ zg`T97G9ZR_7@Gc?Hm!m9AnIl#*m^B-S0E| zPRnjbvbru5p-)p+L9o5t?50N0wEey)XsQy(d3fCfQmJzNURxoM`}ohJ>}ih@{c;&p zPKEwW)5>CXaG3K3x21+S^OXB$cxYfnLJk*|klHOokGU@f zJP=M`mw#$1894Q+1$YDmh;0VP8VZhv!-(Zu2^=Jt00@Du6`(NT=GLtr>|YEsEDBnu zB5|2Z?}T>UH#1nl!_%UXmA$gk!9#rU>MM+oXm!|`c_7Dsv-Ep<0#jYL4I?Y_$o2Xm zLqvIqtpIp*<7>8RdM-7fEmTLTzsD2|X9aT;;~%h}a;XXI>Wvg)HMnW;rWr)@jL;VqYAR9s& zJb?faLhTfAH|?uFr|pUP-4GWu1L^g3yN59MBuHCN^NhiRER`#PMJ76siJEqKnv#T4 zITqJiTgzq1Aq%;}_OHdAdI^bz*Dk>i0apstd;;Lqqn5RuDa3gERn~lq>HMFY@@m>4 zW<8c{&PNl9gU=2BAsPThvX`i*y5dI82m+ZJ$l@sL7z%_H{z{!u)t%RWfIr3*Vn>IX z3lSsmH--@TPo!LYzYpq)q5Ji@V(+pRw#*4x+2tFDUtcABVP!zwP>R{4 z1o&H69M^H!DjEl&k+@UDIDRS4^5yk4mj5~JxuOTA4d`HF*TQJM?nZ=!3V14h_RmSA53^B(sJdAn3*%5A# z9yJ%YQxb}8*8buwg^}UyOH8n^TmttD(zv0G(&^buI!ZA%fqL#^-)1x?smYT)RS0DU$lSt zMaR}VmCDipj@B9zrWmsw+K&9(aw>n1v=O(eQ$afvcB0nsKT440@4x*KWng~KUvkWS zu6SjNs0?rP1tEnSVy4z!B=X-)@e~K8lwLGZitmxjt+#E~Sv`|C(UE;_LyGMPr7Y_@ z%54Ud=wR&_5`QmyLJ;`es&Fr3k75I=-<2+ZA`@VVMwvm*)e6<{ZVq%TyuM2mFv1T7YO<8U0_l_Df8a_o6!oOCc zRZqC}D1qCX=00|bv1+@mE&p_W$) ze8+`ZQ{}Pa`T;rNVEXGpz1MO4kcHbu z_yA73sDCARIo~ZgdaXwu1)*q8X?~8%=UZ%Dia};tr>uzYv6v|zqTlBia7LV0(BLQt zy9OO9>A)qydTQ&A*p4PF#sS|a+dtW4oBzlEt;jllQ&SV@Adjt(3rz44!CX^=9KZJ^ zaxZC>etS849#}RJU>`G=ve}3mvuS`p)mJO0h=DiyE*KI5Ke)l?P!BstSi7gZ;OOCx z(M2|5^EXT%97Q_b6B%+|f--c^RRmsoLzH`LG>Vkh;h!?Jz<+jC1HCPl8<6!?))|%N3H%B+REi{-DBP6P|B<|<$^_jr&6f)H5D^U)^|@V6l29yln8@1mN!s3pj(ZcK zeLv&LV~jPzm`zrMt7Pi1&xqn5kve2(!EQ8$IH0h1VWspymd2d*u>D0*14yKCrJ(!08GMo&pMN5Xj;0I!P!9$trL-C6b>DN^p3#v=B@{tl~gxYcDxO1i=y6Bp7Z< z3Jl|i*)l}HDI6%t(8XZTZ znOWj9#40keYAFl2E1ee_kovb~nUG`o3YENk-~&}aNjQK-w?4bL7#)I3NEi&VP~|y3 z#Ij3vjs{Rsj=xgx+b&#!nE#r>wK9J}M9T&rIEPeS1ln}x3Vy!+!Y@sYhA)OBjyr=` z{U!bbVs&Twj*A9rh_Q-9(IuOcqNs`N|x+*4Fp0Od;pf!lq5he%VuXyvXV!>XdRx zM%~oc&Q1M~o^?vN21kUbsZ?ctPg|qN3n}d_hAKDaQ(fGKiYrqJnB4jAkZr+(;!dJ1>-ms6 z_mgM)2~fS!6>J@(OyM8|#KZuZKX*G|_d(=@#4z9*8N`aU{$@bM@%Z(b&OgqX3~1^` z<>R7D%MeXamG&3gkyo!lCw*r88Y8VCBFI#4E-JDU?BNYj_gPS{GnaZ#ArBD4XZO4i zLv*?+>`oppyr^hTMtZ&5?A$V2@7A&}0eQq)=} zT-J~w_%7zJBu35^q3N5d6=`sXIxw=4NJVdn#GTjI+VBN6fWreUh_$dc$ie z2(wp*xuhI7@{!mj3F5T@JlyDu;ct~E3#L^B-PSXKpQXsvDA6Pl_{doAu#BE)elQ($ zh05~*Q;DQB8Cul;!TS&Z(6%MC5?}WrXg%xNvwzF}O#7X?0Tal!ftQ81`mltrCktCU zy@qm8AIoS{ibI|tcHvW-a0n)804T@;5sHbVT*pKo_kJl=hJHXG>vMo?cFrZC!m|@~ zvcmcT?w)5D=~BPL{@$qSqJehfZy2h5FS0%D*}1{$UfmW(x|4U#b?>o#3H{HVceBZv3Hm=G zz{YOkjJ?TW$`9>d+-hMSdGOs3e_g`CR@tlD_(=C$qRZ@i;{TShd-bj94R~|xmDo>F z#rDOm-6Z4J{^+m=M9U(ijz8Y5@F^3YFF$QHT4_PC{AMrz?`56q*7zaj9JeD~vhU>T zuoSsu;aaWVEv2rt%6_i!xvcKK0CI&4{MMXkK4Vd@(9IQzAI3HRdz>tk$4XRQL_U-S ztDS|1dJ_bovx+d>AxNXG@@TFJKCGp@)`3M=Xu zWmc<~9*{vK+|?JTJ%AYkEh<6<6*Hh-O35Hciwd8UlLMsq!eU}Btk+2h+nXjpt_x%V zPKSJB!otMl<)gf^bWt<)s}*i0R@R<(&7mO_SZOw4`XyYt!*+i3_?8^Qd=Zo2?Qze^7i1TIyE*+At;dL+nv?Sx&?~q7KrxV$3(bWmBqSW1n2-gg3#1xn zd8d?)PMchJef+Y3ZJz|QBhEz{DD*Hy@(zqpRvAzi86g#DHP@D1757$u&WYIqJmhV= zl9UPYUZlGQn;GI>g)#h4%Ru@B|E?96kO)wsv}iNH z0cmki%BEppKzX{H3WK&kHV8#lcel)6rJoWu$;o^1w-li878ZsINFN)32g3(u;eaI2 z%!{KMZS#}Yy|NBpgFh18=ValA(6-W8Nyx3;qfs%@VOTa2x5l@UdvZd5sf`cjF5riB z8Hp)kcUc!QOkYEi$H2px&rN&Ht`Qp99 zA6A{&+4}4IH#G+dwM>W5;!iJykLTXA9gdHuXYgBI`0ViS@=x@DsXrv5ey!SMlB1wz zfpD0fmL^DTGL`VupzG2E_*vguThmWA2jVj`SrbHsNEc&GU6n3}ZfA-^);Sf+eo_{3 ztkO1by{}>-0g#J}mlurk!sp3%QB}o9LP833#|D4b*4Ix%!ON8v0veeM^5929LqmZt zbn-rf8p|}u584VUrE*zMjvG(s%Yl)}lhf1PAeGxw@A~fDaCTTCH74=5{{H^th#wmt z1%4D2W&il`s&zPJY-@Y_4JgfsQ&r4zMFVsN24{JXB7OP#wHxH3P`F;*iD4_LYiSMW z2~zPvogkq-Q>KEuySqS~gO~15PhVdFTygASdTQ$Mw^wQ=KJl~U2VK} zJi1QH?)UPDn;)yaFC8ebQGncqd^%rTem*o`tiM9LXY=Ig=5i!MtsEU0xVaO6hF+MF zRA;$B%zdEBM!8#;kJ9bskJU)E0kqJLK z!sF}~mr#0@DY)Ln$caxT$n|g_ES$mAX&%p_C-Tyz!72;cp7K8G*(kaVVj*1s6z>d| z_&tM~hDLDDdZ$H=3Q)Kz?!S=uShFCnqw|!(v|Fsl3hfcs&`7{kI`0OlX=^*XUW=MH zmgDKhGvls1qsAaL#Kptoa<(^R{6?tmzA=fRp~;F@K<<{0b9X0YsPYw^EE>wj_OqbRUoUgbk?t%$Eex=|2cMdSpYt)Y_Uqd{;{hvBH`NR1o=PcPIwu z=VU>F^a}s4$vk=pl%yEczIO!UjMO#0XJ`8hdtXfc{7DypXDq0cDfDT+?i4KW0w~tS zN)}XgCnB@OLVtZ$3Y2cLC{MH4|9K6cKky2C$;;Kb^bugN{dKGP0sYmJ%JO`PgCT~q zMn2HMf)8T{r$vv#$us4vjfvjZ?s=(%;3j&9jAsKOw3Hn7=Y-{aw69g2*T+FD$Y#NV;gezJ=A9)EJ}^O>Q^ zSSzld|F%N>i@Qk1opo#^Hd{I;kI#VL=A!-5mAgm7ExCm@za_LZ1)Ht4a)3}HWgS(^ zLTg26Z|7t};4OO(biDfC+NYDHrcRj%<39DeEA9Iq@qr3)vmFKE`zkm}4hL(SI&6v) zKS+rSWjFJ5*pwVRs!obf6yjHRDy!L%53GMtnGPSi=UJ0!mLzO#nW?I&fr@iNixJ|Q z6Cc>t`QW(XLPdH_s=(2du(A15q$BBCIW%ywX;8gEs42Bjb^GB>&+vl`+hVLYLdL0B z5~eaDEvxIK- zlo^tQfT^E936iCb-PPPbPA)CUySZ_LeGRO{P;M*KnE7c^JJ`SO$EfLwscC6Hii=-> z6WH3?s#3*x+@rJ1;^~n1YI0xZeY%|J!(k64&#V`Grn3HsPuWijvDfW<8b#--51GXR~vt(g!%&WAO36PRTz^PmVBX~bke+0s<@|i*(j>3$e zh5-V=@Y#KQXo!ZJo3KRVIBdy*H#$0+i;D|9TPHpWKqX^0AO41?&$b=iEM3Xo02Mt3 z$6!U|uko>*Vds6VZOWs-R{v%ov;n6@5KX4>u*>{HrbKshL7!Dfyv5HpF+rcfr&VQt zr>g9^yu6AWJChj$B; zbM~b|tgNh+0xbmvA+)kFh%tCmB$R-c=HDzJyj&%ks6FRizhFnlz`*GMUE%}gnIDu< z){^6x$rz%{Nl5Dl1=`C`NhVllHm$cwp3MLgN0evNlK5##>V4=^CvZ$WgPg`E3Kmj6J#sYvuZ^n8q0x67&q1cqni-gxM(AQ3ae}@{#FAZ#dWk zUqICuFUoj&e6v6LK!Z6zPD!Z{m^(lf08CDqQls89LY-x@LrRuO@z9Mz%f52~Iv{Fy ztYabB5`t_Ns@=CdS)Kzi4G=ldvEchHL^enC;ggRp$`~tFq1I+f#&aM0=7c*sLTR`U zBG5NyQ6x!_j?k!Co5PvzCO{tB*xaFy^dFm>>*P5a>OUatxJ)IUI zo;Y?sF{m3(_6#;X)afL={0i?n&jBY=c3NFA^}Yo~&mh_zhr;?~YCh-WuOgKAGV9rd zLQUx?sp-Zsp+m8*Z>!Fc#k=C+sHn{4lu}<$iuwqx!#!NgNA!b-#(|qTvq77~xaIK& z(@;sz*!D`kxzT1xO5hHzRcU-(o*lye7)WM&^T5%J+;vNFBE5S3U3U2|-_fQ~e5_Pt zcL2q+_x-x?-MHnW3UywkKa`<*f@8%4G4MoNsa95(CrK_;ClpOd6UwX#c z4T9eynj%h4<)pO(uADDx545y{ndSl}i*cy*Z8C0U9DGJ!3Vl7*Wwm=lWSWJvqq$JS zqO@d-jB~-O%1&0jl$mLbg6{+8KSqzoVm8e}`-iZ7{d)JO+7dYI(4m}x@Py4iFoQaW z4CX8&dchpa1D91fs)^%pk;mIp@1-Sn$s9&~`Do>+Mx7}$-^Z|iQOuWzOPq5GbHv%c z%A4!4E&3|YZwHoHS1L|$EvH9FM>#Z*fTs-p(L9)uVY=aZy`yLXS6SBe-ad_$ZiM0D zA^o<5Wn7W9DNc3y4|G#YH{Asx`XfeJYW0Q%`Lr5JAyp(ciPiBD-Fj+s0iJsg|A%gODBLm)uCd(eLS7p z@ho`KN%yNSCF9fDZ2h9T=!je#qe!{{Nu{8yEV`h89v>fi<6d($Fc2Rf|J^c11@M-w zY;Akio!$ywcBg!xZ|4<^DRln`6ORtf7-$=vc;h^-&B>339!|7;Uk|)`AQ?{9ul>mN z4SA=T(n;e%l)TZEBAfH7%lz0S#Na;D+ZFRBUswZz!$s!LUHO8-v__MNm+VR$6oO88 zQGOrk+}xmUKj-Ey7u1G3(6te1>ld5q>l2%sn?=0e&Hns}I83&mo?vfsx8Z59uxkQf z(^p!`cQKw`OOM4bYzN&413y?Od2;(2>@;V~!P<>fja(vz`}3OXT%A9Ysq_mQBcjV# zSkME<0suIQK)e-TERl?jjnUE5e~pi)^^l3;fLe@_02U88@PMO|2&lmqO&NJ@vLQ?h zC+H2M;TT)1E8f$xzG*UPvKYO_sfm>O4~O6hQ#^~;@T;nPR5~q&KXsKKod{2&nzkaw zob)|SOH1SbxQ7b}@p!uEWo2c6{JSR_^w+M5DMVb5mz(>EVTb?h8Erj*j;`)2C>t9J zNdgYiv#%QTbh@VP^5Tf5gQb{Ip&x+xsHUtuSprGta}Gd2!CpJP1{6{J1CwNJQtZ$` zV2FX@QeVDYyqA5$=0L0(pwLh3(gL;VpW4Lho_W(_qBvg41isG8FOi6vs=C)c{+Xii z6`=yo{^ze>z=j9REqa?tLgR;|K;Qwa4h@2tmk&%aAuZNc7@(cKFzOrQbU7MPIdk#y zl+#nCv95W$dT}Zva_1=jmKhU})dm+=y-c1}rl$m%pXXRY5@^JENw$nvt2AV%81Xu-TZTHKJ6ea&_v*3y!ko zS+&uaXo@g@1f68s!THZ3H+wQUB0ka8rHb%_oVDfGIKXbEq*`pG)s!;s*}8)i7uh+; zuFjF8mKo~nj{!yu!ht`){eEqA8MG>_?0;c4>U^!>tJUyur@rYVzYlB7Eb3FfJN<(k zED@SW1bFA=nr+mK5^upW39Y;wBC&d0wz4%$RKDCB02`f(BNRF-BH`^nWxaxYJ)TY0AdTxZcLV0 zzC0p7{k6>)ihP;P_Ds`N?qI;w(2)gfG*a z!y`J38rGXi*w>-c(gV zXwun%+-cwv>1k;Lf#ee37dRKuCJO6|xcF?Bfq<*9Ux`=Yyi6bn1J@F%v@OiYxbPGrS-4i{!31%wE z(9{CeWbkEU;!^y3NSgPX_MN8zMG8-F#P8q!(&W+F9|>c+yCp!mN(Qi|sB%!+?o@NQ zUss{hca=Ix=Oi#R@Lw1G>UpV_M}#p0)_VoqClt+d92Y|rZi+-BfCe=$qn0&MqFQ4; zQ<`Tw+W9z=!Dgv$XhDvPLjv(~1gfOUe{_Z{waIHN)k77>Q`(49cE;*>=8hj}Ic8Eo9}+-Jh@CfQ3PpIHX{>j;ZsGWIfXu}CI}K4zz-PB-P%J!5agz1X zQ7&hLOn%%}N0std)I`~qmAc<-P1>rij!uF5RI#|%Q#CT)b#~0BK%eRAAwkEPL zRZ}>z`)@2Gq|ocPt|W2v%Dm^#WjS_qRdt6fN7KbOz5yM!TRO2y6TU|i(4)c6$F*=7srs(P2hixU4jL=&{JipM zcQ~@Fig_#`bJ%4$6#BRLA+X3r$XC_SHLH=t+Eymwr%@J7E+s9m3*?(n^t5OPx5T?r&d%DkVsKxVpMh^Y%H3 zZzxNzjsxR;KWytP0Nb4;Q9NutZETqFd;mvu`NZ=ozs0 zI7wH#+|3dF2ZRng<|$5%To*yOaMGW@Z;t8-mbpG|K_{l?40XH)@yZ#!9-^-oELMK} zgLws$%Z42*G`tdyKo>JyKvzh(X?_H#qgViwilr`*7j7I0Nhz(*B19ogmp|?O_z4BAU>9r4tGL#W% zB~+oRsvukhh@0anpEEoD6j$1UAH?14v1gQZTle8&+(ZhYp z%(mt}*^-uBp*<`tEU@D^jk|*!pgroo=C*;MxgVbqD^?=@F~hAMyY1U3MrDa41V+2# zuSZj~To(|_qyUeei<`U3_tu?WG5xKo>a;)Cu+iFyr6 zs>p%V6B}ih-X43`&B`K}XqsCUNmBm5%^EvA^BX34&Z@eunPc1Zbh3r5lNJq1ung$8 zj0Q)r;Iq3wX5l2RM1X;bosWraDOYOP(LP7>%C}MJaXgf#0VQO=`vX32nPa%c+t=F6 z?f5y`KE7iS(2b<%btc169g^&dpXLAMFvCGw3$vtf2jpEN$)pAWh~RTtg8;|_ICNNP zr-}*+&)xChrZ)&2vZw~qP?j58Z+!aeO*2BHBRCb3)rHUh5Hp;oZ+1_7`eZTw+_qpg z52+Wv6NJXAdxshyA&Cl=m|;dftQD8#r6mVYyMPZ}`?CUL3x6H|>a*YVOaL7)kW~Nb zdwUVQJjaILCX9K#%LWX(>9HIe+cAdd)T5~+U3b%_yT0I5k};#HuMF=D+YVxnMU8Vm zsim@phP10ICkqRUa136iB1mBaDkO;Xs=cB-^Y&(^tG_Qg!g{wtSWR z4*=|rR3hig+tCKpK6+)PrBG%vGBUv8WCz`;Z7Vf?w)qS@7AXtA*NpFtd3U!`NRRhF zg}Li^RY*`I@A1$#(vpV!gYcGqP`Oi`GcHOd!W5l`i^VoWb;K<*D3Jg`mt;#Qj;)Zq z;%r;Gg+*$kOK~tS&Yz5BD2a*6>;?$FSzo6qo)ZdhkBcnioa_-n^_kIU)EzSIUryy3 zsjgEcIQZ4Da7;D&c~PJ|UolvAmc+AEy}BWFUcQrQcz#-K5!oI>E3BAPC3!$k1mNNV z8j(oxIWqk!({m9ak?x&k(C*Z||FIfyZz)+Ktr`mkhn)*!lP=xPtUgGEBVTEjFSo;c zzJ{;THVzB6e%gPP<+jz>lDIOA!PfL-zm>1s^XTy4`A z(~P927rS(>AJ9qZ&wZdvCM-|2S>MmNX$=`c0m*b@1ZHUez(9@DdiR$D_WqdXey+v1fpCAQYG7uu%LwQMqU3ShiE@Pn_et~zhm=KSu~Cl%<`Is?$$rAV?$y%UilB`jLWJgM$()V*!s-ZP=D z0$|DpaOf=(uxO8%jUB`z8%q7Hp|MUFR!}K+L}N3xbZhkM{H66^%V-80EKiF~=qj>5krl&hNZ@!g!Bw{^+as|lj zF#PEH6^!gddUXq~bhiR*ZdW6XBuV|wIm{6W{hD0u)5mZl)NaNn&rP$eJMvt_o#L|k zKDl8gJ(w!(!#X*qpllS(+Kb@#TL1%+TEhCB3x6H3|9);c5TAkDZ2PYM_1#vf=Z?9o zNNT2?Mx&L<#I4d>%?|{e%zzS?jjcLfhCR)(y#Ml^!xgPYPOdd!fIl14* z@=h9D^snx>Nqdyhl`-=nj-`4nzAI1Y9zuy)&FpYC@!^aI^W_uR3u={WGsSsHmS)qM zq3H>jFT+jFTka_^O~S^H)gU4t%h+M|+8hbK@fk`&XUPEiE5Wpa;@dGbn<>Htt_-5D zW_u^bV=Pr|&fsp_*{39mHTK_d{M}Y#&etX!KitSo%gRy$eHixk_C9wf10Z&n{boNQ zim72}I59v4mDklJ2lfth%eeZrXS(Lsj}6>YHK=JGcaa+35fy6Xm9F$4fEN}ED!lnc zJK`b+pBnepHV z##zwAx7;rEh8s`!!blg{FDUA*0mxj4eOjrh1^=Q`misn7X2X$Vw|vT*?)&tKh?T9@ z4Y}Np$cg)a42z2M0bj@by9ep9u6%+_s!%;M)UIh`;0>JwGGxD#NrR6dS=fRn|NOYA&fe~1@`n71 z_=}O94Lfrrf@<^&k^t(n&x?*7zBi!Fsy!(!%~n`{w~~FJKh<@>=s*~MJ?k^S*lQRs zHB*!}0o+0KJ%nNp>PjT|z3=IN-a`PxWRwb*y^q^?l|cLLcz-l`$0vdD^}m1lD1{v{ ziMIw$S0g#R7w-r5RCM6br)V2>TEhAev+3T-|DJ5i;dvh!X@nXuiQ@M!K8s)(`gq>} zn&CnU-$-HdR!@?-pY&M2 zGbvqhw`F?c|F=VRzb7k=BLwR#^Q&sy&GhzjUG=>@BpY_+V`7RK2<$c4z8$!#Gi0;<}HR?IbJCwHev3YF|+UUUPlj65;sT$)X9qKqk>vnquLphPCt4BHnZkComO?T&)HA zRl%0PGg4Xse@P1939$`UJ6&`6T|K-JDT)@LYa(u>oHuT5fN%zgbd2qPd{FuS1>i0@ z^of84ns}wPYu2-d`*hir$~ih~96-D?Mc04pv-nES31`5ckO;6P^VB#<9FS;11(eiu~edd5r)i^ zo@<|1u@ki+d~IY6?TekJStA=@Hz&p_QBUP^@XnCoMnb84oqRg`O!h~%JzQU#HEFuI ztuHT+kL`a;lVS$z4nns$TGL z3*`sb#`}2t&FZSpWOFS%nE2{-b6S~}l;qQ{-ILm!0})vZmDgTQVTdX-xS9e12GM(` z$-WKSms-T_>fmzUcg{(1BaZ&gmJ}$Gbt1dT{es9B7qf#nnw_I4jkjXPyQ2ddy8rW!CWaHeSNWz8 zHQrk|e1A{sg?YAMwSoC4(J1>@flhzOCJD~kGt~CEeZ^`{nn{JDEn2FeOv+e3$aX`o zm|REnsn1@J*+$2@Tymt7?fV?6b(mtbTyNaxd{nZ>dk}Jnj1belh}gX{1xBoa56>6-WtbeiHAO9J%nY;ExNDA~)}l#$7bZ5VK}EU5+0S}88?WQ zG8Uzo1&rVPk-`nisbnXRmO~;!h&1_2#sf!Xle+U|C#d<;sjC0s3lf^LsEzdMYWg4O z;>=OvwcxEo(o`4*1c8J#sM;3kd64%~%-uSq@AIK#h&jh+0{ixj!7f~mJ55y&q&~yqh97zHtFK!L z&*?$z1KHEifl=^FZNRiR&tsk3z_4>uu>t|W+{V~ z;3u7()Fj)fiT{zo1+z$=N*=%hfz)~B++my!iRH7jXG?L_VSX{&Oc5r3Ml9cmRo^k^ zJ0Q{!09n=EgL9X?$(*qIOXy9nIrDIuDEuFb_FP8ps`^I9o)D}gn^bqvn~i2G=~Bg+ z+Q$#gANL&t8#y(JM1T40al1(U>s{$qsjSF8cg)v9%V;cQj00Uok zJHU93IgyjzXG!t^3XNKq=E1drXH2>I-SFUP7 z(PN1%T#!D>1^}nf#X}1qn)@vw;bg%wOGQ(&9}w4^oAf|raCw7xWGObM3)pYXa1Kx~ zR-_5^X3tgVHMyv`yI<`88I6#67g$o9np<2 z(mK~0=MAZyi7X{Bx#IBf5D*roR#p_jH>bN3fGd!_8;5W&t~^9Fs>m%WDtaC#OL^T5 zoI0P!Y_Z01>-jHT6dfHMJ;_&4U>>$E33&2rYt?7C#;VMQzSdfygZTopkiYINLTwlH z?h6YAKW~qflp6oN(>m?J;cfCbqWF_D%x8^cTpJ%3CoUr+v+CE={|JvPqGrGgZad?2 zn5n{N`?BNl{`+pa>v#}NDJ^+iQ`Ngr4n*yp@j8pUlUP$#zmrIHZd#}*Bg+eGL-D-{ z$*fgX(rPw!jdSqZ>2-i;NEj>hZ}1;rzJ13@;Qloenp(h5AYD~v*dapLxqGS+vN-pc z0$nA+D9hv!Iuc5_8ex4;a(dZe`O@z+Ej;1_kuiqE=%XE>^bn*U=UT0x&qN1|-q--8 zKSJJBpVI)EgY_%VqSd)9N03$e z(`u!^1B!ON-9lPwfj+UFuvO~LB-dfH`AA|LX=}yfJWV$el;GBr7?}B>feI=xRZ-xo~%hZQ1&v& zvHooe)sM7<5Ful~)Uhq8*bZk%P1UM!NX*Kk?rk?R>mMB|D)t)Vo*VsLY1|V50Pp1; z;6;6=EZ95I;a0eebMj(&)00M3zMxRB1&yxgp!);&OBm`VDN=nVUm} zI)~-vlaTD?opUco7~4B_4Q@0mQX-GciBRZiH1F>iefJNN2b>eNHmphXPmkDsR7|Hd zLmiZ*mL{MNrx@k!H-9!lDZTarwG4gTE&PTB`J8h{>9XhfN_>H1ycb}L5;r(z6|Y~H9zZXFs006W6FSV#NLI>X0 zc&gZVRvGVnV$6-a!it~Z>$Du_E?IPQ>h)1!YhO2%yAhN+2b+ znHBl|om+BX#$OeLWdwlIv;w&CLV^Q%kOxa->SxSk{If?3MtocK^obOqEOd{B7C~iqdR@ zewC4D{ylUQ`fg~!W|0IfZv=6!keW$gQS^&DDU{U6&n@>qW+~cuo1dO!6B7=^FzY47$@Za@&0GB4a<$BhOzJpySjKHhjpMM*7 zf4{5e3t8_o>Fn&hvulxH;F+xMnLpDJBJ)a3pDi-fUWdOm)~yBLnRE{({7H>I6j(&{ z#%#6&!eVtDQq~Suwj8rN>>vE|;bgbWD_oUP=pXDC)fU&=Yz=v|SOCUIrQ?6NdH{kL z1-kh9Zm3Btax=#hqaPM$drmf_J6x6L0}Djs2$uU)kO{*zLM-Um>j!vhYY?Dg4+PvO zG>OEIYT(>As*6sZcSce(?4S(xbfADC)Is}ruXJs$}Z?&gyU$am=eUu(g2Tm;! zy7oFmIL83gu62<52p;3N&?^TB_g6N?69aHSgs(#*crrz>!1s`?vE5|9OPJ6 zi@L_#<$&?#Ypj3Q-g?Tz>?LGn}pe&PBy{3e+>ra#?}lK zOwogITsLx}F>`NFMQ>D{6YHifi zJjcZ!x;;G&ymK1s0fUb)&WG;5QN9rruX$?8`zmiK%{JS1xx=#$R6Ko7?Rt;bdR*1s znnj>2^-GbJ?=OyybJHWD7GckJtG~FvE_ z0+#qDkYJ8?ncr+_N)DPNbQ<#{uruYO`uEHmKyj2#e& zvVi3*Q<>Sf%4DFj0J%w`ZAj!Be8^L`bxnM_@vel7pO-SlL*v2(Ztc42*~r2cwBx>m0!8Y;e9`$`xP5fOGlk!)E%@iBIzwlp8fD$x#ZrT z1GXU>-!j|>3wM4*uwoQ4O#Jt7<45J8mLmBtJqQMbsz0)nQ*A)v_8_-1SFXXsZ|+;V zR~ys3+ck-vigJbC&YZIcHv=3y-#(dx#z;NOGkj+u{PWtvFM~#?O)iM~AL(oy zuGMG2NWSrqJiCi73Q33Gn~Pn!=ml#b&&t^sx%>X*G_}|27}di{GM^HtU#17%GP!gr z(bh9PL+$dbQGH~((nIB{qC^vSn{cOn7))~jorFVP`qDA??J#qg|8O;?*D*WvA%O*A z7(k*D!=T_?-fiyHaU>#9k}w2#p9o!y07ctP#Ii-o=NT)@oyx(sR3*;j{?CT`1Fxsl za$`DmSZ$fFemC<}lzsZW@S5;)Mx^>cB`;x+-AvUg(Ve^KmD<+SE_JRrXJl{foHRIW zWjp~KMk&6XxM_xXT=o51_I_SW&H0Rm>%a2$p*$%BV~1tnaOSAKgwjneo6OF3$`N9N z?e9eQ(@P5Bml9ak#R%HMAFvGIXwJEM#rWn3#w|!4ZuF0~!|c9D1Gkx6Q0-rpknZ)y zpRZBpfM-%dy`g*yc+bb;kXck|On;Sj%mylj@43T<>BgOv;jdUftJ`&F#%9(HVw*-G z61Q`RUpI3xYI~>k<$Pvg)47it_i|Wk-uDro)!>55LTDS3ubG=m8%e^SI$X_09i%Y9 znjh<-m@w+BflaQ@2Z?8AxTF7kk~{nHoOt|)Kf4ucVsI>*j35mly^(1OYq*I0AgUhE zO91i{v)_py}8aY%RA#y7~c-ubBzXexu2r{ zsS-M;cKV7yO}YS__#!nGf!X zHB+Wlk&=>C+~yj5C|RuL;b6SQn|nMASk#$ea4E4^8N6Bv+yTwg7}eL-AHbv1cB{}R z(n}+&A~t}l01OCLNZ~2^N83X-T(ogfm`@2Sz{F_$N`ZaDWloP#ehxjUVaFtwHPCFF z%eT$3oyU4|yq7{=D-bdi`IHeVQj-Jv8lG9#?Va`3G&CIVHrhd0n0MOAciJfJ-CiC7 z!j6Jv8R%c5AXQmu)UY4S;u}#$wRCK0<&y^zs7l(#(;^aRd~`Xq->Ui7XJE8`*3+rT znL%^cgy`=tu~dYdD&^m<_USg77mv>Z?5DiInhnODzz0P-#o&;K@S4LsjcQ7au2>!2 zSB$+0KNY>->#DR~e%ZpfD*@p@!#Vp@@UQ&pZK%fRu>x539M^y^jVXS}NB<-(YopmG z_K;0UZPh#(n}SpJm6IlotEbjcCvpOqx7A^{0>YE;?E$R~w$Fd<4OKzd7Fi;`_vMDV z3zeH1bRlS52x<`G3{uV}Ydl!c6hK^JzMNuOKhacFS-F09UF~6fV)x5%615k*rUM4% zfWAMmQe$bm-ELj;RckSOv0>BFqrc$#2TlabXxi7t0N&GGHyl2lX;`UUjgnp)<}{ZT zu5d+p*_+!~YB`v?3Jr-Ip`$~Y4_SOi%O&Gdjcu`7e}Zz-PnPiO}R?qp~Fiu3iK z#>mx@d={)~D)xq_bgG&bHbPQ{YC4O6PN~!pxP09mF3mCN*lE+gZZ=WjcSW1H{rIF8 zYo_a)x=o*jx|Wm7*ZcSnSAv|HV}UM<$dXk8i3=(f5xGtn%q$6(q6eA7Ukl;{A$TjQ z^{(8^-<{Qf2f72>+p8FTGS5%%o?FI(d>mOFFQTHt8`j>gLvj1_b9O(wBbURFgN|tH zUy}dM7m}1TS|N#xQ*z1PW&&}8SS(mW4IDQYM-ooU;s=@zorux2?0sx~Y%qr(D7StQ z0KQZNj$**^jsgOXW981DP9UUhKLervX1Oyxz#>ur(4_aDANru+3$)wS-v8+d?v0+E z-xXWip1~q3pZDu%HDHYd)^+Nsd+&zx1$>zi@E?JbNv{< z-zy5d=8Ogaw&V=v;d5dP>x{Poz(N9eIr*qdM@i?{IOxube0H6cTBu&a!&Y#&%5dHR9=H{<7`&idlSFjHd(XrqQ^qU06=ve6Z zk@ymv3RC*~uMRwc|2vnMK0+`6QLw88*_r;;Nc2TJ%ERjbDkvxN-}6yA_i!o$RNeoN zLKWd#1_lQC{+tQ6xDu9FSEhdd2Z+R$oyYclUufU@YM}vXF9XD=SXyeT?KQ~KGRVZu z?N>aZq<--Ndq7ELaPCHEBu@z!RmWyJ^7eJw;MAF9ss+>c*?_M3LQ{bv-N7ZOJj0)P*S}#k@jcn#!jyN#nbJMXeSQobNw-}+;d#_} zT4ZQ-Lu6NAAVA;o{1(e8Vhbm48C+kIgv{(vEr|LzxJs5n7eppqBC2@^DL z!?6YMAm?37xxFJ8s8#ht9483IdZgV!f-#1)v5R>j3w8tA0z&Z6s!32BQZ^KvFYwG^ zdhW_K%bdcQd`E=l3^GadTkM9^$!@Gbf_ElOJFA)^L{SWQu17|D1?_l0m;KOCxZnL# zFk$yI(f@fRWp7M!(&6tN@y$aE@ zrsMP&gzXFCA70uVTk;Dg$ejO?@cwvdlvYXgQ1_rGcf-=cd&ibGWf%SSq?i2m#Qf?T z8@n7@Jn>RfL4ZTz-A5d33dwWI7A-o&jcCmZcdVZXO`PzANIyP2yq`smBhQQ*DD`qy|Y)AXQQEs zYY$7|6yc`6YWu{MNiUGxN`joBJSXQ7Pb@W_LjT}gVOeELq?-iqn?IxCmv_W7DaBW^ z=mwML6(K^W_=G=JI_pJn(zp(&N6S%^<+KZdehNQ_O?eR-3Bm2vf5R??i-%QD?pjRA z6A)AWrlDIkVebju^L;K6eL>qz_Gc+fsN=&~!;fGrTU8f6-vi-21R_7c8sHN0THhI* z_DD>Ef$ZBSrj~LNNE9Uc-&4Y;61^yo+~HwV4{MT!R++qW)`Cv2>Jp^LmI{Er=iq?&cKQ%lQT#sW+RM%>h2jrnF|Wo+F|<+nyX4 zv4-iI4`7Vg+~HewR*e$iE(7;ZvCN!S>UB7C0vN~C=T*}vOK`n*_OTxnqg`RwTw`@o z*CrXQ<1o#AoPDu_<*{ZcT8?9@a)u~DmGa$MQ}-|c;T>>N@hDu(pQe(MtJW6gW;;No zz{xDm4aXJ0smJ_#|A^Xx|Mf?OuwKfsTsG#|(4Oy=@MyyzMhJ@>BN1mlv2)jLV1S7W_+4S_*gS-~reO^Kq4mo4eF4IC) znR)FmPkyq?mmxb5pF6xdSx*Je0j4Y~I#0YDI_Q0;QM*!^X}>gnqYV8aR8vvpo8eD3 zJ*o9CdX5ed*_?FJOZ9Q02&d*7{T0_iH?6L)V&ao$lVFY9E~cEMyv?-&!Ol>d>)z~H zA|ypju3YR~Hj=;=#T|+6KU&p`!PYIyKV4ox?Itkk)02ne@&G@BRhlSa-%)PA(Km2* zJ0{{WH}85M@&m3WqzBfCYbXv}moAJYQwY+4YrOxqS&gR>y8kZmw&|oASmW_DAJ2e1 zDjm8bQB5QYHs!nC7C3DI-?w{WQJZjK_dMdu{l&ME(QK~}Wn|l)xPM(DanZREj`$rIVb9{vQX5yLtROsADWa-Cxptrb%e0LX~YUOhJ6U;v3<}pSwrK0^Q22$vm&bbUYhh zQo~gh|H*<*A4xNeZc3<#T~V5djUq2?*z>SvoXenlZt$bQquecyqI{lDG2{#_5iTkp z>DA1#CFLn&4^6dEoo6Ft>=fXmuWhVVtYMG+FUCFrEdT%j delta 57043 zcma&NbyQVd_$|B--5f%?Tj}m@r4eZX>5^1X4(vmBOM^%VDj;1V-6B%bEe#@vZus{5 zyWbu6{&~lM!8*a-Yp?aheCB-CP%QqtDEulk3_Ovif|62#B2t1vsRS4@|MyD+3|TfI z0TDY%dtnh?0UHqkUXd4eV!SVGMeTTn?d|OxB*i4f1ng~UYcY&5{-3^?%7-gW_4zZOxCfUtvWvO%d<`Ds z+ou_&GvTq|8F+pWA`kkoJ5oXlLkX?gwTpIiCR?@)tk~^Z+;y__DQ}95M8G5i#NT zelP`GWGwJyu4|AXKYQJKo>@5p4v3-Y9W1u^2`IwH_b^wM{ERQ$)K2z=Q*l2ZOzq7t zkHw`PkOQpYx{r`d!7@~U1CR@%V1UwvUZI#7UK?m%FOtCamtW7BZYoRP6JmULKT95CC zAnAri(x}TewlyBI3>JnifXmn##gzL9vrFZhIFbN32WD`sn>oF~k!2iKc*ii%2cu$k zB5hNHBRjhsBdYe%ko&+CE@K}fpW0Q8OsQF460>p$Oa_02+IUcjBXyDg{e!IG%^_k8 zZATm{;k&CnevM*gMWt9)SjR2!lGLv7dFJ-p;tL$cP?SCz74eD`00I{@3X0~ean-;- zxDH#*gM?+%3-Bj~9>$6|PzJaiN5%@<4ZuZ_;xOO(t7y_F-3?q*iBK($mixy{@gDhE zS{LK*#-}R7YsJRvU7p2JmSf@qyRhGvO<4pbSH>X}!D67U+U4aQ{3CxELdh zMMou}Byp?-kq5xGnU~fOEY8a@^3~qdA{88tD$xLKQ8+?bfA4tB8$^-_x&^QavAU1f z`V;Sm_Dws9m)$1!_VVZ6F0WzJyZbb@^VTv*Z+{-?V_~|@5|OFixE^X2IGuAHCSMd~ zQaFrn6~hX>ll$>Ax5!9wKF5~8uwmi5k>j}R>3lrM=vz0ObB90zfDf>Mi9A&*@_dkP zs{*3?(<<--_!zuBl{lSAXJPFlag*dp|=SBJgM2TQkeq%$mpp^D&g zBLA?7@44#}2hm7@?3#_uin?5yg0PxZNwB*9f2O4eRH8TOXWrKG`nSY~GzcnZ^0WhT zCZ8s8L$Oe7{^kKDv;mPXFuMHFI?Mq%kJUAg2Mip3m@UEviv0=nB&4KhSz1^X&ti{` zyx+Zh=fBv-e$>LV6X-j)bgtYBZ={8H2#o4dLO5V>PT%&-* zIcl&g8S4+PsesyX!^ZTj9P}?9SI00Vj9DRz%)`dMTE{UlwNTF^NbhZP<3^pO3%8q-2dCU%ZhWr50i;^Xb}Im*wTpC(G3XL4J1**zGGQ0 zFSP~;M-otbmwCoZx7d7DI{&w*2*=RLl?bk>5egFHN-Z#Nd>IuNr{WEI3)R%tw$e1p zr-aw*k*9X2IVHF}ogRXOwnE6-{Un|qf1rc9 zX(#E7l(u}pE?&WU&tjiRQj%IIi(uNrLu6!{&ji6#q`PSnbf7Xupqi<#RmB6)0&57i_?> zL7>UiaIWL|6aRtTJp6fOjuzS3ugg!896`~s4~U^(jF@7()YGUHjg?eFi@m$pXLq&cNB!3HIW{B%Rs9;GGP z;jYO$M3{sP)<~f}{leESp|7)5X82pKsZX(i_E0NY&yTCBC=#Q_B5Gw%XjzAXt!A8B z7jahJ8ee^Irr}5({CAKZjv!Z++}|56uDOOA(WCzLh3tgPhUt5@mA8*=gAz3r$RXtgI; zd%6N|&aGNChwKwuxKaD3oYDIYxaLGJ%@aIzHNa58?8Y%~7Zui;8JRontT@DiWw1x3 zJfl^DuT7Wn!CKHpSAS`t5|yiml`EBa$8gil>$qPllsANwckT~G*cg4)=GfWUaR>=j z&CFA|U8TdQN0a6g( za2lGJo*orAMsTg;$hW+}iFE68wV5ZNS-4-=I`M~}KPAXSkp5wNP(VCsoO8XSN1}0{ujXK|Afj9&E#S0uh)(@ z=3&_D%MLOL=7ZRa3eb3{A(T(_BzHFRqvnO{jw*SZP0+c zmjq*s&IOA*PIfVsw4%SWv@2~zuAyU??x_;&W4tH-B~x|K?GnJslki_QG&O0i?%b-eC}Da=3955rSroa&f@} z4=LVpE$}vU#KwxKZN|{UTp9=MmVbx+Y%y$zaj&?=JIEl=uU&y9`*TX^N;fc6GyJBK z8i@V}?;}S&*kSXJqy*eTz<^{!!a;1znm2?9-XksGB`4$e6am+}$5vmqq z37U;@3Om*5MDcC($a|C7W^==Au;BY&h*{A(gm&Iv6SRjWW}`4@%kN%GUw**AB{idC zb}IRu{##Ls)UsfVq;U+$JPeH&D7L7xL*thg$pmC*+RqNZ+&B-!j zbuT(>_5A+^mCsw>4((2s1fDONS&!#D69QKaN+c?3K*1|%Or;~R9zYS<2+ygzg%H5mNsj7 z?Y_G?oI~lc_^lqazCPPuNar=@b6fiUW_3jVo^EXr_W=b32Ms|)#_8KzMzx|tq)w@M z+4Nq%OyHGoSdL{N#?o@_#DSeP7+7 zvSLuLoc5S>5|Ja>{tqX-d${aZH*6dzUiu*-R7Rgo)4Qvm+SxzP=xa>BN!`35Nm z!y!s2YG!(+sCO=U@`1ta_jlLNVhV!_oxcsX+EbN`JBcLFOTYdbWPDv#Q9(})VXuga zEb@LYP}HpAY%D4&DwWTLN`Hm*$J=1tP5(vr#>Hn2kvwmai3_y$i&&mRk@^^NQ{Txh zd{6U$b)?n30l>63@5mwk_|&aGQlEgysHu_`#)jV``0PTQ_SwTC*m)q;@zzLUbX1go zF593Yh9a8}T}F4!-#aKAC2s!8GiR~z%a;`f8TWHQZtcOK!u6-ATfKH7#@TVNY_|vk zZQ2|A$M#Om(b3S$JQ;-BRXv{5x>HS=l9f;Mj;v$ zCR}?E&6EA$Fr>tWlJnm#MhKGv9OLTz;C=-OLyy5Gp!%@0+iGmJ{0F8(be>a5^$x2*DO zLQIU5X3F|4z?VI|=>fA~(>%I^LT9Q~;OXRK8$x6G>U@J?%I;9%pr7VFWmYa;2DcG6 z!`0seCXa-P^uaF7-yOGqS1`H-BCr_|p69QoEgOBNzgpf0p9hL%!Su*6Q`kWFif$$# zX}-~8S^n+GcHa4--}1}ULA$!iNZ~R{q>DNy9BoBXvqW54&bOXfRi9Ch{DHFm(@$C) z0kk(SXc`L)KEH4LXlg>w-E3U>{McfLpNHo!gGBY10r>-Q=z`Q=6ZDyo$!N|es1ik>06np3*|{fB&f|HOPYe`cL81svoE zJO0WwwXj%-Uu%*T%5u96!NmU)c#6crj*#+?1HlbS*`>BrsxIp0LnnMfB^o%Ry+C3hT zKj2LrB=?k;WXAmPo5be(KN!9yY9$aupue}ltc-RB31LcIcwOSSVknm7MsYqaAH&Gx z>**#9|LGvD1 zBjxwqET{K*Kclax$mXPIocYx=>t z%+9>_diSjsF&*#^GC%s0en#+wU6WLN(RX4Ma`glG0)8boqFNJ{9=mFf<+l62cv`=A zOgQCM?QQ3$(^m2-qe=_x1T+f4tz=OEDwA!eNp6t8>d zjKt3HoNiPnN+Rp8zdMO!6ND=rwuv(PyF?tl>Xr4oIzt&abk>Fk&;iFr#+IV~Ykl$S zGu5`l%f1uZk>W2GG#u>g2#_mfOq!&HZuJ-dxZ4qoe(mvXr=%M|{kN*rQoh^PBB#Mk zcvu~80%-c&G$R_ho&x{8rUvYUM8m{$hBsLqN8S%R`zzseaa|36y<8dO%>OM&Fu~S( zbhbY)d8ocU@mV40Z*@NbUBBpO1_u!u;wX8vWTVT@db!;fEo4DcjhOm8Lz@yVOg9YR zMr>@o%dbayvrcYD-w|*A+UnfEfP|X+?_A_D=l=!2?bEA@rIc`!s_U9R@3{j5ydEav zQ=sX-u#yBegVC{x=9;{0!4x(@ho70Dk;II00FnbI1YXg}1dK)!(Mt)u{yWo+p=b>) z#4SdRKzD6DQ?bC=+8NgUXc||&Bna?qwftax`3INMAwxb&W7Uf&$>`(aF>WCE*33Y$}QNg|Z7JpayAW8;Rbh`n5x@j$I~hGNv9p4JV9Ra;f5 zQZ)iN?W8y%fC5~BzMHwRFART@gWO4bphB?VQvyu2?h{!lEfRJXM1YHnyCw0DJ-OLY z=U}OILIw1oWWcLcD>B^!w-ruLPb;f=Tzy#|21`&P`v4<_v3mPligSI7t4yiw&ClhXwmFn z)Ek?hTEBK$1L)=WUyP$LO`|Yd>J=L6p)?+VBkXUL^)psZ0?@h#?{2Z(7Mi>OMR?O{ z1TE3u+1jltEe=+DA?kXlTJ9EK@?V1i7f^tJGLe9FlC{o}0|O6P-^&J7s&gw`wgOv; z_1~GE-^Ow9=s5gv`zTop505iV5I&Y7YJJ?vhTR{+j~f;pTbV^fM0i+PZS|q}&p#@{ zOO&By^eD|y2ow?uqLJ`iVM|y`5Ah2#OioU2Kl`^h|MKw(lsxl=vb0jEBdVRT9U%;1 zEwFG3`F_h&Y90=b&5%xOf1=kcNQs29u^nH2txSQ=jjr>v!h+oJg$C38sa~TUn)pr8 zboASrUwxdi+cFA2>6uH9ipZw1 z4L-n7w6l;iW>Nn9^d$qdb`Am9-=Mvl`aL~;ZcF75J!toc%%L)zpc`RkZayCXS#ZDt zwZEq)YU=3d=rdh^1uIVBEG@xO0<5o2b|%1y675hB;wGq5 z2YUnwy4l&-GVh>V5`24gI)s9mDp2jUcg^I4z0r2}V6%Al4NUgUJN#!P@JvKO^6zs^}CN;z|lAv_jgWwcxinArf4O14aFewbfyV+GsXS*`XS8 zBwkD*Y52Zc3R@x>2FdQW^%~fpD38zRz?2XhJA{t= zvtsn!Qm^2)ER~-NOf z23~Jsm(Sy_7P~MypajAtw@~=dSb$Q%wM4?2nA?m%(|>OwR4CX$2C5dETs=17dDRVPE(QYVDiM31Mr)l0S-Dkxcy2RiS zPSIKY?Q*X5*O*9ki@yPXp>)>xZS+?vwP)=qFGp;au%j8mc;xZXG_LS5(OKzlms3Uc zdBkKRz66%swjC)*Q(1PDDFPv-v8{aY4i`ZF{{8!<91A`&ap}gC%7?5AC)jZiWtPtt zR%U2#t^dUqu0gU*PmN5*Eucy*?nsmURC)&3+}6Ggx_8d7Z-@8Xx=R7Muna&aJ) z_fIjj6Gf`3|2V>C=_wcaL4AM54V0**VU*ltORwkMKZ2f>Vf*~U5+@Ej^F*c^o{AqJ zR2v86pLi9wy0`7l6CyCJsV-=!)%bN&(L0JuN?udmof!>#N?y>pSjC9P;M(GRZ>*@7 z(0od3`fe&mkyIhuEJE5)+3U#`6G5WkTUpxW>`F}KBqlSl(S}g#1WEf_h*7>)uuFLx zus2m<1;)`y8gNHPoDoLY$N{Kg6^eiOzSTa9#s%Nywo7q3lz@YdfC+Mh7CF361<#hJ zMxDy|`dZnVn2Gykj*ZUO>7SPU&}#TB@E&2^VYdvKZrfU z{?w9J%! z*c0I(s)8eEZpHwY+w~OeV1DM-(W%52UEBYRRTKd=VO>%)vREqia9Xl7sGg?XY>lo?a?SRp9$>iE0NykXcMj#IBSteB+?n}A;O(Kj0pVW?HSNPLE3Zcnq%R@3J0yw!jr3w|Z8ZLw;U`H^8X=C?5?i-8(9M%}RQ zwQYfjN0TeArQeyIXil9<=9Y;RLK35{Xglz`GFRdR%;MR8^5{7W6lpoCRmG`{cuMxY zGFU6o3En279{po`C0j?I*RKea1{6iBthfd1)aCK%z6@tLy^LF4=mQmgXJ} z6=C=Q1QO=$g|euDM~@y&#ncg2RTQynW`{-buqin`9|wR~1#v0@j~{k5{k@QP`w8d8 zgo|tfO;4BzZ1I24kanD}JRy-TpMJp{HLfUbAQ4M*%zT`odrg?tPg#)LvvD4DaSBS_&0=)JCDvZJ!RyPXFjeG0GO)C50t|i;xtendjuN?nF63(PESz zDn{?XpOb}p*j$6p61`*LVH!{l^@Wlry+{r%Cn%gV%uzIE;wqH28?R>D=F~CDux?ywW;bP{Vm zJv79@H=P+5>9G@hwfi*Daqmn7!&rnQmiX~a^byxU~Wjvct0Y;#TFFXr(MH66Op?4hm=r=4qj!Ne#*HkK3oEc{;$L$_} zZ$GPM7A_IR%*FMIq&icJ!>Qhk3M7c&pot0-i$CsiB=J92^gwa!si4vxC}R+!tpqZQ zuHZXugz^&x5GWAIaFe*E3ZR+)Dc5!&!d0wWUP_bqu5Ypfq~LTjQ~4R@wY!Z?7JZXI zQ23{CDh`+l3w%%r#oc>w{2G8%8Hi-;nyq!zx3W5*JRf+EK98nLw=o44k3|*8vf(>A za0)ulun<(g?i3)1Q?q5=4~8TwH8rs@0Rk*^sn>tGqG!%)N=sT3Rd{9-6DwtAc*##qj+ARR=L$CP@)h<(?|#1FaHCB;{rS-B~S$?A@lWP1qQAd zN)m~!Qo?PlxfX=N#lZ!_RJrOkL{t&*_+{^1RQE%|l2a7_xP)GD?^jZEDOD`=T&r2o z10D5g`(Om4W(LnXtZJWV^_ml4plpyOvd(FQvH&NjlbiHhoLHkf{k}6>hR&I4$}9pM z?%hlW{n*&p7_Xnc^cDP0Ky>^HtawFV{%f^LfdYfi@xv=Mnin-I03Ao*hux;HWF!iR zBm&}l^9X*TjLXU1=lO<_Z$q$l)J$T>(lBl&8%3t(gx+SIS0AQCvuZP7vc% z02$dq=}8^cXS5|3_Q^Y+%GnuV8V)hwqDc`d6f&kJZLznM|574OW8L03=Osrx2PKzj zHB-VMS}PW>@Qg4m@kc6X-r{m@) zNM`Ck2rpK>z-T*@yeK2?J}QUkk%1ewv&7lpaG*`aHXn;FIozasz#|?cbC5)?oA}~> zOs1iZ0=bczIX^ttzNAk`P(^ggV@ma4T&79l0guY>+H{#BUZ9v8hrHf&{t`lY&8Pw# z=ok4#3ECWntmJNff`k}anYP? zXLZl2H+NMgJT)j@bPa$nhf^ITkt-&?L?xrLQaAx$a2A?B6NulX#OCW7b@(|y&Hj^E z?n3uffJI61YF^l8?|nIt|IUrz!mMjAY$TwoK?UHp+*!yLnZq;n-JhFW?KjfO5pxHi zR))NdpCHCx?XP?3CGUeVF8r zKdfXqQoVLIkpgbX5z002oZ^_d$;el>ZnDz!}W1kHPu zk1coRT@h4)OAejcAgxuSdBiz`fcu?pk%%Y=V!6l!*^xG10U-fMd=5?Or4}y6Iu*)1qhk+`xeoe!RV1PH!V|d0& zV?(rqM8MhK2R0E$CeZ<~{NOy5*#)>Ys#|Mj!D0x2qQa4V5US0_)ER7W1!< z!$f2dedY8EI?6A3!@RH%3@q&-s%si}f1=lr5gh}fsuzt4d#QKgn=W2$eR0Uyg<7XKMlewEfVO#&ByMDTvZG83v1_(ezWYt(Y`M+b=^qc-?aRiu4U2ECqh2V z`t1qaVS_Sl`nPjWNYGzYn<3mU9Df?y`f4$reV%bAn1J4yfz?YtkF$j`adJ9R7^$q^T6zu z_9+%P|G*#DrYap}nZ`R}giQN#h)wW2IE{4d=}cx>Z>EkS!@1G3vi>s`Q1(w~T7^;L zJV_7MNsgyvB6$ZVwG7${C7>Mco&|8AT@WF*dBZ?I@pFYdcJ!0!HYiyF+iM9~UHUG^ z4JtH?hGc7Z3to0v;W+;-!08CRdOBn-akcPZ*_uyN)VplMT^=i*d6<7A7sSk(uz~xA z@LG0UCKa7Oi^@yRAT_N|-N0B4PVvo=Nbg4@kE*MErVCMObk%t*ocVHLj3ut#v+H!8 zm()uw(HXh+roYm3&D-FmwMVgEUPVX+WJ4ixKZK{J*v4=I?n)KVvBh6_dl_d+q(M+v zU7;6A*lZSetTD8LQh!gO7z2R0mqx)ORvw*Jz(4ZaMamm+_W*sxN5izPTMD?XxVkC> z@9%U)GVm5Gw&&_yYqu{-`RI=&p*|4piS;xl_rK0GrQUdc=n9GJ7X_rIBHTDg@%%9n z!t9a)y(SCu0iznvPtH+{Cy#;axgH}{WD#bz}HJS*eO3NMiq*Hr|-$ z4!6xS1`|BT>2hO1ZUInd*Xv*n2eU;~{J8Wc)P@n$Q)vPLxwmZn#AyRv2V*0IHC3g~ zC$;aXZ|5j}%R*YRFrfsKBie$#JlqcTMZMUJ}U-cAFMw| zTM4ju9b*1(D-n2}yp+t5$t82s%3g!wb=I(31<(C8MoBH$@m3h|ZjGddhBorRZU|S-k8nj9N3KmJQk*js|WRD&#&Cl zz!478si4?Rrr2qQwxVGz#GJQvXj#>n@w-s|Z^DJVPSklyb{DLb4CeT|0z#ejk7_yj zoU1E;MrG=?f0}oX7xlErS@%PIR`?3Ddc|)v6U2Z}>H;ftzr0_y7HGW3o>e^|A?ecR zRzgV+zqmZwU?s=vUBgg}`@r>hSl}l~I%p66N2_&lzV}yJBhHTKErkIo4r6yVL!GzU z=1c^@2OK6O2WqL{Q3mc>A|0;?2U_%GNyE`fM6F?754}T7a8DZR|<^mTg zf3qje*epE8d3$mz+0K3?=MX8f;$c_)_H>tc!~4<=5Xc#(iLgl+6iBuU!5D$;}33lTh1Rtr~>GUf9{K%hL4|a%c+8xrtGdU{uR; zayn{48WuNO*UF)=e~ZzFcH;LN$aQOKG0WdJu8Oj19G`Nx<9Nh2C$9|`UkdVdy>UAJ z52r^}&%K9mI;!k+3prv3a(9ZkC1c%0^GubS)@GLMP!n{o@19;|K^5677Qh&EQSi;M zREKd~L{|BuLB%DioA~-Nv}ELIc%R>4`xLnB9>_(zOnXmtFriAIv_ajdu8 z`gOS1QL3D=LgRdq>L3^jJp;t|q~_$zN5R7mgdwJ{B6(<|7E-?@Xbn6=4Qm9b2<9O( z&*9Q#@#%Gl%(%rqA5y&wo877Zc;x+;plwa(NM2HOIFAYHF7_Uf;S#ua1Zp~_ zPdGX&kG`T?`D=!_7Ozs;F=q@>LV|?0rRCzlf5uu1S*;FDyc#P<0z?qEW#{I~gt86Z zr{Z+~hwCAeIft71D7a!`Xl37?5MUp;0~g;!AFnPe*qB$L{F17)*%8LkcMTwd{8`{9 z*nlcy7E?Dbqbp%>Rl&!OKEF!bA~>RH^S&Opg$6eX<6!7wgJV9-#(}DQq(WKC6DePU z_Qu>g$h?UVVfqYTj%?rsH{W&kKX@C6w&GFJwLdupXQL<9T> zRv|NU7=+XSsfj}8a#OH&Q#`xGQKNCR(T;hA#yCM)|F`HFj&f!vE$nyG`1IB39I6}v$t6>zK}Se~-|1#c-)`}@jHcT1)0 zy4ly&6r3UszOgK~!*uo`YbwEH<#$Wm3nw;(?#8(DXXf>-vpHa}>cfX_G>nm-bNE)D zrj7CQrSonzQ6c?lv;J1?N%I1-JwOf}~veU+q>P)K$&vVLt z|DR{?L%7%i4S+;F%faFgV@^Vld0kI+Et}U|{BN;zK7D9|5VP)o>7^_Pgqa86ztkNF zhIU-rs(rO;zZ-@gi!!@NR~?^(4|Y*kA)`PJ>-prg&|X0vfagMc`|RW7YIEL49Kxqa zRJ-1sN9*(;O0j_{%UD{&~Dk&N7DeZ z(>n7Z2UPi|FF>>}t0+yp>cFd-zv^I$T|W0^#Q!Ze%Khd+&DbVVOC-4d$q=B4$L?VS zRwTauh%9~gko4~efD`PR@N$R~qeI5#ervkYO1@3<$~Rqn*BQl)aVuv`Gz1%aj2C{| zu}{mtTK(LNVE=={vowZ$y2+Ig{fJ*KG#s^7Bx;x!pE%V`&{sg#ee)<}?4QDpTts7eH z?DyfwQW5nF(2v2Nu_nMRHOmx#W$|=x+6P#Aprwa;mH!JznYgWHUfg|^S*V)s&r@<2 zEw<;fPh%C7(DSHqo;@5h)xM-P1v-2w=ZCQl;5nE}pX}d_bVB&08a~M-KHSUp9coio3*M5JPGs- zcco@kWv;1$he8sYAxEk#-_oW|yOEJmY*%-;dWhendDhrM?Hn=Q>YM#gqowrd0m|oR z#~+y%ddX<>Pj_NAt8l)r6=@@FBtLO6sa7c1Il-k=F_<4KUa*>$!%&g5`v+uE1yqQh z9&ZbfudImxfuTlnq4eb5=eK^MfMmi#RumUId$KBbQg0+<&?l%+cEzaiS5l!6#;BpX z>><;2Djzn2`Z9h#m^-zn+7yqKUwh0+7}{B-twjKX!A8tIe6XSRLrMayZl9HI{T$?4 z6HT7Zc}Q!L88HdZ&0b9EO~7iaypuBbClc_~v228%rMbG>#V@Bl`r21C?UEkwo}Vh} z3C6-+m2WqUSTR-T#6#h8tD`qDC}daN5+H{GvCeP=Cq;fw$)OivF;lYYP!cA96MG;f zNKk9{rzaZ!KY6Esx2DSGD{1NvEe$6oLgR*J_Ev}>rFif_J3cBZQ!!$>`Z|+Vf>lYqJ{;ZAF3Jq+RA;arFI!;dVbA9eDf_X@nio4XA{{?2ui9RH6T*7Y&Rk!7HJF^koyt7590dL_3DQ>6CVn!uY0_Hwvn!@QvB0?^hL z#fs+i406(ig#}KCQpyzf`UCbDhk4G;b}7l`*xBf!CqFORRJE|MU_ct*x|y8gP+$@A zIaa+CY+CzyhtctNNAQTos$1Fdq%N;f8&i)dvt|>SSlLjFd5Nyj`QLk9Q@UBd76y_7 z!;>&EYLE&z)D?;pKzjnTdGQpxxSL;kU-(QyjdfPZ145^&#gk2eU_f*yO~HxtFUldA(4 zKN%?zoTLlJt>i>fQ`PZyzxO{RqcZSd5^lhqS>^!sL}fqBkKu}B}929}5Y z{X(}~M8HK3I8TGsG2dUA{4YoSQ)r%w<1c~0=^l>His?k=t%$3y(Zo9QZ|1w7L{>b< zUD|XywECId=K4p;STx?ysE@nX(F-15q|TGA7Mp?zKtYTcrcgSu=n~8Gvh{Q-Yl2#Y70}*h~Q=`}kl=wAjOk&e~6s zRLvi0uoaLjBnL1JUP2_#v%Oj#r`vDjIvA57gq0M>qzb^U_s~JtRNEITs9e(9z;R8@VB>e5mm;VMJi%T9G8_Vk< zF(5V70P-uQNY!p1T>PB^-xsQOx$JkQxbBkeyr1i_1KRy3I#<7Ax?ZslJHMl`gSJ2( zkKQxz#Ht(m`cm1<2;uUBx1&I_{{j!R9Mu$7@Eqi>|79qN1W7zYdQ4^-ueW9&!}i=~zI!G^$F z*o9(d;B!rrFo*IY_pDAWljSFp)eGsUobWgP&4^fZ^vO&-S;-TrRSkVPGKx=d7wE(2)D^>S z*f~8CRXxSfS&IEItLnvIZhfjFkKgztg1e@Q>8ZbjTlm^@jHH+Kyq0fADrGEQ^^^UO z3;Y&={YdEr7nqI1siC7tB9xrELO7v(>Cx-0ODVRSQqO<7oxeJDegM-6Yvd48-bt9W6;yf6PI^Pro3hLC$DKK8u zW(?(4z0ic5gW^RdG${JbMD~owE1jliEarIcubaFB7|Mhd(wIEekU{$map|p7+-!N+ zv^SQa{30cVluL>!nPn$|4I=ZI$aQ)gi`tz+a4>=u#weD?G+{|YBsAn9kU)zWVLN1! z&I`4MVPYv;-t`~f`5of5Ebt?(o`}+RFexC0a|?B5&buLi_iA|3(MS4|E^-8Z71iO( zybrGTQG`^!IJJF3=LRh$XFR^qTSkPkt_aq zi0AB`#=`s2ywdAf&g{LrSXI9`&*lE_&xU1jcfPl6SG#2q2Ug&1J-c4MI?`pHHzp??zyCP zDN^kRFY%J#%aF@6;l8)GhnOR`%aR~nS>AvO(9!l|WfJ&GL-(9^>r-N2TBj;-hB!Sb zz7N&oOJ~EO$Dy*ia0pERP*;I#?^c)`CHWMp_%cO|(j6e#3I=RWe zLaSgIT4?zPo-cch$$UkFbHhVeYoZ>^{Qz{-4DHg?%$F}0ddJH;6#KlA@>)!!o*I_! zX&Ksyb_@aoEUc_!?cjYx8>CK!9eJN`zJ?I`sDf0*o8*xYKjYU{!Db=r!;z+<1W29UiG)ji-+&P7&CqeSD7LE9t z_x`eZ9t7&#F!Rk!2_2n1*)QlFWE-oxzlU>k_Nj2nk}3=eJ0(3em*A@v-_uAXFbDtDRqeJ8DG(CNX_mg zSQ*rK*t6<`8S5PLsD41tL!+C)v_sd#6kD#MSG!B=jv7_}*?e5=Id;(M>Kalo8Ly~q}fHd?hLT~ohsq-sygpOk&&((tETh=g(4t#qkyd~1DClOq{3)8~% zlxM5MjeoJ!Kg8MF+b_?Rk-RTNo(*zDS1Ei%+#KiM++3s{+zO0Zi4Y|}TP20WNc}nhx-(rd4hkY(Vl?7& zvYWzz%LP%+vf$;_$J!62&$Psoa1+%+N~)mS}yBE#^+4OMnd|@ATHov zY8rL+?h#>rJIb@IJ>eDT>F=H!&ZGj#u#lGiv#L|x?dD+cecp>E&FOR6A|iu*Ysr64 z&=i#Hwuw{KPKPa4d2P*J~aOh9@&4&f%DBGn5SlLE|!T0%S;fo=_QT)tT?6f-bR<3 zhG@xIe&*K!Zr2tTP#HWDeoF4f$!w1I0sn&PARi`!74+b<>cDG&F**%PZlg0=HI~8> z?ckkX_Tw<7D7D!9uUV&?9{|;keYWU5u7oI zdzrg`jn2VeRs=;r%`nU8E!|W*EjyEw*8g0$6ZE6Ia2)wU{EGL@&GkY1a>3d>g|o@} z`+8xS_VQik&_R_F4wYNl3ZlFD0Rcs|)Y+pDJ^C)CyMNj6`r|(zf2>~G8xgbhtBFWO za2K!QnTo*s4nJ!GD`jk9a^d!FXt=o~xcv^n^3Ty@;Sa!$w&M-m+1;uSgCg5^BJuta zHg5%yGV<+zxfJ2-4II5I6ZK6+CB!6kl`WXZxuVZWasEK(|Lmr5dK8i8uY4Q7ld+@- z!ID~}kYxvfg4!SPvKYzfBnk$#QVLT#uQR`<3~r1pqXq(=)P0=f|9f{CujF{ElO+`H zSrS-B&D#ay`N>{+YrM!{SX(F0;uzzALw>FHT)Mb_5*@tSYi;H=H1C;auFrVnD*O)S z&8AW&4)w~C79V}Pvy?-VNMb8kM}E6-I$iz&T%w*B)rUfz2Gq_?k0~g+R@`v5)G|fE zkMo?D&>3*|HqZQ^E9dFa(a~B}RnOdN=5R(Hj;|ec3L4Fmp9|EM2LxDsjE|aS=U~TwK~JIxyUs7UOd<`bOi=YyUTM zXY|+84RsBxI4|J8`U6HqX?c`BIAs}%k5(yxhu0k1TMa*NfZko-&Z)Gq^vv=bT;c~ znX^{{9U%ykLw1LtTAH9!YwEmgE4%%eVIfwfqqE@+dEpH@#%-~Qw|5!xr&S!W)MWjl z@Y;})?$CEJ5B%hA9w!m99Fte;1l_~FgFF1IG;9F@?P~Ihu7%FIJx6%jNG9f~wbVcL^SF!bUnWx_Skg<}NBwY!#x3loZ_0WmqsK35sve3sOI?0*y&861^%FE7DJ?!aHZ4wKtuirtVg*n(^JK( zk4#Op43_>Z6gH=h1J=-?io@E?%5@9oSapUs>va8I7k_I<#(COti*2T5HemlBOJ5mQ zRoAt<>6Y&9F6r(r1*N;YLvj%UN;e1y0@5kn`Opp02%GMbPS4`~&JXo+uWQ3xbB&domcx&be-4wqXCVTe zUodqd*VS-8Yv#iW?URxgDJ5|x21E{jj(P8|%E5#i_BC$RDPQ+kElZTAb09%h@v0t* zx+~eB(X|7NDjO2+3a{K=q6jYeJr~LA^>^IFmq1bnT8jy8=aBSS2mpq&+A;_yN28Qy zl!A)GL!-eN9{Cw~5rhy)1hpGTr))LHcZ+x#;84m8Venmq_>Q0m7;3rvk#tOg4W=&_ zaPPm(~cTd0YI2j-v~ zhZVk;cE9sohYLC?>YLTQ!~O#z+_)n|&%u2uv6`#+KX-t`*>J=6*&KBW#$9^ZClJ#q5kXv6Fm3*| zU7z1e?ab-pKxkyb789SfZcSDMu1Q>}bmP!|Fwg9~y8&eZnr0$C6__p3quFGJdntgh zz;hu=dlKM#kIlzGwfYkyN>QX)gALytXX+S}EOHk>b7-A0Ze~U&+R6fu;ICTGkHOf5rg5;S$E`}A4Z|Hc%NR@6cv3H z=@dEbqmPU|jY-#6DG08Bxh6 z(0hPqw#jR)ZY+JmRe@yS`Ki}*FK|)Uhrbp${7Cy)y!5A^xmsH?j4PO69gqMP_`X`|59(yyHMc-;yu5n^U;dd~ z9U%TpI{{;-8x)NnQ~)!Ehb>JzQ$rJt)|~DA#{rAZtH=Mddc=*p!ca9sPJx#(NxQy3)=d0r@Z;_OuieXjP_9UuXL2w=N}*^Od%m++9O@&nL+6 z`n261pgik1W7}KxuU6!_JN~^6^9dwD0ZJ6rGM99}XPEVL;XBJMsTnXF6q?VysPBFg z5p!fuBAj7WPCfZ4nFZ3ZyqzVhb#FM%y(XN^#&Qw53Gl%f1@ycnS|he-(mlSc8KWHWCxCiB0p z!I|EIQ1{$iKETRV1uH_ua>GJ(V21?L2jwuW0}~+#;f@EY%#cZxJ#0o`l{fzFmH2hHQSntwP;HKxW7&jXMCtFtE1&15CDz8n z8~tQ?+}awN4`_CVH3{+_iQ$r~c(!HJ`JE0AMP|nz50F1BV$$(s5*>@0`}h7Ag66{M z@-$2NBB&}gTAeEE?~z$NG!=$X@L@bs=L4G%m{-HImd8h)Zh*A z!MlYsiJfA$x3_<%<*^ibJ!FKtU|U}Qe1%>oTWvG)sS-BaFXH}#miC zVx&Q96~(E|;o@uvp^3LZZ>)@;`GcAaHo@wrzfC*cc1W}~D*xeSM8X#To95EFLBzgl-z(HH}E_FCy&riX9jpISNZ=b~$9|DnD z5!{R6HJs)p3!mGp{UcFJ?;OEi+kC!ls*~T4LzviK35g5C>?5ZMpdhSARk8ameNON2 z9n>h%uk^MAQPQZPR0GL$#265ej9&xY)yaGT!0g?uL}f~4)v9d#_@2)C&fNydgdwy1csO$PkO39Snj-|s1y}#%`Wl& zc&+uOHW^YEvm$jp{cmo?;&gm@T%NbE#W^y$xmKg%U37@kU!gbpXIX z21VR*F6qpIdDZo^Nvmh6$7>-StMX0yuqB)gw``B5xUzrI?x0@m?34yT>Ty#>Q=O#szo2IhykNp~z2oc* z9|l3vJyyB>1>Qrwu=pH013V#<$A>szBK9;S`2!8uld%+Hei68}wl&U6G#H^&!o3k; zD-jxf#XoLErU!E*~=gK51-ero~(r#_Dos5@^YquWykChMLYmuOqWFQqg zJL&&kRWnNgF+Ble8F=kE6Bm>|o1Yu7dXRwn+40`n3&^&}Fu#q< zS9YwkmNnd+toIE8>>Ps!tL9lwM0KUA9!fk-Eo()ED(Muq6HV9O!X=E=k}b>VsthRc zq!Kb_V=b2#o9~)n7x};*yamr1#BlYJ_E-*|64$aJxw-o+A^SNnxyn!W zkjw6BuTPlixEQeAm*2j9bJ4pVgpstiW`Kb(qusR05@Z8ga-=R{nBT)C4JUB2POwn^ z`F!^H^))k-1QyZ>W_yE?C_epA;->wjgbGn*m<74EWwx0V7|ppPmeaHX&&pV`IKeI( zR40)?!UK??#&KJQBe)vP85=W6mGkdOGxHs@3W(|w%d06b_L?}CV+lM8H;rj=%F9Vz z*8^|K;W+@EO$(x3C`boGy3;2TJs%*v*f86;HDt#ByNnuReRC`lucm*hykc#h8KK8)`ebFtX-Jbxfz`IAKl6lB zB7y~f>H)?W`9EPQG&C~&_q7Vno3)kWU6)7&0ZsDxo437`LJ{{&P~Cs$E#!B+d}#5i6Mubm;g;r7~U?Z zZr%E-J&GQ1CNlcRZnR}~4dxK09n-WMTouJHKQyW^O^ z{zV~4^Qrhg4Azbgx$7W6l_U{LNC4aJ1SGlUIVJXghp-JlSqE3EoZ^&~l>r1jH=&Z; zdU#GCM?}g0lax=;uBoViWg;qTk&61*+mEC^uLa~exPXjj-SIUG|gXheHTD*P6}@N`3teTM$Us#tOMkM z<8=E|Mi?O@q>9oY{IcGl>Hu0uf*Zblm7SHd`r6zs-W!SlP7@9N_`$@>EDz@lHiWLw zl}%PfSV{~&UCW4v53&R(P{LE8toQt_rr@gn)62GUzjY2Ib&bD4LlfDJ=gcn04c%>o z;WX*Y_L!ra!vRk;lYzAXENU}G)Oj#=-z_ZK==+O4Bb1wm!lrH<0#qMUR2d2!4n60* zydr8hqej||6ecK{tIOsZx0`tzQr81T&j3P$qkAV9$^jTiHD{)XofGbi=leT>hewc) z9Q#7SWeVAFr1U|EMk6$W>$Lw922qAr%O6$;-{c;=Xi+lMx5?SwHi}(-*u%Uj)Kiq1 z;x&xTh(a_e@RPtEWJCY?2#P41g30BaBD7FSO z@gx-MlBQKEwEUtX#Js#b4AQl=2Y35-ibI!lN^wO@EIHgfLS)emJM{f$?ZT%WNxRuQ zy10mgZi1fsSY>6OtT<_CVD0Se5{4~b^|}0k8#We}yVfgEJL~!J)n8QC_d`@aYTMqMcyU0zoqO?@@^%ctxeaF#7`nzen?{;hXOcGC#SYnfrm1Mu&Eh7fQ;$5**7%a#^gXPf_ z8L*BanVEGhZ5MtV>(AdpQr|P?+K-Xfi7$PFp-C@W-e*DEC;Xp6sR$q+8Tk{jEQQ4+ zTf?(i*z94k+~wcjbRfw7>k;7(bfW2kL2?C+@A_7brT)7i61}N5K4GRo?xi#I7@cp8 zIL{HH>MO64K>U=rj4T0bcQITSMzGFjZm=U1vGoFw#rucCAmVQIxf#4=%A5mmcBjH0 zXnTqUZi&}kwNrTMfyb{&CJfO?eiHJp;tOvemhLRsKR*0VMP-fMi&H2rY&v4B=Jn7_ z5(^ca_ydjbRv{4cTLtlWmX(|P6awwH$T~y$Uw@>G!U_+_-Ru()E^W2Kh>d-0@G9)} zFs+(CYAsgzQzA0d}qqd-72cpI<2Y>@MZ@|f(9>CRl)S*V14U{?eI#)tBbi87L*Bqj#k z#N?l32pI%=1SU25!N|x(@8oD2RMbF5@7cN9=i~rmVE_yY4aolK$V=#1XxF(%3kif> z3>Wy#n|Xi`AQyMV)XTcBW3fO?xRZAcngHQAo5_7 z*E@TXJ&hQ3O|q$d8(cTx=wM{mhE=+X{>CzID*@f0x~meV)mM~pKB~AaP$+_%Od^Qv z@%C)6RI8ZenF16%14)ntubP9aEj+*Ny$aSRbHt*-X}$##A_N2OxOC?wfTsxaTG!q6 zb8IFdcFI+fz0B!K3l_E66L&XLOWSt}sRdC6;`48J*Z7KatA~2uFIJ>7m{FrmDEV{i zxk7n((7_oxBa)K=0we9)D6ysJv8p2=4VTdHz0IMx!yVQ_up^RzpTZQNjI@ zKZvEuuvwbAOf2qYZaD!yPGVjKRY-MT>@xEgwIFI68O6@b6ou&0DbcXAV_aOsdPsPm zt`hh6_X~RLqL1|+I#z0y@J?f2{JBw zFgrj7DGcN*d2jNRy3{OhBF=hV--U-Sd(tOOhT_OzOqpx@T?=5ce%tnRSAN9{Lcj)Y zZCMKoI(N4=cN3A^#$23U9#atwGtOx+cl~qeWm;_wYwx5#yKZcQB_85{M6Bi_;2|M zKxLF^d9rJp_kbb<9mlbk(J7&y3Y@6tO?dBhv8a+UrCFtjsT|_H$~hfcq@sSL2@}XA zYE2w3oQ-U@qxAlAMCCAW*gbA2gyD@!!s$qeeW|y} zsd-{$tI5I$O0DBbfG)6r<;1R%MI3F1NH&5^cOw@Y;Mo{r^8GA&3&E=;twx^|9(s$} zc}=7jx+vM=9w=1dwng-IV|fk!Q9P66RYA3+z8(+c0+*DRJILCjpu~+YxVgD8v9N^7 z7uYQl5D|R=UsCuj@Exy8igpGoIb7_dFPHnMC7j$6k9b{wP=JIu(4PTaNN&X7>XX#p zAXgx%vh9zpD=0#CnYwOX|AoyM@w^GQ=QIg5JqJrrPnN)koU_DW_XoRg`;R!MYJqZ4 zU!>uO>2;-hRPCcQmo>xQ)mq2dkFL=_;)voj<9YeC_1y4CNCiG;Ym0Sz?m=BciVJBe zp!OyoO$^99r{$XZHMsz$>gx4C99qen_W*IF?~`yrDZvR5VqJ?IN+L~Zy$FS$knP-F zwV!2P%kB4_`6IUMiA(6RK6*6b^pEko5xN~T-TZ80H)(=k{~K|Yl-WOVV9Irw2V53B z7TWy|3j!}0vzU2ND;v5&J+DKIhcTADw;33p6{CI}r`2^PBd3Z7-e!%5vpE=R85vzqpcSln`gACM2`56tAi<*puOBPY zkZwnQ0l^wy+(-w9^#4wD)53=>LsjSh;wu_m=aC8aCcBq zGZFesp+i?ec47lFRzG*@dx{Y}Nn(inL*foTazfAd99m}{3JC_)rw~royG&T;g;g1F zC$fcRZAC%2hN8NjMa z`?-0plRe6MU(FZCN(+4b@3lJNIoEc%%D@^uJcRF&A|Uh-kWcYgQ{D9$V0`=(lUDem zq4*H4@&y;W+@RkW5tAao``^p+@@rd`XwV>nKBtDsHOq&G_IUV09Q!^8GxQ&{wfS?* zYDkx^2+i*SL>y4m0nMAi5Jd{ z33#~OO_xQVaEw>1`C?3ZIPt!r{-6!sf;u_cK)&d85eADxpUJ9hX-tASzg$`RNt^0O zomjw-i5kDVjW2xfCk+LqUSQZnjNkbb+S9mc>+80|vG>=({nwwjDF1f`RJjVJQ~K{e z-tYBkX=$5Rz`-p4ql&7k=QlRlJu@D^k@f%0R{a$+tDd#3rNIZUBTq54Sy_MIyW5=R zn(6PW+MV*jp{M5bN6X{^rDk|&q2$mbM+syo^*R2&GhSl90Q5+<0)aAb>m9qe@w;?1 zsP)F=1(c_w6V6l%Y@HEJ?IN71cyQ>|=WfgyTmUxN)vAX;53gl51T5tN|AH#zW@|Ev z+1{1UA)}y3nVOmw@a|gI5i_c1cY`vTt{0nfpujH_#Gt+IV4$eqJd_Fvl34^w0Ea@M zrZ(8xb~Rg20y`4BmjJE*=*Y3j|MZ&-d^G-8KF-N3F=tHi;vs~9;C@k3Ldqf9LA{np^wYWCFJBPH0qRb52g88>=Ze4}o&V40 zy`J7zFzL1d;-FuHM#kO)_$AK`>an1c31Wd-R-XHYyMm`W3d>=p`40`1?T%n6<#G0t zH`&C)g2_NHSIpp{i{3}Ci@(4dN5>P7A4<|UQ>3{qMqZxtPpKTZks?kjux652wju~x zGwHpJYqsr7W9U#nY&X#w@Q}>-ns_)4=4}QS`=dC*-(pBmU%>3L1{?|3@*o+x|1NgH zGg7X)o(}Q6I)f%bu58{H-gf$E5@_u|>EpVZUzLbZ8FP?%tI8k)YW#k$Dy)&@NH0)H z=KyaLP7HG`oa=m1MVrrdl1umWg@n=iI-@03rR>jMqkxL>zlWxUm&L$O2z|{u4h5jV z=fxJKf6x_R75l~oi->4>dN%M6b?7_|M)jI5W1U&>EuUlU5M}xLVRt%Ppz__LcZgs% z$B~5bI~&AYSaOJS%|qqxC#gS%Jpl+1Otk;}Wdy#U^gbw*J9RDj zAsW)77i#*-C4OEcyPg`&mD8fad*L5&LYj2Ewe~&(*!2QhtRH<8CeQE9Zpeql{g0pe zojA@+%IBUyvfmls+_E3gl7mNov_JmxQsp$o?i$kp)d|7GcEV-ET1Hq?xBx;Aq71r% zo;5cF6z1yqL*s`?XqUa^Wyy|aaba;`L>V)xnwgJS*bDW%a@w!hEgN00JQ5{Q!)a#D z7tsNFsKxokY8420gzZ+CUr=ag0A-c(L3!qPr5`||&i}#$n<>rexsyWva$IySh`2ZN zyNRa0p|%%4H-A}HU1NV?CYo^AuOb;)R~;8L%DIIjuTlO}18XB{m#sD2NB<%^V{)o= zAtMaGebu$JzftyG`VHzh=fi=G`Ys#5M+1{2Ww3zJukM#@yOOKzq}=l;>I}#A{tgnb zohtUk@x*!qurS!ik@ zeRBQeFys1-?HJh}H~2O@UIBig&Bx`#hYvq$YOp{F$uP}QN2+)*95=RylfMA5v2q}{ z3tx!PunAi> zmP*mA?5Vt_f@k80jW;}7 zzL^Yar&%_ctga|(?A6QixbGkAmwtY{7MT|pJZPQDIOl32zYk9z0Vai`Y+H2=bGBl* zMjY%t92|~3Up|S+v>M@KbQfM7o^t%>5h7#qNYqQ$ z!1Z+w;`!CT?-J`ZW`L?a3-z%@BKie5cF|9UarhgxxkdD9_ToC&6@w*a9udgaT#;|| z_`W%+JUaY+9H?MRf56?+n7;hQ%{qGOqRy)vqolT@hEIooT8*h`C+AdH$B#d^Y=4y1 z_^3F4vrC6QZ*IttQ`Z&PDSr3?juL10)f{+mwl%FzR2E*awoG z1f5OZ65%BLgVH2x**Y5o6%~z=B;t_~<4a#gkE|h3PQGuV1A18p{0w|vF{zM0 z`xUXlUXb1%9iaf2ClbnZQ)(1$w@LcdMUeAT7&g!;Iw6+Yf=d(Qqe zQJCD`iKX}r6z~f&aV^eSr0O_u?rx_G8`fkQ7-}CliYiR*<=!qFDZx`!bc`U)s8C}j z2H&O!q4GJZXLCL*Wu)RSkO;{2?ONI|X5(OFU4DxgM{%9vkhImRF!OjT7b@gop{+d( zwtte}+6qB10|p7%DN4ZFO7Es?x@;+y-@9RMVD=esq}Keze+FY>1NDVCS0*&hh_|0k zlB#~c^=6X8dLgA4a5JoIoXAVVrl|O^vRqXu(2^>^QC)Lf&$=~zfZTjpS|VnEyT znTj|y)Sh5N5%=>SbLPQX zv?t+06eZ1|L{3K#*C9UXtWrQOsm8F9L2vCw(SG-Wb9w(+a+e_FMFNr?G42Z=@Oddx zyZ1$fcVgG!f3H||dNxT!gM5!q!f%t4soJ?;{sI{bi=0qKv(ptBf{|2bN_hc--bas= zlRtRDZr27oJb0_Ex1U+cv<7_qK|}SfFvdN)aEn&>L?m%%>faAAbyNDGv06{L34r}FU$it`L<=U)?;E&6JmEMkJ=cdQ5NeACXE=h5^#LAl>DsGdW)PT^|C4~?1- z24WkX4EnHo?K&cuvgcju-|&5_Sf~;5fRBa3Ov^x6$DvB#Cr#YW&%o=1zM)LcEORM{ z560={ft=3O2yw#Q>8mmDbnasYWZW!(D}&gfhAK&Y4C?tUn%xv}Y{PQvUoNi_qgbgz zO{U^_Qeme*akO1YR9`!pztXOX#TharYqYwZ|12cEVXJG3qp9==F!6t+6ag+i^A>s% zlS2aDbk_eB6|9N}wlocVcw_XXoNoDDqN^WTaCl?=&Y7W3l}7i7-4@cM{?eldFVb0! zaUg30X7RB2xdG+F97#5!uWX5oxphp}Zr;IGbj_`Th?kxnOo9gz^Ef^d7afFT)}t`Xva zuz9=v;D3ZM$zAy#q^}kIEoxNH%V^G%;jF{7DEq`lrtX_4xa`o=DcT}zr>E@rCZG0^ zmwZ6onF_MoinviB)hR74og$7&eZP^XpjVd!4#A znijn1%Gmr}k=4_S*ij7}KICM|XLEw&t!1X2|Ra0kK z9daI{+cyQ5QNobSia=com+Sqc?x2uwD$oVj_>AQT!5#crq))KVdj-der&A)iD zvkmxP6H-l1eacI~Gtf=$h|se2PZl(wYd!mi5@yIHI%Zm97)%9~T<^I7Cj34QY43#r zrn;$;fiKZ-%fHduz3bF~-j^zsp-y&huHWXN{KD7*;&a%-ws;vf8`B|)m<9Cny!C`&9}yztM!Z*J=sGJn(!TTKTrfOeS@N5lp zM-UL)O%_5`G5BM)MyReQz2`d);#VZ zv=WM&6yByI7=dgA@J3u3N8XG3=KIJnOz=PTU8~sr6{Ef3-gZsM3t9Vn8E86BUZztev!6*jS&bdc&WKhZ2lV zXCF8dpNZ~WOsTRQ7oqHnHIj;m)6mqqJba#F3JdYJT;RXr5v5;zfALekp`~Y#Rir=e zcv=1tLj#2Zg3^e5K;@Wn;pMi@umbxPctdf!SEs}{YA1=qT^Z;U76zBvI0MK=A~C*y zyF^hp{9g^jfZ+#YFO~+23YDG6qoeEAFq_(cYi_)cDN;6$LrMh1*d*Cxq;qDHlj=Gv z1|28pk8yka83nEM{rx5q&4YAlTNzPhtdm+50`h@GoPKi(A_p78G7NTydC zi1r<+ovljQ=#weYZQE24=^ZrP2IfQaOj^Vl%TABR!>@!0P$NAX1c%Y!1~jkOZ$ywB z*Vp}SXvS#2ckH0bAU%-)N5fQM%dY+(_#)TmMmwS|tfw#mB;Q1UjgI8yh3A%Pv+e*C zs#ybrC|mn0e%eoXFzz4Yx0@$?`|(pjQItsaz1=vn#l8cYPM#Jyf5*gdzSqbqEnfhD z%P%iJNM$J;R)m6yMxH-qm#EN6H*?aT!O$5v z$6FZDBlWtbe{tnzwXf$#kzpt(ow%6(6AFvpj@a$C`V|eK?fbP4f0N+ooJH<1EAvv| z-6~~OeI>Z{zlgba=DpL5Wb#tfb$ypy1|)9uT>Kmh0#42d7U=X+LNIG=y=%|0o?)Ia z#Ce>Md{!ExVUB&37J)R_(^AY zq)5vJd>ePJv|saOJNoc1XP6%Q5G!)Gh1TY8qe1o`2-i;q_f~escBS){yK$`%ZVI)x z9aDIQ;hIx)Ik35gQw5DDa(z^e0iwPaC`THs-{Y^9kN<_3d{sla9ZQY!SG!qHG*SV( z(aQ<|A_}F~-b(F1$^jGgv412ur@oCF`j(pjVsTsbUf28$F_Nj8bL9@b!AxH7sJa)1 z1haJ72jBZ#yx(|#O3~F^F_NdPnODlZrH^N4x+pCX zU?UHEM;L&(Z0fSCjDP!t>#Q?|d-DsKv+0)b#!dwnKKH{AsG}G6CCqA^@OfkN8)&Tt z=*#~UrVBEyo)80VCm2 z1@Go0-_#Sr5`H%W&cix@bXzif4emsEq#$1ODGB-kw68*EqW=kudm~XLBv|7XI4h zTCe6?9jhg%d|KhJsXDOXalfa`@zGuv*J8~Zy1k6D@Fv5$JkarjuD-ju=Lhwm($Pez z9+vPwo_IEYqi(-M(_JeaEppRSw{~HX&!w2Ez9biq{^ypi-61k*LU5u6dk%0wbb7zp zgjD-aFX_pEu@3av^@}PjxP4NtnSBoDcOrMn-&|W08>}588*IGke@jA^~)${$KTuSnr=X&|` z;yG6+gA(NKpgOQC^@H}(SjP-EN9|zDm|4>Z>~S&NS9G*DBV@~a-bW{1*R2ohjg&8? z;2NApi%e4`)BG?GI6SW7;Zvk+Mtj(yaFLZ8oUi_~dR+2%Q>x*Lfz3_qr3mfb!}DC8 zx9%5%SfBGXb(A#=fU9Xc7(H1*PcZ5Zek-Os!y>f~-{-FyH$=XPf)6!|=60fdZOPmn z4pw%a`>C6p(A8MB?^`7lHfrPY^VuHtnugh#1*bbKMu7eKIj%8|@e!FYJo1Pe<&&-* z=(oUBKCf$ru&?*#J86`s&1O^A9hx{<{~nvm>!>ohYrysT0~b>w*7rQed~;5?P39#kpyi%L!T8@joGlhF5*vTIvu^B!&Oxf1X?%t`%LJW&^l z<){K-(>q`!N>e0F)7r_p8-DQoLGvRo=4?X7MkBE1_$*umGuOz(sJx-{4+272sAD2R zAJ^*FOJ5NQgAU(c;cO7-a?l^Z-%Bly^q2)i$4=YYdyQw9EgfR!e)r0YZI_6ItWxRv zDF1O{?c^3OO##EMxkG!^LqE$vmB2Y+U{u=@X0as0#>(BjZ8K+an{GQTiRJXZL_+6l zZz#rkg_zmyqIMQ>opXjdQxr{aD4d1-l?EwKy^r!F6xtmzH(&9U+XYzmc!Gvf{(HEK z2jba8yg6JHl&n6!>031RHPWdrpKR3)IA2-+_xx$D=pVlU*(#Y77A>N;2IX%a-xz5Q z4_1Wsp8x7wl|VUu%21>ONqu4yNHanEw@mK_cBjHLe+&f&l4TfUtg2Zw{-IvyZ}S_> zJ)Fo3I|!tfW)5BQ_?LhwXqok<{jArnUktQNd)-yR^W*Z$dM>mH|8|ug6-_oX~5!&P4v z(G$!^xRWh*?7}$?q72DiUO-D1xF_k4ZF){;UAg}b)_l^oR(!Q4Ak8La&3o;X4(&`d zn8lXVI8&Ucu)7G1U=~x)Mx>cbJPZH!b44AwA(2*FW%B~;vv2rQ{_3A$6lP*PsrpZi z2m?cY+u5nWs1*$NhS@MJB9ld{*P-j_R7+^zQh2)Zm3)L5G0#ekFln&W#rIFxIYi3f z4&LRjsr;|%tIQm=)J2tGvs30zRm1Xm$~|4Oe+S7r4$E7|cVGj%XaWLvz<)i0Ke$b% z20?>)V<3iA2kbN$Tj2R`;rU94cuR>?r?zpq6bLj!`~N3e$Bp8qy^rIMpZeXRiXQ9v zr1CYHQ^>dSXK4GRlUVGNI0(|Tjo3J8C(bkT(=*WU((^KLjeLI~dO_qF{Dr@BFR~)ceO!+2Oofej4~G z3Hsu)fAPeLKC0tas5cwS|>^93c%-O_$eWb}| zHvn1sVhTLG2ZT$oeZFV_ii#MyU~WPWIMDYdQ03vj*V1d{5fv_q^rROJljcZn8gPpR zF~j*y)+T=`&4a%Xg?2C?Ufjy#!XG3iQ{`Qs53|POi9JqF4(`;Zv92p8Q31=N*Jue^ z?CM0;aTX3NBTbFJFC4M^zzXox!MN#~kY>GkqvTJMxOu zb^d5qYk^;GIyzs%VD}O=ayqe>C|merpTLWbg7bv#GvO~#uVVfej#rAmP3E?>N6dc^ zMBlly0V-uOVdjdVR3J)``^A+U1Qira&!=-UR8^^0mseHJ>MR_@Uh5&GbAZKxw1(e; zR}8aNufN{iCijL#=QRv^FfX=ORN4^3%ZeH^52WO^jBpC_VW?#BiAvt=j_XiMMVWq- zv{3M{tznr+6_1tIik&c>iE5hreZYI|2PD6Na2T_2!UhX>Ouu{g;r#*O&wlrN7YV;T zoMt^W4H~fdboEU7Be~Q){F$RJ(`nTAuN|m0mMi8}H$9e+IVO$;gir8QXlg^X0wPiB5u)roeUbFAn-PelA&IZV~cXmRk zkU`E^9;kCTLw>`ptfG>bn~Pbf`IW<{wL2_Rz}akQ`7Od7-rreBv%LW)%sE^zVZ8d` z5QGTw1I@6S)C3bM8VpA^_|4!Nft*Y7=6I|{%L@J*n^+(_960rtTbEPO_SR?<8+dxb z#t8y1qRJ}YBkdIw6be*;bdGl{ufaQAHa&~VuJ&rZkh?p zREvj==jrOw&a+S)T;KV%vu!4#l%R$kucgzHKP2boynbCoxD?p3hvdv>3y!$0cFuSD zfDqyj|GjCpD~h2KR-`Gv&zn112;kZ~EtpBQMP1h4rvRyv8-?nMijt0wZ2xmzB?cqr z%1`VSEcotSFxW^C`avTmMvje*?Tye<{fOtl*3!}fieB=cMEd&rHh;RHVTzIl33HD2 zoS?A{AZu();dgr)3n~Lf4qE6D6l>(l|N4mitE`L#^eP2yDZ1K+LAthJ-~+EB`lw%+W!VS+%iq(ysiBGn>*t`=~W>SJPM?fYdh*zHDUZf-u+;IJUy+ndHE zGp7C zhetrL{KU@2hE7aOtTyykK!9*=Zte#Y>c+-~+L!XqP71IWO3KP$`?!$N(PaT?X;@)T zTj6h(M2H9o2nnM*uU4|Araufo;5w*UABKb(A)V)1f}JBCNCN(#*QcPpEG!({be;^- z2OXV)A3q?d;jrIDe7u+F`nk|Si=l+%WH<Oua8>#;noME-AY z;E{@h$YMIG^Cmt0x(cvaM>)dFefyo^E0>bzJ%!&u^YfpxspgL$C+EQ8jT z{w*lEZ=a8FyxM~6*U@Q)=oHTjG7enNp;B!YZ%|QtK}T~E;ALWbTn;pE#T^HEBcN3* zH8nL%I)_p3a55vQs;D^~0|SVItekF4X4K%HakhL*{M()nG2X5coX-S`-O%v! z&jZv-VEL5{60swR4UfE8`=3u3m*9C`@=r;k&t2Gvkk$KhR;f}kKlS7>EpZ04u#0$~ z+>F*P`gkG#12bUgvF{C!}rWR3+@-u^DV!?U_2&510^jzv3l8g#Y+-F&`*;h)w9@+wo3SRh3p6 z85!C3r`msmgDcs@K8L?c6OGm=?1<12Be!DX<6Y>E$x$TH>=tR!&`?oPNuJ3;R1^r0 zzB*c%ERu+@(gP<9Ehi`DYi~reu~`?K0)N^pKyW=cS_pFQ!G*x#rxm2eA+1i{%ZqO! zS7QAOQ-v9SmfOpdZ@SV@+Rtj9Uw2*gSYs!I5omnqW2fARNRt10(KuJnS3M@xgh7AU zuS<^B&w4}b#_hWQ=5NnlEO~i~=@ZX{#>gBhN-OR!I*NUXuCw`I7H*=B$gE%6b++r)60GKx-Qt3(zTPXkx;-zN_+NK5#iy7b={U zxBMsuE;69FYmE}gW(kLZH8;237xF8T*a1eLhSp_oO=%Up5^H9;TyI(-&lD# z|G?dyogPR2EfC$t;Y4_A7Yhmq%gbtl8oi2WQ%BdaL7Xfs(jPyjj{h1Q7{~{07}XSM z85xnt2764o7FW~3ZJdFDe>%UyW;>^M8Ob8>7~DS$z2-iG^Qw+i6$=XsYR{{gY>_MM zRff%cd%T2;0-&J0PD#HjCiPtLSkSRnVEQxLXS30I8%!%Jt2ZcNaNX|RMn+-WKf_=_ zPbFd8=mR_IPu#TVXJlo)O~npBQkJSEl(FC+XH+<2K^MuaR=6pcDGAWrQ=t7~fYb-H zsyiAr3A*2rfPsfN6?|qMbUSW~*LYSjFzSlg&?N`xn&k=5{mb^DlqP{UBQo^tzNNVvKD)KRFTd6D#N(rlXrSBzW#N#5BfeFs7dyDN>)(D$N%;)w|K?i^ z#{I9yFdT3bhb?oeZQFVF2K{g;rFQ zEF>fZ^r8iC?XteULW)VU|7UuhY3o^Ki*6q3RzzP5o#K>^WAuwO-%Zo}S-SJdPLgO% z>_fO5*lYPpk)>!%QJaVWCPntcW;CZd85qfrAU0p))8)9pSrF(Xs?&ZoqXNLbtH-a! z+6uEN&TaEpYcuiws*$6pWvTEL=hz;fVZd_vzem2eK8h3J9{fkj~;F60pOjYo{NW#j3^iPj)R^b zW4|jORh5*al$E2@w7yiHY>GR5v$D-}#?uCEfD&?ZT^4w^9I;JQRnc|RZ|_67$%oB0Epe zib=|XSkM)q5{!cbW&0~fU6BG7aYFWPK5m{+W9#y_!dcQyXRsj`7jbS*h@3q+_ebI1 zI{#_C)`MJ;y0rh=EKE0kD5y*dN08{cROOSxQrTs{I}r8_ezN~cQNch*W>Ct^`TuCT z>aZxAue~(V-5?l%($XOvA}ykHcXz`>BQ4!s0@5wrB1oq+NJ)3YH@v^=^V&ZY*4<}j z&YV8?{m__Sizbp}0H8eDQ6b8ltKciV%B?;i^ zQA=0ptz@u&Kpd$sPt{98uBu2%<{*n0?+Jj7R2oQS;snhU9eiQz9#!O!<4!KM;2^6< z_17Z-d>IfS;J5N0H4Okp28?ZdO-KmJ%E}^o87fHz50|8hHM~~>3r0;FC#l?W#EfJ9 z8Yn?iQc}Xc8UCT*vHLDeQKZ(HHpcY#Qx@~1bUwWomV_h7Sf zdU~+iDjYc|xG&6jxOe9E_b2Y|Qrpw3t1C=e^4!rcetz(`7fTRki4SG;+4N{eac zGyyj}Kwz`Iy}dPFh#eCXlM?>w)vG67*QX+YG9_zz$8NRz3E-hd2knhc@4bntP_ZFw zDd44rOFoaJdiyU%OAx4ZfYYgML0lK$X=P>ARm<@Db?4(ei-g$O!BSg@+s}-Xc_MQQ zi=!pz!FP@4v2hl-70WzW03R4|QNlnpkS6KENoV*1E&(B9LBsbzbAs`^n^fVr9hkdY z5j?)jS`7kZZ6~GO2vuBVT|^% zjAZ>LFlD&i%$8GEb99Vk8)qIJ9f77z ziXkv+v%0EJPk;spY=geOx5&0xDC`-`AK%Uz-&O>!*vNO9fG_gs?4iv$5*!(_l8{|7j*XAg#P$PE+}^>#4)`yLV_yLG3?^`g<-6>x-gAVS zuLhuyZ4RIT-(aGi$MIAChn2B>8O-hvT3VO@Se5A?!li^e*dU zAy6lv2@V9_(6cvh@PJz&tffU+Rb7osM)q%_*~E)6aS?0oCa(SUHnmYB<4|oH-eCx$ z3YWI{XT_zUT1~RD89EmJ_87Q-aV#-j3u0JdYMj4mb|{j2Un3bSHBn^@aBV? zc?0fPIME0P7wTHwU8H(i%TUfoibZOuy0HThA0HpsK0wrq3t|SqYKq{=)SS}fv=5HPVe3OZ5ik?2HlwkAsw7z z5Ev2n$=5^()}TUCZ*`S7zTMCjjGYS{Ae!b0E!7X7#Kpz4bc7b6aSAW>;i^)Tb$?_` zbJa#IARa)+&b<)PP_r!U&jECHTwZi)YHB}!|3(5vOF^MNb?3dnA|QqRVc1K93J>gx zZOT<0nA@41oyAm=eOwKm9x@CCi^3FD8mgP@#d`xd>DpN_NP>K4EkU$p>gc7K&;v~9 zBUjjmAoU1I|M5Zv?$9cGBw+Nmz%O#8JK{4I=cg~17@mqtiqmS#;fdRXQvZ>7OA)kQ zjDb8pgq`tY=Znx{IZ!6}utns<@N`;9m{aEo>2h9^2C=-t!|z@;O-`d3$l-4*`tmH$ zK9oVP>-sf6JltJm$~Ad{Oa(F)1uBe-6Fn^G4d|kmoC87u+Wj};7#V>tC<*X42J*5; zO>IxNl!A9&0|N|HjOMu)NrWUA)g;I0$^uG8?v@C45H-^V3GqaVIXZHV{=8(t-UE@|q z6tawo<=m5d54J;tv3^}kcek4d%@)ievnQ@B}AF1 zd`}KHsLAuzE4k!`Tb2;W?$?ZrMP0PwZ{JKSv>4)l1^po;GO6wI+3lBt7W zTW`7Dm&fhc@cDz3sp&VFSAv$=z~=+8p9{~Lg0yr8h|mO>4?%nr3^FI*KE5vh=T*TN zw!6EFjGwGtDhd13t^T^5yhzIv5#yOyyMWQ14`PaS$$ga*`|uU9#K@OXUIY5O z=f-Y7cYLM|7B;(^-#5^~pWv@)+J?{`33jCod71FgEvo=Fv%RiZ1EXb5%eb%Czz?s} zv@0(w!vY%B+%Thxa12n{kLF5Y2ahT-UHavK90e~gF9@>E)J@4SkP8Fyr*{B<$nxkP zDCEx{bwCG6_TRO%UEX&~jE`Rdu&>mp@C!{YQXfCYjk8IUN$zBs4D+uW><{gVml#TO zNYIVH7}YO+*;UDxVC0|{^t^^q-%1M0zG(-d-H8^6*0fYzz>S6_3{yHAby!KB?%3|v-enZ;l_qn5hyAfE|$KZV8 zi3<_@>kfzpHwe<*N_U78yS@ldM56C{LPkmd^BF4q3W2mMMVQS7Pr{mFr`^W;p+S`t zy{WjwPwUXdRIbtIPR?{-I6oiOzCv4=j{@78esq|0v}|FUc47!YO#w6_e&Qr}X=q>J z5DcRXhnB7SYMxOG7nvue;}ZN$BgK@SR2?(rP_bZuWsPM`-kqK|zurcxtGp>4HGR=( z+6OX1FJW2VzPxRvk^*^CkebFb-Nt+Om0HBlfro)?YTmXMF%W#& zi+8r9zm_!qr%8%)!wTF#9sD5m zQd&emMN1OG9O71N#0p{`(sm!rT+v9idfWjsSb|jqbl$ZtVYbTkyFl+Uh80aY<{CzV ztXpBroK5Adg1HRy@q#(`m~2wUql!K5(jP{>@HtI}7{dCZ z^D9J+D`{ayVgl#rR5dUJ9xX`2%E3$s)^(@W1^z!7wyvMBJCm;*Y^v8}v-G3}p+6X$ zSHM&!FEJvNfqij;PEhc|$frEkjvrQxg#DJR-6`;u^k;-iUP1nYtR~8LdbMD;P3^!_ zvm>_CYqTMaA!aCiUcFW&g&9W9X+q;tr_~F0j>!0}vxiU5Glozub0oZO!|A_t#^r4< zE2k@%>s3|w;6>g!>%AX4?TmX-KXvf#QDy=XXv2nKyYN|Y(ZU~=jo2ob;yUU45$sfI zFr-BY+WEb)!FQfu`2^jOu!pUN4oGy^zb`&KKi=a>(F$J;O$oY#HLuY@hPWup60q{d zEXrEMA7}<{N+hW=Uu8c$KD3!B94qYa@acza9iBiJg{`k7@ATb6;rW8P$ou|P)_Mqa38j`v03MZ7N;$;)^w-Oqi(Z!T+FUyHwTWm=2t4Zosuq95l* z>qILzOE@ytD`_9ls=Rd@o!s5i@vN0u^Wb zI;4cJ*y~`IKh;pn3}a%bMMT34y1so~gWb2N_URA#@}-rs8K{&&a3@%kApqovD-_JI zMj~8ta|w_rEbvmK>v!6A`7pccud)J|$aYDcm_Xtb2@Ps=R0B^&V1NP`I*BI9Y9ZYocVevcB9dz1(enCf)UT8Fh5$ zH^`8DA_4x>a~6~=+&fKXOMX;pFYr@4j_84#Yyh@GEl%~@54vVdqrq=y^cYo+33@zq zqP`#{nrpjMi?{^B`8BTTQ>4SEu7&5UVWj5ZKYytCMZP@lMQ`VZqG!UC4{)k0_Ee}yMJ%|2jeDm*T%D;UumH6y_g6KCSoQC^nHEn<5GIG>X0Q@Xn? z`-LY<->a!%HOAjGKCftEy?-oP;b{VA5()UYa0%;lyDw&&pBc<=q~JoZ0{Emy)iYA( zSQ;>|Snr`gh}c0IK`UR#p6k?=YePIFJq8LsUzbV9B9H+f5(`O?j&Nd1N~oZhXQI{P zXOy&;$IqZG)BD`Rh(e5KmZHE_BW%|@Yz>WuaoLa%+W*Av7sV2c&Z>`e_8Z?O>A8GT zo2LELYUVQd2?r#H0~b1_i-p!60K~G5QO)`#rWmNm%4JQOA04zkbn3FgU?7tF8Xdi| z(**{M1YN695Ojseg1ZXP=46*C=S~8>ZgIf~iJA$o|6&#ihbn39-{6Ld;a0T5808vE zr`jhN<7Ath>O9>4ySB6-k@c9F{kO9N2djiCD<8)rQT-0jvhR;|Gb6m+XUi_s6c9yh z`6y9fzW6rSk@sF=h0DAOuW(4-*{L(NSBYDsr~aqJO?^PBr_O2)JS!Y5Iy$-mproe` zxU5*eVnNEk^Fzza5P?XwWX-3dLg; zPo&f6F;NdT83w9Jc6+tcemN;tcd0U1(Z0AG@bvJozmMW}-Zj95(OMoijd;wg1^-O& z=Gm*&ri15(2*~|vrBj2X5lq=u0jQhwxQ|D!P9@4QVIB-0gGjYq(9Ync;#yRX$H7wS zOn_*v`hpE5S3DRi5Z^SSQt#A6TR-A;bGFy`rT=19qkYYbUxw}%*R!MbUz#* zBLyBy@N8eFDLD1~<>$FEFrOE$Orqfd!g%P&$oiJe6vkLQpNxW%qwwD&A09OP=3Khz zI(z+Sz*w{Lqhu5bNIj=(X11Kj`A~$8O{odcBB7FT`{jm>F&<=~$6reSr&y7H8omi9 zVS^VD5rO%DiUEk&OY|s%q5y#|eFU|STT7g4emNSpql(W9AEnASj1(ka{!*hExf2aj z6?gs8^mmnpM`_=sOZ?7%sV`Rw|3fTX^zPTrs8ZW^C6sW|!c9lM=bv?keX(WEUy4F- zj*0&*Ga^foo>jja6}WCNVNlfrJ|T+E9g}tcNt6$x9<7UCOB4u9F}(sE@jFJnD1Fp-O3%ECSvl7R+gAUqR;l|3@j`#)B68f zjBP#p?_g4>L8fY2(*YA6f`^B}Kt+nj^)PGrdI@|Riw{3cSIZaICUd0YC;ZWCJPdSC z2kofosHxnkiGVz7{PQ#77dNA-rjv4OemUM6(=?}N_3-a%e`J&t`C{LZ_dk}zsXJ&v zou;gDgKUK3KIiO5W zqQ~~Qffh_ByXQhuE*49tY?dT(38Zn+@(Z<`|Ert7;7P!v*4 zr*ch;S%Jp^6xlpc^jDt_f3MbgU4%<$;%^IZxuSg)Sd(5}zeN`w20n->tOZU0X&IaQ z8X~THo+OG`+C{8b8$$jL$8b3y)jtQ)NyIrmW_V8zuiEhRsvzcn=9&<=S@tBJwCV#( zQhios$xn1qE=OjYz^C)Rymh8%x8ufMq1Wnr$FKeb1$OY8M82laLLLHDM@8v=I8@XT z;X?GFR8DT-6afn*6#Y|PPbtG1n9RH1uJk(j=;bInCi6=jTU-yyDkuF?v}=oR-9Kcb zB1<%SVE+40gZQ;Y_hLMCI>YwS*uAamk?Q*fkF!5KJsy{CRD5sSA#rzLL6RhE|AFwG z@8K8LlK;L467>N1aAgw8eU6-$?}{Y<^p49ob68d+6~GENieyYRySi+2%gUyvy^lcC zIQEi16HDQf`1i<-^W?w(#r!=@0EWG(+k-tQ6M+@6-3C_EX;NCT7aoPByzD|ZWM{eX zXQ?*7UjApf*Mk;9;bfJ#B93s(V#*5Ii~rR89+bk7pw6Ia*MXhn&SJ-c+Rv>GO@1-pZFa*Q68S` z`LTj(_^)5T00o?)hQ^Lv42K^z4h029tvVoG;Y9`KP%7={$(_8Ld2dz-qy1+2j-U>Q#ZwZ&m9Sk9rr@u0vvPhN2E3JKU=k6Q z(|4GPKTbSUis;<*OHKCrqhJJxW`i1hgR#J(FL;;0k5cq#b`#en6<1fDoZQ^U+?ida zJ9vcuuxuV10#*l;*|(-jQ(ws5E(>Pz^%UNReE9+@4jdDZdF|&5wcODxkdy#Gqdbr3 z6(B8Wy1RW5w>G_Jtma0>$*lwg>Hym2x377zZf@ z1#GF5!Ok(#%4J2{%gYNv?XhkwD7Z+6U9DaUq7cBLNdpR8c7V0|6x6XFw0P*J;J__L*=vAgU=DmHn zVkm;RM$XP$ATWB-qCo<3ct3xwDnsZ!-QAY~jNhZbe)UNrS!_;^j}HXGvE5m()$Lws z6W&+#jQ@b%vmU3SNYaw4x>o33QIpSmKJbr%P?5j30*kikQmdeSI6!O}A z3$iFP_A@cD#!r0Q+Wga|9BD#YPA%F|=)}yRfZJ}s%EqXmz#qm@-zIWx@q1?QfrE2g{5?lsFG3oFR=4* zNM#P$W=(|uCMFdxL7g9!2%=Uy5hOD6$?0r5S0OLbNLo@$&xo-2nd@?Yi zpu6X>KLfC`zU;Jp%q{~|Am0x~;vgrV+As_*=( zeIP617zws6jlfB+>aeb=eEIVb7}APA;h&673|(hW=fxjE(rInU*~KL#*^2ZaH-!~* zYD0`JH~v3tkq%&z6#@T21lZhufptGpkoFMHR?Gq!RjUob3xEhJ6-nVMnG4(?kyKU% z%5v7VFayagL>k^VzP%MZ*AKJ&Czs!fn;zN@(qG=l6X8)a(q!QXOAysg>Xlqi^!=Ht zC9=4g`JL~0cQs>9IDukO+8|V_A+a-cJ@Ltc0ng8=E6@iLRz;BZ5hhC5O&)ZHpn3jS z={K>1FJf7xTMwqgh?Ds*GCU4=U4}Njhp#dY5>HhFUxbNPE3XA;t@%G^evj2Oqq%9k z`Gj96$ta(`i^I?ed6(UnC|EM4w)!)7Nf4SF(kofaV$0(SV+$0t!!>sOq$G+)6BZk2 zl6+G6co+dH3m3L4#v?u`4N~sWx$SxO53!3MgA){Lz8#4FsQF&}#%@*I`Cw5_SveL} z^2?rp+wot$=^;>{Fa|Zf7OZ4Rbd7%t0@rRRRG376lNyav@?|#BzY^tw7wgNOUq;G| z%?*A11!Tk)b&j^VaIKNI6ErI0xW4f3#W~MsmIIVZfi+&-Sr{TZT-Q6lY=}L&cbN{rLR6END>y>hSNzModBi*XqvSTr#g2Bl&{< z>FpqyaA~3Ybbn^9$p%mM@`VA<()oUVlyt^)-4zR@1nqhk76*O%VXTKL$eK!F9g}LY z*ztNOlPq`nv>k|QqHNt)TyoEM#a);?*t{Nu=q!885tzZ6;R-e9O+!CIdZYinx{5+L zI?d1!NST2NWYo9)dsjgznWqalG!@m0fpYKg#Iw?Y!)4-|K64GIDY=OUoDh{Hd>$3&OYD zU)hW>`CaiM+_bfWRGstJ%r^YHbE?T>^3!lB~geQ|or9>*%;8fc~h_7l#1CKwPYQW>lRcGK3$S+In4P@roy z5a$R&0l0&O!18W|znp4$oCK17|6YH-!4Bm513+ihbtGwjj$Nl}P&5^}df&7c)!J;n zyFlr#D|B~x?Ti_wRJ$N;pR@fymUR^ofQLxPB5ttxkjbvx>DEjab^aNwhWdNI#P!I zvuJ{ny(-5K{;Uq7eJ1*sV4(iJbMHjo&LZpe4-|6_DGd(B2oGPr5-!v%2Jv&^pZtMLaALKT>qHNfvm*m{jxgp4|#*-T?v;5FToi^7wU=V zO4Q#Xea??K+=R z@l$kqoCXK-8c(S-&U`r7C_y?MkgMq`^}zJqpG8DuJdwFFrll>3qj0WTYY6^Di~WQs z&~28MD5Cx{fJQYr)%;Xd*|)(xMJ0+7X>fo|X=#6jWt|Gh3TdU+#V$%}7q=J|m&Y|h z4k}t7IRw0bCFBG+nUS|e&nWM+o-81kzpWS|cXFOUmy`;&zV7YrK5fD{s9dZH*yxd;%xYc<$7%hR;KC%%os&}Tw!_{{7=mAm%TTY9{3o_ck;aU4nJMLl}6 z&BaFJAMyO$wI?e|#Gml>0*_s-6aBFxe|%xvUdJ#_E`}$qd|!@!2&Sns^i_YxxCcD62ua+dlGK;6TW`t0v$}?gzvD1)ck!a!8d@QLkz1XO?%6`!K zsxPxD!tEkBukV!?lZ9JQu=(lLs@pYc@}$c%63MjvvgM&@1>4oFU%Bkam!Ez^O{cx$ zA;I?OB>~H9+ptnBDpTG8pGrx_0v$LVgQqQqUt$QQ={u0~X8nb+_fk=(67w*=KjCZ6 z0G3Md(pw?Pyr1-Q%19sK9*(WUg7UPUOR@s6a&Fw; zzlMMQ{4uq(jC0=iXMZDi3r;{`e`~obm-$y@Q*x@+YFedn)fyolJ3=tc)9^PpIX@=5GGeLhR|$zC_n^e}({`N;{#l0)+;0mClN&5Ud$<+w zm`4+wln|c}M&{MkC4eqDZ;$tGpW(uE#a;NPfgRM)n6ptR0(}VAzsRBlCUbsgm zDnU5tVg)QCrqfrwutBb@$GX9L?iGBF_z`e}i&-E-j&z6r

fPq{T5obIVpyBsFoZ29U1#{ z%#;{o#OowAHMOX?_!;QOHk8S(t&Iopd|N^R-x=Lr2Z``=b8-SKKWWg2|1&|5I^6CyTg zMQv;yxdKn9pr9ZqA%SRqzjdJk%FL$&7#8ZUJCO^l5{C@QiR?^yTQahJ!tlqp@F z2-4xls>mN0bfmbv@vtY64g#L_)#10WKU@*w=xLcIR3qJIiig^@VcdXdPF9ZdC_VWT z!6_#{XxPB?P%59>I}e-^0@Dl*8-qus2X(BU>B7xvAKZJdH;3 z6h&-e?4$-%Md=|fc+L6wfna}87Px6>d;tu!(nBvV#VdOHLpi_tnwra?RKHq>PoF-` zI8Z$gEH=h|`0l9hg3Ag8TnI5}HEXRuo5Ik^FxB()aSL`r(Ymc3>zAuGNa8GTv9ohu zZcM-agASdiIcB{^J8_UzQd2lkX>xT=M3D3U;Y=(;o0R0gu-=I4ip zQ_j}>O%K-H3{%#hrx{s}zpFOg?X-Kf8(1U|-&yzk*+a|vuBQE$bkuLfD;6v>@9|WU zM%KrkYFE$7f?hh{)Vx9D9PIz~>lp(>81P->GX%C}dUmWffnop$EOmx1A{N~1mFYCH zKjseA@-Aizu4?X^CYm`pEI=|0+0FjZMuTsRd*ts{Zn4B2VW`6?dO^szD^~$ zhOjfFB^w#L{|I@w5+_cFKJz!anqNl3J#G$0WdrD$EhTi-1)Fji()+WH72b)y^C$2H zG`fXQjp*jzc0cPcu4vz?5#sw-(8D4m(Ik_*+tAcE5?zlGOhYD=M%lFs!E!2rW`I7U zxKvy15LK>~zDFrf(ooEbJm-p@IrYQUJ-8*zX=2y5`XVp&E`q4+ z^)6Y;->U_A!DIaI;$fW=ALISNivT}Xd4iewhi~_)iAnEQ+!EWYf?ku+pyxyjfnZ$4 z$7-%lNm;oIaG%z}evr*S#RwU0#TBuF=yD+{3nIaY_x{iA$8D?4+`A{X)w z?DQlRFDogL&=6Jj+dZG^U{%*OEw@c38)BpEMp9ov` zs=XK^JQBhV4cRjiKi1CVXuZ{D&1x3cB|nN-1xDdv-FoW2Zg+#D1>%!It(-ykM%SFc zsx@n!zC8#(LXBZ0;Rc7JA?v59rI|m#eK)QoY3HLEF#|q^ZTo1#3Dcrr#I!ZGkIJCl{^) z4Yxsw%|NV1j8*N%$4)(X7x!0^v<%c!`XAo|t)yF^B|Pos#~y7_2ls94)At2$qzbMt zs;*Z^IO%@b#jmNNP@?+AyY3kO90`8x+WV28F6GT{f%B=%T;Z!%VSbUPNl<*@FN#(# z3MyAm4HRyI9@|d|Pmq3we14KZzI7|$kk}a2LiapYY)jZ++1@yUO({-qbxoZZVsbf8 zfj+)ooL6T2v1Z>m)9mIzZ1bvmb`XhJvmJB~@q%_%nFPk8yFL8%8jc~po$u{pj?58D z*8BgM2u(h@Uiu*l^88zkK)}k-jM=)GlhI2F$;_PGd?sGor2D8Oj;k5nHN@8tz42G?|vWAsAjxa>U`7-M;8G%luA@``kDv^LSPPVZe>-~ch=U-@`cd2i5a4P zf6PlS?VD<&M-^ymq=&KjH^t1wyyomp@x|YmZrded0-=G<1uH*(60GHG&VexPaQBXH z-@oU9Mzfjb9yb9hKw>4qD*A$#H@UZ05{%O%z4bV+Fy92Bz|va`VzM8YxV1cIyyypc z7X@T4QCJswZ(UL5wK(ioAwug6O0jBXgWm~Q#VKzI^1jK+uq#dP(>(vQ{@oHE32w@! zJ2hUL|3-0}L5jymEwE?pw`qH(^TptE$Gje~lIjbAEr5p(2DjMsIs>S>KHeEww1jnX z;LFgedOE#9o!w~Bx0Cpi&~yCw*hfF+CG&N|$+;gRsFakHnO4Y)AGB11Y`tWj5;8*K zfP{<;I!KMz)Yr#?d~~_Mcy7eeTHiSEYe1X@=1zEHY30a>_B550L_9qBLHZ;7sgU=~ z#Kj=SLfg`ka&b@5)dnNH(<(c=duF&6&s4aEKXA6Jlkxo}0++0(dh|7Oehm+WV!j&J z5h)HSJ%h^Nme&5pjnGCdl{g=*Qb~<`K020E5FRdPPWZxRQt5VLtn+JGH=!G#rQT4) zj0NAEIxMy|E^x~d55_d;dCBmIeYn>@I>YH%)c_W%MIS@QEoZ6|=9Pc`7;>4L>w|1? z*S}JbHtf$qrg;NA3DBpj02ad!nxwg=q4b!TH@nZ^^Lpv$`M87XU#IiTUwih}8E6GZ zfLJ2wG#>c`;huEmxHYjf9dU|=BVN{<0EipUGo40v8G7;c*^Wv|2ahNZd7cQFN_(Fb<1 z7k-Uv&N}>~nR@gFUXs}3EdLOnb8#gAHoSBI>J1!Cpj)<`!Vf>{bEQhl%D#B@Dx|qt zK*^VN&aF3`ltR!m3AkcbXD-W9#Vsm zQ!l}4ZHqka4a1aK^#lDo5jt?GNDuybeQ{P-&lKHF-QuEc5F>?x?BS+M)wECTFZ8~B zBf?-AgNwp4M76;w)h-eBYLfJ73X6*Tk(8F>!Tb9stKHQ{bQ_g_=?f5vK5#Bqw%?!- z%B6cr*fdrvIGYO8NDzks14wS7CS5_F^zl+EFt)Egkd|y(J}SFvbfJ*nnp$5LZHez~ zLGaR6oq_d~6Z8r0`;ejoAA_R?+I zQOMqYznvM1+UT}D5|>Fttp)jAH&+X(D1jMeWjPV3M?ZpwNLg70T#>a@#(Q^PZR>A2 z(UvNg9lNUDO^uXNB-(YwIVMK~(uxQPyu1=dP;Oxuj+2fFuFauD%c30J9EZe~f%?vylE`|un zEP+uHeCsQhh84B72z7)EW(P!qu%aUK#L013-ye@q30Cfja$?oXDjG5cOK69+(;m@8 zGAJZ7jdZ#&?7KwZ0bx%N0qxy)M*RArh@;YPSR501uxa`F>#^E>i!Jwb?ax>Ebn+PA z-bOwZ!V(7K(D*T@?h8)(y6D6M;aSmcA;oP@*>E}t_jTYw8z0?fG}YNXMU+Fit}4Yx z6W{zG&WflPcbrZ-HhTp(GzO3(G;h zLD0bZap2N$f4`n~q<2|c0>5XM;>y^@*ri1y^X=ksxE?(cJp>=)%l){S8;_fbynj~B zSava_cFKwI(vJo;H((yI#Q^&SS!(2urtgR6#9@RE`aie1R!U#n_8X$3_oXxqs-5;s zqn%#GloP4`=&nGM{M7u*%A}9YLUvl-`$K4mP6lOPUfdzVx!0>D(NL9b&NsWC3sm3L zy-u6^Ey2wKu|$Ei0mv6z{*6@ttRCpE<}zGJib2l_aLEJe>bUUm@%sk`)@}vfZoZRC z4fYT;E36p`eA|7=0t;JgQ8)~s$e&8>`TGg^7FA<5uJ<3|%N+HqL5 z1~sJ0NiFQMPpO&;SE*bCsV5oyV>6*~Ts?Aq7xc?=nj0c5mn z8#`BeE-vRQ({dEj7(7IgEiJ}lPZjG=*>F zOxY1b6vIKJsZjNN+AwT0?$NFSJb7wVzcy7*1lKtEi}By>FP)oObAk>WL_Nqb7QqtnUfzVYRac)4{gN2R#E+M=%x7tfr48A_kwF{q%N~ zxGky9e6pClP%f3rW34x0iI;HN*7*|#b~<+u`tj;zCK4&+wRg{cN?!^?+QQW=UFg<_ zSKOtewc1)#OwI3+0BhPp5qh{9Mn7oW%t!?^)syS?ygIHcfiA(>fAbx6u)Xyy? z{Qv6y(g`L108A&Tzrj=OIrD!m)4b{~!U^kZoq0thgr&vUJdfPGec^_ADCkb6JTmU* z*=JqfM$5zu^oppEYNdY9#La#aG|WI$rc&|=kZw&D)1;#cjt^Jax^j3QgU9&(g#Se& zc>~dmo@X7b@X8AcTd;=Y)ir?(1i&<17M#|=pUK7URWM}VHfzb%N1}gpspYajs8pGh zG3D`VlAYbabr(IkJK3r7^5~}TGOJ+eih;~`U}VAQu5rM+Ug)&~6o48;jSAOrHlFi59vEn83#6VN=03gqw#?mj^&2daw|DKRVZZfepY9nG(Mh$z)mjeYCzhYW znABt@;iF7pJk@@n?1M~Ar2T7~OyF<{?7F<$vqz~!?F0}`Z8Mf!8VW*pr`23Gi?@`} z=;dgX_ea|Y=TU; z*~){LW17Ow=}WwUTX6#*7*G746KS_1%#6@MO@XXm!#(_1e*vsWJ4V%tWWS=TtUo*K-X04td#;vwCWJd)u{kd-Lu__e)Q?uTHkf=uK^<9M0qIVi`^1 zwpn}*CXD`|EE9(5+#e@qVo!3;ERb>EHz{*8>sQ(xc6VZWA}su#V#)#P7FEkd;!u%{jLdM=1Ti)yCI<#; zh~j_T5MxtQcTU(p5Ue*99;*YKg|4*E*y&@NRy%}i@i6_$=F4Ax#7!anobBqTyY4Q8 zI%>8i-yBGQ+SAuV^`j0){1MXQ1d;~rGtTL%k9i89-B5!dYE;n!66R``Y;5kg^_TI- zHi#9Xt#AUtOJCzA(jH~=8JU*2Sobqe!<7tb)aTk9L~S3iK!oDZyYxl%RE)J*o1^n* z*7+cNljr%hM-t!XdUYT65eLdm_$R_|aIm}Kqanm~Tn|gRDpJ897+5CKYH?#mjaf8yM<`7kIXoxhFZ^vgih0O`HGvV_t zz2vv0NHJ?oGOnH-x;mR}KQXhX`C{rgOUsGh8})GihQjgh`q?-QqW}HPw8~>3@Pt zjE@_B9}+;CghfF1@JuVrS-1SiroO<8*)2{C4+GzQ{vkiN`TZhXYr2;Dzl1_DoDLEa zgcPVtk-&(SbsQ(W;~7zs(d}F*{Vy!Jap#|F^K?SQm9ShaZ{&G86`Fv_qi|6X5(0EF zrMRQ53@!(f>sksbU4{yY@fxwQ063=bkoKl6DkXRx-;-(?8HW7V0ZN^^gA1?poX$gs z1eWoZW#xZ&3Qh7{ybR45R3?y^_w%qX`62-kGfJid4mSd#pd9*F?V`FOaSL6v%g^P; z$?|!#!Li2r?mZ)cD-F-t9UG%9LK9&O7pVcpxL@Qcx;9QAVKq$ETr(FICeG-mP8ya+ zhM4_u%DZjV@GB!~AC9ne5b=9xPBXbQ@jUmUtAVVi=WTjBQg1;77;SdZw(o!02jw&{ z4<+>dnEv6WRSYadFqxkb?wNQ?e5g!7-BE;5>{nQKv7YVJ5bUqPO+|3r3zo=dl%QI z{!bDI8NmUkQgMW?!33+zBjrgAL?3!w$5o*c5_Wy1^|7vq+UYqeC}wUau0hNQ4uN9eGeOTp=0T3niz~Hv3#g*hAoF6^v;f{8Skp4h&1|5wIFGBy z?La8OOJ)^z!(};R3%X4%vRKN{KX;pR%H8Y%Yzye1t)-!%K~X7A2(n12^C+OgGkn+2 z%tRSBkYC$!ZEi7uuTW!JS~^O0IQ&8@h&3gd$1Z0$2Gz)ep7xqlcnbAfD&v}Vjuq$S z(npoO1O2WS5=!?jfLq3fNuzG}D-F@~>(Jx49C|iz)bN7*FI|kd7>=ejV@YoES$gVk z?=ODuJzPLmt^%XyknD?hi8SHH04)U`ix+8bk+OD3rS&RV7)cmixw>_cDAsQqvxK+agplW#s{0@-9yd3mf) zC4|9UB34#RkK~W~mA3nhn?Z(pvUGk*CSasH>0%?*M*D8YAWBOBupF}$RzyB?*HQ9O zQHrC4gStCqPBEJ3(b&R>`;2baS&~D9E=6+i$UTbJyrt*a^ggm%&-0|o(>1vq6x7tj z0b`d2K(3tk{seZdP_wX<4|ChH;A+{7{`vC{u>pX6Y=VwkohJRBP$W>oDlBGapm>E@ zR%~8XTx|Zuij49HE^*;{(KY4N7=QDJEs8K^pQxy`+#U~@Sc68GD}QXk z2FtNLX)`gSh_iE`Nh3mYy2~KI+=>LG>LcRZ^i8_U5vU&=e!E z{wKj|eY`a7v8%Xz?Vm}e*ZEkZ!{!Fo zn3><=PL4zv^a&^cIh9EkAT~?ZmL6uKITA(8i8~mH15Ul*_aBIv)KBq*K}}?@xY%1{ zyv7O~syd~8-#7Xr1anpu%4*l6)pURW(<(b&BlUw=0g(t9>!rFyN#S~BUrNg7a_fZ5 zTx#()T|@ETJ>QDmCsjWGp0CjBItD&(dS+@WM82&Ts(qj`UXw{WU0K!8aCx@6x@y_= zX9mn?kCg@~8WIx|x0MzDd;ee{x=+n%)xP)<)bhw}Q2#Jl*Wd6RC(^@3Dy}>3KojZ)Mvb{LUU@|1u}$O#r$E6YE_0-V9QL}V^a#^5l(XNvK_1!+>7VU z_l{$UC7<|e%X&1&)$)L#1zPCcUvsAp-zGIKOQKT9k$9rM#U$*WSAJeMXZ_fGy07+T znFd|XpeqP-z2sA=`@@3EQYo3P9UX_9M?-mf_{4XGZ^hSV?JRv6Z8f#EchqFcwNn{x z8`eQH%CDPh94+5TN@%4wT}4Z!>^)pc-MlK!C;+B(dn^$(H;&m4vimms`xkbKsh#s= zG$^4_Zql*~7D?HfNFc4|USSbR=pC*0AOS|-hYjFpL$lx2s;f{GHQ!yh_rFY}&}eo& zS_j;r)jt;Y0~hzK>pfNgUfcIaaS#YSac|1qf3>$YqMqsbe^p(1Je1$}pBcl9wGm0S zh9t7a*s??hAuUqKPPS08lx=$KyHKP=vLtQR>_Zra>_Z5VB}>`&o$uxQ`MiF=?>ztA z=f3XTd(XM&o^#*lzMq249|l!=5MBL64D!NjamQ(1HnWdon+3&?U&9Odv`eXcVV_g^ zTEC;6sqbR_4IYpz88Z)pjlI%>5RcqnyK|3Hs%gvmlQWj>m_fROyVH-3 zA)>8rVMY0Qj-ZxPgF)D-8N~^P?F!41+h>)Olq{R#g&aD6QlcGyDcddo?T&sTYMgxC z-RN_tWPk;Ox;-=k*=ej#$87nz0B?M`-!XUAcPcGZSyWV1slVNdYv~1ps{;3hx$se> zb^w+ECbfmp(5EMZ?5n?X#O1bVX7ueJJ*j~qMiwwGU;axzeZfnW z{e=ZiBB%zX=40ehc0k@#(EZT>x(3km<2C7=<@Xn^*soKulyCp_TtVu(`M;NWHCu4Q zgdnWWn%(00;=J!LLwSyuoFs=RLw*&6 zv|K@J5O5}qKyXhqJ#Rk3UaaiBv!W7wgR$9C%!P+g@lk`MZ595FA9yB#0_;U93hxB1 zoZZ~q8q|&`tx#C5D&~&^Mg-kJ&kqmB%mU*WcQ7yP3^8S-FS?Gu^PiV92hEx6l4(ap z>8_f;U|V|t6E}VO#Hi~FOGG-CRT#8v=A+2d{xP?zeAyqxvoQtOyf`D$lGT#3Ql`eY zy{frS4VMW%OVzmcQ2Q7<M8m8V?ug z87+E0PLet0eu>B&)$yt*>nSfglnZvuQb4G+x0#UZJKhcLPMeRb39>yL@p z5pB!2&WbNz6HB(AtkQ;*+=$M!s3Vh;6nSF6BFjzqY*aYWb>za%0;FFxILqj^uYK`w=HK(Z0VV<$!*Mln#4oSeZHsSfG&b6TK1<4i8Hrq>uw*6gWp>|Rt(5@3{Qj@E%G;Hn+B!7Cy|~F^lyA3k0_8M zuS(!_-Gm|vs0dDG+*853i(p4nr2E@IHM5W%lx9LsHf( ztoX^Bt-iZIyX?o2<*441Crrz*iex27wBpN3kUL92$4wkh-dhRi)3Fko@iQQK#d30% zPGS6vNB)ZoJxx@_@nTk#`r4_rTQW?I922X0c0Zf#8<>9Dy1%)A664}!)5rd-{_3|4 z!lZR=sEhuh#Zgf@;R%7!o;T?=^|SNSj#&mNi7lD>Qd!tJNhPEjh_E8keQ8V-Tc&?Y z>2@)F%NVg1cL`kNb5WMyBuM)py#L;&-?|HZOkM3$k}a(ro}|B@Zdb4+aDo1tzw*xs z{1Jnph`IVT`GtEA9UM|{McAMaE&qToS57SKLkj#g5*w^azc&LcZyy1)dF)NH1KHS$ zFF4lb>2~r3RZLJUtspz_=0F#a{0OPgKBZZhawpC?@7V@F>?PP%nXor_PJ>g%w-)T_ zlx)GK?I|_ZVAAi$YlwNrq#n7j$xBqXV7(cWwHTx-`*V<^2U2p%1cWsM5^8S0^K+~=>%T53kZPZ{D7EaTT%kd|^?ot?GsQXfZj{h2BF z405l4sd!aaSI5(^QZ`hJexDB~WS_a+2X{hC?Vv!vZjrPbscnN?8qK#c^f!6bR52k` zK5H|7_}KPtH2}t?+7gL!BZy=E&AZa5;_wCCDK|FWBWelp@h|+wt6PJrvYl!2vSSE! zYMPiJ%bIYOGqrndTz5yv$>f2l$eIb)zr7CM;i>S{HS2(Fhv9OG7~0ciU027?v4XC4 z7?+%wQIKw7u}{h(Ac+3T&!Mxoj`&2meNA)dKQj`cuBG+OgEvgw3G#Ce^-HMaTDE@G zx>lta0uD;_TXy9e4Ka@{U5}@l0-5%qQ{Im<8bUZ4eYFKGb5c}`bCGNCUs7{rv;>>Q z8#1qSZza$NU;`+TE;H9y>p4eyUg-pc*2PHh1Hr~3h5GZ z)ML1TH-3cXO4HaWaBicqU!TE|O`{C_eeOmLbLtd$CPHiKK_qc8f@^BgFUg-~Snk@9 z?{|}A1g~p2%M26)Ke>=XwJ3^{xli*NJ|qxP>kE=;CXyh#;@f6BYh3TX<5%9qn-Yp- z9LBXr>F8)?`HRF&)wT)}3?*sixpd5S&c^sUNWZgTWtyOBY0{w+YK%JhT_&zU4-*6~ zTm^QNdrW%|di539C~XNGdo%h(!CqYaZpof@3wX8eqL^2`jIZspBleb{hF9Bo z9MIs0o{Ch)v=kd|a;zc8JcIw+{Cj8-MrKB!Ud-S-$uSLq&2JTw$o16gT1$^72Ya1l z)>#>t4=ZR003aKN!{J~q{SNP_2SLOEJu;uqhZ}fD+K1VLV~_$sMb^E&9zh2KhmR!S zZ29&C_C9?f?Z{?Lj`~xOyZ+-%nkpW5*b({5Nw{zT9)bL_Zvg9uH3Fauc<&-6rLn>E z#|!K!eBj;}?0}Q)%+=Qin7P(7fmJbfJ`O$(pk*R-^s6?gacF$pX|ViQsM=L3KnMh= zE|0>PLIXb=m+0MF*&VWm#i#t*2+3MK=ce4@!BLcJLQhCOMfjsFV!Z`Du@NV5$MkH= z^B5H;b&*$~6mn7f<0tQ83`2##DkcPc3iAK*{u2p+3=$nMfEBiZ8`BTuxB&aItE(i) zoPZsq!$9A^2OZvq0Zf~Xjg1Sdy1eQikLjq1fcey*0d!=^K67Pv?CdfeI6$^0m!fAZ zxXsY{<40JQ11NO^k@i+3HAchJ?VlN@VT%mzE3_*F)Ugxosq+KM(4H@dkeUD~F4e>; zlkmxqFz|qbM3nkOvvoP%V*k0Qah8a2 z@#R0xsc_nVnz6DBI}{uiZzl1NScbqn@+Sf-5`zD?sHX*CCI$q+eY6Hc0T0sBaM@$n z9N4J$klMfh!Qj}28WI%}`o{TxwWR1b-ehLp@xEF!b!zJ_9&a7nM!AWjndI6_Ph-@Z zK2#a-ck!1&>t!D@Gk@oRb(ZKCS~2_d2+>?mub>*rD46bdly=6Pcfa4bq9tt5NwhiL z4|^7asuPp~f`r6`s+_B7+o)dGqF?Sc7IgpIKBADM$rHj{vmiXinMCMlkF)t|-O;`{S~3}C0pKmIv_@nP z%z*OM0eyTy30Su%y@#va{VFW{n>V&Qr8C8i!%v@*gvLd^7C$O3z3onZew{sTDaXrJ zSXf*r6Dy^xH_OXS#G)x@*{G`(s_WovZ{fY~F`HU{S*H0EcnQk`aVfr4W6_n8c35Ca z@pi!UJ{&t|`9#6XiQ#TUdszMur{eO>N$p z*w8ky;eGhBpXaMqHpjxgPG=e8sQlKGj2ro_wiVsBg_~R%h_)AzU_E0QjHgExhZ)8) zP@dEq>8-X3!0_&pZ3_u^3;X&jxF_Zz+rO}!qCO|b@+SWI17XIogwKGkeSa8(CZ2ou6>4F||mMXhb&EW=o-w?$m5t?_ZEQ03zf z4zvPTww$~^r}>ZpX{t%k##NsIq0F1m!OBOIsB$#{50(CaQ?arFM2SrdKkRDMz1j$2 zJ}?DfFX2rG50IhJfxd!&`$uh6!-y7#tw%}Lu-gj|dD72SFO^4z$c~w2;z?4~GXaOD z#g;z9_D!%mOEf&OR~JWPVkS#rckw!Wb*six`6%^fxCXvynI$?beiAyv!7OwY3_FMt z@`s$B4pE(}X2m|h2201sV=hG3$DPgHRiWJv6}B4Rb=&toYBH($iTJeg%trqS`A6TZ z`GMqBC^T|e;=p(YgroN8J|Tu=i&IcPnM`QDtadjbVyKM$E(Cea%_H3WI4K$JTN$ga z%8&r;DxBUw#%~`&Fs+qHwk#=vVI%91M5KrmepJ$W+nkZti+1De@Z8&|2LJhOkA<`d z@+1F!X`~ALaYwt4Cx@ZcP9>`+Q(idGbu6BVdP8X;_3?9Z%JBPHa@b=D@&LRH65D|h1i$H&E!vvh_ie+SA3}U3JVq;?Q{hExiqyU& zc_!t!vHuq~rkd0nmR{MUXNZ$)z%W8|43tKka)p00Wm0zQ6vxPIwlq2oJTt(NRG|(d zfI9 zlo-JKNs%kz7LA!DSae3pgKFc)R%!5GOsXOhpTh5NdkhO{7>#+$XKmv>GX+Yi&cO{) zIB>9cfM2OjoqVaG`S({1^owRkC`xkg4%e8t%JiS)UvdeG(N%kVacv&#yBZ;xV8d-? z%{U_LWu!Lg9qHl)+t8AowtnEZ8{&HD!^<4rSgxtGxVl5v5<3Uy;?x!kQF%5r@~I1* z7?wkdO&9`OooxuHItXa+6X0Ezw+cJ5hYJLd=QAKg+U%XV}Lc!mZtadNMWNYth0653$eBx0`A2}48X z17tY}hIIWn>!?c|G;xcwEuDBNT%)cYafb;kXLv^7{s&%GcEkeB)+o`U1+_PKhK(sB zYA=F%g~tcF8_A1&hZp%TeBTE%QJt)NMC9e5hOdcAROv`4S5PKJ%8mK$FjXjhfFF|P zE2{7r6^3|s?vR6iV%<+atwEuL{q^3AyjOW%ui!pGg8gWOEm7b{Ouv7yHmO^-Hn7uDIiF9NlWLs(v5&Lf`Wj2X=$kolF}jFjWkHtJO1X) zyf^dyc{AK$Zp`ex&;IPsXMNUM`{ylQQX+m8GAfp^F29%rpST2{XbKLh)c^ff8&#TF zL{P-aT3kq+N5n=zlt)NVh@VGXOhAA~$ihmLPtaOONYI+UrUrEr`~T~gDW5Tg2}F4K z1b77g&#<9Lgbhf9NR^AIpNX4k(rXWqV8}C>4I76@IA6f66OE78^pEPvtj_+0qCC#K z-5TPh@OLq#>^5ln)+cf%1}Dbu`tpnChSRZLq+Y+3I#Bct5PA6|-JxoDNb(8q{<`c2 zEo)2|pWRxq+GJ@as|qybUGDuRw-z{)TK2O|4wO9$%sV1~ern~81Qbfm!^o?H+UjGv zWiT_Ve0tkrs!ZiNhKNO?bQ7_N!(w%;rg1*NUQtDhPtcy zADy3N=WlOPiUW6hj|&oIvQB61^2YLlE;6;Yhw_3i)z;%bGKVyZqIQ~ZjDJ?eoR*?` zq1<`Yjh1d_@Wnl{0RyL4DdOdoVnm1eOln@<Oai9WPX$_TqTM{6O*~UBs9wkv@fQlZIw)|p7;2a8)nbdKnIKcP^85F78!K$% z9q0!ZNt=;U>bL|5ykbbPCc2D}tNP1?Hk+~PK7rttVRaLmqta|X9r;;Ij=54m>e!GY zWR@pC=CnJvYo?0=cq(VzPkWBM*`6HYh_kBkj%AAQLTOAOCA+WcTsP8-!ZBaZTAmL& zlQ|m{wAkI}x#cg^+d=xm3#M)<_hUgr?=&q;aO&;oVklDXP z_s2|N9_iyl(Gx@`F1~4due^IlAt++q-QM1Wg-C!tqW{&T^?<(O_oN%`GIxDALP}}k zuWSy1smnF`r+{TOoeivO7fj})V?dcgvNmYWFJQ@U;me1%p={CSJC&U@BbP5_(b$f+ z{(>HdErJ<(aW}XnKJrgzl z_=H}QGwXVSDiX`FD3hG%Y>d>~g_l#LMGZSRtMIIhXIg*AdNW^yD5=PLmbimuPrZgyJ;H(>9zu7z|8xO%+ZIA7@X!Vw2{Ox2iBh)?yH&?ZMR*R zh6SyJ$^}y>^GF9$3M7aL~qjK?W(!^8(t>nJ=U!$7o>GzoU z)w;0^_y`b53Uvh!&>386M?*xlw6x57cz9snt@I3btuO|tC^_X-@{E-xjSDT}A+~VP zeIgVP(!J?zlTt!9? zwfDjWua?Vyk2M7>1qHTK9Pk*`50(_ODbTge5RtbD1-SpF9kHWQZN)~G=hMzAiX;4z zK9VW8eH(OpvD+Vo3KQV1w))WbrrLWT5YP%(|Lp!OWdAGWU|biCVA4rl{Q8pR;}Tj* zb&MJwT+q)C^lKj)8d}`k5l__<84|%yN`78A5n0>=8r=<=`V3ia0AiN)&h(Nl!!m>= zPu%(x@+@_5AI|B9>s62WpfGcK+)u4ECL~gKPI>+nRvvCHM1>U~9KmusUDndu+5TdpaW zlcJgGL?o$Ji}UdpndFqec?D)3K_q;=t|Indf1IL;8Q0;Nh>Q_JiVoY`tV-O*L{cip z4(n_ILe!OcXjAr}O=sUh9}QS4en+uNc@avT&DsaMJ`o=G8E$6 zbr9zf`E$c)@wc7xn`hc3p8sVyQ{hCI*$BAaG@`@)ts*br3`P8uVb`%xdp4+I=coB- zduchZSu40Vzt|=KQ|RjcIZXkj|epTZi7d_78tk#P0$o$AzImPFnAmV zoU>t3BclMrD1B%(A9`|Jq3l%QarHmzGXCw!5{II5o27`JJG=L%>Vsp4tj-Blz*53H zszGE|k2PZkzL=Pp1Xbo_y6U-<=giXK;o-OP$5aAw!|+5*nTZZC=4SNUxh9}`J3)w7--dLnnozt^1jDB#~m@_}=JfSm0AIcGdP9RIM(U=fCk#9>U0 z#>7jJbX1rdnl=_$(^9K!3q0B9pp3QC>W@l{#=)y~=L3=^4ugY1<|d{)J!>g!^O=a> zYO-4aDe8|{B$SNBDv}ts@9U%W0d>*&Z8+Rp2K^&Gdr&O)CXXdVwAZ${*wf{g0{g6~g^a)VH9X8WN;k(ZwC!v)t8&)yD^ZQVoaAoJI>Rt&+k zTf=_Cja0*aYXN}h<{Zsx(iy_!uAQgqqwPpx&FWLKw`FZbMO*aGB5Mc?|eo90U&nmHZ4*`0>r2GkEbOv!9; z+5Q)ZC?r`z%2dEb6hHj?y93OND4e7joNcv{xDnE$8)WvZk;O8=orDG{pw0v}BAStt3H70*{yz1`yiuIhB8q zb?>}!)zH+$V^NkpB%ov*w6;flEe;|_xDGBEC3ck9hgT8F31!q_1(uCKduHcTs$eUi z$QfndLv21~>{N5yhNo_y(Yjqrq7IUJHt<>ZeJFCCua|cJi7U#T{Gw2F?!RN6r04$7 zVI!Y!a9uvc7bK^O?Ui~P>-1a0qGs17Q7;XhQ&Q>j;!;v zVz6UjLV{`NVc^ib;JuD$F~*%OUuxxMw@F)gn|89iYH{()7E{!JWL60x>Ak!lWGlTFP=; z4liJ~bzos*|C|^fw^b_~?*}aHvxdzpCj0vczu~T1!fByV*3=REYok1{LR1nl^%HgTKJn5yM zXMxGw?h8^KN3Z!O8*ohzr^EHoW2W6+5AS?k9?ldK<>GMB`z9bZmuuA=;7>i@{5$oW z$E5qZ@HJXqkWY(TrKlh71HVY@mgddS@kXO~2bNMs^NlbC&P{7OS<7Q*&!>R9liU>h zTDHr;JKd6+;PlGXUj`t0eNP0}+%mp-Q@Iz})J|T<)pd_`{=~lLqtJ|H?39^qhykK?aW1zm?}9hWa0JsXXVyca7aaIvU%PIi zylEA<{bGVaV4tO|s)`9SZ4ujP4GBSJPko`Nawco;?CAJ29Ge_=58pliR#v8HW5bf1 zl9H5~il+VfLlkzYdM1%IPI3Z97+UlRe^SR|@ZU?VZY8Azf*O-dbxy6QSMmQ|?M~`9 z<=~=pYkc8vjVC^|(xCnHs$lAp6zjA)b#{yW#nO7lV zd3j)aVOCZ2d|$>iDJhBOR-ZiAk{Mo%B!$F^J$(si!VS2WJ7(>~GSqdZt3bMQ*z|V0 zFtz&X^Dhh-vp}0k-s6;G*(e`s2;y6LdEM0mgzaM{Cv}-wSrxv#gcmvNcuIhiQ&aih z$G;zqkB-6#nUvvjUE#tNIe|YhqES!f8q;`}!Sxr_-Dva{Ul>k^m5Y|dEUf>;UvlTZ zHqid~Jt!a7W5JDRF*i!bXLOr6<%+|oERf)zUfYl@r&U6J{$=V~2dp?Djo*&*lS<#lC;ha-F6 z(*lXuaW;~Mf*raS_1*VXvU^0bIc^+G&igQFpH=0SU=LnXkO`CVjXOWOx-(Jinx)Of zGm_@YLiuK!pa-LCt{Qs(+2vlfFE26Xw4$o`EF9g%7!ciP@ZEH~L{w6W^Uq{MpBiT- zM3}q&>*2{Mp=xj|@(3R<)Q)DB5D0_={GfA_dh!tgDPdau+u0T_(|hY_dGH5$D0{b? zwTXU6vMb67_~imT3ihihAZ>gS9Sd~^cbGPhp|vjnEu;SsJY>eDwt(2b)5J|cClnBb ztj;fWR(wX>(zR4)TX`AMuW8fv&9CTN>vu1Kn{KrC14iZw^*MB#P!hSmxBK2~bf?}+ z6(6w>u4w$mdiawMI@d@^~mcrhb1KF}jZrQYv(Ag$K`0B@Eo4WTun5URGX(7t)MF4CtpMEO znXc-_;e|;BO`h=dk!DPY(_EL*dm?^8Ib$&jy3KEmVrb?UP_uF5S=c4|0{tD!}FzR_uOCi_3JNXWrH?BlarJ1e0FPFTfB^ZJ{v8MpW7Y97^o2S*q8H(j6Jge zkRzocdv@ru%)&2XnXe9#F`pE7F98HJ%p<5TF%Uc3>24ny%^eM2;>F-HtmUH&A|ED7 zdyO-9WBud-M3DJ-YyT!LEEu~Q|9v0_RQMa~f0{sOi&Vbsi(iiRp*H%Lp>Xma03_ zo7|2aB)2^XwSjG?XKaBr05>{c{C4XB6b6wkgGYh!Kzk=`5dtu;RLyK1IYnhEEy{u8y*-}#M=6u{_=z1jQa<6}3d#4xh5qBAfs z+~;@N3n>(geXgq`_44xC*{RBHn>Xh>F6y8aaiaJLzPJtKjmZ~4GDeqEc{SM}q%keY z37Z*tL7?>NlaNNb-|qPtoBMl%%SR?kbO#D#%os*|;-H-B%x41i2NBENfiL1Zm;hbW zkSe#(#u+@@sZOpKqf^W{f54mf^nxKG)BrA-bRUZ5zRIKYmo-F{Ns2ga?_EoSpT*x7 zyj1H{ARmMAWk}{PYHZfQ-t=9xnyocrK0)%d7}V<^3#ou=z2#0K?GlpA%*^MSnp>Yr zK0IfB$(aiMQAl{Q|M~OhrLnQorD4M9>AN^u$tlybUq~O3`T)02OpKviu$lT_(T#5S z@;9HkpTU)S9K6tzwTF766SZ;Ad(Q;4lcW3wz+Cm2*6VI`usvdHt#h`Hf`$`mq0Qo4 zyYjy~7Z@KFz%BJ|BdVcf1BcJRlNIrvt&2to2q|w_###Bju&{7HEaL+cl`?$Tqsvvbm3gG#HkPOSn-b7Mwf33@J+$L(owE!H7FrLO zNT1l(_q^lMSX-Njk&)5u=C8xw3#^e0V>2^XpE}p9qIeRegVjLMSr!4`u5On(H5r_N zG@diZX-TX8tmi1y54PUdw%?JT)rX@LG=Ff}+@mIVFyShPy)NUKpA0kn&tqB6_ zt*XWZH+jspKRz$&w24uen3zD#MaX6Pi^9I)VKQ!5V_0}NL|$Wh7Zw&eP&qq0dtWL| z)Dj}-^q!(tGydGl!f_=de=n!)t84f)*GIqdN4#;+a#2BP!?4*%e1s680XTi_>>nUn z)^x1-YVhG!{C{A`n%nDc4xOT?`wcEE#KejjJp-#OFoU%{QQ8yQFDSL#eer-lScV`x zP2CGB8w~ENf)K|ig6a&sjN`IS%&;t^ee`3J3<)Bw zXE}4Y+0Z9%4Uql@=n=q});jn6^fxYK3^MOuMwZ4Evj1XEpa;=D9Kaia0Ckc1o?fTy ze^H%ZP=F>(Kt&bv@gqs`2pb27>M_pqz(6VG_;)Rz%SJPC7-3Q)ALsKZsh*cOG#Qt< zI@oepf0gMe#D3HB=c7jprB!oVn~W4dpFo+fXHHM>We3jq3jX~aOT!b4yXX44{> z(<;64xwyEn9RI5N?c2Ai%w+GK(Jvu7BXf-6;vc|8-$}eEv7a^y+gORR0@Oq<38I)>{PvkA|CG)$jJ3j8= z%|-=c2kQ^ej^Qb5$S@-E5@1kJ?4BOpq#1(^ZOw!fsw7#Uk;U&{`;o>?h+E~PZb&NQ zwxxA~24~{r{B=s6q!^MxaWb`}tfKOaHN_xMmXQ&el9Do?bgo7yMZPQC=R-z7qBdtz z4~X{XS`=ah{Dp(8$$qNr?(0oMZ?A$_tG=z6x8qo}+-?pbF|ZFN`F+ut&TMT1wlFIi zf*S{|4nU+T8g+FE2DyLxIdpT^-~tdQY}*gtlk3^a*1qaXP@uJ;TTT-#JK7m5U@Fr5 zWXSwggX=ms-}1XJ9lw*#iQy1KW9 zhIvHp_G?B0PtU{zM0iM%G>Z*QXvwIEwAwxeC8j0h=F5p`Q6($#;kVsae7{`ebxm^( z49rY(W&LS((nA>+ZCiQP^2QiY=QM=T6S>QqEA{XL`hYjNiU8ni51~yE^a#x?@TJ-0 zNH+`iyMp4ydDw|Y+TXKlGu@0%b3(|h@FZ!0d+b?o3skccWhUzskj>9NUI-SJk5JIpMn|e?|)yCuOUcTl!*&= zQ`_+k(&kE=%0!6URyHJomCuk>tT!ql@I?ggMUujquc2%P%1ohW+Lo=3BS4N*^q8#} zQJ9I7(zwzlGC%D|KKWy2I z3>zvG_{t)8``|7wZ|4`T~0IoT9FCY{6%bK`K$>EL^0u)hRP`GxRl*xV~nJ(9+T zhLxF7-XNPZ!HIL)E0OMS5#OK#VY034&L35xQ%puH>0LHpYz^rky$Q5?-$}J?_};+Y zRZQ<$2*pTpxs*RdNY{z)dm@?~VZUZ&JG=xiU@rp*EmW;Z;H_-1j~`wgOV9n7Ozj;` zLyI$GNP4LXd<8dt-OA(-na|u>58Pqq?|PYy)<{yG;f|Lm{v4@8) zr4Dc7m6;5Ux=Ycfrl!z8Y1*CK7ZtGziNvJij%nAkdu#N#%ovdm<&`^p#LU1~4W*y++XSJ(pR=;$89`%rHf*&Mn*Znj zBw&{!*z)2=z&ks6!4#G7iWbg8(PBQw&HTw40loVnH{xPgh50XQO{eY)@Z6 z6ZleCs5IIJ)k87xp=F>8jga!NWBk4_RkfeOvn3gskf^YI4pN=61{>*0grZ`esNzY%@4o+_FS4^+l2`6*o^^lvcrV9ZVHZ6) z+SeuU`DeLRn^mMz-uohlmn6R*dD9^bE`PASxru8(U>bI@F0C*o>4ygQQ}2GmCrBxK zc6T3n-yy<=geV1q%`b0dp?-2^n(`3sxOKL^#N1ZEKDQkO=sBqcQ;>@eRV16uDB&9W zO~lBtHh{=kR4j<}2CcEzS-{N0Lc#u19E8zJN$ZBjc0I*Bws0oj-m3N63sL3B1W^SA z1$onwQ&aD~bMGLfd@4xkV)3u8ysQngF5tJC7=9+Z`_~_r67y(N!SA5rvi?YtbX4of z#vy*nn#YZX*&bMQsm}Ow<9L4kFZSZ{WLssrX0mU!^T)6|d(6a;Y6%rf@AFczkg>{%FOWg-y*)2*EFwHH^@ASjrPiOeaVNY!weOIDq+IO{?H2EzN~?i+?R!7%=0&`uq~V&OwR;rvNHmKzjCf!x6f>QOQ=sSAsiw;W z1m1FE5QjXvJ%J}e_%arl^3^t0|0GfO-2M{|>}LdSP4i=0o6N@c_WDMDioL!4ib+)Y z#O~T$`+0TA__Gjy;ef;lv zQo!)Q&MQa5$2R_>Lb^I-`W-8VLWj5DQj}wXGz+ZpQS>o}oJlu&K0@{7F($5AZuf_4 zczh+iBq4~Ji=s@rI}fj@Dpi^rojByLERL!9A;u-LZ>$%(-EkBhY#K@INbXh#sU@KU zdk}M}+ZP}O!fcVQQQ((;VUK6#3b&B3sb1;)yPr=5md+$BObWGkQE_o$>LBYgEiHT@ zs`*z`JUl%14i4{)VJdEJZjVl(CBxy;l%GGoU}0opy46`zR#IXR5}G_b`Qq>+JOA4O z;P1fJb}#NIpkSY+my#IU_z-Pssr#xnEDja__j&oByYab77#eE9 zkvz^aCzgVa&zRT=Xf?2Do;RQ&b+y}S=fgR1;9BQjx&~YZN8xuK9#3c-9qPOEPf}f% z1px3#jjzAN_R*2;?dFXAwm1;zhft})Tk!Dn^ZUX$6M%YiJ|~ApJxd4^+SOjD_9sA1 zq`bF7ouQ|k-sKT{2L0X?Mp#_!$Nd&JM4eJxV* zt?ion^>j_adW$=NHKwe+YPd8nxV==RoME_({PQ$*E&ZX`-|kYE%Ac}U~M9@NpOMc=nz~4d2{18(qyL3IffA0AvFI6041qrCMaFdq>8qpC( z(Bgj@TUTD=L~|s}6Zx47*xzFUW)G)Ez`kjHffva&=P73d$`zq{_$9=}B36WIj1Qlr zd_&y5>Ne{bG;JjM)Z|vh0>ZeXadLxhY3-sFLsnK+9(YYkbYq}=W9&U^6P4h-==$8= zp1nvT8$I;}TFKw!c1jWw)aWp&#S1U)2QjYaz8`t0j3k6)^SBljltaGMm)uWE&RY;za(K;hpXi6)-m8AJ3U==2<<||>Nu{;3ppVGdvJdc^j#W2 zag$cYKF2ExbweBC>5vke4z^%=eY1pU)Ict*qE0R0_ zR(FlYob*&ua^40Uez-bWKlo*-bd3L3yX(WNsv&G@pF;ln2^7Dg?Er$uAF^8H)m zq-K4LiPokxUmtAOC`cc;`dZQ47yXQ{1k*O5LHIoqUu-8m8gYX4up^9sa?3(nundE- zjrab{T);dCakeC?Xzh!}V%~X>HCVqK0qn@#Q1xBLn{>U7;efI3=b9jkwOZ?_cBVEjbCh&<^{%lXQ=x zrN>jYqlS8)6WG>&6|S#k&+{sCj}CX8Nt!{8JiXSpi)p=mS=dN;&CFuI3hs^GNFu$# z%UmM{vC;&T42UQf)`QMPf6=4%7~l*Fe84oPK4uK;#X28gh$TSqpim9 zzGS39PGNrS#7v2H>-%Ssx4py}d@D=Jz8!Gv+0jETa=2jS*zQsI`alwIqn+0qYU)kU zY*OQyHL3t>qUc|rEIYOTn}KXx@_PbTbjAiZ?M+Wl8kTuLOidZwt?26LCvSQe1L=(d zQCMp?X=@G=H#Rq=Av&{;b_n54FgW2vTxothmxO{mcTJ&AH5p_(zx)P-^fEFW9CDO} zjKg>UZb0uTo$=yyL0wz_Gzxn{!L{MpgeMc!^#YBUgIS+F0S0f832a-DVhebw)7CHPqKmYRIe^`r)X<)(p{5)hT>$h}~?H*4-xEW9oQsBA$ zb(+PG-PX)y*9*WM0uSsG$@LCl|?L!LDWe|OW@ zM$Ou&hfsUeA@juVxW1tw>He7LZL#cPxNO*;kD(XAuB?2);6Tj?mjcyX3!nevciQrX zkP=N7OBi}35&@^7;_Vmum3_(qe8fA3j!?3SSwJ`0vqR*7lf(T-`(6Y-xs@*-%A39= z*+5N6TyvI;8}j^M)wyUqgzbe^?L#=pzoUp1-nn+Gs;WxCZ`t*^doDUU`X3c*VZm_Z zPDn_oXbz%2^%rOC{~mn1`{#F5GR$D2`1Lle#QoH~(Iwrs6AT6Z(#CB`_OW)OV$30W z+INknl-e*s_NJ#^>p!Tys}_xHTuX|SKhgw~;q>?hMoKil<$hI9WEcb63-7G*GSED@v8lEgW2YNH(odaIvXV|PvBmCHFYot%+ z0x98jydD22=5`7DN_2I0th}f@)&B70KhW18@5pc{4-@kQuW@d`z zSJ^Ww$8Cdm4YQH*cAjeT7GG3l)$6#*qHzKQNKOxW8_2>ia7JFCtXKe|@RGngc6cc* z2{{zk!W&y#6-ZSHq_7~s5Fr(BngqE8Vp1;BLNNDUAQ8h-v7ZtlS`&mI5vVp85-_{X z$@U)rR@OE;^&v3P;h)fp9a4NvgP;fQkXP{d9PKe|QJ*}qg5Y|FkOPszvuDnSys0nv zEjm$|+1QxG#4>Qq0m0LT(r1N28XpT$bVX{#500lrys+MN4scR8V{>I+H0~`x>f=d@ ziAu0rQG8KC1s1;(N4fJLn@@IYLOb_h3O?)#74G*OB+0`d&?{4l7q6c<Z{oZu%SZZa7d?`nAjIVxN;^x4|x0PtO91*)(sfYmNkIY(Q$( zh5HH6(u`;t!G*u&b3ZDQWPft^x*3UYkDzhAru3^9;%b54A92WFuHccj&uKw67Hnkf zG>{8EjHD6-Y}wgdAEeJUbaz*XwQKCt^A_F49R0xd`?DI~j@xGb_4-Xc^}v_pua{={ z7t7|y#R=Y$MYk6Es;ZCMZu+Xx0|zxH_p5r|sULA}0$G(K!$MXF$`4EoTbDkk_J74I zzB(BH>xHp+3Chykx)>{KSLpt^QPRdO|752LlIqnRqy5>}+5%pN5tEA-G!0vmN1Pm#s~Q&s$k=MgeWtxLbZq04G^A0ik{XX7 zw6Iij+uQ`;iux*ry^(g}8p>}cFK!n!MA2+0t}`U!3@4_k2#aXec1}9vWNC+-~L{hnmBZ#b~gF*%gSybtN)WNz4GV_pBQYJC(AhyZ-iqQ z$76lcPh9Y390Xfo=3(mj4JY+s)--^ykGDdyueY>DQ zz{4U)q4|02j}a3PiKc8HwNR07PkQdmw!pxbV8YJpW=i8JNvohYJ9^3mHVx3Y-N>U^ z{QCHGrowKkwvj->$h@Q;Ew7Ic6ZcDr)3x^I%^#|`(w4s5(kN+^oEr`@r&HDdjE8t( zJNo?qY9*)M#e2+fY8*=R6?y>DOG16Z-upENxyW;-bM&iBx%>Oy=3p_!;OVo@*F5H~ zhr@gtz5H8kr&rH3?VSIBe|}4RQu;G9`|k9^u)Kgkh4;MO{6b~}L^ZN$L%ZE^n_EKL z#;qHOb{j}b3CH05&el25(>rl-JVc}Dn<s(%O*O12WYOzNeKTwG%;Yv`@wd+I^S6f8V}H-R zT<=d538AOR^n&3v@{XGgy~3VWMrT2zAl;U*kkgR$n{1YobOH{{mc3mvrTtZ}KgAid z8yXj=S&eV7ZQq0UC_tN&Xc||J=V80`ygwSk5Ig8ycQ^cDRzz_(&pF#%b^<}7dxtDX zRz2b|ir&mMN-XAiZaRp^&eBuQKvE9U zwR)2G#@kDCSvYFp*NqBcyxg3kqUo0uXH-;eS<*3Fd>G(TVuScO5{JMW_Y(@c2`|kk zoD>g`)^6U)iT(*LuI|qdv?P=*_ryu7B(X?2D94;FR^un zAhZv#)EL1~SIGt*v%K!7$e~drq;fsQLv7Di^KW4D}p7-LUr^?EsCV0K@q*W zSMci_zY)45i=igbq(9Fek(D9}?uqxA$Pn{@CQ63Zeho~h%X}llNg!aAxp(-r7_BA= zX@z<#r=4f=hoDH79@eIt9OjQ=ULv{{40t2;ko%QP+)yb8@icYZG*o}cYw&IY zsWl%gafT0>C!5Tyb2DSS5JJr_UM!41-j$WfKrwpx1<4q9#R|~sxW!ua3lGZaeD6(P z`mryx&v{Eqn#wuopIb0fM7gNP>{AleV_|vm1&4dmx^a-qNs@(wWi4?jmKx~(_l?ij z^>ZH*?P*y#zG#%TQI-@wg6|@o%y|3dsU0?}o#7}qsBq|(L?GtMFyup>8!W1W^w|y> znt7M6@!kg)nEg2D@699o%s=@A*b(LY<26?QJV3%PhX9`vax8F1di*0!#ndW~Nsvm} zhJcWQadc_XXwQkd1FPv2JejX-{y8VpFqkL8$*sG4N>D=a`YH;t{Y?xzI9c0AF!g#t z-JlPxjE?Fdw_PiESw>#N3R73;nA#7igH#FgnQE)ZZhy+a`l*loI_KlhPA*=bqWHMUtE#A%h0h!({-d7n-w(&wk!!j`3Sog* zPZCJDo^o`Y=ZGO<78vY$!3-DGD_i_-2hGH?BAukwgtEz5nzOTor*D`r0Qpem6K=X8 zs=1_7B$qt5J9Phq653S7gS;s0Lh zDYGlS3*8g%FsN;V_@bX{S@>MYHn0qXNIS^Bf0F}7u|`k9GCQ6U&=6AwmGM;xr#$_y zaYf8H|6HppyqBM}^A=|*vtuAXXsZT0&6c{WkHp4NgsBs<;7~BWG@fODYw=^11Jh&a zVSvXKJf1YcFTbBiR-(TA+ zU7mn78x=%IOb6-s1nPn$^|k_KVaC$U&^4VD=pINW%XbIO1~pXl_bY};3_lvHbp9#B z)Gy6Dldymm)FZA*yD=G$-n`qnac_N$c$X&K7cNZOvmPzq^!_1rC&4!i`bGHh*u+sIfIsxUR+ry9IR>PsExaCPN*#rP@Rbsw@2p7{ zCD5e>VABQ1BfH>X%Wg zp;WLFry-;={wQ%8z>5A4ThA6;G%NKBWa_p#J#2zON0mNOAEcNKU%ozUuLO;S9>4Qb z4$vH&S-%=WdZ!W{nv}nIdVS$p9s_Neos%yrq8~bZ+(fh7k#k;~A19ue3nV+CxTTOU zEw0qG|jz6#on5qNtw?jVAi);&maJ3_CVvqR5TQp_dU2v+F((eAhzuoenpFydq({-FIc& z4HtH?-d0V>ouDl~U_sh&&^>Wa+*M48u(hP`AkJxg`C37_LmUex@&NsRRE!Y62or?V zrjx0@&kk9lq!k>-zocGQ(E17$mcM*|()1!(6X|N9Cs-M1Kw=k_HAPfk9A87jxPFfW zq&65M*B^m}*bc3w#l<{|wN6saw&Gj1s8}*YI{@ND`b5wh)Q(8Sm+jUS9t<<;NrrXY z`R*&!&0x2pVE&_*{@xa-^gWN-U43>`QsEqpY()8aFg*0y(NT~B4-4Bvy~Hk$(9gcC zo=eeOC=`N97sgAza+i=*HpM&G*$9A`{=znuA9IPeZQc* zwo-}Rx~Sw~wCzVk$5Nl7)hyLAZ744-^U9nEc}hSIDczQFuoRA6a>b+F_z|yYx-~Jpx=VueHL`nA_TjUJ#Y#DoyeNsC`mD`p(gHvLt%26$6{JKPqjzr%1kr!$RZFT6 zmcCimC$Enh8&u>gu`_#eoD&s`cv9!+h`#QT%DgD`F^ae48?rika`};u-Ln*#yu8#+ zsG&iR#Sz|X+>#tqmw_7tZ;d2}M}EC?1ifQoy9xAgMk+FKB)h^_9{SZIRKB4KT6u@3 z$6!}hYemWJ^8NAJNFz%814c|)3SeDW@lnLjd*{h0D=Qes3H6&gxLW2xRFEbHHnDVV z+@N_>U+y~j+W>GfOHY94!aaXw%~Swutw1>WD+=S81pI_rk9YC#KX0D$juq^9s#^Sv zD;JfVkr60%@}Bv2NVbi#kL_pXrJi3`BohVfGhj3ivmErC?jh}?5I9?1;sN?Us|_$F zyttuGbS?QIhk$%bv#m}CImpMykdYH4^1DK> z8xRd0L%oz5Bd5yRaK0eeC#JkMSNKp??)tLkc0+Q08A=EG=a>Hx54Sd@xH__~zUJM} zTcH5AXZc%))w;v=XV{b@N;++Y{W>`WHobwI?5RlmFHM54&F*S0t`udBme1>6148_`>b18n)a2ryiTC}{z@S?E@84m2~pAI*#Mj(iYD0UM$ihuZf`mA=A@ z4{xhnNGa!`Pse~Iv>H=zivh^{@siJF{b>hUpoJ z=l$NlzsZ2Ey1#uqtNE^%BKg~*4Yi6&vy2Ig?-L+2*B%WvG9a|J`DcG=^hN0hg6zhYfzZn+A+gtMuUZhOMPv zzqW(Wy>QpZeQwN-;9v{d%b+fq5e4eeXR3tCE~*yXndvFQqIQ#mwOtvM=%HV3Z<)5~ zM3&jw8*jRHYQZkYK6``h>}SQQ7wqIj736xwzZPeh2%zf+3;Z6hFm0>Py|o&+P)1Rn zPO4SB7R_KA>Y`h&?u9{AG~he?cW#N2C%^)&bHI3Ph1;p|W8GQJbU%m~_8`*1nEBI= zCzl^D@(1lNQ!VY>(7pI=_^lZHvE%lw!Bt35z7kIw=i>tScs;c|mh7a8(AR&!(3P^V=QZ^~?+R0HubQ2L4#v_h zo|GtN)ApZxXR38NnKeD^A0=)g6J^+KR4}X-^IZs8Gb?2JugLkdT+@%{B@C~cdTtEN zadu>k_ihoyppKc;bmfj5b`b&1$2Hx!$?E>Zwp=fq!YWU$o7>}_7E8Q6KddzmQ_Y`1&Q-r%P3_dPSER?k?)To41z*5@FOQc+oCREZSv z@7EGW_wGqCp*!)UF_0~Hm?TEXyGfLpY*`zff{%Gd)&gJDkO&{dNcQo5ZlRt$^@~;f z_?Axs3+`AFpAQcAvzn%}mRF!jjslfdPDTxrTdSgU4(|MZ7s-sj+rc;9L-5)Q=1nTu zBw&d536`4q*`pUI>GG=Kz29%WKIoI>&{4ledl{#rvOaeYEgi&VH10>aY#WEoJAB6e zkXb(Mcj>-Wgk%+ESKkNY4QCAfFs!JWA!c(q(TDL&Q%ubAU(L|Xi#;q7nI}zsG}xvR zf&b{N-ao1_B-`O5ZTAZn%f`3i-od;sael9X@z&x4R_}YB9TJ!;EUm&b9;>&P))(0o z7MRaujfOBt1f9s@CVC1j7%_jAZ0$fac#(|38e2Eh*PH{U7?MFKd^otfAjsq0@)Dtrro9s@ ziYoHinYi3lSUb%ib_^td#kILD^{*I5r0j6*~fLE_?++5`_Ob8OrBorh?6Pq|rP7A)bOPL2EN6RX1 z1?(AOS6muJe;jsh?NVpejyU$?w8I8ShSM)2^2su}&NGAq%BqXg=aUgBwe-iORLC6p5!ramM92VxqNX`PKI;bS`xNOX_I|q_B zUne{*EyE!;XNp=x($4z@?1MM5dwb^%IJu+KET3Qe{iX2rM20JD8CyMB#;mXsw-+W3 zk~EepgS$PTLC{-gx<25hwQ!e!#DJMz!4ZctiC_G=YZ987*-e%g_7Fb zM->d24b7n4EXotixp+a+dTmz_X&?k+hE-Lh90%{L!B;vcEfXn5`yU92e z)rcqtuM}t8M1M8$aXL7Ug%<2LOn0r=)8f#NpN^B@ttXDC1K!f0ROr_k!iZATc+6!k z=duw>u%25i64wCtJEFz~(UK|9pdWGmZypm68efX!w?{|7i z-C>w~wf*&k*yzY%IQ=>8kUpz1EFwCJ22qAaUfniLFq@v9HU*XhD=6zW&;ik&m)Js1 zgjloc9TCI}wlYJ~j3ZE|ji~VEqsK_P%m08_MAmn{QV*f+%1F*2B@e5N@XwGdwqaNy zQvLY(V_PcnUr;pQtD<@1^6Z8OG`S*OF~pi?b{2c2K71eFG5mO$)l^vLvd6S^GKpI6 za&DgLQ4FBKr=e=!K!5Jt{mE|l_97#}A%vYY``B$^v@CSKRXhklu|cdnlZf6iC)dJE zX@36)#qy{5sa>d5{5FMcz?v}+lr7etpGVeT2H;CL`L=XQzT#`3q-0_>NNzNLi(5`Q zB;tI{_Uxv()JaU4%x1J)$JeTSf3EZDpx)FkE{*F(qUEgsbM)VD)wBdG7|`grJtZ}H zP6VS@vN}TX!KpmKvT}l$7s=)u06CO`$UhOmdoq3RQIM1@DgjxCuEYAg$ltXSp$h{h zfSsPJ;fGTwZ|Xk_ylF2$WI8{J#@0c{0S=RE%Kp>3RR;61EMwmfS3}i5rj8w!YHz$> z$|&8C{jj$KZP~69?;bXw=*&3KXw{MgItNbq%jTL>z0OxZ2n;rYCiK~uVJxf!5GrJo z-stzy2(rWIbV?VF$-$0o?K^%&$6g{N>!KQtH~lB(o91WtyCw29@M(>yf4~+|oypt$ zOfx;QY5Dz8>0J~B)wyTy-ehKw`gVi&ZnnE`74f-O`e8o~ZJu(LERB_H@e*nA`*B&O z-l!2f?Z2`^jr?+%^lSMUS!A%d5~dIVX)p^XU8Y5^Y#SYn1VMDQ$TPBy20!$OG|*60 z_)0qM#?Ux}+xN`_axWh~CRGfyTmnyt?yr4$$0CoFGdnL9 z-y2bj&i$Ev3(;|)3Q9F=1IBc>ojpt-YTq{jZQeGY8@d> zT#WrCL1a9fyI^ZE6Ixt9dOcUBOK(EO$e>LP*As@|z`pJ}`R7G+bnJUFyk+ER9;K@D z|AKsvQY@AskHi?h@QTUko7+$H+vIG~1&MZ{^^jzUV;Z(mrE~S&-xMP@F0Rbdb-=Jg z@<}yr(eP>Z&xF2UZwRgK!F^rxnSHcY7-Q4%Jk+2*L(@-69@C@J6n9)ui>rk?&|}50 zWUS`cxP&s|=^1q2jhN z?M|z4E;fYY>{C(LKhk}HI5|@}afNO`&(DSE`A+3!2pcBStoGMdlsJY=n;SeXn0^Z% zNb%@7YXtY_o7QIMpOo_U)_I-1mN=i>$UJNzp(Z2~efOtgX@;XTr!%sxLQ2gnw^yRm z)baz5LQL&^x)0FeE-wE_M{#f8rHTQmevILMY`F5@1_&l$u27uRy5D$g&i1ATSA7p&n^^1=-b0i8*M2yQ(h9F9ih09KEfbi5hr0 za>t)E@1N{M0WDFxwe_b;))*gsksgi-!Y_gM|4>xu{|BRbp~ucr?o4O|zCL>#1aGr{ zUN`(R<)8&rj6NKE_ciije9bCL`@zp);-f`br34G-ST^SQcS=JByZgI;BwrSdYEHM8 zP}tTK6=tULXq5^JhAxvyD0 z>c7ZU7^otLqpZm{5^vPmh>g}Yb%%-3nRPG(39$+vv zE5t+iim)h`?+DQy&6d_T^d)7eH~(gNx#EOJg7)mHeLX&_ocs%&mc}bhE6pj+43VoJ z8wYRvT9}PIA4N5qOosaIiS4_)oK1bf+(u|KI(X}>Wl(LK$XnZ&H^zO8@vk@Q3>pkU zP>aM8k(2KQNX7#;h)xs<7A^7GAJk#fxCOe& z9Lh84k7b(mkbx-UXIjEiBmGr{llWAI4X!lOvB!v9l_EQxtYUvU-2{EY11&v=Wewh& zMyX2ycM18|@QeY)o>@=m3gqQ~JRh}t^Ki9gXSmQJtT6X(9S^G-*n88UY&?Y+%XLuH~Xup*|&c=YQ62gjlm%pMD7?BrkhfMS~hn8*`Z@` z@gUaYND2)fnT9j^i}Ui%r|#0?yO^l4m(@hgwN6S%8C1jWQH%wlK$TYWB@lESw$xTH z=!MpfkI(4HIkFw0YoRJg-1IK#yI1&v!XPm&zuR-Jje+#y)ATg_^s2Kk-^H7|+X2cH zmU{Y&C>J+3`31A#XE;N9R@4FhJ3C({4PkBLUhDVIbhDlHDUjKSOuq2Aq3~#A9-LG8gX?_9-#@wbtfR@ z8&=myJi8{Wi1365EZpz_jlKWfW`&H8t@f{!4j`S05)&7~7RKCgB=hK8S$ z#*UyK59Lpg$$qyL7v?x3x69UmRa_4_%t3-a`;bFO`?9mQb_M8|bsbIHka*|Vosy?( z(tY{SREzfD;Vka6*ZOboo{ZL%S>Y(EyNitndxwKc?{d)^)0K(NkEZ4Lb`;}}{{CVQ zCkq!3>7_!i=cQ0If9C81@F}-8^Pug+FP>rOF*j}C^}cpQUrwVeA8611@GKRZ7vSY> zh6rHOkeCA=!t~#8aol$m5(?=zPPEOdwQOBsYyc!@8!3l5V+CRwRjO_7hBAf9{p889 zK|(Pz<~rvmmos`_>Al~jV5v&=tZP=BE1=$OslW+WqI_#-$Frb(Ep#(Y?ZIWZp!YzZ zTLFY&DL=XJzPv0?7w7+XrV#LO1O5{lE+|b5E!ngA*_i$BvZdVb+`z-XWOhs(4&;d1 ztwuC;QFMlW<7Plds#l-e9wk$7dPD|FpFL-)06Uontf#6qC<(DA+tWd1_$cgAa_vIb zj5Y!zQ6Fa+i9@1Zp3eUhq& zy4rGjJ38PLNKvr1=lR`HH@h9ROigc;N^b4%731Q?Qat`9kTPk!N!&DK9AX6b9)-CEM53KXgmB%ZjA~hgUhQG7ME8h zW_yNK?fKs-S9;MV1I}A(Dxhz0H|zbEL4Re&PyO8#ok_pc>9_^ed8#L%i(#teOe(M4 zFw+Ba938AAIH-oGJ2+W;i7uH}I9tOX(vBm?vw>icGBHwt>k}<0@_*no=`R`Qp`76d zBxkMXd9r$9LgHh2M#M_xI%oVn6@3ZB6<5+{~u$2?)_zZvXqs6SyfP5Yxa?ETc`!8cUkJ28@G`L z0opI04z}(wew!d`ey~CgBynb`qWm!|*U^EjGG09@X@vdfNx53NTXKEWhd9!c9(n-@ zx=$!G*bM=D;|I7)H~ma_M$F|4|N4$LH7@v_79o$_u-?V_>#* z+hvUnu8*Hl&H1)%i03XgJ9dtyqh^%66&V?=@#@4T6~_<6h(TW&vl_I0&5T+FAX{X4G`2uxdzjyehy7Ux%IgovF1#^XFYV9Lsy#5D_x2WEiyqyMx7r(2_d?*7yf#qUh z5uzBij4|Y+y#IZj+%{rsu%MukX1jW$Hh(_fl~6PqOtc3|F)x}AkDAz~0xFMR1ROCL zZZBHu%uay<`P2LJ%#215rY_dK?hF}7{jlKLyLp;-RaVWS%ZbNmlmKB@{&vg^fEg=^ zdUq&En;G+FdFcNXi0XJNq7(fZuXP3YHQ>DPUu+wx`^tHl7{oyEVwt$}P$nlim_2Felq?%Iaj+!(Rd z(o-l3Qz!s6iu1M46YT58o?0WX+q8#?$peVxk*l(wviae_#Zo$=&&hj<~>&n$PS?k(R&bMBV%Wct9E(qfv}AY9GDcT zKFkT>60N!XOPJ2gM&!Y)|HHd7+x`BpOe0yrh+74_+mp8Q6FR`ic#dm*{oY{z`g+CV zO~CEtYskc+WW-GGl`948%ius?3ZL!tx4fiZE2G6D1S|dVy0i}NATH&v@gn*6Rh#3ARi>KnjzK z2ZJ|h%+%go2Kqi1XXLr;chP$Z<977c0Q6$m@^@jC*NVX4HGZ4b&la^4eK!RK3&Cp= za;J-|ztiPEMR$$~d=;F7d3<7$s+GF?0okZdbS{PTTUWmOIXE0eSoF(epWu={E4dy( zJN3A_XvY6Ieb3&~(p#L3Cv6{qW+dLl@5)gL-|}F$Wv&?Pp?~`HKpq%vY{?QDL7{f8 zMmor~>oKFSdlI1dWFV^QBUDwH$ESkQFZ6YS&%-BYi6)ud`}kXRKDC7ZMsQWWhX{Yb z-S`I-;xpX2vFWkwE7yle9vJuC4!hF&Kl8i$l!5)YIP789i_2dYm4QZU4t%6s`wxdQ zIOqZGpc{HWlPDfx69Iplq1Gd$4_R*ah|)LInWzm1=84D+3Fo0yK*((-KVnjn$pTIR z;Kz1DI8Ja768IF=Qo1+&ZVKT=^{9MHU_fZCOjCn|6;0T&UpzcK;nit-_Y68i*LTmqLZ3fRR8!ntFBf&91#lF5eZ}#*^X#cFVT`Tk z6nb{qA3+yFT_)t# zDr@=vB@ARfv?vy@^><2r-`aju%yS8H{Vm+m`b7O(b9ct(ufrJlZ@{=V(CGW8M(%U$ z`{6HB88_R7<8pCjxfNZvY(0hd>&LIYT4BdFX%JJTD2pR32K~q_35*GbA~2K?{~`w3 z75K>nILGLn;53aUNL{n)4fwjJ#t$OaX)AD2DZ_3(lM zg2K+29DASG8#f@ebskm@sxu<+^YY%t0ge3DDpO#5VM2$3tO%PlD0_me`TV5|Jcd8s ztWIV8pxR_}b*7V5lUq`nT~m^k*I0D8ytSGGDuj^>Iq(2*QU+y;b2_~CG1YhVbGOt` z?t)XxdAs)dk|bg~NI3Zah>Qt!F6Ed$uTH9X%H0-)?S#?PJ~-%HUim)e!)EiYCEA&V z+xx-Zv^h!7-IhpCr&d+4?~(NtAw~icZ+s_0?B=Y+au8Sip6jO%hvp<%3dk2S8UA!$ zM?U@b{5z$X7(`4dHoM-qe(rj5M+kTmga1hpydvo5GfK%GA&Wt1s&8nK^AGaFY9P^x z!T|LEl7~w5YO605O%a3I!uDTfhDZz1)S zCXWreY{)gYzVSGzs#$yT3+h59APo)d+{NG`!$%Anfrc0HGQa=y`8WF*3FT+`{=(>j zQpc-i)s-;>7Vf9tDXsdtFSwpbff6i98hmt$6rYKWoX`Dw0Z_(w!=W`>UlRTAZz-)e z*z-q^|5|bJ#g`lynFga{Bf>u}n6`LoZ$@LD$XaY$%A_+lfE?bA?`)Ho3Lf(7^M%B- z_V=M6{)c}SnP*Qd-Rky^0xylV_&F&e@A}f4S9U%~wx}}Y0)NuMbLbn6Z%sQ+H@G%H z77PA##1!7l);|S>I9m69abmWytvb21Ritla6}*hvh?02`<@K!2Y+NVqG?fpfr1Q{` z5rgm#NsrYs5-c{J1|Kg05))Mq4_)XRPo#kZR|C~T%K`#Dx4Zk+{dXrXwAtt9XWUFy zG`ytX=Ood+aj6$)vA(yLvtbE%x_|w|wkKv#>R^L|?qU*pzMMc9V01yJZpjz{AW85= z?YQUur{)C4hjWFc8v{F0zqHP&qKco)BCUv8= z2_DH5Mzetr<6@(Rv^KU*9FV-z!}8$6etz%m2-I@=f|#v_ z)C`vTh0WaETiI7cDi?p!vutLqDBS26yF%EH8UOnlqzN7OF;YHZRl1=0rQhGnYD$a+ z^)~lh_#l7%pGHvjlyy|V^`S>Ou|`lcY>qOX?Eg-1_wG<8Rz7#=qSvkDn?tK)S;fYd zw%whmMMd__#)k}XwK6_XX8GS~>&7`=ziDW2V(U!C-y8L5lL><>0O(JE`Kgh5jO z+tZlqgZmkz$m_(P={goN1LbSmK3}$bCINQ|SN{ty%K5`C7S}M0L_CgtrvJ`hZ_was z>@^vK%F)-828;XZSD?~v=bfvCSnmQ?fV+;KMXu3=!81fi{-x1EM$6mgin*_PHGTIM zCOcoOnwmM3;@LI+doSIU<@QfZRzuC~@`(CdcpFt`y@YagMglb=02rp%nL0bQy%wHp z^chIe7a54MBagyM=j1pM0PF;)>F4tSfU->En;_!tHtV?$2<5=}D zR9N+A$D@bqA|t?T_17B9kK&P-&4@$xqSw;W1#*((Q&T`9-)JvQYH4dvy!Kl&(3^qp z*L}buYHs${a?elVk0OB)Sa4(&oC5wYwKqogDQEA$a!PVi{>9rkSv>bIgr)Jc{03y&WXxlIt@clZ8a;nln{()>hoRVQ5m1pXz!4yR0VYeDsm< zFTJK|$LBti{$<+Y!;v+~#{HI**58gEP7ZIpj67tNdb>eFs%E1f+Sx|ZP);&Ij`@gt zme7*v|BZGDUse};B;7ng;6I&%2=TeO2CuK(I#SW#Y@T76@oK)N|M)i-5Xpa}OKdm6 zc$UzaC^d$juR&0Pt&NSL{mb9BMG-WTYRnbx?W$i))Oos3dKA^9lk{)1K`iX$<)A(D zlgLu=<@R`nICQ+S6xH_v|Nn_D29HyKC=Y|Y2eF(|o;e?T6`Tvv`ZEtZiz+d7E~XNC z!a!#tX0jp~`v=s(Ulk*KI%Ri&*Z(@sv0z;RupE9Y$UfNJci4V?;dy>)JMnK~=h0kg6+(XYOYh#^wqD~M=qz<1{mlQ=^t2-Thu=Z6Y}D0x z@Npw%O9sDdoqxlFEE$=~6g`TtXSq?;``0^+`2Q1);0ObksgoJZFw>`G7}9}4aV;sg zguZZvr6eC>jPdbH9Q=Eb(FAW-G_QPS)#c=a@tH>wM@Qxt0+J#itp9g6>mx!A#IB-& z0MpS+9eQCC$$8b<#bsQb=JWHABfn7x)W53TFUVr$Pft%JziZ2sOmr90ueY*F(@>i;n|KLf#wG@?kq~xMD0q~ zB$7jbNKuTR1~S8>=q}2UMo_cxB@t9i?a=PyaeuyjX0C#Z}wA@#Pu5% zGK}B>WO*Ya>g}DK(fRq9xHw$WSos}+eA!??$M~bz*jPA0 zs+AQJj0W&=06qm70|SZ%Hw^J0`CKU#6&$Fsu@Rq$D3n$voJLrfJVs)d8qsWZvN#)d zk7XQ}+PHwWTno5`|5U8f5w#h>_F1E}v5djs2(dNXpI!5*)abc68dl>(#M1I1%TA#6 zl$h%Nu*i?+QATHi&tsrUMEpwgYYphQg+)YOy?qS`KIwDrZHaNjN`tK zL|}<3mr6du8ltn;N}Vw59c0efxf@V_uSU>bBx9wSMP$y09zf4|+B4Sqgi7M2e1{iG zI4ND{+aTIsC!0GvGOu0{kdu?kx^Snaq`*liLPL>bNS{epCnJLGevE^I^SB!Y_WJc} z!0tuM&#zrAj)jGltx*&oAHU3F@(R%VMMYtPZNfR%2HbHP8o|&rvz~Y|a;EO?t?|Oq zv9U3(#PRWQ!1lW0`KG_W9~DrXGjnjrfkTs)zFn0%z{HEds_-v^IkzFLBHCx>!VG9K z8ee#fyQtd)d2}na`ZdP{o zbmnh2kdBisXY%l=+Y7rJX3%rVfol@`$Fz=1d#Ky#Q#nZ|F3U7R5 z6qFfvejpdGjEp|S#l=be?rCt_7@3#|Tj_j1N6Ej!=BW?AFn}cvkjTMb-`>6yQc<8V z?q~xmOG!-~9Un&m>IR_aV8=D8+3^8Br*9oKGF`t;!q)R3+TQf*F4J6&& z`7pk^Y8W^J5*2wx#i+U6gcnb>%QHnfYQedwYiUhTGwSK-VE|f(!9nF`O=LUm1LBVd zgB{ff{gQGwdNGkXFk_y9xaY?_Mu<8;;DC!9r7J7D#oge3?D^Of+eeRum^ZTACa zYzj+)q^f-A^4V&Kb#wj09n*(T$yjtevLvL$#KeI4nX-Zd=>A-V51!1oJ&#yeSk#MN z*8|d*!1%0LXjUH_OJ07yp4g(!?pkhZYleXJQY96a#1OO`^9!`i6A*1% zVAyr!H8)cL`3|=9fs4%SY}604UR>c1VE=#;kdH?n+j0j_N1UCV<+dCoO?A0N4M8YW z%apgX+X>v0l9Gb+-YDh=E9Ohf%7#Lnc8H--(MNxK;lz1czQy(R-fhqKwzs8qbaWne zmY0peCercnJnHM~iy!z$D&R-~HW26@EFh@U)4HHfx@mV&AdI56uI?o2thH5~h=>TT zd|6pBO-vRIYXb`q@R;Uu5H1x|P4HaS$G^@3562I(RX$Z7L1(0gqz|>PtK<@%lOQng z!0KhK0s2fyNqKj4$(WOq!|gaP_|;q;6A!O96ob(Dd{?i!#*h_TPhTIdBxL2~kEu3* zR_PFB?E!AfB{3PFN^VY02g?nI&;mGukg^thh51`iU;~eK%74z5#&$5_ zvP5-E|Cp444#1s6i^Te*4%Z`YZoDwd9{6doel9lh{`JpQYUAl^1Hn}6tjfwq;8FZx zNkHzvMFQmdVE3Q-T{_Fk$;}WKY%&X{;{twFa7;hy>*x6#ffNI_BuQOeQaHPOV&dB8 z6(?bO91OW2{;~L%qN{&*5MIDY5ukVvWL5RXvwv}~1WIQz<4Hv{5%ph!%jB_2*S2j? zI-6LI%uygMEckUAHm5ryt=0}DHVmqRM%Q>`>!#Y%(;y7VpEG*!gk z_zkH(p*EMg=>`(Y#Du0}=s{f8xXrq@wubIG8G3HAgHiU<{Lj=BmiSMoww51IX%+UQ zawUFiX<2Y|X&3w8w(&bVHy6pLh05x8+K)E|NkHDJk}>r*TV9Ow2@4B5AFay44UWX! zDIqSkcntWwp8J;t22P-`faZG-bP>X;G~*{)aBskc%VLfaAS$n_A_PxszdG5Vq_WEX zHeqW}?~EV^$;oMVhY2k#EC40a0siyd_?FK{$8>@dO_`%@;%5=BUu1bf)zSx1#B7{P zExs51d3ky2Fx1sxA%%9Ga`%_lzYns_t?6^64j%)TQKnp+*m#u=74&SBp$Cq)1dC0P zdU?%1OqW$wx{iEs117I~+C$vd))vSg3eXG?;4;u~ZuWWc0-cAK*JXdc;od<^Obj?} zT@@yssJm?8>2anX(titQ(#yw4+S+ahIuul-09IkZx2sEprjxHB#rR38d}_}9Hv)PJ z@yhRGLCmF;ppPFP2@*cGWIpYh zG-2xj`Di)nYMGlqWo2bG;N;{Z$2mSZK`R}_z{HdW&IfQz09i3&?kIYVer$L+Dxh1& z(Lc!=-%@|`CK?Fo*NGMNl8L*H(N{n^vnOny0m-lP`+!bBGF8BObTN>FPyRG06!G4# z0!2RRMD|zr>T2zrNxaMqZ*SW35#bU|FTg-bH)dB&?E~JMO|y&hRuQ% z!`0P%O?Kkon6sA>c<+pWp^XfgdCfW@SyQn*7$g>FG=)W zrKa8|WfLt11_nWw)zE?Nu(##CU_!xl`Z<_(@$~6aW58H?rz$A-Dqb-k9SbW&yQD@R zDkv-a4Q=1VX(ELBKwL4K11 z6c`zO1jGHYN;g8s4dp$?*)d<17Dm2Q013$ zHr6n5hVBANKZmK5NR!TR4A;Q0C~PYkQ*aqjhp_9-7NT0v(~F)BS(;l}HJxHK=-P2A zlO+LG;YWmo3F+yvySw&_zFn^cddR`>lrnq~T3~B|y?k{LT~NT7n(b7Ur(^|nIeq-B zE0Rt?(&9t@f!e11{MZq>!3szIfTM1n=U)h(_$CPnn@-t$MZn#4hSKeLkL( z_wCcuZB5iDx)~pIM>$M)BJHpHLMK~F2!v&Iwwm|$up0zyoMk16M9PpEM?%s9^_T#x zaNM&O}PmB)uWH@oXz?kw0QkRqxN$ql0--6G&u;jQp%$gyJ1P$XULUuM)L{z;dgQU+}GBt zR0pkJsC+gNB221aCT>8=GVNVu{ECGgE6+>Q1&Gj7QGOe|g!94_PQlIEjLmM1CLrSm z1VO-W3O3z`_GXqork@M)mc8KJvrfefLlhDc%89^M(98iE9USaQnH_hz*9wl{YJ>(+ zShmdj)qb{eS#9kv%rntlL~sr_4urr_YgrqcqHc4<^{I-gs&QNEuPqS?F9N3q_V)70nCKb*u&|)_$fvt6Umj1}S^4^k1l(U)5j}pKQ&E90@o-zE z1@*Qs-f_&ZyhctF_P_*wSMvc@5w(d;CQx$VU;1gYv(=foE&7ST;7EG4Vq#1bMzsw4 zqrTRBA4)3!N9GnL&G@h4zkCS?wvUE`V`xR66h^qpSWu52{9Rcec-%--An}Dd+VP=U z-vLT7(ixebXP?!_jt%O`6GZ6PPO^1%3jeq(}^ePoAFf z^}3DjTWcT0udNvfNT^QlemhK1O&@mAo|66k7|#+s{UQjr+VIxp0LuK1OJgGSeKzp{ z59Sn-H&g5UX4wJu5Ewl<^>UC>>!iCTqisI?_it6O4<;rnfnoW;Eei{S!gBVU`c!GB zS*vyQ^lYkd>~4}U_k>svcL~VWO>u!9E02&V zgUzO0nsk15vGnk7Tus7|>hWX7=Y(V}N?+KMPe&D~7jo5^rDNoC&+l&zmg<4&1T58E z0NZEY)U4a%4c7QHN)sWKxv1OddzZ4{Ti3ckDY+_*xeWQkAO^2MmHYm<&zp40miuYC zZpX;CS!W`ciG=^a)T(8-Ec=;0ubAfwgNt`zvwiRLld<-1NVwis*9W!$CvSaKJ3H*W zG%^Ng5nUV=a$d{9z`{RgXJ>+5`)S5j&j2<7#%_WTuKL|i5GlM%|Ak*Am@1v!23VPa z-i5e{NJ!>ty!B$(6{X<=71-IUeK^8#DQCG_%}hQ_`~}3Ch5qL=R&bfVwkvC}yzPakA^S%pjc8Qf%OPhwQ`BIqmHay0-qgTwRa!Rk z3ECfR2}aH-X5rr=D2CUbbgL+A|GcqMqe;IgR=FC59k>1Q$M1N)OHFbH{=R{bhWcsp zYy@n#oTG3UiKw7ogE8juKSXQdT&d)%Pr^m7oAo|YL${-=z91Z|)r}a2Zu_`1-Ao65 zgV{gJfKByIjV@nO+7MR> zIF=23>^%f&MGhu?F11?ObC34+_BcsM<#R`EHvw7uufaiz_!$lm-~x0)#>3+|z*(L? z>I;+rDg^K%f&dEgkxLNyfs6|K#f-V;7k3_eq6EEt=z>7WL~M}zq9w{{niK}j`@5!8 zho;AEIxx`R=(KQbpPq^P*IoN{q(;1&C zHlda8g_pcB04185%R;JfTNn~nBI@yX{05`heaL_GOzXKIaGPk9aSGb>uUkgux;WIaF9ES!RF?B&-;0eZO>{8T&}GZ?8id5J z(rEIpffvK?LMFs z^*%fWv#qa<=s5j8biOgNTWARwatxVtUbJqh#h``7BT_!+;E;d=?YEM}4($XaKSMS! zH&KF$=wJPsU2*z0{lnvO-W<$cL83qeKE3np{YbV9N4VHb$W@N1rhS91XH*!22ntTK zaySM=$e2}9f(0;9ki`L!i43@o=lctGZrT7#`_I(_m;`tgnooTI1hjB7X(ZLfjOK~N zD*FYanYC90A2&5MmF1XTM_0_(NHk3Z?_LzK*d0wWIyq_SB9T%sIy&0^Bx;Qv;1htv z_r;4BlG4(M%u&){u-hNoGbrn%sJK`fD0Utm9&Z%)tmqik?*x$W2sV;RlcvGx1C6$h z&c$Gc*o{N(s5Q-Mhk%LM&hT){Rgj{vuuy8SJ2Tnmwhrr1?ShGnxw|7xi)s;R^kz+i zdAwy6@75kUzQAD+Cq9S-T1{~bpBL^BU^CKBWx|@x>e>JTOoL1E3!hfD0sj9$XaXnp?o8&jDm{mWbm#$TDR?mulSJucIal38 zaB$Wmc6_FjDSBt@2}Y!o0@LI%w=VfJ32c-^h~E~ zkkn;oYg;@Kwr@JonPt=XP!9G9V6~tG1Wc(40s%PyRPZS%VgOu8$HIaE_BTXB6avHF z?`L8#2pQ|2=9hmR!D%bAk-=cFT@vQjJoDT#Pq@CAQf6&s;1l<&&B*x{Ub62kF2nWp z!{-+?Ou4Jj2&#;XjM+`me;q`V$fvrcZ!!$w@uxC3ttiV|^I4hQi{noLeDhkym5LKH zzFC9wdbR+T1MyQY1tJL2AZE|Z;cP)wT@2qgwGaIS0DLVo12%{ zRosSeYvt_B?Q|Co5`Mss&MGa%26JC14%dVL1P)g)o5}@+g?K(13jlrY=;)9#VKYd3 zX~z26AnE=ley+JSeXi4!7MO6*GNA>0`hx$cApx^ zaN|S3ttl2+ECSu%TcDS9D(TE(NRrPl!Ji9(%r35?b^2uxlW4_Juw&uk$^(z==ZVZX zpRJu8JWG~PRRjR;+WV0uw-rNhLZKg%GcppC*p4NNH%VvmK1+3_oZo&d~F069>psV@EJ z-U`kNsH`H_mu(@4f01BeR79j;Ar)NO|$ zqhhCH)t;S-TrJ(3%m zVgbSpx8~!t&(Cwlw@}4Cum2XDw%Y(p0%woP9=Er(1-MYpmb!s`FHtLYnCX+t*EoAG zH{*HU&n83Yl4@gsKll0rx=%tShUA+m!x) zET&B#F+nI~0-!Tyh=s+)XT8JEproXPgY(kS$%*7CH#pn9$0V>%eFGYFLG|^5APa*l zZ1l!-;q82a)bBWPepo$`cQ?dSr`w(R02B>H&tU}6vJXG{=vIXgrF z6dj=`>MG6kMDGbm@NK7*EiS$V8Rz=jrf)ep(j$Wdpt>Li=7>@;9BcIX1~%`ry-q~` zguDt(^81sUa+C@t^{T1MM|>(zpsVE>sPgVWq7^IgTF@e|>DM=JYWcQr0;B_@J}y&1 zXKEA-s~wIBqgc!GuqQ3QO6{~A`i<5?IvWxwl?r9>zJV{EUE>3@KJdKV0QkjOjyvdK zIYhD#FnPZbQ%i-tKU?kqx|adg9o&@bbZ-#CR#b3QpI%8(C z(cy&P9-`-Vgb;{RTCoz4!OTsptAH30e24YZAsdNT>n(Z~C`ejju)3-$V$FBWLx^~q zyJCXyf(%EWlGXWsD!B7~-T6lXmpE_*S-2sx5BJ+`7k0e4XU51Uhhh}Uuf(jF(YP%^ z>=7$@BX-wvjTl(iHW+h)A=HZ;K5E?sW+b77ro#Dw!Qe?%4&2Avf@y*-h~z{0cJQHH zAm@qeY7MYWPJlt&WlKqeQQhCVO+x{ULsGpStmNrgYi#va*=0pF!378)BxPqq!2q08 zkh~`mBd!F=Vvqzu8(N-bH7mU#YCxv85Nh$YT z`!CovZM&fQV4xiU5B2OScH&D=+Sl3x_dTT9h_>VvzdX&iaiwk|pl5#m9h9mHI%g$v z-iNs;qumds5;hF`;#0|22@PI?_RTIbnriuA_2L6?NMda%0${wD7 z8I^vg#$rtl$NLu4rkT_-M43yAK%y7?sTwLt9~n_sPUTk_>Cn=N!19X32Bi?ZR=)-J zLi>S6&k&ulki)9c=fI^D=A-$&^ft(ZT&)#lX+Q1VE_6G-5DS1Yi#DNHGG6(_;82(| zn5Izf2_(Dnl zHSZ5)^+zF)1_xQNyDdWm%cCRUuyLDqq37jAXpZLrSdKupE*zA|Hsr@ zhea8!-NQpSh;$1gCEbl82q++k0@6r#cRWLQYA1v+U4^6x9<^a-b_il-Ww~+8S1jGKSN!bM&Wr|_8=2~uN8z802}ai9hNc(MY`6gF0@9&Q(6X{MU&&>|1)<51S;ZrANlI4$~L%g{|IFF>tFC!KiTbNorj^pqEG<9jlTG2EGYL~xqQG4CyyXhwx|lJQ@(*4{2y&}+ zhd{X-2AOeXB9@I?kaTTv9GA1=K9C%1*SxyML@-mFXb>5ZJrumgMaGt7m!ela@@=HR z?^fb9RzK#xiFTy$I#k!v3Ii3X;*cVc2z`9T!I<28L5BwrU8S19Y}vW#2fyOz1d&9B zLBi%kcho+n1u!W9C##22$T~rPiw6QTKW{BSnCz<~Zz<4Qms9HJ2nOvE(DF(a2h^B6 zkZAzm0UGV%t?)jbgk}P#Ld;8W*8!02R)_y{^lJb$0L9rZ@FQ|OwieG5vZehR3=swS z`J&(E6>V>!NcVg{Jb(L^2{g(cK9d2!R>t=qodKrRbgc_o56tJg`{V6{mmF!i4_@9# z>OK*%%h&N1I$s595UU`sVic11jRwB51H~7|h`zCBSAO38L6ffo?hsa4{+jW#6@a;gQ9HXqSF)x*+Bo|RHmw8NHV(~Uryzs$tB&6hz0X?%?;$U6 z`vw7}5zvLD0~0SFfnp48X%&FEzcn$5OG;W*b2Ej$lE45=Qe9iyk}m_Tj#R_JF7yGY zxaK{5cemLdEx_nGn-*BFAQ=W;f&O!=F%D=+0)XZ9G%X(=AN1qLk2}?WByPom?F#j8 zim>IqW%D0fM89WLWRH8!WQis#*_`zR*L9r$^BqcpPT5E;P4#(AncFR- z3IO*YJix>?V^9CSysW4F66e6OdX_3hBacKMl7Uph9w8&#YfYS*#dT?iRBA zk5=$sVD>*K_!GAn(D=VTT?AQ9})rqY%m!%Fu^mg?+alK*jpsH@82y#=S=az`m#F#t?eo7KT5F z-@TY+@13#b69Oq>8SO7Y#^;$V0+jCJqTBePARLqosx_4;n%BiSe+-UE?V4I|kJ5XdUGwjRl+zTz3MZMkBb9?); zD)$%+p!lZsOHeAyq=@tpF`NO&S~`BGl28gK{dbPRaO1Y!fmbj;i8Xn_6gw^0S<2FO zIyyoZ&)s9b+QlIFm+cKH>^$?3Y17s<6*niAj7X331PjRxds=m+0b55IjVoUFHvYL* z0j19ixXg#4c}8AMyrjW_IZxK4u|<00AO^>`D;V$6R=P03V`0h_!%uPHUbebIr1Dq9 zh}xJ*rT;R5f*;+bFoWfT-_3$mp!I3YSn@6^EqM~^65g``rx*+SH05Ux;z2>@5ZWEQoMb(f+I>nmYGkgvw&T77mZQv|llY0wFIWO>Ib-QJ ztm&!xs5`7YMPhRtJ(z4B#W67V(>wBQJv5|Q*3vgvgSJEm4BaJ$1{X;anLCeGF>D}l zs}6L#3huD2Yg;hD3M(Mly1**|g`YJWTvx>3$tXk&{uFOW3P2X;PX(NQ;Uaa@3OzvD zjDtYfC&MUFjmY5`un$u^QImcKE8?5JgiY^w3p`-6-Ia%ERepN{BoqWN;a`Hy?{YuM z@>abq^m&+Ay``$TjEa!jmL{4sVSTf#^6v~7?-_NZszy#Odw^%PUfRUt4bg_ZN1}?_ zWWE#y`ghONNAG9My|ha62bxnZnv$1bwjG|J$|-DUNU#(|AYL8Q{HZk#9CA57qnjLJ zFUzx!DR5*^&^1C1v7RwYZb-3#Yt1gmqUf>uC}m`BAZIw%M|Wv# zxJ1X-aIzXLmzriIJk!B>yD1}=tzPZ_oIO5qWhpw(cI-WFUCT6sPA{qW!VM)sm7u~6 z4%iwOou&Le!Iz|NaJS|AZDk%vz=`#qbOX91YfaZ&DkD{IB%)AgT@VA-k-07AJK+!t zufeCx{}~o+Z1U~hgrGMFYYI~MN-8erbFGwCx52=<%<-m2Vdr@$+h_H#1=@$SqYO5L zZST}b0o|TIWsLPB+n0_H9rpC@-eR^F*G?H$;IMWa+9Ga8#aaU{0H zgyrz6jjBcyJo0C&ij1ns<3yW8@JK!N(>C#bG9z+lL!@LSgTlxWoo38pf5Z0{3#91g z-5AOWvfER@Gcxb@U!)aySGd6{U!lPJasW5oS03m|=jo!Zi#7 z?q#L$W^*A$N4#MWtRj6$Z2_-v;5+=P9%HW$1N8zzvoK`OuG$UG6o)0FP5!Jr#DD?) z4TP$cg<-0igc99^mLO0a1!m?!`=V%ikNl?VDKjJ*;7N?u% zK$bdD5EN#$>A{|q9&4$M1)q;|_ocq)GxE`YPBA~{M9P)9d2KiHw8&`cHHqzU@^kLW zI_+YqHv1bIl@S6``MGv`19Wr0zHFfXAL`Q)GE+Y<`ziCeRa#jt+a}NUDi}#KURIk& zL!jmIe;(Mia#(@L*SvgBZ(r=?mt9u;5z#%r_$9OG0@bK!I8co=tQcxEkES+@NtESH z4I*uHD*U_o){m44gyVnIsZ9mHTcA}aPx|~(0Y%%h(^4;8Ku-~Z(82WVQ^UiZj0p!6 zHq3qet-cpn6?6z(SU)Xm_TT}Q%E(T}X?xwC%S9FQz3qxabyyM1x4p)V4ju(7MEgW$ zWI?hfmH7WQ2y*ZeQ(0)K6*YXV<={dPgS4cs&O(mY^=VgqtA{D?Wd9I#0F=4a+4i&; zbVNZ9DSYEt=TrIByIBBS%lpVFf{j)(GoTCr8FV7c38M`F457WPh1 zg#p~vR@hHq2LcK=?nLIkobs`xhiBVOzJUg&GQfiTiusQXg&w%@6?iZEwWe?p6jRj6 zcE7#OO9N65enJ@xWPo~`r_tyGr(cBym8){GTuuip@Je7*eZPT^5G!9wI6#n|Bh|~L z*U==HNXTaZ{2M%qioz~HE%x^a`Oo`}HhCy}$jB)Ug>WSI2GJ@Y(A3~`AE8PsbjWA> z66$tN2Ajunq+1ZjA)M_LBKdo=q-$avmMMZJs;EBd={~}kRye{Q$zd`>fI=ee*+?LP zCwi03{{MCqdf?DHrsG4np~{T+k>Iua%XhqG{eX-D%oUBzd_oKzMX}O6)=Nj5#{H=pso7mwYX~M~ z?mkdxb#9_c^CCzI>a(zrfNR*^IK%D-|6g~~@B1VysVkn<$FWc)*1`H4pyg3ZdFv?Z z?!+8XkTZ36h!_MA_f)2&W`}I;!RyBCkxsH2+lr2Xg<(OupDj0NDkD1d5_|bp=X^0-wWy+C zzHean0FRiy9?$px-+rRsHTf&-ZfPZXP)zMWVQG|uQ7hE->spy<>C~nB3Dd{#+p);} zx{ABpg7Js*Ru7NwOJnS_t<}ZB++m6WHhY|FlTgp9Y}+(7K8^c4!fP*wOu`VO;=RkP zDKDdXUjMX2yO?{-o&V$eE;YZ`kb42oO^kG!zmLdw$ABBaWVA`x!5%|(lxXCE$)Qf- z-|PNH1RsHYnVKL0p__5g9f>>?z3%H)EX0lNWNP<`4Q^f}iX**pD0@7ViPdJBiK;Rp z0PCwTWBnhQ7c~&L9u3A_P6Ta@ckKhYJ)(T?THRob7wdzsjre&2azEt>s(3h^3K-(G z)o7ry=-ZMNW!3_B+~@VDHFjiAvg~j#CsPCk+wAmjOyPzwihC9cFTS!q5sA#OpdSyo zk)l`gw!NxM5buBDd~{rK-WLf%uoldH1ztA-eZH{PetslyW*GF*>f9wV*B({ii8C|YSPmD5!mf_jo+5t}vH#rb0x6^wjH@Jd)-oe2I}@|sy?1gbG*y&c!`FSu1? zdSb`TJ-PD~c8Y4bVp|5=PYH4V25h1wy6fjvV$ee3e&q<2DE@l?aNQjU?fr1dxv^=h z-@8fXp^fl!paWmW<2Z~kKtbApaOiu1tx0PU8^=`N28Aq;vUQGmvlW~f3w|FfCUXL9 z^11pbgc#j}!4;G{F?*>0>#w=-5zeyD&I)`teI)smBB!G4mc&FXaVeFhuW6G<)HX{Gi ziov2%(l^RY1GRjM%>9I`8LeF$!AHF<>y%^x%eeDv;4QC>ynB$+3mQ}NwJlP4eb_!- ztrUOIf64I1pb}eQF-ZSuY!hXM$Dk=3fG^KF*vqiu^(`dfB0tDZAYb9HYr%)6{Wz%m#F(KkQWZhS412^;1X(VOan~G@ z!=NQGIYRUCd>P-!U`678MxlZxs0|K?5jX&y)3iqf`ixUkQ!Sj_Y%rb_yCj$=z4C!z zAoK?n&Q{jij|+dr>!yM^mW3P-tf<}%IK07zt-!MK*q(tcsX!_}rbc?~k@X}SWnV&| z8v>pA0h{}96(h)e<{Q&A6#S)Kf;B_ zBfl4r_=bA4<@+>`54T&`s5Yr7WF6joG#clfeW5gBdN%->4q7OLXDk4(@F3d) zlz^0;J^OtO;VZX})R5aWM1ckzfO-U*J%1aPMp-veMT^(K>3Cawa_!Obc+>DgSi|-Gl{+;rh)zusmci7_6-Wlwl!r+ zU=&3kp$`edZ2Ja;qBkx8F*(z}O^bQ&?qw$}RR5!mw5PbEKz=c4dlWUi$Vxo!N(K?E z{|0&)Yz%GNq{bexiOdC}m#mZ2 zw5rpoXe`WX;ZP<7f-g6TZQnb}UByeV&;K(qn4stl`kl;sKA^q@02jyA3EytkSpDuu z-sAT?!%-%{)wQ|z4COMm`~+Rs;Vr_3oDS|QJd#l5ZjYs#Fc_No7iLg9qRIvDuq|Z& zU%shbSXhV&%;$>Vi;rqXfb69PaU{05>-^=mH^d8gk%7|^z-5tMxY7Dc&~Nk^Ng_;B z=Zn0tl{um>f}&#pOnZea3L<1-0vZ1=iEaYWDI{Bv)%!ac(w$OuvF=< z5d9~!3@@4unUGo-||9Ut;597)LyzcY^mJ+U~P#ShTC9n5_pWTD)t86Ps~52rNmeY9Ad za-oK)8DhbQI~3eglPw-s4VO2s`+Mc`$ngOXkLq`Ryeh8PPKi}o)1RLY!TrzItrMkN zP?nKVbTuR_ZmU)8TSXJ_-Aa5zaJHRW(w0tjrg?eY{eWhsI=5DtjXH=CTp;EX(@Vw9 zM5t+NYs>4Plj6WTEJmwlW(OcS)Ly+xND~pg=A)cwwo663#H{0`y5Q>hy1zqGl^XAJ zDKMQR9lzH!BUOiSpDlSYo$1JBYhs0AY$~e(Rr5#8*j*#`3S4c$^?GY0oe@n-+bCb- z(eU&5*8@Tb_D3PDB>^YMbm!C8$Pl@opCRs-;EvsW32+n^8BUn#!gkbm9rd^=cv{Yw z*0Ox;zYH=T3$~;>F=5@kH)B4uLddX8zWnCz$xmBcff$RnD?0j?Lwh0>zxhRX=m9UC z=xdAdy05fn_!Z*q!Xp8ve_Q9VE^#J#f3Em4w2U`KV$by9VgJ^>nz?z9C89yWeyjh0 z16c_Ai5F#2pJ&yTm&XFO6u|ar{8dXY8G!rAVs!j^+4FaNnBK~X?}UN z*ujH{f*aLsE1FuX409Kkn0xjSjU)a-8e70B+5$!kf8}Dq7p%|gM&iN9C#^Eo?A`><0K!_g^0d%eY0r#&sA zSExL{x9*O;E4R@j=Oq&*&<-n4gdu~j4-Z)H>kYg>lfgT?=52YsdV~22LZQ2MUWHW! zL|wL7r9u}Fkn5?cZ2GLj3tEw;+EL_OZ>PSRF=lVAuVXiwcWLXka<>|T^%(nm%i-Gf zlbtGu__f#8=Xg8c!dVfc8FK_hk|@w_URrFoX)kv_b=G=4y7=1x5qZ4zN2bMJ|C%pT zX-Sr9e=jKJ0PBG3Q!RvHSp0~nMKizzp^79zxLsGw>^;j}Z%Kx~IqPCLz948JPvAk} zS=7a@=w%3{4yc9SbWQ9$bWB@WY=E;Hg@=bL`f8SFw*_M0$x2U5Pyc+*(;VErq}21Z z+%WlO_uTC-#o~pWFdOx3OLN%VPB)kl7>!?+p4{W1Y3|bYZ3z;vI`;Gps-Kt;&GULr z4&A8}L0$~T7>POHoq6ZoG|#HHoDd?zP!?{~ zP@aH$_4Iq1kWC6ee*9Pi%yrL|L@n6?@kH6jOA`nOG={B1tgz{OXG z&Auz8-1F8@%*l21O)a=H&Eh6qYi4)$k7JiSugb-wh1W^%LBT)kxsh9g-w)0mV42tD zgJ`)~{Hp(c@2&IZ=OTW9|9?M7C*~YHVF*c$LBZJs{yF_te@ZH*96<|Tx0?$4)rkp85v^o zs1U$&%DiQ74>E|mhSx6mOPKYxf-|KzQq=jhbMPnAqtVGbCM;TofcyGthg&C;uk?wt zEm$1lne0n130thf+C*BI3ip*t%mE4YpGD>5#Q*CH zq&;+N?Nxfd8h)*m;+d5i+I1(AnI7*5)uDi-Cc9&6PLR>f-CDcAj=9AONk1sQ$@U4} z>+b%RkyfY)p1|+7wKHOC87_cEiKTJHx+Kx%$w~Tvw}OSWbCuhN6B1E2$@?L_RGy5c|JK-#@ZP>Y z)1B#R$n zETCn#UKLh(yVkI*B@ms7$AyqIqPB3;1vrbNw(Kez$v`_OhJ(>3^42XRz$gR*_^Qi* z*cv|PHxavOK~<^aSNI)@V@!r|1B_h^+*w_<;nR+ZmrBUgnO(1*j{-vMk!UStszx%I z#wV$q8sPuWjAXh|Te5QDw~i=}MMft36c8K%zUZC6fGAqj10e@K;8F}8t-pAi`CY`a z79zv0ZbyE2E?lFlu-<(}wSP@n1I$Cnz;J#F!@ipz>IIJNYsv^KYb|tNKhc1zZNoZnx=D$8(S0!dV%~l5IqL?e%47ns$U@~b!~XF$G22=R zyqqLep2Jam?vobX1m*3@Oy#{4xnkA-S~>UCU%y4<`=Jn`6}<8*m$3}~6M>LFy1ek3 zx!G%N-;q#~eODhoUKHWbCM3pPfpI^sOhF=m+_x097_JxCsPbSl7!H-!GFN1a98`}c zEZPV?giVv)8a}yDOq@O5!JFS7-tADJP!M=;@^q9ANd+#V`c}!mJF~fcv^nG%GY;at zLvNl`%HYGxUmNM7UhoI#BR0;=>2z_M;_{tUQ3ehmKXgy7Hs=-sy=Vvc1v?^i(IEey z%VYX@MbV~T07;%Tyn0tqkJIE{Lue(did*NQ+Qq~pf!bn_`rWxjCMTnu#TW``TidoY z$ocnB@3sRI<$wked9F*}a3J~lFy{4Ivx2YeaL>H;@Ai6mAtnZyjiDFlzE{TowsPEe zUqVkjPpUI#+yn~SM=>{Btng6g#6w2p!lmI2%|1_@uqIyUt*Hh*w78-nf^KyGyv-v&@j z1FfX)E78T8^m|p$Upx9VoHZtsq*4AJF?{*Ci(8ngNmC z@0;sZI8W$|HrK!F+E{^lADQ9Lv|`VGv5tx&JF`Zd-bkSC9mt><8mizwG{>qSo|Qcw zBWANO%Bdq;n5M-2&*yf5wb<;amG0(=nAQJ@?vJPEd7)x){AKm`pVvkoZnoy4`$Uth zk-y-35N)@#KY{WI)J)~+iT?A=3Y6^+X&^udKuo2;xCDVOI@dzV`DTCFLqET~aYt!I zRc!z!LpslqxHb`e@W;^{v2QsdDQ*Sf#@BRWi_}0_Sm13BC|U6>(G3rWyI4_Udunju4o z^R=JanK!O>!M_#B#6N25tI>TzWHgWK>rJ|FQ*=Ev1Z7_<7`cV-kY5B1D&L%z-)Xvo zRJ@Sv?l#ii=X(0)*G+zdVnld26dryyi;{rpyN8&tV}}yvTPc3vp3NgB2&{H;cCJzS zu+O9?pbkUHXDi#NU$GJoaUik(Y|-H!up$IW7K+A-;bsU)-z~xAzaks3O*q=w`H};s z@SOk1o3PhD9p3bH(#Q*pYskdvd3ZNHiznh32fWzG28s+ux4$2r@Bc{~M-NYrFoCGb zE8u2<3E2+!d$qVFbF&6k-WJ`MwPNdc5w4vFXVQrbHV$YvRKE|PZg8MmBR?bYY9^+WtN%_B-&cc>A)=z6 zHDC|9)v^L6E$uuqNm$`To;6U%Y47*Lt9kYxV?>hz7&ITCkgl(<=aiQ_DEIz$6#X$U zz{0~53ou%=gkgm56{9Cy0FDjdd5%tEb_Ag#P}6xl;R0Z};BVGpQSt}|_=v(fmulBU z|7taGGaDqg+f8-M`~5j(P4$wlpHE%7FWLfS6q*vJ1?Sv6|Grznp`7}Fy^%sw$V-GG z3h=!^TLr)#qbIghQk{>Fj)q1?p18OiK0*S>IWCay5w~O_E?aA85Kl{k(q3+Q1H@oq zV`DlYUMV&Uh2SKhw+9@>1}PFAwCE7)vOc>=85 zMZamn>E1P7wmEU?!6fNdY8IFRLNLg9yTs`yCR~t@&hDkh#RbgSGaSrd5qOxKxbPAS6o{9E-48jpS2f((Z_}X;=nKnUjdrg?Vdb* zbJH5goCV#yU0Ws88w5IDCOR$G-q3NJcoa=d=23kmz_Nb z;_cf9#}LE^#H?2P(-inQne`@Zz$2qeUAp(1C%&AM{2}w5d(Vwt zxTuTML}<9x^+Zm@$XC!82GtQRxHh?5c_AxgJZDp*ov8s)O~6e$x(w(!xo?X~+ZTTN z6b^8qh4PU4h#=rMF8+vHil+t|3STXMG0{!(@t(!^PfzRU59XDCJGwJdOXO>)r>6{N zL`>@q0#?vt26s|2vP#c`x3_NwQC0OT?A!P+<(fVlSp_L5eb9b|kq77>QD44%3D~Qu zs(Mpl^mrQosQ`WuposAU(Vl>A0C2k>bDx-MaN-c?u?3c`x&E!lx$({tvLOex89L9B zf`SLXML|wa3^w5~U>pL5EarH1#mo+;&Nu9+2Umn00FVtTR;!3pfQx@zO3k#S4`5BN zq1Ue;PaFb1&d49{EO9rED)WBovzD?l`yXe#ARx4~!tY{R-`>vu_%Q&`!~?qVJB&d6 z%tZRV1o24Gi|!5Amxg=k9Dv=B2BZxORnngt8#8Jazs54`S~=D;G?a0iKQ$Z#le5`{ zR+%(`HUI*A0_fi%fFzxjwe{O`=x77noeght;4b1v1!O|cu{cU@XS5gO6W%~ zZ%UdS?}P3@zi66;;ew32oS@WVA}oh;pBN|&0HdM-biq!g0rK}Y(bB2a3kKJs0QgYK zBIW^{xu?E~_dI0U=}F(6kZJ8=kPeX7~kC^4f= z{8*rJdbdM^_+&pjdcBU4zm~O#OVo!CS#(AHzPwXP&2t${;a*Xeb1CnMQkbQ+KK)=K zB5L;~aYbIUtM@ztmogU~_k*X+r27*f4{j0Jo13!$aCkye60o~nc645n^k5SKVJ(2o z6)0=?+0$bTYHrJ`tDE^62ui-v($Z~cs*1JDMeyOnTP`CI?(4cbo*f;P1G@=WXs5B) z_V(O|tNkO#l94DTPeQJrUPPmsvK0wy_{YKHB~aJ~B~S+ugtI)@<+L`B`6h0S=UzyOo@XWJcA560f zxsmRF9C80@59%l51<#ids6W`w)DVIlUzWo6to_H)#(Qpw55Ti&W)fmq7P-U5TGRJLO~&X*KoTuL4WHEi-X6B+gEK4`G5Zr=d)}V( z*HHDx^77ZXE8dQs5QP)*saIQgViqb@2W=Scwo119>WKGhf>EQqs1Du&0s?PZe8t=w z^~vH*ud?a)CM(fK1UJB*Ehvx=l7H|Syr=5xSMAETA!TdCYC1a4G&RX*Y8@ErvVhPf z#LmsFxxyT0)gI)NVJo^#`1djp6|YFO+G(2fq1effQ@B2Nyw;XvlmBS{d<~N3w?S>s z+)O6z=DxFv*VDc^Z?H{z%xftp?=NF@v&{xv*=0u&gw3JN4P{Afx0?qLaS!cDsUs)_ zzy<=mO;~r)$I<>DKYDt5O-{C_XeA-fJ8+;J2(sL=HNiw+*l%^s$QLDD*WaT)z3ZiN zHdiBUK=kX%{PpL=k)mmBed?>CB{BCP7mI08kHUAgG?Gouqy4L)NIwVB?ZP=L=iWcc zoLy%e7M!yNmM&?Y%0Ir!*7RdfF}=46=?u|4sU@&$W9t`AiI@4a^t6VM8d~}-v^d8S zd%H-Z3&4EsfO5ch9}Dv&O-M{s2Nd6t4ca=!SEpo3p}?Q!Y`sB?RhS2+RMdGHTeT?u zmH{?1(=#}z)yez={kpD0Y`JjmEuuP#Ut2_=Qf8<4d1(oE_1DVj{-DN8PgHv~!}3F; zTG7AXzv4$by&TZ~1|6kc`n5*YZb}__E1NItq$FAxtG0x&PhrOM``w)DzU5A}$t##J zbqS&=lCe-8tahAZlBhq4vwOSYoOaMWmmhM{LXRI3~N6PyYn7|9f#FBB$g{u)I zCP4Pnr{HR%JbC)to12|oJtTVgSnuUaeqJ(11%)the=nDyoG6v*wz+q!WZHGcPMB5k zXP?g+QiaJ$wd*{R1=cmrRI2R@mnrr5yQR5*QkCkL($h~b{WiKdI2D~;TyYFbR=J+q zimJjdT-8o7G&0^%ruj>SSzGeM$R#K-)Sf3*Gl=AQ327{{A|y?fr%|W*RkgR}77aD; z^ttlx+)BPL^dYe`guHOg+L#!ulGgzOAJ<0)e#K{IO6|J=UMYv%hul^l(wrgjNK{>a zG>fSCvu&x>m0!(eIo;$GI`wAqm?8HoSiW!j;@x<^Woez+G}YQVND5atZO|6%`5CB` z^o`r%Tb9_e`PE|zx`7{umV&2gf~Ve-@^TQ$yB>Hd2%#xwimU3Emwnv+am^{F!Hf|LklyuHI@-E5&O6z>Ml~Hjv;k!}*2A zYWI`s9i*DvvsWYb*CtVbO;6Mo6Azbjd6IxLw0vd)nQaR!u3^(m_g<}plaIp5?5929 zze|LyM7vH;@hO7FT)n*qNp)1qW0R>yJ(hIqIc0ZBJ!uD1Ow9?8^x0;qIw+&k zyLkSIt|3FVPLdc$w-PBYbEjAH?XCixoR8JjZj&#tK}-Z(JwqCZz&QQeHFF1)Lq*}4#)hNC!ky`rhk zWVsRbylnE_%t@~n*fG`q0O=0M$!QEMx;Cop&Vj9NHCRc*`LM>ZtpxeHL!gvbV6eT5 z`t-dc@p__;2t|KQeB83Z%N^DDu;L7ykSPDx-A$5uE6XO&`F{+m{kVe>jnlJqaI0hh z=UTkvO=xQi#I!h@8uNqpwefLreETwwUc4YOC{G4SQ4TjQ2$r_z8k2!q4!_TdZT~J4 zKjwsszCIlYY>ms;`uh5Ew(4)hcY)t_mfD-D3ImZa=)tKxejLEzN$X`cWUIWFZA=qy z_0(ktbFHu9U{YF3ZR*@%cBCMqgWa7H2$6cR_|eCw5}UvIvM217|5Iq25)U+>Xx&`S zU+E5O{*s>FSxJ4u{bA~G$fjK&OplZOD=(KqhpRk_iL7J2-u8U6gr)n#{r=(M1(o(i zN4Z%A$m7ec9p9w@d~<-j53(95g`stpT3fwMYXStmgh0a!nO{DC zwnBREZf~0cY=d&Pbmml*MR9I-z^Z|O<(PF8iiIjoqs)SZYSqD+{{-URZnK?1nooZ~ zxe2?)^YWgV>ySU1$vW)R=I7(uHAGqimWAO$`|sB7wXdCV^GG&Khz&jCPwCvR=0B40 zshH~>Hz#6EWG>1c-5p;#&VrQRNwN6oG~b4De8hn0{qpr|c|*emgb86-5I7G3tKs}l zr}5d@G8OIifJYKWNJqW?0XU}T0E2-?!TsI3`pdBV(|zyxW*?8CfEU zmH|S(Kn#`_q*7otihAxN5y!q@X@X!~`66C7Jo>xEv~&8PJKU6UHf3HaqlzhKfc zEv+XO|FNvMx8wC#KWD(XoXO%h|k{{X$l7+PY~F443HCD%rt?_z$EQi z?Tndoh28RM3+MzC^p@JZ_+3OEO*%0))(OH0AYTua3{>P-+g?ilWNVcARdFqwjW zawm6$Oqw`DYOYK6=C^+@tFG6SjPPv;d3KF7`dvY_Y=J0|#ADFSAbwr^I2&s^jWjR67Hj2|k$iPq*DAo+opw=+t2gx^2D!*K^19{wNg0#B|?9 zipQ`;(rS@uz0i7E@Mmu?C;)&u#`?Yd&s~r4a{hKEM)?&%SVV-bdFwa%F3f8U*^*xTz$RT?oT3d44Lwp<{}ql-9T#DKbA1I8 zMX;BF3?5bDme<~VGYsTuL?r?DHwrw4nr$`j-Z(?PPdp~q?Dg*YGq%{yAk&vW&fsee z*!&bYdxL;dB9$Nd+B!WQu8FP5;PX>MhD>Zq1~<0WQn$!sxS*L2q$Qawjy&Y|Y?*%7 zi$_IXp^LB=s-Q+zJdWsSzeL3|n>wG>BIPwjcXM?Gg7|{_SD=KVV8&QFJp2;$aX~c) z4T%Uq%K(W1H8aNtI8Y%0CbOx@ceHE`q!AGC0^)a^!OH%;CDwmb7vx}Z-;X*=`E(bz z_09s4AD`Pqa7FKxr2O^anv*K>VH+%allux-@#(JsBZ z64qM!m9qPW>gvYTI|?;4Itg4^K>Yzh2he7*eYLP)U5(kF4IQoj%E4%sWA+9ZE>LIy zk@M3l?<`=25vM>G6$i?yEisVZf=C@?njq!Pn~r3PVDAwQwAZHbR)%nw^stsPsA?+avflm@wXATB zfOy@${!Hau{7F^Jo!pbeLd2RpC0gGX+4*BRu9{LP-jTlE>7+Lh{~c4D@rzf* z&_*sB>r0H6muop*5e5C!*6%ou1!_w9H<-1YgUH@u{?tSf*H%AzLz}MHh0VNrEygD- zp4Nlk34p$WwGN1izocEdX-1o(UI=|^X+^9!p4)SNBXIZ?I}dXn8S#%Cv9 zGuC*qJ1&)<$LYRJiy{^YAs!+vvA=z|S68GM_*C~n;R(%9f;NVaC$?jeQadWIs7L|j z3G=)1wQD#En^AsTE@u!12Kh5va)J9AT zy~KIvPdmtzFPCmZO*;^_7{NgPV_V`*w6W{jZfY~Tg6??`4y6|nHhkKPDRuiO+H2IA zb2?B>qt_}LWY(!U&fr*C&Q(`Z*%AgGJ98q)M9;+U-#6*&C81YyuluGWq(+J;cg&O^ZHv_kzenWEm7| zb{AHlXzdvJ5b`p8)7Zw0D-`B&8VGGc)?1*X#+q+dI@Di(K5L z%Un1^l+mP12eb~lDj}T}sJ(Zzg^7P1bLOo@TM7RWh*`+5JxP^xb39rLxaxlFF{G^i zm+I-zJD-vj*Gc@A2Jxuk-W}7YP7$U$i<{08kfDAinG<8{;!hmMzmgIwA>_2e3z5@F z#^Z&&`~B^1(+T_8{U=_O!(28m3)`ksdoCnvE4xjvP$t3|wvMs%o|rG*jY!hreW{GR zJPQ5zz*EjuD(X=v26u+tQu*s{2hIrwS3a%@p0IgPfs3ujPPpjys;aHllZFYrt*%+fdch+L1(x>H?@lc)cNI`2h#y@%he&ycb-wtuPs*SX!aH*@d5HA~`85a9&DIL0 zku;OHd8}v;_31g`FY9eSFIR_sm5WhYytV$Xtfd+CCribyu}{S=I#goj6m_(!C@|f6 z(>~ZaPA4pXGZ^7%$>G#xe3Dz#%KJI#%(feDiky7_D=rbV5A;>x|o^K6OmT^lJz^fz+R5oIL4 zpvi+V^ER+rO18Y1bVYmGUqgpM9gAg}L^l`q3}MspG90IBVaYdswXyo8Z6Y;V{k2v1 z+SBfCyc{t70(Oq_N4yrQYRzO8hway(x$;XmX^+e5JRtnby=s75Ao87?ni4BCJMeA> zG9Z6HeCo`lxf@5hvb?(`9F=Fr#N^+Tv@~*mEP|d71n5RlZjTO}3er0N8NA&c-HsjaOXlrrhfc5{w+0 z2gg(75jWoUR#r->TVf(2S`#kR0{dAQq zz?22h@mS_#@4eN*Y2gMH@HS$lrLDg}uBsucn>Y$3+aOEHKQx{oEU0^{c@DX_gGq$P z@E9?OOZE7^g+P2>uF>?<|N52crHfb_NhZ+DDW-J#zIbH zXIIf1)EB1906Ma8g&Mr;BOXZ4SpXvEL%=R6P+y~pr}+S47(lc3ZRI2|>9dcN8`ih7 z+CUuZX=udXop4c7iXiM0HKKIf$;CHcds7G1Mj3eQ_b<VI-sK&oIh4zRzV$0SJR)FzJB7gJuke=0HEUe{Y$?pEkIpT|!iG(-xHK2sd zY0{n`plPQXuX)q=`gv4|ucxu~H+)~mfJ{)ir^YPRlzuRS{DN^#cMlg3xW=r_fZi>w zw67;}_1?pW4=rJ5iq=+EIOpG7z;SUlCLFy%&^}ok`UpLNZO_!kmXws_pdjym1_8sw zA-YujuhEL>!{mW#fpP>tV=qIj~)QSsO?PG9ek zE*;>+&Zt7$n!FAt>s?q2t!~>?0T3Ei3Wx^7n=Qb+6SX?f{R0u5KGqXvoQXqFgr5X` zEW~jWV0(ZbpGfY+;cX|NYz>HwuNx`fiRUNaPBU4{6+`}M|HaMYHpfDz8gFo8xy)Jo z*dVkm!8Yi#82L7Nq6R39b~S@BH$WrzF;L-!fl$}8*|P(1spYowVK^2Up! zD4fj*8;Ie$f)EpYHw=s?8U_tqaH${0!x}+v?$b&;FFwee#u88S$Sn;G2`Q!Ab|vhJJ>TDT z{hzDrxpZ>Q`F!4=_qgxZ>vg~GR!8+GAueI9-`TiGt>MJM0?J-smKrNz}Wk0#)GYCJx{$#QLmtC|dQt_0otf&A(_LGKQ zt?5Y*pan)ROV-nGp7Ka1lp2KN{_>@HbN&b0S~@y7fa$={<>hZ5XQ0lqvTT~Ss@#8T z!@)dWH=>!wQ9Lk`rZ41cc!05fnMyC9-udZ{eAa5ClWj!&zO#@&=cQ(G1IXBVMfn~` zwkN#46wmU~eP795t@Qen5E&;&N9&gudyEPZvu?~;by^)44@u> z7(?4_&Wnk;jZ={MrN1sMDe3O-m$DuMBESY7u+~`b(_5C%2&JW?!v<1iNXQUaU;{t~ zm6w-mnRG%_elCB`dt>&uPaLt!Pv5YRh--`V6=1D00WqLMi z!(SA~Ck@8BlE2-Lsz0ws0l`9Dj&@1ch0}roH6L8eyA>jcxe^@ap6@A>{szVuoNn0) z^&>u#WH;eTorcgdsclG-1mCnIJAI|s$DAk;egYO)S+@0Kwr#rV!IX>1>7y+*F}OBD z`V5N-%+DFmFz+W*SrIe<0Ce4S(hOiY2|b(gjMbol7lCf?ceAyf!%~fRgDk-uZn`4v z;Zs}s^01NFMCFzDlh+k+=!0rCNu$IY1MzY=CRM z`gpqe)j>MQBM8o9?-ze3Z#i@R>S-Ex6cK2uPwZLd7b?}BEHJE+wKN5uhioav%tHcuxjW7pKP@DQsK<%F9OLg3*OFzC;)#dn#yZwmhKMj5 zVN9mvk*--lhynmkV0i&8&&?HB2+{$v8z^-!V7d_yP;*7cI`U0ioG2WQz^}pzm>4Lu z5;5t7tPx}ui#`Z5QI2diM7|K$CMH=;gtX|>71JXM9F9AaoAtggIA1>TZYf6b3lfLO=>w5mK2e^y%Cb&_DRH@+dl6cP_W7@2A0|f@DK;1aI z+j=%f-9)`}P}FPN$J_3*aSZbswnbQoe|6mWza-nwg|e~G-`}F8;g$+gT%NZI2=e&S zXl-!V&`gwqy=^YvHP*Bgb&Ox#n4`#7e2Q_Y_WZou!LE-1c@8R~fndOV@gi~&4gvrf z=YRi38MJ-I_jDcK6?1cQqZCwSP^(@nFD`x!Ku(pZ5L{Hmf=@?#yWY%6B6(++rLu#= zr~H(qFZcYDCM+xC^}ECt88nRoseeXmg!zHWmT&v z05IqKC&ayrM%xp6xW|xfO!b;-b#mE)iLR&DZ*-FNFPhsNHK;(%M9U}{w1>2Yq!eb* ztxeggOf9?h!VsO#R{?&3(!!kH+i?;SP2o4FSdM;?zN`cIH@MN*fS(zVBsGA?KECc3 zrhzpN9&mIF+SBI_)WmYsPyF6`g$cG zVDwPjQ{z6Ixr%MjAyxz9c8AN?FuYVZgf0Elb9>PX#za*kvj(oQ6u zGGN`AYlw1WcW!_d*jj+)3*KVCr;t#iTwiiMl{EG{{-(~%v_A@AhM?U&PnZUOu`maV z#z+(_HJZql`E-*jXxu?qei zUu0&oUnb>S^Tqccojbqu%Y#z@GWoi)LW=nc*)c$x_s)o&-pnx z@KqWHBY8!tc5N!fz@5?rQN+7m_v<1b{K>^#O~vtgA%?5kB4D&MHJ|0-|o1%El; zbGV%g1~)?;DSl%k+d+~-ot#fpnC@lxNBzFqSYUDPXIv!E-G)Al$vWjUA=*oQz_+axQXT1O zU&q^}b%$#D-+3PxoXRlLtC}ET6&*5hbzMgi%;qq)Q0xaW$0YXTy5VnxI8m$ox!P{zWtyPW~v??V67 ztEb7#Pv+}I8=asM%RIn%LiFdDe7$T)-LQG!O~{Jboro}sNc_;Ex}5-78B0Jdk{k6$ ziLd=6#oO9tx33kw%uiBUfl(ZjlZXiaY`kRmOrQnQv0jf#@A98J{x3(&>n>2w#PYWZ z75tedzHdB1f}NpKa5+oY^!GlXOl|(`nfBXft;U|&{&_3vUJ;h2TsB(SNA$&Ww4mO9 zvD#>v@Ph~ZaL{yZV9f*3Sx7&5ML3x4Z2EeO*gPVIrdlgw#i^JFJY^N_Rk^LLX>Qh0 z=xD>lpvL0xoqOzk{^b(7lPp0H_j5f-ecGqh(c@AC7*6<@WZa7O*2pvR$QHWbhR{02 zv1m;p->8eD7eCYtwcfdDd~!AW-B9a_#dk5@v3jS^V&zUAv)A|#UAYQlo>j^H3caKG z+))gUT-f^dvURRo^wYYBYd+P=6vIQ><8)qV)bP8zZnERm@C;DL_~qmAE+qQF(awe{ z7B7i(&5udq@CY8ea!fqZbNaHvTJ^2Fw^<4C@-K;~rr^Gulf^fKhy1JVe%9w^HtGB= zu-2ndIg&?(Le6E!4erh{(97cdzWN_8O)MV&JNRVOp5|!(gNnYUV8n4!Ir^oG87{ZB zn@dz()NAbZTJ7q{Nl9~KnSO=$56$mn%Feu;%46<)_0O3VFTV|4K9@dUFZcY|ik0XG zF+LbH!)LI6^zrrmJwHzbKHje&)jTIacckOKkvU4ZbB^uZ_w8ZXMd=YM@kbQi=RI!cK27A&YbzEt$N+lb7wt5Sk{P%TP-?1z6o4S zDUO>FjU;ikHyMlG!@@MX_0Ld;uGz6tO2sE`Y}oG%3lF8pG<9hM6dkv5^QGpewGzG)7pQH+4e%KY3A{5et@s75P@o?tzUliwckKPG zeQc*PgOgY6*Tm%71P+pNX-8?eW2>!&K2k2^3a7l!YXYx?UMZiWb7a}|x&(<8fnHpB ztl&A&;1-^$Tu~`Mfk$l8Li4{od9|G0JU)}@oHnp3>$xhkvzv4yC@Ngr)NZDe==?md}INQ6; zG*|Q96*j4tTN(5-9S|3@qC05V6%~5w!dZS%ItS=nG_E?@9)cK|_mc5unK4=Q9P5q& z=4crNJUuLD1iw?~o}o81L1a-|?B_kNy<+vFAL9~~3vn)-hr+^f-En)Rd^d*As^c-T zE(Yt52i$Je#^92HhJ$ObNpf@~Nbw+})@wT<15zl!&1;&S%RcwriXnugARoq-t!YC~ zG?1L>L(uLn|GCd@+Dl`1P}X0UgW5mX=WY8PZ;R9goF4+CS1 zxVqZ>mdTqgTXeq4T%RuDm~63o-*eguf_s!{KXN!cdwm&40u-Vf-0vbi#(SlJ+BPL< zWAf_u`;Z8TylK>}9Et`Bf#$E`DXz525oaifn_N&p4SbFMSiAJwDhhdS5Z*ox8)u3F zvh0;uF~VcSHY~kV7#@L*dm;Vcv=cq{Kh~tu)Hf9%_D)q(d=%;Vl zuN62+n(vbL{>yM3@^J7I<=71vtMMoG$6VY4b{(`~&Db4~ed>L)W&0Ucp||M5nCTbgcH{~~RV!SMd7;~r5*`b^K{f=R=~3TRdC=+T ziKzYT>cRr)Mv*iDp)*Kzv>R?|Yd|e6s4AA1XGT27;Or9U_8Ikdl~nn-?|<8O-D z-*2szz_iyP)0E~@bcUzsp#8miFnhf9+EEV&uH%&Cz^K(T%E-pX#<%pW+9eUzXMIXfjM#IlV!FOC`jtTD>f3cF;KL- z%kz54_d{cd@-#3W&!=LuaMJqn^RWL43n+$+g@+V`-yU46jL)V=Xt@LfLnu$N94I$N zDZ9rn(6iWTC>2y$GMs3?Ms zcy3VTB?2>=1Cs`|+n@6D@6SYHx8z(#o_rfN01-;F=ac}Y| zUQz`8eGhAICo3Z}0G(vIrnF2sb@-ZwTx#W~3kgQ=zr!R_u;k}Rv)|>eto@0X_g5~( z+j-ll=bkOA9TA%@6wCS*=8k)g{iouS9i?Z455L+(21JDhhwthi&(ZRw9IGHiOv0yW zQM@T=5`r%QG^NXV6}{Ua<0%MrA~`2eZ(bEXp1J+<>{U3TLSWrSf$PUdZq=3?ZN6l7 z)hFuR3qPiZMb8{GSs%{lf-I=5K!7C}*N{zGukv`It+6QF__D{@*uf^nXf*LXkG58O zomjkB#mLIrpD*qOU0{2MY%^eNR5L1on82>039oDyUfO=pZTXwo<8)1;N382+QqX7V zQGxFq_c&qS3H=lpO$Hf0IAkP4VhV{roa=9kigZX-7(aG`Mj0mGB~YzD>r;GanTo(B z^bpiCz#2ePkLw`%%$p<2pM!myP~x)a{W=wqY-o&-h^F-6wN#6K6PtZub+$&jb$sl; zZDD?U>nGv^+P=pk|Fl#m&axOJrn*erdtPk$TAF`-*z4sjOyG1R?!-ktJ_qw3;c01U z7{%$660SEyNgJp6gX!B^*G3-hczMs*`B}Z%--*746+SugxVx6f3_6EokF$5BMk?5A zAlMJ*>Q!{l2v3fqrNQSr?23|gig70x(Cez)GK8tp5Gz{lTj_S|j;dDN^*gI;o^xRn zMqSQp1`!eufj1EkwvM7pSQ1WHdMaoP=gV@b!auP(F|6)+3F$5Ps-D=>O>0#TwlOw- z&v}hmDQKiNTr}e2Im@1%?+BWMgB~Hxr8&|$+QD}$(^G;vK#i7l9l$#dyN6!c-SS<} zb(adziHc_dAo<22EJ)2DY*}4(a>SD1(Uo6KYLmLf#1r+A64p@2_4H|Ec!8tX?%}gU zNaP3m7Cv-ZiOToaKeyyd_pV{@6qb7ZKtDJ=<@b0s4?Tz|tqp18&OAs!qGkW&YE3j6 zZ-z%iQ=tePqfjZ&rWzvp`k|4uZTNL`f(>5 zH30EMzSC`*!WA2QI(T-}QJC~xGDal%dE6yRcRs>Zy)W;S8+*}ic`xOmutd{aznC{n zvALvT$8BvzG^h|6qzo(S7$0B0$GjAGT-T%Qas@;YrIOwsWoF-%w!Z(+|7}@ful?5& z!%3EO)991O_e5gOP5o*}^xG-n^pUp`%Y032Tqe!v@S2v~IX^#uqU^~HcESDo^MbCd zej9pszm1od2^0o)k3A=}!6GzhgSwcmz*XIotTV^@k#PPA)%umiN5$Ea(e83u;a-$O z^wE;=e47)FDG2<@fzY&dkUW zu4QW40ejF3Ad?CUqZ=DlVa*i`I$}ngfeF)|Oxm~e=7If3IcmuIPG+*e3ul|z2XNT> z4D%5xG=|&G9)EU@ zob!yVZN1mmlYdHl&=*YMIJWsi>b9(`@F^g_1xH$$D()U$o1c(^l{wiRN_}|F(ptIk zw~mu;$*)0O*@~ju?ca;mqW`pgEW=OH&0%{hfciYAY$iUDF~+p9TxB|kWJ$EK@dAtE zr7_9L9s_atr|h)vgtNTSDujwjGTF(Tp|_AAgDunaSPSRyC!G>e3Z)8fzqMfbRAl&b zI29_JH0r`-V{tL}HWh?gZ8(&fa2FyHP2=bg`T$U79J;%4+1@R49hsyNJ(QQv6D%u2 z$Al8-fv#C{gmiYss2pATf{~P&)y-$T#za%HuOjo(9lw!V8MG{!DA7EllolX&4t}ZH z%BcdYQ=8{*9`%(9p_W&#&z-`xF5=N|EVIvomi z;4p%HtEF?zf1x6$_j}F>>fRDrjg^7nrgxVrLtfu~e$*)T6D?wR4u{wTb*3gXEW7NW ziyf>hzrnVkfLQ9QN3hHe(1Kbb_GXUp(w%}COLTP&`WxF5><$Ds5Td9?dB2AL4mb=UYmxJM>~^Be0bN}%;~Zsv6pehoDW`1;8bd(1WLm> ztZU{BrhPc7W?%HnZZAHkG3{)&EHr1=HCZ`haQxn->x8cnGOxVwXKbkwz}dyi#PMca zXwtQ7DK2AAT~Z?e`&C}6VEXMX+qCQ<`4YIt3fEANDqt|t9(VR_X4%6yZn zV1o5Cs2{_i*Ap+{8tg(N|5Xnb%71cChU6U18HRY?+*Ru^SAe2ML}E-)AOfOA;mhiL z&F>NQ^9!iAP`x0HJejwD9L_%PR7P2wmuo5_W51a{B9lOX*D+#9IBkIL4_Y__vxdDTMOqMK!uOCf;n9nub6K z=XcjpFW>fcO?m9e`8Eq00q@G@TTcn+{O~xi*t3PTu3Wld@V9eKkH7RQ5D#4aNMq3< zRi=2ajck_0tO~%2vANwZnxm}BjUs+J-8IZAn5PHd{vwlVVj%WSKw>zC93_Q%F@p>l z=|{dAX&))vDM9l1Oop{8W*RM$bZ+Xi!`auo76s1Nv+A7Ge)XH9^f5MC6p1HSDiEya zCExSzv21el72u24Bi^+1OIRZo;Pi73jpaVBNcB}vH2#Ss&p#OzC34*h?B68;x9Zd`*@6>a-P*9V5Vwf%%rgD88#MI#+dwcW+WzpMhZJ` zcpq8Hs-D@K1?9vFXAoiaWY+dgOn=>-`<4hL8jB8R&sT8!Tn}R?jnMhBg?gm%GUvp| zd#Gs>Ceb7`etz`mQRC7tLg5Zn2$PPnhg}EBF#_Vge>(=xr<$66aeeXND&G5BL$s#L zwW}vR)3(x^S?GNZ`LOi+cYX1-$=o54JcL2KJs%fwPk`06v*k0P{yZiuj>YJzuaBct z4V>#$50JyggDn})Zyth5pAsx09$8>KljY9g8f;_F2xgo_waimM^Tl?)ub9UHs=CO# zD_v?AC2O91wbIoOt+6W=mFJkGrm=Zxd=gmlehhn6E;i}ZU4M>U(`(IZAtzA+ zyA#b&wJ@R%X5zeVgndJ&HZu>{7cGZ~$FU<~py*P*wHgt}kwc^=f}#9XxV={ZIh zX7TThgeZkZdhf+0P~dJ_60vl)gG-~eiU*^M$oQWHVw#NCs%^2tV!sXf@2aT*^`f5LY7 zK*V?-F-LWy8Ln9KUn*Fe(Mz4mqWfQ6nTUEHgEEk7$=-+G}jU$VTMagjy469zgnMUwF3z z2cudlA4^Ui_Z~2i6*lQw|y5A91 zD{;Puip%76o!O4`-arh^^UM=`kTq>?ZD|3Kcjf{>A%wK;Ro+>!(B2L-VsMPX3!djkBFLS$*SB=X2HLHX76Xol4V|-RgQM`OMQX;WPi{<7%1#u0f0Rf1a|NTwMv{h28(oO^|5O)pPxe`6s?&ej5+7O z_!G$Ct%zkU+IeP_dk3Ke1e(5m)Og^)N&!oq-xwqO(Mb1#Ks8U4?$)|~aB_FjgMMMi z;1!F7-OE0nBDT7^CRr1@9d?vLEFGEe+sj96aqd@K1a|qL(lBwIjK+gt_lCMj5IBw6 z>yLifSu-x-o2I$eE|1s@)X-D&J^-RNHMaE&<8hDIv%3IlL9=;~3dMs*0+gNu?D6fl zJC6XGHSD^oDh2TIXPB9__4UJW6Ho2A2%6w8&6CR2JV3w=j4Vvt%8sYYPAqn1)hGQU zN|QBb2np3gjl>r*12#-XsB^}f#J)kEL0jPaq2Pz)f?*dfl;PBseafIFbwVg*ol?k( zUO2;-ty%bE!0K!6pmLvx5U5p?eAS1uTxL_D#>_gLK)nDD0m+i+;5*%OE!1pKd~E@A z|7DX7(C9|YTBEfdF}pco`*{jz%_16&ux`7C{5~W_EKMve5j@6TtiK=^bBi8dHVjH8n${@e=LCBYmPt|LvZ3?{_ZO9qA}mL_j7I_-NBLY; zQ5gO6y{t6R;#pu*Gj$Vc%fl>&MWYuR#M{S+zZ^Pjg&ZH1&YTzPE52Z_?4|_S82m>< zaH4too`w(2g$~L=l>T!QxxhfNW;E_It~JiD_w2u4xmC47r0^Rr!|p|5kooBE$;iO) ztj{yhh*Dmk=#bPPYvKQ1{23qU66T#pwri#r{l7PhJ5wB+fks1m)amwrUvZ;;|I(U+ zUvQuf=#0*rq1uIu?Vg!tX0E;61+wqs9u{5)UpLP}F$@>=`Z zi~lpPTJ&G_9eWRDC;`8J+z}E;ZQi;!S@5|3>W8-P8sE{+gh&vwFTtF6*0nzA9eeT> zV!?=lb~kL_?$4@If3GpR+vEG?>@#1?YLD;0HfXvz9tYUZ%I3eQ{;(M`*_LCpj>wS)%t_+8R5o1}WIB~}TBz`jW8%BW< zLC&dz|J|I`X~8t`h7@8!n3%}h9bYFW8|@~K9nM-Y3K+Mw7g5Ta&KCSxj*U1ySi*=o zEq!)&kHqiuqxc(z`FOIL(-V6p*u87X9ghFqr&gKI*1};nIQ8BM#*tq$GBTPf={G$H ze|C?);eq~&jIAAp=;Mm}#*6+WM*j%aancYMJp-ac^5&-nQHT%`o?~J!80&q!bNc^= z?S~rgjQmEMm>Kl2O=9CV7Kc{v4;4p>?R6Ht^20OK5lk}|o8Y60;o(Ci(k*#46z>ry zT7JUT-H>`1HCvv{Ek}88k)B0Drbvabq12ExmGH!*&KufZ4_=ScS+&Gt&({uZgAml_KzLx~NyU3rCo!i6K8qRsT}9Ttsa})M zyxAokceOvFyGKVy-QfcdH$z!W?NF;*_Y&+U^4yfdBhH^^6x{cx_qtTS;rZClDIy|} zl2xW*`5GsgAaUtJ8}r}UjfzDh>)^WR{|STfGJJ~e_JhwF7ICdtxx7Ig78dbKP%1sg z@$4rwagCsMI?*WIh9929r=KY5RDiLn6qaS(a-6mLKG{cUvYA)WC}D@Z^ev2e+~m={iVJk_g%fp&6_tj z^zNH%^}Jx0(tL_uAKD40W4T%BKao+|DsR~EsZPq@$t+Ph$)3c#L)+=1$(N8pha4^1i$mr(z1Ara4P6s%>m?L5u0r}FiPf3%=t4B z`QP;BnXrTgmS+6Wn3_c}paL2XXFWS57{GGQ*zfDtp!1nrg8L&;E*>j(ehj<8|9963 zsW69QK}q(6pcVZ(<$d(^Ve4Z_=V3301a$ZQ1U(`xP_Oa{_x-LWA5SOen83a3jc5TD zD>isEq+XT@PAg={@y+{C`VV`;t+vsfnjHI5f zbvNB-;ZvjgNtU7wMBH605!T2FlxQ5w!?net@UTd^N+Dx@S_VP3!-+{WI7$VW zQH(~pT$d-rV31tOS^F(naa9r=cjRw0BMAqcuoqAtowFLP@_rd_>T}r|12!ZwPewfY zKbT-n(4eI5ONP;)_@0aH>RoGYE;(p44xwUsaV)}Oe_9ZP#jt!X>>Y2H)%J~`akQT9 zo}Tn4Q6TP4-ywYP1{gwWcDDk`xd^pyN?{R;&^7O66BkmYkh(Z=EgXqRHnV$w^+vPw zJLzDvG>OE^gZgHeOH^EfbRO@YU<`J;MqToK?N&XN;!~02J-0& zFw&Wv2-Jrka$vvL>ho^x3=R9qdZz1u3B5yytoA6^S?(w9_{2Ft@}#>aZkM5nyNDe(@$7z8 zOrkgbZu>D)`N)yOvWC=%`%M=Ym*!X9pqdT9(Mk=An8NJycdB{Sjr^LU-SczH4^K9` zwTO1DYy8YoRRK4bPr`D^`oC!(Y1h2F+oY&)!5W@z*%;xzy7NIUenPxUuwSh85o+Kj0=3# z{bPhzS+qhA<26)tCA9< z^`S~(k<1!8eBh$2k=wj0V%XE0l^mUvB{@QqmL)lg7O~^XChjEi4o>@VrZnc%|6B~C ztwX5q-T7~?dwR(jAX~x>B7dXNdKGOPeCq$=uuH1Xmz4h-!V4z5l%|Mn7tR~ov&i|& z*Qe@Wt9IL7eBi&+@WvTY5~W6zYeHppdTaazo2^QNc#{UbFzcGrYQPH4|^V794ucB@E zE?w%XYT~|}6VR9Qv~!1Uf0XS=Zua6e$ycj*#UVT;FF52L&n;aG!h3kvl%c%jNYP|V zQt4e>#?$*|@pLKI?mlfYxpp7BV-h%ouX`9B_VGn z@GRe_8GJew-ck+FRFOE67`k7&aY60e6gY_fcY~8Pr9$KiWGT50@-q)fT95F~*nZJJ z$lY;zpPaQomtO6;wt|=-O!l9vM($i0xPHvMU^J8B+Zwr4Qv&KFi z;5U+Y;|7cuS=du_RK$g3izJ(U{HZXlkbL&$3x56$8&^l;hl5souFEzZ1o|E#9}lEQ zSt=OKka8K2CY9{E@S<4AG%%&5DjzH^JrdyA)pxEf33`j@Lvkw@I4fgxP{9-g150EsI4WAo}5Q1)J}I6re`E(Ok*D7uews#=zRkNTOJ#%FpU+0swt$2XtW;@T*DhV zvNrl=**o|D=21h-qo3tmrzro1I1gv%oC2?Q7Wj$;@-JkX)4LUCrUtpqgDhA#f&{Yc zIe*&ox?UkYR_^=9;*fHUzs9~q<%YGNT0HY3QcELQ?r!r5VVWtL@yC8*Zw+|6)GW5} zZSm}3u3;9ebS4Pz>2Q~EcI4dY+co&Jge^!X^EBa`sEw&oD9_v--xu8OulsN;!|?2< z(s*zV1*(zqXzn>7g`!~%>-@C4PbsA1L2p1|Y{}aADa^ud=HatOUQ`3~O|`|b-|5;C z@S7O;O^Y)mEF>(%v3h;V>f8P8p~n@cPx4Y@l#srEv?@}14H9&3z*!o@CTK&-LX@5J zJlx|7I;ghehSF887uB!kXAU}1FwW}?aA^krx}?-u>bdkXlg{leYFZai=>^TFz`wdj z_u4;#sc}*|_L=-ESyQn+7;f|uAWg=aDeaoa-it#9i{yhJC z;S%RUvEq8c-|X1#krjWu0-scj%1Yd=;5bgq7^S!Vd^Mr~Oe71O;YPqtrRPDkaCJnM1S3jzWvFyp@{(!cudG^NUjR-w;#FlN859Qj-?xtjst7Ypbdo3q|85^3I|KZpZoT0@%14@ z{RvrDSw1G&HMMCQJGSGI4o{w|c{MWGQ~0A=$^JM2!PFL4!U+(4@(R?synOi*{6pQ` zVoQ$-kk;@atfH{z8#=x34?bM)!HLmK*;)nQ919OOC&IZpPV5|p(XtB`4LTZ8=0~pJ z6|6EiWe5XI&NDf0!Ua$VHrCyB9LB64NG30{zcaN?vgr@0RVy}VuGpPi zYI{y~bEkUe$&;h?D3h$7PXRjJE%%sU)YJhhNpWpNX?0RDEpDGAto1lz-UZoQn(iyADiDk=?1WNITEGG|pgvK3R~J$`?9 z*#N5HdDaAEJm4+#g<(kH^qr9844QE=@q5B=9t1HSHr=it&d$EpEaD_N zge7_fy(Cu7nj5`GGyHQuTzEVrU13CjEt880VIKAOjCPt(N`7=>?j_)YX}6A&;)x@) zbFna8lRWl+XLlNwJbKf}wac$Wx~7wQlo28Lh|KGFZ?4v|#E?&bx%KrWv(J}}l$#Ao zt`zNdB7!aWeEgMyGfeh=VT8%6wiO8HxJ}Mz@%GkMxhdpDZ;3di%AQKtDnX_$AT65nUZh2skQEDMKEH#tc3&7*6-QBm=G zn;k#CzK)}hw@z~n`?r*EZNx8;vsde3qwRFauT}-`x`H9FbNn-#?D7Yio`8>5G{Z^O zh@N+oj*`i)(9)m-fvKKXeZ0STUw!Rup+UU%^HCxrejPZk@{(95#wgup2Y8MqSyW<= z=MX9_(-MH11{u zk-Hw*6rl$DP2!V1CPD{OYmc06c4kIBnMy?$9p^CJgdEHWGGEX@D4}RH45|D5t+!M7rh&|0JY@_-1_Sb+p*)im*?a}_$ z{d}M;SEOm!T)FPxgiFa&|6#t<^?b!Nf5*8;T;4T=I;wxMTJ}c`Wo;P^nJVh~_8UI2 z=f|7bEqh~!HbEagHvfgUVpt>aje@@1T0L#YL!6rw)}3jit4J=JMt!``_^}l56131R@iGf zt4F}+{v{?&pg5!1d)uJok=}2B=oGegr=rG$H4Vk6j+(@6IHTrfu1g*DD;}=lt{1H= z4VA5$RhzClbg%R*Zq<~!jMX5teoJstl_q6*`@i4e6sj^^MXvXVbN$Ru?zNqsHh8SK zQ|@7eNQM!Whxtfe5Z?OrM|xYt|5OMig>6m1%iN1 z7*t0DntE`FXlxiBeOII3X5uThfrK1xHB()0A{N|bUFT9gO?L@BG|t00lNjB2{d}~Q zkIT4Jn1$cLGv2fl3y(c|G^DojjLKGeoXZX_QmEHIXedS zeQQz!{8)_TA;+K||6pi5ZqcPv=QD?mG%lm0HNR0wzR|$N-6d^#L z!5%S3%ut!wU#?&LFxSFcDGLx9oy(nw`%DB>Q!&DVRpr{V9PZ*COC<7(Pu6g6D)zDsc=A z{6hfJU*WNsx9L-jM>Vuox--4xhZv|Mj@`xa5q`UDsPO@2{%1E6L$t_A)@uxPJ$>K* zkxXvKz)l&b0IgX1;RxB{`*Fc;lWPd`1s(wIhHlg?`ST-q1d zP8A@(%MFTxo45U$YqS#_okP}xh;vx^|D)dHZf$MtrQEx|qtR0}u((wkc9Q1_Hj@u+ z?ZwU}=Y-!&&lO1Dy;0FoXR&4~FFQ@i+E1%1_#&54z z`~=%cjv;VxT-50CJ3k*%XrLet{AdngD3a`UHV!vB&BWk^D-lS;pLf@#MqL2fGE=Pg zD3B$8soeKDzs85ZmywX^d|%uW-0`VSRwARx4H7vWl%L(S1joe7EWSLurK2WAA3fL* zxmz9*Ee00-_<)5oE4jjHsMJXN9X~7>rFH@kO`9y`qL7l&w-sZb#LhTa2T`KFVeZc{ zwlLT4$oO29sS9*0*r^;@q1FFfVh^d&Dls9_Ba3Ph8?-4(g(z(+s7Qr8j5?}m<9D5d z)rFzIpTHkS%N+6WPr`6pl1)+TjG<>8IZKu7a4Do)hg=a2e?kNIkM{lyIad-jbFJ1s z{VwT}CPPITTr-!x`Wv&+LDw05p79;>@MAS3UJd(VyxgMi5(*s;_qBMFAEhikqH}IG zGj^P7L!nY+B+jQf1`!*dO!*kdkPej(okGZ7s}z^lcu?wPR`F2@jSZJ)E7m|@JOlz5 z=9jlx#qUw`q}e8T&i57B-W0e_HCm3xVm}=_-^^s-Psy^cSy}fAKy) z&b8%JeK!pj6Y|BZr)bBbaM-DgONr>wAk446MC&GokuG0+dkF2 zNm+ZD*oNJV6HF4v{V5;O3}U%Wr|8RumVkb%Ov=M#An)d)Z}M1Th|mi+0OhDVE+~;* z04R50d4k@^DmkHxLRz=4rO0pZ&*To&o5aB~;yi}%_4tsr%;v(;z<$$%DrnyVLqA7s zi~0*{I0R1?*(#OJJq+B>t1x;=lH`a>G{9Vb%Bd#Sw#ur%yxH9yysQ<-d?LHz2Ca z@wEoe$AOxS)YX&?IJyw)$SkC!uTTRqv~yv#xgTFPm96OHaJ&}I&Ll|4w{Lk>CXHnN zF=RK_^N9Kao&$4^BNbb5_f5TL<_XtSspaRuF|?T-x?TS>GCZw`Yjp)^AKAu1s$oL@ zYki}5+vny?iKO1v{AD4b^!J9ZSQB&peP?V`Dm{ek;v_xw-XQv)f0n}%zT6nLsv}7L zf&r>rPTwNzk!VV%?zG%LIK^~(1VceFprSTYfGDBz;(KV zHGezzvgSi$VPBuN|H7rC)k^hjo%A*sgZEz8d1akGo)Pe>7!s;n`dSNSguj~5Ifk@e z8VJI8z?#HUeOJD3WPKyu6Sh0?4sJ<9N?;Ni`OPShz5zI^!8^jo-hi$<=MzHf`I<~0_q09uNCMJM5lY9*! zVb;6p1$l`>&Hln?uE9d9nE|M;I`2&g|7y|7w?OD@@wF0lF2E2XpupaK$r47|8vh3^Oqf2 z7&{)}|9kr(Uh0xLnVU>1l7>GT!~1UpQF0C>@{GKra9|A;j-F6-$=X%^wzpd$)831E zEpC!S^4~jIg%^UDa_G`oOugRCwnAbQCQi#tcD5(_1mi{!IrjJQy+X3)t_PXPH~#)U zM7j&QOa&17ZS&<}CWRpR*cPW}ImyujT^9N75xqV@l)th02{7Iv`rPq)llHmjJ8=N_ zZ}7zVmU?VF*5D$tZEK#+ni;hE6L3VF$!ymkb;`5e-pOhCpq{0sAOK7u;IMO&mEjDy zfERhuFLr!S>+Kznwq-r0r+6nm1XN{MYz;`^V19c_Lf6B;}PtPh33>%m&r8~E-CI3 zj^|Cc^n+oY)v686E$PGc(?^LiLEI*sm+Qz(aZ-V%7Yy_FIw8MK#2T9xQ1ai+NU6oxS8ZH@NV-O?55^>?Dy> z_e6GCvtm-Q$=F4#jo(pyGVt9#BvLtGK>8y;w16$>_PCs0=#6*(udXYPhw}UWGh<7( zwAhy{S;E*8SxShAkbU1Np~VvNj6!6{5{WD!A+m)DF_EQ&Y$3}GLdc$s81uVBpX&R^ z&+~eD-I;lw`<#34x#ymH&pGeYvsZsb)~A-2t^?SOTFVjfG*4bah+jRFBDF#Y+d(K>JW?2Tg*#aNU|Ia+yZy*y6HbMr7(Y7Qtm zf;D?SnYv4BO8Pdm#ketc2Hqss;R;w|x%gIG6##3lDXCqoIR~OJrXQakM`V4F>zFpA zKa@s1<0xCo;9i`c|E+IIh2Iu7Ms51yxZs`Y-4l7e)9pgTcUv58D!r+@G}@|I5$o?= zZiTNhzJANct*camoy^Or$6~WWCt#8$8&omtZ5^c$W#z*`_0il3D~h+;)#n%H=hwFJ zG-?5}?}am!rOwoxrJ6cRD&rL0LOn-8znU~E8{g$`2`y8?ot|qT0*EtUqoil=*4c)i zCBC5m6WLqx`Gu~dvRUi`y_bD@S3QrrZr127c=;L+k8>JJOLTq6R<~;NGK2w~pN6Fc z?o}uwG=h>IoTaculyRCrK^~c13HbPTk*B0*A^N4|y>_GAAQgkWD>OHUVhj9HYH(gN z6YYJ_Y9^3IGNI}60*P)+KgZX9xr!~_4BT8uM%I@q`L|V7tQCK>sJHNN9XN%YE`OjiZ(;veV?Y(glkM7u(3fbhi+PY_qayW zAyT<=k+(y|R@K*0|Du0^`;S|Ciy_s~5)5z09j}$8GkxT(3A1fu0sXawS|~7gh;Z=P z81?sl4Ni$jt6-COdxO%u@>}&Nc#~s(s<0hYhdrjB`KEbm;gK9-6=Oq!eF`Q;_w)^+_9_Ad)r5s{8k>N zt2|K@xZA7=fI%fb{*ZiVHahfBQEj7_BZR4A-zMyL+wD+xV35iG%4QUJ^?f=`AvP3udK->V&)XPiU! z^U7t6;o5t*oQ7v698W1^9#FN$O7+^L=Dp^|HF_kZj;-?wJjR@Wv(74|n-9DprHEMr zkyE+~$w~xoeziv0;I#wn9wB{}rxI@nM9@W!XcppF>`z=QI{VNlmDsBF^{5Z~vL^mU zetTcQ6e5ITTTO09OGCr)=H?x7)1;wWlliiq1J5sBmlY>B*f`IX{$>tGXDNANHvt0x zb!YEW9nrK4y?ro$+Pckc+GR7m6?QXs9CCbo@YjG;DVzW=J=YI9awYY#n~Q74U8dwy zgJWME4PKyy^4rxNbri|#|&BVMvn4CZ-f6AxBxJ&0*w7i{7GLI8}%OHsc2l5SusL z1?$Y6Al*+{=R&q%sPhlPgJ}uWK1d%%A0?@CCW))?l_Pj6ykeG_3E1n+3VmUr*Xvcb zXKP6#P_up*ywxk$K~YE@WhA+rOX9@}W^vg?J0t5q$LJj$CT$%R#zSJCNX!uwZTkps zm@#d3@bOwFm&AG}b?Y#@I;iuVLZWelSL}mm9|VyXb`zhrP)z4TvyF@KP95?iIh_L- zAxe41Ai=7T9(Fm1LIk02(jOBwKx{oN6j|P(vqbB!HxmcM5L!@IoHGr;zol_pdsOJv zw}7x+jzWiTW7Z{cc8x~u|*5z5jZxB0;=Sp3hT*ui6hdQ+P za{lL5Hj55yJ20zqFsbQ*^L^_2_lUg7d6IXtg3s;OjFsS3ZIle4!m?f|w79)QE6ttr z*L`7Wdc7lxjCVBQKHSSX_DPJz%sAQ;`2w-oZdTU_@>u%i`^kL4= z$+-&<6en*gol~$UoNbvueXJg-l8^#1X7$)T&v}`h-I!Q(+r-p#=OEz~V*z+p`|==w zX;e|^E*Ti5z$6z?KRYAmJqL*Gd6CuG$dk+n?)%H-Ro9_tdP#p$f zbbIyc)w}JQOFWp7%N2^TyE%w6gw65`@qMASGF`zeN|Z`Aq}Eb|w&Tv+RUkyec>!JoZ(#$ z2-lz_z?Tb{LtgkoI$ydflvKb|8VNZdW#J{;E1U(qKvOeqlFFdAL?wp4S1LM_ic$zw z(Cd{u$7lT!J_b9lHS4AuVK*;F<}Mw{d1>4(0T+!ZGJ%2;N&9;VSVyL71!!6aB3 z9VB-Ac>RlZV{kv%&tTO|nPzia&G=}`E|^i5Tfw)S}B zwXL+!im2NMHc5!;xt_y-I74jY33o1PM$QPJ&cMy(I_CovmNPt3o%%JuSLo2|7(y?A zG69l*TSs{xTY8|ilHeA~3$U>2vf7RIh|S0<8gChxd=bCAC&`M0@pjT?%4f^(L zh6z8{^ok^xA3Vk6m6xy9Vp~@_kn)FoU<+6{UKGEC?R0+0j|3uv|ByJ~xrjr6a&-5Vg2+x zu@s~TipuJy@q||adn=>(4^rAgq4fazd_*CbeTj}PK`?^;oh^c%%zh(7!*R+d?r;_I z5K*BG={bW?D!>bYVlDLb4rC!}+GiVV6U+#Mw)A@S`iIJP6yBn)xq_GHAjw?JtkaHS zJ|LI6a$)`#@RM-CiU$)n+z{bTmx@fYzL1tmJyO>TLQr6oERTzc;h5^!CUvb)Ye4@z zF)u@YKK>OG+ucSjm5WSu9{+gJw6F;VU0{;@v`>zJt7XiWzW`O78fCn$soAUs+%hF$ zA#idIP^M)yY&zKJt=EvpK*M>23Vp^QhZ9GCA!v(NmOf{nNTY&l4h(m6!ulvDE^9&$ z+qvSapp2sXwuZatPmxY=J#o27Auk)mAzZ6SxCv^n*zs`cf+J~6;k`ryUigX0wC>pp zB=uYT5P5jYXwa#d+wY#N^q1tVGdZLRwVoh`>9~c+FEF(!*!^P0smxyyI3m-iBF}(x z49?X597O#3`fl+0h~nfphxCst>VQbWz~rA2R{5Ln4SIHHW?zgomR*=7-Kg`uNrwxb zJ?BBX;i(vm&Q$ilXqE!zcbf(s8*D#2z(3m0PNrb?DzK{q7Yic`i}%1()$*N4O|2#7 zECMdFILIvl31}j=17G1J-KUR*)03~=QF<3wU~@#~Fu2Ga)ss0e&+uz(+~?h!lD8$? zbxV=(vwXW3nLy&;!q2QF8>HE%jqvc55)&0d<=qX4n=t0U`rNqfBDlybrbC9pJcIN1 z^`*M4cJ<3E%*O70;5KHn2GhT{F@fwVXK>Y3Rn)gLLDV!r*L50O0{=l~vuMl`cB6{E z`s^P<7!&2l{?6t!PqzyFuWWMiF zyCz7R@aY6dg`TLdBwCnE_K3X>yyG3pD9=TJLy;_LHosbs#UXnT5uv_&fzHyNJ!UsKSZ~nP3eAa6iN1O#V->2ExcfjF`zT(uw$kBXYTj2rPHCsy@ z9G`4XR~+{gTtJuMPe=tZjNqJ^Hn8aR>&L(f8@6Esf|~$H%qJ)CHG8=h6mcvg{hxu( z11T!$EvmCY?ox36!8nUN!tkKA2^^!6vlIo^m6rNwr$n8yCo{%x)_D0$_YvdlG{Cfb z2R6p%LAHUuEdWX~0}K?;3JOHOt<=>iCnIe*R^^j5_P_i~TA+-K49LIc-W?Y=e*HBW z?F9hVI06_Suy_GHHpS&&fQ$?hP69j91At`%JZ@w8Uii&SO_hPXpWs>b`sy-b>XnZg z5NbO~>@k=-u^z`hs|8$b+-iIBIzh)RcA@Lqik({Ovg&6&oA>@*zrLjGa1HD@=r(Sd zD_%Khr{dpfZU<#XglGasH|vl^wmB0Z^Yh3usgo(L%ThBAyCJ^v<(DUuL=gH{4 z?BrdZhui74d`J>I8=Dl_|3neQdt7%J1cAlL&PQzj^16IS`l&~W2C9$AsXZiG6u4?f zJButTPHuipe0<8^>rzRXU)ADi zrMTPE)3afkLpD96<~LU|-m2Sqd!=_y#HG{veXi`i9WGXgw4UR!exvAdO~O*fdL`cj zyRCZ?35V2K*STHCWoF$AdjgdCQH4q|G6zzMRZLi_Lu zj3TsvXRa4qz`9Ml8pX`FhlHZ7M05W-o}ScjDD>HB{uh1?`>id30(8)eLRZQ3VT~^I zjK%j6Ia#gFqW3%$=xyDx{#cd}UIcl;JX(VqQe1O1xQ7)qS8`aB_ z{Cq+~D9VsH$(#1n)#dyVutExc_0%nxNRuRrd=)=mFd^KncUM>^9fUz#2HY)bsVZ@`sxd=CriL!(L+3$(MFUpRb zrtpuqoHSE_y8(6X5{>Ff=Tyu8mQ6@Uu>rAal&}1NVg{(3uNXu4zbgH$oP%6Btkd8r zKamGh2nJiYFVTVZ3wezsuaNQ5Osp1IZk<6Bfl^-Fo#3s|yQkf_wl-CLZfI(T3y)A& zX_qWAu@}_nYe8+={k}54&T19DOa$vW=@r5 zdW9!=QpOeZ-iW!OVcD&)u?C)e@HfcT9xYzxS@hpX2mscWVa0fUYI=hu!N>|?y|p1^ zXsC8abMS$8Omwx=?We~+gII&T)vPV@6l>d0Xn{I}K^)XZ?uBfxFx(b*@QWKuF*D7{ z0k*k+s-EK~ktAVPK%G0!KyS5))GcY@iBVx}x^W2e66Ni?)Qf>N1f@;|8yC!-zoT8-c!d6c5610-IcIp{qBE-wAZeT zC9@g`+4-YGG5=l*$a)1ZO#YSM2{n&wDkxYXUy467N8}&btv$E5xR9%3hu}G~&1YLu z9(kw4Nl#C43ONH*gFU57$P_!6v7ajHfQ(UgFo;t+|4>rBO*?8;bXNn_dxBcIcS%$) zB`#iOitdn%QC_fvy4Ht>2D`oF>_~}*YC~C#Pdevb+EfoiKRj+185eIfWxP9M*k|BQ zvzestR4*xPwVUG%{VvQUNlH0yPYOUfuUDxe&}xvQ%ZH@jb#2S&^-|imRt{LA4B(lt zWcX_*8_aKE&H-Cz%Cp^+aeL|9^SFN1W_#d4p7rLgegSp;N`?C@@K)toZ<=lV;w~`m`+9 zn0wXa5Me(lu&kkpL|g;y2wb^8OX(*iz>r2;z8 zQYL(xosdP+BF!1@V>g2_ZQ`~_s4GtU*xxg<;V5=^IS($h?jHzARTeux=F z<<1g_SJ}L)-N1pDBar~mFHuX$nKB|eq$~{WOpVqJ6^=>bUlVGy~;?P2vew}S`r$*0&-gl@fp!^)$OzYS! zPi_Xk;RhHG!y)7{&3!e*Mi?zC!EVbvC2ieZMem#GU3%yM=K90N@Ls#*?kXXjVf4Pe z5E^Z{B0>$N4Ua>b7XBt_pajpE$=o@KH9-k?u3FPV+s7JXNasQuVtg=>Qz{8Vce)wB zGE`h}JN!=tA<}x7Z!HQhx@}1fOaxxK85xr5SIg7`FmjBx_)h>U*;1?YNEn+CA^CH9m#{PF@UQ@ zF4skQ^WhlyGJ;x2*13yk)Rr606^5ZNF|p#)xaYQ*Gk|lh+}*?O^t;hNVgBs(@S)H9 zhJ(2Y-BMfNZB6^Sf|e`&lrv6SBuWc82{turi@)+`_Yw2CPufyguC!K`P8N>Yi!=|r ze!PD6Vub+Yxpo7O%O1gzV0Mwq!3y;rCWkB*PQ}MbCyYDhBDBu$#gE6oWf`}c=kF1} z$OPk!9&Z_fEmFLUF1;X7FE8Ww;CdU|tk2UuUOQx(Z&E`O#Dj_aW?IVl5U#BGl?tCw z_QhYE&q=N^eDCdg+VQ5di;upYAAxdKc)BC#6T3M-75}c_yj(F|P^c^_f)e-QZ~(jc z0f)2zD;-B#cB#M$%?l~0r({QD4UKnm4a^S?BRPl)+YCAZ4b-H14gt@K&vrsr5KFQn zhpP&dj}-5{Ew|Y2z^&p)tVvDcvDE(h62Y?m`g?Tjvph&u6jbu;c@t^r7T#z#l#7{N zx4Wo^$afF~p+6ZQZt=YDug_s%pJhST-}4@g+kbR`RDu8*)o{jS_yJ(wTc*vndbU-- zEZ$_SQT=7(f|4}_l4?hwag7vO;(K;))@XIOV3#75vk07o&$VnGOaz=57X@b6ZaP4N z1NuHH+0@XH*g=#sFg^+{T_+DkRBoCOaW z?M6Ln2zu0cSpRglLS$RGFXccU95Q3~9n%zc(b_;f#I|t!^LuY%-#xz<)7nK`;?}Qj z_zpt;ASZ&ajFG(awz$sl?_e;aI!0@X000M|crcUa1dE-(DuM1n!^ftW1^{IKLszSf zpj4lnq)l>U_E5vUQ#f)p_oX9l!&_EJuFVS2>pW4zPLP1cx8~EZt!$f*b6-*{a^`VW z)-vAg}@)P*9^N_g>Zvk zb=u|;U`HD9LC(Rgyiz@}c?IMHtoV?t*yht0!mgU)=k=4ATX$r)OJWWqFK@fB&HKQk z3>>y@;~RvGFcM6(n3>?zF@+g=LzaINU@^)wU_+ATHU+eymqj-apR&C2l3& z!It!f?W~sg_yh%^Cc&3LQem=I`Yaq*qa76q0i{=@`{VMDf2Dx9tceQ@qEuip0(gdSabKyX}9lsd;1B_wD|vEsg4l*LxETUD&>@&<#Y9Muk?h&y}kI%N;D> zfX{^v0t_N^5SdKk-?n7IHCKPulta1@ntvdj&@3ay&|XWlRb#v*?gyA{#kwXf zc1>6rDx0!nRj^Gt2at%fE$2|2PV}tt>YxdTUJ!O^!I~fkha3~ncXX6RMwC6~8oKNBffNRD zosiN!T2aKXIjyKCzxkK2OMcX^UZpVK`7Tr2-WajIl{)0WW2Gmr<~>#yC?`Gbwr*|@ zgZbDM*9>pu`OS`*2>0Jz!4$e6CjFwM5fm^~v4u$vTQI|(W1rrE#;l{;y{y8^o+p^i%Q7tqpxq@53NA)nXBthmAJYjU-VvW z3CF@<_BLIdw!VQzw>=1seGj0P?8YB)K(t?zPfPjFsz|cdZlz^1f&>-FQ z1D@mm{qQ~?pX-|WFbvn6z1CiPt$W?~+DQqdUDx-jFtG_m^aLfP1SO;dB$J7;W&ZDv zI@q!t5+b6)BGy8Jyb^+v61*bf;ugG;mLd|oLK2n|A~qtn0)oNIqm7L!l9tEWtoCCP7$SoM7AL&qF4p^h z-R<(;)|U%RpP#oJ9Jqp4g8tXL4R&pJx7Rz@`|bNvzQ-GLXMs15fN)P1|)@Trq$lAT=0V z+qy*8Fl4yY_LignO1Jzqa807QYfbCMF_(05{1CKTe6TaFuM_T^Xpzpq-E8Wm0H3C$ z?&Ku$MeOim|vql~O8Sz`+A&{}&=AMh9BzoXl<>ZM%frDm(bVSA#`ywZPP zgOo6x5)Y7TJg5DAY=*d87DsYa&5u@AdbSt zm`&*CXo#q0~;vrd{mRH1u-xV-#gPC%D)+kgN0_YS%;Qov^HT_cs36Q9Mu zCrY)6{A1ztv8FzOn4KGOM+7IAW%VIohxrWvUteFn5>=|4x=Yg>A~K=-0z4_32$VbF zcmi^aMfWV14J8;KkMLgs@aoHk_UYX(NCBHSV%9_Q?MQso#wYMPMj-imH37)+(1E8f zxEIy3Ce-j;!(d@)YHbQ>bC-kaCF)Htu(hdLf-oZZhJtLj_CVQ9y{C(l>f9# zQ^NJ#;pJ8V89fbiY<4y){CV$S*cQy?papv8yz*}AyYwHgq1FSY2HEX}eKXZnU5A}T z?1S$0Q*MV=r;mNMLe6cM>p0?z{>N+J-Sy%%9^*31)Fkj9fIsU5@{_T}J2{CRQjIS+1-=V_Q0PcfjvfR07{=kZ##Z`gqKeFhx6a{mhShOZuS_s|1z(7}EE`5g9*m}PzXxHTJ zi-Wgccm}*MtE59Mq?9^Va%xlBV9+iSjnn%@vY%IEkLad0{}@3_sLU3vM)-}6xXCmwb!hSCZ|HT{8<&YveLh*)rQ?I19OOaqOiYY(pwR4- zQ$G9SbSA~Z|h0QrE3`*Drc>}LNF#^ByoX?}cf)9e) z%7v~2inwfN5ZV#{M_xOO0QjdR(5AdQGWI?NUGE)8%x}1SM58@{xBn(W-&Alts<@~Sv!@~Q%vq7e0nmgI<50B(Q-KY&e zEo(R-I(J=;01Se4gl`}_7lF-hCy%(KviJO|jbvW*i=Do^(WHpx4}gcJ1$+{t;%(g9 zliB(@7-w0%s^NW-H??g#A!1Oz*s%N26r_X6Eib2FsR3{qQg;DtS|b6Q2`DYC!0Hy0)-_ zej84YN5=&{X~hvvauYCD<9qXSt7sWh?%h&XfCBu0noi>Y3;B03bQP196wP+LXzh1S z7i97+ig=^=G}ma%#9-FHF-QeYmtuC-3HG9l^UfezS`k zOYqeoW7IMxrQuVR2(nUjb%~d^oh5Wruite{FP67lbe6$}2AkfE4t@)p=JKtI3k8{? zG6QClS2pAEjgk%}f=-}~XtT2Ce0g_7MTc3eCJi_TpRtT!q+59n1~TooV12&NF8uPQ z;PYqnJD_%`Ui^@TE@8LPU%5keB<#gJ9(s|+krzvV6vbHu$C;<#j9tzj>ulqQRX66Q z)s(+EIg`IVOgJ`59dbQf;9hJC0I%)14ZeLQ%_luxYiGW~K#>l9+1`8A#Nm?klp|+E zK)r(2@uBjveHV53Es{x{dZ0!HH}n=&A**&?UEE;*-(d@u1{5R0cD)=`iQ}(dPP41C zrp+O?c79OSCcBSQ0(dwyhAaX&hi3$di0ib*rj!TYlfhT6w48rU1dcOL3_Q6)!tq6v^YC!Z$B zSCo~NT@QTKF1WQ7pta1l2bDM|>O{rFZf$zrQ{TVBeg|vI4JgpM=)E9(gQ*SYX|u`J zVP+e~92k44X~dyQ$9gkFeax37CuXCd_}#5WRKen~Rh!&c5PCPxlw2C}^gGGv``(sK z$=?Nf+c>$Sq!!tpe2G!dCLDNX5TZ(q9o7F82a)W{l@jNmDZwTLVlQJMG*`5XUI#mTAlo~`x%je43(yL(p?lx z7&>YV&{6YfTgD_q;C3w#UUn+Zwu}1u`o@yo_$XTA3nb^^rsbUJ18M2IvtdakZ!W87 zo)9DJ2vet1a&z0KmJBWjt?~89Mq|Ms6ZgZsk2kLnd7wpn&iHeL{x8{1Xj5Lv{ddq6 zSUzK}prxYEUWTL-TT z+0DiN1@wluBK8Ik3;1KA-}k$!F}r2xRhwT;&(_Prbs|+N3=^Y^qCO{2d6^p zBcVA)kTZf+eg2-T{*MvnGj9cjj#jkJ^ssm-ID7-#rsn2?(}jn=j+z(vNf-d`4aWG} z#cx$H`X^{x`r8Lue(l16MqycvD*>S&Q&N8!5o*`hz_QK6Wo7XyHavYy}c;+-kBp5Dt75hwHMn zhR2>l&jn|>ZdEa8@haSWDUdssO?8duC)nF|rS0v^o}Qjx%gRCx2B;fIiHMZIx23!L zMZLYfdFRhKC^$Gd*?D|K7j5r(0U0>5yATjhXcoIm>^F;`0;EnWTL-t$l0d;|K0;+&XqLR&@EJ6SU*c zBS8{b$O!STK|Uy&+9PA*^dFm36uSndU58@ru9ya z-T;~?w^vI(D-I8X7M&lzYs5!gLB88jPDIu4{2Un2*3}iZG;?(oq$0$zwB(UD-`(6q z&D7d~w;1DFS|%njfBwAsQdGpo$%&`;Ik7wZrR^}WU|3WiZdXV*RPZk4_wP;%4o9`E z!W|9S$X`%eeFSwWtUl`UrKkHUxtM|OJ(sCi(xkbUfg2skb!{>a(}r_W-c96hrCC4h z<2zY(4Cg(1X#4F?)fKFK#OZRm`AO5AGTYOQA*9>Rd3bp7mdS)PTMzDQz;wDLaE&q~ zfPXMY_WDvO@}8{uF3`p*!b5LlFAlW<-9Qd*)vuEd5-_L`NTs2oavT{M0f!BDUZ46l zW6!+{FH;xejvK!8ER%Ct{C@gAU7API``*}qOxsj`fB*A1zwWqVS{$?{z=W9=zU=^n zqiF`bGZ=(%;YB4c;`l4yrG0vDYKmQf;8-LJg9B!eFE961^YTb>gSE}fTs-ffS{yc7 zpvDe9dPE?ULCiCtST>R0*2YvGQJMxjn#g4Elk1vM68@MuGIeCZbLdrG zPxyn*E=9_sc=~{$->wCfjW>V8>((|h&)V-MmiFV*eqSl;ZwQ3Lk7gbCGo{@X|JdZv zlG-6JItd&SK2GZ4{>daRd72p-&HWRxuJkh=+>~BkW<=D|yjB!@jDfh@nW+^9=6p7P z|GF z;R$(Dvs15KU0undxwM(0iRjhgtRxoJRv}BTOk3aB8rVMn&tLPLo-vO$prd<`{(sS; z>#$M6Zs*YEyA?Vgxvu_0Jt`(jOMQ^;BWrTlQ%b9XvB-eH0xIJoP%S*thB(4w>l9bX z(8a87>$cumUv$9o4dYW2Lzma!U65)(TVp|WZJF7r)iZr7B>ZvXZW^#d>gIW1sEPkoEQQvd;$gm3ppeeH4U zyKnK4LYOvO9oz6zcPY~7lOL&-%;cZXuiHyD*YcrbC_}%w@*w$#4`ZL25wWF16yf3`+He7j@(i}x>(Y>JNMaIlk9SotRj5wY-iG&u8;Z41m;C@ z9pRj!#oGyg;M#5^CmUlY3eU`P`xjZ&y?W`*8ckHj)3!#_sQ!2Wyce-eR}h={uaGn)K()6xLHvDe z**!)nkLjd{ox;3qN%tZ%_zmRuZ4|YG@Y*)iSkeI3gESd_vUXRcBeT5Jaeg3_3q1ij zL6a~!@Hql2$7pPzhUdWBOJMFT5XAGejfdxb=}Q%Uek?@NlYplkykw-)T8~;y6VAMr zlxk;ZXY(fBWdz_etMM z6Et>pWkBUaUB|-mGgl0wkt#}DbODso7x5|rp9lz$vvbRMTUuWvRU%k}_=oE2Fp=Xq zvrl94o#6e~gTr_o(cH0D_j?L3*wU z%GU4rXU`r7<+C8|;<2W!Ew0}nwqnD3D^*Nhz9iAek%?|-JEAF#4Vs}jbAoEp-9q0^D+P)X zon!my_zx5bg#M^r3?L2b0u$bE{P}&%8o;x5sNwp(y2DXtJ>4el{rObK*c%ZpZf-0< zL|obcEzZV<3AG7Pad9ed-fSj*6`&>7Dw}xY;-aRcgw+H#ITr6vZlBVOql=1*mGTgS z=a#e&=}|bqcj7MpA2p5zwac9s#sn6$MW1YDo-?-w26OOL9aOY`QRKg;CeR^pA}~6V zks|weyX!SRGF>xCL5}8$rvN??X;jQE+LqTpA6fVycoZMCq_Pm$O^YBx6w{eivGMsA zMlFaS?8879>fP)3sd`iL+R4aXjCMrZ zaiXCr!iY!J%S%j0SC@BKFG`t>i;56>efjd`b6y^Xjg8H{%C)bhrJY}%B{PUt5*BvkR&Bgjbh8rhw(JD#Jb$kk<4|#2IKlngIXH3VUPooFykMm|TVL^(kVxqFhrP z=Soxr2CJy(5y+!Kz5Fy)c~bIoe;u=c7DWwh(vj%LEF8X=VLge%uxV^jpfT>I9LRw- zYjNXm7cM|bs}jsTp7}VIcvh$o12qrT$-|6k|75yK3eR1VuVJ|riT)6qp!a%y~T&jou|dwW$Q%K~b79L#BL z8-92vE3tKjAg6n-`XenMat>qnon84fS)m=7$2R$i6r=vjGj|ROS5!pf7F$;>fc+g+ zCF0Kd+p!m-x5kGW%4aTu3!G-J_v}E%@AlK*w=e)Ae=WEpU|6*SgILdLa+nzw@)_WI z=z`E}a`DoJqvDZ1%qS`|3Rw5A79cv9K%=ZBWnw2h68Ej{6nmX?;% zr94ZO?Cp(HRn*iXy8^0t9Du4>E;7YfwywQQVlx_8#}hYY4^@F2Z_V~nFtnl#9G@6p zB>TG2tC$s*HGn17+KM*`zbN7oyS*k4q9W&UbvzQAqB9@FH_Od^de?UMTANlhn4WqxF z-I+HJQwsyl4cu878-PT>>1q5LL;ug8A&?w!^^iq zu1lWXY=X&5v78HIGgBIAi|zJrw%-!}cBjP1?>UB9@A2N%q*r)6d2J{ILfDDAB8o`- zF#S`v3U|bTKFi%(e7Y;d<5nI&J(f1RQywycfYj78Mu zRORfnC%Xqn2gIS4JN2yLP99ZB85z-=n{T$wl-bBFt-?+G=qV|&qLnQ@K`6)9)YM>e zgWv6(9)@;@yCkN7&5Aq}eR$iK;tif9*ArMGF-yfB=cV^Q%{F1mQ5t=RGbOUdHpn)M za$$!{QZRqta;t403GoZrE@S39Ho9iU_=XEh*1&!Q`K)9XYNkG-I}fvl8t;Dpne$sf zyR(?7&4jo(2!7i?Sn9H}8_LxGS^Sb7?7Qb6&CN{|9-b<%qaXV%p6wWHK}6}8QRWYPJ%3kRtIU~296267fRDQTkxLSiB^G2`!4GN- z>gq{40rreP`He8kny>p1#UBk4@wW&pLre9t6T8POCv(%bSC)5ar;q$bccM2)7wV`gpqpK zTZ8n>8pOZG>7P@}N+b(P)Pm$+FP4cT8oO#|`}zb%cJ@iPwi6*CPX+26a_*rOfb-5< z$6gI!dun|_ca@b=X%MFieTSzKQI`>`;A(NzFjFnp{CRSyEf6!p&@=%LcC}SU`!?^d z$p!kIY_s*hoQRiCwwjXbP?9Am7uuF`lgNKB=kk%!u&9g(8#Nq^s|@PUQD`;CPdn1BQXyqOkMUb|WV@yw$1nYeneX}&Ql2P*a zqaycjl`b2LZaO^Lc+wNM+5>qGr@`E>#bx^&mZPwCyrJ8+{=UA0uQQ9>oAqpSC~BY{ z>w+Z6aBe=M4q8Buii=C-kVqW_NOyNTCos1+Hz5kHuBpAS5NBwp(?;ogD(_F^Ln|1= zw+rwkzLL)EE+Jup5c%XwC;3sX3({BF8aL~9*WP%uz5`vW(H^JI%#oohw%`WV!5YQU zx+csS$IvCTYCom%hMEPA<2-4Fc-fVWp7ij6TT49VBgVyg_39Pk;=rQ$2I9mB>c#Ra zh68OElQ}i>OG^pw$My0qTO!&I?>K~7P+-{fcaHnvxsqm; zBTJ&=g@lKFYg-%hZRpp6&0M}EXfryR|U2%VWZ}D5emV$YJz=mUq)|k zwmAP6rTpiH%J$2xhPDecgjCTtHisVEOka**R*9ErMFn+ZOmuG5huXz~-T3TAfW&p$oIKyBZLNX&MpO|87jL2;Y1g!?*_uI$+dc3_)u(;-^e=|H) zzc0)5TNCdK)k77`t^gSe1#2U#$3dqw_40r@Q(%Q`qN4}l0@eXOGFDU3l`^Q(he?_l zRYp_aPG~L}Xqp11+dH091&J@^Rnc~C&%L24ULPJ+1hSPz18#2}!cP%Id@rEtV%8f*oNZ2il=?emi?Vv9^9SZ5!tgV>iaZI|W$bund1qnXa?zUF+HATUQvho?iin%d3N`(Z zm4&c`2aH$k5E^m0xzasF0rT#1s=3eSZ#TpVbGCF#JUirQAayr2zLh6pkMK@q8Ba_O zuR`i9PPM~)`_U}}BD|bo=`Diw>0M7h&iXI{FDNZ;80}A#-#3yV+@$0pl`xl z1aY2-0&T`m0x?M5KqZPpgRjqxAd-13&>!%F#2jA?eo*_?pUPb|5~O_VI8 zfRa57YAuE;e#2y_pl`XDv~x+emosM7ROi_ideXL~;qUR;)26t94{!w0jXYL+tYrh% zwBwTSB`1WSi`cr7GGeo`7zT6YL1sumNtX+dS|7{^g-R|NIXQXD4%EPH?(L~MIB>r* zF&Ukh=rMu!ueq(RtyxTdGfo$=r*Lz37xdnPtLMnfY`Iz*8}txXymR^w5790uQHO{~S z_HYlpV|h05fHX{>#?PNw=3ky=jwBNIx|$RKaNP1mjH;CO|K0)35Q`<3<7|^_NgU+T zq3>gcjkby%#J2hQ8cji+UYz$1du}IOdNh*=&u_Uiv%dM7;bU4Go$tRBUuc1Ca$EY$U-qX?gaLg_9kolq{wE@HvN{*s<;SJ z4Jl|VJicg`o4ff{?-J-=R0)0_PhMW`av{3ATB;~m^PrCCit4VW34{?)&@$ywvfFX2 zANVXrq9;ZCEiD$YfxAasTGekOu$s>^On`+jtDJA>^Y@6G@g!VMzJ2R6OV=oT={ zGntNs5Oq8}(TjelLUXY@ih00!KD?QZ^*dd}qg9g)OD$^wVykC>;q(nAMRek)PupU4 z;Lnst_iU=!FtM^}t3?RUeE-HVHh+30t%-9?dvaFtw_#7_=r>71+u85P=J?e1t9Ds= zr;Cj~((fLi$H%5-ms8Y}{q5XGexKx9i7gs{tP}T!@*kOjmxJSP=+-B#>gAoa5|*fb{y0g3N|gnH}>ximvk9rOJ8}P z&KLZ339#61NN~Qs>eFc=DyO7>TreU;KwN3T^iXtS@UZ@Y0N|{Baf9wm8oX?#SB~&a z2Y>t1hxCu7-O?fGsusRi?GsVZ$tg%85zREUyHhJ0T3@d_!vAKJV$s0YzqkATnoPhz zuHaP=qx$@bs8m%5%)X0?h)}U5_0!`}5b%Ha2jV$GQdC2jBQ;XRndM&BiKY)5SBlfN z-5j2jdCOk!ZSQ8w(!kuaT^tQ%ul6;;+#N{7qG_IL%o?HINP^-uP*&xe z|0CyW#)tLGrapiKY5c7{6HEv(aX2PT2=uM}*30!ajEb%h*b}WEBJ!5F9z|6=YgJ!nOjgsvJ#;VuDj zEF{fb=4W*v@1EE=sk7L@3xK(rr_6J8Xm__>{yC&xK#gfsR1`2!0~Kymqx;6MS%(|( zCP;e34GpGo$K#q*oMq!!;t;tf!`2yAeOgUX;20$FRE@YsoJfKX@oKc|K6^yT0`QESGVQvmoFT@ zCnoZ~eCb}kW@Bf6W{%A&^(g<1ar?^2Ng2+wv~NtmzJi2p@`p#UI=6uzNf5e+vI|z+lbbvdN^%Uchya z#(k1IHmyM4b{xcT@9i!Sf8fL;FMsF29nzU~CuzTrhqnA(E+>L<{`(UQVx)YTQ>U!c zkKco^%29vL^UD`t{WOU=j%q~fR!6vcYdlMY1+99z07k9tkfNL0k$@`|C1ohYM!g!u zegI{?)Kszj``(I*n6^Wi;U&7oI=Ce)%7hWN0$HC6Yt<4Hvq##b4@rex1(kE3mp5sW`aVa+eAZ?O zUg8x&3mq|3v+?D)=MULoOkYvV)$;oG>9pU*#6y%>!vZG!pb-nI&y+!4Q-8+RQ z3l2K~B2-(C_LH z+c>o|V{9sCJyMgE^#M{_NTo>h`(ExC-$O5HC{Y9GiM5IVXCMm?b}olZWF<{4^TI+; zvZlw63?H3Ytbp#vVHS~*Aw)yQ)wNkB%GWl=8M1!3OE&+0F6ai~Z)~t0e>`jH4^0lY z)p*Pg9VTCq1TO7lB-j+^5kA*m|8**G%N@D)dz8uUAaEL5$cf~fvFV=I^^QO2lajr* z#x9rpOfb*lq;`)1O8xh}r#G9Lj=c?TZYTZ`};s+KhH?RdinN&T}TD z{jP5wQ*}4-X2iabyjVY&N&dI1vE<{#5%Pqw8cGvJKqSD`YORDF#Err8S43|}O0Oic za=Ny*#eZ^#r@DAo^6fy$BD9#vv>nzEA_vTV?Y?Pp&N1pN>Znk!d$+UpUv+?s(TkaD zke!E9`#>UeqoKBCj&t`|q?MTJf*>t_{vV;8h* zKHj;8J(sp=VEZfSE2-B`1qEvQeye&m-1GMF7C_l&?E|G?475GJ)NxnfcwBwZPW9Gr z`CY3sGQ|atds1j7GO9EzAFL-IJ}TWuf#nY_$24@IKNO5>+0-(wVBvOL%^I6J*Jj&D zN}3%pymtZ~-Zz^HHYqsuMr`>8V3;+Gu!mJyW_BPj>Qtwg2qbs~Iu#4=QLB_W?{J-j zp(NbuOQ$_ue{H+r8$0RFYI>we-XnU5Eo>Ko3X~P@j3l$L4i`6;2iWagR8)I(XjF#f}NA{eB95GNq;?}<@`6z|5iFavI|_`=D1l(}>m zB?He#DH^2bAhw|O7)_T}D|UL~03T-aT-BqN{o?-N+qaml+FiS+z=e+Er^=og-&v*? z!gxt?wwk|2?Z3VvH5Unz=TZSPuxzgxoHTIJF6h!`7ZHLVbW$jP11meiB&*YPKu6&!<4%Ar|*Q4oSGvj&~56Fkjl{oQn<%i|R6Fys46Y;obhH@F1Jk z#wT8xf^GQ|q1V5JMsL9HzJKniX;v;=Vjr$5EAXp%ceYcfX&{UJ75LB~=mlKqf`IK} za-26}r+V}Eh)C^^v>gI5*J|=P%{B+fjKQpuE{NlH^pfmV*zHCh7s&iWG zyBG60PTopoRECyh92jy(K-_tLC|WGXr4peHmocx|a)T-Nes%{Nf7Ii}20VH6li^H= z9L9d-tz&JpldBx@0#1S!3EEhq-|qLHl=HU96|PDgbJ~>Q-Ie9zf6|7~nWS34WM}Q& zbvT-By80XThV!A$(g#{8-T5a=+7(e#WLJ*KD3+(z*hNSq7jS*9nN5gC^1O)6s`XOU z$|z;xmXV51>{|RxMIw?4zWItSs2S~77vbOA1_fjYA&KoEzct&{OZVuX5vjI@v;7(` z()-S*tL+b6o$vPc+-0vRf&MQP#q!+mpuBe2mK#6LxZb%z&ngnCfEkLY)zv)ni4>u~ zW+11l&$?CsRi($}HItSc@4~FQF??{~7Q;5yxlVbk*eeg$$0#*ml5S0Z))4ud_&u93 zM-MrUCBJglbHTSTd7Un+5Ui6@ zvL~YV+R5Wr+KlT_WpDqEhJW^T*`Tm49izZ0gkcg++Icwbf+~;)aw0)77%f<6?F&;@ zncOOHz#7gmo?jT*VH#%YTZ`;cS3$Wa2AU7W^6_k!;A_lvJT_T+NIz8(;> z{)yI&D3-i7)%>zT;$dz1E~v_O1uqvs+8kef^s2RYGHw6hS~brly(_gtIYx}DAi*LO zJKS6#Ou!dSq?@#~cl!*Eq$WVJ1s4KL82)_VO47*m#$arO0=Xil5+LPwz5Uuri7)vv zQ_I%TCnrYto0^%Gt}ZHP(xmtLsq$JUX^eg$>TOAeQeWX(QSEG|~-5EnjzJ%G+7yIw%me_YyAOHggEzcSTDl}$f+2JKC&o^-pToC$LCE&N|4n_a z7c?x?9(r?EygN?%beEJ#`)T8c`}>6W`_~8M12E}h(`XK5kpRb1T}%}SugOh&o>0x} zW15?9VT9N)nbjVKT0vJEs(wxVc@V5Xwnt4D5<`Ti0*O9%K^U-jJz_N7g=wB#*;$74 zZ4qcPyLT^dl$$zc3lww9hQ?~PJ*8Sz`^DCTO4x)S1TNuF3cDaYF&b-mG9+*BoZH_X zil{A~um1VZ-)`!?h_^@1+x?xe+Z+cHczm zA2=zFf3FP};B(hI+q_sMdT0&*Kt{Rc;Y3@yz{>+sU3AX_tuZgGp*sxqp?1$ryz934 zf)6Q!7VqDI;z26Fa;pTo%~tbswFwZp2r@1DRm-y;o^|@9Iva+tIBHLgnF_M9KQbTD z}m#R~&S@+TiJuYFsl$mL$8Ca=6W zBSXnLyGcMi^u1XBqrI)$Ff!O4;;40Ao|Wf50AdN?w$TMzPsknroeljLaE}%1lwwzB z+3iM%T7OBW|Jo*rIB$~!{i9SBpBQbvAz%Zfnn1jrT+yS^q&`lkeQcG4vojS5reE z0Sh4?qybjDKu|)!Zt=v$VfHmOP3oVmNK?&*BmwNdiY}U?f56dzh|Yqra0?^CeNV=O zqVH=EY}b1)^eIl`OZh>5HgM}$z?i3)ya!KB9(VKr0y>zM?UM2^4!8k%{9khxfMJlI z<=Z5vG&1du5V#&bxGKYMK^maaJ_<;BqW@B6u zYOYQ9be1w@u`ov}*_5VFt!PQk1dh+`2sx%9q&$%XB7x(Y`*=LQaoH;wStb9A8 zHoxq*QYqq(U+&t75XKik;xF@_lxvtOsAxod0w}zh%Nd(YMG26o2yHkcgaP0)ZbMX4 zoZUvzz9+U>ZDbXnP!j+rL}m1)egpz7S{7Q2pctsWWuSs#p$&^e8u}4haEafL(FvnO z|5UnAB5BJXa@(CD`#X^-quNm^K@5*ec?z`=Sw&}i$^ST&v8VVk%H7~E;)sK&`I!pd zU_q+;Ho>-(c6SW`AtOTWlM_CU330e8fqg>tQ1g}?CEQx%KI7E!y_Rx1l+C?1y924F zR(a0u9+sADe=BCiXrjn#&ZH#+V)Wm`Seyf@z+p$Vvqlyk+%2mIBB87-%?UZ>`%s~` z=U^zPLfVqXg&e#gP60ihn41Cu|ElNg{6vLlu*D;hx7~sOE#M-tuNNP>e$|_zlD>*LZXOa-8j+2i{_j`GKd~I`hK~kupSn{ zWj?nj*hP&68^m##;CHF)t6fIC1jugEfhR8uSn&HWc>aLUoa{ahPp4h=>lc^>I61!g zBjO@Ipm=AXq*GBXUYxwb{dkzpW_WD^`Mcsa$GfA^`}YrU0q>eKYbDlIogWVoyF+Pe zM65Gb$`;Hjpifd>Y)^HeJO9h;Yin)fo|5?IDPfU{isK6?TNJyPwjW7res_3gK4-%& z^89IEGU)PV?6sI;0d}Zj;oQ4&QY<7zs<4PX@C`s{p&Yj2Z--~x_deziVleFzOI@1% zkyvjLzL_P5Rh(%`^rADXOUT4Nx}jz`^<-lrLZ)yx>nT$!?`6wr6rggM-#ss9X^x-vmzw5r1_q3fc!D3~)c zHRPk^ittvl&BCqL6sr_!w~nr3VJm1=@5lM!eF@ zczet1!8$$EI6Du~LTKOZM6JL4OiR=#;e9NrG>N_-V2aaVy3PdbH);z6B5PaVRktbm zgQvaM=NPc=@W$jj0^~u8f@}3c@8vh~g-TK+3!mfJKg1_HU!rkL5Oj*LVAQUf-l*7r zO%s9fgh8<(e+4e(r}K9TjMPX-Z*_FsejFdK6xg0HuYb6e$8<>rO*ey!qJ)`*kbPI9c^b0#lA`n>fl$vc@wL2O4sgl-~J>o$ZL1-l;~UmxC`H(s5!v9##SR$RnZ)BbYEKihWrTI;2nPU(uj(#g4U*n z+s(iCYya}!Ugz-@c?kUc7JXs+hJ&IyMRi1I_qFU=sx64W#I zd<39ULC8#(<R54A5-L}h#raL(jE;gG{h1?69RTFWm%FSe~%P=+o{AtG^2KX zn&j=mPHWM&fmZGiS@R}>EeVD*s z;mlwV-qc#FraLv~Dk3ZC%oq2?hA_sVJzpEK5{eaJK~HF^>yAMXh7%w9>Gj2M+P{?n z=Hx+7L4H!L$Wa=>nH9q`iLfooK+c>q=~(-y2lf_q1;KKwm2oMTX zffy`57DUZ@U*~h^25&wG*IAwUs&G(`f&Gv&w_S%i9{+i{1amFgE9G}OwCn#JuCF!N z6m^d@c+Xu7eklRs(_QXLzMT0{(57mWzR|k_Z&#Z`MJV=^zKDNCQDZ((JwnpgC=rZR zC_nls1JNXzBz(7i1TxHl<3xMUE^rIEYCVkaRsG{ic8pV#b>DiF`gbw`h5xFPtv`@5 zW+%Og9jSIrsl_7EjaL5@{ke$_)e1-jY`r5Utb%Hl_&yK+x#YFX-p=V+302;6@anVF zv$r8`5rw;Vmwyiq2R1Yee%R=Q7duM6D|)xxK}p?rp374v{1P|);|E&72b`jwqbGu} z;)lHueU+|1(Xdze2j(0hdNRfmYt9@rfoT^>@%?r5sJ%eYHMXA;YYlpmS^&CLn68{# z(-*hWm3~TunD8KSYW)$nvXUYz1J015{!o60Kq9^`+coz)_#S`kvoDoZEHEA0ke?fm ze`GEcSg2e6GHlY1x_<>w&<<1N;m4VXdH>wZ#?!p#&i6;!PlTlWwVJT*GOTGfg1z`L zM3oXiBN|aakdli2^*pb@?dj59 zq}-fmiZ}d=YWaA3jnl{|82G*6pkazH$M-a!4kU}|VKUh;TO9M98(ZG{cTwl>gYmsu zv6bV)oE0@q!>sKu(#gdIKTDh6P)W!V@fYWK>Y2-sEc&b#h=6}EYx;_G@4hF@C}E4G z{U5&GI;_gI2_IcF(hX8d3(`oJGy;MGN;lHo=}UJiAkv6{bcb}eq;!YUCEe#)-}n8_ zb}y~94>v5=`@Hka+;h*&J%Ku`wrq52NPhE%jobo0RZ~J9 zf^~VrBe~@g8h->s5G6D)XO}>31DGdV_nPO34)M6r%QB`TocSN~h*JS9qb;xav)5UF zh>b9R>;m~{+5LNPfI$dvu8h@365DQM=lAS{`#pS6Q)iCfR%t+0=kWFGsF)n# zXz`opt$8EWZSZ_s2*!k<`=`{6;pihDts1TG9=XT=O}24XQny*aAV2Hi1K3MA%VtHQ zSz>QQ!m@FG|5`E<`s7i)+HcY{mdPuN1UgI)+lWPP+j|ex0O`kOQ9Wn(3O&)rA=sKk zCDVJ$^vdmI-~RB@=;GAT@_7)Bl-F5~Xlk%kBv<*K-bhR1)xP*0V@LYevX3HacLllo zSD5)`GYTkJu;a0KdQJ~xSdOGoc9N_lCjuw2u3jX=ft?0~yzJG`9VbeXe*M*q@9L9i zdygz^#Q(YSMfjM6d-ue-HPPIqNXmkZugESugvCr#wX^u^iLU$|B&QQl1ILTmQD`$e&QH)m|?XHD{}Tqj@Q zF|`7Xj}J-+q%4YOYYR#Hl22DNc@-rLB#Oi#UFNotH9yAKaBI# zXjZg=l29f~wisz*n3teV~N?Z2@-Q{X0X~QX2=lK4X2)uvmdD34kq8yYP6(1H; zgPQ1lw8u!#FVA-N4yHePmTwsxkY!4lvpnQaSjw3~j+B{PEZl5dX0^>1p}_;jTkPx4 zU%D>7z+lJp3kDhen@1~-Dz%D;fzqhqSRae|oe%UJ|FHqSPWj&J$zJBl|KaEil~9z= zwMZTx;E}Tq?&Pv6Du+KJa12`*yU^wK9{-S33)Syhc&h1azRI?--rf@2EIqlu=v{`W z#&*wyXy)Nn*pH68?2%QZ5AJ_D2EoMe;$_p(8|Gm7<8IDT<-nC{SeQ1*xLX5@Y~#1L z-Ch}9X7)YxZjwrg_Kgv^f^&JYH-`UX@!B522K&V3C8aD-Pf?u|lnf0WF6+d2nC%WO zqu!EC-}<^<4lzm2=1uKD3-4QV4MejzN^GyS`}i)XIOgZ_Rb%nk;3Q1A)~hBlMQ-Lt zSW5|sT_~MuGj07fO+uq z%TgKTRVFfsp_2JF^yl{I6+P(AwBxl74adtM(md@6D=X3_1p5ki0$m8)^y~Bo` zrcg+p{@;dlu1>d&n$88Y#?ms}-}!$L_nIDWfln+(9dEZfX=-+Z3CMCO17{xJko`zl zY+eR~KMm^v<^P-Q6aLR5qjwt8GzG3$y^HhZ3kt~@olqgH$PMk8y$A_q{xrSpvMs52 z1IF}fpKyp?h-*Omjc$(mrNSevIdZN`vllyOUW-WqQXD$kGuSZP1&3J<%JgQKU-AzJ zg?H9SNMw_%90qwd4pS(88mc3o+Mc3c@BrG+{fqPA{{5p>GS;9AF(015FYj)Ks32>} zmtn5NF~eqQw!+gd>!z|k+c+@4+fD1&dS1+?@X`2W6NL&|Y@RHwZnZhsm@oPD30*<2l>@Ai$hrg2Gn{=5x{LpXDafEvZVBRWc0*5!;Fi%wHMe1s#TA zxeHyu*&G~HT>(`tKl2su;OpW!^MlLOdt2K^rXbn7%~W+`zd{)1OAk$pj*!$OJsV2{ zP#M12gla`O>IqngSw73&`7TDhJE#;F6dNeOIEQ0uiuJ*snpqUvo(9ICkI6sxaZz2r2Q`XSod!Y6Q$MY54WS0@gA$(a{k0N zZ<$a1#Ro;=Mg+sz1?C(8y9M>67?s$=zc&tWdxaQ*Dc=bty4B@+HN&Py2L;n|Vos$k zX1Mriw4GGL&2a9K31=Y+VRjR-5&@$M21{?xa;%9ifAjTUEI&u<7^fNz9_sh)ReF?oOk>y zg&p1Hz*lDQlj@~VeX+9Ga%m%S59s2szI|APHHl9Cu|CIZ$E4V}BMj=DX*>((D<4I< z5!lkz4djvsBb6O+%m@9NyLTP2_Z^x1U8BMA^|Va}6Aq&M@Lfc5V||J#G%6#+t!H(gPzhx1xYsv;s7^J9?BGY#NcQ zxCL;3>>T>IfWJW(F@@CzK7Vh9D@I&*R{}|TXd~D#+~~SMoLWhf{%OQCSARN~-5I-N z`%Cs)H|=!{n1!dSrxV5gs!%!aHmVfQ;^9-1uPF$}-u;b;>?F>vh-upNQJWvTc{t9V zqz%x@A?(;x>Hpb3>6j1#uBxn*w>edGfS$zBB7EY7#({*HX8zA}PBFyRBU&Us3Iug6 zkJh;CS5F`~cxCWLCm@aKTEp0e2UtnX7qEL&Lo7eGd(-9n2x`si`8hX@)p=!ui#EZA zk|3aP5$k#T@X>Oz9TaX{>%`B7pNnS{I2DY$TNx`Y)#lql`_qH$E>?Lfe{X+&{<0C> zx)^`)0<^m{Tm;*4XzI8lz@P?(hldUBuY=IqOZLyfI)g*RLt*}D`3;)9N?HXbh6xgo8wZjd6s7mX%>D_dkkxzrBtJY=Ow;S-65J%ZtMrPoY#(jDw zXQ%J2cz@eVxm}c-Q*?R{eLS58PP^!0Aji72UI65vrEk`gq7Al!SM%Y#@uFy z{b$ILF&?AkUm%9EF5!a5RS_Of=kn|imoD#jYdgLX80TzU6l?zT zlcr6=5Dck!YedhfWJtedal2FI+h$Ifc}PZ2Na{EmCP zlOcwiVoXdLGjWWE6BiTC&{qX$)mHA+@LBJ>x@EmO8rjE26USmMl}%UEu}$Y2n>Q*= zqtoJ}+g7aw;T2WvX=$!fz?VsCbajvMOzKRF-3>G9tVz;7!nbX@(Qt>y++ga~zN0q; zWQ?bl&qNenW>-+@D_dGC8ZKCN9@{~Dj^_|&)+oYF%Kw}1b#r+v>Zh}!`_9sO50x}2 zyUt-zWG?gb@ZD2M!7C8#9I%nI??d7n>@%A>QOHl>VD&50wy`mG!{bl&^pl3;aLaYs-Xqm&G?l5P``^N4rHhvbb5b%N4$psF>nvIt zD9UMU@6NY+pO%_0`!@e989eZ4I&C}SSLsvI|Erw3p<0mELMuqW*qrzR!;X}k`n4ql z=c516$ff>2cxdEY%(h(EK)Q!LgP#GAs_DF#^ZeH8%r12CSNZ-6UyR^k;2mKMSG}1H zOAz)trohbt8>`Y-r24yd51#XaNh_68LPFyBlOa8ghy8=yq>bZy#8TS>->pOyv70}K z1}!H!i{fG$Zl#v?tzJ-;PTX$E^zJZ!HMQs2x@fHK#b}<~(z54|nI&)deY6+z+HHnQ z3ms5%XoX2*AQt=Y&)1w;dbRC7j$f@vs70NBL{R|eN}5TYz-!|65wpVvtfYEPPq*^Rrx|FM`^g{Do0XCD<5Ex zKb#6>zG*tvYrI%iNz-d?;`DrXEp&!wz+D*&4`YDDC64Q;u_x#@dt z`k^{ojtP8B-byi$L6P(7sh9GwACH&kGu`21c%LQ zjpHD=Q*Acy{)Dzrku^`CS|LD$OjeQ|@j)v|wj)P!y&GQFC2JF3m@H-RUsWUhYCiU& z^*SDtcA)(i&K`=P{ah1fTepK9324hsI4s+8G>3MhAH?8KIN1MC^y*2=jJQ#%O4PcB z^7+-@3--avYm_=s4Yo(^$%YMF6hcsgm*}Fom(#*R^o6c)&X3#M{E_CHcm8xSVlW?& zv0j0OZJb68LhvR|7&qyW+BUfQwP0D(6fWk^DXb9;m&3H_N zHW$G6pE`@MP8`)+Q=-T07j>=Q&`1hB%g{*mKjExgIFz_`Wqp2dhw-kMF<*vJ+MlaL zZOE;=&MKZ?i4p%w{2*8$Cqt9Qj{I_KDEQiEYj&jLhY<>7X$fXOd z&166J>*%rR12*i_UiDaC&Xbn?a_WN-;va7^o~S-tF+!68H6v+gbjp}X&UQeSY4^-4 zU6b{EKuYGP5=jO>m&qiY>an7j$AwcDiYK#=RCwSbPx~6|nu%Wt#FusW!eqW>Wwwt_ zO@0}x`}7bQ&QGn&yXGH_yzqJHxlh-UJwjMNb!%mByoo)sM!llVLLM6EoHRhUoe9_r zvxmU7@F;GDnf?EB@cMGgW2%hdj}u9hHjAgWygDVj73}Apl0-6mWj@9{)OH-}Ffj0v z_yCG0t0Op+;`I;tTB@J0#d_&qP2M+a615~5c(gaVBq%;Wp4x- zeJaK=&umM8)cC9w7H3M+^-HT3rirqm=kTu7wwUXXG44OvYy4GyWenzkQAh%LQJhy!BfzVCI1hTP?`0 zn{-n%Eww&+`J$evzs##mU*&=nPg4t8bM$FPr2}o{q+&_XW2-lQ0E5?iLNc)jvc-(?QC(-LZpJA6BzY<%5GQUJZIE9P~ z#?du8?4a_e!X5d0*~j>4=AwI9V%7(7S6`hehGLpI#7APi zT9K3sXIhzd&ROc4g!b9!M_>C}>y6vhPYZtU>-qXl>iMQjg-i|O*C>55&KchrkL%k4 zLV)7G-dLQ4Wa%v|%;pIxE=y)~ryF-9wLJ~<>w->SiR98VqIVG0s<@JKci$QcOqYsX zydQ950=?i$$&%EcDRGthk=cunHKa3Awv?#yiCj9c~ZSQBPjm_&kKGxe5^?^#~8gotp==3BrGz((rH|_Y2~+pYMQIUSW1ZY31P?ua*KHvSGDvV`*k8_7ic* zPvMUMz7X1AWk^QLl3z68!@aZ?uil5{mw*QbPzvpq)?PLsX7Nx&`xX3U!G9c?O>Wt@ z&_B3^9dD!r0<)%#bt*E%3BIsNzdW858KTZ|8v`kt!OD;8$)A()aI`mG!~YIOPNdvk zEE>W!8CrRy{RQ$l?}*+}N&B)K>QUs|Ys_?Qz3W9Cj?3aWjK3%|8GdH}dvT)n&AIQ3 zcxC)O>?Y4j%(pSTGxZZ0+tg5Zy&;bq6?14y0W@R&=Oy>8vO&e;6sK(dZu-mj9_K`Q zdWRE>^ULI;|GqWn$9>Qe)wBGs^++VY(VqB7#OmVjq6{XNYu!$NSZ(ikefc|_5%N-$ zKYi)V*6KW@=#WuV3L$V;I&q|Byv* z9}lBC@hZE>^}!B(-Spk_+F}W<@BeusR5Tn);aZ1wlnUDNh?fGHw#y_*ODR#(G;PFs z{(>6K!RP4kHdu|PC!Z-duZMZUn2xw$Kwid5U~;gWj`2ldDfPP#Cgv)huYIk%aq|mV zaMM}saT@#$vq-EJaVMxG*8XR60xaB1K3hWpyd%87n|F1;Pq8IBjFS((%PheiO#6u(4+n>-<5F1?;#!t|D<`w?Ye7EX zm%UwloW4s^XOK}OmZIa!K`ca-0>Qd`3hbY+C%qD5sNa>Cy_{IgCAY9S+_BqwYuPaJ zo^R@2Q+3h+H5Bf4IYPyK`otdix@ ziU{g|#Vf*6!Aexe#jCpjfL?*=PJT`$h-T#Bw6 zZ?1U@3r|X--$k>f!^c9mtpsCYCNt+-w`nk_`v)Cd`| zAdM&kD4j~g8@Dvq7iMecn_%b7i_L0izRKDD*!6O{^fiT>T8-WR-UfQ#f==d8V!!FS z1wTQYN?&mwI7JB}YOtaC{u@<$?$)eRjuasfxtq=p>LaSxrXk&fTc#9VO!a zdtdn-S876`-{8K!Adt?=F(<2SRP(*u@E&m)wZJLu1DIf*76|491qVxP{2_S?FH)eS<>L~K)&8QVeFGt#P!JvhqLa#~zmRXW|0VeJeW zx4`r7X={7g-wxGLvwe#{q8|QT<>BaBI&oMtm863#>+a59SXekZH-};V#E=Usu)baZ z2$|4wbC0u;wj1nK%UD`6TUlGP9SrvMy;N3?G5GjWGfBqVTX+trgQ*r|P45CRpDcA2 zF00?q!nzaA#@+!{0xxgxc1|owDJhzGkNgZX1A`~ZX^;RyqLl~6RfS0}EtuGTD&4a; zqTK~^L(<$>Exkaf-|89|WA*caWw75)!Lt0!xQ7lx4Q|<0#e_cKgQ|Is1aegU=wlWf zyN^d?(LoOwSTxchIf#K@Hi7hm-}t!d3trwwYlgMe)mcD%Av`>sOxUg1kOu`EwrEO9 zN^u0xzxh#G8lqYtt*e`6=$n*~@UlRimWyl5wqxz~>ID2ha87OV_PN<`aj|3pN7`Sb z_0QOW%7K4vZ7of98c+wVV$1;*yyO= z+S*z+FJ=-tF0P!WCK(Vc4as;3G6ahnZ7?IAT~{|T0Y%T`sZI1soUMYR$4wepqU~9&2X5PJj zPs_~QpM!I^Vm?6N)l9v(xM)|`Ysi_^)I^DmjSceyQ+=l9=9taHJN)`h8?6YVd)@cF z@oi-N8Fl(wY2J&67m6l?ByVZNI?B3HPF-*Gq049b-f^gb(jg9rfgiLI5)-vt-GJg4 zC$NYpa$XEz#%}4+Jy4G<{B9H#SqD`)UY}Z?o}L;GC3E3~zP^l1pW52r2O>&nE<#it z9UXY2q~_E3X!V?&f$e@%Q}5wp@~k9uLPF$VW*le!&D*zJFOtA20RnYX@F{SqvQdi{ zO=X)v%nhHAP-<0`Jpxk=%#+6_CH>{{mZpvWwYwP(m6r?*D1d{qd!|%bTT22|&}L_6 zCEa-XBft0()T1me(WZ!bCJEN>AMRt8d0+ZH<8u-V$Le@8wtb3?w&Zci87%Rs4^Q0? zODH8tG8(-4_=JQYpiZ=u4*vTTh^d0%PzyUdSs*s1tsP>1R#Z~b-PQ(URLK~c_q-s5 zgxMeuR{`Ja)3Eao+>gs#>A>lOuuZmF&qPmexYiZkL{*=Wkzu5g5=`{??(PmJJW}EX zIW{ofxU@8z=>j_|D@hX*I&inZd!-?X1eO;8B!9pWN7Su=IeH6AO9^l#3`(qfyq_(|DR6 zZ35osd+7P;M#F|R-+&rER>A0BzkZEc)g*J7pmHFX_9GBUnwGOhe)~q7Pc=V0telFNQ&NK6-QB%) zc=%)$W?iEVmmSH=Lj}qi;GVM*VFbVHZ3H5Bz=BDtqFllMtf;^Th6m(;B@`4Qq&COK zq45A9u^=ri4ZrrRtV8Q-l0cr5k+J7b3pg^M;WxIhfCZ!vkB%I`55Z?Cjf{-q6msMG zO{I8(A3uH!*OIfdqb8pRQVdZP{KE$}--^Kfj9mRBl#ZiaGPQq4hz#5Fd^nzB<`=2v z5MuT6mq%ufMqfQy>oEK=3te1y%31ymkPcZv%xP#KKRY|?td)_KHSP#{q#V4g376wl z$Rz-xlT;)G>IMe5!IJ(_QCO*m7o@^$V>2@rZ*|e(R|MDt{ATILB=h>OMDziP-*w`h z57;^#-+|;yVq#*GnHOA2VQDGm)n~?Nfmm>SX(FDVzCh^XRyE*7u?h(ZaXPL^H#*(| z0|YBNUV3}ql<$MX0%8+D87v5RNK@1A6V`~A5s}Plc~6Ce=KgpW78l#h@a}JKOQ@)f zj4nIUtJtJ<^NMFCGh`@a^e@iko$g zCIOH+G#sa&&%OW_N!Qh#^~TcHRtCsZ!0dY1xVZ@wa-HNo0ItyA?9$M!Pr=Fpo&-qm zxCJL`mxO4S$m-}&fYXQTs(}X;Cd%7l1p+0&Dt{C~MO6*;J`M}u{f++q9R$n_uE8uQ zILp+zT#ZUX8-ieMNQ3X$-8+qdhrkKTaz$o;Q?Wl=daPkL^Cg+6?j`bj32^b!>d`BO zNOxCGAcP(d%gdv6at2sal8v5 z%YG85YGN4e>$D?K$LSj!?35wZ3yNfKKnKDcP3gQXzBAqd!q2$LDJVQM4S=QnwyIHF zw`ETFQB^fz7-KHOuJ;JP#f*ad2E59#EIyA}VWaq+n9X=mN5LY1HN| zKh#;$M7>FX=iuuO7Hn>A1~T4oNj%oPi8ID#ZKR}VoX!(x6MP0jiOnmE;Co){DcySO z>C&41{(d9a=|;d$+2j0?voO@*Ju~_(;GcX@L_5nz3t}L&uk~RlM{IsSB^(-@qc_QS zw_`%7=O?G8VlEwrhlgv)8|~n7nee|I#D?{r=yj?xYT#q{_H5F`e7!7m0E_`hC_W=Y zY)_MB&xJ&8&t>w861X4PSZYz5c|*XWVo9`m)?8?* z`A%J(sIaJLk)0iQDtK%!83S)n!pBF1o0}VtoE#&t9hRsN4E!uSymh6ZmAsFxk8pw!gtF$?(3kM)T?!YBO_{eESHRGN-e8W|ty_WmUWR#ZPB4L`ix z(ZqF_sGO_nq>>+FPZZ19*+!uu5z%)^_deorw2vn-Fl$2FpGgDIm-IG0J>qs~~b!l{^y&QG{G_U@e z#T(P3ul){ZmJSvc&k_{=IOG@AX~elcXGz2Wg69F%CMxo9r`i+s7zC3LMXk@MorQ2c zZ%s&Z%gqsRGY&w7g(hE=o*o&1M4(4=9Y;9KiPdGy1@sWX0ohDtT3T3?|6JAru^0TJ z9sy|}2vy&jKr6b9PH9-A;snu*fG~*>4ebvX)|SHkP=w;%u5N7p1YV zi*4}TJ(BBZbdEGZeKS>Zb@tFnCmO0t2nIQJhc)M$x-+*uOm0Uml(q|?GiVdVpK(JJ zixG8weQhLO4Ad2}nf^)s$I|*6Wpf_a#?1pLE@y1~?UzhlZ5K+W2}lYkwRyl#3=bmw zea@|m9p2y9N5;jo67Kpuro%nY%z=-NpMSbUr7u|9nJd}<6(jVS1}Ja?@yfnmziK>U zv8JLc;5!DMb;aPa4t}escsqLYEjPE@ZYx!IdyL%SRUsn9ro-AdgWk1vDcc$S$w<7B z;`Xi9`|DkEu%IYaYR!0mt|pb=cFv{EkaLtA%jnSHeC01%tVF(0sX5uel#~Y%*XTQ^ z7UPTli;PDp4p1{N3=)JHw5JSV9KI2bSR|fGhFBrSSXyzP))HUDfB;0-QK)2lLMps3 zCSXXWl*;$35PfBRPe<77_m8)5tMZCnC)jN>_I7rE+gN z{+nt~jf#iS!L~Ph>+!R`$o@%Z<=qSNAg0l6?01cPwljKw?SEIEcGAEmGaY~#sX9&t z%XMUhN?jY<0EXz4#3Bo+&{-Ku2mT+|+iP)hk~bl}=dJLh74LAmaH#X<@NvXX_YDtg zH=(tmdb(fLRklDb5lA9EqUBC|9nSK(A4u_7JL&~`He(vJJ(f!_A_IyDhD%MJ0PWz@ zd&kGYMImPtV1}Gz04f{te)YTJ-8+B|Y9G)2c?LjF`PPSv3ru!1v{Tm8Vp~VY@PhhL z=e4zy6ftRZI`--nZV4^XeS?SVX`Uso-IDna+*&`tPJ;!xh4cy^D}9QZ(u+pXSzRkx=!+85*Wm5_ZaWY!IOqQC3=ExnX<~c9fqR7a$hSAqdn9 z2^UlHmkzWB|IlUZ)z#FrzZC}m9CzZ1XMO*U%)r2Kxf=S!MhGW{+Wwbv3+>9~@j5_V zwe^`Qcj(r=Ajw+=f1>;d8^kpb6&hH%(>zt#fSjyJ4_1-NdCBDN(az_m6qxH*VF3U= z0o|!50J2+4=BEtwbY3gNaE~6xn~$Gx7295$Vp&;;$M18A#+=`gpTn10+eeZqk?X zW?Qea54p0$WoXobM#KEsU4HvCZi>fd;?f$m7tgDnl0vXDzi}I#pKM1MeyweM)Wq@qEh|3S`%y*cCB;A}*AAhCrR>7Tuc+h|BNfIpqjIv4V@sj~uNa}1%C|RH zwV$~3lz`M2R)*vOD8oh(W6J04GRa*Ff)#%@jxQxBoQTLs2S!rn4g38o&GU0FW}Lbx zMKj9Mlgjy=jT&0>@_Kd<&v$mL8Y6YCNam^-xZx^xA&jrn1RQ4|wH=@=48m?oT@@J! z>qA3I^b8EM%?2RZ_E9!P*GhZM_}K`6ad{OLIW4WPQjuSR`@VINf)o_IkJM>e28Ivv zKD|9XI3+3oNdx6&axTCo5P_7GjNgv3j5g4#d8uSJ0~Hljci8I#>?va4plm3udWYex z1R?FXGJgj2+n{txJKPU;$h$PnhW!JvXf-uuRSs zxE-&mx;hQCmyO2V5tcf&Hd@cW3=+#a9{;s2Yd%K`$2@epOwXTBel_hY3=N-R0u^Ke zkZmmR!(6t2PSs^*?}&->k@{aglF=L3OED<6vrM}#_Zj(1Q9o_iJD3%qkgbnC?c+9P zYl&et*dxWE8!{lX_Azm}Kh^7ZGTG5=sBCGw-TtXvLOqrtD%{!8F*-59W0P8v>?9Wp ztkVFkhZ?9*Z|&`M0a3e95|EO)=hW6FeL3l`8_lSq4UDZPEB0U`2p=6ALx`4zkmBWo zMn~TOkzauqIwa)eJI;umRM|lwQ&`2T0?Zjm9!^qRof1PrP*b!0Kzh+PG(>qVOh<kWA8Dnt@ zydsxIs0|R3d{T%16R97v11Fp;;>kUnDUJ*9W4!!}JqCcx!OZ~LgqhErm=fAxut%L) z&TW3nPi#7uH@l6No(cZrA$l`Fz$qrQVeaUt>EOt9%IkT5d(~oH`t$E{rq93rbfBY@ z;?hm5F|<@;t#Ju7E++sF*olP-1)kTn-tAL7++Vc5(!G2dYT*6DW$G7hUGTs+c2j93 zvS@Up3;)lw5TP04_szWxFedQueP+ z1?bp=gr1zxMlQ+z;BtGX3)4+bXv9>;F>|hxb#kig<_eFDl(MlYmXRRX>g&R4;6=T? zzj@!pDURbz_$N8D%eM^RBC7eKYdprLdNO*D1WCC5;+<}4@Vz+~=BQr@cmm2zd#jF+T^U7#kb z+rZZ^gMZ`|6{WPb$;%u_!2L93dLkQ5{%5ND6l56zLKjZZPf8xMp|*|w&wARQ!AtEBV__M%j(yS@<$;1JMZ5m;IS!vA;_Dpq;o_)c$@K;D(H@;6t$GfqL8%xhOYTRy2+ba_3#4ZTb-7!K04A;>I%ujz zne3=ah{gX@+Z$Nxc|^#F?o^zsMNG3#gkf$DfpFN}+pFX9_o~*28HI6{Kp-{Pf9~cds9Rh?E$&CkgXI{u|Az&(m#+^Z@R%czJojUFUx}DY%-~ zNQS7JISNQs{{Bi0{U0w%8xJRF4mww}%1W<+wFUliE=QNDwweIIRd`9#H># zDJzRgKtO;8HW&Q+=LB$Rba?@&*#N5pDstRFgI2V*bnr=B7#W%7fdL07NI=-ANSJ=? z5t$~%)<>P6be=q6_%x7DM)sCITEPz!v(0d{k{C_d$0J14OFgpgfh=LY+)nW=fgjVV z4$A30@>4J^@y#1a$uun5$9ENZd)J==rRi{s}7)Z$cjNUu_q=OiK&LLsvHmhXuAagfTiZ1UzjNh5%WoZG03T&yVyF1H+O4JLg{uO*6IoWBb<+e3BF%bx84>By& zgfCyf@-`Y#Q7S-Lfm98Ccz{BY{q6ypDx|6&18&b%QNiFzHmRS~LRuc>72BJd%fX*NOi zLUl&q3{h4jJ;r_ds=cF@2XWCx9Ws%=yen)U<5w6;&jk$1#>R%nFB*`i(HUQ`3A*^~ zQM!aRG&VY(ZoLI6f$dg#=>VS)k&@z;>_6k+sAJ~5oMZkn$TnpUH#I*VmGlQUg3Asl^0qsPM_q7Ev<0CCg5A=05|dm=wm|*3kxsrN`$culSpq4U~wzC_riVq zC-|G6Zz@X+|NXNvS7~ICWBC+AlZ`LX@y%eu`R|diO5KWxA{r)-kac$pnlG`&5B`Bm6+3+dwLxHh0HHNG@xdAHw3#12e$e2r{z!-N z-UWdxpqwcd4G=omorV+c9}|Op1MOV0K3EVm&Sy@-xcn;Y3DFv`b6GqXq}2YchYMAy^T8%Fkfg$1%=3OKl+^h3IGQSmJsOA*6!@=yirp# zQH#@-Wd9Od&IULlKm$rCDPaNjO-`3kXL2RIo$&Dw%B}U+92imj2nil<4HM#0*G+~2 z0@j9^e__>9oyx3up+bq~^HS`jM}mw~G65KXj2nLu0RJnx<2iYa!-00vo!( zuOfq$mCdWVoOVzCB>pJUga*4MU>A}91Y009Qp?XOEyaOv!U+8>5b?f<>R5fwr3a+T zz0nkCHQJ&!jyB*zD=64Ju*=HH&HJd@jwq`ELhOxZf@o+Na7EymDGJRfpFFX5&MubC zf!e_X+hCA6>nyObi!gA5MG!K-+bYu-<7o{RX(Dg5t$R}B;^r^np|i` z%LeAi#r`89g?W@wIe;C&LY+V}pZffTW*<>4Fc%*4VHazZEeRTvqMksuY_E0{QbQno z>}G39)>B$fW(tHf-)EMel!V47CZgo3J_?uaXylWzvf3$E?@mf{I?HaJQhI;? zQC&l$@viYlLj#mDJv4Z{JB|gjgOyJQ8YFrnEI8aYya?oaVaD(0g?ny*Yv^8XR(8y! znZ$d0`FA}LlvW*>$R^){zM;_{m(-|jSrZh6qxx0O4|$Sg85$ z-#-yXb|p(ID{{Wis|q?v@PKG!l&z++aTSJ1!_9*oatbQV+PYFSUk14#v4_V?l~5&j zl+2Yd-_hu@{M7^pF z*VX`64E8u(^tr2o%Lq@BocBNdfBQHD>W@;(eLSWRY@9|N_HFE_5@w3!6-_cJaH4kH9yot(DXnX=m_&=J z+mj=gcKOlvPc=2x3U!N|-}AyvjCU}`mUq$XrAeA-bTmd^o zIy+u(I0>2!r)`g~8Meeo85z<1-pMSJ(A0#;Kw`w(k$p@m{MypSh7tpNO%aqPCyj#u zm$O>)wOhr ze$)KQZ=W$Qj+rFjwl`Bgq=^xX2x>Wo1ixvFr2ozL38J`iL?Aap_PJ6ON7Kt~N^ z(q9rAYy6>735o6%Nfqm2FLf78w%f{O^5){O3_jX0@Vx^w+8fqnL4;9T|D>%oisxz4 z+#>`|@&&0J5f~{_Jzh+1Z}Tp2T4fDaJ|+7YC>mHto{e?%?Z86%@r zP9{!Jv3zRj$XEp2vDdd7hEL@$oGMK#N*exJ;H*&m>!H8-< zuC890|I8CB6$^QJAFs!X;|S-2>KBG;93Bh;T#zU`yHcwTcss8U1JU1PI~GxrrM8EJ zaa*Q`+>G*IJvVke`*g50V809%hRb&C)0%+I4t~FEtoWPig)V&2=3m3gG1^|k%>H>O z3i>$$+{#<8rKGv;1v{K|dIc*+)p&y|i4kSAqYU7wu(0b%SWOTlwJP8Pfsj?P zg=c1NKJPMj*R8C^An`=!SAi65fM9f|!)Wa598Ryq zP#1Le*_DK`Cn}&kqEJv$sut*6D;Uzw1HtoSay^K=1l6DF>bipKZWz(st2RsOetR!@ z{qQ)nrf9LzC}=Uk4k1T{SSJPW(Paa0O5UqgKg^4wct6~Y;sP!=kn8mx2kaDm!R`b! z?mxgoyGTyk3}V|9t2$1-df5^lsoSE?I@wQ#+=H;hAwZ{sMk@-1Lkx$=*jP%zfd4e~ zyiQJG+#F5^+pxC7SlYlAHULJ-Z$3g5&T;KzZgP^T*U@&xZ05v5LHW8`yN_!GP?L z2r5G0$(M|yiR8L-JcI39Fq?yo4Gj&u8p6O9DT%64J)h(5)5uqNc7MB)dQ%Zz@Lh@$l9R*239qIVk0EgH)7zJpma^BZeL(Gj%4uLE-MM(`6=?rD>~H|3 z|M>WLDV5em8g`rTsJ=e={P8VqALA}gaFQ=UPtb6Ns5Sp{(oRmWz>A!Pdh-z|Fmm(o zyw%p;Q58;N@sX33_Bhoktf_I;?8yaJUc#&iJ>UojOlq}#z$|(~1X0A}|09xRRY1lR zj2@LgMfHuG%Cb*#=TEzFn}6Q?f>w-<8zZ`gy9F`sPo7u`>=q7|TM<3*+O!R4HaEV2 z2ou~|FEp)j5UJq6>@v8xv#IG^k2=i*a2d}0G~km#0|40QW(0~gP23!oHQMlYpNfhx zt4mqHO7uW6RJ(D3n;dR9v;^UtwsS8iMZFR(l%xS>2GOd$vREpc15QbS4H4it2*Tmk z-wSMOba8Q?&(Y`=e2ogctQRms+11-i2e2~8wJNXG4OkM5fu-Q&9}x%q{;dvgI|0oz ze9y<{JF7eDG+C+f#kTAKf`>wXWdYRbWlGWquP(pe1zL2$g6i?uNW@bQs=?1_MWFun?Y?4Z8{AXjH*lXq%rgdm>+nIPoR zjyXR|_y=@+kP$clT&Y~bPmlr*85cA21p_Dz!hiq!6VQZ>%%h~Q-?z4Kt7#i1@E-Y9 zn*2}~XR$nGvU$ws0 zKIqGf`hjj2-o9q$!xE66muC!6K$AIpKsZ342}wzkxvDfE9RlB<8Z#V29i%u8pqU78 z$8hKZvc79r0ei6ZHOoUaqh51rt09 zkYb=UEXVk?fjU}w`cdc0MkV#>TDT8&aYd3e1xrzf^tbK&jm9@!VRjJcxaelDU5{wH zgz45ki>|tBlrh8_pPUQ^ISpV@I%b6wL4pDrVBl4!cXBxN!U$Q-%~T-ogWh)v`emBz z*#0U9hGzsIWWcoTQ*>|1D>%;r8fySkrLkkLDV3|5U0Lb$gHO)Jh84cKt>ji2^y%;M z+>o|LCVXI&-L46deO7>Ulmw_&jLyu2!An7|uI+~9wpH@< zlAzrH^drK%jOr!}k2HkAfwhx`&R1cbEh*v1R-tUB}(b7{8T_>)Oih;sV zx_%-VR+L)wmZC~kHn{j{Fch!uL4fi!9cNJHSDy?vt+5dmzMHK8H2(!`XJebeC(TQb zA12lNivgqM76=d<8YBQe#F{@jQ-BzVzk^5}L_EN07!r+wu;{>Sz&N zXZT;q;V)nWY0v|*SKdcTQgGV{n&*C3pB&vG@{g5H`Gl97`%(5IV*h6v8o#-5s~Q?U z(o%Yo-*%Md1~*j7m)yi6Ay)l-@9)0^|M-9WXfy%*Ul#?MhySl>0L`5K_p{(R+jno? z#&~rX0-p?OYHD->*nT|QwkkRP;#Dc`!#+JobA1LDpatu4XOH}i9Q|!_0sr}PaF1xU zY+wMMgDHpk4&yG#Ba8q_m>R4Z{u<*NPlF6z2HhjB08ZEjEE&!Z&&PBke5CYDMv36x zz}}!{Nnk-1;ajk6^?(CeA!a61m?DJ3eI11bGlNIK@49DDCGC8|dS|;p>1W{XO%HysHcLQPck&p<%n*$N1A%2n9{lG9_+{gc_uxwr zb4|BWF5ujW4l0-#m_HwB4}Z;~Cq-ev_F&y`isnTHSIlEL>Iin2r}0}O22CCR-=pdn zxg+MXZbJGx3ikr~z-0=p0eC9O_MfVQU{g35ytFR&k=#^d0Z8!3Glw^LO=p-C9V*w@ z*f}vuT92O{ke2shj$j(AJd^1`81Y67{pH1Dk+56uxOAT@&W97ZL~^;bwmcR-otnXYFCX(X z2tn$+S(3-o(&pe!uWE29{kAbNVCnKknr(k`R-7R0`8TilbEfux~zw{K?N8g2=fj^u9O)u~#oAnK5h)TrZ&&pBK{*u+Kg2U6UJOwdEPEM>69Q_)t=7&`nas^$=)2ZreF0cRB zhXtC?zHmaeJ(1+|D$k|wk-2o;#*t}{puA4oO(2u_db}571c=!<3}POhuHq0Q9IRd# z+0?jUT|asEo4kGCSUvb(%A!3aB71T9o5IP;ArlY#G2;K@tu=>ZP8@5KaN zle`bumZt6*P182Az!KCxlLUdvO82^a+O#F)Y+6oXe} zmVcHU?_DQ*R(nuc<9!{43GB|cyE1yY*eJVAf$l0`Y*D%Qsabl^6IOE_pSIxdauJo| zbT9$~iwsWD3nti6Vz_X#Niw`H6;fB*Lu)pHPC9U$gX2RCD@4uw4V)UzZ6=2;M=2)$ zIB@;iPRY^mKGk-sGg*B^%2_3=cydywaE( zDHnl5`iXDD^q7QRZc8jL=w$$W* zEN6<0dY?l1{7>>PUrFhIfl-jl%r%SC&(qFRiV|?_GX32diHYVmW(gr}k0lGJ9qi}> z>U;MEAMj56G|C7Mx0oS!9Z1GIih<1(0W+huDp&Xg6!+0~*3`;{4K!Wp*16ubwFS?p z|5C4fa1?jl_^WgGe}<@Iiauo^aGls|)6!D!Dgmr5A}QVaaUC~rg8bfK<|IPnNItU0 ze_scl9lnpLig}EWx`OLq%?!g1$33SBVcIaAYn+EydN2_unR80IRW8*wY|Nrve$C}W zu>=g{peKRnV;kG+&C!|s6<8!fs>!-0rSEgeVewn5TCkt%I?(L`zHv^BZ8}(Cck<~{ z)TfxE#45+sYGSnKuQYp$q2F^OZPdN+f=VV>Sbg5-cau9u!zBuA|&C!^ht7{hdU( z>YH0q$2_;_WrzcVBtt>C$O`$MZB(fi_!lt%)?yT>a1aHvdfm2?&SCe~&|fTYMD?)i z*O=LulTLo!%;OXlCqfxXvDo-UvcibKzNW5lBmQ?p%<^MmVvf}N9C16tVFCgI55R@d zub)p~0o6_x*rk;Agqgm=Tr+bgzu}#K4P??zpd$i0+?)&tmxP9&S@0$qrBCk~OuE3> z`9{B?t)tU*VNwA^LJ|Q+zvPbD8+i>G{vFiULJf=26BY_;72#(c5mZ3{rh~{S@B{ML zkCjyV2R#ar*D!%L0P$^t^!r$-5AAj`=v4x9J7u?axzNrF%!WtkZ_`ML5 z113ROB10s`?y`O{KfyotD@LRb!52*(&_lH;65f~42D#~wLlBZRRnXhcTIlBZCF3DYW;?XybHTDm;5UH&{v z1dfd>zG=C8|8rQ|S^4?jKO+H^zx@?9p0Bk2NVAS&@sDIq=cipdqyBGOgIn|$iJtPB z^3WGI;AH!=K1(pH-6b|CkNLOW&72_L0-ZMB+WY`JOQ+70M_T$EvNYK2fcMLyR1?zt zNqk*5f(2UDV%|WA`5&(h&iYC2967u*tWk&_YFaSWXZ$5u;OQ*~{tnpLM zg;Bshi5z>N3!j`JGa~~gi|h@@=M5G2#jh3L!Nlt%{cN-#p?KU>t_dd`NRNBe?&#vE)0M0u;pbodXgOWM8o0E}= z>2z=9LMlI`NbbX2JA0De*)?;JzI0$FlIAZl)9~T2SUvNH$SQ1HGK%{W&FbR+9U|9g z!A`IQ|M_1-aTHbFHw_SN?{w}E5-#d`caPchiTBhr2MD_KZoAd$!|w8C^u047_TRZL zC-FR)_Vf(*HpV_XL*#Jmzx9ewlJKi(`&Q20H8;}~1W2QYg3de?C{CD4?U+`6BGhE| zoD4~?c>_kwhf16O!!Ys8iL9|vr=c)~)mzWXvLy8ZL)^W^&FNlcF;7MV-`VwIj1yh7 z@F3XArdXw=rRclUo@B)oy#gNL^5P7%*lZFt)BAzF#|8H#g7cEKb;)>2aN&EE#%4Nf zV6q!>sOkB1Ex@8U!60@ZFuC%sRu_uE&EN-QkQ&9dK8YARZQ3Zk8vjTblg}EU>=3e( z{O^Iyyl8g1pd&4%rMVXd0KNgY2=s(@46B$i2Ur{unu0*ZKEdRB81Z~CUh_MW%kndg z(d-UC$-~S#S;yj&Lb!citu197Jc4j2EOBo@myKlw4%qfKy5SD~|8d5?bX_I_e~+1TV)f57dUZ@jL8T(?vG_S)=zfckxz ztMK(^$uLj@KTQ1!paY3Mtl2zJ%+ibKp*l~i)KD6S?f}5^79d2BAKeH2eqb{LHD|*r z7pKWL>IKvfi-6CbzCJ_dv_=nu@$v*&Sw7(A+_kEmF20RweZZ5O^d{P0Jlrb$)cKoI zM+cU8!1TJ#?dsso%@`2*=3$NyJX)u~=~@VVuAHF1)XDh*bav8R6;~ZK;f|dz_pieB zp(p%?_1VV@kC_}5?wU8k7#R|f*Fj4b ze7y9qDB{XeMTDOI@T8>zeaQ~`?0XEzKiz4f6gxXRq%ml( z@;e*(qo-N=5;cAXT@lPAsu@RM-xX+Rhw0$Wx-(bK4psu@-P7w$V<2i=Hm;S`UV;@~gxu#F08zJ z^CUMM9n;=ox8m-HExTrQ62jtH@s)vp9yhSjF@lwR51a>a%xDLvjF6u#R>=R30ujyB zBIH&ej-#R8e*v2`C=ru$>MxT9AKL%Kn-PN11dzgLF`+6$=>`yAepB(4i2F|t!hk5 z+rF4}9TK&1cx)3R_}4h4f_|-}H~4B-S$Fiy1qEL$!6$0LSgO^mbxd`F5oV&n?ZZ&^ z&=~ofaT7`QAGhtAz7B6=OD`i__h8YtgMZKGX&uoDM-*ue4|L6N6zg!e9XMdWA;lFni4$4oHm*(koX7A zTx;fyHucPZPpdBneGu$)ovm-s$WT(KO7JlOtiQU;vCiB&8v(%QgMIriv12a*Q*tjr zMd@L^-4_gHq_QMI;MwxYC2X~0>9_SqzaMu-Yfk_F=S4g)<*>P7Gei=`D)$4fD>qb) zg|=5v1jHh^Onzx-XIq?DjAv-|?Jib8|28s~Nidk>HMsuFW2TLlQpW3tnS0B;Hw2|& z`;(K_V@_A&>%&GIaPF@0;dtr4>L#!5o`((_iv|}7=)kVPx2^LOSYSAqA`<70j`RBy zx3iJkVRj1tyc@B9vytNq)qSvVSJ<4cUH43O!4#!(PeaxpIey$8igLMEtHEcWG^|Q- z`KEHMhy(NP0nb44f4Sl@=+odPflV_Hox#5BmAY7GbuCjThv4uVRi6{&e%&yo19SEB z$-hXI*uND#j2l)Y(ZN#$?-t|9Mg(Vb>$6pr5j$-Gz``YV&Gk<(6tI?_>3UboU@);@hIlXFD+77 zpPetU2FhG_YSp|!3CMf&VR!f|F^#A@)^IT{1(w@^p{`_1{sXN`9#_u=R-#E9f zmwq>N9nLx^^9&F%pD=+-=PmB57R6G2tgTK072ospWX_rl-oR$;M_v&4f1h-@(cfbv zKZJK_;CCc)QaBt<)z_~1Oe@_#mpb2ZS5`xz?}d-i86nWmG2LGAUZJC|pB;O4SD>k{ z03!s1zjE}|3o2ZF*vhy=7;HNPn;);69}BL)R<{Wbr>@&$8=iC?SW!on(^=&8G9d}6 zb7sq;CzWJ7Lh~S0boq1mWAx*Bq}y)KJex7iFn`~}cX1Vuv4p#xP3=j2+@(?^IbSby zTtkvEl`X5JIext0D&kzNA9wn(prC*< zB(qrsmXwqv#r(OlQtLptcddM2CH41_qJqM6KV{-_E2xk5@X5hd+CwGHExCQ8qZcn; zT-SpmP6oPgoLIK$Q1WV17vretz{blzr+lXF&V%f%4Kzr`O_it5ex%5V9{IE0uH_Y{ z9izLjvsxNPAK?pf+S!Ea=ZFr9vbwF3v9~ zNQ4yy82IWsI{9%-ywZL}g@xG#1rSTostagz0)i9ZO$q*fh1X?KG3}dB9(n$XHlpf$ zWuZJ!R`_AADZSq{&$W2T`tz`KeW=}q=h%4~XDpEF`H8oy_V7=qo)3)zM0BU$ZxK*z zT)M0jLaX#-dI04EoEYvudw_f}vT-QiNJ3S>GG$v)X554U*e0$JhMA&4&YXgQ0S#Jp zp;UtT{(YrY9*|8(>ZVh0=;oYK<4U{5fGXE>iUMb>h^9tn(!2WXZGsPc%2KF&0^CZi zJM&*?oQuxXAtiXs*69~E)^iTD8-0t8qNbG(Ry@<$KIfnNUJ2SZy~zaCKtLG`qE%2( zU|?nrt*aA@h2rAOynVq0fj*gmp`oV=3V4XBJFw`E7LZGTCUc9<*!v**zIA6QG&BYXRL5Cz45D>gJ9=?ejQd>c}GFb|N2{vhh~sk@e*t3$8infHRS4 z*uLV5ny@6FR;A(a(EV_0T5{V@S(%Vc>&u(Ml$a(^I_2Vu9xT*;uA#xd?Fq*0bF?`q z|G@@y!9{`$h`={JC8g`f2R70y2|DO}2jD5p%T@qOidOzCXK&HAUC(E>lPg2^0XMMh ziKO%9srPCT^8BcWt}*8&bUPR?fcHvR1NG(uD5ZneUfc#1B_)fUxwh+kls(+|i@j-G zKnMnx*3Q9!#+f?oyGBu8;4Hm>zz2}PGivyK1lbrKIrW+7NPj=?oX|~@n6Mgo?3*t$ zVn&B$yNdk}o?a9%YkE(4&)3r@RfrE%G3xy#5~^!54k+9iLiQMz=Ycw)xQBn6;vpf&(_2l!%^lsF3U>|rO5 zHk~hcAFx8rE3RO-5*_1IgSem1=g=OI)Jt{0ik$G?Uvu&EyFj^38>ItE+FXs^Z)?!N z5;U-q0~n|QAbcPA{ricU8i}y5@aH~yUaF6ny-Ke!-8RQ%=i4YQ$*iWm)5^dc|ya6hWbj(`UD2;TGwBnHO zJok$#0(=^0w>!>WnMGY)F^D+AJo)sFs#^0xsi(0`Uo?V}Y{=Jn5WWiU=Tjl;tGyLc z(p7H-dHFEQ^q*FN;emYf2j|F?6r0OF$IH(8l~Hx$n$Yls^CkOhUxP>jLA4olxd1vE z&7K4x&OhMfR9=n`p9ShnYG9N8ihOZ5ysa5n49kNDKZD8PUxRpxB(vr>#}eY=S^#jB ztM4cA^3SzUB05@aKf@BpIFNiHLN(uwyZt72)L~Mce`^n}k|FDu81m_hy;B^zTJ@6ry3XSWIe;n=>C3HszUr3_wM=;(xdv|Ig5Ihm?-TAz+ z3+;9}`2BXny?Uq3t~8fgUCBbi%XHT`2VRA_v|J^vKaMq_uc0>jDS#&mc!KApmKGL( zbsE|-3+{TCxrk%<^Y^qxn+GsP?cvh30n74I-;ELivl3^75VYy=^{J(KNnuC$?{Oe%5Y*>YWG1 z5m~jhDKw()GY6+*4smgDF96yIxF4*k4{Yu2|A6cob0HOU>3`OQ3N^UFYXYi%+u_D| z(5eeC!&R5}0{r{{k_*f@^#u*q1;$JdjO)Bxd+L4k_iG+IJ`|j6?&hD?3At6c<=`#e zP)g`#z@(X$dB*f<1i#48cIn&b{GH0A2OU%#X`FF%jRO?BiB}6qb7l6_5hA_`Lr?R@ zIBi?MdrJ|c4uP7=`Uk@mP}w)Bmux4J9G%@1)pFGcwJpZ!fY=yBu2&0`69Q+{efm5f1s0%WXGBYp)0i_v28WF5V78ai{Lh>b;^QrhO zxq$;Z50nvNV`C%Z&iZcGyydaKv&cQ^I7F@^4ECHG_ADgw(Na*zrzo;~Y0R^#sl`rq z!rtN9)KP8=Vl0hG@awa7Q^l|I5wFMb9F$3;ud`^$RZz85USre)x@#XW9Ukj(-%ux5 z>`Od$W*Enfblyqc_K#z}hw)TRW9D*K-`Ajo*qrQ zIeAqb9XSUF4&^+TnGn@UZN}R`Cg#;@IS#E#9XgbH{v7R%tEv(X4-Z**#67+wp$uwM zA0x&%aP+JB!y;Wej`I8r0zbH6YdzGiu7-+9RZs-0DQ>ju6~_y>q8BrJ5ycp_ITO5(@jh)KTBzqZ5crd-Le!T)++*|V>9h5eN-|lU7lbd9h#`9X8L+n%vLvfF)g?{_5ixYZy3Qx=~kX@}GRI}ie z_p`JA_*P<46iFqIBluO>)Gp{l2!g9qD`mTJAtyi62zk#s&~j0?c^U}d`?3l9?ZhETHvv$d{bk*^QIo_ z8PTQdC5f>tv8aO+*AkddZ28(@2_tco0r)$T3k+?PoReWO*td{7r~_Jq(DHz^ z8SqrWq58eIcPPUxM(9hQgM$Nz>3{b3-_-I04&lD2sNSSdo=_ge$FKObeNIijqIo@U z*ZYpsJvc!=U6 z#s=1L*jzYL1-T&4!EJN4?w*p8>M?OfeJt;;8yLN?1Z?q(a( za(cY%*=4k3Y_s?-q+gzYtbCVFNUD*Hsm%wK1_l+%;FpQ<^wqAX7)T+}4T#*ukWM3i zZSBhDW^PSQGKd&J^q37_r*~FOFDxt+e);EnB3L{SGlA0r2vn#Xc)j(m7!o|NMH?F4 zqRM6Zc64{u&KQZH>_t%Mcp6jjPz}og?gtP#sIA50c~3BncH*$T{F2Js_2b9H>_F3+ z8^Ta>j@B6h@sZ>2YT@z+-WDdw4Wnh151%?}?thJ>jbHE_;U0b}RvAsMsnMVbMge)C zpo{|^rZK4*4=@VH$c45Wl-Jw&mC!LBh;vt;PxT?H;(!*>w&WvFJphZgxw)Cac>{E( ztxq?mgEmoBef=+^22V^?)7Ms4fdIsf7wO={2S+(1zPY-3TRr_~V_X(^aUfI&!q(3L zdGCgCdfNAAg)0*k`JiNkppacuWCyFhRL2lB{}IG@$@-y9OIr5_mUxmxo7oi(CYhq& z*FL2&o8_6UU_dCRS%i*>4i)pXWCyNu+Gl37LUQxlLHao(KRUiZzO_ph+LUB9_ z^cPipgEMpWmX$S~W{vO`_susTC)=8;mnzo_bc~O`MBIc3L(N+K_C4}!L37Qr|1S`S z6dBYeiu*j=TkLr*6|Si6HwB97?@mFuBB7d&X{B*T8S?m?o16PLeCh<+G%T#Fpv_(f zTO6DJC|RmdOAlYj&wc&UH(g@9ofKCeGYEN9$9)Vm-pkw#=XBx zWEYfnm>U%eA}~WF&BcHv3Sl4Lc=vVsrrO|*^D;2{*`4(#a0V$f3}I-fY-BWzG9wH{ zpZ0vcWCB)k% z`QV3B`JzL*rP-r=f3$qR%})%kE>s?QYS$QX zYt(+PB^Oi(0*s*0qZF}q#Ew%&kAgvhU{--^tpUUoI>v<991q$steMy`5(I;~!kP#v zR)~&J!E{P#RP0a!Ko-D?!a)@h-hJ94QSPy2 zsP#oBuq_Lp^(IGJTH5+ly=cA!mqCrIev_$_pJAE#b?|j+5m)OB39t)NGz+z$0uTr? zOg0I|&ac#%9@lPAqCB7O5K4s9AhzTK!fR0S;imzM-PXVv z2shuAZWk8_f9n$nNntj2q_XTlk=33;x}v|0QiK-WYth*is^`rl!U{;`sNqorg5_wN zYYPuTygqeQePV99y7yVLFpHe?72>mHUoL18&X=GQ^HgQNCnZ3r3+oYlXl#FqiZPc!SNI3f-l z&sA&UuE=Ili9SYlmiZkfWtyF7%BySB-#*_=ItrkZ;nNS$<(?Zu+kcJPKGZK9<1)Fl zurPbzE$lP{g8_^IG)gPVWsoEx2&si0IXZ4V@-uAkJ<0jKba8fsscK{-S%MSA7(XR- zRK}uq-sRT<AqAT z#Z>+t@#^K2?J+r-B2l8SoqKX{U$L^O!iPHv6tV2aRRNQ>#sVmlAm7knnI!TX&kw4% zgrwWc!G!At^kudkHy?;KxN%OsJ&Ypbp3?wYhDu7166Q45i!yU{@_yC_4>Ca31~?ip zLRzu!K-elzDvN&p=hPIf1{wij`YHkBA)Wtxj|qGSvLtPE^h*Z8O` z2Os0mwal2|F9{`B>K!)~M3qXstF^7I} zLl_O*u3@r#=5^pSLK5b~5vpMk%bdP!u5=&Yq_MGf6kP5Q&#Y~7C#8!3Uz-4QcwwNs z!P@%g2usY)wRMD!hQvJ6nc6kX)r}f!b^xbjom;%tr~{!j52yS zotE#E89`-RGjj$;8J zDwq&-w}(g?sH1E6Rmrr!NMGtsA}v2njg6HCfRl1w+|baFyn{^4PN#~%D}>G+Z^g0> zBw_mt7yEm);*d<1^H1Xy-z(!)YZ|L>uSI(0+^Q8T1-yhxf3}AOYq3A&jb8Uq8z!4D z_^}bJ6gs(XbMSJ7-sd;@U>px_Bs#v{!m7kf;PbOe61gUJZNdm72oI?o^T{KG<`2Aq zyAeL@;x<-3>m(m}**`JyC60kNkVP_f4W) z*bR&KoQ^n|Q&|0;cNejhyzCk?m*5`=u}JJzADmtA7(YAiGGv}aR9LnOnSUeG)VL%^ zVtc|8mGLmE&n5Rbz=SoXeL*i=DCp$H%`FAxhVah3w2PN6F1QT{JG+5S5-M3gWfc`> z2ymh-J8mK~a#vkUSBz9LryH_ACei^9uM=xQHQ?N!Kfh@7!~3{5rJmZBPW+vQhxf@& zt>5{$q_<~vyLj$AeyGipPOacDO_hpzoBBF*) z;OKP7o^pk9(;V1}M?NddXw=`nc_n<6t zO=zvA4n#5go*Baq{Tqh__*?EN`^SwEKNksZvtNSDtiT;<+(6T^y|EYXMotS(wP#;N ztt*@ZT4>M_@~%qZ!4aSGtM=!>=X3=`V^CmNDVNgi+@E2YSpn%+kq*skjHjspB%?YW zn{{eE_k^ekJ5ajRpa1}>YuEMD&oFT^0%9J$RL3W`(jA#zJbOKD*UVOd;3U-PcHpg7 zUu(a!9eAFl*oBHvj-g#z4bUtyFhsiK#Wm8sEC;#nf-pJ0u}Wb=kLKpR$+W1h@~9Ib z_@&zXV$x&I)mjESgYQZ_I^xUq0~>BmfB=B{ueP-F7H zEkq|oBox}3HqzBPY`R0eZObWIJJ3I2g9 z3=B6xda@%FZ>fiTS>V^*F-rG{zJ5n=nG!qCHVD_}XG-ZECBF>6X=@Jqvfh7MBCbQT+jU{oNr(JOtvBxpeOK4uW?;hKd zPv5D9tZVHZ9{Lo4d^c^~aouT0TJ-)XIrYQow`1{YL%H1BJh_hyr$$)d(GXjwypD^CKu;aEQVs^M){`6q{*ZS=Di~>7J z-f7xfHSO7%9e?_2Q`c>ij)|^S3i=!ma54{nmCHi$_yHE5rUq@R;McWDVD|}dW{kCf z3RE2>&5(&P+cxL6I~d_dPcB*P2q99(bne5x08Hc3{3eAb2QMJgg;Xzh!yU z@cS=@c#5}(i`r@9WRGyCzx6#Ucj^`M`5nbK>2LpGvs0+|(kaeTFl%UVy-jMe%rf_O zDlebN*94FwK~o#%9$kMfI7bKPh^V^a9w?^y)5RV;{yBmj{bpzFg=@jt0v8@#FTr}_ zzV{9H0q!BZHZToBMS*=8|AbW(JHk`+UZq)H>qgWCZ+>70v8O#fuSo61h*D%1*;&Cb zX7s)75k{#?37we`GWqlEw5hM+AWyyBc^wRLIIaXNX`u0WvsCP@(g%Bu5AEo2FP^EcxNG_6>WE4XCZ3P zWr)#0Wo=sT?OxaOiXqnezzbQEbINX3!PwPo5xy>VbDQPjqZU!4cVjdfRuf~W@#z0R zV+d_dZTvxHNOdJ}l$CqF7PxB%E`z_48t`8Wxj8i90kp!hG_k`wOR0rln$N5OEzLCQ7_6c`z%c*Z_xw#; zKwt4Q%crq%N})j=YxUzZvy(VP;pOb9Vgv0gCf#+v7kIt0dt2_fAr9$i8brH62&S(V z`-G7+>;4btC~b>S$Rh*04fe46y5rbnnCq1xbA>^R3ZJOx5H~EgeV}x|!y}S_0S-nAB2DW~b^o zy+LLZcNXmpu*gn7A7eyFa8dydUo3v?*9OroiD>y+XdtI(Jm)imE8W?xl%_$2jmJYV ziMAcWi>C{`1q6vab}jmMn0q2FY6NLGr@vLVbSn05q(3lL6a`4GhNkAMdo5Uj%uk;z z`X!ykT$fdU?pU`|#gsze!uf5J3B=#J{@)saXhFx{ipIQ}-$z}v7nX_o(75gb?J8ev z3%=K+G5jn-KYes6&88jC7?WnIm@*%skus1oDCsizmYOYH|0W#=CY_OeURKZJmW;t4 zR=KzJD|H$%pTNz=K)Dhv2mvaRL=)72Ux-BjOP2$s38{2<&>pYHEMrc6P@SLu=GoPk zARq?+-#0+v{Bs{P@W}mb6GfE5A~4fD!kUqxKTXv0^xZ&refNt#64l$R*!4}USMHV& zd#XUkQ@6ZMi*VCvfzL)D#ZMS!+&hK~j$d$4bu7H7_RLI6y~T0Pa)WZ9|I3SVYisL_ zsw#@A@t&q2+!sJa@^zylD4CocZs3U!_B>?Zl>lmZxlluce})8|kW&DtZ>v1>o2vD2 z{OPPXgiChw4jvzeuZ*j%@*=Ee^K@~m#3 zh{MW+T^46tMG6WF@8tJ^FpFLH+k?*s!X*pM-1zYvdQk2uJ3VO@xJre3Rv0iB02KSF zyqq+lD|q-$nr72iEjEBo0*e7Mxk^B~B(c`DYCpN|#geIGVd$7L7Y!$=$9r-vmCD=Z zd6a*0DcO4}Uz%n{ipefpBHzC+;Cb{E&HzWt4HphR131&n+G&Z)lJa6-x{8!kQ{vJ1 z05tFzU1aZ3hJp18Z}23+%caC zyaymTfC^JVem-EzzH1AIC_vTxrhCcp+NH!)fyaDWVoOe+nfkDW`Y^U=iun20=FYI- zhY}4!UeAas0cs5cE`#D%sx#yQA2M=tL%_8h0KG05Z5B-fuowWYu{i1$ zRC?I;D%scHve26q_5lDCkdA=NFaXbhd4=WCLex0~Wlrr+ z968hrmg9TYPVu3k_tSUbAhZNwuAxG^pHC`#XPNRymWv^2rADpSX-0Uq z-($y{Mv@rO@9#{M(1%rE+h$U!AdlNB8vTae zJN=?t|0pyw_igmyE=`9nFTmb|+FcF-O)49>ZO~Z-%#B>ZH5b0;T@SAI0fI4#K;-M) zSvny9#H6N*<*coYA0TKahC62Lc|?1fS7h9^7IZs3bV_7wDtW6YZu``&TOV#ei)6DN z^dR;0G@^UaiNj3()Lp?J+M68Dc1tEeVR*s{udXUk#ewuQl7T+w<5ZU|4`GN#_X=&e z+1t*(K4w9|1VD2@muu|o@O)-8)YWeS?gRk5&?@6(xpEO?w{E>lNRS2E8sP8&a0EXn zsHLPRAP_~XE^7>*Isj=N5W z`qK{P0PU!C-?%Z>ZdwY6VA6n^6GC!1@o+?luHU{bAZ(GVlXM z)plFOkT!@?K7dpQQ;cB$h^Mye>Pq}_V&(vsPf-PymeRy>G2^AS^C!5X=nQN1}-U z=5~*_2~4!gq=Y8BeZ-lJe5yk$r35$EZhY}|x40R_-N8$}x&4xH=K0v=JCoS%&Ut*Q zNO8+2vsp%=1AjKW1@ro7Pbxb$f~!_1>z;3AeQr?*9bg=_RGr!Gfw}fWiasNOg)KH^ z6-_-2*|fK7l|&4f3fvQuY)xc}A}g@9)W7TqOPJ?4{VEopp$7g`(z-ji&C~?I4r61DNMvv=8TAe7e8! z5tP6g>s2Um+;XVGDgW`C6Nxp53spGe7rA_*-NOCyntD2Xl-@FNnc)-OV1}v8tdR@o z8-fWMijq7rnxE4dX2k|%=9q%T9+9JxS$bWN{(2Qok!lHDBZIZy;RO}oXpu!zMh6D0 zuX%(bURllZLcbP*m;`-vCxH_UK7fKwd$uH3!OScZuwl7@Lhj_GtXE;^ns!da*ivI3 zW}|OobXpMN98^pJZ{@wYo=&Qbg@0~v4o?)_H9>vfon!NO%d;uKiQ}|Z^#F$hPr~m%)Mja)swTecTeF0AwK2KD8$?u&Lo)7lh692FgPtRg zCw9&+-oHYI3yZWZq!jQoWJtBf0Tbnd)wH~XJz&;)&fE1aD zh$x}LNRT(h&hK~(UCVfF|nUG}{AN5!r& z>If1@o9gsEyF{p|z{?pt)5wr}i?vlQXBCB4UjpvY)AIuAdi15*dY(e8P_fW)pTB%% zaO}GIN8vwnnY%H1*UI8r&X689l^--xq^iavbia>~25%a%y$r#LXx#LOvg5$2qPQ%{ zj*hiw>zT)Y1nOXAMJV!@sa+tcsrs1O47Dt9x>r1jH(#w$TCJG`w2m{09z=;ymoyjz z;QoCSS-$-o33IA`ReUG3h2-xz01}!Ol=Y&4;V{i}7l-C?p53y5D>%mpP~PCZCk3bL zC;h<(1Ms09!hcO*B>3qvDFcHqzp0ceT`cI*1CtpJg>&m;Eryank3(wYkNilt@YU3`jRf!^}OSzx%&;EtiX$_ni0S-p_vavj=1YWg@BJu6cYnK-l)a z&}M4qLaW2brOCwBO}Wtmy*o6~0MI5s_Zo7kEqcJ))g3Nw`enCF`a9p$GDE!S;WGV{ zf2sTN7*yI-?qO+h?7al!>VslyFiKFDkm|gGr~b%L}84CEzYW4_;`l)$!S?t_`+5&I52YC|CF?Hk}3Z{3>!u!yi|NsiN+|2m^N%aZ^2TDlfg&-iM5 z>GubH7sCX$LEXP`jGn{VAZWI+m}%vn?&v`q&~IAh`mL z*I~-JFIV~sPCv$>v*Oh_d|(Pz@yx!pDwYxt_Noih5-6vhKJQRN_#Mso zg21iWQ^bnvH`0K9rX$1S?s{1nM5*9S80c{~dsUr}*bj+ETOrqkk2#v;VSY?a?K$!= zL`Y&NWXBww5v_8MfV1&pa-=k(A>z*+sVa~e01^d)ZcL1;1P99jSNdtIdUk3m3lMFF zC(O7Q6eTEXfM0-&fDl*orziY&#!Qa$CT<;j+GN28gFs9Va1tQKjXr}!qPDu zBvNK$)xa@6)+vXjE2m0p#T}jAhvimlK50&lZVP3~90CN!;vHQ-c4l%2AQBg9m+~?a z_?*1)@WO-O|JvF+fzf@ChC9W4z$q4aq5FWJ>AH%lss&IsAe=MM)us4@PFew6o1FZ7 zThtkFjXyu-0WSRx^%TgN01VVUrNT;26d_9p;68vIF|e*Y&4nat*^gA_e0A<*v*PSi z>*rS#>~wI0uN@kDm%yo{7GY1t?z(H65h=eF<8*uC#&ZT2*<0Z`e+Fu$X55*Ca)e7& zzx1LK)i%yoyh!YN%VX_JA}7D@N`xQ$`2&zHbf{Z7Sj^dTtrzh?jz0}B8dKi;d&VdC zVouRz%+nQpG;{)|J%5HLd^Ee_yO;MeL(UE`0?#hOpoU0t#+rv{OUgl3&p|Rch2N0; zIE;KVb_763#HpJgwt0*SqXzmM2Ca(Efiy3$@L66&03tjeAD=SOb?tkg$R?oTOilFw z{f*L78GPV8O?>mTdm0oM`E9qLVsNw^$66J=epmMh#IL4Ul&3n!NggjB8;dBBF%v^> z$TvKi)J%fAN*QT$+bc*`TZWr%OgIPAwOETw+UB?Px>(?O?=z;}EeYT?jqz*EpB3C! z%HVP;yHM`r6asYt!{p4P#suDlUS)+<3Eg_vI+obJM$KTw?CDP1L|>OHyp&Te4?CVK zfXq+Ih95i70U94|23KflXR zZQAu}WEo_c0=O(Q^evEHpaPn$-GC2w{kp<|fBM0yP+3t=qHDe2cucZ5JfYZ^zAzG|o z@RY#dIL?N={ly`1aVER{l{B7b}?18m_8%ws%yAz+QiNpDHUu}QT7;(+e8tGm(Otpqsz zUA-$Jx45i;M+GqM&vIIC!M4SvfYE>Fd2VcOl zOE<(Z`~f0L^TUK+(=U31W#Lrd_FNUf!%e-7{vSxGc8YztP8fFWa;MuFDNNL=p>AfW zrDgkRC=VNQ)5`vLWzOSY5dYdGxahjl!p1$qWcOm@|D;iV2yhbT6DZMvLQvW;m^$FI z1E?6lrvnocg`qhMH~WFoEGV%EvL9liN91h+OdxWGyXJu1_`h5`W#!1VeaZEGz%)yd z^2}e`=aII_kA-yOWd;Iel9mmn+-?83Y4S851(*UGx zXF$>hL|m79EnAYcR6wdz9~VEf)GcEE#@x9K)(F>!^{rO?ql`u;Ki}}=$lkx!Z}E1S zR1oH;aXb?zckM%B4wIL_^Z$PK&#k|X_VnwMIZLsHv#242D43j==GFuRWnHdzGLdA0 zKoND7$RDkPIjnT8JT6wHbk97d{g>1F1LzJiFm@|cKMxie9(|5BcP+B}iNBCzL7FxLLBAkQ%J4#l zzH}?jqu{p7Af4cReYYF%DQ$h#RyNg##xxv?*DWs9@Uls|U2`D`5bUj?DjvT0jc-?+ zpTn;DGe76XPyCs`y}G;wnzyRNp};?%h~Dh3sJP#MUudC!nxg0J!_VX*{JB2<&xMdL zXMV~11*~Y;D8zRk@=`;K%Cf^gAFBSOA{u#{XWriDLeK9PCAM-sh4ivrxk8CX|4OF7YJe%rZ6go8)26m_)P=^7q z^<|bFc0v5y?{jao0c&Jz`)F_VU0yc+oUr&LZX9T03tz-T1j$#X`M=1+m=p)JwQ-5C zJfY)vn^yJeVZ4#jaPmR?yM0w zoWxmOYSZH4;t-#8vIJC@__hxR7Q`n;S8R=Q)4nl-$b1+_t*V}~dgp44IQ{0r12Nm- z7ncNxP5BVUx>zDwZNR+-$;7JHzTHBW&XqyUy*-#sO%8d~(w9#FHRPzbH!(9`Jf9zs zNaQp&=iF000G!LMsr9^%(tm;;&q|J}f(?M8rn$;00+_hD4I_PbsuQJ)h8rlzvu>+W z1)c$hJ4ybi?7$Mc_@D5r0;eVwU3~yDF;XaYe>S+(>L{{Q&IMe7bWjy*W3n1@G?(dc z``Bh%NqP4r3%RH0-SeYvDh#L}`S0fzqB(U;mY0s!kl`^pp~^XQ0;$aRmvWlJt$&j6 zgKX@}mino!Xd1cW62QD1DhUDr-oh6fRi2Z;0GO$z9dIInzb!ewL`2BYSLOi-0}F%< zOr8O#Oj%9SLhnd-=&see60Hj&<>y=XkqYZLFaN?9Y3aL6AZG$w*AXiFlN*|aw;taJ}>-cK=vlY_9Z zdqsBOr~9%V*~Y)lCU)dEF}3#bmbv9CFjafcB77iO8RsPDapsSYWaX4XD<4nb9c_+% zJ)DIf9o~uR)2%9L`4ran7~A3@O%vDn^zY0)03?A>fRy+bcJ!jD1kL2QJ}|2`X_<^M z7(SP7BkUK&oxDd1ROjMsV% zz1VFNt8X0}y|J(IE&7c+a3KW77#)kbNZ{M@_nSg!n8e!HAsUA%l|$joY_ zd(GQ_2GMMdXI_9;PvUwM!7e~Sx&}quOF(n)*dFf}y$b^(c9Ai)YaMfYZxgI{Myjc7 z^EIb86J`jo0q`Fw`kSUn&WrL|PtfF@e4?KJjb1Mj4nVB<_KE~{JzP4Ai-Ua)8*A7N zuxkF=g*u1<851=R+ZW@)7PU@^W6NqOp(iGov>+TlD}O8d^ZzJ^%J)Nrwa%NlP15J?=^(sK6WdBkFMzrA z(@pp}*LBeeRM9#co%(|=03wrjN*gAL9*!~)&ZVSoXT59l?n&$-8zg)8-szPr;V=Nd zml>$#HMU+5Hf|oG#-M{g--AsOT3ie-Iwk!cz0A)X=Zjf-xIXkMMeJiU(e=v+lH+dN ziZ~S{qIP57NhY1Eqen!2oXLquqc!;3-}~c|f)&&ZfGB>_Gdr+wZ+l{aqJA-FZo(63 zR%?;x=5A^6TVm=eyGX@5N|)!$**D)fhU86BxX87({+NbV{`A%|xs9^1%HQv$sbV=b zG-()+b4o7B4dRWJ{TOBkT&^7r5S`j^ohD&d0GRb#Pv-S%Ej%CU`w>^h(xy0XE)kH2 z2+n~8yY17;fp!a>#&%Uwr78rtPmglWXcDY2`6zu{rZV}>hfpQsWKLn zD^y~TbT6%skRSgKw55nb$JnU!&DU+_Ge51vjB~0=Ti+GCwg2LI*ZFN7gFlCykbfjm z*c$fL(a}*@L)6wADW(DP(j(axDjwQkpOiS7-_^S7r{U*6P;Ao^(JXh$DMMxENZcY3 zn)L_UMe`~~2}OXqp|r&?g2kq!`P1P<7igiF_K>2a8;{TH0*@}u>H2FRTwQ;QYMVCx zjH6L%^52X~ljgeyQ`hfWarKrgciZrs|EXHL6MGPM*@Q+`w3~FI{noENHW!V!J(@aI zdIko|OE3yxy@UEDoy9J|o&z?M)J~%X6Hwy;fl>aI)RNUdd+`niKjZd4u`u4tfM!D$ zc!s@4Aucnam0gG=cmSF>!Uz;8LBF|9G3Ox+BkxFA{;l_K^A~xPq(7&dh}{Mu zXxA~$`rY8lKH2&EjL2IVR^*Nr2tYAMMnpq#&k&@1){42TF*5`bUp3Lc9;;e}e|f<7 zd+PY~b)4#R`qS&}HSU6Nh!jbE%wf+KfkbC#XJ3g&h|8`&Ri)lYMg}41=YTpOs(Cxsjf;5@tVjB-<%yAOxb4kM!v z!Uwl`#b8~Al1SP?^Wy}j79#R@$8GMnEM~qNQy~1bX|ZrPS@&r7^ORl-QN#=Mv9WLj z>yE6T)o%|N2q5dPm+!9~1WeR8vjX@z@t4UDF^w-@zKqv68xP#o*Du0lty93UuWxie zTt;q&n?Ww?XwDG<-duxZ`?jRpjLp-dSH+_BDn?LO)gB2TUd*#X<&xj`v8rxr9jLd1 zuK>)_if-!xuKOwWDElwSyUN#1U?ykr=aw4bru^Ec^3J@EQxt(WRxqsnf?03b9B%ho zxcXs(oJ9bi;VO$j1UWMR(&66DBDb_ny`ht1I4joMPe`MHEY^Ffs&m9z_KYeEazSkE*0PXLut$-s?7+|&;ksVETXF4Cd`F)WSz9 zOTVeY&$RG^)aZp4&T#5g5jkEuwRQJ<3tKGhHMd(5y9+8DSey}IJ$>N( z3}~-tGN)E1&tZ``4p|3aV%!oH6ixj zD-KWe{P=y=P@SQ}(n@@;(Kejx2CQ-LPh^Bpso8{|18~9SRSZ@}V}MuHz^fZucGwPV zOasBn$a~qw)&tNzHGh985YbK)wZ3pFBG9Y@ z7q4$1eWO`;&5H?U+iM4AKWB;JMecgX2k>9J`)bOA1`z}q-0{4NuV9h~j@JCQ^iujw zzHi?ICS>$yk(F7;(PE`NWtUWFBdOgngQ+z1EcADq4cfbc+hLXf#M z?{zf?bPM^h(cJ)oO2$rxZgM_=cusl@Hgg^s zQXBofv&n#s@n2uL_I*g%hU;BOMM(W_Nz(=X&Mdg*o@%56WpQzW#R@Q$9$|9*%*C3AC(THXsaD~$U0e8o2R>pNH_zot~H znS4duD}wVNPm8d*RRR$x8Qb!$1)u)?U!|g`E)_ZAbLP3KDx^J9LJ!(>`Tu?)jz^8B z%9XiIEJxN*kn`7cprK*z?ryO<&i}|BcNKBTPw(-Kf1MC{H_{^dKq+cj_PE2w>6!NH ze@~CGE|-_Ij`W+o$UY-nMRA8XlQTCJDQpknw{p`fP{$?U;1!g9FG%EG#Ak?hLVC4)+?M)?s(HT{~J4X zc1A*oBxxZ{PF#xYOr1EhMdF6@%_9P{r@PUA`_(n<&b~7i^3+|#tyA*Io`j=q>^AKW ztCj=k*fx&#Zwm?C2Op_}Zmth}R51It(?(97?t_WbQs|L*{ctZK^aerN8N z+5c$(cui#ZfD&5C3Eye8XB63cRy?hp+J8=A_W7ol;WtkpoRAf2pde${E}>+pcj@d* zc;|#BbB-8>=e7QW;qMf@Rz>(7PS`c4CMI4LtJDTo<)JHdHsuKA8zT(gT2Kcx3|K5q z@h!#JjcKBuq1>XDMR!ZSWN>ygH4&Ykk@j!n_YqBc+58(#br4h;?fv^a5lI+cRdw|} zQ~$;HP&(D(+ce9?xXOqK@{li@5_9le{|47VQh3Zj30ZU~Nk|^eA;?95l>9JP+~Tl} zU~@oVp;~)nxV2qo?w389#=WX7?c~fVw;#$crC<~QnMi2@-+sT#YC4{e<_DdtNaUY(AKgLc*jj>2n%YP8S_5Zs0lcUYX1N8fDUJDdY6_a9hl-a2*JB=Bu|S6wLQj<7Kx0Ao)nPC zy5pGs*$ux*;8_;_Eafg7OAugy7k?!HrX=BZc_-q&|raVw@EfR90CEh zr9x9GFi!5D-F7XnE7#3j4Pv@Lqg0}nJ;Bj4e5GGHREt1x?f+d5dI*F+0<;fAD&P|~ z$roNA-*$)_cD{u~Mn+$sX>!w^TFfj)7IsJkIh#c-D|komp;+%?d`%|)9bt(s2Wum% zpbmMRl%Sw%pAb4{ae)(i>^#H;vpzvSRviV?HMWWNv`J(UIBmQP7kIg;f#OA3{J)3NP}ETTXJE?Q>BsP-AIV_J znnuZK{_Zj;H^dXBV`R$YI;HLe1Dy5!ttAG`B#`sF$(jcbYJ@LwV{$eN~`OxA)4w zb`nWA{7|BR5EdR9-A_;v#l;&-U|5}BUlG6ycJmO}zX0qc1ecZ4 zyKrbO?uvk%0fR3(XD%4E6tZnb*w-e3F#dNMbNlZ1O3aM`OJ4kV7qAxlpvCtFk0N3| zsU_!Qz;q+N0V{9T4L$$n&R4|dHiQjS$oUU>H0S)W(09es_m1bg<4sboTzS}C>Jbl` zX3$1y=u}8@$TRp%!M~dkvUcJK+$cXS0`ekl&#-ikN3Io5)u&M1qZfekFrY444Xt9XIJ^Xi&p-eFc;bfA5Co7P6i;9F=tH zGR#Q(jwN~(<5lnav)v7yGbq2r{je=O>hF!BI5&qmtgUk_Z9J?28TnjXfGYR`tp*<5 zUfFm5&N3MOMt^|G17{HTZZ&+FemQapJ!tdDXjU_)JpYup?l2eHW=QUO{D(q)Gep;A zc7fZ{^U^RUxEr=sLJonIM#^9^VyU;VH4d-Tc@{t*on__vyKGQhEw*JF_~3e3k7iZ0RZmaM$6DwCjt5&58v@=jh^SW5m$ zV8}gcy~hVfQ_xFhpDmd?S<`guZUhSgv=QyhVO+6x z`-{=82l5ybR5MVK#C=CEX8q_h5e~9p@&7ZZ91ruI@va2{NiT|Tx0vK$Rc4;O_iEd@ zVd{Bdn@veENlhR5nLmQvViOBCe*zPo03OB>S_nI9uHJ3Em?I-)#KV>({cmr6_WPZn z90!9g4v-Ns7H#cX*u&c95sh{aNuftwOad^r4YwOc2)q?M@iQ!?+#DJ6znLD~9Z;Yi zF$Ev1Jvcn1Vif`P0j9tdO-|)IAXW?pm&ln*f@UqUT(=I~7NWtBLw!^5lld_Tv!-Kj zluY>lTE9%mEHUkdeEW6~cy+-u-eWU|E4lF;AE*{lmtK(eTQ(CXO~-y~O1axO{62J83s)?)uLT)9xZA zWiE*2f~DuXas4v|$(X^$wd20bjB(D=M*KUEXu@Nja$PS@qNs-bdv4ULt0KRY$(ixd z+$QKp|Fepx-$L%ELg;y~aPogoPbhyCV@IG6fnB$w6R^&i0E_+JcDYLW7qfbw@5_NC zL9Ub#$3FZTeF_>YKY}IUlSQ3jmNy>cW4)Q1YMK3HF1uaY@FhkmE`qGJo)nl<8ua6&+)w<~2p#7l4Wd#-` zmmgOXaIu|*$s4@IB- zxZsgu4xLCJ>9Nt@SG4}=ef9`-wdKQ?b$3B#!$qtwe^XLIa)@$B!TDTtRLl))_}`6$ zWi$sZCX&d0{X3+z`Wa0u$9Cpl-(3ILzd(#_cExKZ+G-!$e4@xR{q~`G6zKs%rHVP< zo)<%H!6bED7ix`OzatlB71YgsEXQ8uSxk-S#75S|TLpcT-aUwPL5|tgwTo$ZYrjol zai-|FRzM(+_e9r2=hs6NB){XGMHbxwR*cGB9vFFq1yf;*lQ}O){z9>qIlSIkt~o&} z>qj{^L|BLsP(F}-N-~_9KT*=7G#|r$%%(9ZlAJRQ>FL-|n$CMEi(L~P<3m8QvWzZ-Jxkiem^TAMY|kbXiwf-ypk z+q5(ww}Mn&_cuZGPLM+_D4i6B{Bektrdqj2v2d-)g`7U$UVPo-ovJwJ9N#31qwqyB zQ6}D3yxV$g+}t@K!X9NeTP0$bXdn5Sy&<{P;(=|>jj;HSa53M0YsltCqB%nobA)Zt z&3x|`_$36XWX?PUd<&u&)YF8GW^FU#yEk@E6YS9I6=kzRF^w%8=C$^zL3Q7)34Y>j z86d7?cR~EHSFZ2K0JU(HU5EmyLZE+&<Gf=N0wBj5hMccCg>X?a%8 zhn(LjwAg#@SDW;{11vt@4%C>ny3tflp;qu>0#~-h7Gmlk0i7FOo)Oaw0!9Du0|0E z#^|W!R6S+AGBHWBK*>Ob6w)LV=#U_MCuFh`)D$|eXO^ET}=aw9*W zn;|7&fLl5|BLEXm9zq`K88U4ToBf6nK@6Dja-)q1;IQ^$lOjv}d+i3p24 zaKo8$WAOUrvF8LKp1`rl*0j^j_{e?5L=^OG6Zf)w1a<_>w?`r29wKq32n$h-{Y^zl z6u)r|41e03sYA-Ao;?JJuB#7CUz)DAKt`N-8+G1bO)0T_OWI595yC(p9u=i7juh)` zc8P@YKT{JH-v0G@g&1Rzx|FsX5CUvlflC~fhIctx?4?V`&WPQ*K|#st<1wb;QjDs z(b-Qr_jyxgpLlJ8gZ>XG6NWinQ`t&@_ZhKUfJ`qWaL`6Bm~K;UC=he}sM1gX4!o1T zU$)t&0`;q^snK1WQH5Do!Yec|MResO;kU}vg4&azp{g6F^P|CUi)+F zv+J>SDq%V;-<@FBs6oeqB5V54l}WHy6ln*=s==7IL=JEVl$TMw5T#gnF3O?<#U?-& zO#7C&XDy^Dj>SbqDHa1cxrhj2JTfvez`1(8cBoCx)S}wbecwjdQv?JAti*!=PBv=T z;KP!}VPjiu+5Mx!FD(ngES&cJ zWSZ|Ur+a3S9z8a$aXJARaLLROjDvOkQ2R0yD0llw(_q^0@-RW^mzzq5VA9|nwv`vHod5Bi zZT6Q>I4wI(R;`MH7W<;sLu9b$`{W>l%j}%|Dgg|vNrG&6U52Qd%UACX-=@Sx#Q9!T z9QFu13BjgnzIokz=YY zFkZmp)sh9;9b`w}I#(M#FSmR=T*C=zNb)l|4g@gn-W-EmsETeXQ82~%AqIieYX2n` z68UoA+HFrc)wog}aSw^r=U-^#v_JYm#F)pMoOHi#yQ#i%{cC-ldV$VGep_N5_Z6BC znE*nN+^iaE%cQ^kYqOIc9MguE*-D4#YU3m*a@)juGj6{@f5@M(V~UXN;DQSJH+|B= zUOpDsVT^9~*dp!x%KZMcX8lI0G;91Gp4)N@M)+ zdU=eS&VQHKB8ka5MDMtzV_~XMXMZF~rSf}iS()(ma2tzggXtFRlFHaE3Irh7{z9iB74F%+vQi^m|$ipz6yt}JiLt2o0Mk9EeIp&DnL{hUNtyP6` zBX?MUy~CCnHZ?0?M6b|rWc-UGDC0aYZjRRz+P(`%@nv{DLmRs`dLwh=_gM$MvkNI7-S1&6koH{-wo7Sy_Gnyjy){06^WqZRqMD#vM zHsaS9+OkAw=e?QhGOJs`_&AQ)gGvM;KQ zoQ-Q;GF*mg1@2Mgei!Qv`tnTYja+!#(>-RpJf19%Cmu&()IQ$86U?wR81u>)9sOAJ zP|^Anq?odj(gU$JpuvjEdIi)bu=iYv-hdL^ARM-`u|W~w43G~mh>*DK)g^W|1jrs` z1{pl{yX}l-#h5jN<~sY-a0(=}MJJTcKzWyG$W=To0nEqht>vt&$&>my?>{o9FC=E| zCDu!g+`(y44wlCt5IJ^qTyL=go-XhV?Y@uM0GhMc>hUDY%Q_Y2h=lcKRgD*R8Q!Dm zI7eerdJ94<%-fGTJG{oS#Z4^rra=b!`nE~$-+#b?Gc$^uJJ!uv>Viqru$~y#U{TTK z*}(mGnv$(wfuWYL3RolM!50CbX!1+_RjPJ}Y7pgWJ3Ux0pXfMZ9zh8+MTZm@KK%^% zmZSYaTb_=YL5CAsW}phXT7l|7*IpK~+zh&cPnggtc~k1^oK`;HS%uBvhV=H&p3`ov ziegc_FM2BA&4`dfxFSb(nf|=s0Qpo_b|n%SI^qD@n+Gc4{rz?m6*lPrI>F_+BAFoN z{MKFTR^2<}K;W~}Dqi+*6~s~5fy=MP36jnXX6Txe81P&*hWj*zyka458>b;LlP_zu z$hit0*Xb3N`v=4SZ3S*`Zq%)R6{xHo(`^O!rmkJ>)GYyld<4Sp*=#@UTQ{--%a#>` zXV2apw32X6|C#m#7-YM#D8q68VhW)m>Zloeu}u>BI&49*ChYpAF}@=24LeCTrO8+c z+uyQ>hQU8hmJ2=u(+g5m8XX&xs0qRUNtpkK)3|8FAw6*GTRYBYt*)I7SdT1tF`%-W z)l*I!lb>BxVg3-4y(|%HHJ7F|;hXqn=Zfm>m#-~u-7K@kphza9pmVFQL5n{MCFK+x zUxK5>3zN;Ge8_i0$oyx9Qn>X+pKp`r=#Z9t&`AU(D}#D#HYB{{Y0uOVmrefN^0Lw3 z%=*EseQLfP1-cEW2W_+2&xOqy6BFdBUpq^^rz!&<+EkAyU@+omq{gt?qbTndKzq?Vn4rA2KuzRd}~ zPItZzZ3gZHMyt=dJ|d4(6Hx69Jl{R9>JJvzAOcYmkv=di#1#dOT*W5!HRfP@WChN@ z=KGq#UBWzp@njK>@7!O@PQw&&1|OrdpZkK;Ud+h)K@-iE94I8n3UckSEXU(WYI&!7 z8vAPrvw>fB0vaRLhv0_IF7sIlNw%t3sEyHj- zpy`1t_Ry72D>Pd;-!owA+p^1UK;sA@V^q5cpS1K@W$4tj*O10nu&18^EALFm9<8WKd5D3G9vDQ>s?aJ9_j0GurKHeW_7DOttgKg4?P9Ngg(9yfqWM^l+`0U-*e z@Y`frF)=ZDQ?AVy=bb=EUT1x*G%K;?p_RG3gq!&qLv)<@Z#F(dg=BI!hKQ*tAOirDKxWniX!ZN!3&07>0;fS?(@x;y+F)zCF5Y{_27Fa}oNYyjqD*#N>nGP;|jraLtMYD}$PN6Xt6GtbCA zo5WB`hKmer+>NmKjducW>gr|6~UU{oTWP zYRT!_R$V@bh}1j336FNkFrlG&t=fX;L7MqhpBUIy9RL}up8vm#DC640T=TrZO|fvNjN`{UpuX>ji}_799h8hF^~3Wgsy&x=H)t0}pEH2^ zBQvjT3z^zL9%cp{I5n_C0CokzN51G)(q4NJvpx-y^Ua)7my91W#t`ilD zZ`_V5!QF5N+(E`Jz>yGM={PF^kYy1cg5nVBX!XAd;IgrJs-y28t{m=rPpT7Tds`__dOSAM<@jDF+TDn~VQh|<7)ACPhcekuTpTi?8rmcXxs9m=@Yn{4u54=oqR?MUE27gb1 zo#!ZPs5ZBoltFVyZ0?Vr3?#YTuy4doswiQ2H;EjqL7im?*y|<-j$>PZ8ZCd+6!bNY z^Wt;w$!y?|z0XY?vQHF)#yNl6?`i= z$btxzJDcd2)7Q}%VpV>KvvUJ;{Bkj74AG1A3louJ>y6$E9kJNlQ%(+|nB84*i9l)S zs6GzLROa05kly5t#D#l7C&XdrJH47L^+?B`{aV#~2Z=*SN@n8Y4)eSkp%TJis#u*wALgVtRE`x}T~xolHO!|=p>0*@CCyLfr4@Tus%{}dZl-v*YI9Ks%q zab)vutgF*&cSoh+{t_s?ouowq>@7Hz8*nKBqEXIuQ!Z_ZVMxr3$aEI$GF}sAtNe#u zG;4t;i?e-M7sbe+l>x7;$Awx3VNp?+CTBKm?R0);nQS?El-ENOy?Zd@as2Dg+u2R@ zi$)|ts3%%Wdb7$g_7n8lM00bivGv;{KaWLsd7(rB4gy2&$GD_W)o;&G#t_7mG1(sqZC4J8GLyrP; zh3e}X*yS%Ed*gjR`3azMh_kUDO$}{i{x>#>SM(;(5?o)OoadS@^2baAH@oZ$G7isF z;f@(o-wVPIA0@>^X7XjOY@HvJO6QN0P5*U%A5|R&@GVx0(;xf>B&F_Ww^UxK)3-kT z>O7Uci9Ks}-rDmh(J%RH%*Rm96~M??u0ma_UI8F#meqg(2zQd!p7HwCpWnv{xk(Y( zjtxh4WH2)SOKcq>300Mu*WhDnP;qd|N>Z$#b?dlY@O}eCNy%bI z!(0*uXc5BXOtKG>-f-UsKK$8NU;rtDC`X|0*0euQN92&`b5~s>BZrlZJLZasj$;A_ z%UaOn5`0^>`g?3_UBc@qm7fGkwQnrWWjNyf!40)_+AbKps~^KSMxN)Hb{vr3u4SKU zek}5(_S?kNNsn30k<5uTHIyHqa0>^1auZWfUScZ%CRY(A3$vPq!ORA3v&U5`41Lpp z4_PMVjY1b=OU&3^&JRI?P2*Gko$SEmPkz^aT(}5k&XPfBQjfw)$HZjD8$|r4fxWot z&LlAKErT}yv5Hp{rmk}Jof?aG9nJ;n8YX3Oz8%r! z>Fp}>htt4vw;}Lv*=;dGDVo2RH~%wLQly#n=-($BLIw%^@T1>cuL53)7zj8n#&1BA z)kOjisV3ItYj>~k{t9(6$9E%e<8>o`TgsZJZU4z(u=+ZvxkWFeKI9}!kxO$^*PUWy ze0<1-jifXs(x0_}z|6+H5$|6)ruc~6!ZS&<7)1ym^hF~TSwTC_ds1EqC@1pQ? zISfnYcl?1{RMdPrQtI+#!2Ds0R7R9gIjJE<`WiKTPbiPcy*gDo+~0GD;^%5U#s@oR zGZ_T^34!Nvc!`>E;eLUQjg9`bt2cKeqYjRZc#{bAO>VtrrL!@D?4QyA;6o6a9PBL` z3BpSk=lig3@TueX#VMf@|G*p9Yg<)Apg`@>C&8fARgf!Iy*XaK(4~8vaK7wSoVg$Q zMqO_tWvcXFe`(_|X&0DMzWe5{0_0gk>{DkVEOa$$Lx4cB*BfGUr9=fvgFE2NQy5cpeAZB;WaHv)6w+3@+!zga~ktbG1WeP{qO?_q^MrsQoOFvtAON~p78&##IF5UY`53}wg#ehUb*idX#lWhJ z&+^>jpLg#)?poaKua1>62mccVfge%%ZwC{aeaL@K&6fU!Xm)TA-Egv$memMuf6jpA z4BsyWhRL5FkbnngZW3-0HsPhmy7tCwuZ=xY(fas!hzIV1y$9CR(9iT3R6pe4cs~sJ z{ex#>XTx@DDSN|q%TWzwlT^Ee&cJ`@UB90=M=G-EV$-!*GF+h@<;kSwL+DEAN?^Qu zK<;{*pMUf6^ylK@V%27bM-G>Mgm~)G(ME{;uYq|d*1%K~!ntjG_ezm|xt*Y0iaQ0p zs#GlL>~TX&JUTMhC8355dv|L8?Wg#;1d?Rd8sU#->%1M2-eV?5$8qe^4h7xb-op@; z)h9APPBZLw?QXU1Fg4XxuJHp$3q{{s<|>!Q0F15P8InNHMqpa# zsSc@NW9*l4{f($I4A2tAZ^y4r`F=j4B4YwU41gZSx%P%Zuk;KI#)3xl3}iikD0aUX z86zHuR)}j^ri`yq(;A1eKX3$~T)~&4SAH~pjD`g{Z)qCVoAtpou^4@@qh^U51cYV} zJx;q`>Cwh+mr!HPC(D=_+1wgy+)}=iB>j^34PgUpgi&ntx@P^n>oHQ#>!%fD&sS)lREu+MRa?$5rm3b841 zr`nq#a`D{@XMvFocG+C`NC2ZmSZoj_-FWga0FvSG{J$&yLqu!NoavC*kp>Ebt*@&3 zBd0f&5K69qQN*qt_8!>cL*vYz@BA@OIZaDlYxXn?lINV)=hfDKMLHSFAfN2M z>0($oo2mJlJxU(kj*5|LC2Ua$qOIf8CUc)_3Q~@j-a^b}`Of-7sU3jw-Uoe9))N@V zst3}9_!~MpIx+#-{#L>$?kzPyozorDqcca zML!!Ko2N?EcJQ>}gnDI7<$U2rPkjsB{`jkJ!JDIBP?KchW%oI6YpQ)N>jVu?-B*U5V z$}SDN9i8426yvO=7EgJH@3d&NY!A{k59wuLS^OS91~+wBuS$(u?+@Lri3xVG8_oqo zJsI1+yDeKBnpuh8E7({?-|_zhD*FZ_=#P#4J(&y=rMl8#9mba;q8;_~MXpcKK5r4y z7y`Hh2?YB6+&gvt9mz3J^D1~_X%s+(AVUy#>AI`maXvN@n0=}ZZs(irqQ!7~XBJ=h z0Q<1X7x@=5f!WD+)QUCzHs5?)WCXkrA=>%%Vj7-&P2od4a*f;a$|6CH1aQRzuYi$2 ztP}{|(IjYtUhj-t9s1^0ZZ&;Y=T;t8nhB-ISt3Fb>QxS=i0KHw-GA)vf6SB0ftpF`4a4|P6YNIg%d$A-iD4lFa!*t-rh2h ziPqYw#h=YS#=K!0uS>~9dF(H(ZiVVU)dc`@#r(#0VbAXZ_) zw2c@3AX8IS{T}{yO8!J{4)m60gP@53epQlHl3bELr8MXDS;#TV4)+ehKoK`Cc5~H* zoH*Z}LyTg<86HM{!)I1pV?X=N!?s~^nMEwgTcZC^jtT0WV|57>d8ZI(9?`ig(W!i! z8=fkDvjhR-Ne_>gZ?P_|uX^`IAnnPIrqf4n8ww) z;iy1euS6H>od_%&j?56n6Wp>B8KaN#&Ngb7u>TS|c3~s0S6KQD{Hlx2oV6!feW)0` zjUGHqxmphD`0hY#dQYR$HW$Yo~f{g=Mfz#!-p2V7Q4{u`_(w7xLnW7tRLhSBSfSSi9c(cCw`{hiw1(_ z-ISnA*KVc-lXy1WoRcuE>`aSVzI{_Nsc(T&isR>jo~56c-it-udol>X;T4c2t@;xYhhn=6QjqqU*fz$G|qmK~P(( zha?ye?(%ZZ!Ro)m{RRPQ+^nvwtgom22aQegu8|07RE`M6*o88n6t8I&+*7%_BfgVl zpSr~JD*B|w_yLCJ!f9}a)db*Tz!q*7NsyKZn!S`s?DGXdvT-RBY=~Y}GDfMES@1tz z{9_AFtcj7)WR4mL`6~i}P(-%-6+g1^?|(9FzD$@AYn}91SIG46P^Ad)^Ft*>TdbV| zTj0x!uU`tl8daGu*BE650V=`<9A5%N|2fJu6Fm;`wh5=yhh$_vxNdL`1X0CouAA-`f3qauu?M1IDLBTUlV6`3W6o2S|q*F{};(kVO}f1;)q z2WYO>&@<%~H=gv&Gnhp#K@c-2Y#_gGuq{@C_U3cm3OkEsz7;T7Y3^5}Y zj#a?m!SV!m;y)sC0Hv_Lh4R=oIh9;8#0Pb4hhj&vOggnFDjK)V#K^%UqA$&gQdlvT zvCY*ntAT9zoex5 z_`mrGC~~i)M3!PPuxrvvkt1ZfCs=mCS&^I7as$0pd;WYPG89rg z{>6Yw2dW7rU;ZwOcRTo2Pscx#tcBK6B2|cN2}MI6W#i2;g}o?UMH8`v5@Q3$@T>Ff zefTC-!DI&&f)SKKB|{IoZ>AmL$&RenfFS>!M z?#+ME9|YST6;72dPWwWD|0x))DqjVS$@}JMIeLFL+Eonc_qer`8Nivtg}m_;DWwaA zc_%}Rm~D;&4`OHP)R~7TX8zvlC^MUf_~T0!T{+feb{(4GCcrjR*Q@^=%W8nvcdx&7 za<{j@w+>e6k|TUz+(T2|>&O;emR)=ZE(Y-Jef(cKUgjM2#F2AGREMU`KQ<{_#lYlsRy$k7o{l`64wH zJMp#CuX_@C)Dcc}24kw~=aBZbJb5BB#RRVIpQk|>I4F#=lo#v&G|z!VYD%7#iwS8B zu-wtI6rCjzJc_W z1oot#0sFe%FiA$_j(yZ~DJA4Wc#HR_C)5y>G(6u7lDz5~7!W3zt*xz~pr>5aA;HXd zyY`lwv_JZO=??`8o6D}JvNLBv6G4)R3$J;RO&#gaRs@+4}qUu|~nZI#6X>w{3g4ro5&O)S*f$eR~e%kOBpA z!M)2T9-KVq?&X_4DV|%gUp9<6QI)%F-|Vb=dNkotSVv|=)FCKcT5W2KF`AIJaYJsfTUb%H#YnTfon)s~j|OV^MS zq;O)iO3_P2p2odtp27()iqTgBk?cx`OYJX%kf*l1wFhmhy~Zl-2RKWAV&xSmlxogv zP&~UXWbgBRF_$X320>A?3`I99I>=CzFur_?sl3j7#Dy*79>#)@MgWqZpIE`+<&rM2=FuqNt!biUCn)4!n6xQ z(V+S=*yrNR{WsC0^cKSpWNWj!vAFBZNIQIou5;72ZM)F>hZ0$ zK**kl{NB5{%&!^b-j>( z#b3S~i=N5KQuQX2vn@XU0tIq%DUhn!3Ysl{Z3eCAn(bsV+3Me|dYHYyO0f)n{0mHa zt`1tTjZB{C0aE=Z7w^-Mj;sbMK=F6tFC%ZTmm1jw^h>SFUE$!MxshTO$(#;goU(x_ zV{&!JFL+8h3ojbdS+k}xsj{MCGFo@rMv12%8v!LaK|UT&u;bCJvy}fmMa0U z;>h!2#V>sx)(2(T8@K~@YPH`oy0D|$i;HYsu!xO!0%Yu>?(;!GhVr?x zF?jQJv>aw%5~%$VoN$LR@T`Ye?jWQi+be%ryU^R zkR3PU95tZ9xze-j!c#^yLSX1$RWZ7&D<0(h@hZV~M|VYWpjn0z%7s5yeXW!Lr^#`s5qoMqbf8a_|@ zgzeMxB?jRb17vQyZW>ZUFn5|BsUM{pfC|O}0(DjQeWk|e$qSLg%PtRX1f4W~Cwk3T zrPqn_mwlKn0`~MS4k3PlFEu24rdc@d*WBw=$OH)844Fj>8c!i51h7F4hS$Ch!i9PU z2KL_&h#%ii-#)Ji=nNTL8r3qnoL5pVQk;{WO%~l~PRa9}SC|SZmasUb;RVkMRj?Zn z(}JJk+wpKgjnMgk(GN?82CJyPBv4xsOA$(nHvV86y&&DOqoH*4yJd-c)}qBn^jnUI zm@f)X_qAq=2kYtUk0-oknY}ETwjOi%hST-9@8b|r zjZDDaJuuKca9Wf3-UML98*H_Xll=U%1HRhNTXFVSvnRJnVNiC!pwmKA1NP}T-FY#b zj3({)`F+mZnHT#xn;u}6EuWXhLd;6xe;NhY+MLh_7#tLf5#EFh=3nA{W=^~VGYh=1 z{L~+GzO3*eLXwW7N&W>VXt@Noj{3?^&FeO|B!B1W3XL3>a%zQ%nj9q|Qvuh!&bB2v zjjOCqX=q&dxroYZj$EI+7*byuoNi#>lAO<#Rxs}U#Gk|KRYw*>k?*K-g2u35`r4Ab zRN02=D{rK`39U{_syJ;a^gRv7kcu=?vm^B^_1aD_gTf%>cw3Yv^?q#I)wCnc92yx zI}IH=75iz+jP>w1)#P}G!(Xpdhs19ZFie?(&#)kfW5&@H29zl{L#C~~lcP_>tI>U^ z-{PwuVG1$r=##8ntQ$HHAnXW^!xbpcwrZ6yYA5%VN z3kq5D_Si-hP6Q0k9>(}%sszLS7z2L1Q|$rH5*U6Vg`3r~pn!eBSb732K#V3Gr|sDJ z>7rpZ2nT@xed)Qai}s3<XzT^cYDFt{xYBq3`#J%V5U;B0#o-~5}E_i)l z_j$}dh2jaMbrfn$UMnp!^MD1qQGiI&6(z zihPD9hAq2oNmeJMsYMQf%5xMt8(xHoHLM%eVkX9{lO25*Cg>x5Q5(a+(G6Q#k|#kt zV&?^>b=@din`Gh?hdB5GyE6dSqnsI}>YE=TVy*IrH2`-c0mN{7S{CA)D@cAWP4-D? zDINjC8XRapM-!e5={a~e(l{G;QW*7?EYnAcd3E6`2--HFLegQ7wK&tXZuC9>>Q2?R z18lCOlA;n(Yqd|qs<|O59nxi15lMNXUp8{`B!UZMflR)xP#xHCht$;VET^QXN}Qkg z+vUMoLl3J(2BOgWmf(+ALwR+XiBDid{j-R{@7CGmMz!Lf@;!46Dx0sh4^M1@H zPpj!uG@}@NJTtpc4zAT_CC&vwVYl>@zMPc=;j)KxLZ&7+&`XY;P&UTud&S7J@2Owe zbPx8{Wv(@37SAOBs2EYI+kIvFtfWl%#*w zkT(Xlc+@=Jx~)4*4-7?-i2iMd``-c2G~UQjXt#b7H(a?4mxH*O0|(0@0u4(9Cw2IE z?i6H{I`AJBfOi_e00_|p4Ldki7xEoXSUHruFo@huK2E+vbh zu-^V3csMoKD8o#k@hO zNQw8}>_s7o46c zSJm~}F`c2_-h*zkP8^(!gY#S$mQvFFht~4!+_bG`B9P|T?OXLmGv!KuOOr3b4@w+6 zJG8YSb*}_vdj%xd~3f?dc7MaOL%~-{hVYz#*L|>PbQKBbFL)617{LTbfQ0KBfYGBJX_6%Bj zmV~?Qyn{A_VY-yIPk2(rykKl_(JVP;7f$Za?)f|I3^FViNnO^fOYay0P+B_8#PO~T zbMfbG^z=u~_+y)5o`@Yis5+-8+zpuI6NBo7))MbTyoTW@^RC(HtqlBqNSpVYgYx4^ zzokTwff(U>?A`UO0RcQcDE3V3z%08>Y_CYR_@Uor3+g^g_d7=t(ZOP_-ynF|NTo-T z^t=Er*~!0W@e#9|_Z0ueG$7xKv)-o+zAKv$Je#R&D@+t)PtiNfQI;M--~2N-)MnGQ zNEAC)Ix#H}nun@^U3=gmvZ)1}(S#!gR@cA&{U6N>y%zrd*UkTgetCaption(); } - if (!_animated && (dimensions.isEmpty() || doc) || image->isNull()) { + if ((!_animated && (dimensions.isEmpty() || doc)) || image->isNull()) { _animated = false; if (image->isNull()) { _thumbw = 0; diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index fca26a14b1..f7bf3298f7 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -651,7 +651,7 @@ void DialogsInner::onContextProfile() { void DialogsInner::onContextToggleNotifications() { if (!_menuPeer) return; - App::main()->updateNotifySetting(_menuPeer, menuPeerMuted()); + App::main()->updateNotifySetting(_menuPeer, menuPeerMuted() ? NotifySettingSetNotify : NotifySettingSetMuted); } void DialogsInner::onContextSearch() { diff --git a/Telegram/SourceFiles/fileuploader.cpp b/Telegram/SourceFiles/fileuploader.cpp index c93f8dbb6a..1bb0eb42e2 100644 --- a/Telegram/SourceFiles/fileuploader.cpp +++ b/Telegram/SourceFiles/fileuploader.cpp @@ -140,17 +140,18 @@ void FileUploader::sendNext() { if (parts.isEmpty()) { if (i->docSentParts >= i->docPartsCount) { if (requestsSent.isEmpty() && docRequestsSent.isEmpty()) { + bool silent = i->file && i->file->to.silent; if (i->type() == PreparePhoto) { - emit photoReady(uploading, MTP_inputFile(MTP_long(i->id()), MTP_int(i->partsCount), MTP_string(i->filename()), MTP_string(i->file ? i->file->filemd5 : i->media.jpeg_md5))); + emit photoReady(uploading, silent, MTP_inputFile(MTP_long(i->id()), MTP_int(i->partsCount), MTP_string(i->filename()), MTP_string(i->file ? i->file->filemd5 : i->media.jpeg_md5))); } else if (i->type() == PrepareDocument || i->type() == PrepareAudio) { QByteArray docMd5(32, Qt::Uninitialized); hashMd5Hex(i->md5Hash.result(), docMd5.data()); MTPInputFile doc = (i->docSize > UseBigFilesFrom) ? MTP_inputFileBig(MTP_long(i->id()), MTP_int(i->docPartsCount), MTP_string(i->filename())) : MTP_inputFile(MTP_long(i->id()), MTP_int(i->docPartsCount), MTP_string(i->filename()), MTP_string(docMd5)); if (i->partsCount) { - emit thumbDocumentReady(uploading, doc, MTP_inputFile(MTP_long(i->thumbId()), MTP_int(i->partsCount), MTP_string(i->file ? i->file->thumbname : (qsl("thumb.") + i->media.thumbExt)), MTP_string(i->file ? i->file->thumbmd5 : i->media.jpeg_md5))); + emit thumbDocumentReady(uploading, silent, doc, MTP_inputFile(MTP_long(i->thumbId()), MTP_int(i->partsCount), MTP_string(i->file ? i->file->thumbname : (qsl("thumb.") + i->media.thumbExt)), MTP_string(i->file ? i->file->thumbmd5 : i->media.jpeg_md5))); } else { - emit documentReady(uploading, doc); + emit documentReady(uploading, silent, doc); } } queue.remove(uploading); diff --git a/Telegram/SourceFiles/fileuploader.h b/Telegram/SourceFiles/fileuploader.h index 8e038fd9d1..5ae1c6dbcd 100644 --- a/Telegram/SourceFiles/fileuploader.h +++ b/Telegram/SourceFiles/fileuploader.h @@ -48,9 +48,9 @@ public slots: signals: - void photoReady(const FullMsgId &msgId, const MTPInputFile &file); - void documentReady(const FullMsgId &msgId, const MTPInputFile &file); - void thumbDocumentReady(const FullMsgId &msgId, const MTPInputFile &file, const MTPInputFile &thumb); + void photoReady(const FullMsgId &msgId, bool silent, const MTPInputFile &file); + void documentReady(const FullMsgId &msgId, bool silent, const MTPInputFile &file); + void thumbDocumentReady(const FullMsgId &msgId, bool silent, const MTPInputFile &file, const MTPInputFile &thumb); void photoProgress(const FullMsgId &msgId); void documentProgress(const FullMsgId &msgId); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 98fa3b9f4d..6c348beec7 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6064,9 +6064,17 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { text = App::peerName(_authorOriginal); } if (via) { - text = lng_forwarded_via(lt_original, textcmdLink(1, text), lt_inline_bot, textcmdLink(2, '@' + via->_bot->username)); + if (_authorOriginal->isChannel()) { + text = lng_forwarded_channel_via(lt_channel, textcmdLink(1, text), lt_inline_bot, textcmdLink(2, '@' + via->_bot->username)); + } else { + text = lng_forwarded_via(lt_user, textcmdLink(1, text), lt_inline_bot, textcmdLink(2, '@' + via->_bot->username)); + } } else { - text = lng_forwarded(lt_original, textcmdLink(1, text)); + if (_authorOriginal->isChannel()) { + text = lng_forwarded_channel(lt_channel, textcmdLink(1, text)); + } else { + text = lng_forwarded(lt_user, textcmdLink(1, text)); + } } TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto }; textstyleSet(&st::inFwdTextStyle); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index b21d9f3cd5..5b3dfc9cf3 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2607,6 +2607,40 @@ void CollapseButton::paintEvent(QPaintEvent *e) { FlatButton::paintEvent(e); } +SilentToggle::SilentToggle(QWidget *parent) : FlatCheckbox(parent, QString(), false, st::silentToggle) { + setMouseTracking(true); +} + +void SilentToggle::mouseMoveEvent(QMouseEvent *e) { + FlatCheckbox::mouseMoveEvent(e); + if (rect().contains(e->pos())) { + PopupTooltip::Show(1000, this); + } else { + PopupTooltip::Hide(); + } +} + +void SilentToggle::leaveEvent(QEvent *e) { + PopupTooltip::Hide(); +} + +void SilentToggle::mouseReleaseEvent(QMouseEvent *e) { + FlatCheckbox::mouseReleaseEvent(e); + PopupTooltip::Show(0, this); + PeerData *p = App::main() ? App::main()->peer() : Nil; + if (p && p->isChannel() && p->notify != UnknownNotifySettings) { + App::main()->updateNotifySetting(p, NotifySettingDontChange, checked() ? SilentNotifiesSetSilent : SilentNotifiesSetNotify); + } +} + +QString SilentToggle::tooltipText() const { + return lang(checked() ? lng_wont_be_notified : lng_will_be_notified); +} + +QPoint SilentToggle::tooltipPos() const { + return QCursor::pos(); +} + HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _replyToId(0) , _replyToNameVersion(0) @@ -2659,6 +2693,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _kbHide(this, st::btnBotKbHide) , _cmdStart(this, st::btnBotCmdStart) , _broadcast(this, QString(), true, st::broadcastToggle) +, _silent(this) , _cmdStartShown(false) , _field(this, st::taMsgField, lang(lng_message_ph)) , _a_record(animation(this, &HistoryWidget::step_record)) @@ -2667,8 +2702,11 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _inRecord(false) , _inField(false) , _inReplyEdit(false) -, a_recordingLevel(0, 0), _recordingSamples(0) -, a_recordOver(0, 0), a_recordDown(0, 0), a_recordCancel(st::recordCancel->c, st::recordCancel->c) +, a_recordingLevel(0, 0) +, _recordingSamples(0) +, a_recordOver(0, 0) +, a_recordDown(0, 0) +, a_recordCancel(st::recordCancel->c, st::recordCancel->c) , _recordCancelWidth(st::recordFont->width(lang(lng_record_cancel))) , _kbShown(false) , _kbReplyTo(0) @@ -2708,7 +2746,8 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) connect(&_botStart, SIGNAL(clicked()), this, SLOT(onBotStart())); connect(&_joinChannel, SIGNAL(clicked()), this, SLOT(onJoinChannel())); connect(&_muteUnmute, SIGNAL(clicked()), this, SLOT(onMuteUnmute())); - connect(&_broadcast, SIGNAL(changed()), this, SLOT(onBroadcastChange())); + connect(&_broadcast, SIGNAL(changed()), this, SLOT(onBroadcastSilentChange())); + connect(&_silent, SIGNAL(clicked()), this, SLOT(onBroadcastSilentChange())); connect(&_attachDocument, SIGNAL(clicked()), this, SLOT(onDocumentSelect())); connect(&_attachPhoto, SIGNAL(clicked()), this, SLOT(onPhotoSelect())); connect(&_field, SIGNAL(submitted(bool)), this, SLOT(onSend(bool))); @@ -2793,6 +2832,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) _kbShow.hide(); _kbHide.hide(); _broadcast.hide(); + _silent.hide(); _cmdStart.hide(); _attachDocument.installEventFilter(&_attachType); @@ -3119,7 +3159,7 @@ void HistoryWidget::onRecordDone(QByteArray result, VoiceWaveform waveform, qint App::wnd()->activateWindow(); int32 duration = samples / AudioVoiceMsgFrequency; - _fileLoader.addTask(new FileLoadTask(result, duration, waveform, FileLoadTo(_peer->id, _broadcast.checked(), replyToId()))); + _fileLoader.addTask(new FileLoadTask(result, duration, waveform, FileLoadTo(_peer->id, _broadcast.checked(), _silent.checked(), replyToId()))); cancelReply(lastForceReplyReplied()); } @@ -3604,7 +3644,12 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _history = App::history(_peer->id); _migrated = _peer->migrateFrom() ? App::history(_peer->migrateFrom()->id) : 0; - if (_channel) updateNotifySettings(); + if (_channel) { + updateNotifySettings(); + if (_peer->notify == UnknownNotifySettings) { + App::wnd()->getNotifySetting(MTP_inputNotifyPeer(_peer->input)); + } + } if (_showAtMsgId == ShowAtUnreadMsgId) { if (_history->lastWidth) { @@ -3702,6 +3747,12 @@ void HistoryWidget::updateNotifySettings() { if (!_peer || !_peer->isChannel()) return; _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)); + if (_silent.isHidden() && hasSilentToggle()) { + updateControlsVisibility(); + } + } } bool HistoryWidget::contentOverlapped(const QRect &globalRect) { @@ -3822,6 +3873,7 @@ void HistoryWidget::updateControlsVisibility() { _attachPhoto.hide(); _attachEmoji.hide(); _broadcast.hide(); + _silent.hide(); _toHistoryEnd.hide(); _collapseComments.hide(); _kbShow.hide(); @@ -3873,6 +3925,7 @@ void HistoryWidget::updateControlsVisibility() { _attachDocument.hide(); _attachPhoto.hide(); _broadcast.hide(); + _silent.hide(); _kbScroll.hide(); _fieldBarCancel.hide(); _attachDocument.hide(); @@ -3910,6 +3963,7 @@ void HistoryWidget::updateControlsVisibility() { _attachDocument.hide(); _attachPhoto.hide(); _broadcast.hide(); + _silent.hide(); _kbScroll.hide(); _fieldBarCancel.hide(); } else { @@ -3935,6 +3989,7 @@ void HistoryWidget::updateControlsVisibility() { _attachDocument.hide(); _attachPhoto.hide(); _broadcast.hide(); + _silent.hide(); if (_kbShown) { _kbScroll.show(); } else { @@ -3982,6 +4037,11 @@ void HistoryWidget::updateControlsVisibility() { } else { _broadcast.hide(); } + if (hasSilentToggle()) { + _silent.show(); + } else { + _silent.hide(); + } updateFieldPlaceholder(); } if (_editMsgId || _replyToId || readyToForward() || (_previewData && _previewData->pendingTill >= 0) || _kbReplyTo) { @@ -4004,6 +4064,7 @@ void HistoryWidget::updateControlsVisibility() { _attachDocument.hide(); _attachPhoto.hide(); _broadcast.hide(); + _silent.hide(); _kbScroll.hide(); _fieldBarCancel.hide(); _attachDocument.hide(); @@ -4576,7 +4637,7 @@ void HistoryWidget::onSend(bool ctrlShiftEnter, MsgId replyTo) { WebPageId webPageId = _previewCancelled ? CancelledWebPageId : ((_previewData && _previewData->pendingTill >= 0) ? _previewData->id : 0); - App::main()->sendMessage(_history, _field.getLastText(), replyTo, _broadcast.checked(), webPageId); + App::main()->sendMessage(_history, _field.getLastText(), replyTo, _broadcast.checked(), _silent.checked(), webPageId); setFieldText(QString()); _saveDraftText = true; @@ -4677,10 +4738,10 @@ bool HistoryWidget::joinFail(const RPCError &error, mtpRequestId req) { } void HistoryWidget::onMuteUnmute() { - App::main()->updateNotifySetting(_peer, _history->mute); + App::main()->updateNotifySetting(_peer, _history->mute ? NotifySettingSetNotify : NotifySettingSetMuted); } -void HistoryWidget::onBroadcastChange() { +void HistoryWidget::onBroadcastSilentChange() { updateFieldPlaceholder(); } @@ -4715,6 +4776,7 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const 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; @@ -4723,12 +4785,15 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const if (showFromName) { flags |= MTPDmessage::flag_from_id; } + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_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); App::historyRegRandom(randomId, newId); - App::main()->finishForwarding(h, _broadcast.checked()); + App::main()->finishForwarding(h, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); } @@ -4792,6 +4857,7 @@ void HistoryWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTo _attachEmoji.hide(); _attachMention.hide(); _broadcast.hide(); + _silent.hide(); _kbShow.hide(); _kbHide.hide(); _cmdStart.hide(); @@ -5062,7 +5128,7 @@ void HistoryWidget::sendBotCommand(const QString &cmd, MsgId replyTo) { // reply toSend += '@' + username; } - App::main()->sendMessage(_history, toSend, replyTo ? ((!_peer->isUser()/* && (botStatus == 0 || botStatus == 2)*/) ? replyTo : -1) : 0, false); + App::main()->sendMessage(_history, toSend, replyTo ? ((!_peer->isUser()/* && (botStatus == 0 || botStatus == 2)*/) ? replyTo : -1) : 0, false, false); if (replyTo) { cancelReply(); if (_keyboard.singleUse() && _keyboard.hasMarkup() && lastKeyboardUsed) { @@ -5211,6 +5277,10 @@ bool HistoryWidget::hasBroadcastToggle() const { return _peer && _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && !_peer->asChannel()->isBroadcast(); } +bool HistoryWidget::hasSilentToggle() const { + return _peer && _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && _peer->notify != UnknownNotifySettings; +} + void HistoryWidget::inlineBotResolveDone(const MTPcontacts_ResolvedPeer &result) { _inlineBotResolveRequestId = 0; // Notify::inlineBotRequesting(false); @@ -5569,6 +5639,7 @@ void HistoryWidget::onFieldResize() { _kbShow.move(_attachEmoji.x() - _kbShow.width(), height() - kbh - _kbShow.height()); _kbHide.move(_attachEmoji.x(), _attachEmoji.y()); _cmdStart.move(_attachEmoji.x() - _cmdStart.width(), height() - kbh - _cmdStart.height()); + _silent.move(_attachEmoji.x() - _silent.width(), height() - kbh - _silent.height()); _attachType.move(0, _attachDocument.y() - _attachType.height()); _emojiPan.moveBottom(_attachEmoji.y()); @@ -5602,9 +5673,9 @@ void HistoryWidget::updateFieldPlaceholder() { if (_inlineBot && _inlineBot != InlineBotLookingUpData) { _field.setPlaceholder(_inlineBot->botInfo->inlinePlaceholder.mid(1), _inlineBot->username.size() + 2); } else if (hasBroadcastToggle()) { - _field.setPlaceholder(lang(_broadcast.checked() ? lng_broadcast_ph : lng_comment_ph)); + _field.setPlaceholder(lang(_broadcast.checked() ? (_silent.checked() ? lng_broadcast_silent_ph : lng_broadcast_ph) : lng_comment_ph)); } else { - _field.setPlaceholder(lang((_history && _history->isChannel() && !_history->isMegagroup()) ? (_peer->asChannel()->canPublish() ? lng_broadcast_ph : lng_comment_ph) : lng_message_ph)); + _field.setPlaceholder(lang((_history && _history->isChannel() && !_history->isMegagroup()) ? (_peer->asChannel()->canPublish() ? (_silent.checked() ? lng_broadcast_silent_ph : lng_broadcast_ph) : lng_comment_ph) : lng_message_ph)); } _send.setText(lang(lng_send_button)); } @@ -5614,7 +5685,7 @@ void HistoryWidget::uploadImage(const QImage &img, PrepareMediaType type, FileLo if (!_history) return; App::wnd()->activateWindow(); - FileLoadTask *task = new FileLoadTask(img, type, FileLoadTo(_peer->id, _broadcast.checked(), replyToId()), confirm, source); + FileLoadTask *task = new FileLoadTask(img, type, FileLoadTo(_peer->id, _broadcast.checked(), _silent.checked(), replyToId()), confirm, source); if (withText) { _confirmWithTextId = task->fileid(); } @@ -5625,7 +5696,7 @@ void HistoryWidget::uploadFile(const QString &file, PrepareMediaType type, FileL if (!_history) return; App::wnd()->activateWindow(); - FileLoadTask *task = new FileLoadTask(file, type, FileLoadTo(_peer->id, _broadcast.checked(), replyToId()), confirm); + FileLoadTask *task = new FileLoadTask(file, type, FileLoadTo(_peer->id, _broadcast.checked(), _silent.checked(), replyToId()), confirm); if (withText) { _confirmWithTextId = task->fileid(); } @@ -5639,7 +5710,7 @@ void HistoryWidget::uploadFiles(const QStringList &files, PrepareMediaType type) App::wnd()->activateWindow(); - FileLoadTo to(_peer->id, _broadcast.checked(), replyToId()); + FileLoadTo to(_peer->id, _broadcast.checked(), _silent.checked(), replyToId()); TasksList tasks; tasks.reserve(files.size()); @@ -5655,7 +5726,7 @@ void HistoryWidget::uploadFileContent(const QByteArray &fileContent, PrepareMedi if (!_history) return; App::wnd()->activateWindow(); - _fileLoader.addTask(new FileLoadTask(fileContent, type, FileLoadTo(_peer->id, _broadcast.checked(), replyToId()))); + _fileLoader.addTask(new FileLoadTask(fileContent, type, FileLoadTo(_peer->id, _broadcast.checked(), _silent.checked(), replyToId()))); cancelReply(lastForceReplyReplied()); } @@ -5675,9 +5746,9 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif FullMsgId newId(peerToChannel(file->to.peer), clientMsgId()); - connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&, const MTPInputFile&)), this, SLOT(onPhotoUploaded(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); - connect(App::uploader(), SIGNAL(documentReady(const FullMsgId&, const MTPInputFile&)), this, SLOT(onDocumentUploaded(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); - connect(App::uploader(), SIGNAL(thumbDocumentReady(const FullMsgId&, const MTPInputFile&, const MTPInputFile&)), this, SLOT(onThumbDocumentUploaded(const FullMsgId&, const MTPInputFile&, const MTPInputFile&)), Qt::UniqueConnection); + connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&,bool,const MTPInputFile&)), this, SLOT(onPhotoUploaded(const FullMsgId&,bool,const MTPInputFile&)), Qt::UniqueConnection); + connect(App::uploader(), SIGNAL(documentReady(const FullMsgId&,bool,const MTPInputFile&)), this, SLOT(onDocumentUploaded(const FullMsgId&,bool,const MTPInputFile&)), Qt::UniqueConnection); + connect(App::uploader(), SIGNAL(thumbDocumentReady(const FullMsgId&,bool,const MTPInputFile&,const MTPInputFile&)), this, SLOT(onThumbDocumentUploaded(const FullMsgId&,bool,const MTPInputFile&, const MTPInputFile&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(photoProgress(const FullMsgId&)), this, SLOT(onPhotoProgress(const FullMsgId&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(documentProgress(const FullMsgId&)), this, SLOT(onDocumentProgress(const FullMsgId&)), Qt::UniqueConnection); connect(App::uploader(), SIGNAL(photoFailed(const FullMsgId&)), this, SLOT(onPhotoFailed(const FullMsgId&)), Qt::UniqueConnection); @@ -5693,6 +5764,7 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif if (file->to.replyTo) flags |= MTPDmessage::flag_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; @@ -5700,6 +5772,9 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif if (showFromName) { flags |= MTPDmessage::flag_from_id; } + if (silentPost) { + flags |= MTPDmessage::flag_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); } else if (file->type == PrepareDocument) { @@ -5746,7 +5821,7 @@ void HistoryWidget::cancelShareContact() { } } -void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, const MTPInputFile &file) { +void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, bool silent, const MTPInputFile &file) { if (!MTP::authedId()) return; HistoryItem *item = App::histItemById(newId); if (item) { @@ -5760,9 +5835,13 @@ void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, const MTPInputFile & } 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; } + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_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); } @@ -5792,7 +5871,7 @@ namespace { } } -void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, const MTPInputFile &file) { +void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, bool silent, const MTPInputFile &file) { if (!MTP::authedId()) return; HistoryMessage *item = dynamic_cast(App::histItemById(newId)); if (item) { @@ -5808,16 +5887,20 @@ void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, const MTPInputFil } 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; } + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_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); } } } -void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, const MTPInputFile &file, const MTPInputFile &thumb) { +void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, bool silent, const MTPInputFile &file, const MTPInputFile &thumb) { if (!MTP::authedId()) return; HistoryMessage *item = dynamic_cast(App::histItemById(newId)); if (item) { @@ -5833,9 +5916,13 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, const MTPInp } 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; } + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_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); } @@ -6047,7 +6134,7 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { updateListSize(App::main() ? App::main()->contentScrollAddToY() : 0); bool kbShowShown = _history && !_kbShown && _keyboard.hasMarkup(); - _field.resize(width() - _send.width() - _attachDocument.width() - _attachEmoji.width() - (kbShowShown ? _kbShow.width() : 0) - (_cmdStartShown ? _cmdStart.width() : 0) - (hasBroadcastToggle() ? _broadcast.width() : 0), _field.height()); + _field.resize(width() - _send.width() - _attachDocument.width() - _attachEmoji.width() - (kbShowShown ? _kbShow.width() : 0) - (_cmdStartShown ? _cmdStart.width() : 0) - (hasBroadcastToggle() ? _broadcast.width() : 0) - (hasSilentToggle() ? _silent.width() : 0), _field.height()); _toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip); updateCollapseCommentsVisibility(); @@ -6062,6 +6149,7 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { _kbShow.move(_attachEmoji.x() - _kbShow.width(), height() - kbh - _kbShow.height()); _kbHide.move(_attachEmoji.x(), _attachEmoji.y()); _cmdStart.move(_attachEmoji.x() - _cmdStart.width(), height() - kbh - _cmdStart.height()); + _silent.move(_attachEmoji.x() - _silent.width(), height() - kbh - _silent.height()); _attachType.move(0, _attachDocument.y() - _attachType.height()); _emojiPan.moveBottom(_attachEmoji.y()); @@ -6540,6 +6628,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { } 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; @@ -6548,6 +6637,9 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { if (showFromName) { flags |= MTPDmessage::flag_from_id; } + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_silent; + } if (bot) { flags |= MTPDmessage::flag_via_bot_id; } @@ -6615,7 +6707,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { _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); } _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); - App::main()->finishForwarding(_history, _broadcast.checked()); + App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); App::historyRegRandom(randomId, newId); @@ -6662,16 +6754,24 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti flags |= MTPDmessage::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); - if (fromChannelName) { + 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; - } else { + flags |= MTPDmessage::flag_views; + flags |= MTPDmessage::flag_post; + } + if (showFromName) { flags |= MTPDmessage::flag_from_id; } - _history->addNewDocument(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), doc, caption); + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_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); - App::main()->finishForwarding(_history, _broadcast.checked()); + App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); if (doc->sticker()) App::main()->incrementSticker(doc); @@ -6710,16 +6810,24 @@ void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption) flags |= MTPDmessage::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; } - bool fromChannelName = _peer->isChannel() && !_peer->isMegagroup() && _peer->asChannel()->canPublish() && (_peer->asChannel()->isBroadcast() || _broadcast.checked()); - if (fromChannelName) { + 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; - } else { + flags |= MTPDmessage::flag_views; + flags |= MTPDmessage::flag_post; + } + if (showFromName) { flags |= MTPDmessage::flag_from_id; } - _history->addNewPhoto(newId.msg, flags, 0, replyToId(), date(MTP_int(unixtime())), fromChannelName ? 0 : MTP::authedId(), photo, caption); + if (silentPost) { + sendFlags |= MTPmessages_SendMedia::flag_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); - App::main()->finishForwarding(_history, _broadcast.checked()); + App::main()->finishForwarding(_history, _broadcast.checked(), _silent.checked()); cancelReply(lastKeyboardUsed); App::historyRegRandom(randomId, newId); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 4c82a86312..aeb94c7afb 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -391,6 +391,20 @@ public: }; +class SilentToggle : public FlatCheckbox, public AbstractTooltipShower { +public: + + SilentToggle(QWidget *parent); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void leaveEvent(QEvent *e); + + // AbstractTooltipShower + virtual QString tooltipText() const; + virtual QPoint tooltipPos() const; + +}; + enum TextUpdateEventsFlags { TextUpdateEventsSaveDraft = 0x01, TextUpdateEventsSendTyping = 0x02, @@ -609,9 +623,9 @@ public slots: void peerUpdated(PeerData *data); void onFullPeerUpdated(PeerData *data); - void onPhotoUploaded(const FullMsgId &msgId, const MTPInputFile &file); - void onDocumentUploaded(const FullMsgId &msgId, const MTPInputFile &file); - void onThumbDocumentUploaded(const FullMsgId &msgId, const MTPInputFile &file, const MTPInputFile &thumb); + void onPhotoUploaded(const FullMsgId &msgId, bool silent, const MTPInputFile &file); + void onDocumentUploaded(const FullMsgId &msgId, bool silent, const MTPInputFile &file); + void onThumbDocumentUploaded(const FullMsgId &msgId, bool silent, const MTPInputFile &file, const MTPInputFile &thumb); void onPhotoProgress(const FullMsgId &msgId); void onDocumentProgress(const FullMsgId &msgId); @@ -633,7 +647,7 @@ public slots: void onBotStart(); void onJoinChannel(); void onMuteUnmute(); - void onBroadcastChange(); + void onBroadcastSilentChange(); void onPhotoSelect(); void onDocumentSelect(); @@ -770,6 +784,7 @@ private: bool readyToForward() const; bool hasBroadcastToggle() const; + bool hasSilentToggle() const; PeerData *_peer, *_clearPeer; // cache _peer in _clearPeer when showing clear history box ChannelId _channel; @@ -817,6 +832,7 @@ private: EmojiButton _attachEmoji; IconedButton _kbShow, _kbHide, _cmdStart; FlatCheckbox _broadcast; + SilentToggle _silent; bool _cmdStartShown; MessageField _field; Animation _a_record, _a_recording; diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 3e792b0145..fb5bbe3c1f 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -700,7 +700,11 @@ void LayoutOverviewVoice::getState(TextLinkPtr &link, HistoryCursorState &cursor void LayoutOverviewVoice::updateName() const { int32 version = 0; if (const HistoryMessageForwarded *fwd = _parent->Get()) { - _name.setText(st::semiboldFont, lng_forwarded(lt_original, App::peerName(_parent->fromOriginal())), _textNameOptions); + if (_parent->fromOriginal()->isChannel()) { + _name.setText(st::semiboldFont, lng_forwarded_channel(lt_channel, App::peerName(_parent->fromOriginal())), _textNameOptions); + } else { + _name.setText(st::semiboldFont, lng_forwarded(lt_user, App::peerName(_parent->fromOriginal())), _textNameOptions); + } } else { _name.setText(st::semiboldFont, App::peerName(_parent->from()), _textNameOptions); } diff --git a/Telegram/SourceFiles/localimageloader.h b/Telegram/SourceFiles/localimageloader.h index 51edd73104..6e6b5a0ee6 100644 --- a/Telegram/SourceFiles/localimageloader.h +++ b/Telegram/SourceFiles/localimageloader.h @@ -166,10 +166,14 @@ private: }; struct FileLoadTo { - FileLoadTo(const PeerId &peer, bool broadcast, MsgId replyTo) : peer(peer), broadcast(broadcast), replyTo(replyTo) { + FileLoadTo(const PeerId &peer, bool broadcast, bool silent, MsgId replyTo) + : peer(peer) + , broadcast(broadcast) + , silent(silent) + , replyTo(replyTo) { } PeerId peer; - bool broadcast; + bool broadcast, silent; MsgId replyTo; }; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 349568c2ba..9e35fe6e83 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -589,7 +589,7 @@ void MainWidget::cancelForwarding() { history.cancelForwarding(); } -void MainWidget::finishForwarding(History *hist, bool broadcast) { +void MainWidget::finishForwarding(History *hist, bool broadcast, bool silent) { if (!hist) return; if (!_toForward.isEmpty()) { @@ -600,6 +600,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast) { int32 sendFlags = 0, flags = 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; @@ -608,6 +609,9 @@ void MainWidget::finishForwarding(History *hist, bool broadcast) { if (showFromName) { flags |= MTPDmessage::flag_from_id; } + if (silentPost) { + sendFlags |= MTPmessages_ForwardMessages::flag_silent; + } QVector ids; QVector randomIds; @@ -1267,7 +1271,7 @@ DialogsIndexed &MainWidget::dialogsList() { return dialogs.dialogsList(); } -void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, bool broadcast, WebPageId webPageId) { +void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, bool broadcast, bool silent, WebPageId webPageId) { readServerHistory(hist, false); history.fastShowAtEnd(hist); @@ -1307,6 +1311,7 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, } 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; @@ -1315,6 +1320,9 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, if (showFromName) { flags |= MTPDmessage::flag_from_id; } + if (silentPost) { + sendFlags |= MTPmessages_SendMessage::flag_silent; + } MTPVector localEntities = linksToMTP(sendingEntities), sentEntities = linksToMTP(sendingEntities, true); if (!sentEntities.c_vector().v.isEmpty()) { sendFlags |= MTPmessages_SendMessage::flag_entities; @@ -1323,7 +1331,7 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, 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); } - finishForwarding(hist, broadcast); + finishForwarding(hist, broadcast, silent); } void MainWidget::saveRecentHashtags(const QString &text) { @@ -3719,28 +3727,37 @@ bool MainWidget::failNotifySetting(MTPInputNotifyPeer peer, const RPCError &erro return true; } -void MainWidget::updateNotifySetting(PeerData *peer, bool enabled) { +void MainWidget::updateNotifySetting(PeerData *peer, NotifySettingStatus notify, SilentNotifiesStatus silent) { + if (notify == NotifySettingDontChange && silent == SilentNotifiesDontChange) return; + updateNotifySettingPeers.insert(peer); int32 muteFor = 86400 * 365; if (peer->notify == EmptyNotifySettings) { - if (!enabled) { - peer->notify = new NotifySettings(); - peer->notify->sound = ""; - peer->notify->mute = unixtime() + muteFor; - } - } else { - if (peer->notify == UnknownNotifySettings) { + if (notify == NotifySettingSetMuted || silent == SilentNotifiesSetSilent) { peer->notify = new NotifySettings(); } - peer->notify->sound = enabled ? "default" : ""; - peer->notify->mute = enabled ? 0 : (unixtime() + muteFor); + } else if (peer->notify == UnknownNotifySettings) { + peer->notify = new NotifySettings(); } - if (!enabled) { - App::regMuted(peer, muteFor + 1); - } else { - App::unregMuted(peer); + if (peer->notify != EmptyNotifySettings && peer->notify != UnknownNotifySettings) { + if (notify != NotifySettingDontChange) { + peer->notify->sound = (notify == NotifySettingSetMuted) ? "" : "default"; + peer->notify->mute = (notify == NotifySettingSetMuted) ? (unixtime() + muteFor) : 0; + } + if (silent == SilentNotifiesSetSilent) { + peer->notify->flags |= MTPDpeerNotifySettings::flag_silent; + } else if (silent == SilentNotifiesSetNotify) { + peer->notify->flags &= ~MTPDpeerNotifySettings::flag_silent; + } + } + if (notify != NotifySettingDontChange) { + if (notify == NotifySettingSetMuted) { + App::regMuted(peer, muteFor + 1); + } else { + App::unregMuted(peer); + } + App::history(peer->id)->setMute(notify == NotifySettingSetMuted); } - App::history(peer->id)->setMute(!enabled); if (history.peer() == peer) history.updateNotifySettings(); updateNotifySettingTimer.start(NotifySettingSaveTimeout); } diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 075a37474d..ce45674f00 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -183,6 +183,17 @@ inline int chatsListWidth(int windowWidth) { return snap((windowWidth * 5) / 14, st::dlgMinWidth, st::dlgMaxWidth); } +enum SilentNotifiesStatus { + SilentNotifiesDontChange, + SilentNotifiesSetSilent, + SilentNotifiesSetNotify, +}; +enum NotifySettingStatus { + NotifySettingDontChange, + NotifySettingSetMuted, + NotifySettingSetNotify, +}; + class MainWidget : public TWidget, public RPCSender { Q_OBJECT @@ -220,7 +231,7 @@ public: void gotNotifySetting(MTPInputNotifyPeer peer, const MTPPeerNotifySettings &settings); bool failNotifySetting(MTPInputNotifyPeer peer, const RPCError &error); - void updateNotifySetting(PeerData *peer, bool enabled); + void updateNotifySetting(PeerData *peer, NotifySettingStatus notify, SilentNotifiesStatus silent = SilentNotifiesDontChange); void incrementSticker(DocumentData *sticker); @@ -320,7 +331,7 @@ public: DialogsIndexed &contactsList(); DialogsIndexed &dialogsList(); - void sendMessage(History *hist, const QString &text, MsgId replyTo, bool broadcast, WebPageId webPageId = 0); + void sendMessage(History *hist, const QString &text, MsgId replyTo, bool broadcast, bool silent, WebPageId webPageId = 0); void saveRecentHashtags(const QString &text); void readServerHistory(History *history, bool force = true); @@ -371,7 +382,7 @@ public: void fillForwardingInfo(Text *&from, Text *&text, bool &serviceColor, ImagePtr &preview); void updateForwardingTexts(); void cancelForwarding(); - void finishForwarding(History *hist, bool broadcast); // send them + void finishForwarding(History *hist, bool broadcast, bool silent); // send them void mediaMarkRead(DocumentData *data); void mediaMarkRead(const HistoryItemsMap &items); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 19f23036c7..72e7bf5155 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -245,7 +245,7 @@ void ProfileInner::onSearchInPeer() { } void ProfileInner::onEnableNotifications() { - App::main()->updateNotifySetting(_peer, _enableNotifications.checked()); + App::main()->updateNotifySetting(_peer, _enableNotifications.checked() ? NotifySettingSetNotify : NotifySettingSetMuted); } void ProfileInner::saveError(const QString &str) { From 37309a91ac36f5a4c745c2d17874a30c303bb9bf Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 20:23:42 +0300 Subject: [PATCH 123/316] fixed media_only dcs, added copy post link to clipboard, fixed signature display in gifs, 0.9.27 dev version --- Telegram/Resources/lang.strings | 8 ----- Telegram/SourceFiles/config.h | 8 ++--- Telegram/SourceFiles/history.cpp | 4 +-- Telegram/SourceFiles/history.h | 6 ++++ Telegram/SourceFiles/historywidget.cpp | 34 +++++++----------- Telegram/SourceFiles/historywidget.h | 3 +- Telegram/SourceFiles/mainwidget.cpp | 36 ++++++++++--------- .../SourceFiles/mtproto/mtpConnection.cpp | 11 +++++- Telegram/SourceFiles/overviewwidget.cpp | 23 ------------ Telegram/SourceFiles/overviewwidget.h | 2 -- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++--- Telegram/Telegram.xcodeproj/project.pbxproj | 12 +++---- Telegram/Version | 10 +++--- 14 files changed, 71 insertions(+), 96 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 96f55498e7..387bdd0d77 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "View group info"; "lng_context_view_channel" = "View channel info"; -"lng_context_open_link" = "Open Link"; "lng_context_copy_link" = "Copy Link"; "lng_context_copy_post_link" = "Copy Post Link"; -"lng_context_open_email" = "Write to this address"; "lng_context_copy_email" = "Copy email address"; -"lng_context_open_hashtag" = "Search by hashtag"; "lng_context_copy_hashtag" = "Copy hashtag"; -"lng_context_open_mention" = "Open profile"; "lng_context_copy_mention" = "Copy username"; -"lng_context_open_image" = "Open Image"; "lng_context_save_image" = "Save Image As.."; "lng_context_forward_image" = "Forward Image"; "lng_context_delete_image" = "Delete Image"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancel Download"; "lng_context_show_in_folder" = "Show in Folder"; "lng_context_show_in_finder" = "Show in Finder"; -"lng_context_open_video" = "Open Video"; "lng_context_save_video" = "Save Video As.."; -"lng_context_open_audio" = "Open Audio"; "lng_context_save_audio" = "Save Audio As.."; "lng_context_pack_info" = "Pack Info"; "lng_context_pack_add" = "Add Stickers"; -"lng_context_open_file" = "Open File"; "lng_context_save_file" = "Save File As.."; "lng_context_forward_file" = "Forward File"; "lng_context_delete_file" = "Delete File"; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 42473d4699..7f9df339f7 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,10 +20,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9026; -static const wchar_t *AppVersionStr = L"0.9.26"; -static const bool DevVersion = false; -#define BETA_VERSION (9026001ULL) // just comment this line to build public version +static const int32 AppVersion = 9027; +static const wchar_t *AppVersionStr = L"0.9.27"; +static const bool DevVersion = true; +//#define BETA_VERSION (9026001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 6c348beec7..3dd6a40d1e 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4455,8 +4455,8 @@ void HistoryGif::initDimensions(const HistoryItem *parent) { _thumbh = th; _maxw = qMax(tw, int32(st::minPhotoSize)); _minh = qMax(th, int32(st::minPhotoSize)); + _maxw = qMax(_maxw, parent->infoWidth() + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); if (!gif() || !_gif->ready()) { - _maxw = qMax(_maxw, parent->infoWidth() + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); _maxw = qMax(_maxw, gifMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); } if (bubble) { @@ -4506,12 +4506,12 @@ int32 HistoryGif::resize(int32 width, const HistoryItem *parent) { _width = qMax(tw, int32(st::minPhotoSize)); _height = qMax(th, int32(st::minPhotoSize)); + _width = qMax(_width, parent->infoWidth() + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); if (gif() && _gif->ready()) { if (!_gif->started()) { _gif->start(_thumbw, _thumbh, _width, _height, true); } } else { - _width = qMax(_width, parent->infoWidth() + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); _width = qMax(_width, gifMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); } if (bubble) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 6bf69c08f5..8d80eb393a 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1032,6 +1032,12 @@ public: } bool canEdit(const QDateTime &cur) const; + bool hasDirectLink() const { + return id > 0 && _history->peer->isChannel() && _history->peer->asChannel()->isPublic(); + } + QString directLink() const { + return hasDirectLink() ? qsl("https://telegram.me/") + _history->peer->asChannel()->username + '/' + QString::number(id) : QString(); + } int32 y; MsgId id; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 5b3dfc9cf3..6bdc9c72a1 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -879,7 +879,6 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } } if (lnkPhoto) { - _menu->addAction(lang(lng_context_open_image), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_save_image), this, SLOT(saveContextImage()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_image), this, SLOT(copyContextImage()))->setEnabled(true); } else { @@ -892,10 +891,12 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkDocument && !lnkDocument->document()->already(true).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkIsVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); } } + if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) { + _menu->addAction(lang(lng_context_copy_post_link), _widget, SLOT(onCopyPostLink())); + } if (isUponSelected > 1) { _menu->addAction(lang(lng_context_forward_selected), _widget, SLOT(onForwardSelected())); if (selectedForDelete == selectedForForward) { @@ -980,19 +981,18 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { QLatin1String linktype = _contextMenuLnk ? _contextMenuLnk->type() : qstr(""); if (linktype == qstr("TextLink") || linktype == qstr("LocationLink")) { - _menu->addAction(lang(lng_context_open_link), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_link), this, SLOT(copyContextUrl()))->setEnabled(true); } else if (linktype == qstr("EmailLink")) { - _menu->addAction(lang(lng_context_open_email), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_email), this, SLOT(copyContextUrl()))->setEnabled(true); } else if (linktype == qstr("MentionLink")) { - _menu->addAction(lang(lng_context_open_mention), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_mention), this, SLOT(copyContextUrl()))->setEnabled(true); } else if (linktype == qstr("HashtagLink")) { - _menu->addAction(lang(lng_context_open_hashtag), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_hashtag), this, SLOT(copyContextUrl()))->setEnabled(true); } else { } + if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) { + _menu->addAction(lang(lng_context_copy_post_link), _widget, SLOT(onCopyPostLink())); + } if (isUponSelected > 1) { _menu->addAction(lang(lng_context_forward_selected), _widget, SLOT(onForwardSelected())); if (selectedForDelete == selectedForForward) { @@ -1044,13 +1044,6 @@ void HistoryInner::copySelectedText() { } } -void HistoryInner::openContextUrl() { - HistoryItem *was = App::hoveredLinkItem(); - App::hoveredLinkItem(App::contextItem()); - _contextMenuLnk->onClick(Qt::LeftButton); - App::hoveredLinkItem(was); -} - void HistoryInner::copyContextUrl() { QString enc = _contextMenuLnk->encoded(); if (!enc.isEmpty()) { @@ -1109,14 +1102,6 @@ void HistoryInner::showContextInFolder() { if (!already.isEmpty()) psShowInFolder(already); } -void HistoryInner::openContextFile() { - HistoryItem *was = App::hoveredLinkItem(); - App::hoveredLinkItem(App::contextItem()); - DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkDocument) DocumentOpenLink(lnkDocument->document()).onClick(Qt::LeftButton); - App::hoveredLinkItem(was); -} - void HistoryInner::saveContextFile() { if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { DocumentSaveLink::doSave(lnkDocument->document(), true); @@ -6952,6 +6937,13 @@ void HistoryWidget::onEditMessage() { } } +void HistoryWidget::onCopyPostLink() { + HistoryItem *to = App::contextItem(); + if (!to || !to->hasDirectLink()) return; + + QApplication::clipboard()->setText(to->directLink()); +} + bool HistoryWidget::lastForceReplyReplied(const FullMsgId &replyTo) const { if (replyTo.msg > 0 && replyTo.channel != _channel) return false; return _keyboard.forceReply() && _keyboard.forMsgId() == FullMsgId(_channel, _history->lastKeyboardId) && _keyboard.forMsgId().msg == (replyTo.msg < 0 ? replyToId() : replyTo.msg); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index aeb94c7afb..b263760363 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -108,13 +108,11 @@ public slots: void onUpdateSelected(); void onParentGeometryChanged(); - void openContextUrl(); void copyContextUrl(); void saveContextImage(); void copyContextImage(); void cancelContextDownload(); void showContextInFolder(); - void openContextFile(); void saveContextFile(); void saveContextGif(); void copyContextText(); @@ -610,6 +608,7 @@ public slots: void onCancel(); void onReplyToMessage(); void onEditMessage(); + void onCopyPostLink(); void onFieldBarCancel(); void onCancelSendAction(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 9e35fe6e83..6df869b326 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -3769,16 +3769,17 @@ void MainWidget::incrementSticker(DocumentData *sticker) { RecentStickerPack::iterator i = recent.begin(), e = recent.end(); for (; i != e; ++i) { if (i->first == sticker) { - ++i->second; - if (i->second > 0x8000) { - for (RecentStickerPack::iterator j = recent.begin(); j != e; ++j) { - if (j->second > 1) { - j->second /= 2; - } else { - j->second = 1; - } - } - } + i->second = recent.begin()->second; // throw to the first place + //++i->second; + //if (i->second > 0x8000) { + // for (RecentStickerPack::iterator j = recent.begin(); j != e; ++j) { + // if (j->second > 1) { + // j->second /= 2; + // } else { + // j->second = 1; + // } + // } + //} for (; i != recent.begin(); --i) { if ((i - 1)->second > i->second) { break; @@ -3790,13 +3791,14 @@ void MainWidget::incrementSticker(DocumentData *sticker) { } if (i == e) { while (recent.size() >= StickerPanPerRow * StickerPanRowsPerPage) recent.pop_back(); - recent.push_back(qMakePair(sticker, 1)); - for (i = recent.end() - 1; i != recent.begin(); --i) { - if ((i - 1)->second > i->second) { - break; - } - qSwap(*i, *(i - 1)); - } + recent.push_front(qMakePair(sticker, recent.isEmpty() ? 1 : recent.begin()->second)); + //recent.push_back(qMakePair(sticker, 1)); + //for (i = recent.end() - 1; i != recent.begin(); --i) { + // if ((i - 1)->second > i->second) { + // break; + // } + // qSwap(*i, *(i - 1)); + //} } Local::writeUserSettings(); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 3604baf574..3da8619852 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -1967,6 +1967,15 @@ void MTProtoConnectionPrivate::restartNow() { void MTProtoConnectionPrivate::socketStart(bool afterConfig) { bool isDldDc = (dc >= MTP::dldStart) && (dc < MTP::dldEnd); + if (isDldDc) { // using media_only addresses only if key for this dc is already created + QReadLocker lockFinished(&sessionDataMutex); + if (sessionData) { + if (!sessionData->getKey()) { + isDldDc = false; + } + } + + } int32 baseDc = (dc % _mtp_internal::dcShift); static const int IPv4address = 0, IPv6address = 1; @@ -2046,7 +2055,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { _pingSender.stop(); if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %1:%2 (http)..").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); - if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv4 connection to [%1]:%2 (tcp) and [%1]:%2 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%1]:%2 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); _waitForConnectedTimer.start(_waitForConnected); if (_conn4) { diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index c95cce077e..2430d02d5c 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1271,7 +1271,6 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu->addAction(lang(lng_context_to_msg), this, SLOT(goToMessage()))->setEnabled(true); } if (lnkPhoto) { - _menu->addAction(lang(lng_context_open_image), this, SLOT(openContextUrl()))->setEnabled(true); } else { if (lnkDocument && lnkDocument->document()->loading()) { _menu->addAction(lang(lng_context_cancel_download), this, SLOT(cancelContextDownload()))->setEnabled(true); @@ -1279,7 +1278,6 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkDocument && !lnkDocument->document()->already(true).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkIsVideo ? lng_context_open_video : (lnkIsAudio ? lng_context_open_audio : lng_context_open_file)), this, SLOT(openContextFile()))->setEnabled(true); _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); } } @@ -1309,16 +1307,12 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _menu = new PopupMenu(); QLatin1String linktype = _contextMenuLnk ? _contextMenuLnk->type() : qstr(""); if (linktype == qstr("TextLink") || linktype == qstr("LocationLink")) { - _menu->addAction(lang(lng_context_open_link), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_link), this, SLOT(copyContextUrl()))->setEnabled(true); } else if (linktype == qstr("EmailLink")) { - _menu->addAction(lang(lng_context_open_email), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_email), this, SLOT(copyContextUrl()))->setEnabled(true); } else if (linktype == qstr("MentionLink")) { - _menu->addAction(lang(lng_context_open_mention), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_mention), this, SLOT(copyContextUrl()))->setEnabled(true); } else if (linktype == qstr("HashtagLink")) { - _menu->addAction(lang(lng_context_open_hashtag), this, SLOT(openContextUrl()))->setEnabled(true); _menu->addAction(lang(lng_context_copy_hashtag), this, SLOT(copyContextUrl()))->setEnabled(true); } else { } @@ -1447,15 +1441,6 @@ void OverviewInner::setSelectMode(bool enabled) { _selMode = enabled; } -void OverviewInner::openContextUrl() { - if (_contextMenuLnk) { - HistoryItem *was = App::hoveredLinkItem(); - App::hoveredLinkItem(App::contextItem()); - _contextMenuLnk->onClick(Qt::LeftButton); - App::hoveredLinkItem(was); - } -} - void OverviewInner::copyContextUrl() { QString enc = _contextMenuLnk ? _contextMenuLnk->encoded() : QString(); if (!enc.isEmpty()) { @@ -1521,14 +1506,6 @@ void OverviewInner::saveContextFile() { if (lnkDocument) DocumentSaveLink::doSave(lnkDocument->document(), true); } -void OverviewInner::openContextFile() { - HistoryItem *was = App::hoveredLinkItem(); - App::hoveredLinkItem(App::contextItem()); - DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - if (lnkDocument) DocumentOpenLink(lnkDocument->document()).onClick(Qt::LeftButton); - App::hoveredLinkItem(was); -} - bool OverviewInner::onSearchMessages(bool searchCache) { _searchTimer.stop(); QString q = _search.text().trimmed(); diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index 58d1efbd54..f06da8a254 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -86,12 +86,10 @@ public slots: void onUpdateSelected(); - void openContextUrl(); void copyContextUrl(); void cancelContextDownload(); void showContextInFolder(); void saveContextFile(); - void openContextFile(); void goToMessage(); void deleteMessage(); diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 733bd0e84e..a60467d8b6 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.26 + 0.9.27 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 878e146e64..7afbfd1598 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,26,1 - PRODUCTVERSION 0,9,26,1 + FILEVERSION 0,9,27,0 + PRODUCTVERSION 0,9,27,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.26.1" + VALUE "FileVersion", "0.9.27.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.26.1" + VALUE "ProductVersion", "0.9.27.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index c7f7c5580f..0b392f3d6f 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.26; + CURRENT_PROJECT_VERSION = 0.9.27; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.26; + CURRENT_PROJECT_VERSION = 0.9.27; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.26; + CURRENT_PROJECT_VERSION = 0.9.27; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.26; + DYLIB_CURRENT_VERSION = 0.9.27; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.26; + CURRENT_PROJECT_VERSION = 0.9.27; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.26; + DYLIB_CURRENT_VERSION = 0.9.27; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 7e97206f14..add9a12a4f 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9026 +AppVersion 9027 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.26 -AppVersionStr 0.9.26 -DevChannel 0 -BetaVersion 9026001 +AppVersionStrSmall 0.9.27 +AppVersionStr 0.9.27 +DevChannel 1 +BetaVersion 0 9026001 From 08153c944de9695acfbc916abe5a1eab80ca2b0e Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 20:24:56 +0300 Subject: [PATCH 124/316] langs updated, 0.9.27 dev version --- Telegram/SourceFiles/langs/lang_de.strings | 21 ++++++++++++++++--- Telegram/SourceFiles/langs/lang_es.strings | 19 +++++++++++++++-- Telegram/SourceFiles/langs/lang_it.strings | 19 +++++++++++++++-- Telegram/SourceFiles/langs/lang_ko.strings | 19 +++++++++++++++-- Telegram/SourceFiles/langs/lang_nl.strings | 19 +++++++++++++++-- Telegram/SourceFiles/langs/lang_pt_BR.strings | 19 +++++++++++++++-- 6 files changed, 103 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index f1fad4804b..90b60d32a6 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -123,6 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "Interner Serverfehler."; "lng_flood_error" = "Zu viele Versuche, bitte später erneut probieren."; "lng_gif_error" = "Ein Fehler ist beim Laden der GIF-Animation aufgetreten :("; +"lng_edit_error" = "Du kannst diese Nachricht nicht bearbeiten"; +"lng_edit_deleted" = "Diese Nachricht wurde gelöscht"; +"lng_edit_too_long" = "Der Text ist leider zu lang"; +"lng_edit_message" = "Nachricht bearbeiten"; +"lng_edit_message_text" = "Neuer Text.."; "lng_deleted" = "Gelöschter Kontakt"; "lng_deleted_message" = "Gelöschte Nachricht"; @@ -556,7 +561,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link in die Zwischenablage kopiert.\n"; -"lng_forwarded_from" = "Weitergeleitet von"; +"lng_forwarded" = "Weitergeleitet von {user}"; +"lng_forwarded_channel" = "Weitergeleitet aus {channel}"; +"lng_forwarded_via" = "Weitergeleitet von {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Weitergeleitet aus {channel} via {inline_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Antwort auf"; "lng_attach_failed" = "Uploadfehler"; @@ -645,8 +654,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_button" = "Senden"; "lng_message_ph" = "Schreibe deine Nachricht.."; "lng_comment_ph" = "Schreibe ein Kommentar.."; -"lng_broadcast_ph" = "Schicke einen Broadcast.."; +"lng_broadcast_ph" = "Sende einen Broadcast.."; +"lng_broadcast_silent_ph" = "Lautloser Broadcast"; "lng_record_cancel" = "Zum Abbrechen rausbewegen"; +"lng_will_be_notified" = "Mitglieder werden benachrichtigt"; +"lng_wont_be_notified" = "Mitglieder werden nicht benachrichtigt"; "lng_empty_history" = ""; "lng_willbe_history" = "Chat auswählen um zu schreiben"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -706,6 +718,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "Link öffnen"; "lng_context_copy_link" = "Link kopieren"; +"lng_context_copy_post_link" = "Link kopieren"; "lng_context_open_email" = "Email verfassen"; "lng_context_copy_email" = "E-Mail-Adresse kopieren"; "lng_context_open_hashtag" = "Nach Hashtag suchen"; @@ -736,6 +749,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "GIF speichern"; "lng_context_to_msg" = "Zur Nachricht"; "lng_context_reply_msg" = "Antworten"; +"lng_context_edit_msg" = "Bearbeiten"; "lng_context_forward_msg" = "Nachricht weiterleiten"; "lng_context_delete_msg" = "Nachricht löschen"; "lng_context_select_msg" = "Nachricht auswählen"; @@ -772,6 +786,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "Gruppennamen ändern"; "lng_edit_contact_title" = "Kontaktnamen ändern"; "lng_edit_channel_title" = "Kanal bearbeiten"; +"lng_edit_sign_messages" = "Nachrichten unterschreiben"; "lng_edit_group" = "Gruppe bearbeiten"; "lng_edit_self_title" = "Name bearbeiten"; "lng_confirm_contact_data" = "Neuer Kontakt"; @@ -837,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}"; "lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen"; -"lng_new_version_text" = "— Neue Option in den Einstellungen unter 'Hintergrund' hinzugefügt (nennt sich dort \"Flexibles Layout für breite Bildschirme\"), um das Layout bei besonders breiten Bildschirmen zu ändern\n— Abstürze in der Linux-Version behoben"; +"lng_new_version_text" = "— Bearbeite deine Nachrichten in Kanälen und Supergruppen.\n— Teile direkt Links zu einzelnen Kanal-Nachrichten über das Teilen-Symbol neben der Nachricht.\n— Unterschreibe Nachrichten in Kanälen - so kann jeder sehen, welcher Admin die Nachricht geschrieben hat.\n— Sende 'lautlose Nachrichten' in Kanälen. Klasse, wenn man mal wieder mitten in der Nacht eine Nachricht senden muss."; "lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 4370b950bc..eede26f55b 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -123,6 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "Error interno del servidor."; "lng_flood_error" = "Muchos intentos. Por favor, reinténtalo más tarde."; "lng_gif_error" = "Ocurrió un error al leer la animación GIF :("; +"lng_edit_error" = "No puedes editar este mensaje"; +"lng_edit_deleted" = "Este mensaje fue eliminado"; +"lng_edit_too_long" = "Tu texto es demasiado largo"; +"lng_edit_message" = "Editar mensaje"; +"lng_edit_message_text" = "Nuevo texto..."; "lng_deleted" = "Desconocido"; "lng_deleted_message" = "Mensaje eliminado"; @@ -556,7 +561,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Enlace copiado al portapapeles."; -"lng_forwarded_from" = "Reenviado desde"; +"lng_forwarded" = "Forwarded from {user}"; +"lng_forwarded_channel" = "Forwarded from {channel}"; +"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Respondiendo a"; "lng_attach_failed" = "Fallido"; @@ -646,7 +655,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Escribe un mensaje..."; "lng_comment_ph" = "Escribe un comentario..."; "lng_broadcast_ph" = "Difunde un mensaje..."; +"lng_broadcast_silent_ph" = "Silent broadcast.."; "lng_record_cancel" = "Suelta fuera de aquí para cancelar"; +"lng_will_be_notified" = "Tu publicación será notificada"; +"lng_wont_be_notified" = "Tu publicación no será notificada"; "lng_empty_history" = ""; "lng_willbe_history" = "Selecciona un chat para comenzar"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -706,6 +718,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "Abrir enlace"; "lng_context_copy_link" = "Copiar enlace"; +"lng_context_copy_post_link" = "Copiar enlace"; "lng_context_open_email" = "Escribir a esta dirección"; "lng_context_copy_email" = "Copiar dirección de correo electrónico"; "lng_context_open_hashtag" = "Buscar por hashtag"; @@ -736,6 +749,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "Guardar GIF"; "lng_context_to_msg" = "Ir al mensaje"; "lng_context_reply_msg" = "Responder"; +"lng_context_edit_msg" = "Editar"; "lng_context_forward_msg" = "Reenviar mensaje"; "lng_context_delete_msg" = "Eliminar mensaje"; "lng_context_select_msg" = "Seleccionar mensaje"; @@ -772,6 +786,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "Editar nombre del grupo"; "lng_edit_contact_title" = "Editar nombre del contacto"; "lng_edit_channel_title" = "Editar canal"; +"lng_edit_sign_messages" = "Firmar los mensajes"; "lng_edit_group" = "Editar grupo"; "lng_edit_self_title" = "Editar tu nombre"; "lng_confirm_contact_data" = "Nuevo contacto"; @@ -837,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop ha sido actualizada a la versión {version}\n\n{changes}\n\nEl historial completo está disponible aquí:\n{link}"; "lng_new_version_minor" = "— Corrección de errores y otras mejoras menores"; -"lng_new_version_text" = "— Ajuste para activar o desactivar el diseño adaptable para pantallas anchas \n— Arreglado el cierre inesperado en la versión para Linux"; +"lng_new_version_text" = "— Edita tus mensajes en canales y supergrupos.\n— Comparte enlaces a publicaciones específicas en canales, a través del menú contextual de la publicación. \n— Añade firmas de los administradores a los mensajes en canales.\n— Envía mensajes silenciosos en canales, que no serán notificados a los miembros. Es útil para publicaciones que no son urgentes o en medio de la noche."; "lng_menu_insert_unicode" = "Insertar caracteres de control Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 7563d169ce..8c49827618 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -123,6 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "Errore interno del server."; "lng_flood_error" = "Troppi tentativi. Per favore riprova più tardi."; "lng_gif_error" = "C'è stato un errore nel leggere la GIF :("; +"lng_edit_error" = "Non puoi modificare questo messaggio"; +"lng_edit_deleted" = "Questo messaggio è stato eliminato"; +"lng_edit_too_long" = "Il tuo messaggio è troppo lungo"; +"lng_edit_message" = "Modifica messaggio"; +"lng_edit_message_text" = "Nuovo testo messaggio.."; "lng_deleted" = "Sconosciuto"; "lng_deleted_message" = "Messaggio eliminato"; @@ -556,7 +561,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link copiato negli appunti."; -"lng_forwarded_from" = "Inoltrato da"; +"lng_forwarded" = "Inoltrato da {user}"; +"lng_forwarded_channel" = "Inoltrato da {channel}"; +"lng_forwarded_via" = "Inoltrato da {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Inoltrato da {channel} via {inline_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "In risposta a"; "lng_attach_failed" = "Fallito"; @@ -646,7 +655,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Scrivi un messaggio.."; "lng_comment_ph" = "Scrivi un commento.."; "lng_broadcast_ph" = "Diffondi un messaggio.."; +"lng_broadcast_silent_ph" = "Broadcast silenzioso.."; "lng_record_cancel" = "Rilascia fuori da qui per annullare"; +"lng_will_be_notified" = "I membri saranno notificati quando pubblichi"; +"lng_wont_be_notified" = "I membri non saranno notificati quando pubblichi"; "lng_empty_history" = ""; "lng_willbe_history" = "Seleziona una chat per iniziare a messaggiare"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -706,6 +718,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "Apri link"; "lng_context_copy_link" = "Copia link"; +"lng_context_copy_post_link" = "Copia link post"; "lng_context_open_email" = "Scrivi a questo indirizzo"; "lng_context_copy_email" = "Copia indirizzo email"; "lng_context_open_hashtag" = "Cerca via hashtag"; @@ -736,6 +749,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "Salva GIF"; "lng_context_to_msg" = "Vai al messaggio"; "lng_context_reply_msg" = "Rispondi"; +"lng_context_edit_msg" = "Modifica"; "lng_context_forward_msg" = "Inoltra messaggio"; "lng_context_delete_msg" = "Elimina messaggio"; "lng_context_select_msg" = "Seleziona messaggio"; @@ -772,6 +786,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "Modifica nome gruppo"; "lng_edit_contact_title" = "Modifica nome contatto"; "lng_edit_channel_title" = "Modifica canale"; +"lng_edit_sign_messages" = "Firma messaggi"; "lng_edit_group" = "Modifica gruppo"; "lng_edit_self_title" = "Modifica il tuo nome"; "lng_confirm_contact_data" = "Nuovo contatto"; @@ -837,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}"; "lng_new_version_minor" = "— Risoluzione di problemi e altri miglioramenti minori"; -"lng_new_version_text" = "— Interruttore per il layout adattivo per grandi schermi aggiunto nelle Impostazioni\n— Risoluzione dei crash su Linux"; +"lng_new_version_text" = "— Modifica i tuoi messaggi nei canali e nei supergruppi.\n— Condividi link per post specifici nei canali con il menu contestuale dei post.\n— Aggiungi le firme per i messaggi degli amministratori nei canali.\n— Invia messaggi silenziosi nei canali che non notificheranno i membri.\nUtile per i post non urgenti o fatti di notte."; "lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 4164413533..bda501dcf0 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -123,6 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "내부 서버 오류"; "lng_flood_error" = "시도가 너무 많습니다. 나중에 다시 시도해주세요."; "lng_gif_error" = "GIF 애니메이션을 읽는 동안 에러가 발생하였습니다."; +"lng_edit_error" = "You cannot edit this message"; +"lng_edit_deleted" = "This message was deleted"; +"lng_edit_too_long" = "Your message text is too long"; +"lng_edit_message" = "Edit message"; +"lng_edit_message_text" = "New message text.."; "lng_deleted" = "알 수 없음"; "lng_deleted_message" = "삭제된 메시지"; @@ -556,7 +561,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "클립보드에 링크가 복사되었습니다."; -"lng_forwarded_from" = "전달받음"; +"lng_forwarded" = "Forwarded from {user}"; +"lng_forwarded_channel" = "Forwarded from {channel}"; +"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "다음 유저에게 답장 :"; "lng_attach_failed" = "실패"; @@ -646,7 +655,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "메시지 쓰기"; "lng_comment_ph" = "코멘트 쓰기.."; "lng_broadcast_ph" = "단체메시지 쓰기."; +"lng_broadcast_silent_ph" = "Silent broadcast.."; "lng_record_cancel" = "이 영역 밖에서 마우스 클릭을 해제하시면 취소가 됩니다."; +"lng_will_be_notified" = "Members will be notified when you post"; +"lng_wont_be_notified" = "Members will not be notified when you post"; "lng_empty_history" = ""; "lng_willbe_history" = "대화하실 방을 선택해주세요."; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -706,6 +718,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "링크 열기"; "lng_context_copy_link" = "링크 복사"; +"lng_context_copy_post_link" = "Copy Post Link"; "lng_context_open_email" = "이 주소로 메시지 보내기"; "lng_context_copy_email" = "이메일 복사"; "lng_context_open_hashtag" = "해시태그로 검색"; @@ -736,6 +749,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "GIF 저장"; "lng_context_to_msg" = "메시지로 이동"; "lng_context_reply_msg" = "답장"; +"lng_context_edit_msg" = "Edit"; "lng_context_forward_msg" = "메시지 전달"; "lng_context_delete_msg" = "메시지 삭제"; "lng_context_select_msg" = "메시지 선택"; @@ -772,6 +786,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "그룹 이름 수정"; "lng_edit_contact_title" = "연락처 이름 수정"; "lng_edit_channel_title" = "채널 수정"; +"lng_edit_sign_messages" = "Sign messages"; "lng_edit_group" = "그룹방 수정"; "lng_edit_self_title" = "이름 수정"; "lng_confirm_contact_data" = "새로운 연락처"; @@ -837,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}"; "lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상"; -"lng_new_version_text" = "— 와이드 스크린 레이아웃 설정 적용\n— 리눅스 버전 크래시 수정"; +"lng_new_version_text" = "— Edit your messages in channels and supergroups.\n— Share links to specific posts in channels via the post context menu.\n— Add admin signatures to messages in channels.\n— Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting."; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 5d5e5d0cf9..5edaad9d5a 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -123,6 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "Interne serverfout."; "lng_flood_error" = "Teveel pogingen. Probeer het later opnieuw."; "lng_gif_error" = "Er is iets een fout opgetreden bij het lezen van de GIF :("; +"lng_edit_error" = "Je mag dit bericht niet bewerken"; +"lng_edit_deleted" = "Bericht is gewist"; +"lng_edit_too_long" = "Je bericht is te lang"; +"lng_edit_message" = "Bericht bewerken"; +"lng_edit_message_text" = "Nieuw bericht..."; "lng_deleted" = "Onbekend"; "lng_deleted_message" = "Verwijderd bericht"; @@ -556,7 +561,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link gekopieerd naar klembord"; -"lng_forwarded_from" = "Doorgestuurd van"; +"lng_forwarded" = "Forwarded from {user}"; +"lng_forwarded_channel" = "Forwarded from {channel}"; +"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Antwoord op"; "lng_attach_failed" = "Mislukt"; @@ -646,7 +655,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Bericht schrijven"; "lng_comment_ph" = "Reactie"; "lng_broadcast_ph" = "Massabericht"; +"lng_broadcast_silent_ph" = "Silent broadcast.."; "lng_record_cancel" = "Annuleren: uit het vak loslaten"; +"lng_will_be_notified" = "Berichtgeving voor deelnemers"; +"lng_wont_be_notified" = "Geen berichtgeving voor deelnemers"; "lng_empty_history" = ""; "lng_willbe_history" = "Kies een chat om te beginnen"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -706,6 +718,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "Link openen"; "lng_context_copy_link" = "Link kopiëren"; +"lng_context_copy_post_link" = "Link kopiëren"; "lng_context_open_email" = "Naar dit adres sturen"; "lng_context_copy_email" = "E-mailadres kopiëren"; "lng_context_open_hashtag" = "Zoeken op hashtag"; @@ -736,6 +749,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "GIF opslaan"; "lng_context_to_msg" = "Naar bericht gaan"; "lng_context_reply_msg" = "Antwoord"; +"lng_context_edit_msg" = "Bewerken"; "lng_context_forward_msg" = "Bericht doorsturen"; "lng_context_delete_msg" = "Bericht verwijderen"; "lng_context_select_msg" = "Bericht kiezen"; @@ -772,6 +786,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "Groepsnaam bewerken"; "lng_edit_contact_title" = "Naam bewerken"; "lng_edit_channel_title" = "Kanaal wijzigen"; +"lng_edit_sign_messages" = "Ondertekenen"; "lng_edit_group" = "Groep bewerken"; "lng_edit_self_title" = "Je naam bewerken"; "lng_confirm_contact_data" = "Nieuw contact"; @@ -837,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}"; "lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen"; -"lng_new_version_text" = "— Adaptieve layout voor brede schermen toegevoegd aan instellingen\n— Crashes in de Linuxversie opgelost"; +"lng_new_version_text" = "— Edit your messages in channels and supergroups.\n— Share links to specific posts in channels via the post context menu.\n— Add admin signatures to messages in channels.\n— Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting."; "lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index fb36ee6188..2c92adab34 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -123,6 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "Erro interno do servidor."; "lng_flood_error" = "Muitas tentativas. Por favor, tente novamente mais tarde."; "lng_gif_error" = "Um erro ocorreu com a animação do GIF :("; +"lng_edit_error" = "Você não pode editar essa mensagem"; +"lng_edit_deleted" = "Essa mensagem foi apagada"; +"lng_edit_too_long" = "Sua mensagem está muito longa"; +"lng_edit_message" = "Editar mensagem"; +"lng_edit_message_text" = "Nova mensagem..."; "lng_deleted" = "Desconhecido"; "lng_deleted_message" = "Mensagem apagada"; @@ -556,7 +561,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link copiado para área de transferência."; -"lng_forwarded_from" = "Encaminhado de"; +"lng_forwarded" = "Encaminhado de {user}"; +"lng_forwarded_channel" = "Encaminhado de {channel}"; +"lng_forwarded_via" = "Encaminhado de {user} via {online_bot}"; +"lng_forwarded_channel_via" = "Encaminhado de {channel} via {online_bot}"; +"lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Em resposta a"; "lng_attach_failed" = "Falhou"; @@ -646,7 +655,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Escrever a mensagem.."; "lng_comment_ph" = "Escreva um comentário..."; "lng_broadcast_ph" = "Transmitir a mensagem..."; +"lng_broadcast_silent_ph" = "Silenciar transmissão..."; "lng_record_cancel" = "Solte fora desse campo para cancelar"; +"lng_will_be_notified" = "Os membros serão notificados quando você postar"; +"lng_wont_be_notified" = "Os membros não serão notificados quando você postar"; "lng_empty_history" = ""; "lng_willbe_history" = "Selecione um chat para começar a conversar"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -706,6 +718,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_open_link" = "Abrir Link"; "lng_context_copy_link" = "Copiar Link"; +"lng_context_copy_post_link" = "Copiar Link do Post"; "lng_context_open_email" = "Escrever para este endereço"; "lng_context_copy_email" = "Copiar endereço de email"; "lng_context_open_hashtag" = "Buscar pela hashtag"; @@ -736,6 +749,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "Salvar GIF"; "lng_context_to_msg" = "Ir Para Mensagem"; "lng_context_reply_msg" = "Responder"; +"lng_context_edit_msg" = "Editar"; "lng_context_forward_msg" = "Encaminhar Mensagem"; "lng_context_delete_msg" = "Apagar Mensagem"; "lng_context_select_msg" = "Selecionar Mensagem"; @@ -772,6 +786,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "Editar nome do grupo"; "lng_edit_contact_title" = "Editar nome de contato"; "lng_edit_channel_title" = "Editar Canal"; +"lng_edit_sign_messages" = "Assinar mensagens"; "lng_edit_group" = "Editar grupo"; "lng_edit_self_title" = "Editar seu nome"; "lng_confirm_contact_data" = "Novo Contato"; @@ -837,7 +852,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop foi atualizado para a versão {version}\n\n{changes}\n\nHistórico completo de mudanças disponível aqui:\n{link}"; "lng_new_version_minor" = "— Resolução de bugs e outras melhorias menores"; -"lng_new_version_text" = "— Layout adaptativo para wide screens adicionado em Configurações\n— Resolvido crash nas versões Linux"; +"lng_new_version_text" = "— Edite suas mensagens em canais e supergrupos.\n— Compartilhe links para postagens específicas nos canais pelo menu de contexto do post.\n— Adicione assinaturas de administradores nas mensagens dos canais.\n— Envie mensagens silenciosas em canais, que não notificarão os membros. Útil para mensagens não urgentes ou enviadas tarde da noite."; "lng_menu_insert_unicode" = "Inserir caractere de controle Unicode"; From 16255f159100f6800d64752cf02b9892fb9e74b2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 20:39:35 +0300 Subject: [PATCH 125/316] fixed os x build 0.9.27 dev version --- Telegram/SourceFiles/pspecific_mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 245765b9d5..7f2cf95082 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -86,7 +86,7 @@ void MacPrivate::notifyClicked(unsigned long long peer, int msgid) { void MacPrivate::notifyReplied(unsigned long long peer, int msgid, const char *str) { History *history = App::history(PeerId(peer)); - App::main()->sendMessage(history, QString::fromUtf8(str), (msgid > 0 && !history->peer->isUser()) ? msgid : 0, false); + App::main()->sendMessage(history, QString::fromUtf8(str), (msgid > 0 && !history->peer->isUser()) ? msgid : 0, false, false); } PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), From 39981835ced6ee10f05698e1b8cb6811bbfb3016 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Feb 2016 20:58:14 +0300 Subject: [PATCH 126/316] mention links bug fixed, 0.9.27 dev version --- Telegram/SourceFiles/gui/text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index b65e30f2c8..958401f1fc 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -967,7 +967,7 @@ void LocationLink::setup() { void MentionLink::onClick(Qt::MouseButton button) const { if (button == Qt::LeftButton || button == Qt::MiddleButton) { - App::openPeerByName(_tag.mid(1), true); + App::openPeerByName(_tag.mid(1), ShowAtProfileMsgId); } } From 1bd986d2cb71cdf3edba1872d8b61b76ee0aa6ff Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 12:29:07 +0300 Subject: [PATCH 127/316] added any profile photo delete, fixed profile photo upload --- Telegram/SourceFiles/application.cpp | 4 +-- Telegram/SourceFiles/application.h | 2 +- Telegram/SourceFiles/mediaview.cpp | 26 ++++++++++++++++++- Telegram/SourceFiles/mediaview.h | 4 ++- .../SourceFiles/mtproto/mtpConnection.cpp | 4 +-- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index dc1f0baee9..2c17f7b831 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -951,7 +951,7 @@ void AppClass::killDownloadSessions() { } } -void AppClass::photoUpdated(const FullMsgId &msgId, const MTPInputFile &file) { +void AppClass::photoUpdated(const FullMsgId &msgId, bool silent, const MTPInputFile &file) { if (!App::self()) return; QMap::iterator i = photoUpdates.find(msgId); @@ -1040,7 +1040,7 @@ void AppClass::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId) { ReadyLocalMedia ready(PreparePhoto, file, filename, filesize, data, id, id, qsl("jpg"), peerId, photo, photoThumbs, MTP_documentEmpty(MTP_long(0)), jpeg, false, false, 0); - connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&, const MTPInputFile&)), App::app(), SLOT(photoUpdated(const FullMsgId&, const MTPInputFile&)), Qt::UniqueConnection); + connect(App::uploader(), SIGNAL(photoReady(const FullMsgId&,bool,const MTPInputFile&)), App::app(), SLOT(photoUpdated(const FullMsgId&,bool,const MTPInputFile&)), Qt::UniqueConnection); FullMsgId newId(peerToChannel(peerId), clientMsgId()); App::app()->regPhotoUpdate(peerId, newId); diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index d823ab1f2c..acae496077 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -191,7 +191,7 @@ public slots: void doMtpUnpause(); - void photoUpdated(const FullMsgId &msgId, const MTPInputFile &file); + void photoUpdated(const FullMsgId &msgId, bool silent, const MTPInputFile &file); void onSwitchDebugMode(); void onSwitchTestMode(); diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 5330c1331e..492189aa43 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -398,7 +398,7 @@ void MediaView::updateDropdown() { _btnSaveAs->setVisible(true); _btnCopy->setVisible((_doc && fileShown()) || (_photo && _photo->loaded())); _btnForward->setVisible(_canForward); - _btnDelete->setVisible(_canDelete || (_photo && App::self() && App::self()->photoId == _photo->id) || (_photo && _photo->peer && _photo->peer->photoId == _photo->id && (_photo->peer->isChat() || (_photo->peer->isChannel() && _photo->peer->asChannel()->amCreator())))); + _btnDelete->setVisible(_canDelete || (_photo && App::self() && _user == App::self()) || (_photo && _photo->peer && _photo->peer->photoId == _photo->id && (_photo->peer->isChat() || (_photo->peer->isChannel() && _photo->peer->asChannel()->amCreator())))); _btnViewAll->setVisible((_overview != OverviewCount) && _history); _btnViewAll->setText(lang(_doc ? lng_mediaview_files_all : lng_mediaview_photos_all)); _dropdown.updateButtons(); @@ -707,6 +707,21 @@ void MediaView::onDelete() { if (!_msgid) { if (App::self() && _photo && App::self()->photoId == _photo->id) { App::app()->peerClearPhoto(App::self()->id); + } else if (_user && _user == App::self()) { + for (int32 i = 0, l = _user->photos.size(); i != l; ++i) { + if (_user->photos.at(i) == _photo) { + _user->photos.removeAt(i); + MTP::send(MTPphotos_DeletePhotos(MTP_vector(1, MTP_inputPhoto(MTP_long(_photo->id), MTP_long(_photo->access)))), rpcDone(&MediaView::deletePhotosDone), rpcFail(&MediaView::deletePhotosFail)); + if (_user->photos.isEmpty()) { + hide(); + } else if (i + 1 < l) { + showPhoto(_user->photos.at(i), _user); + } else { + showPhoto(_user->photos.at(i - 1), _user); + } + break; + } + } } else if (_photo->peer && _photo->peer->photoId == _photo->id) { App::app()->peerClearPhoto(_photo->peer->id); } @@ -2090,6 +2105,15 @@ void MediaView::userPhotosLoaded(UserData *u, const MTPphotos_Photos &photos, mt if (App::wnd()) App::wnd()->mediaOverviewUpdated(u, OverviewCount); } +void MediaView::deletePhotosDone(const MTPVector &result) { +} + +bool MediaView::deletePhotosFail(const RPCError &error) { + if (mtpIsFlood(error)) return false; + + return true; +} + void MediaView::updateHeader() { int32 index = _index, count = 0, addcount = (_migrated && _overview != OverviewCount) ? _migrated->overviewCount(_overview) : 0; if (_history) { diff --git a/Telegram/SourceFiles/mediaview.h b/Telegram/SourceFiles/mediaview.h index 3007e574eb..1736bcf109 100644 --- a/Telegram/SourceFiles/mediaview.h +++ b/Telegram/SourceFiles/mediaview.h @@ -107,7 +107,9 @@ private: void loadBack(); void userPhotosLoaded(UserData *u, const MTPphotos_Photos &photos, mtpRequestId req); - void filesLoaded(History *h, const MTPmessages_Messages &msgs, mtpRequestId req); + + void deletePhotosDone(const MTPVector &result); + bool deletePhotosFail(const RPCError &error); void updateHeader(); void snapXY(); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 3da8619852..9e0e10a49c 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -2054,8 +2054,8 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { _pingId = _pingMsgId = _pingIdToSend = _pingSendAt = 0; _pingSender.stop(); - if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %1:%2 (http)..").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); - if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%1]:%2 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %3:%4 (http)..").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%3]:%4 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); _waitForConnectedTimer.start(_waitForConnected); if (_conn4) { From 027c6fb9c087aa8f869db9a58b8d85db7fecf1b1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 14:32:56 +0300 Subject: [PATCH 128/316] langs updated --- Telegram/SourceFiles/langs/lang_de.strings | 8 ---- Telegram/SourceFiles/langs/lang_es.strings | 18 +++------ Telegram/SourceFiles/langs/lang_it.strings | 8 ---- Telegram/SourceFiles/langs/lang_ko.strings | 40 ++++++++----------- Telegram/SourceFiles/langs/lang_nl.strings | 20 +++------- Telegram/SourceFiles/langs/lang_pt_BR.strings | 8 ---- 6 files changed, 27 insertions(+), 75 deletions(-) diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 90b60d32a6..af025585cc 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "Gruppeninfo zeigen"; "lng_context_view_channel" = "Kanalinfo anzeigen"; -"lng_context_open_link" = "Link öffnen"; "lng_context_copy_link" = "Link kopieren"; "lng_context_copy_post_link" = "Link kopieren"; -"lng_context_open_email" = "Email verfassen"; "lng_context_copy_email" = "E-Mail-Adresse kopieren"; -"lng_context_open_hashtag" = "Nach Hashtag suchen"; "lng_context_copy_hashtag" = "Hashtag kopieren"; -"lng_context_open_mention" = "Profil öffnen"; "lng_context_copy_mention" = "Benutzername kopieren"; -"lng_context_open_image" = "Bild öffnen"; "lng_context_save_image" = "Bild speichern unter"; "lng_context_forward_image" = "Bild weiterleiten"; "lng_context_delete_image" = "Bild löschen"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Download abbrechen"; "lng_context_show_in_folder" = "Im Ordner anzeigen"; "lng_context_show_in_finder" = "Im Finder zeigen"; -"lng_context_open_video" = "Video öffnen"; "lng_context_save_video" = "Video speichern unter.."; -"lng_context_open_audio" = "Sprachnachricht öffnen"; "lng_context_save_audio" = "Sprachnachricht speichern unter.."; "lng_context_pack_info" = "Sticker-Paket"; "lng_context_pack_add" = "Sticker hinzufügen"; -"lng_context_open_file" = "Datei öffnen"; "lng_context_save_file" = "Datei speichern als.."; "lng_context_forward_file" = "Datei weiterleiten"; "lng_context_delete_file" = "Datei löschen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index eede26f55b..6c43144dc0 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -561,10 +561,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Enlace copiado al portapapeles."; -"lng_forwarded" = "Forwarded from {user}"; -"lng_forwarded_channel" = "Forwarded from {channel}"; -"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; -"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded" = "Reenviado desde {user}"; +"lng_forwarded_channel" = "Reenviado desde {channel}"; +"lng_forwarded_via" = "Reenviado desde {user} vía {inline_bot}"; +"lng_forwarded_channel_via" = "Reenviado desde {channel} vía {inline_bot}"; "lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Respondiendo a"; @@ -655,7 +655,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Escribe un mensaje..."; "lng_comment_ph" = "Escribe un comentario..."; "lng_broadcast_ph" = "Difunde un mensaje..."; -"lng_broadcast_silent_ph" = "Silent broadcast.."; +"lng_broadcast_silent_ph" = "Difusión en silencio..."; "lng_record_cancel" = "Suelta fuera de aquí para cancelar"; "lng_will_be_notified" = "Tu publicación será notificada"; "lng_wont_be_notified" = "Tu publicación no será notificada"; @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "Ver información"; "lng_context_view_channel" = "Ver información"; -"lng_context_open_link" = "Abrir enlace"; "lng_context_copy_link" = "Copiar enlace"; "lng_context_copy_post_link" = "Copiar enlace"; -"lng_context_open_email" = "Escribir a esta dirección"; "lng_context_copy_email" = "Copiar dirección de correo electrónico"; -"lng_context_open_hashtag" = "Buscar por hashtag"; "lng_context_copy_hashtag" = "Copiar hashtag"; -"lng_context_open_mention" = "Abrir perfil"; "lng_context_copy_mention" = "Copiar alias"; -"lng_context_open_image" = "Abrir imagen"; "lng_context_save_image" = "Guardar como..."; "lng_context_forward_image" = "Reenviar imagen"; "lng_context_delete_image" = "Eliminar imagen"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancelar descarga"; "lng_context_show_in_folder" = "Mostrar en la carpeta"; "lng_context_show_in_finder" = "Mostrar en el Finder"; -"lng_context_open_video" = "Abrir vídeo"; "lng_context_save_video" = "Guardar como..."; -"lng_context_open_audio" = "Abrir audio"; "lng_context_save_audio" = "Guardar como..."; "lng_context_pack_info" = "Información del pack"; "lng_context_pack_add" = "Añadir stickers"; -"lng_context_open_file" = "Abrir archivo"; "lng_context_save_file" = "Guardar como..."; "lng_context_forward_file" = "Reenviar archivo"; "lng_context_delete_file" = "Eliminar archivo"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 8c49827618..071e7d8a7a 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "Visualizza info gruppo"; "lng_context_view_channel" = "Visualizza info canale"; -"lng_context_open_link" = "Apri link"; "lng_context_copy_link" = "Copia link"; "lng_context_copy_post_link" = "Copia link post"; -"lng_context_open_email" = "Scrivi a questo indirizzo"; "lng_context_copy_email" = "Copia indirizzo email"; -"lng_context_open_hashtag" = "Cerca via hashtag"; "lng_context_copy_hashtag" = "Copia hashtag"; -"lng_context_open_mention" = "Apri profilo"; "lng_context_copy_mention" = "Copia username"; -"lng_context_open_image" = "Apri immagine"; "lng_context_save_image" = "Salva immagine come.."; "lng_context_forward_image" = "Inoltra immagine"; "lng_context_delete_image" = "Elimina immagine"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Annulla download"; "lng_context_show_in_folder" = "Mostra nella cartella"; "lng_context_show_in_finder" = "Mostra nel Finder"; -"lng_context_open_video" = "Apri video"; "lng_context_save_video" = "Salva video come.."; -"lng_context_open_audio" = "Apri audio"; "lng_context_save_audio" = "Salva audio come.."; "lng_context_pack_info" = "Mostra sticker"; "lng_context_pack_add" = "Aggiungi sticker"; -"lng_context_open_file" = "Apri file"; "lng_context_save_file" = "Salva file come.."; "lng_context_forward_file" = "Inoltra file"; "lng_context_delete_file" = "Elimina file"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index bda501dcf0..50a4e22900 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -123,11 +123,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_server_error" = "내부 서버 오류"; "lng_flood_error" = "시도가 너무 많습니다. 나중에 다시 시도해주세요."; "lng_gif_error" = "GIF 애니메이션을 읽는 동안 에러가 발생하였습니다."; -"lng_edit_error" = "You cannot edit this message"; -"lng_edit_deleted" = "This message was deleted"; -"lng_edit_too_long" = "Your message text is too long"; -"lng_edit_message" = "Edit message"; -"lng_edit_message_text" = "New message text.."; +"lng_edit_error" = "메시지를 수정 할 수 없습니다."; +"lng_edit_deleted" = "메시지는 삭제 되었습니다."; +"lng_edit_too_long" = "메시지 길이가 너무 깁니다."; +"lng_edit_message" = "메시지 수정"; +"lng_edit_message_text" = "새로운 메시지 내용."; "lng_deleted" = "알 수 없음"; "lng_deleted_message" = "삭제된 메시지"; @@ -561,10 +561,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "클립보드에 링크가 복사되었습니다."; -"lng_forwarded" = "Forwarded from {user}"; -"lng_forwarded_channel" = "Forwarded from {channel}"; -"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; -"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded" = "{user}로 부터 전달 받음"; +"lng_forwarded_channel" = "{channel}로 부터 전달 받음"; +"lng_forwarded_via" = "{inline_bot}을 {user}로 부터 전달 받음"; +"lng_forwarded_channel_via" = "{inline_bot}을 {channel}로 부터 전달 받음"; "lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "다음 유저에게 답장 :"; @@ -655,10 +655,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "메시지 쓰기"; "lng_comment_ph" = "코멘트 쓰기.."; "lng_broadcast_ph" = "단체메시지 쓰기."; -"lng_broadcast_silent_ph" = "Silent broadcast.."; +"lng_broadcast_silent_ph" = "음소거 메시지.."; "lng_record_cancel" = "이 영역 밖에서 마우스 클릭을 해제하시면 취소가 됩니다."; -"lng_will_be_notified" = "Members will be notified when you post"; -"lng_wont_be_notified" = "Members will not be notified when you post"; +"lng_will_be_notified" = "메시지 작성시 구성원들에게 알림이 갑니다."; +"lng_wont_be_notified" = "메시지 작성시 구성원들에게 알림이 가지 않습니다."; "lng_empty_history" = ""; "lng_willbe_history" = "대화하실 방을 선택해주세요."; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "그룹 정보 보기"; "lng_context_view_channel" = "채널 정보 보기"; -"lng_context_open_link" = "링크 열기"; "lng_context_copy_link" = "링크 복사"; -"lng_context_copy_post_link" = "Copy Post Link"; -"lng_context_open_email" = "이 주소로 메시지 보내기"; +"lng_context_copy_post_link" = "메시지 링크 복사"; "lng_context_copy_email" = "이메일 복사"; -"lng_context_open_hashtag" = "해시태그로 검색"; "lng_context_copy_hashtag" = "해시태그 복사"; -"lng_context_open_mention" = "프로필 열기"; "lng_context_copy_mention" = "아이디 복사"; -"lng_context_open_image" = "이미지 열기"; "lng_context_save_image" = "이미지를 다른 이름으로 저장.."; "lng_context_forward_image" = "이미지 전달"; "lng_context_delete_image" = "이미지 삭제"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "다운로드 취소"; "lng_context_show_in_folder" = "탐색기에서 보기"; "lng_context_show_in_finder" = "탐색기에서 보기"; -"lng_context_open_video" = "비디오 열기"; "lng_context_save_video" = "비디오 이름을 다른이름으로 저장."; -"lng_context_open_audio" = "음성메시지 열기"; "lng_context_save_audio" = "음성메시지를 다른 이름으로 저장.."; "lng_context_pack_info" = "팩 정보"; "lng_context_pack_add" = "스티커 추가"; -"lng_context_open_file" = "파일 열기"; "lng_context_save_file" = "파일을 다른 이름으로 저장.."; "lng_context_forward_file" = "파일 전달"; "lng_context_delete_file" = "파일 삭제"; @@ -749,7 +741,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_save_gif" = "GIF 저장"; "lng_context_to_msg" = "메시지로 이동"; "lng_context_reply_msg" = "답장"; -"lng_context_edit_msg" = "Edit"; +"lng_context_edit_msg" = "수정"; "lng_context_forward_msg" = "메시지 전달"; "lng_context_delete_msg" = "메시지 삭제"; "lng_context_select_msg" = "메시지 선택"; @@ -786,7 +778,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_group_title" = "그룹 이름 수정"; "lng_edit_contact_title" = "연락처 이름 수정"; "lng_edit_channel_title" = "채널 수정"; -"lng_edit_sign_messages" = "Sign messages"; +"lng_edit_sign_messages" = "서명 메시지"; "lng_edit_group" = "그룹방 수정"; "lng_edit_self_title" = "이름 수정"; "lng_confirm_contact_data" = "새로운 연락처"; @@ -852,7 +844,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}"; "lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상"; -"lng_new_version_text" = "— Edit your messages in channels and supergroups.\n— Share links to specific posts in channels via the post context menu.\n— Add admin signatures to messages in channels.\n— Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting."; +"lng_new_version_text" = "— 채널과 슈퍼그룹에 메시지 수정\n— 메시지 작성란에서 특정 메시지 링크 공유\n— 채널 메시지에 관리자 서명 추가\n— 알림이 가지 않은 채널 메시지 작성. 급하지 않거나 늦은 시간 메시지등에 활용"; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 5edaad9d5a..99a49c8fb3 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -561,10 +561,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channel_public_link_copied" = "Link gekopieerd naar klembord"; -"lng_forwarded" = "Forwarded from {user}"; -"lng_forwarded_channel" = "Forwarded from {channel}"; -"lng_forwarded_via" = "Forwarded from {user} via {inline_bot}"; -"lng_forwarded_channel_via" = "Forwarded from {channel} via {inline_bot}"; +"lng_forwarded" = "Doorgestuurd van {user}"; +"lng_forwarded_channel" = "Doorgestuurd van {channel}"; +"lng_forwarded_via" = "Doorgestuurd van {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Doorgestuurd van {channel} via {inline_bot}"; "lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Antwoord op"; @@ -655,7 +655,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_message_ph" = "Bericht schrijven"; "lng_comment_ph" = "Reactie"; "lng_broadcast_ph" = "Massabericht"; -"lng_broadcast_silent_ph" = "Silent broadcast.."; +"lng_broadcast_silent_ph" = "Stil massabericht.."; "lng_record_cancel" = "Annuleren: uit het vak loslaten"; "lng_will_be_notified" = "Berichtgeving voor deelnemers"; "lng_wont_be_notified" = "Geen berichtgeving voor deelnemers"; @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "Groepsinformatie weergeven"; "lng_context_view_channel" = "Kanaalinformatie weergeven"; -"lng_context_open_link" = "Link openen"; "lng_context_copy_link" = "Link kopiëren"; "lng_context_copy_post_link" = "Link kopiëren"; -"lng_context_open_email" = "Naar dit adres sturen"; "lng_context_copy_email" = "E-mailadres kopiëren"; -"lng_context_open_hashtag" = "Zoeken op hashtag"; "lng_context_copy_hashtag" = "Hashtag kopiëren"; -"lng_context_open_mention" = "Profiel openen"; "lng_context_copy_mention" = "Gebruikersnaam kopiëren"; -"lng_context_open_image" = "Afbeelding openen"; "lng_context_save_image" = "Afbeelding opslaan als"; "lng_context_forward_image" = "Afbeelding doorsturen"; "lng_context_delete_image" = "Afbeelding verwijderen"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Download annuleren"; "lng_context_show_in_folder" = "Weergeven in map"; "lng_context_show_in_finder" = "Weergeven in Finder"; -"lng_context_open_video" = "Video openen"; "lng_context_save_video" = "Video opslaan als"; -"lng_context_open_audio" = "Geluidsbestand openen"; "lng_context_save_audio" = "Geluidsbestand opslaan als"; "lng_context_pack_info" = "Bundelinformatie"; "lng_context_pack_add" = "Stickers toevoegen"; -"lng_context_open_file" = "Bestand openen"; "lng_context_save_file" = "Bestand opslaan als"; "lng_context_forward_file" = "Bestand doorsturen"; "lng_context_delete_file" = "Bestand verwijderen"; @@ -852,7 +844,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}"; "lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen"; -"lng_new_version_text" = "— Edit your messages in channels and supergroups.\n— Share links to specific posts in channels via the post context menu.\n— Add admin signatures to messages in channels.\n— Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting."; +"lng_new_version_text" = "— Bewerk nu je berichten in kanalen en supergroepen.\n— Deel links naar specifieke berichten in kanalen via het contextmenu.\n— Onderteken berichten in kanalen.\n— Stuur 'stille berichten' in kanalen. Ideaal voor als je toch echt iets moet sturen in het holst van de nacht."; "lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index 2c92adab34..73e7314ec6 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -716,16 +716,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_group" = "Ver info do grupo"; "lng_context_view_channel" = "Ver info do canal"; -"lng_context_open_link" = "Abrir Link"; "lng_context_copy_link" = "Copiar Link"; "lng_context_copy_post_link" = "Copiar Link do Post"; -"lng_context_open_email" = "Escrever para este endereço"; "lng_context_copy_email" = "Copiar endereço de email"; -"lng_context_open_hashtag" = "Buscar pela hashtag"; "lng_context_copy_hashtag" = "Copiar hashtag"; -"lng_context_open_mention" = "Abrir perfil"; "lng_context_copy_mention" = "Copiar nome de usuário"; -"lng_context_open_image" = "Abrir Imagem"; "lng_context_save_image" = "Salvar Imagem Como.."; "lng_context_forward_image" = "Encaminhar Imagem"; "lng_context_delete_image" = "Apagar Imagem"; @@ -734,13 +729,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancelar Download"; "lng_context_show_in_folder" = "Mostrar na Pasta"; "lng_context_show_in_finder" = "Mostrar no Finder"; -"lng_context_open_video" = "Abrir Vídeo"; "lng_context_save_video" = "Salvar Vídeo Como.."; -"lng_context_open_audio" = "Abrir Áudio"; "lng_context_save_audio" = "Salvar Áudio Como.."; "lng_context_pack_info" = "Informação do pacote"; "lng_context_pack_add" = "Adicionar aos Stickers"; -"lng_context_open_file" = "Abrir Arquivo"; "lng_context_save_file" = "Salvar Arquivo Como.."; "lng_context_forward_file" = "Encaminhar Arquivo"; "lng_context_delete_file" = "Apagar Arquivo"; From 6fae60b6bb6325baab90e0b5755d9fa0b5704d20 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 16:00:48 +0300 Subject: [PATCH 129/316] fixed conversations list update on message edit --- Telegram/SourceFiles/app.cpp | 6 ++++++ Telegram/SourceFiles/mtproto/mtp.cpp | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index a96c182e7f..521f923ad6 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -931,6 +931,12 @@ namespace App { existing->updateMedia(m.has_media() ? (&m.vmedia) : 0, true); existing->setViewsCount(m.has_views() ? m.vviews.v : -1, false); existing->initDimensions(); + if (existing->history()->textCachedFor == existing) { + existing->history()->textCachedFor = 0; + } + if (App::main()) { + App::main()->dlgUpdated(existing->history(), existing->id); + } Notify::historyItemResized(existing); } } diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 6f443783c7..7b834ce511 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -531,7 +531,10 @@ namespace _mtp_internal { return; } } else { - if (h.onDone) (*h.onDone)(requestId, from, end); + if (h.onDone) { +// t_assert(App::app() != 0); + (*h.onDone)(requestId, from, end); + } } } catch (Exception &e) { if (!rpcErrorOccured(requestId, h, rpcClientError("RESPONSE_PARSE_FAILED", QString("exception text: ") + e.what()))) { From ade6b5aae0b77f6703fd08e432b65f9caab269e2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 16:10:57 +0300 Subject: [PATCH 130/316] version 0.9.28 --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/config.h | 6 +++--- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 2c17f7b831..a22be4e6bf 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1053,7 +1053,7 @@ void AppClass::checkMapVersion() { QString versionFeatures; if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9027) { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Edit your messages in channels and supergroups.\n\xe2\x80\x94 Share links to specific posts in channels via the post context menu.\n\xe2\x80\x94 Add admin signatures to messages in channels.\n\xe2\x80\x94 Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting.");// .replace('@', qsl("@") + QChar(0x200D)); - } else if (Local::oldMapVersion() < 9026) { + } else if (Local::oldMapVersion() < 9027) { versionFeatures = lang(lng_new_version_text).trimmed(); } else { versionFeatures = lang(lng_new_version_minor).trimmed(); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 7f9df339f7..e6f4801143 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9027; -static const wchar_t *AppVersionStr = L"0.9.27"; -static const bool DevVersion = true; +static const int32 AppVersion = 9028; +static const wchar_t *AppVersionStr = L"0.9.28"; +static const bool DevVersion = false; //#define BETA_VERSION (9026001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index a60467d8b6..cf5bb6c5ea 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.27 + 0.9.28 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 7afbfd1598..e93f790374 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,27,0 - PRODUCTVERSION 0,9,27,0 + FILEVERSION 0,9,28,0 + PRODUCTVERSION 0,9,28,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.27.0" + VALUE "FileVersion", "0.9.28.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.27.0" + VALUE "ProductVersion", "0.9.28.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 0b392f3d6f..0f6dbcf6da 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.27; + CURRENT_PROJECT_VERSION = 0.9.28; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.27; + CURRENT_PROJECT_VERSION = 0.9.28; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.27; + CURRENT_PROJECT_VERSION = 0.9.28; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.27; + DYLIB_CURRENT_VERSION = 0.9.28; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.27; + CURRENT_PROJECT_VERSION = 0.9.28; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.27; + DYLIB_CURRENT_VERSION = 0.9.28; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index add9a12a4f..3d7d55000c 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9027 +AppVersion 9028 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.27 -AppVersionStr 0.9.27 -DevChannel 1 +AppVersionStrSmall 0.9.28 +AppVersionStr 0.9.28 +DevChannel 0 BetaVersion 0 9026001 From f696263460bfeadbce3412c7d22aaefd5a680e26 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 17:41:09 +0300 Subject: [PATCH 131/316] limits for caption and description updated --- Telegram/SourceFiles/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index e6f4801143..ddf3f20e0f 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -142,9 +142,9 @@ enum { MaxUsernameLength = 32, UsernameCheckTimeout = 200, - MaxChannelDescription = 120, + MaxChannelDescription = 255, MaxGroupChannelTitle = 255, - MaxPhotoCaption = 140, + MaxPhotoCaption = 200, MaxMessageSize = 4096, MaxHttpRedirects = 5, // when getting external data/images From 9d9b4b83a1e57bd21985976e347d5f54bddf5285 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 19:49:31 +0300 Subject: [PATCH 132/316] improved build script, popupmenu separator adding --- Telegram/Build.sh | 20 ++++++++++---------- Telegram/SourceFiles/gui/popupmenu.cpp | 6 ++++++ Telegram/SourceFiles/gui/popupmenu.h | 1 + Telegram/SourceFiles/mtproto/generate.py | 2 -- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Telegram/Build.sh b/Telegram/Build.sh index c0efe0de8b..d2bbd2cd75 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -69,7 +69,7 @@ elif [ "$BuildTarget" == "macstore" ]; then echo "Building version $AppVersionStrFull for Mac App Store.." ReleasePath="./../Mac/Release" BinaryName="Telegram Desktop" - DropboxPath="./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" + DropboxPath="./../../../Dropbox/$BinaryName/deploy/$AppVersionStrMajor" DropboxDeployPath="$DropboxPath/$AppVersionStrFull" else echo "Invalid target!" @@ -109,7 +109,7 @@ fi if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then - DropboxSymbolsPath="/media/psf/Home/Dropbox/Telegram/symbols" + DropboxSymbolsPath="/media/psf/Home/Dropbox/$BinaryName/symbols" mkdir -p "$WorkPath/ReleaseIntermediateUpdater" cd "$WorkPath/ReleaseIntermediateUpdater" @@ -123,7 +123,7 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Telegram.pro" -r -spec linux-g++ eval "$FixScript" make - echo "Telegram build complete!" + echo "$BinaryName build complete!" cd "$HomePath" if [ ! -f "$ReleasePath/$BinaryName" ]; then echo "$BinaryName not found!" @@ -178,18 +178,18 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then echo "Copying $BinaryName, Updater and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStrFull.."; mkdir "$DeployPath" mkdir "$DeployPath/$BinaryName" - mv "$ReleasePath/$BinaryName" "$DeployPath/Telegram/" - mv "$ReleasePath/Updater" "$DeployPath/Telegram/" + mv "$ReleasePath/$BinaryName" "$DeployPath/$BinaryName/" + mv "$ReleasePath/Updater" "$DeployPath/$BinaryName/" mv "$ReleasePath/$UpdateFile" "$DeployPath/" if [ "$BetaVersion" != "0" ]; then mv "$ReleasePath/$BetaKeyFile" "$DeployPath/" fi - cd "$DeployPath" && tar -cJvf "$SetupFile" "Telegram/" && cd "./../../../$HomePath" + cd "$DeployPath" && tar -cJvf "$SetupFile" "$BinaryName/" && cd "./../../../$HomePath" fi if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then - DropboxSymbolsPath="./../../../Dropbox/Telegram/symbols" + DropboxSymbolsPath="./../../../Dropbox/$BinaryName/symbols" if [ "$FastParam" != "fast" ]; then touch "./SourceFiles/telegram.qrc" @@ -307,10 +307,10 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then echo "Copying $BinaryName.app and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStr.."; mkdir "$DeployPath" - mkdir "$DeployPath/Telegram" - cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/Telegram/" + mkdir "$DeployPath/$BinaryName" + cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/$BinaryName/" if [ "$BetaVersion" != "0" ]; then - cd "$DeployPath" && zip -r "$SetupFile" "Telegram" && mv "$SetupFile" "./../../../" && cd "./../../../$HomePath" + cd "$DeployPath" && zip -r "$SetupFile" "$BinaryName" && mv "$SetupFile" "./../../../" && cd "./../../../$HomePath" mv "$ReleasePath/$BetaKeyFile" "$DeployPath/" fi mv "$ReleasePath/$BinaryName.app.dSYM" "$DeployPath/" diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 035ada7e31..38c2d90566 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -103,6 +103,12 @@ QAction *PopupMenu::addAction(QAction *a) { return a; } +QAction *PopupMenu::addSeparator() { + QAction *separator = new QAction(this); + separator->setSeparator(true); + return addAction(separator); +} + int32 PopupMenu::processAction(QAction *a, int32 index, int32 w) { if (a->isSeparator() || a->text().isEmpty()) { _texts[index] = _shortcutTexts[index] = QString(); diff --git a/Telegram/SourceFiles/gui/popupmenu.h b/Telegram/SourceFiles/gui/popupmenu.h index 4d7968bfc9..64ff31fb6b 100644 --- a/Telegram/SourceFiles/gui/popupmenu.h +++ b/Telegram/SourceFiles/gui/popupmenu.h @@ -28,6 +28,7 @@ public: PopupMenu(QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu); QAction *addAction(const QString &text, const QObject *receiver, const char* member); QAction *addAction(QAction *a); + QAction *addSeparator(); void resetActions(); typedef QVector Actions; diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index 017eca81a6..de413ceae1 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -827,5 +827,3 @@ outCpp.write('\t}\n}\n'); outCpp.write(textSerializeFull + '\n'); print('Done, written {0} constructors, {1} functions.'.format(consts, funcs)); - -print('Done, written {0} constructors, {1} functions.'.format(consts, funcs)); From 12f3bb2082b8a5d5376dda30979080e0e8cd3531 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Feb 2016 22:13:18 +0300 Subject: [PATCH 133/316] build script fixed for appstore version --- Telegram/Build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/Build.sh b/Telegram/Build.sh index d2bbd2cd75..650e3692ba 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -69,7 +69,7 @@ elif [ "$BuildTarget" == "macstore" ]; then echo "Building version $AppVersionStrFull for Mac App Store.." ReleasePath="./../Mac/Release" BinaryName="Telegram Desktop" - DropboxPath="./../../../Dropbox/$BinaryName/deploy/$AppVersionStrMajor" + DropboxPath="./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" DropboxDeployPath="$DropboxPath/$AppVersionStrFull" else echo "Invalid target!" @@ -109,7 +109,7 @@ fi if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then - DropboxSymbolsPath="/media/psf/Home/Dropbox/$BinaryName/symbols" + DropboxSymbolsPath="/media/psf/Home/Dropbox/Telegram/symbols" mkdir -p "$WorkPath/ReleaseIntermediateUpdater" cd "$WorkPath/ReleaseIntermediateUpdater" @@ -189,7 +189,7 @@ fi if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then - DropboxSymbolsPath="./../../../Dropbox/$BinaryName/symbols" + DropboxSymbolsPath="./../../../Dropbox/Telegram/symbols" if [ "$FastParam" != "fast" ]; then touch "./SourceFiles/telegram.qrc" From bd26a352fd5ceb1675fd34fddd838a5dc96d1c04 Mon Sep 17 00:00:00 2001 From: Mathi Fonseca Date: Fri, 26 Feb 2016 17:51:59 -0300 Subject: [PATCH 134/316] fixed ellipses dots. should be 3, not 2 --- Telegram/Resources/lang.strings | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 387bdd0d77..678298a397 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -86,8 +86,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cancel" = "Cancel"; "lng_continue" = "Continue"; "lng_close" = "Close"; -"lng_connecting" = "Connecting.."; -"lng_reconnecting" = "Reconnect {count:now|in # s|in # s}.."; +"lng_connecting" = "Connecting..."; +"lng_reconnecting" = "Reconnect {count:now|in # s|in # s}..."; "lng_reconnecting_try_now" = "Try now"; "lng_status_service_notifications" = "service notifications"; @@ -108,7 +108,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_status_lastseen_date" = "last seen {date}"; "lng_status_lastseen_date_time" = "last seen {date} at {time}"; "lng_status_online" = "online"; -"lng_status_connecting" = "connecting.."; +"lng_status_connecting" = "connecting..."; "lng_chat_status_unaccessible" = "group is unaccessible"; "lng_chat_status_members" = "{count:no members|# member|# members}"; @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "This message was deleted"; "lng_edit_too_long" = "Your message text is too long"; "lng_edit_message" = "Edit message"; -"lng_edit_message_text" = "New message text.."; +"lng_edit_message_text" = "New message text..."; "lng_deleted" = "Unknown"; "lng_deleted_message" = "Deleted message"; @@ -156,7 +156,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_code_telegram" = "Please enter the code you've just\nreceived in your previous [b]Telegram[/b] app."; "lng_code_no_telegram" = "Send code via SMS"; "lng_code_call" = "Telegram will dial your number in {minutes}:{seconds}"; -"lng_code_calling" = "Requesting a call from Telegram.."; +"lng_code_calling" = "Requesting a call from Telegram..."; "lng_code_called" = "Telegram dialed your number"; "lng_bad_phone" = "Invalid phone number. Please try again."; @@ -195,7 +195,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "Channel name"; "lng_no_contacts" = "You have no contacts"; "lng_no_chats" = "Your chats will be here"; -"lng_contacts_loading" = "Loading.."; +"lng_contacts_loading" = "Loading..."; "lng_contacts_not_found" = "No contacts found"; "lng_dlg_search_chat" = "Search in this chat"; "lng_dlg_search_channel" = "Search in this channel"; @@ -204,7 +204,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Save"; "lng_settings_upload" = "Set Profile Photo"; "lng_settings_crop_profile" = "Select a square area for your profile photo"; -"lng_settings_uploading_photo" = "Uploading photo.."; +"lng_settings_uploading_photo" = "Uploading photo..."; "lng_username_title" = "Username"; "lng_username_about" = "You can choose a username on Telegram.\nIf you do, other people will be able to find\nyou by this username and contact you\nwithout knowing your phone number.\n\nYou can use a-z, 0-9 and underscores.\nMinimum length is 5 characters."; @@ -241,9 +241,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "Update automatically"; "lng_settings_current_version" = "Version {version}"; "lng_settings_check_now" = "Check for updates"; -"lng_settings_update_checking" = "Checking for updates.."; +"lng_settings_update_checking" = "Checking for updates..."; "lng_settings_latest_installed" = "Latest version is installed"; -"lng_settings_downloading" = "Downloading update {ready} / {total} MB.."; +"lng_settings_downloading" = "Downloading update {ready} / {total} MB..."; "lng_settings_update_ready" = "New version is ready"; "lng_settings_update_now" = "Restart Now"; "lng_settings_update_fail" = "Update check failed :("; @@ -285,7 +285,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "File download could not be started. It could happen because of a bad download location.\n\nYou can change download path in Settings."; "lng_download_path_settings" = "Settings"; "lng_download_finish_failed" = "File download could not be finished.\n\nWould you like to try again?"; -"lng_download_path_clearing" = "Clearing.."; +"lng_download_path_clearing" = "Clearing..."; "lng_download_path_cleared" = "Cleared!"; "lng_download_path_clear_failed" = "Clear failed :("; @@ -294,7 +294,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|# image|# images}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|# voice message|# voice messages}, {size}"; "lng_local_storage_clear" = "Clear all"; -"lng_local_storage_clearing" = "Clearing.."; +"lng_local_storage_clearing" = "Clearing..."; "lng_local_storage_cleared" = "Cleared!"; "lng_local_storage_clear_failed" = "Clear failed :("; @@ -325,7 +325,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_passcode_logout" = "Log out"; "lng_passcode_need_unblock" = "You need to unlock me first."; -"lng_cloud_password_waiting" = "Confirmation link sent to {email}.."; +"lng_cloud_password_waiting" = "Confirmation link sent to {email}..."; "lng_cloud_password_change" = "Change cloud password"; "lng_cloud_password_create" = "Cloud password"; "lng_cloud_password_remove" = "Remove cloud password"; @@ -352,9 +352,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "Password was not changed"; "lng_connection_type" = "Connection type:"; -"lng_connection_auto_connecting" = "Default (connecting..)"; +"lng_connection_auto_connecting" = "Default (connecting...)"; "lng_connection_auto" = "Default ({transport} used)"; -"lng_connection_proxy_connecting" = "Connecting through proxy.."; +"lng_connection_proxy_connecting" = "Connecting through proxy..."; "lng_connection_proxy" = "{transport} with proxy"; "lng_connection_header" = "Connection type"; "lng_connection_auto_rb" = "Auto (TCP if available or HTTP)"; @@ -390,7 +390,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_sessions_other_desc" = "You can log in to Telegram from other mobile, tablet and desktop devices, using the same phone number. All your data will be instantly synchronized."; "lng_sessions_terminate_all" = "Terminate all other sessions"; -"lng_preview_loading" = "Getting Link Info.."; +"lng_preview_loading" = "Getting Link Info..."; "lng_profile_chat_unaccessible" = "Group is unaccessible"; "lng_topbar_info" = "Info"; @@ -432,7 +432,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "Remove {user} from the group?"; "lng_profile_sure_kick_channel" = "Remove {user} from the channel?"; "lng_profile_sure_kick_admin" = "Remove {user} from administrators?"; -"lng_profile_loading" = "Loading.."; +"lng_profile_loading" = "Loading..."; "lng_profile_shared_media" = "Shared media"; "lng_profile_no_media" = "No media in this conversation."; "lng_profile_photos" = "{count:_not_used_|# photo|# photos} »"; @@ -627,7 +627,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_remove" = "Delete"; "lng_stickers_return" = "Undo"; "lng_stickers_restore" = "Restore"; -"lng_stickers_count" = "{count:Loading..|# sticker|# stickers}"; +"lng_stickers_count" = "{count:Loading...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Photo"; "lng_in_dlg_video" = "Video"; @@ -652,10 +652,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; "lng_send_button" = "Send"; -"lng_message_ph" = "Write a message.."; -"lng_comment_ph" = "Write a comment.."; -"lng_broadcast_ph" = "Broadcast a message.."; -"lng_broadcast_silent_ph" = "Silent broadcast.."; +"lng_message_ph" = "Write a message..."; +"lng_comment_ph" = "Write a comment..."; +"lng_broadcast_ph" = "Broadcast a message..."; +"lng_broadcast_silent_ph" = "Silent broadcast..."; "lng_record_cancel" = "Release outside this field to cancel"; "lng_will_be_notified" = "Members will be notified when you post"; "lng_wont_be_notified" = "Members will not be notified when you post"; @@ -721,7 +721,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "Copy email address"; "lng_context_copy_hashtag" = "Copy hashtag"; "lng_context_copy_mention" = "Copy username"; -"lng_context_save_image" = "Save Image As.."; +"lng_context_save_image" = "Save Image As..."; "lng_context_forward_image" = "Forward Image"; "lng_context_delete_image" = "Delete Image"; "lng_context_copy_image" = "Copy Image"; @@ -729,11 +729,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancel Download"; "lng_context_show_in_folder" = "Show in Folder"; "lng_context_show_in_finder" = "Show in Finder"; -"lng_context_save_video" = "Save Video As.."; -"lng_context_save_audio" = "Save Audio As.."; +"lng_context_save_video" = "Save Video As..."; +"lng_context_save_audio" = "Save Audio As..."; "lng_context_pack_info" = "Pack Info"; "lng_context_pack_add" = "Add Stickers"; -"lng_context_save_file" = "Save File As.."; +"lng_context_save_file" = "Save File As..."; "lng_context_forward_file" = "Forward File"; "lng_context_delete_file" = "Delete File"; "lng_context_close_file" = "Close File"; @@ -758,7 +758,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Could not send a file, because it is larger than 1.5 GB :("; "lng_send_folder" = "Could not send «{name}» because it is a directory :("; -"lng_forward_choose" = "Choose recipient.."; +"lng_forward_choose" = "Choose recipient..."; "lng_forward_cant" = "Sorry, no way to forward here :("; "lng_forward_confirm" = "Forward to {recipient}?"; "lng_forward_share_contact" = "Share contact to {recipient}?"; @@ -821,7 +821,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_search_global_results" = "Global search results"; "lng_media_save_progress" = "{ready} of {total} {mb}"; -"lng_mediaview_save_as" = "Save As.."; +"lng_mediaview_save_as" = "Save As..."; "lng_mediaview_copy" = "Copy"; "lng_mediaview_forward" = "Forward"; "lng_mediaview_delete" = "Delete"; From abaf74a886777032f33300443366290788e1a0e3 Mon Sep 17 00:00:00 2001 From: Mathi Fonseca Date: Fri, 26 Feb 2016 17:53:08 -0300 Subject: [PATCH 135/316] improved grammar in english lang --- Telegram/Resources/lang.strings | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 678298a397..98830ecb3d 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -684,21 +684,21 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_users_typing" = "{user} and {second_user} are typing"; "lng_many_typing" = "{count:_not_used_|# is|# are} typing"; "lng_send_action_record_video" = "recording video"; -"lng_user_action_record_video" = "{user} is recording video"; +"lng_user_action_record_video" = "{user} is recording a video"; "lng_send_action_upload_video" = "sending video"; -"lng_user_action_upload_video" = "{user} is sending video"; +"lng_user_action_upload_video" = "{user} is sending a video"; "lng_send_action_record_audio" = "recording audio"; -"lng_user_action_record_audio" = "{user} is recording audio"; +"lng_user_action_record_audio" = "{user} is recording an audio"; "lng_send_action_upload_audio" = "sending audio"; -"lng_user_action_upload_audio" = "{user} is sending audio"; +"lng_user_action_upload_audio" = "{user} is sending an audio"; "lng_send_action_upload_photo" = "sending photo"; -"lng_user_action_upload_photo" = "{user} is sending photo"; +"lng_user_action_upload_photo" = "{user} is sending a photo"; "lng_send_action_upload_file" = "sending file"; -"lng_user_action_upload_file" = "{user} is sending file"; +"lng_user_action_upload_file" = "{user} is sending a file"; "lng_send_action_geo_location" = "picking location"; -"lng_user_action_geo_location" = "{user} is picking location"; +"lng_user_action_geo_location" = "{user} is picking a location"; "lng_send_action_choose_contact" = "choosing contact"; -"lng_user_action_choose_contact" = "{user} is choosing contact"; +"lng_user_action_choose_contact" = "{user} is choosing a contact"; "lng_unread_bar" = "{count:_not_used_|# unread message|# unread messages}"; "lng_maps_point" = "Location"; From 9eee689a76cf810d78b8c6d76756fac82445e38a Mon Sep 17 00:00:00 2001 From: auchri Date: Fri, 26 Feb 2016 22:25:56 +0100 Subject: [PATCH 136/316] Rebase instead of merge It's better to rebase a pull request instead of merging the latest commits Signed-off-by: Christoph Auer --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68c80c0a70..35cf65c822 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,9 +89,13 @@ Check the log to be sure that you actually want the changes, before merging: git log upstream/master -Then merge the changes that you fetched: +Then rebase your changes on the latest commits in the `master` branch: - git merge upstream/master + git rebase upstream/master + +After that, you have to force push your commits: + + git push --force For more info, see [GitHub Help][help_fork_repo]. From a385c637995d7e5f46cc46f824f33a210c04a027 Mon Sep 17 00:00:00 2001 From: auchri Date: Wed, 24 Feb 2016 20:59:13 +0100 Subject: [PATCH 137/316] Fix link in CONTRIBUTING.md Signed-off-by: Christoph Auer --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68c80c0a70..c37c3d8916 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ For more info, see [GitHub Help][help_change_commit_message]. ## Build instructions -See the [readme][README.md#build-instructions] for details on the various build +See the [README.md](README.md#build-instructions) for details on the various build environments. ## Pull upstream changes into your fork regularly From 175968c3c096c48d1fc003448d519ba39755401a Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 27 Feb 2016 14:44:47 +0300 Subject: [PATCH 138/316] active muted unread count uses different color --- Telegram/Resources/style.txt | 1 + Telegram/SourceFiles/history.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 015fb86da7..8d9dd68e6a 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -955,6 +955,7 @@ dlgActiveUnreadColor: #5b94bf; dlgActiveUnreadBG: white; dlgActiveColor: white; dlgActiveDateColor: #d3e2ee; +dlgActiveUnreadMutedBG: dlgActiveDateColor; topBarHeight: 54px; topBarBG: white; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 3dd6a40d1e..4dd68f6bfc 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -175,7 +175,7 @@ void DialogRow::paint(Painter &p, int32 w, bool act, bool sel, bool onlyBackgrou int32 unreadRectLeft = w - st::dlgPaddingHor - unreadRectWidth; int32 unreadRectTop = st::dlgHeight - st::dlgPaddingVer - unreadRectHeight; lastWidth -= unreadRectWidth + st::dlgUnreadPaddingHor; - p.setBrush((act ? st::dlgActiveUnreadBG : (history->mute ? st::dlgUnreadMutedBG : st::dlgUnreadBG))->b); + p.setBrush((act ? (history->mute ? st::dlgActiveUnreadMutedBG : st::dlgActiveUnreadBG) : (history->mute ? st::dlgUnreadMutedBG : st::dlgUnreadBG))->b); p.setPen(Qt::NoPen); p.drawRoundedRect(unreadRectLeft, unreadRectTop, unreadRectWidth, unreadRectHeight, st::dlgUnreadRadius, st::dlgUnreadRadius); p.setFont(st::dlgUnreadFont->f); From a88b6765884af6fdbbfb1714990d0cc88e9649a9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 27 Feb 2016 22:39:51 +0300 Subject: [PATCH 139/316] global shortcuts with loading from .json map --- Telegram/SourceFiles/application.cpp | 61 ++++-------------- Telegram/SourceFiles/config.h | 2 + Telegram/SourceFiles/gui/twidget.cpp | 5 ++ Telegram/SourceFiles/gui/twidget.h | 2 + Telegram/SourceFiles/historywidget.cpp | 88 +++++++++++--------------- Telegram/SourceFiles/historywidget.h | 4 ++ Telegram/SourceFiles/localstorage.cpp | 4 +- Telegram/SourceFiles/mainwidget.cpp | 14 +++- Telegram/SourceFiles/mainwidget.h | 4 ++ Telegram/SourceFiles/pspecific_wnd.cpp | 1 + Telegram/SourceFiles/stdafx.h | 11 +--- Telegram/SourceFiles/sysbuttons.cpp | 10 +-- Telegram/SourceFiles/sysbuttons.h | 1 - Telegram/SourceFiles/types.cpp | 4 +- Telegram/SourceFiles/types.h | 10 ++- Telegram/SourceFiles/window.cpp | 12 ++-- Telegram/Telegram.pro | 2 + Telegram/Telegram.vcxproj | 2 + Telegram/Telegram.vcxproj.filters | 6 ++ 19 files changed, 116 insertions(+), 127 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index a22be4e6bf..e128cb5eb8 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -22,6 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" #include "style.h" +#include "shortcuts.h" + #include "pspecific.h" #include "fileuploader.h" #include "mainwidget.h" @@ -47,52 +49,6 @@ namespace { } } - class EventFilterForKeys : public QObject { - public: - - EventFilterForKeys(QObject *parent) : QObject(parent) { - } - bool eventFilter(QObject *o, QEvent *e) { - if (e->type() == QEvent::KeyPress) { - QKeyEvent *ev = static_cast(e); - if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { - if (ev->key() == Qt::Key_W && (ev->modifiers() & Qt::ControlModifier)) { - Ui::hideWindowNoQuit(); - return true; - } else if (ev->key() == Qt::Key_M && (ev->modifiers() & Qt::ControlModifier)) { - App::wnd()->setWindowState(Qt::WindowMinimized); - return true; - } - } else { - if ((ev->key() == Qt::Key_W || ev->key() == Qt::Key_F4) && (ev->modifiers() & Qt::ControlModifier)) { - if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { - App::wnd()->minimizeToTray(); - return true; - } else { - App::wnd()->close(); - return true; - } - } - } - if (ev->key() == Qt::Key_MediaPlay) { - if (App::main()) App::main()->player()->playPressed(); - } else if (ev->key() == Qt::Key_MediaPause) { - if (App::main()) App::main()->player()->pausePressed(); - } else if (ev->key() == Qt::Key_MediaTogglePlayPause) { - if (App::main()) App::main()->player()->playPausePressed(); - } else if (ev->key() == Qt::Key_MediaStop) { - if (App::main()) App::main()->player()->stopPressed(); - } else if (ev->key() == Qt::Key_MediaPrevious) { - if (App::main()) App::main()->player()->prevPressed(); - } else if (ev->key() == Qt::Key_MediaNext) { - if (App::main()) App::main()->player()->nextPressed(); - } - } - return QObject::eventFilter(o, e); - } - - }; - QChar _toHex(ushort v) { v = v & 0x000F; return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v)); @@ -708,8 +664,6 @@ AppClass::AppClass() : QObject() return; } - application()->installEventFilter(new EventFilterForKeys(this)); - if (cRetina()) { cSetConfigScale(dbisOne); cSetRealScale(dbisOne); @@ -767,6 +721,8 @@ AppClass::AppClass() : QObject() DEBUG_LOG(("Application Info: window created..")); + Shortcuts::start(); + initImageLinkManager(); App::initMedia(); @@ -807,6 +763,13 @@ AppClass::AppClass() : QObject() } _window->updateIsActive(Global::OnlineFocusTimeout()); + + if (!Shortcuts::errors().isEmpty()) { + const QStringList &errors(Shortcuts::errors()); + for (QStringList::const_iterator i = errors.cbegin(), e = errors.cend(); i != e; ++i) { + LOG(("Shortcuts Error: %1").arg(*i)); + } + } } void AppClass::regPhotoUpdate(const PeerId &peer, const FullMsgId &msgId) { @@ -1070,6 +1033,8 @@ void AppClass::checkMapVersion() { } AppClass::~AppClass() { + Shortcuts::finish(); + if (Window *w = _window) { _window = 0; delete w; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index ddf3f20e0f..2490993ad9 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -129,6 +129,8 @@ enum { MaxZoomLevel = 7, // x8 ZoomToScreenLevel = 1024, // just constant + ShortcutsCountLimit = 256, // how many shortcuts can be in json file + PreloadHeightsCount = 3, // when 3 screens to scroll left make a preload request EmojiPanPerRow = 7, EmojiPanRowsPerPage = 6, diff --git a/Telegram/SourceFiles/gui/twidget.cpp b/Telegram/SourceFiles/gui/twidget.cpp index 6631a1fa58..eced0da475 100644 --- a/Telegram/SourceFiles/gui/twidget.cpp +++ b/Telegram/SourceFiles/gui/twidget.cpp @@ -21,6 +21,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "stdafx.h" #include "application.h" +#include "window.h" namespace Fonts { @@ -52,6 +53,10 @@ namespace { } } +bool TWidget::inFocusChain() const { + return !isHidden() && App::wnd() && (App::wnd()->focusWidget() == this || isAncestorOf(App::wnd()->focusWidget())); +} + void myEnsureResized(QWidget *target) { if (target && (target->testAttribute(Qt::WA_PendingResizeEvent) || !target->testAttribute(Qt::WA_WState_Created))) { _sendResizeEvents(target); diff --git a/Telegram/SourceFiles/gui/twidget.h b/Telegram/SourceFiles/gui/twidget.h index f627ad349b..ad839e7016 100644 --- a/Telegram/SourceFiles/gui/twidget.h +++ b/Telegram/SourceFiles/gui/twidget.h @@ -183,6 +183,8 @@ public: virtual void grabFinish() { } + bool inFocusChain() const; + private: }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 6bdc9c72a1..91b027d791 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2612,7 +2612,7 @@ void SilentToggle::leaveEvent(QEvent *e) { void SilentToggle::mouseReleaseEvent(QMouseEvent *e) { FlatCheckbox::mouseReleaseEvent(e); PopupTooltip::Show(0, this); - PeerData *p = App::main() ? App::main()->peer() : Nil; + PeerData *p = App::main() ? App::main()->peer() : nullptr; if (p && p->isChannel() && p->notify != UnknownNotifySettings) { App::main()->updateNotifySetting(p, NotifySettingDontChange, checked() ? SilentNotifiesSetSilent : SilentNotifiesSetNotify); } @@ -2979,7 +2979,7 @@ void HistoryWidget::onDraftSave(bool delayed) { return _saveDraftTimer.start(SaveDraftTimeout); } } - writeDrafts(Nil, Nil); + writeDrafts(nullptr, nullptr); } void HistoryWidget::writeDrafts(HistoryDraft **msgDraft, HistoryEditDraft **editDraft) { @@ -3228,6 +3228,26 @@ void HistoryWidget::notify_historyItemResized(const HistoryItem *row, bool scrol updateListSize(0, false, false, row, scrollToIt); } +void HistoryWidget::cmd_search() { + if (!inFocusChain() || !_peer) return; + + App::main()->searchInPeer(_peer); +} + +void HistoryWidget::cmd_next_chat() { + PeerData *p = 0; + MsgId m = 0; + App::main()->peerAfter(_peer, qMax(_showAtMsgId, 0), p, m); + if (p) Ui::showPeerHistory(p, m); +} + +void HistoryWidget::cmd_previous_chat() { + PeerData *p = 0; + MsgId m = 0; + App::main()->peerBefore(_peer, qMax(_showAtMsgId, 0), p, m); + if (p) Ui::showPeerHistory(p, m); +} + void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) { cSetLastStickersUpdate(getms(true)); _stickersUpdateRequest = 0; @@ -3546,13 +3566,13 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re if (_replyToId || !_field.getLastText().isEmpty()) { _history->setMsgDraft(new HistoryDraft(_field, _replyToId, _previewCancelled)); } else { - _history->setMsgDraft(Nil); + _history->setMsgDraft(nullptr); } - _history->setEditDraft(Nil); + _history->setEditDraft(nullptr); } if (_migrated) { - _migrated->setMsgDraft(Nil); // use migrated draft only once - _migrated->setEditDraft(Nil); + _migrated->setMsgDraft(nullptr); // use migrated draft only once + _migrated->setEditDraft(nullptr); } writeDrafts(&_history->msgDraft, &_history->editDraft); @@ -3666,14 +3686,14 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re Local::readDraftsWithCursors(_history); if (_migrated) { Local::readDraftsWithCursors(_migrated); - _migrated->setEditDraft(Nil); + _migrated->setEditDraft(nullptr); if (_migrated->msgDraft && !_migrated->msgDraft->text.isEmpty()) { _migrated->msgDraft->msgId = 0; // edit and reply to drafts can't migrate if (!_history->msgDraft) { _history->setMsgDraft(new HistoryDraft(*_migrated->msgDraft)); } } - _migrated->setMsgDraft(Nil); + _migrated->setMsgDraft(nullptr); } applyDraft(false); @@ -4581,7 +4601,7 @@ void HistoryWidget::saveEditMsgDone(History *history, const MTPUpdates &updates, cancelEdit(); } if (history->editDraft && history->editDraft->saveRequest == req) { - history->setEditDraft(Nil); + history->setEditDraft(nullptr); writeDrafts(history); } } @@ -6520,59 +6540,23 @@ void HistoryWidget::mousePressEvent(QMouseEvent *e) { void HistoryWidget::keyPressEvent(QKeyEvent *e) { if (!_history) return; - MsgId msgid = qMax(_showAtMsgId, 0); if (e->key() == Qt::Key_Escape) { e->ignore(); } else if (e->key() == Qt::Key_Back) { Ui::showChatsList(); emit cancelled(); } else if (e->key() == Qt::Key_PageDown) { - if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::MetaModifier)) { - PeerData *after = 0; - MsgId afterMsgId = 0; - App::main()->peerAfter(_peer, msgid, after, afterMsgId); - if (after) Ui::showPeerHistory(after, afterMsgId); - } else { - _scroll.keyPressEvent(e); - } + _scroll.keyPressEvent(e); } else if (e->key() == Qt::Key_PageUp) { - if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::MetaModifier)) { - PeerData *before = 0; - MsgId beforeMsgId = 0; - App::main()->peerBefore(_peer, msgid, before, beforeMsgId); - if (before) Ui::showPeerHistory(before, beforeMsgId); - } else { - _scroll.keyPressEvent(e); - } + _scroll.keyPressEvent(e); } else if (e->key() == Qt::Key_Down) { - if (e->modifiers() & Qt::AltModifier) { - PeerData *after = 0; - MsgId afterMsgId = 0; - App::main()->peerAfter(_peer, msgid, after, afterMsgId); - if (after) Ui::showPeerHistory(after, afterMsgId); - } else if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) { + if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) { _scroll.keyPressEvent(e); } } else if (e->key() == Qt::Key_Up) { - if (e->modifiers() & Qt::AltModifier) { - PeerData *before = 0; - MsgId beforeMsgId = 0; - App::main()->peerBefore(_peer, msgid, before, beforeMsgId); - if (before) Ui::showPeerHistory(before, beforeMsgId); - } else if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) { + if (!(e->modifiers() & (Qt::ShiftModifier | Qt::MetaModifier | Qt::ControlModifier))) { _scroll.keyPressEvent(e); } - } else if ((e->key() == Qt::Key_Tab || e->key() == Qt::Key_Backtab) && ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::MetaModifier))) { - PeerData *p = 0; - MsgId m = 0; - if ((e->modifiers() & Qt::ShiftModifier) || e->key() == Qt::Key_Backtab) { - App::main()->peerBefore(_peer, msgid, p, m); - } else { - App::main()->peerAfter(_peer, msgid, p, m); - } - if (p) Ui::showPeerHistory(p, m); - } else if (_history && (e->key() == Qt::Key_Search || e == QKeySequence::Find)) { - App::main()->searchInPeer(_peer); } else { e->ignore(); } @@ -6902,7 +6886,7 @@ void HistoryWidget::onEditMessage() { if (_replyToId || !_field.getLastText().isEmpty()) { _history->setMsgDraft(new HistoryDraft(_field, _replyToId, _previewCancelled)); } else { - _history->setMsgDraft(Nil); + _history->setMsgDraft(nullptr); } QString text(textApplyEntities(to->originalText(), to->originalEntities())); @@ -6966,7 +6950,7 @@ void HistoryWidget::cancelReply(bool lastKeyboardUsed) { update(); } else if (wasReply) { if (_history->msgDraft->text.isEmpty()) { - _history->setMsgDraft(Nil); + _history->setMsgDraft(nullptr); } else { _history->msgDraft->msgId = 0; } @@ -6988,7 +6972,7 @@ void HistoryWidget::cancelEdit() { _editMsgId = 0; _replyEditMsg = 0; - _history->setEditDraft(Nil); + _history->setEditDraft(nullptr); applyDraft(); if (_saveEditMsgRequestId) { diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index b263760363..2a4b49fe95 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -596,6 +596,10 @@ public: void notify_clipStopperHidden(ClipStopperType type); void notify_historyItemResized(const HistoryItem *item, bool scrollToIt); + void cmd_search(); + void cmd_next_chat(); + void cmd_previous_chat(); + ~HistoryWidget(); signals: diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index fb5ed2fbda..9764cad672 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -2352,12 +2352,12 @@ namespace Local { _readDraftCursors(peer, msgCursor, editCursor); if (msgText.isEmpty() && !msgReplyTo) { - h->setMsgDraft(Nil); + h->setMsgDraft(nullptr); } else { h->setMsgDraft(new HistoryDraft(msgText, msgReplyTo, msgCursor, msgPreviewCancelled)); } if (!editMsgId) { - h->setEditDraft(Nil); + h->setEditDraft(nullptr); } else { h->setEditDraft(new HistoryEditDraft(editText, editMsgId, editCursor, editPreviewCancelled)); } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 6df869b326..6c588c6194 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -517,7 +517,7 @@ bool MainWidget::onShareUrl(const PeerId &peer, const QString &url, const QStrin } History *h = App::history(peer); h->setMsgDraft(new HistoryDraft(url + '\n' + text, 0, MessageCursor(url.size() + 1, url.size() + 1 + text.size(), QFIXED_MAX), false)); - h->setEditDraft(Nil); + h->setEditDraft(nullptr); bool opened = history.peer() && (history.peer()->id == peer); if (opened) { history.applyDraft(); @@ -812,6 +812,18 @@ void MainWidget::notify_automaticLoadSettingsChangedGif() { history.notify_automaticLoadSettingsChangedGif(); } +void MainWidget::cmd_search() { + history.cmd_search(); +} + +void MainWidget::cmd_next_chat() { + history.cmd_next_chat(); +} + +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); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index ce45674f00..7f417acbc0 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -435,6 +435,10 @@ public: void notify_historyItemLayoutChanged(const HistoryItem *item); void notify_automaticLoadSettingsChangedGif(); + void cmd_search(); + void cmd_next_chat(); + void cmd_previous_chat(); + ~MainWidget(); signals: diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index ce6173b801..02077ba674 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -620,6 +620,7 @@ namespace { case WM_CLOSE: App::wnd()->close(); break; + case WM_NCHITTEST: { int32 xPos = GET_X_LPARAM(lParam), yPos = GET_Y_LPARAM(lParam); switch (i) { diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index b9d77d66ba..22bc151150 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -20,7 +20,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #define __HUGE #define PSAPI_VERSION 1 // fix WinXP -//#define Q_NO_TEMPLATE_FRIENDS // fix some compiler difference issues #define __STDC_FORMAT_MACROS // fix breakpad for mac @@ -38,15 +37,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #ifdef Q_OS_WIN // use Lzma SDK for win #include diff --git a/Telegram/SourceFiles/sysbuttons.cpp b/Telegram/SourceFiles/sysbuttons.cpp index 44fd04ef59..9a61c847dd 100644 --- a/Telegram/SourceFiles/sysbuttons.cpp +++ b/Telegram/SourceFiles/sysbuttons.cpp @@ -22,9 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "style.h" #include "lang.h" +#include "shortcuts.h" + #include "sysbuttons.h" -#include "passcodewidget.h" -#include "window.h" #include "application.h" #include "autoupdater.h" @@ -166,9 +166,5 @@ LockBtn::LockBtn(QWidget *parent, Window *window) : SysBtn(parent, st::sysLock), } void LockBtn::onClick() { - if (App::passcoded()) { - App::wnd()->passcodeWidget()->onSubmit(); - } else { - App::wnd()->setupPasscode(true); - } + Shortcuts::launch(qsl("lock_telegram")); } diff --git a/Telegram/SourceFiles/sysbuttons.h b/Telegram/SourceFiles/sysbuttons.h index db6e2ed897..6cbc284a49 100644 --- a/Telegram/SourceFiles/sysbuttons.h +++ b/Telegram/SourceFiles/sysbuttons.h @@ -20,7 +20,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -#include #include "gui/animation.h" #include "gui/button.h" diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 0b16ead7f2..231b9bdf39 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -35,7 +35,9 @@ uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; // Base types compile-time check -NilPointer Nil; +#ifdef TDESKTOP_CUSTOM_NULLPTR +NullPointerClass nullptr; +#endif namespace { template diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 00ef2c51f0..2814ce5ccb 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -36,7 +36,12 @@ T *exchange(T *&ptr) { struct NullType { }; -class NilPointer { +#if __cplusplus < 199711L +#define TDESKTOP_CUSTOM_NULLPTR +#endif + +#ifdef TDESKTOP_CUSTOM_NULLPTR +class NullPointerClass { public: template operator T*() const { @@ -50,7 +55,8 @@ public: private: void operator&() const; }; -extern NilPointer Nil; +extern NullPointerClass nullptr; +#endif template class OrderedSet : public QMap { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index cead63ab7a..6817c6ac5a 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -22,6 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "style.h" #include "lang.h" +#include "shortcuts.h" + #include "window.h" #include "application.h" @@ -1008,8 +1010,8 @@ QRect Window::iconRect() const { return QRect(st::titleIconPos + title->geometry().topLeft(), st::titleIconImg.pxSize()); } -bool Window::eventFilter(QObject *obj, QEvent *evt) { - QEvent::Type t = evt->type(); +bool Window::eventFilter(QObject *obj, QEvent *e) { + QEvent::Type t = e->type(); if (t == QEvent::MouseButtonPress || t == QEvent::KeyPress || t == QEvent::TouchBegin || t == QEvent::Wheel) { psUserActionDone(); } else if (t == QEvent::MouseMove) { @@ -1019,13 +1021,15 @@ bool Window::eventFilter(QObject *obj, QEvent *evt) { } } else if (t == QEvent::MouseButtonRelease) { Ui::hideStickerPreview(); + } else if (t == QEvent::Shortcut) { + Shortcuts::launch(static_cast(e)->shortcutId()); } if (obj == Application::instance()) { if (t == QEvent::ApplicationActivate) { psUserActionDone(); QTimer::singleShot(1, this, SLOT(checkHistoryActivation())); } else if (t == QEvent::FileOpen) { - QString url = static_cast(evt)->url().toEncoded(); + QString url = static_cast(e)->url().toEncoded(); if (!url.trimmed().midRef(0, 5).compare(qsl("tg://"), Qt::CaseInsensitive)) { cSetStartUrl(url); if (!cStartUrl().isEmpty() && App::main() && App::self()) { @@ -1043,7 +1047,7 @@ bool Window::eventFilter(QObject *obj, QEvent *evt) { psUpdatedPosition(); } } - return PsMainWindow::eventFilter(obj, evt); + return PsMainWindow::eventFilter(obj, e); } void Window::mouseMoveEvent(QMouseEvent *e) { diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 4ff476e8b3..3ea1905073 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -108,6 +108,7 @@ SOURCES += \ ./SourceFiles/mainwidget.cpp \ ./SourceFiles/settings.cpp \ ./SourceFiles/settingswidget.cpp \ + ./SourceFiles/shortcuts.cpp \ ./SourceFiles/structs.cpp \ ./SourceFiles/sysbuttons.cpp \ ./SourceFiles/title.cpp \ @@ -197,6 +198,7 @@ HEADERS += \ ./SourceFiles/mainwidget.h \ ./SourceFiles/settings.h \ ./SourceFiles/settingswidget.h \ + ./SourceFiles/shortcuts.h \ ./SourceFiles/structs.h \ ./SourceFiles/style.h \ ./SourceFiles/sysbuttons.h \ diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 16a8dc9350..6f0ffc6536 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -1043,6 +1043,7 @@ + Create Create @@ -1060,6 +1061,7 @@ + diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index ddc386b0a0..3c80ea71f0 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -906,6 +906,9 @@ ThirdParty\minizip + + Source Files + @@ -1004,6 +1007,9 @@ ThirdParty\minizip + + Source Files + From bfa8075acf6c18c7a521c3c38cdce4e8b2400e3e Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 27 Feb 2016 22:41:15 +0300 Subject: [PATCH 140/316] added shortcuts module to git --- Telegram/SourceFiles/shortcuts.cpp | 354 +++++++++++++++++++++++++++++ Telegram/SourceFiles/shortcuts.h | 33 +++ 2 files changed, 387 insertions(+) create mode 100644 Telegram/SourceFiles/shortcuts.cpp create mode 100644 Telegram/SourceFiles/shortcuts.h diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp new file mode 100644 index 0000000000..37731fc81f --- /dev/null +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -0,0 +1,354 @@ +/* +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 "shortcuts.h" + +#include "window.h" +#include "passcodewidget.h" +#include "mainwidget.h" + +namespace ShortcutCommands { + typedef void(*Handler)(); + + void lock_telegram() { + if (Window *w = App::wnd()) { + if (App::passcoded()) { + w->passcodeWidget()->onSubmit(); + } else if (cHasPasscode()) { + w->setupPasscode(true); + } + } + } + + void minimize_telegram() { + if (Window *w = App::wnd()) { + if (cWorkMode() == dbiwmTrayOnly) { + w->minimizeToTray(); + } else { + w->setWindowState(Qt::WindowMinimized); + } + } + } + + void close_telegram() { + if (!Ui::hideWindowNoQuit()) { + if (Window *w = App::wnd()) { + App::wnd()->close(); + } + } + } + + void quit_telegram() { + App::quit(); + } + + //void start_stop_recording() { + + //} + + //void cancel_recording() { + + //} + + void media_play() { + if (MainWidget *m = App::main()) { + m->player()->playPressed(); + } + } + + void media_pause() { + if (MainWidget *m = App::main()) { + m->player()->pausePressed(); + } + } + + void media_playpause() { + if (MainWidget *m = App::main()) { + m->player()->playPausePressed(); + } + } + + void media_stop() { + if (MainWidget *m = App::main()) { + m->player()->stopPressed(); + } + } + + void media_previous() { + if (MainWidget *m = App::main()) { + m->player()->prevPressed(); + } + } + + void media_next() { + if (MainWidget *m = App::main()) { + m->player()->nextPressed(); + } + } + + void search() { + if (MainWidget *m = App::main()) { + m->cmd_search(); + } + } + + void previous_chat() { + if (MainWidget *m = App::main()) { + m->cmd_previous_chat(); + } + } + + void next_chat() { + if (MainWidget *m = App::main()) { + m->cmd_next_chat(); + } + } + + // other commands here + +} + +inline bool qMapLessThanKey(const ShortcutCommands::Handler &a, const ShortcutCommands::Handler &b) { + return a < b; +} + +namespace Shortcuts { + + struct DataStruct; + DataStruct *DataPtr = nullptr; + + void _createCommand(const QString &command, ShortcutCommands::Handler handler); + QKeySequence _setShortcut(const QString &keys, const QString &command); + struct DataStruct { + DataStruct() { + t_assert(DataPtr == nullptr); + DataPtr = this; + +#define DeclareAlias(keys, command) _setShortcut(qsl(keys), qsl(#command)) +#define DeclareCommand(keys, command) _createCommand(qsl(#command), ShortcutCommands::command); DeclareAlias(keys, command) + + DeclareCommand("ctrl+w", close_telegram); + DeclareAlias("ctrl+f4", close_telegram); + DeclareCommand("ctrl+l", lock_telegram); + DeclareCommand("ctrl+m", minimize_telegram); + DeclareCommand("ctrl+q", quit_telegram); + + //DeclareCommand("ctrl+r", start_stop_recording); + //DeclareCommand("ctrl+shift+r", cancel_recording); + //DeclareCommand("media record", start_stop_recording); + + DeclareCommand("media play", media_play); + DeclareCommand("media pause", media_pause); + DeclareCommand("toggle media play/pause", media_playpause); + DeclareCommand("media stop", media_stop); + DeclareCommand("media previous", media_previous); + DeclareCommand("media next", media_next); + + DeclareCommand("ctrl+f", search); + DeclareAlias("search", search); + DeclareAlias("find", search); + + DeclareCommand("ctrl+pgdown", next_chat); + DeclareAlias("alt+down", next_chat); + DeclareAlias("ctrl+tab", next_chat); + DeclareCommand("ctrl+pgup", previous_chat); + DeclareAlias("alt+up", previous_chat); + DeclareAlias("ctrl+shift+tab", previous_chat); + DeclareAlias("ctrl+backtab", previous_chat); + + // other commands here + +#undef DeclareCommand +#undef DeclareAlias + } + QStringList errors; + + QMap commands; + QMap commandnames; + + QMap sequences; + QMap handlers; + }; + + void _createCommand(const QString &command, ShortcutCommands::Handler handler) { + t_assert(DataPtr != nullptr); + t_assert(!command.isEmpty()); + + DataPtr->commands.insert(command, handler); + DataPtr->commandnames.insert(handler, command); + } + + QKeySequence _setShortcut(const QString &keys, const QString &command) { + t_assert(DataPtr != nullptr); + t_assert(!command.isEmpty()); + if (keys.isEmpty()) return QKeySequence(); + + QKeySequence seq(keys, QKeySequence::PortableText); + if (seq.isEmpty()) { + DataPtr->errors.push_back(qsl("Could not derive key sequence '%1'!").arg(keys)); + } else { + QMap::const_iterator it = DataPtr->commands.constFind(command); + if (it == DataPtr->commands.cend()) { + LOG(("Warning: could not find shortcut command handler '%1'").arg(command)); + } else { + QShortcut *shortcut(new QShortcut(seq, App::wnd(), nullptr, nullptr, Qt::ApplicationShortcut)); + int shortcutId = shortcut->id(); + if (!shortcutId) { + DataPtr->errors.push_back(qsl("Could not create shortcut '%1'!").arg(keys)); + } else { + QMap::iterator seqIt = DataPtr->sequences.find(seq); + if (seqIt == DataPtr->sequences.cend()) { + seqIt = DataPtr->sequences.insert(seq, shortcut); + } else { + DataPtr->handlers.remove(seqIt.value()->id()); + delete seqIt.value(); + seqIt.value() = shortcut; + } + DataPtr->handlers.insert(shortcutId, it.value()); + } + } + } + return seq; + } + + QKeySequence _removeShortcut(const QString &keys) { + t_assert(DataPtr != nullptr); + if (keys.isEmpty()) return QKeySequence(); + + QKeySequence seq(keys, QKeySequence::PortableText); + if (seq.isEmpty()) { + DataPtr->errors.push_back(qsl("Could not derive key sequence '%1'!").arg(keys)); + } else { + QMap::iterator seqIt = DataPtr->sequences.find(seq); + if (seqIt != DataPtr->sequences.cend()) { + DataPtr->handlers.remove(seqIt.value()->id()); + delete seqIt.value(); + DataPtr->sequences.erase(seqIt); + } + } + return seq; + } + + void start() { + t_assert(Global::started()); + + new DataStruct(); + + QJsonArray shortcuts; + OrderedSet notfound; + QFile f(cWorkingDir() + qsl("tdata/shortcuts.json")); + if (f.exists()) { + if (f.open(QIODevice::ReadOnly)) { + QJsonParseError error = { 0, QJsonParseError::NoError }; + QJsonDocument doc = QJsonDocument::fromJson(f.readAll(), &error); + if (error.error != QJsonParseError::NoError) { + DataPtr->errors.push_back(qsl("Failed to parse '%1'! Error: %2").arg(f.fileName()).arg(error.errorString())); + } else if (!doc.isArray()) { + DataPtr->errors.push_back(qsl("Failed to parse '%1'! Error: array expected").arg(f.fileName())); + } else { + for (QMap::const_iterator i = DataPtr->sequences.cbegin(), e = DataPtr->sequences.cend(); i != e; ++i) { + notfound.insert(i.key()); + } + + shortcuts = doc.array(); + int limit = ShortcutsCountLimit; + for (QJsonArray::const_iterator i = shortcuts.constBegin(), e = shortcuts.constEnd(); i != e; ++i) { + if (!i->isObject()) { + DataPtr->errors.push_back(qsl("Bad entry in '%1'! Error: object expected").arg(f.fileName())); + } else { + QKeySequence seq; + QJsonObject entry(i->toObject()); + QJsonObject::const_iterator keys = entry.constFind(qsl("keys")), command = entry.constFind(qsl("command")); + if (keys == entry.constEnd() || command == entry.constEnd() || !keys->isString() || (!command->isString() && !command->isNull())) { + DataPtr->errors.push_back(qsl("Bad entry in '%1'! Error: {\"keys\": \"..\", \"command\": [ \"..\" | null ]} expected").arg(f.fileName())); + } else if (command->isNull()) { + seq = _removeShortcut(keys->toString()); + } else { + seq = _setShortcut(keys->toString(), command->toString()); + } + if (!--limit) { + DataPtr->errors.push_back(qsl("Too many entries in '%1'!").arg(f.fileName())); + break; + } else if (DataPtr->errors.isEmpty()) { + notfound.remove(seq); + } + } + } + } + f.close(); + } else { + DataPtr->errors.push_back(qsl("Could not read '") + f.fileName() + qsl("'!")); + } + } + if (DataPtr->errors.isEmpty() && (shortcuts.isEmpty() || !notfound.isEmpty()) && f.open(QIODevice::WriteOnly)) { + for (OrderedSet::const_iterator i = notfound.cbegin(), e = notfound.cend(); i != e; ++i) { + QMap::const_iterator s = DataPtr->sequences.constFind(i.key()); + if (s != DataPtr->sequences.cend()) { + QMap::const_iterator h = DataPtr->handlers.constFind(s.value()->id()); + if (h != DataPtr->handlers.cend()) { + QMap::const_iterator n = DataPtr->commandnames.constFind(h.value()); + if (n != DataPtr->commandnames.cend()) { + QJsonObject entry; + entry.insert(qsl("keys"), i.key().toString().toLower()); + entry.insert(qsl("command"), n.value()); + shortcuts.append(entry); + } + } + } + } + + QJsonDocument doc; + doc.setArray(shortcuts); + f.write(doc.toJson(QJsonDocument::Indented)); + f.close(); + } + } + + const QStringList &errors() { + t_assert(DataPtr != nullptr); + return DataPtr->errors; + } + + void launch(int shortcutId) { + t_assert(DataPtr != nullptr); + + QMap::const_iterator it = DataPtr->handlers.constFind(shortcutId); + if (it != DataPtr->handlers.cend()) { + (*it.value())(); + } + } + + void launch(const QString &command) { + t_assert(DataPtr != nullptr); + + QMap::const_iterator it = DataPtr->commands.constFind(command); + if (it != DataPtr->commands.cend()) { + (*it.value())(); + } + } + + void finish() { + delete DataPtr; + DataPtr = nullptr; + } + +} diff --git a/Telegram/SourceFiles/shortcuts.h b/Telegram/SourceFiles/shortcuts.h new file mode 100644 index 0000000000..e903478987 --- /dev/null +++ b/Telegram/SourceFiles/shortcuts.h @@ -0,0 +1,33 @@ +/* +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 + +namespace Shortcuts { + + void start(); + const QStringList &errors(); + + void launch(int shortcutId); + void launch(const QString &command); + + void finish(); + +} From bb518043bc2ceb4bb7703ad8b46f17062be54ab8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 27 Feb 2016 23:09:31 +0300 Subject: [PATCH 141/316] shortcuts added for mac os x --- Telegram/SourceFiles/shortcuts.cpp | 12 +++++++++--- Telegram/Telegram.xcodeproj/project.pbxproj | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp index 37731fc81f..430622547f 100644 --- a/Telegram/SourceFiles/shortcuts.cpp +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -169,11 +169,17 @@ namespace Shortcuts { DeclareCommand("ctrl+pgdown", next_chat); DeclareAlias("alt+down", next_chat); - DeclareAlias("ctrl+tab", next_chat); DeclareCommand("ctrl+pgup", previous_chat); DeclareAlias("alt+up", previous_chat); - DeclareAlias("ctrl+shift+tab", previous_chat); - DeclareAlias("ctrl+backtab", previous_chat); + if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { + DeclareAlias("meta+tab", next_chat); + DeclareAlias("meta+shift+tab", previous_chat); + DeclareAlias("meta+backtab", previous_chat); + } else { + DeclareAlias("ctrl+tab", next_chat); + DeclareAlias("ctrl+shift+tab", previous_chat); + DeclareAlias("ctrl+backtab", previous_chat); + } // other commands here diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 0f6dbcf6da..496b74e15b 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -61,6 +61,7 @@ 0755AEDD1AD12A80004D738A /* moc_abstractbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0755AEDA1AD12A80004D738A /* moc_abstractbox.cpp */; }; 0755AEDE1AD12A80004D738A /* moc_intropwdcheck.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0755AEDB1AD12A80004D738A /* moc_intropwdcheck.cpp */; }; 0755AEDF1AD12A80004D738A /* moc_sessionsbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0755AEDC1AD12A80004D738A /* moc_sessionsbox.cpp */; }; + 075FEBEC1C82336D0003ECA3 /* shortcuts.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 075FEBEA1C82336D0003ECA3 /* shortcuts.cpp */; }; 0764D55A1ABAD6F900FBFEED /* apiwrap.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0764D5581ABAD6F900FBFEED /* apiwrap.cpp */; }; 0764D55D1ABAD71B00FBFEED /* moc_apiwrap.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0764D55C1ABAD71B00FBFEED /* moc_apiwrap.cpp */; }; 078A2FCA1A811C5900CCC7A0 /* moc_backgroundbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 078A2FC91A811C5900CCC7A0 /* moc_backgroundbox.cpp */; }; @@ -307,6 +308,8 @@ 0755AEDC1AD12A80004D738A /* moc_sessionsbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_sessionsbox.cpp; path = GeneratedFiles/Debug/moc_sessionsbox.cpp; sourceTree = SOURCE_ROOT; }; 075EB50EB07CF69FD62FB8DF /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql_private.pri"; sourceTree = ""; }; 075F99A91A45EEF200915C72 /* lang_es.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = lang_es.strings; path = SourceFiles/langs/lang_es.strings; sourceTree = SOURCE_ROOT; }; + 075FEBEA1C82336D0003ECA3 /* shortcuts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = shortcuts.cpp; path = SourceFiles/shortcuts.cpp; sourceTree = SOURCE_ROOT; }; + 075FEBEB1C82336D0003ECA3 /* shortcuts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = shortcuts.h; path = SourceFiles/shortcuts.h; sourceTree = SOURCE_ROOT; }; 0764D5581ABAD6F900FBFEED /* apiwrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apiwrap.cpp; path = SourceFiles/apiwrap.cpp; sourceTree = SOURCE_ROOT; }; 0764D5591ABAD6F900FBFEED /* apiwrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apiwrap.h; path = SourceFiles/apiwrap.h; sourceTree = SOURCE_ROOT; }; 0764D55C1ABAD71B00FBFEED /* moc_apiwrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_apiwrap.cpp; path = GeneratedFiles/Debug/moc_apiwrap.cpp; sourceTree = SOURCE_ROOT; }; @@ -952,6 +955,7 @@ 047DAFB0A7DE92C63033A43C /* mainwidget.cpp */, 8A28F7789408AA839F48A5F2 /* settings.cpp */, 8CCCACE96535180FEB557712 /* settingswidget.cpp */, + 075FEBEA1C82336D0003ECA3 /* shortcuts.cpp */, 07DB67451AD07C4F00A51329 /* structs.cpp */, 6B90F69947805586A6FAE80E /* sysbuttons.cpp */, 2BB2A1BB8DB0993F78F4E3C7 /* title.cpp */, @@ -994,6 +998,7 @@ FE8FD20832B4C226E345CFBA /* mainwidget.h */, 2EA58EF6CDF368B0132BAEB9 /* settings.h */, F80095A026AF9453E9C2B8BD /* settingswidget.h */, + 075FEBEB1C82336D0003ECA3 /* shortcuts.h */, 07DB67461AD07C4F00A51329 /* structs.h */, C913E6A1001E07EE7C13CE93 /* style.h */, 3BE70E2A82DC2BF402165ED5 /* sysbuttons.h */, @@ -1658,6 +1663,7 @@ E8B28580819B882A5964561A /* moc_addcontactbox.cpp in Compile Sources */, 07B604321B46A0EC00CA29FE /* playerwidget.cpp in Compile Sources */, D6874C00733283846ACA9AB2 /* moc_confirmbox.cpp in Compile Sources */, + 075FEBEC1C82336D0003ECA3 /* shortcuts.cpp in Compile Sources */, ED2557A57C6782721DC494AF /* moc_connectionbox.cpp in Compile Sources */, 5FC914F652D1B16FDA8F0634 /* moc_contactsbox.cpp in Compile Sources */, 074968D01A44D14C00394F46 /* languagebox.cpp in Compile Sources */, From 26ffbbc34f39413e7ac7c80cd3ce72791f37b8db Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 28 Feb 2016 12:48:09 +0300 Subject: [PATCH 142/316] divided shortcuts file to default and custom --- Telegram/SourceFiles/shortcuts.cpp | 241 +++++++++++++++++++++-------- Telegram/SourceFiles/shortcuts.h | 4 +- Telegram/SourceFiles/window.cpp | 54 +++++-- 3 files changed, 222 insertions(+), 77 deletions(-) diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp index 37731fc81f..b18a4399a1 100644 --- a/Telegram/SourceFiles/shortcuts.cpp +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -133,6 +133,76 @@ inline bool qMapLessThanKey(const ShortcutCommands::Handler &a, const ShortcutCo namespace Shortcuts { + // inspired by https://github.com/sindresorhus/strip-json-comments + QByteArray _stripJsonComments(const QByteArray &json) { + enum InsideComment { + InsideCommentNone, + InsideCommentSingleLine, + InsideCommentMultiLine, + }; + InsideComment insideComment = InsideCommentNone; + bool insideString = false; + + QByteArray result; + + const char *b = json.cbegin(), *e = json.cend(), *offset = b; + for (const char *ch = offset; ch != e; ++ch) { + char currentChar = *ch; + char nextChar = (ch + 1 == e) ? 0 : *(ch + 1); + + if (insideComment == InsideCommentNone && currentChar == '"') { + bool escaped = ((ch > b) && *(ch - 1) == '\\') && ((ch - 1 < b) || *(ch - 2) != '\\'); + if (!escaped) { + insideString = !insideString; + } + } + + if (insideString) { + continue; + } + + if (insideComment == InsideCommentNone && currentChar == '/' && nextChar == '/') { + if (ch > offset) { + if (result.isEmpty()) result.reserve(json.size() - 2); + result.append(offset, ch - offset); + offset = ch; + } + insideComment = InsideCommentSingleLine; + ++ch; + } else if (insideComment == InsideCommentSingleLine && currentChar == '\r' && nextChar == '\n') { + if (ch > offset) { + offset = ch; + } + ++ch; + insideComment = InsideCommentNone; + } else if (insideComment == InsideCommentSingleLine && currentChar == '\n') { + if (ch > offset) { + offset = ch; + } + insideComment = InsideCommentNone; + } else if (insideComment == InsideCommentNone && currentChar == '/' && nextChar == '*') { + if (ch > offset) { + if (result.isEmpty()) result.reserve(json.size() - 2); + result.append(offset, ch - offset); + offset = ch; + } + insideComment = InsideCommentMultiLine; + ++ch; + } else if (insideComment == InsideCommentMultiLine && currentChar == '*' && nextChar == '/') { + if (ch > offset) { + offset = ch; + } + ++ch; + insideComment = InsideCommentNone; + } + } + + if (insideComment == InsideCommentNone && e > offset && !result.isEmpty()) { + result.append(offset, e - offset); + } + return result.isEmpty() ? json : result; + } + struct DataStruct; DataStruct *DataPtr = nullptr; @@ -253,73 +323,116 @@ namespace Shortcuts { new DataStruct(); - QJsonArray shortcuts; - OrderedSet notfound; - QFile f(cWorkingDir() + qsl("tdata/shortcuts.json")); - if (f.exists()) { - if (f.open(QIODevice::ReadOnly)) { - QJsonParseError error = { 0, QJsonParseError::NoError }; - QJsonDocument doc = QJsonDocument::fromJson(f.readAll(), &error); - if (error.error != QJsonParseError::NoError) { - DataPtr->errors.push_back(qsl("Failed to parse '%1'! Error: %2").arg(f.fileName()).arg(error.errorString())); - } else if (!doc.isArray()) { - DataPtr->errors.push_back(qsl("Failed to parse '%1'! Error: array expected").arg(f.fileName())); - } else { - for (QMap::const_iterator i = DataPtr->sequences.cbegin(), e = DataPtr->sequences.cend(); i != e; ++i) { - notfound.insert(i.key()); - } + // write default shortcuts to a file if they are not there already + bool defaultValid = false; + QFile defaultFile(cWorkingDir() + qsl("tdata/shortcuts-default.json")); + if (defaultFile.open(QIODevice::ReadOnly)) { + QJsonParseError error = { 0, QJsonParseError::NoError }; + QJsonDocument doc = QJsonDocument::fromJson(_stripJsonComments(defaultFile.readAll()), &error); + defaultFile.close(); - shortcuts = doc.array(); - int limit = ShortcutsCountLimit; - for (QJsonArray::const_iterator i = shortcuts.constBegin(), e = shortcuts.constEnd(); i != e; ++i) { - if (!i->isObject()) { - DataPtr->errors.push_back(qsl("Bad entry in '%1'! Error: object expected").arg(f.fileName())); - } else { - QKeySequence seq; - QJsonObject entry(i->toObject()); - QJsonObject::const_iterator keys = entry.constFind(qsl("keys")), command = entry.constFind(qsl("command")); - if (keys == entry.constEnd() || command == entry.constEnd() || !keys->isString() || (!command->isString() && !command->isNull())) { - DataPtr->errors.push_back(qsl("Bad entry in '%1'! Error: {\"keys\": \"..\", \"command\": [ \"..\" | null ]} expected").arg(f.fileName())); - } else if (command->isNull()) { - seq = _removeShortcut(keys->toString()); - } else { - seq = _setShortcut(keys->toString(), command->toString()); - } - if (!--limit) { - DataPtr->errors.push_back(qsl("Too many entries in '%1'!").arg(f.fileName())); - break; - } else if (DataPtr->errors.isEmpty()) { - notfound.remove(seq); - } - } + if (error.error == QJsonParseError::NoError && doc.isArray()) { + QJsonArray shortcuts(doc.array()); + if (!shortcuts.isEmpty() && shortcuts.constBegin()->isObject()) { + QJsonObject versionObject(shortcuts.constBegin()->toObject()); + QJsonObject::const_iterator version = versionObject.constFind(qsl("version")); + if (version != versionObject.constEnd() && version->isString() && version->toString() == QString::number(AppVersion)) { + defaultValid = true; } } - f.close(); - } else { - DataPtr->errors.push_back(qsl("Could not read '") + f.fileName() + qsl("'!")); } } - if (DataPtr->errors.isEmpty() && (shortcuts.isEmpty() || !notfound.isEmpty()) && f.open(QIODevice::WriteOnly)) { - for (OrderedSet::const_iterator i = notfound.cbegin(), e = notfound.cend(); i != e; ++i) { - QMap::const_iterator s = DataPtr->sequences.constFind(i.key()); - if (s != DataPtr->sequences.cend()) { - QMap::const_iterator h = DataPtr->handlers.constFind(s.value()->id()); - if (h != DataPtr->handlers.cend()) { - QMap::const_iterator n = DataPtr->commandnames.constFind(h.value()); - if (n != DataPtr->commandnames.cend()) { - QJsonObject entry; - entry.insert(qsl("keys"), i.key().toString().toLower()); - entry.insert(qsl("command"), n.value()); - shortcuts.append(entry); - } + if (!defaultValid && defaultFile.open(QIODevice::WriteOnly)) { + const char *defaultHeader = "\ +// This is a list of default shortcuts for Telegram Desktop\n\ +// Please don't modify it, its content is not used in any way\n\ +// You can place your own shortcuts in the 'shortcuts-custom.json' file\n\n"; + defaultFile.write(defaultHeader); + + QJsonArray shortcuts; + + QJsonObject version; + version.insert(qsl("version"), QString::number(AppVersion)); + shortcuts.push_back(version); + + for (QMap::const_iterator i = DataPtr->sequences.cbegin(), e = DataPtr->sequences.cend(); i != e; ++i) { + QMap::const_iterator h = DataPtr->handlers.constFind(i.value()->id()); + if (h != DataPtr->handlers.cend()) { + QMap::const_iterator n = DataPtr->commandnames.constFind(h.value()); + if (n != DataPtr->commandnames.cend()) { + QJsonObject entry; + entry.insert(qsl("keys"), i.key().toString().toLower()); + entry.insert(qsl("command"), n.value()); + shortcuts.append(entry); } } } QJsonDocument doc; doc.setArray(shortcuts); - f.write(doc.toJson(QJsonDocument::Indented)); - f.close(); + defaultFile.write(doc.toJson(QJsonDocument::Indented)); + defaultFile.close(); + } + + // read custom shortcuts from file if it exists or write an empty custom shortcuts file + QFile customFile(cWorkingDir() + qsl("tdata/shortcuts-custom.json")); + if (customFile.exists()) { + if (customFile.open(QIODevice::ReadOnly)) { + QJsonParseError error = { 0, QJsonParseError::NoError }; + QJsonDocument doc = QJsonDocument::fromJson(_stripJsonComments(customFile.readAll()), &error); + customFile.close(); + + if (error.error != QJsonParseError::NoError) { + DataPtr->errors.push_back(qsl("Failed to parse! Error: %2").arg(error.errorString())); + } else if (!doc.isArray()) { + DataPtr->errors.push_back(qsl("Failed to parse! Error: array expected")); + } else { + QJsonArray shortcuts = doc.array(); + int limit = ShortcutsCountLimit; + for (QJsonArray::const_iterator i = shortcuts.constBegin(), e = shortcuts.constEnd(); i != e; ++i) { + if (!i->isObject()) { + DataPtr->errors.push_back(qsl("Bad entry! Error: object expected")); + } else { + QKeySequence seq; + QJsonObject entry(i->toObject()); + QJsonObject::const_iterator keys = entry.constFind(qsl("keys")), command = entry.constFind(qsl("command")); + if (keys == entry.constEnd() || command == entry.constEnd() || !keys->isString() || (!command->isString() && !command->isNull())) { + DataPtr->errors.push_back(qsl("Bad entry! {\"keys\": \"...\", \"command\": [ \"...\" | null ]} expected")); + } else if (command->isNull()) { + seq = _removeShortcut(keys->toString()); + } else { + seq = _setShortcut(keys->toString(), command->toString()); + } + if (!--limit) { + DataPtr->errors.push_back(qsl("Too many entries! Limit is %1").arg(ShortcutsCountLimit)); + break; + } + } + } + } + } else { + DataPtr->errors.push_back(qsl("Could not read the file!")); + } + if (!DataPtr->errors.isEmpty()) { + DataPtr->errors.push_front(qsl("While reading file '%1'...").arg(customFile.fileName())); + } + } else if (customFile.open(QIODevice::WriteOnly)) { + const char *customContent = "\ +// This is a list of your own shortcuts for Telegram Desktop\n\ +// You can see full list of commands in the 'shortcuts-default.json' file\n\ +// Place a null value instead of a command string to switch the shortcut off\n\n\ +[\n\ + // {\n\ + // \"command\": \"close_telegram\",\n\ + // \"keys\": \"ctrl+f4\"\n\ + // },\n\ + // {\n\ + // \"command\": \"quit_telegram\",\n\ + // \"keys\": \"ctrl+q\"\n\ + // }\n\ +]\n"; + customFile.write(customContent); + customFile.close(); } } @@ -328,22 +441,26 @@ namespace Shortcuts { return DataPtr->errors; } - void launch(int shortcutId) { + bool launch(int shortcutId) { t_assert(DataPtr != nullptr); QMap::const_iterator it = DataPtr->handlers.constFind(shortcutId); - if (it != DataPtr->handlers.cend()) { - (*it.value())(); + if (it == DataPtr->handlers.cend()) { + return false; } + (*it.value())(); + return true; } - void launch(const QString &command) { + bool launch(const QString &command) { t_assert(DataPtr != nullptr); QMap::const_iterator it = DataPtr->commands.constFind(command); - if (it != DataPtr->commands.cend()) { - (*it.value())(); + if (it == DataPtr->commands.cend()) { + return false; } + (*it.value())(); + return true; } void finish() { diff --git a/Telegram/SourceFiles/shortcuts.h b/Telegram/SourceFiles/shortcuts.h index e903478987..8d2483dd15 100644 --- a/Telegram/SourceFiles/shortcuts.h +++ b/Telegram/SourceFiles/shortcuts.h @@ -25,8 +25,8 @@ namespace Shortcuts { void start(); const QStringList &errors(); - void launch(int shortcutId); - void launch(const QString &command); + bool launch(int shortcutId); + bool launch(const QString &command); void finish(); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 6817c6ac5a..96a9b0a4a0 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1011,24 +1011,43 @@ QRect Window::iconRect() const { } bool Window::eventFilter(QObject *obj, QEvent *e) { - QEvent::Type t = e->type(); - if (t == QEvent::MouseButtonPress || t == QEvent::KeyPress || t == QEvent::TouchBegin || t == QEvent::Wheel) { + switch (e->type()) { + case QEvent::MouseButtonPress: + case QEvent::KeyPress: + case QEvent::TouchBegin: + case QEvent::Wheel: psUserActionDone(); - } else if (t == QEvent::MouseMove) { + break; + + case QEvent::MouseMove: if (main && main->isIdle()) { psUserActionDone(); main->checkIdleFinish(); } - } else if (t == QEvent::MouseButtonRelease) { + break; + + case QEvent::MouseButtonRelease: Ui::hideStickerPreview(); - } else if (t == QEvent::Shortcut) { - Shortcuts::launch(static_cast(e)->shortcutId()); - } - if (obj == Application::instance()) { - if (t == QEvent::ApplicationActivate) { + break; + + case QEvent::ShortcutOverride: // handle shortcuts ourselves + return true; + + case QEvent::Shortcut: + if (Shortcuts::launch(static_cast(e)->shortcutId())) { + return true; + } + break; + + case QEvent::ApplicationActivate: + if (obj == Application::instance()) { psUserActionDone(); QTimer::singleShot(1, this, SLOT(checkHistoryActivation())); - } else if (t == QEvent::FileOpen) { + } + break; + + case QEvent::FileOpen: + if (obj == Application::instance()) { QString url = static_cast(e)->url().toEncoded(); if (!url.trimmed().midRef(0, 5).compare(qsl("tg://"), Qt::CaseInsensitive)) { cSetStartUrl(url); @@ -1039,14 +1058,23 @@ bool Window::eventFilter(QObject *obj, QEvent *e) { } activate(); } - } else if (obj == this) { - if (t == QEvent::WindowStateChange) { + break; + + case QEvent::WindowStateChange: + if (obj == this) { Qt::WindowState state = (windowState() & Qt::WindowMinimized) ? Qt::WindowMinimized : ((windowState() & Qt::WindowMaximized) ? Qt::WindowMaximized : ((windowState() & Qt::WindowFullScreen) ? Qt::WindowFullScreen : Qt::WindowNoState)); stateChanged(state); - } else if (t == QEvent::Move || t == QEvent::Resize) { + } + break; + + case QEvent::Move: + case QEvent::Resize: + if (obj == this) { psUpdatedPosition(); } + break; } + return PsMainWindow::eventFilter(obj, e); } From 798f800913b2932bb86fbd4eea238102056e7e8a Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 28 Feb 2016 14:58:30 +0300 Subject: [PATCH 143/316] History::dialogs and Histories::unread are private now, counting only chats from dialogs list to the badge --- Telegram/SourceFiles/apiwrap.cpp | 2 +- Telegram/SourceFiles/app.cpp | 2 +- Telegram/SourceFiles/dialogswidget.cpp | 32 ++++--- Telegram/SourceFiles/dialogswidget.h | 3 +- Telegram/SourceFiles/history.cpp | 110 ++++++++++++++++------- Telegram/SourceFiles/history.h | 91 +++++++++++++------ Telegram/SourceFiles/mainwidget.cpp | 8 +- Telegram/SourceFiles/pspecific_linux.cpp | 14 +-- Telegram/SourceFiles/pspecific_mac.cpp | 4 +- Telegram/SourceFiles/pspecific_wnd.cpp | 4 +- Telegram/SourceFiles/title.cpp | 4 +- Telegram/SourceFiles/types.h | 36 ++++++++ 12 files changed, 213 insertions(+), 97 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 2955002259..78b74c727b 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -273,7 +273,7 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt if (!h->isEmpty()) { h->clear(true); } - if (!hto->dialogs.isEmpty() && !h->dialogs.isEmpty()) { + if (hto->inChatList() && h->inChatList()) { App::removeDialog(h); } } diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 521f923ad6..dc77d01e83 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -522,7 +522,7 @@ namespace App { if (!h->isEmpty()) { h->clear(true); } - if (!hto->dialogs.isEmpty() && !h->dialogs.isEmpty()) { + if (hto->inChatList() && h->inChatList()) { App::removeDialog(h); } } diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index f7bf3298f7..29d3437f0c 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -443,16 +443,12 @@ void DialogsInner::onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow) { } void DialogsInner::createDialog(History *history) { - bool creating = history->dialogs.isEmpty(); + bool creating = !history->inChatList(); if (creating) { - history->dialogs = dialogs.addToEnd(history); - contactsNoDialogs.del(history->peer, history->dialogs[0]); + DialogRow *mainRow = history->addToChatList(dialogs); + contactsNoDialogs.del(history->peer, mainRow); } - - History::DialogLinks links = history->dialogs; - int32 movedFrom = links[0]->pos * st::dlgHeight; - dialogs.adjustByPos(links); - int32 movedTo = links[0]->pos * st::dlgHeight; + RefPair(int32, movedFrom, int32, movedTo) = history->adjustByPosInChatsList(dialogs); emit dialogMoved(movedFrom, movedTo); @@ -471,8 +467,7 @@ void DialogsInner::removeDialog(History *history) { if (sel && sel->history == history) { sel = 0; } - dialogs.del(history->peer); - history->dialogs = History::DialogLinks(); + history->removeFromChatList(dialogs); history->clearNotifications(); if (App::wnd()) App::wnd()->notifyClear(history); if (contacts.list.rowByPeer.constFind(history->peer->id) != contacts.list.rowByPeer.cend()) { @@ -550,8 +545,8 @@ void DialogsInner::updateSelectedRow(PeerData *peer) { if (_state == DefaultState) { if (peer) { if (History *h = App::historyLoaded(peer->id)) { - if (h->dialogs.contains(0)) { - update(0, h->dialogs.value(0)->pos * st::dlgHeight, fullWidth(), st::dlgHeight); + if (h->inChatList()) { + update(0, h->posInChatList() * st::dlgHeight, fullWidth(), st::dlgHeight); } } } else if (sel) { @@ -1019,7 +1014,7 @@ void DialogsInner::addSavedPeersAfter(const QDateTime &date) { SavedPeersByTime &saved(cRefSavedPeersByTime()); while (!saved.isEmpty() && (date.isNull() || date < saved.lastKey())) { History *history = App::history(saved.last()->id); - history->setPosInDialogsDate(saved.lastKey()); + history->setChatsListDate(saved.lastKey()); contactsNoDialogs.del(history->peer); saved.remove(saved.lastKey(), saved.last()); } @@ -1074,8 +1069,11 @@ void DialogsInner::peopleReceived(const QString &query, const QVector & _peopleResults.reserve(people.size()); for (QVector::const_iterator i = people.cbegin(), e = people.cend(); i != e; ++i) { PeerId peerId = peerFromMTP(*i); - History *h = App::historyLoaded(peerId); - if (h && !h->dialogs.isEmpty()) continue; // skip dialogs + if (History *h = App::historyLoaded(peerId)) { + if (h->inChatList()) { + continue; // skip existing chats + } + } _peopleResults.push_back(App::peer(peerId)); } @@ -1786,11 +1784,11 @@ void DialogsWidget::activate() { } void DialogsWidget::createDialog(History *history) { - bool creating = history->dialogs.isEmpty(); + bool creating = !history->inChatList(); _inner.createDialog(history); if (creating && history->peer->migrateFrom()) { if (History *h = App::historyLoaded(history->peer->migrateFrom()->id)) { - if (!h->dialogs.isEmpty()) { + if (h->inChatList()) { removeDialog(h); } } diff --git a/Telegram/SourceFiles/dialogswidget.h b/Telegram/SourceFiles/dialogswidget.h index a535d2fa15..dfa643f5bd 100644 --- a/Telegram/SourceFiles/dialogswidget.h +++ b/Telegram/SourceFiles/dialogswidget.h @@ -67,7 +67,6 @@ public: void selectSkipPage(int32 pixels, int32 direction); void createDialog(History *history); - void moveDialogToTop(const History::DialogLinks &links); void dlgUpdated(DialogRow *row); void dlgUpdated(History *row, MsgId msgId); void removeDialog(History *history); @@ -219,7 +218,7 @@ public: void contactsReceived(const MTPcontacts_Contacts &contacts); void searchReceived(DialogsSearchRequestType type, const MTPmessages_Messages &result, mtpRequestId req); void peopleReceived(const MTPcontacts_Found &result, mtpRequestId req); - + void dragEnterEvent(QDragEnterEvent *e); void dragMoveEvent(QDragMoveEvent *e); void dragLeaveEvent(QDragLeaveEvent *e); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 4dd68f6bfc..4a69bdd3d3 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -294,7 +294,7 @@ History::History(const PeerId &peerId) : width(0), height(0) , sendRequestId(0) , textCachedFor(0) , lastItemTextCache(st::dlgRichMinWidth) -, posInDialogs(0) +, _sortKeyInChatList(0) , typingText(st::dlgRichMinWidth) { if (peer->isChannel() || (peer->isUser() && peer->asUser()->botInfo)) { outboxReadBefore = INT_MAX; @@ -367,7 +367,7 @@ bool History::updateTyping(uint64 ms, bool force) { } } if (changed && App::main()) { - if (!dialogs.isEmpty()) App::main()->dlgUpdated(dialogs[0]); + updateChatListEntry(); if (App::main()->historyPeer() == peer) { App::main()->topBar()->update(); } @@ -1180,7 +1180,7 @@ void DialogsIndexed::peerNameChanged(PeerData *peer, const PeerData::Names &oldN } } for (PeerData::NameFirstChars::const_iterator i = toRemove.cbegin(), e = toRemove.cend(); i != e; ++i) { - if (sortMode == DialogsSortByDate) history->dialogs.remove(*i); + if (sortMode == DialogsSortByDate) history->removeChatListEntryByLetter(*i); DialogsIndex::iterator j = index.find(*i); if (j != index.cend()) { j.value()->del(peer->id, mainRow); @@ -1191,11 +1191,8 @@ void DialogsIndexed::peerNameChanged(PeerData *peer, const PeerData::Names &oldN if (j == index.cend()) { j = index.insert(*i, new DialogsList(sortMode)); } - if (sortMode == DialogsSortByDate) { - history->dialogs.insert(*i, j.value()->addToEnd(history)); - } else { - j.value()->addToEnd(history); - } + DialogRow *row = j.value()->addToEnd(history); + if (sortMode == DialogsSortByDate) history->addChatListEntryByLetter(*i, row); } } } @@ -2175,16 +2172,10 @@ MsgId History::inboxRead(MsgId upTo) { if (!upTo) upTo = msgIdForRead(); inboxReadBefore = qMax(inboxReadBefore, upTo + 1); - if (App::main()) { - if (!dialogs.isEmpty()) { - App::main()->dlgUpdated(dialogs[0]); - } - if (peer->migrateTo()) { - if (History *h = App::historyLoaded(peer->migrateTo()->id)) { - if (!h->dialogs.isEmpty()) { - App::main()->dlgUpdated(h->dialogs[0]); - } - } + updateChatListEntry(); + if (peer->migrateTo()) { + if (History *h = App::historyLoaded(peer->migrateTo()->id)) { + h->updateChatListEntry(); } } @@ -2235,10 +2226,13 @@ void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { showFrom = 0; inboxReadBefore = qMax(inboxReadBefore, msgIdForRead() + 1); } - App::histories().unreadFull += newUnreadCount - unreadCount; - if (mute) App::histories().unreadMuted += newUnreadCount - unreadCount; + if (inChatList()) { + App::histories().unreadIncrement(newUnreadCount - unreadCount, mute); + if (psUpdate && (!mute || cIncludeMuted()) && App::wnd()) { + App::wnd()->updateCounter(); + } + } unreadCount = newUnreadCount; - if (psUpdate && (!mute || cIncludeMuted()) && App::wnd()) App::wnd()->updateCounter(); if (unreadBar) { int32 count = unreadCount; if (peer->migrateTo()) { @@ -2253,10 +2247,12 @@ void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { void History::setMute(bool newMute) { if (mute != newMute) { - App::histories().unreadMuted += newMute ? unreadCount : (-unreadCount); mute = newMute; - if (App::wnd()) App::wnd()->updateCounter(); - if (!dialogs.isEmpty() && App::main()) App::main()->dlgUpdated(dialogs[0]); + if (inChatList() && unreadCount) { + App::histories().unreadMuteChanged(unreadCount, newMute); + if (App::wnd()) App::wnd()->updateCounter(); + } + updateChatListEntry(); } } @@ -2420,25 +2416,25 @@ void History::setLastMessage(HistoryItem *msg) { if (msg) { if (!lastMsg) Local::removeSavedPeer(peer); lastMsg = msg; - setPosInDialogsDate(msg->date); + setChatsListDate(msg->date); } else { lastMsg = 0; } - if (!dialogs.isEmpty() && App::main()) App::main()->dlgUpdated(dialogs[0]); + updateChatListEntry(); } -void History::setPosInDialogsDate(const QDateTime &date) { - bool updateDialog = (App::main() && (!peer->isChannel() || peer->asChannel()->amIn() || !dialogs.isEmpty())); - if (peer->migrateTo() && dialogs.isEmpty()) { +void History::setChatsListDate(const QDateTime &date) { + bool updateDialog = (App::main() && (!peer->isChannel() || peer->asChannel()->amIn() || !_chatListLinks.isEmpty())); + if (peer->migrateTo() && _chatListLinks.isEmpty()) { updateDialog = false; } if (!lastMsgDate.isNull() && lastMsgDate >= date) { - if (!updateDialog || !dialogs.isEmpty()) { + if (!updateDialog || !_chatListLinks.isEmpty()) { return; } } lastMsgDate = date; - posInDialogs = dialogPosFromDate(lastMsgDate); + _sortKeyInChatList = dialogPosFromDate(lastMsgDate); if (updateDialog) { App::main()->createDialog(this); } @@ -2560,6 +2556,58 @@ void History::clear(bool leaveItems) { if (leaveItems && App::main()) App::main()->historyCleared(this); } +QPair History::adjustByPosInChatsList(DialogsIndexed &indexed) { + int32 movedFrom = _chatListLinks[0]->pos * st::dlgHeight; + indexed.adjustByPos(_chatListLinks); + int32 movedTo = _chatListLinks[0]->pos * st::dlgHeight; + return qMakePair(movedFrom, movedTo); +} + +DialogRow *History::addToChatList(DialogsIndexed &indexed) { + if (!inChatList()) { + _chatListLinks = indexed.addToEnd(this); + if (unreadCount) { + App::histories().unreadIncrement(unreadCount, mute); + if (App::wnd()) App::wnd()->updateCounter(); + } + } + t_assert(!_chatListLinks.isEmpty()); + return _chatListLinks[0]; +} + +void History::removeFromChatList(DialogsIndexed &indexed) { + if (inChatList()) { + indexed.del(peer); + _chatListLinks.clear(); + if (unreadCount) { + App::histories().unreadIncrement(-unreadCount, mute); + if (App::wnd()) App::wnd()->updateCounter(); + } + } +} + +void History::removeChatListEntryByLetter(QChar letter) { + t_assert(letter != 0); + if (inChatList()) { + _chatListLinks.remove(letter); + } +} + +void History::addChatListEntryByLetter(QChar letter, DialogRow *row) { + t_assert(letter != 0); + if (inChatList()) { + _chatListLinks.insert(letter, row); + } +} + +void History::updateChatListEntry() const { + if (MainWidget *m = App::main()) { + if (inChatList()) { + m->dlgUpdated(_chatListLinks[0]); + } + } +} + void History::overviewSliceDone(int32 overviewIndex, const MTPmessages_Messages &result, bool onlyCounts) { const QVector *v = 0; switch (result.type()) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 8d80eb393a..237670ecff 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -40,7 +40,7 @@ public: typedef QHash Map; Map map; - Histories() : _a_typings(animation(this, &Histories::step_typings)), unreadFull(0), unreadMuted(0) { + Histories() : _a_typings(animation(this, &Histories::step_typings)), _unreadFull(0), _unreadMuted(0) { } void regSendAction(History *history, UserData *user, const MTPSendMessageAction &action); @@ -52,7 +52,7 @@ public: void clear(); void remove(const PeerId &peer); ~Histories() { - unreadFull = unreadMuted = 0; + _unreadFull = _unreadMuted = 0; } HistoryItem *addNewMessage(const MTPMessage &msg, NewMessageType type); @@ -62,7 +62,29 @@ public: TypingHistories typing; Animation _a_typings; - int32 unreadFull, unreadMuted; + int32 unreadBadge() const { + return _unreadFull - (cIncludeMuted() ? 0 : _unreadMuted); + } + bool unreadOnlyMuted() const { + return cIncludeMuted() ? (_unreadMuted >= _unreadFull) : false; + } + void unreadIncrement(int32 count, bool muted) { + _unreadFull += count; + if (muted) { + _unreadMuted += count; + } + } + void unreadMuteChanged(int32 count, bool muted) { + if (muted) { + _unreadMuted += count; + } else { + _unreadMuted -= count; + } + } + +private: + int32 _unreadFull, _unreadMuted; + }; class HistoryBlock; @@ -195,6 +217,7 @@ enum AddToOverviewMethod { AddToOverviewBack, // when new messages slice was received and it is the last one, we index all media }; +struct DialogsIndexed; class ChannelHistory; class History { public: @@ -264,9 +287,27 @@ public: void getReadyFor(MsgId msgId, MsgId &fixInScrollMsgId, int32 &fixInScrollMsgTop); void setLastMessage(HistoryItem *msg); - void setPosInDialogsDate(const QDateTime &date); void fixLastMessage(bool wasAtBottom); + typedef QMap ChatListLinksMap; + void setChatsListDate(const QDateTime &date); + QPair adjustByPosInChatsList(DialogsIndexed &indexed); + uint64 sortKeyInChatList() const { + return _sortKeyInChatList; + } + bool inChatList() const { + return !_chatListLinks.isEmpty(); + } + int32 posInChatList() const { + t_assert(inChatList()); + return _chatListLinks[0]->pos; + } + DialogRow *addToChatList(DialogsIndexed &indexed); + void removeFromChatList(DialogsIndexed &indexed); + void removeChatListEntryByLetter(QChar letter); + void addChatListEntryByLetter(QChar letter, DialogRow *row); + void updateChatListEntry() const; + MsgId minMsgId() const; MsgId maxMsgId() const; MsgId msgIdForRead() const; @@ -345,10 +386,6 @@ public: mutable const HistoryItem *textCachedFor; // cache mutable Text lastItemTextCache; - typedef QMap DialogLinks; - DialogLinks dialogs; - uint64 posInDialogs; // like ((unixtime) << 32) | (incremented counter) - typedef QMap TypingUsers; TypingUsers typing; typedef QMap SendActionUsers; @@ -395,6 +432,9 @@ public: private: + ChatListLinksMap _chatListLinks; + uint64 _sortKeyInChatList; // like ((unixtime) << 32) | (incremented counter) + typedef QMap MediaOverviewIds; MediaOverviewIds overviewIds[OverviewCount]; int32 overviewCountData[OverviewCount]; // -1 - not loaded, 0 - all loaded, > 0 - count, but not all loaded @@ -632,15 +672,15 @@ struct DialogsList { if (sortMode != DialogsSortByDate) return; DialogRow *change = row; - if (change != begin && begin->history->posInDialogs < row->history->posInDialogs) { + if (change != begin && begin->history->sortKeyInChatList() < row->history->sortKeyInChatList()) { change = begin; - } else while (change->prev && change->prev->history->posInDialogs < row->history->posInDialogs) { + } else while (change->prev && change->prev->history->sortKeyInChatList() < row->history->sortKeyInChatList()) { change = change->prev; } if (!insertBefore(row, change)) { - if (change->next != end && end->prev->history->posInDialogs > row->history->posInDialogs) { + if (change->next != end && end->prev->history->sortKeyInChatList() > row->history->sortKeyInChatList()) { change = end->prev; - } else while (change->next != end && change->next->history->posInDialogs > row->history->posInDialogs) { + } else while (change->next != end && change->next->history->sortKeyInChatList() > row->history->sortKeyInChatList()) { change = change->next; } insertAfter(row, change); @@ -688,22 +728,19 @@ struct DialogsIndexed { DialogsIndexed(DialogsSortMode sortMode) : sortMode(sortMode), list(sortMode) { } - History::DialogLinks addToEnd(History *history) { - History::DialogLinks result; + History::ChatListLinksMap addToEnd(History *history) { + History::ChatListLinksMap result; DialogsList::RowByPeer::const_iterator i = list.rowByPeer.find(history->peer->id); - if (i != list.rowByPeer.cend()) { - return i.value()->history->dialogs; - } - - result.insert(0, list.addToEnd(history)); - for (PeerData::NameFirstChars::const_iterator i = history->peer->chars.cbegin(), e = history->peer->chars.cend(); i != e; ++i) { - DialogsIndex::iterator j = index.find(*i); - if (j == index.cend()) { - j = index.insert(*i, new DialogsList(sortMode)); + if (i == list.rowByPeer.cend()) { + result.insert(0, list.addToEnd(history)); + for (PeerData::NameFirstChars::const_iterator i = history->peer->chars.cbegin(), e = history->peer->chars.cend(); i != e; ++i) { + DialogsIndex::iterator j = index.find(*i); + if (j == index.cend()) { + j = index.insert(*i, new DialogsList(sortMode)); + } + result.insert(*i, j.value()->addToEnd(history)); } - result.insert(*i, j.value()->addToEnd(history)); } - return result; } @@ -724,8 +761,8 @@ struct DialogsIndexed { return res; } - void adjustByPos(const History::DialogLinks &links) { - for (History::DialogLinks::const_iterator i = links.cbegin(), e = links.cend(); i != e; ++i) { + void adjustByPos(const History::ChatListLinksMap &links) { + for (History::ChatListLinksMap::const_iterator i = links.cbegin(), e = links.cend(); i != e; ++i) { if (i.key() == QChar(0)) { list.adjustByPos(i.value()); } else { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 6c588c6194..735892f4d2 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -785,8 +785,8 @@ void MainWidget::notify_clipStopperHidden(ClipStopperType type) { void MainWidget::ui_repaintHistoryItem(const HistoryItem *item) { history.ui_repaintHistoryItem(item); - if (!item->history()->dialogs.isEmpty() && item->history()->lastMsg == item) { - dialogs.dlgUpdated(item->history()->dialogs[0]); + if (item->history()->lastMsg == item) { + item->history()->updateChatListEntry(); } if (overview) overview->ui_repaintHistoryItem(item); } @@ -4246,9 +4246,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { if (h->lastMsg && h->lastMsg->out() && h->lastMsg->id <= d.vmax_id.v) { dlgUpdated(h, h->lastMsg->id); } - if (!h->dialogs.isEmpty()) { - dlgUpdated(h->dialogs[0]); - } + h->updateChatListEntry(); } ptsApplySkippedUpdates(); diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index b734e9f0b6..7221645bc6 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -250,8 +250,8 @@ namespace { #define GTK_ALPHA 3 QImage _trayIconImageGen() { - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted), counterSlice = (counter >= 1000) ? (1000 + (counter % 100)) : counter; - bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; + int32 counter = App::histories().unreadBadge(), counterSlice = (counter >= 1000) ? (1000 + (counter % 100)) : counter; + bool muted = App::histories().unreadOnlyMuted(); if (_trayIconImage.isNull() || _trayIconImage.width() != _trayIconSize || muted != _trayIconMuted || counterSlice != _trayIconCount) { if (_trayIconImageBack.isNull() || _trayIconImageBack.width() != _trayIconSize) { _trayIconImageBack = App::wnd()->iconLarge().scaled(_trayIconSize, _trayIconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); @@ -286,8 +286,8 @@ namespace { } QString _trayIconImageFile() { - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted), counterSlice = (counter >= 1000) ? (1000 + (counter % 100)) : counter; - bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; + int32 counter = App::histories().unreadBadge(), counterSlice = (counter >= 1000) ? (1000 + (counter % 100)) : counter; + bool muted = App::histories().unreadOnlyMuted(); QString name = cWorkingDir() + qsl("tdata/ticons/ico%1_%2_%3.png").arg(muted ? "mute" : "").arg(_trayIconSize).arg(counterSlice); QFileInfo info(name); @@ -621,7 +621,7 @@ void PsMainWindow::psUpdateIndicator() { void PsMainWindow::psUpdateCounter() { setWindowIcon(wndIcon); - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); + int32 counter = App::histories().unreadBadge(); setWindowTitle((counter > 0) ? qsl("Telegram (%1)").arg(counter) : qsl("Telegram")); if (_psUnityLauncherEntry) { @@ -645,8 +645,8 @@ void PsMainWindow::psUpdateCounter() { ps_gtk_status_icon_set_from_pixbuf(_trayIcon, _trayPixbuf); } } else if (trayIcon) { - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); - bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; + int32 counter = App::histories().unreadBadge(); + bool muted = App::histories().unreadOnlyMuted(); style::color bg = muted ? st::counterMuteBG : st::counterBG; QIcon iconSmall; diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 7f2cf95082..2f8971696f 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -176,7 +176,7 @@ void _placeCounter(QImage &img, int size, int count, style::color bg, style::col } void PsMainWindow::psUpdateCounter() { - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); + int32 counter = App::histories().unreadBadge(); setWindowTitle((counter > 0) ? qsl("Telegram (%1)").arg(counter) : qsl("Telegram")); setWindowIcon(wndIcon); @@ -185,7 +185,7 @@ void PsMainWindow::psUpdateCounter() { _private.setWindowBadge(counter ? cnt : QString()); if (trayIcon) { - bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; + bool muted = App::histories().unreadOnlyMuted(); bool dm = objc_darkMode(); style::color bg = muted ? st::counterMuteBG : st::counterBG; diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 02077ba674..6b91561eba 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -1133,8 +1133,8 @@ static HICON _qt_createHIcon(const QIcon &icon, int xSize, int ySize) { } void PsMainWindow::psUpdateCounter() { - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); - bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; + int32 counter = App::histories().unreadBadge(); + bool muted = App::histories().unreadOnlyMuted(); style::color bg = muted ? st::counterMuteBG : st::counterBG; QIcon iconSmall, iconBig; diff --git a/Telegram/SourceFiles/title.cpp b/Telegram/SourceFiles/title.cpp index 2bc52abc63..28069d257b 100644 --- a/Telegram/SourceFiles/title.cpp +++ b/Telegram/SourceFiles/title.cpp @@ -266,8 +266,8 @@ void TitleWidget::updateAdaptiveLayout() { void TitleWidget::updateCounter() { if (!Adaptive::OneColumn() || !MTP::authedId()) return; - int32 counter = App::histories().unreadFull - (cIncludeMuted() ? 0 : App::histories().unreadMuted); - bool muted = cIncludeMuted() ? (App::histories().unreadMuted >= counter) : false; + int32 counter = App::histories().unreadBadge(); + bool muted = App::histories().unreadOnlyMuted(); style::color bg = muted ? st::counterMuteBG : st::counterBG; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 2814ce5ccb..68d6864ced 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -554,6 +554,42 @@ static int32 QuarterArcLength = (FullArcLength / 4); static int32 MinArcLength = (FullArcLength / 360); static int32 AlmostFullArcLength = (FullArcLength - MinArcLength); +template +class RefPairImplementation { +public: + template + const RefPairImplementation &operator=(const RefPairImplementation &other) const { + _first = other._first; + _second = other._second; + return *this; + } + + template + const RefPairImplementation &operator=(const QPair &other) const { + _first = other.first; + _second = other.second; + return *this; + } + +private: + RefPairImplementation(T1 &first, T2 &second) : _first(first), _second(second) { + } + RefPairImplementation(const RefPairImplementation &other); + + template + friend RefPairImplementation RefPairCreator(T3 &first, T4 &second); + + T1 &_first; + T2 &_second; +}; + +template +inline RefPairImplementation RefPairCreator(T1 &first, T2 &second) { + return RefPairImplementation(first, second); +} + +#define RefPair(Type1, Name1, Type2, Name2) Type1 Name1; Type2 Name2; RefPairCreator(Name1, Name2) + template inline void destroyImplementation(I *&ptr) { if (ptr) { From b678913da539ca7ea3759d1991620e8c65a62ee1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 28 Feb 2016 15:36:23 +0300 Subject: [PATCH 144/316] improved rpcClear() when deleting a complex RPCSender, clearing recent inline bots on logout --- Telegram/SourceFiles/app.cpp | 1 + Telegram/SourceFiles/dialogswidget.h | 5 +++++ Telegram/SourceFiles/historywidget.h | 4 ++-- Telegram/SourceFiles/intro/intro.cpp | 10 +++++----- Telegram/SourceFiles/intro/intro.h | 4 ++-- Telegram/SourceFiles/intro/intropwdcheck.h | 2 +- Telegram/SourceFiles/intro/introsteps.h | 1 - Telegram/SourceFiles/mainwidget.cpp | 12 ++++++------ Telegram/SourceFiles/mainwidget.h | 13 +++++++++++-- Telegram/SourceFiles/mtproto/mtp.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpFileLoader.h | 2 +- Telegram/SourceFiles/mtproto/mtpRPC.h | 14 ++++++++++---- Telegram/SourceFiles/overviewwidget.h | 16 ++++++++++------ Telegram/SourceFiles/profilewidget.h | 12 ++++++++---- Telegram/SourceFiles/settingswidget.cpp | 4 ++-- Telegram/SourceFiles/settingswidget.h | 2 +- Telegram/SourceFiles/structs.cpp | 6 +++--- Telegram/SourceFiles/window.cpp | 10 +++++----- 18 files changed, 74 insertions(+), 46 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index dc77d01e83..e88ba331c4 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1843,6 +1843,7 @@ namespace App { updatedPeers.clear(); cSetSavedPeers(SavedPeers()); cSetSavedPeersByTime(SavedPeersByTime()); + cSetRecentInlineBots(RecentInlineBots()); for (PeersData::const_iterator i = peersData.cbegin(), e = peersData.cend(); i != e; ++i) { delete *i; } diff --git a/Telegram/SourceFiles/dialogswidget.h b/Telegram/SourceFiles/dialogswidget.h index dfa643f5bd..6443a08d60 100644 --- a/Telegram/SourceFiles/dialogswidget.h +++ b/Telegram/SourceFiles/dialogswidget.h @@ -259,6 +259,11 @@ public: void updateNotifySettings(PeerData *peer); + void rpcClear() override { + _inner.rpcClear(); + RPCSender::rpcClear(); + } + void notify_userIsContactChanged(UserData *user, bool fromThisApp); signals: diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 2a4b49fe95..786de93530 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -569,12 +569,12 @@ public: bool contentOverlapped(const QRect &globalRect); - void grabStart() { + void grabStart() override { _sideShadow.hide(); _inGrab = true; resizeEvent(0); } - void grabFinish() { + void grabFinish() override { _sideShadow.setVisible(!Adaptive::OneColumn()); _inGrab = false; resizeEvent(0); diff --git a/Telegram/SourceFiles/intro/intro.cpp b/Telegram/SourceFiles/intro/intro.cpp index c62b8d55cb..ec2c1bafde 100644 --- a/Telegram/SourceFiles/intro/intro.cpp +++ b/Telegram/SourceFiles/intro/intro.cpp @@ -428,11 +428,11 @@ void IntroWidget::keyPressEvent(QKeyEvent *e) { void IntroWidget::updateAdaptiveLayout() { } -void IntroWidget::rpcInvalidate() { - if (phone) phone->rpcInvalidate(); - if (code) code->rpcInvalidate(); - if (signup) signup->rpcInvalidate(); - if (pwdcheck) pwdcheck->rpcInvalidate(); +void IntroWidget::rpcClear() { + if (phone) phone->rpcClear(); + if (code) code->rpcClear(); + if (signup) signup->rpcClear(); + if (pwdcheck) pwdcheck->rpcClear(); } IntroWidget::~IntroWidget() { diff --git a/Telegram/SourceFiles/intro/intro.h b/Telegram/SourceFiles/intro/intro.h index 7ce176f0ca..bec0f7eb08 100644 --- a/Telegram/SourceFiles/intro/intro.h +++ b/Telegram/SourceFiles/intro/intro.h @@ -29,7 +29,7 @@ class IntroPwdCheck; class IntroStage; class Text; -class IntroWidget : public TWidget { +class IntroWidget final : public TWidget { Q_OBJECT public: @@ -71,7 +71,7 @@ public: void finish(const MTPUser &user, const QImage &photo = QImage()); - void rpcInvalidate(); + void rpcClear(); void langChangeTo(int32 langId); ~IntroWidget(); diff --git a/Telegram/SourceFiles/intro/intropwdcheck.h b/Telegram/SourceFiles/intro/intropwdcheck.h index 5f29c9b3c5..9a0d1c1f69 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.h +++ b/Telegram/SourceFiles/intro/intropwdcheck.h @@ -25,7 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "gui/flatinput.h" #include "intro.h" -class IntroPwdCheck : public IntroStage, public RPCSender { +class IntroPwdCheck final : public IntroStage, public RPCSender { Q_OBJECT public: diff --git a/Telegram/SourceFiles/intro/introsteps.h b/Telegram/SourceFiles/intro/introsteps.h index 4522f46622..e554f11fb9 100644 --- a/Telegram/SourceFiles/intro/introsteps.h +++ b/Telegram/SourceFiles/intro/introsteps.h @@ -20,7 +20,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -#include #include "gui/flatbutton.h" #include "intro.h" diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 735892f4d2..1cd34b51df 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2240,14 +2240,14 @@ void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool bac profile->hide(); profile->clear(); profile->deleteLater(); - profile->rpcInvalidate(); + profile->rpcClear(); profile = 0; } if (overview) { overview->hide(); overview->clear(); overview->deleteLater(); - overview->rpcInvalidate(); + overview->rpcClear(); overview = 0; } clearBotStartToken(_peerInStack); @@ -2390,13 +2390,13 @@ void MainWidget::showMediaOverview(PeerData *peer, MediaOverviewType type, bool overview->hide(); overview->clear(); overview->deleteLater(); - overview->rpcInvalidate(); + overview->rpcClear(); } if (profile) { profile->hide(); profile->clear(); profile->deleteLater(); - profile->rpcInvalidate(); + profile->rpcClear(); profile = 0; } overview = new OverviewWidget(this, peer, type); @@ -2446,14 +2446,14 @@ void MainWidget::showPeerProfile(PeerData *peer, bool back, int32 lastScrollTop) overview->hide(); overview->clear(); overview->deleteLater(); - overview->rpcInvalidate(); + overview->rpcClear(); overview = 0; } if (profile) { profile->hide(); profile->clear(); profile->deleteLater(); - profile->rpcInvalidate(); + profile->rpcClear(); } profile = new ProfileWidget(this, peer); _topBar.show(); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 7f417acbc0..660793df49 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -59,10 +59,10 @@ public: FlatButton *mediaTypeButton(); - void grabStart() { + void grabStart() override { _sideShadow.hide(); } - void grabFinish() { + void grabFinish() override { _sideShadow.setVisible(!Adaptive::OneColumn()); } @@ -417,6 +417,15 @@ public: QPixmap grabTopBar(); QPixmap grabInner(); + void rpcClear() override { + history.rpcClear(); + dialogs.rpcClear(); + if (profile) profile->rpcClear(); + if (overview) overview->rpcClear(); + if (_api) _api->rpcClear(); + RPCSender::rpcClear(); + } + bool isItemVisible(HistoryItem *item); void ui_repaintHistoryItem(const HistoryItem *item); diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 7b834ce511..781e6f2ff4 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -154,7 +154,7 @@ namespace { bool onErrorDefault(mtpRequestId requestId, const RPCError &error) { const QString &err(error.type()); int32 code = error.code(); - if (!mtpIsFlood(error)) { + if (!mtpIsFlood(error) && err != qsl("AUTH_KEY_UNREGISTERED")) { int breakpoint = 0; } bool badGuestDC = (code == 400) && (err == qsl("FILE_ID_INVALID")); diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.h b/Telegram/SourceFiles/mtproto/mtpFileLoader.h index 9446c979b5..f64ac4d456 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.h +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.h @@ -236,7 +236,7 @@ public: } virtual void stop() { - rpcInvalidate(); + rpcClear(); } ~mtpFileLoader(); diff --git a/Telegram/SourceFiles/mtproto/mtpRPC.h b/Telegram/SourceFiles/mtproto/mtpRPC.h index c12f4c3f59..09b13781ad 100644 --- a/Telegram/SourceFiles/mtproto/mtpRPC.h +++ b/Telegram/SourceFiles/mtproto/mtpRPC.h @@ -791,6 +791,16 @@ public: return RPCFailHandlerPtr(new RPCBindedFailHandlerOwnedNo(b, static_cast(this), onFail)); } + virtual void rpcClear() { + rpcInvalidate(); + } + + virtual ~RPCSender() { + rpcInvalidate(); + } + +protected: + void rpcInvalidate() { for (DoneHandlers::iterator i = _rpcDoneHandlers.begin(), e = _rpcDoneHandlers.end(); i != e; ++i) { (*i)->invalidate(); @@ -802,10 +812,6 @@ public: _rpcFailHandlers.clear(); } - ~RPCSender() { - rpcInvalidate(); - } - }; typedef void (*MTPStateChangedHandler)(int32 dcId, int32 state); diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index f06da8a254..968ccd773b 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -71,7 +71,7 @@ public: void changingMsgId(HistoryItem *row, MsgId newId); void repaintItem(const HistoryItem *msg); void itemRemoved(HistoryItem *item); - + void getSelectionState(int32 &selectedForForward, int32 &selectedForDelete) const; void clearSelectedItems(bool onlyTextSelection = false); void fillSelectedItems(SelectedItemSet &sel, bool forDelete = true); @@ -146,7 +146,7 @@ private: bool _reversed; History *_migrated, *_history; ChannelId _channel; - + bool _selMode; uint32 itemSelectedValue(int32 index) const; @@ -275,30 +275,34 @@ public: void mediaOverviewUpdated(PeerData *peer, MediaOverviewType type); void changingMsgId(HistoryItem *row, MsgId newId); void itemRemoved(HistoryItem *item); - + QPoint clampMousePosition(QPoint point); void checkSelectingScroll(QPoint point); void noSelectingScroll(); bool touchScroll(const QPoint &delta); - + void fillSelectedItems(SelectedItemSet &sel, bool forDelete); void updateScrollColors(); void updateAfterDrag(); - void grabStart() { + void grabStart() override { _sideShadow.hide(); _inGrab = true; resizeEvent(0); } - void grabFinish() { + void grabFinish() override { _sideShadow.setVisible(!Adaptive::OneColumn()); _inGrab = false; resizeEvent(0); } + void rpcClear() override { + _inner.rpcClear(); + RPCSender::rpcClear(); + } void ui_repaintHistoryItem(const HistoryItem *item); diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 73fcf2f241..89da54afb0 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -48,7 +48,7 @@ public: PeerData *peer() const; bool allMediaShown() const; - + void updateOnlineDisplay(); void updateOnlineDisplayTimer(); void reorderParticipants(); @@ -65,7 +65,7 @@ public: void allowDecreaseHeight(int32 decreaseBy); ~ProfileInner(); - + public slots: void peerUpdated(PeerData *data); @@ -247,16 +247,20 @@ public: void mediaOverviewUpdated(PeerData *peer, MediaOverviewType type); void updateAdaptiveLayout(); - void grabStart() { + void grabStart() override { _sideShadow.hide(); _inGrab = true; resizeEvent(0); } - void grabFinish() { + void grabFinish() override { _sideShadow.setVisible(!Adaptive::OneColumn()); _inGrab = false; resizeEvent(0); } + void rpcClear() override { + _inner.rpcClear(); + RPCSender::rpcClear(); + } void clear(); ~ProfileWidget(); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 89e0925c5e..a6c0b8d887 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -1945,8 +1945,8 @@ void SettingsWidget::updateConnectionType() { _inner.updateConnectionType(); } -void SettingsWidget::rpcInvalidate() { - _inner.rpcInvalidate(); +void SettingsWidget::rpcClear() { + _inner.rpcClear(); } void SettingsWidget::usernameChanged() { diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index 65e222fcb3..d2ed56902d 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -330,7 +330,7 @@ public: void updateDisplayNotify(); - void rpcInvalidate(); + void rpcClear(); void usernameChanged(); void setInnerFocus(); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 0ce99caad2..3664b9bf05 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -1203,7 +1203,7 @@ bool DocumentData::loaded(bool check) const { if (loading() && _loader->done()) { if (_loader->fileType() == mtpc_storage_fileUnknown) { _loader->deleteLater(); - _loader->rpcInvalidate(); + _loader->rpcClear(); _loader = CancelledMtpFileLoader; } else { DocumentData *that = const_cast(this); @@ -1214,7 +1214,7 @@ bool DocumentData::loaded(bool check) const { } _loader->deleteLater(); - _loader->rpcInvalidate(); + _loader->rpcClear(); _loader = 0; } notifyLayoutChanged(); @@ -1296,7 +1296,7 @@ void DocumentData::cancel() { if (l) { l->cancel(); l->deleteLater(); - l->rpcInvalidate(); + l->rpcClear(); notifyLayoutChanged(); } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 96a9b0a4a0..c3ecdbd686 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -504,21 +504,21 @@ void Window::clearWidgets() { settings->stop_show(); settings->hide(); settings->deleteLater(); - settings->rpcInvalidate(); + settings->rpcClear(); settings = 0; } if (main) { main->animStop_show(); main->hide(); main->deleteLater(); - main->rpcInvalidate(); + main->rpcClear(); main = 0; } if (intro) { intro->stop_show(); intro->hide(); intro->deleteLater(); - intro->rpcInvalidate(); + intro->rpcClear(); intro = 0; } title->updateBackButton(); @@ -724,7 +724,7 @@ void Window::hideSettings(bool fast) { settings->stop_show(); settings->hide(); settings->deleteLater(); - settings->rpcInvalidate(); + settings->rpcClear(); settings = 0; if (intro) { intro->show(); @@ -737,7 +737,7 @@ void Window::hideSettings(bool fast) { settings->stop_show(); settings->hide(); settings->deleteLater(); - settings->rpcInvalidate(); + settings->rpcClear(); settings = 0; if (intro) { intro->animShow(bg, true); From 5b345cbc2dfc8e67701ef560882b24994662797e Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 28 Feb 2016 16:23:03 +0300 Subject: [PATCH 145/316] some asserts added to imagePix() --- Telegram/SourceFiles/gui/images.cpp | 25 +++++++++++++++++++++++-- Telegram/SourceFiles/layout.cpp | 3 +-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/gui/images.cpp b/Telegram/SourceFiles/gui/images.cpp index 8bebc9ddf0..eda1211031 100644 --- a/Telegram/SourceFiles/gui/images.cpp +++ b/Telegram/SourceFiles/gui/images.cpp @@ -264,6 +264,7 @@ QImage imageBlur(QImage img) { QImage::Format fmt = img.format(); if (fmt != QImage::Format_RGB32 && fmt != QImage::Format_ARGB32_Premultiplied) { img = img.convertToFormat(QImage::Format_ARGB32_Premultiplied); + t_assert(!img.isNull()); } uchar *pix = img.bits(); @@ -287,6 +288,8 @@ QImage imageBlur(QImage img) { QImage was = img; img = imgsmall; imgsmall = QImage(); + t_assert(!img.isNull()); + pix = img.bits(); if (!pix) return was; } @@ -373,12 +376,18 @@ yi += stride; } void imageRound(QImage &img) { + t_assert(!img.isNull()); + img.setDevicePixelRatio(cRetinaFactor()); img = img.convertToFormat(QImage::Format_ARGB32_Premultiplied); + t_assert(!img.isNull()); QImage **masks = App::cornersMask(); int32 w = masks[0]->width(), h = masks[0]->height(); int32 tw = img.width(), th = img.height(); + if (tw < 2 * w || th < 2 * h) { + return; + } uchar *bits = img.bits(); const uchar *c0 = masks[0]->constBits(), *c1 = masks[1]->constBits(), *c2 = masks[2]->constBits(), *c3 = masks[3]->constBits(); @@ -427,12 +436,18 @@ QImage imageColored(const style::color &add, QImage img) { } QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) { - if (blurred) img = imageBlur(img); + t_assert(!img.isNull()); + if (blurred) { + 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); + t_assert(!img.isNull()); } else { img = img.scaled(w, h, Qt::IgnoreAspectRatio, smooth ? Qt::SmoothTransformation : Qt::FastTransformation); + t_assert(!img.isNull()); } if (outerw > 0 && outerh > 0) { outerw *= cIntRetinaFactor(); @@ -449,9 +464,13 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r p.drawImage((result.width() - img.width()) / (2 * cIntRetinaFactor()), (result.height() - img.height()) / (2 * cIntRetinaFactor()), img); } img = result; + t_assert(!img.isNull()); } } - if (rounded) imageRound(img); + if (rounded) { + imageRound(img); + t_assert(!img.isNull()); + } img.setDevicePixelRatio(cRetinaFactor()); return QPixmap::fromImage(img, Qt::ColorOnly); } @@ -459,6 +478,7 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) const { if (!loading()) const_cast(this)->load(); restore(); + if (_data.isNull()) { if (h <= 0 && height() > 0) { h = qRound(width() * w / float64(height())); @@ -489,6 +509,7 @@ QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool roun if (rounded) imageRound(result); return QPixmap::fromImage(result, Qt::ColorOnly); } + return imagePix(_data.toImage(), w, h, smooth, blurred, rounded, outerw, outerh); } diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index fb5bbe3c1f..31605b763c 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -422,8 +422,7 @@ void LayoutOverviewVideo::paint(Painter &p, const QRect &clip, uint32 selection, if (_thumbLoaded && !_data->thumb->isNull()) { int32 size = _width * cIntRetinaFactor(); - QImage img = _data->thumb->pix().toImage(); - img = imageBlur(img); + QImage img = imageBlur(_data->thumb->pix().toImage()); if (img.width() == img.height()) { if (img.width() != size) { img = img.scaled(size, size, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); From 0e49c1396874da9a5fe899197ba6bd3d73764ae4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 28 Feb 2016 16:54:04 +0300 Subject: [PATCH 146/316] rpcClear for mediaview, ImageLink changed to Location --- Telegram/SourceFiles/app.cpp | 27 ++--- Telegram/SourceFiles/app.h | 3 +- Telegram/SourceFiles/gui/text.cpp | 4 +- Telegram/SourceFiles/gui/text.h | 22 +++- Telegram/SourceFiles/history.cpp | 127 +++++++++-------------- Telegram/SourceFiles/history.h | 39 +++---- Telegram/SourceFiles/pspecific_linux.cpp | 2 +- Telegram/SourceFiles/pspecific_linux.h | 2 +- Telegram/SourceFiles/pspecific_mac.cpp | 4 +- Telegram/SourceFiles/pspecific_mac.h | 2 +- Telegram/SourceFiles/pspecific_wnd.cpp | 4 +- Telegram/SourceFiles/pspecific_wnd.h | 2 +- Telegram/SourceFiles/window.cpp | 6 ++ 13 files changed, 108 insertions(+), 136 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index e88ba331c4..d434bc26ea 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -49,8 +49,8 @@ namespace { PhotosData photosData; DocumentsData documentsData; - typedef QHash ImageLinksData; - ImageLinksData imageLinksData; + typedef QHash LocationsData; + LocationsData locationsData; typedef QHash WebPagesData; WebPagesData webPagesData; @@ -1671,27 +1671,14 @@ namespace App { return result; } - ImageLinkData *imageLink(const QString &imageLink) { - ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink); - if (i == imageLinksData.cend()) { - i = imageLinksData.insert(imageLink, new ImageLinkData(imageLink)); + LocationData *location(const LocationCoords &coords) { + LocationsData::const_iterator i = locationsData.constFind(coords); + if (i == locationsData.cend()) { + i = locationsData.insert(coords, new LocationData(coords)); } return i.value(); } - ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type) { - ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink); - ImageLinkData *result; - if (i == imageLinksData.cend()) { - result = new ImageLinkData(imageLink); - imageLinksData.insert(imageLink, result); - result->type = type; - } else { - result = i.value(); - } - return result; - } - void forgetMedia() { lastPhotos.clear(); lastPhotosMap.clear(); @@ -1701,7 +1688,7 @@ namespace App { for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) { i.value()->forget(); } - for (ImageLinksData::const_iterator i = imageLinksData.cbegin(), e = imageLinksData.cend(); i != e; ++i) { + for (LocationsData::const_iterator i = ::locationsData.cbegin(), e = ::locationsData.cend(); i != e; ++i) { i.value()->thumb->forget(); } } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index a23c92c39a..b206d462e4 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -134,8 +134,7 @@ namespace App { DocumentData *documentSet(const DocumentId &document, DocumentData *convert, const uint64 &access, int32 date, const QVector &attributes, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size, const StorageImageLocation &thumbLocation); WebPageData *webPage(const WebPageId &webPage); WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill); - ImageLinkData *imageLink(const QString &imageLink); - ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type); + LocationData *location(const LocationCoords &coords); void forgetMedia(); MTPPhoto photoFromUserPhoto(MTPint userId, MTPint date, const MTPUserProfilePhoto &photo); diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 958401f1fc..591a6d782f 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -955,13 +955,13 @@ void CustomTextLink::onClick(Qt::MouseButton button) const { } void LocationLink::onClick(Qt::MouseButton button) const { - if (!psLaunchMaps(_lat, _lon)) { + if (!psLaunchMaps(_coords)) { QDesktopServices::openUrl(_text); } } void LocationLink::setup() { - QString latlon = _lat + ',' + _lon; + QString latlon(qsl("%1,%2").arg(_coords.lat).arg(_coords.lon)); _text = qsl("https://maps.google.com/maps?q=") + latlon + qsl("&ll=") + latlon + qsl("&z=16"); } diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index 7e270d81e9..944d83fff9 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -424,12 +424,29 @@ private: }; +struct LocationCoords { + LocationCoords() : lat(0), lon(0) { + } + LocationCoords(float64 lat, float64 lon) : lat(lat), lon(lon) { + } + float64 lat, lon; +}; +inline bool operator==(const LocationCoords &a, const LocationCoords &b) { + return (a.lat == b.lat) && (a.lon == b.lon); +} +inline bool operator<(const LocationCoords &a, const LocationCoords &b) { + return (a.lat < b.lat) || ((a.lat == b.lat) && (a.lon < b.lon)); +} +inline uint qHash(const LocationCoords &t, uint seed = 0) { + return qHash(QtPrivate::QHashCombine().operator()(qHash(t.lat), t.lon), seed); +} + class LocationLink : public ITextLink { TEXT_LINK_CLASS(LocationLink) public: - LocationLink(const QString &lat, const QString &lon) : _lat(lat), _lon(lon) { + LocationLink(const LocationCoords &coords) : _coords(coords) { setup(); } @@ -450,7 +467,8 @@ public: private: void setup(); - QString _lat, _lon, _text; + LocationCoords _coords; + QString _text; }; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 4a69bdd3d3..30ab9b24e2 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -5612,10 +5612,10 @@ HistoryWebPage::~HistoryWebPage() { } namespace { - ImageLinkManager manager; + LocationManager manager; } -void ImageLinkManager::init() { +void LocationManager::init() { if (manager) delete manager; manager = new QNetworkAccessManager(); App::setProxySettings(*manager); @@ -5635,11 +5635,11 @@ void ImageLinkManager::init() { black = new ImagePtr(p, "PNG"); } -void ImageLinkManager::reinit() { +void LocationManager::reinit() { if (manager) App::setProxySettings(*manager); } -void ImageLinkManager::deinit() { +void LocationManager::deinit() { if (manager) { delete manager; manager = 0; @@ -5664,33 +5664,27 @@ void deinitImageLinkManager() { manager.deinit(); } -void ImageLinkManager::getData(ImageLinkData *data) { +void LocationManager::getData(LocationData *data) { if (!manager) { DEBUG_LOG(("App Error: getting image link data without manager init!")); return failed(data); } - QString url; - switch (data->type) { - case GoogleMapsLink: { - int32 w = st::locationSize.width(), h = st::locationSize.height(); - int32 zoom = 13, scale = 1; - if (cScale() == dbisTwo || cRetina()) { - scale = 2; - } else { - w = convertScale(w); - h = convertScale(h); - } - url = qsl("https://maps.googleapis.com/maps/api/staticmap?center=") + data->id.mid(9) + qsl("&zoom=%1&size=%2x%3&maptype=roadmap&scale=%4&markers=color:red|size:big|").arg(zoom).arg(w).arg(h).arg(scale) + data->id.mid(9) + qsl("&sensor=false"); - QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url))); - imageLoadings[reply] = data; - } break; - default: { - failed(data); - } break; + + int32 w = st::locationSize.width(), h = st::locationSize.height(); + int32 zoom = 13, scale = 1; + if (cScale() == dbisTwo || cRetina()) { + scale = 2; + } else { + w = convertScale(w); + h = convertScale(h); } + QString coords = qsl("%1,%2").arg(data->coords.lat).arg(data->coords.lon); + QString url = qsl("https://maps.googleapis.com/maps/api/staticmap?center=") + coords + qsl("&zoom=%1&size=%2x%3&maptype=roadmap&scale=%4&markers=color:red|size:big|").arg(zoom).arg(w).arg(h).arg(scale) + coords + qsl("&sensor=false"); + QNetworkReply *reply = manager->get(QNetworkRequest(QUrl(url))); + imageLoadings[reply] = data; } -void ImageLinkManager::onFinished(QNetworkReply *reply) { +void LocationManager::onFinished(QNetworkReply *reply) { if (!manager) return; if (reply->error() != QNetworkReply::NoError) return onFailed(reply); @@ -5700,9 +5694,9 @@ void ImageLinkManager::onFinished(QNetworkReply *reply) { if (status == 301 || status == 302) { QString loc = reply->header(QNetworkRequest::LocationHeader).toString(); if (!loc.isEmpty()) { - QMap::iterator i = dataLoadings.find(reply); + QMap::iterator i = dataLoadings.find(reply); if (i != dataLoadings.cend()) { - ImageLinkData *d = i.value(); + LocationData *d = i.value(); if (serverRedirects.constFind(d) == serverRedirects.cend()) { serverRedirects.insert(d, 1); } else if (++serverRedirects[d] > MaxHttpRedirects) { @@ -5713,7 +5707,7 @@ void ImageLinkManager::onFinished(QNetworkReply *reply) { dataLoadings.insert(manager->get(QNetworkRequest(loc)), d); return; } else if ((i = imageLoadings.find(reply)) != imageLoadings.cend()) { - ImageLinkData *d = i.value(); + LocationData *d = i.value(); if (serverRedirects.constFind(d) == serverRedirects.cend()) { serverRedirects.insert(d, 1); } else if (++serverRedirects[d] > MaxHttpRedirects) { @@ -5732,8 +5726,8 @@ void ImageLinkManager::onFinished(QNetworkReply *reply) { } } - ImageLinkData *d = 0; - QMap::iterator i = dataLoadings.find(reply); + LocationData *d = 0; + QMap::iterator i = dataLoadings.find(reply); if (i != dataLoadings.cend()) { d = i.value(); dataLoadings.erase(i); @@ -5744,9 +5738,7 @@ void ImageLinkManager::onFinished(QNetworkReply *reply) { DEBUG_LOG(("JSON Error: Bad json received in onFinished() for image link")); return onFailed(reply); } - switch (d->type) { - case GoogleMapsLink: failed(d); break; - } + failed(d); if (App::main()) App::main()->update(); } else { @@ -5777,11 +5769,11 @@ void ImageLinkManager::onFinished(QNetworkReply *reply) { } } -void ImageLinkManager::onFailed(QNetworkReply *reply) { +void LocationManager::onFailed(QNetworkReply *reply) { if (!manager) return; - ImageLinkData *d = 0; - QMap::iterator i = dataLoadings.find(reply); + LocationData *d = 0; + QMap::iterator i = dataLoadings.find(reply); if (i != dataLoadings.cend()) { d = i.value(); dataLoadings.erase(i); @@ -5792,19 +5784,19 @@ void ImageLinkManager::onFailed(QNetworkReply *reply) { imageLoadings.erase(i); } } - DEBUG_LOG(("Network Error: failed to get data for image link %1, error %2").arg(d ? d->id : 0).arg(reply->errorString())); + DEBUG_LOG(("Network Error: failed to get data for image link %1,%2 error %3").arg(d ? d->coords.lat : 0).arg(d ? d->coords.lon : 0).arg(reply->errorString())); if (d) { failed(d); } } -void ImageLinkManager::failed(ImageLinkData *data) { +void LocationManager::failed(LocationData *data) { data->loading = false; data->thumb = *black; serverRedirects.remove(data); } -void ImageLinkData::load() { +void LocationData::load() { if (!thumb->isNull()) return thumb->load(false, false); if (loading) return; @@ -5812,7 +5804,7 @@ void ImageLinkData::load() { manager.getData(this); } -HistoryImageLink::HistoryImageLink(const QString &url, const QString &title, const QString &description) : HistoryMedia(), +HistoryLocation::HistoryLocation(const LocationCoords &coords, const QString &title, const QString &description) : HistoryMedia(), _title(st::msgMinWidth), _description(st::msgMinWidth) { if (!title.isEmpty()) { @@ -5822,16 +5814,11 @@ _description(st::msgMinWidth) { _description.setText(st::webPageDescriptionFont, textClean(description), _webpageDescriptionOptions); } - QRegularExpressionMatch m = QRegularExpression(qsl("^location:(-?\\d+(?:\\.\\d+)?),(-?\\d+(?:\\.\\d+)?)$")).match(url); - if (m.hasMatch()) { - _link.reset(new LocationLink(m.captured(1), m.captured(2))); - _data = App::imageLinkSet(url, GoogleMapsLink); - } else { - _link.reset(new TextLink(url)); - } + _link.reset(new LocationLink(coords)); + _data = App::location(coords); } -void HistoryImageLink::initDimensions(const HistoryItem *parent) { +void HistoryLocation::initDimensions(const HistoryItem *parent) { bool bubble = parent->hasBubble(); int32 tw = fullWidth(), th = fullHeight(); @@ -5862,7 +5849,7 @@ void HistoryImageLink::initDimensions(const HistoryItem *parent) { } } -int32 HistoryImageLink::resize(int32 width, const HistoryItem *parent) { +int32 HistoryLocation::resize(int32 width, const HistoryItem *parent) { bool bubble = parent->hasBubble(); _width = qMin(width, _maxw); @@ -5903,7 +5890,7 @@ int32 HistoryImageLink::resize(int32 width, const HistoryItem *parent) { return _height; } -void HistoryImageLink::draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const { +void HistoryLocation::draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const { if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; int32 skipx = 0, skipy = 0, width = _width, height = _height; bool bubble = parent->hasBubble(); @@ -5967,7 +5954,7 @@ void HistoryImageLink::draw(Painter &p, const HistoryItem *parent, const QRect & } } -void HistoryImageLink::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const { +void HistoryLocation::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const { if (_width < st::msgPadding.left() + st::msgPadding.right() + 1) return; int32 skipx = 0, skipy = 0, width = _width, height = _height; bool bubble = parent->hasBubble(); @@ -6009,40 +5996,20 @@ void HistoryImageLink::getState(TextLinkPtr &lnk, HistoryCursorState &state, int } } -const QString HistoryImageLink::inDialogsText() const { - if (_data) { - switch (_data->type) { - case GoogleMapsLink: return lang(lng_maps_point); - } - } - return QString(); +const QString HistoryLocation::inDialogsText() const { + return lang(lng_maps_point); } -const QString HistoryImageLink::inHistoryText() const { - if (_data) { - switch (_data->type) { - case GoogleMapsLink: return qsl("[ ") + lang(lng_maps_point) + qsl(" : ") + _link->text() + qsl(" ]"); - } - } - return qsl("[ Link : ") + _link->text() + qsl(" ]"); +const QString HistoryLocation::inHistoryText() const { + return qsl("[ ") + lang(lng_maps_point) + qsl(" : ") + _link->text() + qsl(" ]"); } -int32 HistoryImageLink::fullWidth() const { - if (_data) { - switch (_data->type) { - case GoogleMapsLink: return st::locationSize.width(); - } - } - return st::minPhotoSize; +int32 HistoryLocation::fullWidth() const { + return st::locationSize.width(); } -int32 HistoryImageLink::fullHeight() const { - if (_data) { - switch (_data->type) { - case GoogleMapsLink: return st::locationSize.height(); - } - } - return st::minPhotoSize; +int32 HistoryLocation::fullHeight() const { + return st::locationSize.height(); } void ViaInlineBotLink::onClick(Qt::MouseButton button) const { @@ -6285,14 +6252,14 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tTex const MTPGeoPoint &point(media->c_messageMediaGeo().vgeo); if (point.type() == mtpc_geoPoint) { const MTPDgeoPoint &d(point.c_geoPoint()); - _media = new HistoryImageLink(qsl("location:%1,%2").arg(d.vlat.v).arg(d.vlong.v)); + _media = new HistoryLocation(LocationCoords(d.vlat.v, d.vlong.v)); } } break; case mtpc_messageMediaVenue: { const MTPDmessageMediaVenue &d(media->c_messageMediaVenue()); if (d.vgeo.type() == mtpc_geoPoint) { const MTPDgeoPoint &g(d.vgeo.c_geoPoint()); - _media = new HistoryImageLink(qsl("location:%1,%2").arg(g.vlat.v).arg(g.vlong.v), qs(d.vtitle), qs(d.vaddress)); + _media = new HistoryLocation(LocationCoords(g.vlat.v, g.vlong.v), qs(d.vtitle), qs(d.vaddress)); } } break; case mtpc_messageMediaPhoto: { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 237670ecff..436997fbe3 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -120,7 +120,7 @@ enum HistoryMediaType { MediaTypeFile, MediaTypeGif, MediaTypeSticker, - MediaTypeImageLink, + MediaTypeLocation, MediaTypeWebPage, MediaTypeMusicFile, MediaTypeVoiceFile, @@ -1973,59 +1973,54 @@ void initImageLinkManager(); void reinitImageLinkManager(); void deinitImageLinkManager(); -enum ImageLinkType { - InvalidImageLink = 0, - GoogleMapsLink -}; -struct ImageLinkData { - ImageLinkData(const QString &id) : id(id), type(InvalidImageLink), loading(false) { +struct LocationData { + LocationData(const LocationCoords &coords) : coords(coords), loading(false) { } - QString id; + LocationCoords coords; ImagePtr thumb; - ImageLinkType type; bool loading; void load(); }; -class ImageLinkManager : public QObject { +class LocationManager : public QObject { Q_OBJECT public: - ImageLinkManager() : manager(0), black(0) { + LocationManager() : manager(0), black(0) { } void init(); void reinit(); void deinit(); - void getData(ImageLinkData *data); + void getData(LocationData *data); - ~ImageLinkManager() { + ~LocationManager() { deinit(); } - public slots: +public slots: void onFinished(QNetworkReply *reply); void onFailed(QNetworkReply *reply); private: - void failed(ImageLinkData *data); + void failed(LocationData *data); QNetworkAccessManager *manager; - QMap dataLoadings, imageLoadings; - QMap serverRedirects; + QMap dataLoadings, imageLoadings; + QMap serverRedirects; ImagePtr *black; }; -class HistoryImageLink : public HistoryMedia { +class HistoryLocation : public HistoryMedia { public: - HistoryImageLink(const QString &url, const QString &title = QString(), const QString &description = QString()); + HistoryLocation(const LocationCoords &coords, const QString &title = QString(), const QString &description = QString()); HistoryMediaType type() const { - return MediaTypeImageLink; + return MediaTypeLocation; } HistoryMedia *clone() const { - return new HistoryImageLink(*this); + return new HistoryLocation(*this); } void initDimensions(const HistoryItem *parent); @@ -2049,7 +2044,7 @@ public: } private: - ImageLinkData *_data; + LocationData *_data; Text _title, _description; TextLinkPtr _link; diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 7221645bc6..650c51f10a 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -1494,6 +1494,6 @@ bool linuxMoveFile(const char *from, const char *to) { return true; } -bool psLaunchMaps(const QString &lat, const QString &lon) { +bool psLaunchMaps(const LocationCoords &coords) { return false; } diff --git a/Telegram/SourceFiles/pspecific_linux.h b/Telegram/SourceFiles/pspecific_linux.h index 748a5639c9..0804e8deba 100644 --- a/Telegram/SourceFiles/pspecific_linux.h +++ b/Telegram/SourceFiles/pspecific_linux.h @@ -195,4 +195,4 @@ public: bool linuxMoveFile(const char *from, const char *to); -bool psLaunchMaps(const QString &lat, const QString &lon); +bool psLaunchMaps(const LocationCoords &coords); diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 2f8971696f..854ff00d28 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -910,8 +910,8 @@ QByteArray psPathBookmark(const QString &path) { return objc_pathBookmark(path); } -bool psLaunchMaps(const QString &lat, const QString &lon) { - return QDesktopServices::openUrl(qsl("https://maps.apple.com/?q=Point&z=16&ll=%1,%2").arg(lat).arg(lon)); +bool psLaunchMaps(const LocationCoords &coords) { + return QDesktopServices::openUrl(qsl("https://maps.apple.com/?q=Point&z=16&ll=%1,%2").arg(coords.lat).arg(coords.lon)); } QString strNotificationAboutThemeChange() { diff --git a/Telegram/SourceFiles/pspecific_mac.h b/Telegram/SourceFiles/pspecific_mac.h index 979e9825fd..596f9c866a 100644 --- a/Telegram/SourceFiles/pspecific_mac.h +++ b/Telegram/SourceFiles/pspecific_mac.h @@ -224,4 +224,4 @@ QString strNeedToReload(); QString strNeedToRefresh1(); QString strNeedToRefresh2(); -bool psLaunchMaps(const QString &lat, const QString &lon); +bool psLaunchMaps(const LocationCoords &coords); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 6b91561eba..1a2e461400 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -3660,6 +3660,6 @@ bool InitToastManager() { return true; } -bool psLaunchMaps(const QString &lat, const QString &lon) { - return QDesktopServices::openUrl(qsl("bingmaps:?lvl=16&collection=point.") + lat + '_' + lon + '_' + qsl("Point")); +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_wnd.h index 90bc466c46..0f149ad290 100644 --- a/Telegram/SourceFiles/pspecific_wnd.h +++ b/Telegram/SourceFiles/pspecific_wnd.h @@ -195,4 +195,4 @@ public: }; -bool psLaunchMaps(const QString &lat, const QString &lon); +bool psLaunchMaps(const LocationCoords &coords); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index c3ecdbd686..3431edfd51 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -521,6 +521,12 @@ void Window::clearWidgets() { intro->rpcClear(); intro = 0; } + if (_mediaView) { + if (!_mediaView->isHidden()) { + _mediaView->hide(); + } + _mediaView->rpcClear(); + } title->updateBackButton(); updateGlobalMenu(); } From fcd713b8a6d6ebccef84851d89183e987dfdbe87 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 28 Feb 2016 17:06:56 +0300 Subject: [PATCH 147/316] beta 9028001 --- Telegram/SourceFiles/config.h | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Version | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 2490993ad9..7c0ab7da00 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9028; static const wchar_t *AppVersionStr = L"0.9.28"; static const bool DevVersion = false; -//#define BETA_VERSION (9026001ULL) // just comment this line to build public version +#define BETA_VERSION (9028001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index e93f790374..6ad208fd05 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,28,0 - PRODUCTVERSION 0,9,28,0 + FILEVERSION 0,9,28,1 + PRODUCTVERSION 0,9,28,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.28.0" + VALUE "FileVersion", "0.9.28.1" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.28.0" + VALUE "ProductVersion", "0.9.28.1" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 3d7d55000c..e3f6eee41c 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.28 AppVersionStr 0.9.28 DevChannel 0 -BetaVersion 0 9026001 +BetaVersion 9028001 From 08072346fd77be9f9de4f8641d77527a627817b1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 29 Feb 2016 14:34:44 +0300 Subject: [PATCH 148/316] fixed crash in next/previous_chat(), MTP::dld/upl -> functions, download and upload sessions count reduced to 2 --- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/dialogswidget.cpp | 10 ++++++++++ Telegram/SourceFiles/fileuploader.cpp | 10 +++++----- Telegram/SourceFiles/mtproto/mtp.cpp | 16 ++-------------- Telegram/SourceFiles/mtproto/mtp.h | 10 ++++++++-- Telegram/SourceFiles/mtproto/mtpConnection.cpp | 4 ++-- Telegram/SourceFiles/mtproto/mtpFileLoader.cpp | 10 +++++----- 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 7c0ab7da00..1bffe5ad4b 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -51,8 +51,8 @@ enum { MTPIPv4ConnectionWaitTimeout = 1000, // 1 seconds waiting for ipv4, until we accept ipv6 MTPMillerRabinIterCount = 30, // 30 Miller-Rabin iterations for dh_prime primality check - MTPUploadSessionsCount = 4, // max 4 upload sessions is created - MTPDownloadSessionsCount = 4, // max 4 download sessions is created + MTPUploadSessionsCount = 2, // max 2 upload sessions is created + MTPDownloadSessionsCount = 2, // max 2 download sessions is created MTPKillFileSessionTimeout = 5000, // how much time without upload / download causes additional session kill MTPEnumDCTimeout = 8000, // 8 seconds timeout for help_getConfig to work (then move to other dc) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 29d3437f0c..c2b685e275 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -1522,6 +1522,11 @@ void DialogsInner::destroyData() { } void DialogsInner::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData *&outPeer, MsgId &outMsg) const { + if (!inPeer) { + outPeer = 0; + outMsg = 0; + return; + } if (_state == DefaultState) { DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(inPeer->id); if (i == dialogs.list.rowByPeer.constEnd()) { @@ -1606,6 +1611,11 @@ void DialogsInner::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData *&ou } void DialogsInner::peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData *&outPeer, MsgId &outMsg) const { + if (!inPeer) { + outPeer = 0; + outMsg = 0; + return; + } if (_state == DefaultState) { DialogsList::RowByPeer::const_iterator i = dialogs.list.rowByPeer.constFind(inPeer->id); if (i == dialogs.list.rowByPeer.constEnd()) { diff --git a/Telegram/SourceFiles/fileuploader.cpp b/Telegram/SourceFiles/fileuploader.cpp index 1bb0eb42e2..a9388ad85c 100644 --- a/Telegram/SourceFiles/fileuploader.cpp +++ b/Telegram/SourceFiles/fileuploader.cpp @@ -103,7 +103,7 @@ void FileUploader::currentFailed() { void FileUploader::killSessions() { for (int i = 0; i < MTPUploadSessionsCount; ++i) { - MTP::stopSession(MTP::upl[i]); + MTP::stopSession(MTP::upl(i)); } } @@ -187,9 +187,9 @@ void FileUploader::sendNext() { } mtpRequestId requestId; if (i->docSize > UseBigFilesFrom) { - requestId = MTP::send(MTPupload_SaveBigFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_int(i->docPartsCount), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl[todc]); + requestId = MTP::send(MTPupload_SaveBigFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_int(i->docPartsCount), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl(todc)); } else { - requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl[todc]); + requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl(todc)); } docRequestsSent.insert(requestId, i->docSentParts); dcMap.insert(requestId, todc); @@ -200,7 +200,7 @@ void FileUploader::sendNext() { } else { UploadFileParts::iterator part = parts.begin(); - mtpRequestId requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(partsOfId), MTP_int(part.key()), MTP_string(part.value())), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl[todc]); + mtpRequestId requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(partsOfId), MTP_int(part.key()), MTP_string(part.value())), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl(todc)); requestsSent.insert(requestId, part.value()); dcMap.insert(requestId, todc); sentSize += part.value().size(); @@ -246,7 +246,7 @@ void FileUploader::clear() { dcMap.clear(); sentSize = 0; for (int32 i = 0; i < MTPUploadSessionsCount; ++i) { - MTP::stopSession(MTP::upl[i]); + MTP::stopSession(MTP::upl(i)); sentSizes[i] = 0; } killSessionsTimer.stop(); diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 781e6f2ff4..1770bcef1e 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -627,20 +627,8 @@ namespace MTP { const uint32 cfg = 1 * _mtp_internal::dcShift; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum const uint32 lgt = 2 * _mtp_internal::dcShift; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum - const uint32 dld[MTPDownloadSessionsCount] = { // send(req, callbacks, MTP::dld[i] + dc) - for download - 0x10 * _mtp_internal::dcShift, - 0x11 * _mtp_internal::dcShift, - 0x12 * _mtp_internal::dcShift, - 0x13 * _mtp_internal::dcShift, - }; - const uint32 upl[MTPUploadSessionsCount] = { // send(req, callbacks, MTP::upl[i] + dc) - for upload - 0x20 * _mtp_internal::dcShift, - 0x21 * _mtp_internal::dcShift, - 0x22 * _mtp_internal::dcShift, - 0x23 * _mtp_internal::dcShift, - }; - const uint32 dldStart = dld[0], dldEnd = dld[(sizeof(dld) / sizeof(dld[0])) - 1] + _mtp_internal::dcShift; - const uint32 uplStart = upl[0], uplEnd = upl[(sizeof(upl) / sizeof(upl[0])) - 1] + _mtp_internal::dcShift; + const uint32 dldStart = dld(0), dldEnd = dld(MTPDownloadSessionsCount - 1) + _mtp_internal::dcShift; + const uint32 uplStart = upl(0), uplEnd = upl(MTPUploadSessionsCount - 1) + _mtp_internal::dcShift; void start() { if (started()) return; diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index ed2882e241..ac79f5e3c3 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -70,8 +70,14 @@ namespace MTP { extern const uint32 cfg; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum extern const uint32 lgt; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum - extern const uint32 dld[MTPDownloadSessionsCount]; // send(req, callbacks, MTP::dld[i] + dc) - for download - extern const uint32 upl[MTPUploadSessionsCount]; // send(req, callbacks, MTP::upl[i] + dc) - for upload + inline const uint32 dld(int32 index) { // send(req, callbacks, MTP::dld(i) + dc) - for download + t_assert(index >= 0 && index < MTPDownloadSessionsCount); + return (0x10 + index) * _mtp_internal::dcShift; + }; + inline const uint32 upl(int32 index) { // send(req, callbacks, MTP::upl[i] + dc) - for upload + t_assert(index >= 0 && index < MTPUploadSessionsCount); + return (0x20 + index) * _mtp_internal::dcShift; + }; extern const uint32 dldStart, dldEnd; // dc >= dldStart && dc < dldEnd => dc in dld extern const uint32 uplStart, uplEnd; // dc >= uplStart && dc < uplEnd => dc in upl diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 9e0e10a49c..e5959811b1 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -2119,9 +2119,9 @@ void MTProtoConnectionPrivate::onSentSome(uint64 size) { DEBUG_LOG(("Checking connect for request with size %1 bytes, delay will be %2").arg(size).arg(remain)); } } - if (dc >= MTP::upl[0] && dc < MTP::upl[MTPUploadSessionsCount - 1] + _mtp_internal::dcShift) { + if (dc >= MTP::uplStart && dc < MTP::uplEnd) { remain *= MTPUploadSessionsCount; - } else if (dc >= MTP::dld[0] && dc < MTP::dld[MTPDownloadSessionsCount - 1] + _mtp_internal::dcShift) { + } else if (dc >= MTP::dldStart && dc < MTP::dldEnd) { remain *= MTPDownloadSessionsCount; } _waitForReceivedTimer.start(remain); diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index 04a7b68eb0..6fdf6c5e10 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -349,9 +349,9 @@ mtpFileLoader::mtpFileLoader(const StorageImageLocation *location, int32 size, L , _location(location) , _id(0) , _access(0) { - LoaderQueues::iterator i = queues.find(MTP::dld[0] + _dc); + LoaderQueues::iterator i = queues.find(MTP::dld(0) + _dc); if (i == queues.cend()) { - i = queues.insert(MTP::dld[0] + _dc, FileLoaderQueue(MaxFileQueries)); + i = queues.insert(MTP::dld(0) + _dc, FileLoaderQueue(MaxFileQueries)); } _queue = &i.value(); } @@ -365,9 +365,9 @@ mtpFileLoader::mtpFileLoader(int32 dc, const uint64 &id, const uint64 &access, L , _location(0) , _id(id) , _access(access) { - LoaderQueues::iterator i = queues.find(MTP::dld[0] + _dc); + LoaderQueues::iterator i = queues.find(MTP::dld(0) + _dc); if (i == queues.cend()) { - i = queues.insert(MTP::dld[0] + _dc, FileLoaderQueue(MaxFileQueries)); + i = queues.insert(MTP::dld(0) + _dc, FileLoaderQueue(MaxFileQueries)); } _queue = &i.value(); } @@ -405,7 +405,7 @@ bool mtpFileLoader::loadPart() { App::app()->killDownloadSessionsStop(_dc); - mtpRequestId reqId = MTP::send(MTPupload_GetFile(MTPupload_getFile(loc, MTP_int(offset), MTP_int(limit))), rpcDone(&mtpFileLoader::partLoaded, offset), rpcFail(&mtpFileLoader::partFailed), MTP::dld[dcIndex] + _dc, 50); + mtpRequestId reqId = MTP::send(MTPupload_GetFile(MTPupload_getFile(loc, MTP_int(offset), MTP_int(limit))), rpcDone(&mtpFileLoader::partLoaded, offset), rpcFail(&mtpFileLoader::partFailed), MTP::dld(dcIndex) + _dc, 50); ++_queue->queries; dr.v[dcIndex] += limit; From 99b52d4cc128dc7075f5de49ce40b99ff832caaf Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 29 Feb 2016 19:53:26 +0300 Subject: [PATCH 149/316] all deinit moved to Application::aboutToQuit(), mtproto connection thread management refactored, disabled -style=0 fake argument for Application, beta 9028002 --- Telegram/Build.bat | 1 + Telegram/SourceFiles/_other/updater.cpp | 2 +- Telegram/SourceFiles/application.cpp | 65 ++++++--- Telegram/SourceFiles/application.h | 5 +- Telegram/SourceFiles/config.h | 2 +- Telegram/SourceFiles/logs.cpp | 4 +- Telegram/SourceFiles/logs.h | 6 +- Telegram/SourceFiles/main.cpp | 39 ++---- Telegram/SourceFiles/mtproto/mtp.cpp | 128 +++++++++++------- Telegram/SourceFiles/mtproto/mtp.h | 17 ++- .../SourceFiles/mtproto/mtpConnection.cpp | 122 +++++++++-------- Telegram/SourceFiles/mtproto/mtpConnection.h | 14 +- Telegram/SourceFiles/mtproto/mtpSession.cpp | 120 ++++++++-------- Telegram/SourceFiles/mtproto/mtpSession.h | 16 +-- Telegram/SourceFiles/pspecific.h | 6 +- Telegram/SourceFiles/pspecific_linux.cpp | 4 +- Telegram/SourceFiles/pspecific_mac.cpp | 4 +- Telegram/SourceFiles/pspecific_wnd.cpp | 4 +- Telegram/SourceFiles/settings.h | 1 - Telegram/Telegram.rc | 8 +- Telegram/Version | 2 +- 21 files changed, 300 insertions(+), 270 deletions(-) diff --git a/Telegram/Build.bat b/Telegram/Build.bat index 6f83a43f27..788f9c7668 100644 --- a/Telegram/Build.bat +++ b/Telegram/Build.bat @@ -1,4 +1,5 @@ @echo OFF +setlocal FOR /F "tokens=1,2* delims= " %%i in (Version) do set "%%i=%%j" diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index d89efcd950..7050e9bf30 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -255,7 +255,7 @@ bool update() { } else { break; } - } while (copyTries < 30); + } while (copyTries < 100); if (!copyResult) { writeLog(L"Error: failed to copy, asking to retry.."); WCHAR errMsg[2048]; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index e128cb5eb8..fca1d7df40 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -110,6 +110,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) connect(&_localSocket, SIGNAL(readyRead()), this, SLOT(socketReading())); connect(&_localServer, SIGNAL(newConnection()), this, SLOT(newInstanceConnected())); + QTimer::singleShot(0, this, SLOT(startApplication())); connect(this, SIGNAL(aboutToQuit()), this, SLOT(closeApplication())); #ifndef TDESKTOP_DISABLE_AUTOUPDATE @@ -127,27 +128,6 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) } } -Application::~Application() { - App::setQuiting(); - - Sandbox::finish(); - - delete AppObject; - - _localSocket.close(); - closeApplication(); - -#ifndef TDESKTOP_DISABLE_AUTOUPDATE - delete _updateReply; - _updateReply = 0; - if (_updateChecker) _updateChecker->deleteLater(); - _updateChecker = 0; - if (_updateThread) _updateThread->quit(); - _updateThread = 0; -#endif -} - - void Application::socketConnected() { LOG(("Socket connected, this is not the first application instance, sending show command..")); _secondInstance = true; @@ -333,13 +313,54 @@ void Application::removeClients() { } } +void Application::startApplication() { + if (App::quiting()) { + quit(); + } +} + void Application::closeApplication() { + App::quit(); + + delete AppObject; + AppObject = 0; + + Sandbox::finish(); + _localServer.close(); for (LocalClients::iterator i = _localClients.begin(), e = _localClients.end(); i != e; ++i) { disconnect(i->first, SIGNAL(disconnected()), this, SLOT(removeClients())); i->first->close(); } _localClients.clear(); + + _localSocket.close(); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + delete _updateReply; + _updateReply = 0; + if (_updateChecker) _updateChecker->deleteLater(); + _updateChecker = 0; + if (_updateThread) _updateThread->quit(); + _updateThread = 0; +#endif + + DEBUG_LOG(("Telegram finished, result: %1").arg("unknown")); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + if (cRestartingUpdate()) { + DEBUG_LOG(("Application Info: executing updater to install update..")); + psExecUpdater(); + } else +#endif + if (cRestarting()) { + DEBUG_LOG(("Application Info: executing Telegram, because of restart..")); + psExecTelegram(); + } + + SignalHandlers::finish(); + PlatformSpecific::finish(); + Logs::finish(); } #ifndef TDESKTOP_DISABLE_AUTOUPDATE @@ -899,7 +920,7 @@ void AppClass::killDownloadSessions() { for (QMap::iterator i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) { if (i.value() <= ms) { for (int j = 0; j < MTPDownloadSessionsCount; ++j) { - MTP::stopSession(MTP::dld[j] + i.key()); + MTP::stopSession(MTP::dld(j) + i.key()); } i = killDownloadSessionTimes.erase(i); } else { diff --git a/Telegram/SourceFiles/application.h b/Telegram/SourceFiles/application.h index acae496077..1f69aaaa43 100644 --- a/Telegram/SourceFiles/application.h +++ b/Telegram/SourceFiles/application.h @@ -30,7 +30,6 @@ class Application : public QApplication { public: Application(int &argc, char **argv); - ~Application(); // Single instance application public slots: @@ -41,11 +40,13 @@ public slots: void socketWritten(qint64 bytes); void socketReading(); void newInstanceConnected(); - void closeApplication(); void readClients(); void removeClients(); + void startApplication(); // will be done in exec() + void closeApplication(); // will be done in aboutToQuit() + private: typedef QPair LocalClient; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 1bffe5ad4b..5e68c9995f 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9028; static const wchar_t *AppVersionStr = L"0.9.28"; static const bool DevVersion = false; -#define BETA_VERSION (9028001ULL) // just comment this line to build public version +#define BETA_VERSION (9028002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 4a90c14aa1..67c1e55afe 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -292,7 +292,7 @@ namespace SignalHandlers { namespace Logs { - Initializer::Initializer() { + void start() { t_assert(LogsData == 0); if (!Sandbox::CheckBetaVersionDir()) { @@ -378,7 +378,7 @@ namespace Logs { LOG(("Logs started")); } - Initializer::~Initializer() { + void finish() { delete LogsData; LogsData = 0; diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 451fb81795..df23981171 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -23,11 +23,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org class MTPlong; namespace Logs { - struct Initializer { - Initializer(); - ~Initializer(); - }; + void start(); bool started(); + void finish(); bool instanceChecked(); void multipleInstances(); diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 508fb9052e..2cbe3e078d 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -25,8 +25,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" int main(int argc, char *argv[]) { - int result = 0; - settingsParseArgs(argc, argv); if (cLaunchMode() == LaunchModeFixPrevious) { return psFixPrevious(); @@ -36,34 +34,15 @@ int main(int argc, char *argv[]) { return showCrashReportWindow(QFileInfo(cStartUrl()).absoluteFilePath()); } - Logs::Initializer _logs; - { - PlatformSpecific::Initializer _ps; + // both are finished in Application::closeApplication + Logs::start(); // must be started before PlatformSpecific is started + PlatformSpecific::start(); // must be started before QApplication is created - QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable - static const int a_cnt = sizeof(args) / sizeof(args[0]); - int a_argc = a_cnt + 1; - char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; + //QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable + //static const int a_cnt = sizeof(args) / sizeof(args[0]); + //int a_argc = a_cnt + 1; + //char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; - Application app(a_argc, a_argv); - if (!App::quiting()) { - result = app.exec(); - } - } - - DEBUG_LOG(("Telegram finished, result: %1").arg(result)); - - #ifndef TDESKTOP_DISABLE_AUTOUPDATE - if (cRestartingUpdate()) { - DEBUG_LOG(("Application Info: executing updater to install update..")); - psExecUpdater(); - } else - #endif - if (cRestarting()) { - DEBUG_LOG(("Application Info: executing Telegram, because of restart..")); - psExecTelegram(); - } - - SignalHandlers::finish(); - return result; + Application app(argc, argv); + return app.exec(); } diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 1770bcef1e..4c2ce87fb2 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -24,10 +24,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" namespace { - typedef QMap Sessions; + typedef QMap Sessions; Sessions sessions; - QVector sessionsToKill; - MTProtoSessionPtr mainSession; + MTProtoSession *mainSession; typedef QMap RequestsByDC; // holds dcWithShift for request to this dc or -dc for request to main dc RequestsByDC requestsByDC; @@ -62,13 +61,16 @@ namespace { typedef QMap AuthWaiters; // holds request ids waiting for auth import to specific dc AuthWaiters authWaiters; + typedef OrderedSet MTPQuittingConnections; + MTPQuittingConnections quittingConnections; + QMutex toClearLock; RPCCallbackClears toClear; RPCResponseHandler globalHandler; MTPStateChangedHandler stateChangedHandler = 0; MTPSessionResetHandler sessionResetHandler = 0; - _mtp_internal::RequestResender *resender = 0; + _mtp_internal::GlobalSlotCarrier *_globalSlotCarrier = 0; void importDone(const MTPauth_Authorization &result, mtpRequestId req) { QMutexLocker locker1(&requestByDCLock); @@ -111,7 +113,7 @@ namespace { } DEBUG_LOG(("MTP Info: resending request %1 to dc %2 after import auth").arg(requestId).arg(k.value())); } - if (MTProtoSessionPtr session = _mtp_internal::getSession(dcWithShift)) { + if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift)) { session->sendPrepared(j.value()); } } @@ -202,7 +204,7 @@ namespace { } req = i.value(); } - if (MTProtoSessionPtr session = _mtp_internal::getSession(newdcWithShift)) { + if (MTProtoSession *session = _mtp_internal::getSession(newdcWithShift)) { _mtp_internal::registerRequest(requestId, (dcWithShift < 0) ? -newdcWithShift : newdcWithShift); session->sendPrepared(req); } @@ -230,7 +232,7 @@ namespace { } delayedRequests.insert(i, DelayedRequest(requestId, sendAt)); - if (resender) resender->checkDelayed(); + if (_globalSlotCarrier) _globalSlotCarrier->checkDelayed(); return true; } else if (code == 401 || (badGuestDC && badGuestDCRequests.constFind(requestId) == badGuestDCRequests.cend())) { @@ -281,7 +283,7 @@ namespace { } if (!dcWithShift) return false; - if (MTProtoSessionPtr session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { + if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { req->needsLayer = true; session->sendPrepared(req); } @@ -319,7 +321,7 @@ namespace { if (!dcWithShift) return false; if (!req->after) { - if (MTProtoSessionPtr session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { + if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { req->needsLayer = true; session->sendPrepared(req); } @@ -346,7 +348,7 @@ namespace { delayedRequests.insert(i, DelayedRequest(requestId, i->second)); } - if (resender) resender->checkDelayed(); + if (_globalSlotCarrier) _globalSlotCarrier->checkDelayed(); } } return true; @@ -360,21 +362,18 @@ namespace { } namespace _mtp_internal { - MTProtoSessionPtr getSession(int32 dcWithShift) { - if (!_started) return MTProtoSessionPtr(); + MTProtoSession *getSession(int32 dcWithShift) { + if (!_started) return 0; if (!dcWithShift) return mainSession; if (!(dcWithShift % _mtp_internal::dcShift)) { dcWithShift += (mainSession->getDcWithShift() % _mtp_internal::dcShift); } Sessions::const_iterator i = sessions.constFind(dcWithShift); - if (i != sessions.cend()) return *i; - - MTProtoSessionPtr result(new MTProtoSession()); - result->start(dcWithShift); - - sessions.insert(dcWithShift, result); - return result; + if (i == sessions.cend()) { + i = sessions.insert(dcWithShift, new MTProtoSession(dcWithShift)); + } + return i.value(); } bool paused() { @@ -580,11 +579,11 @@ namespace _mtp_internal { return true; } - RequestResender::RequestResender() { + GlobalSlotCarrier::GlobalSlotCarrier() { connect(&_timer, SIGNAL(timeout()), this, SLOT(checkDelayed())); } - void RequestResender::checkDelayed() { + void GlobalSlotCarrier::checkDelayed() { uint64 now = getms(true); while (!delayedRequests.isEmpty() && now >= delayedRequests.front().second) { mtpRequestId requestId = delayedRequests.front().first; @@ -612,7 +611,7 @@ namespace _mtp_internal { } req = j.value(); } - if (MTProtoSessionPtr session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { + if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { session->sendPrepared(req); } } @@ -621,6 +620,25 @@ namespace _mtp_internal { _timer.start(delayedRequests.front().second - now); } } + + void GlobalSlotCarrier::connectionFinished(MTProtoConnection *connection) { + MTPQuittingConnections::iterator i = quittingConnections.find(connection); + if (i != quittingConnections.cend()) { + quittingConnections.erase(i); + } + + connection->waitTillFinish(); + delete connection; + } + + GlobalSlotCarrier *globalSlotCarrier() { + return _globalSlotCarrier; + } + + void queueQuittingConnection(MTProtoConnection *connection) { + quittingConnections.insert(connection); + } + }; namespace MTP { @@ -637,12 +655,12 @@ namespace MTP { MTProtoDCMap &dcs(mtpDCMap()); - mainSession = MTProtoSessionPtr(new MTProtoSession()); - mainSession->start(mtpMainDC()); - sessions[mainSession->getDcWithShift()] = mainSession; + _globalSlotCarrier = new _mtp_internal::GlobalSlotCarrier(); + + mainSession = new MTProtoSession(mtpMainDC()); + sessions.insert(mainSession->getDcWithShift(), mainSession); _started = true; - resender = new _mtp_internal::RequestResender(); if (mtpNeedConfig()) { mtpConfigLoader()->load(); @@ -657,7 +675,7 @@ namespace MTP { if (!_started) return; for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { - (*i)->restart(); + i.value()->restart(); } } @@ -666,8 +684,8 @@ namespace MTP { dcMask %= _mtp_internal::dcShift; for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { - if (((*i)->getDcWithShift() % int(_mtp_internal::dcShift)) == dcMask) { - (*i)->restart(); + if ((i.value()->getDcWithShift() % int(_mtp_internal::dcShift)) == dcMask) { + i.value()->restart(); } } } @@ -681,7 +699,7 @@ namespace MTP { if (!_started) return; _paused = false; for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { - (*i)->unpaused(); + i.value()->unpaused(); } } @@ -714,7 +732,7 @@ namespace MTP { } Sessions::const_iterator i = sessions.constFind(dc); - if (i != sessions.cend()) return (*i)->getState(); + if (i != sessions.cend()) return i.value()->getState(); return MTProtoConnection::Disconnected; } @@ -728,13 +746,13 @@ namespace MTP { } Sessions::const_iterator i = sessions.constFind(dc); - if (i != sessions.cend()) return (*i)->transport(); + if (i != sessions.cend()) return i.value()->transport(); return QString(); } void ping() { - if (MTProtoSessionPtr session = _mtp_internal::getSession(0)) { + if (MTProtoSession *session = _mtp_internal::getSession(0)) { session->ping(); } } @@ -754,7 +772,7 @@ namespace MTP { QMutexLocker locker(&requestByDCLock); RequestsByDC::iterator i = requestsByDC.find(requestId); if (i != requestsByDC.end()) { - if (MTProtoSessionPtr session = _mtp_internal::getSession(abs(i.value()))) { + if (MTProtoSession *session = _mtp_internal::getSession(abs(i.value()))) { session->cancel(requestId, msgId); } requestsByDC.erase(i); @@ -763,26 +781,25 @@ namespace MTP { _mtp_internal::clearCallbacks(requestId); } - void killSessionsDelayed() { - if (!sessionsToKill.isEmpty()) { - sessionsToKill.clear(); - } - } - void killSession(int32 dc) { Sessions::iterator i = sessions.find(dc); - if (i != sessions.end()) { + if (i != sessions.cend()) { bool wasMain = (i.value() == mainSession); i.value()->kill(); - if (sessionsToKill.isEmpty()) QTimer::singleShot(0, killSessionsDelayed); - sessionsToKill.push_back(i.value()); + i.value()->deleteLater(); sessions.erase(i); if (wasMain) { - mainSession = MTProtoSessionPtr(new MTProtoSession()); - mainSession->start(mtpMainDC()); - sessions[mainSession->getDcWithShift()] = mainSession; + mainSession = new MTProtoSession(mtpMainDC()); + int32 newdc = mainSession->getDcWithShift(); + i = sessions.find(newdc); + if (i != sessions.cend()) { + i.value()->kill(); + i.value()->deleteLater(); + sessions.erase(i); + } + sessions.insert(newdc, mainSession); } } } @@ -801,14 +818,14 @@ namespace MTP { QMutexLocker locker(&requestByDCLock); RequestsByDC::iterator i = requestsByDC.find(requestId); if (i != requestsByDC.end()) { - if (MTProtoSessionPtr session = _mtp_internal::getSession(abs(i.value()))) { + if (MTProtoSession *session = _mtp_internal::getSession(abs(i.value()))) { return session->requestState(requestId); } return MTP::RequestConnecting; } return MTP::RequestSent; } - if (MTProtoSessionPtr session = _mtp_internal::getSession(-requestId)) { + if (MTProtoSession *session = _mtp_internal::getSession(-requestId)) { return session->requestState(0); } return MTP::RequestConnecting; @@ -817,11 +834,20 @@ namespace MTP { void stop() { for (Sessions::iterator i = sessions.begin(), e = sessions.end(); i != e; ++i) { i.value()->kill(); + delete i.value(); } sessions.clear(); - mainSession = MTProtoSessionPtr(); - delete resender; - resender = 0; + mainSession = nullptr; + + for (MTPQuittingConnections::const_iterator i = quittingConnections.cbegin(), e = quittingConnections.cend(); i != e; ++i) { + i.key()->waitTillFinish(); + delete i.key(); + } + quittingConnections.clear(); + + delete _globalSlotCarrier; + _globalSlotCarrier = nullptr; + mtpDestroyConfigLoader(); _started = false; diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index ac79f5e3c3..a59c092b97 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -24,7 +24,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/mtpFileLoader.h" namespace _mtp_internal { - MTProtoSessionPtr getSession(int32 dc = 0); // 0 - current set dc + MTProtoSession *getSession(int32 dc); // 0 - current set dc bool paused(); @@ -49,21 +49,28 @@ namespace _mtp_internal { return rpcErrorOccured(requestId, handler.onFail, err); } - class RequestResender : public QObject { + // used for: + // - resending requests by timer which were postponed by flood delay + // - destroying MTProtoConnections whose thread has finished + class GlobalSlotCarrier : public QObject { Q_OBJECT public: - RequestResender(); + GlobalSlotCarrier(); public slots: void checkDelayed(); + void connectionFinished(MTProtoConnection *connection); private: SingleTimer _timer; }; + + GlobalSlotCarrier *globalSlotCarrier(); + void queueQuittingConnection(MTProtoConnection *connection); }; namespace MTP { @@ -99,7 +106,7 @@ namespace MTP { template inline mtpRequestId send(const TRequest &request, RPCResponseHandler callbacks = RPCResponseHandler(), int32 dc = 0, uint64 msCanWait = 0, mtpRequestId after = 0) { - if (MTProtoSessionPtr session = _mtp_internal::getSession(dc)) { + if (MTProtoSession *session = _mtp_internal::getSession(dc)) { return session->send(request, callbacks, msCanWait, true, !dc, after); } return 0; @@ -109,7 +116,7 @@ namespace MTP { return send(request, RPCResponseHandler(onDone, onFail), dc, msCanWait, after); } inline void sendAnything(int32 dc = 0, uint64 msCanWait = 0) { - if (MTProtoSessionPtr session = _mtp_internal::getSession(dc)) { + if (MTProtoSession *session = _mtp_internal::getSession(dc)) { return session->sendAnything(msCanWait); } } diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index e5959811b1..ae2fd23731 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -252,8 +252,6 @@ namespace { typedef QMap PublicRSAKeys; PublicRSAKeys gPublicRSA; - MTProtoConnection gMainConnection; - bool gConfigInited = false; void initRSAConfig() { if (gConfigInited) return; @@ -277,66 +275,75 @@ namespace { } } -MTPThread::MTPThread(QObject *parent) : QThread(parent) { - static uint32 gThreadId = 0; - threadId = ++gThreadId; +uint32 MTPThreadIdIncrement = 0; + +MTPThread::MTPThread() : QThread(0) +, _threadId(++MTPThreadIdIncrement) { } uint32 MTPThread::getThreadId() const { - return threadId; + return _threadId; } -MTProtoConnection::MTProtoConnection() : thread(0), data(0) { +MTPThread::~MTPThread() { +} + +MTProtoConnection::MTProtoConnection() : thread(nullptr), data(nullptr) { } int32 MTProtoConnection::start(MTPSessionData *sessionData, int32 dc) { + t_assert(thread == nullptr && data == nullptr); + initRSAConfig(); - if (thread) { - DEBUG_LOG(("MTP Info: MTP start called for already working connection")); - return dc; - } - - thread = new MTPThread(QApplication::instance()); + thread = new MTPThread(); data = new MTProtoConnectionPrivate(thread, this, sessionData, dc); dc = data->getDC(); if (!dc) { delete data; + data = nullptr; delete thread; - data = 0; - thread = 0; + thread = nullptr; return 0; } + thread->start(); return dc; } -void MTProtoConnection::stop() { - if (data) data->stop(); - if (thread) thread->quit(); +void MTProtoConnection::kill() { + t_assert(data != nullptr && thread != nullptr); + data->stop(); + data = nullptr; // will be deleted in thread::finished signal + thread->quit(); + _mtp_internal::queueQuittingConnection(this); } -void MTProtoConnection::stopped() { - if (thread) thread->deleteLater(); - if (data) data->deleteLater(); - thread = 0; - data = 0; - delete this; +void MTProtoConnection::waitTillFinish() { + t_assert(data == nullptr && thread != nullptr); + + thread->wait(); + delete thread; + thread = nullptr; } int32 MTProtoConnection::state() const { - if (!data) return Disconnected; + t_assert(data != nullptr && thread != nullptr); return data->getState(); } QString MTProtoConnection::transport() const { - if (!data) return QString(); + t_assert(data != nullptr && thread != nullptr); return data->transport(); } +MTProtoConnection::~MTProtoConnection() { + t_assert(data == nullptr && thread == nullptr); +} + namespace { mtpBuffer _handleHttpResponse(QNetworkReply *reply) { QByteArray response = reply->readAll(); @@ -1311,30 +1318,31 @@ void MTProtoConnectionPrivate::destroyConn(MTPabstractConnection **conn) { } } -MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConnection *owner, MTPSessionData *data, uint32 _dc) - : QObject(0) - , _state(MTProtoConnection::Disconnected) - , _needSessionReset(false) - , dc(_dc) - , _owner(owner) - , _conn(0), _conn4(0), _conn6(0) - , retryTimeout(1) - , oldConnection(true) - , _waitForReceived(MTPMinReceiveDelay) - , _waitForConnected(MTPMinConnectDelay) - , firstSentAt(-1) - , _pingId(0) - , _pingIdToSend(0) - , _pingSendAt(0) - , _pingMsgId(0) - , restarted(false) - , keyId(0) +MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConnection *owner, MTPSessionData *data, uint32 _dc) : QObject(0) +, _state(MTProtoConnection::Disconnected) +, _needSessionReset(false) +, dc(_dc) +, _owner(owner) +, _conn(0) +, _conn4(0) +, _conn6(0) +, retryTimeout(1) +, oldConnection(true) +, _waitForReceived(MTPMinReceiveDelay) +, _waitForConnected(MTPMinConnectDelay) +, firstSentAt(-1) +, _pingId(0) +, _pingIdToSend(0) +, _pingSendAt(0) +, _pingMsgId(0) +, restarted(false) +, _finished(false) +, keyId(0) // , sessionDataMutex(QReadWriteLock::Recursive) - , sessionData(data) - , myKeyLock(false) - , authKeyData(0) - , authKeyStrings(0) { - +, sessionData(data) +, myKeyLock(false) +, authKeyData(0) +, authKeyStrings(0) { oldConnectionTimer.moveToThread(thread); _waitForConnectedTimer.moveToThread(thread); _waitForReceivedTimer.moveToThread(thread); @@ -1357,6 +1365,7 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne connect(thread, SIGNAL(started()), this, SLOT(socketStart())); connect(thread, SIGNAL(finished()), this, SLOT(doFinish())); + connect(this, SIGNAL(finished(MTProtoConnection*)), _mtp_internal::globalSlotCarrier(), SLOT(connectionFinished(MTProtoConnection*)), Qt::QueuedConnection); connect(&retryTimer, SIGNAL(timeout()), this, SLOT(retryByTimer())); connect(&_waitForConnectedTimer, SIGNAL(timeout()), this, SLOT(onWaitConnectedFailed())); @@ -1966,6 +1975,10 @@ void MTProtoConnectionPrivate::restartNow() { } void MTProtoConnectionPrivate::socketStart(bool afterConfig) { + if (_finished) { + DEBUG_LOG(("MTP Error: socketStart() called for finished connection!")); + return; + } bool isDldDc = (dc >= MTP::dldStart) && (dc < MTP::dldEnd); if (isDldDc) { // using media_only addresses only if key for this dc is already created QReadLocker lockFinished(&sessionDataMutex); @@ -2231,7 +2244,9 @@ void MTProtoConnectionPrivate::doDisconnect() { void MTProtoConnectionPrivate::doFinish() { doDisconnect(); - _owner->stopped(); + _finished = true; + emit finished(_owner); + deleteLater(); } void MTProtoConnectionPrivate::handleReceived() { @@ -3928,7 +3943,7 @@ void MTProtoConnectionPrivate::unlockKey() { } MTProtoConnectionPrivate::~MTProtoConnectionPrivate() { - doDisconnect(); + t_assert(_finished && _conn == nullptr && _conn4 == nullptr && _conn6 == nullptr); } void MTProtoConnectionPrivate::stop() { @@ -3939,9 +3954,6 @@ void MTProtoConnectionPrivate::stop() { sessionData->keyMutex()->unlock(); myKeyLock = false; } - sessionData = 0; + sessionData = nullptr; } } - -MTProtoConnection::~MTProtoConnection() { -} diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 1d2d684cf7..8ac08b94bd 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -58,11 +58,13 @@ class MTPThread : public QThread { Q_OBJECT public: - MTPThread(QObject *parent = 0); + MTPThread(); uint32 getThreadId() const; + ~MTPThread(); private: - uint32 threadId; + uint32 _threadId; + }; class MTProtoConnection { @@ -75,8 +77,8 @@ public: MTProtoConnection(); int32 start(MTPSessionData *data, int32 dc = 0); // return dc - void stop(); - void stopped(); + void kill(); + void waitTillFinish(); ~MTProtoConnection(); enum { @@ -358,6 +360,8 @@ signals: void resendManyAsync(QVector msgIds, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo); void resendAllAsync(); + void finished(MTProtoConnection *connection); + public slots: void retryByTimer(); @@ -466,7 +470,7 @@ private: template bool readResponseNotSecure(TResponse &response); - bool restarted; + bool restarted, _finished; uint64 keyId; QReadWriteLock sessionDataMutex; diff --git a/Telegram/SourceFiles/mtproto/mtpSession.cpp b/Telegram/SourceFiles/mtproto/mtpSession.cpp index 54ed49cb91..a6d6d918cf 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.cpp +++ b/Telegram/SourceFiles/mtproto/mtpSession.cpp @@ -66,7 +66,8 @@ void MTPSessionData::clear() { } -MTProtoSession::MTProtoSession() : QObject() +MTProtoSession::MTProtoSession(int32 dcenter) : QObject() +, _connection(0) , _killed(false) , _needToReceive(false) , data(this) @@ -75,9 +76,6 @@ MTProtoSession::MTProtoSession() : QObject() , msSendCall(0) , msWait(0) , _ping(false) { -} - -void MTProtoSession::start(int32 dcenter) { if (_killed) { DEBUG_LOG(("Session Error: can't start a killed session")); return; @@ -96,37 +94,32 @@ void MTProtoSession::start(int32 dcenter) { MTProtoDCMap &dcs(mtpDCMap()); - connections.reserve(cConnectionsInSession()); - for (uint32 i = 0; i < cConnectionsInSession(); ++i) { - connections.push_back(new MTProtoConnection()); - dcWithShift = connections.back()->start(&data, dcenter); - if (!dcWithShift) { - for (MTProtoConnections::const_iterator j = connections.cbegin(), e = connections.cend(); j != e; ++j) { - delete *j; - } - connections.clear(); - DEBUG_LOG(("Session Info: could not start connection %1 to dc %2").arg(i).arg(dcenter)); - return; + _connection = new MTProtoConnection(); + dcWithShift = _connection->start(&data, dcenter); + if (!dcWithShift) { + delete _connection; + _connection = 0; + DEBUG_LOG(("Session Info: could not start connection to dc %1").arg(dcenter)); + return; + } + if (!dc) { + dcenter = dcWithShift; + int32 dcId = dcWithShift % _mtp_internal::dcShift; + MTProtoDCMap::const_iterator dcIndex = dcs.constFind(dcId); + if (dcIndex == dcs.cend()) { + dc = MTProtoDCPtr(new MTProtoDC(dcId, mtpAuthKeyPtr())); + dcs.insert(dcWithShift % _mtp_internal::dcShift, dc); + } else { + dc = dcIndex.value(); } - if (!dc) { - dcenter = dcWithShift; - int32 dcId = dcWithShift % _mtp_internal::dcShift; - MTProtoDCMap::const_iterator dcIndex = dcs.constFind(dcId); - if (dcIndex == dcs.cend()) { - dc = MTProtoDCPtr(new MTProtoDC(dcId, mtpAuthKeyPtr())); - dcs.insert(dcWithShift % _mtp_internal::dcShift, dc); - } else { - dc = dcIndex.value(); - } - ReadLockerAttempt lock(keyMutex()); - data.setKey(lock ? dc->getKey() : mtpAuthKeyPtr(0)); - if (lock && dc->connectionInited()) { - data.setLayerWasInited(true); - } - connect(dc.data(), SIGNAL(authKeyCreated()), this, SLOT(authKeyCreatedForDC()), Qt::QueuedConnection); - connect(dc.data(), SIGNAL(layerWasInited(bool)), this, SLOT(layerWasInitedForDC(bool)), Qt::QueuedConnection); + ReadLockerAttempt lock(keyMutex()); + data.setKey(lock ? dc->getKey() : mtpAuthKeyPtr(0)); + if (lock && dc->connectionInited()) { + data.setLayerWasInited(true); } + connect(dc.data(), SIGNAL(authKeyCreated()), this, SLOT(authKeyCreatedForDC()), Qt::QueuedConnection); + connect(dc.data(), SIGNAL(layerWasInited(bool)), this, SLOT(layerWasInitedForDC(bool)), Qt::QueuedConnection); } } @@ -139,10 +132,14 @@ void MTProtoSession::restart() { } void MTProtoSession::stop() { + if (_killed) { + DEBUG_LOG(("Session Error: can't kill a killed session")); + return; + } DEBUG_LOG(("Session Info: stopping session dcWithShift %1").arg(dcWithShift)); - while (!connections.isEmpty()) { - connections.back()->stop(); - connections.pop_back(); + if (_connection) { + _connection->kill(); + _connection = 0; } } @@ -194,22 +191,17 @@ void MTProtoSession::needToResumeAndSend() { DEBUG_LOG(("Session Info: can't resume a killed session")); return; } - if (connections.isEmpty()) { + if (!_connection) { DEBUG_LOG(("Session Info: resuming session dcWithShift %1").arg(dcWithShift)); MTProtoDCMap &dcs(mtpDCMap()); - connections.reserve(cConnectionsInSession()); - for (uint32 i = 0; i < cConnectionsInSession(); ++i) { - connections.push_back(new MTProtoConnection()); - if (!connections.back()->start(&data, dcWithShift)) { - for (MTProtoConnections::const_iterator j = connections.cbegin(), e = connections.cend(); j != e; ++j) { - delete *j; - } - connections.clear(); - DEBUG_LOG(("Session Info: could not start connection %1 to dcWithShift %2").arg(i).arg(dcWithShift)); - dcWithShift = 0; - return; - } + _connection = new MTProtoConnection(); + if (!_connection->start(&data, dcWithShift)) { + delete _connection; + _connection = 0; + DEBUG_LOG(("Session Info: could not start connection to dcWithShift %1").arg(dcWithShift)); + dcWithShift = 0; + return; } } if (_ping) { @@ -324,12 +316,13 @@ void MTProtoSession::ping() { } int32 MTProtoSession::requestState(mtpRequestId requestId) const { - MTProtoConnections::const_iterator j = connections.cbegin(), e = connections.cend(); int32 result = MTP::RequestSent; - for (; j != e; ++j) { - int32 s = (*j)->state(); + + bool connected = false; + if (_connection) { + int32 s = _connection->state(); if (s == MTProtoConnection::Connected) { - break; + connected = true; } else if (s == MTProtoConnection::Connecting || s == MTProtoConnection::Disconnected) { if (result < 0 || result == MTP::RequestSent) { result = MTP::RequestConnecting; @@ -340,7 +333,7 @@ int32 MTProtoSession::requestState(mtpRequestId requestId) const { } } } - if (j == e) { // no one is connected + if (!connected) { return result; } if (!requestId) return MTP::RequestSent; @@ -356,10 +349,10 @@ int32 MTProtoSession::requestState(mtpRequestId requestId) const { } int32 MTProtoSession::getState() const { - MTProtoConnections::const_iterator j = connections.cbegin(), e = connections.cend(); int32 result = -86400000; - for (; j != e; ++j) { - int32 s = (*j)->state(); + + if (_connection) { + int32 s = _connection->state(); if (s == MTProtoConnection::Connected) { return s; } else if (s == MTProtoConnection::Connecting || s == MTProtoConnection::Disconnected) { @@ -379,12 +372,7 @@ int32 MTProtoSession::getState() const { } QString MTProtoSession::transport() const { - MTProtoConnections::const_iterator j = connections.cbegin(), e = connections.cend(); - for (; j != e; ++j) { - QString s = (*j)->transport(); - if (!s.isEmpty()) return s; - } - return QString(); + return _connection ? _connection->transport() : QString(); } mtpRequestId MTProtoSession::resend(quint64 msgId, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { @@ -507,6 +495,10 @@ int32 MTProtoSession::getDcWithShift() const { } void MTProtoSession::tryToReceive() { + if (_killed) { + DEBUG_LOG(("Session Error: can't receive in a killed session")); + return; + } if (_mtp_internal::paused()) { _needToReceive = true; return; @@ -537,9 +529,7 @@ void MTProtoSession::tryToReceive() { } MTProtoSession::~MTProtoSession() { - for (MTProtoConnections::const_iterator i = connections.cbegin(), e = connections.cend(); i != e; ++i) { - delete *i; - } + t_assert(_connection == 0); } MTPrpcError rpcClientError(const QString &type, const QString &description) { diff --git a/Telegram/SourceFiles/mtproto/mtpSession.h b/Telegram/SourceFiles/mtproto/mtpSession.h index 23db4fba38..a635372f12 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.h +++ b/Telegram/SourceFiles/mtproto/mtpSession.h @@ -28,7 +28,7 @@ class MTProtoSession; class MTPSessionData { public: - + MTPSessionData(MTProtoSession *creator) : _session(0), _salt(0) , _messagesSent(0), _fakeRequestId(-2000000000) @@ -222,9 +222,8 @@ class MTProtoSession : public QObject { public: - MTProtoSession(); + MTProtoSession(int32 dcenter); - void start(int32 dcenter = 0); void restart(); void stop(); void kill(); @@ -278,13 +277,12 @@ public slots: void sendMsgsStateInfo(quint64 msgId, QByteArray data); private: - - typedef QList MTProtoConnections; - MTProtoConnections connections; + + MTProtoConnection *_connection; bool _killed; bool _needToReceive; - + MTPSessionData data; int32 dcWithShift; @@ -304,7 +302,3 @@ inline QReadWriteLock *MTPSessionData::keyMutex() const { } MTPrpcError rpcClientError(const QString &type, const QString &description = QString()); - -// here - -typedef QSharedPointer MTProtoSessionPtr; diff --git a/Telegram/SourceFiles/pspecific.h b/Telegram/SourceFiles/pspecific.h index 7362f15da0..7003daa426 100644 --- a/Telegram/SourceFiles/pspecific.h +++ b/Telegram/SourceFiles/pspecific.h @@ -38,10 +38,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org namespace PlatformSpecific { - struct Initializer { - Initializer(); - ~Initializer(); - }; + void start(); + void finish(); namespace ThirdParty { void start(); diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 650c51f10a..2134e97dd1 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -1237,10 +1237,10 @@ void psShowInFolder(const QString &name) { namespace PlatformSpecific { - Initializer::Initializer() { + void start() { } - Initializer::~Initializer() { + void finish() { delete _psEventFilter; _psEventFilter = 0; } diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index 854ff00d28..f674e84e65 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -850,11 +850,11 @@ void psShowInFolder(const QString &name) { namespace PlatformSpecific { - Initializer::Initializer() { + void start() { objc_start(); } - Initializer::~Initializer() { + void finish() { delete _psEventFilter; _psEventFilter = 0; diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 1a2e461400..3dc358887b 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2159,10 +2159,10 @@ void psShowInFolder(const QString &name) { namespace PlatformSpecific { - Initializer::Initializer() { + void start() { } - Initializer::~Initializer() { + void finish() { delete _psEventFilter; _psEventFilter = 0; diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index b57a6b4f15..93524bba88 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -77,7 +77,6 @@ inline QString cInlineGifBotUsername() { return cTestMode() ? qstr("contextbot") : qstr("gif"); } DeclareSetting(QString, LoggedPhoneNumber); -DeclareReadSetting(uint32, ConnectionsInSession); DeclareSetting(bool, AutoStart); DeclareSetting(bool, StartMinimized); DeclareSetting(bool, StartInTray); diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 6ad208fd05..f82064666b 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,28,1 - PRODUCTVERSION 0,9,28,1 + FILEVERSION 0,9,28,2 + PRODUCTVERSION 0,9,28,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.28.1" + VALUE "FileVersion", "0.9.28.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.28.1" + VALUE "ProductVersion", "0.9.28.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index e3f6eee41c..c6c53f35a0 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.28 AppVersionStr 0.9.28 DevChannel 0 -BetaVersion 9028001 +BetaVersion 9028002 From 616354b8e97266926aa2a55b23954a6e2e9dee80 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 29 Feb 2016 20:30:18 +0300 Subject: [PATCH 150/316] improved for old version of Qt --- Telegram/SourceFiles/history.cpp | 4 ++-- Telegram/SourceFiles/mtproto/mtp.h | 4 ++-- Telegram/SourceFiles/shortcuts.cpp | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 30ab9b24e2..88db017feb 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -294,8 +294,8 @@ History::History(const PeerId &peerId) : width(0), height(0) , sendRequestId(0) , textCachedFor(0) , lastItemTextCache(st::dlgRichMinWidth) -, _sortKeyInChatList(0) -, typingText(st::dlgRichMinWidth) { +, typingText(st::dlgRichMinWidth) +, _sortKeyInChatList(0) { if (peer->isChannel() || (peer->isUser() && peer->asUser()->botInfo)) { outboxReadBefore = INT_MAX; } diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index a59c092b97..14a24470be 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -77,11 +77,11 @@ namespace MTP { extern const uint32 cfg; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum extern const uint32 lgt; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum - inline const uint32 dld(int32 index) { // send(req, callbacks, MTP::dld(i) + dc) - for download + inline uint32 dld(int32 index) { // send(req, callbacks, MTP::dld(i) + dc) - for download t_assert(index >= 0 && index < MTPDownloadSessionsCount); return (0x10 + index) * _mtp_internal::dcShift; }; - inline const uint32 upl(int32 index) { // send(req, callbacks, MTP::upl[i] + dc) - for upload + inline uint32 upl(int32 index) { // send(req, callbacks, MTP::upl(i) + dc) - for upload t_assert(index >= 0 && index < MTPUploadSessionsCount); return (0x20 + index) * _mtp_internal::dcShift; }; diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp index 14d64ffbf2..dd395f8804 100644 --- a/Telegram/SourceFiles/shortcuts.cpp +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -339,10 +339,10 @@ namespace Shortcuts { if (error.error == QJsonParseError::NoError && doc.isArray()) { QJsonArray shortcuts(doc.array()); - if (!shortcuts.isEmpty() && shortcuts.constBegin()->isObject()) { - QJsonObject versionObject(shortcuts.constBegin()->toObject()); + if (!shortcuts.isEmpty() && (*shortcuts.constBegin()).isObject()) { + QJsonObject versionObject((*shortcuts.constBegin()).toObject()); QJsonObject::const_iterator version = versionObject.constFind(qsl("version")); - if (version != versionObject.constEnd() && version->isString() && version->toString() == QString::number(AppVersion)) { + if (version != versionObject.constEnd() && (*version).isString() && (*version).toString() == QString::number(AppVersion)) { defaultValid = true; } } @@ -396,18 +396,18 @@ namespace Shortcuts { QJsonArray shortcuts = doc.array(); int limit = ShortcutsCountLimit; for (QJsonArray::const_iterator i = shortcuts.constBegin(), e = shortcuts.constEnd(); i != e; ++i) { - if (!i->isObject()) { + if (!(*i).isObject()) { DataPtr->errors.push_back(qsl("Bad entry! Error: object expected")); } else { QKeySequence seq; - QJsonObject entry(i->toObject()); + QJsonObject entry((*i).toObject()); QJsonObject::const_iterator keys = entry.constFind(qsl("keys")), command = entry.constFind(qsl("command")); - if (keys == entry.constEnd() || command == entry.constEnd() || !keys->isString() || (!command->isString() && !command->isNull())) { + if (keys == entry.constEnd() || command == entry.constEnd() || !(*keys).isString() || (!(*command).isString() && !(*command).isNull())) { DataPtr->errors.push_back(qsl("Bad entry! {\"keys\": \"...\", \"command\": [ \"...\" | null ]} expected")); - } else if (command->isNull()) { - seq = _removeShortcut(keys->toString()); + } else if ((*command).isNull()) { + seq = _removeShortcut((*keys).toString()); } else { - seq = _setShortcut(keys->toString(), command->toString()); + seq = _setShortcut((*keys).toString(), (*command).toString()); } if (!--limit) { DataPtr->errors.push_back(qsl("Too many entries! Limit is %1").arg(ShortcutsCountLimit)); From 32322c4450d6081dafd7076570dba339e9cfbd22 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 1 Mar 2016 05:36:23 +0300 Subject: [PATCH 151/316] fixed some warnings, added debug logs before thread wait calls --- Telegram/SourceFiles/dialogswidget.h | 14 +++++----- Telegram/SourceFiles/gui/animation.cpp | 1 + Telegram/SourceFiles/historywidget.h | 26 +++++++++---------- Telegram/SourceFiles/localimageloader.cpp | 1 + Telegram/SourceFiles/mainwidget.h | 20 +++++++------- .../SourceFiles/mtproto/mtpConnection.cpp | 1 + .../SourceFiles/mtproto/mtpFileLoader.cpp | 1 + Telegram/SourceFiles/overviewwidget.h | 6 ++--- Telegram/SourceFiles/profilewidget.h | 12 ++++----- 9 files changed, 43 insertions(+), 39 deletions(-) diff --git a/Telegram/SourceFiles/dialogswidget.h b/Telegram/SourceFiles/dialogswidget.h index 6443a08d60..75ef10e494 100644 --- a/Telegram/SourceFiles/dialogswidget.h +++ b/Telegram/SourceFiles/dialogswidget.h @@ -219,15 +219,15 @@ public: void searchReceived(DialogsSearchRequestType type, const MTPmessages_Messages &result, mtpRequestId req); void peopleReceived(const MTPcontacts_Found &result, mtpRequestId req); - void dragEnterEvent(QDragEnterEvent *e); - void dragMoveEvent(QDragMoveEvent *e); - void dragLeaveEvent(QDragLeaveEvent *e); - void dropEvent(QDropEvent *e); + void dragEnterEvent(QDragEnterEvent *e) override; + void dragMoveEvent(QDragMoveEvent *e) override; + void dragLeaveEvent(QDragLeaveEvent *e) override; + void dropEvent(QDropEvent *e) override; void updateDragInScroll(bool inScroll); - void resizeEvent(QResizeEvent *e); - void keyPressEvent(QKeyEvent *e); - void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e) override; + void keyPressEvent(QKeyEvent *e) override; + void paintEvent(QPaintEvent *e) override; void searchInPeer(PeerData *peer); diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index c667d28f9e..1e9af9fe20 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -93,6 +93,7 @@ namespace anim { if (!_clipThreads.isEmpty()) { for (int32 i = 0, l = _clipThreads.size(); i < l; ++i) { _clipThreads.at(i)->quit(); + DEBUG_LOG(("Waiting for clipThread to finish: %1").arg(i)); _clipThreads.at(i)->wait(); delete _clipManagers.at(i); delete _clipThreads.at(i); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 786de93530..bd53f26486 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -423,18 +423,18 @@ public: void windowShown(); bool isActive() const; - void resizeEvent(QResizeEvent *e); - void keyPressEvent(QKeyEvent *e); - void mousePressEvent(QMouseEvent *e); - void paintEvent(QPaintEvent *e); - void dragEnterEvent(QDragEnterEvent *e); - void dragLeaveEvent(QDragLeaveEvent *e); - void leaveEvent(QEvent *e); - void dropEvent(QDropEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void leaveToChildEvent(QEvent *e); - void contextMenuEvent(QContextMenuEvent *e); + void resizeEvent(QResizeEvent *e) override; + void keyPressEvent(QKeyEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void dragEnterEvent(QDragEnterEvent *e) override; + void dragLeaveEvent(QDragLeaveEvent *e) override; + void leaveEvent(QEvent *e) override; + void dropEvent(QDropEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void leaveToChildEvent(QEvent *e) override; + void contextMenuEvent(QContextMenuEvent *e) override; void updateTopBarSelection(); @@ -542,7 +542,7 @@ public: void sendBotCommand(const QString &cmd, MsgId replyTo); bool insertBotCommand(const QString &cmd, bool specialGif); - bool eventFilter(QObject *obj, QEvent *e); + bool eventFilter(QObject *obj, QEvent *e) override; void updateBotKeyboard(History *h = 0); DragState getDragState(const QMimeData *d); diff --git a/Telegram/SourceFiles/localimageloader.cpp b/Telegram/SourceFiles/localimageloader.cpp index 49d0cfaf26..4ce85fa758 100644 --- a/Telegram/SourceFiles/localimageloader.cpp +++ b/Telegram/SourceFiles/localimageloader.cpp @@ -117,6 +117,7 @@ void TaskQueue::stop() { if (_thread) { _thread->requestInterruption(); _thread->quit(); + DEBUG_LOG(("Waiting for taskThread to finish")); _thread->wait(); delete _worker; delete _thread; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 660793df49..f0318a1a4b 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -39,13 +39,13 @@ public: TopBarWidget(MainWidget *w); - void enterEvent(QEvent *e); - void enterFromChildEvent(QEvent *e); - void leaveEvent(QEvent *e); - void leaveToChildEvent(QEvent *e); - void paintEvent(QPaintEvent *e); - void mousePressEvent(QMouseEvent *e); - void resizeEvent(QResizeEvent *e); + void enterEvent(QEvent *e) override; + void enterFromChildEvent(QEvent *e) override; + void leaveEvent(QEvent *e) override; + void leaveToChildEvent(QEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void resizeEvent(QResizeEvent *e) override; void step_appearance(float64 ms, bool timer); void enableShadow(bool enable = true); @@ -201,9 +201,9 @@ public: MainWidget(Window *window); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); - void keyPressEvent(QKeyEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void keyPressEvent(QKeyEvent *e) override; void updateAdaptiveLayout(); bool needBackButton(); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index ae2fd23731..2a089a14f9 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -323,6 +323,7 @@ void MTProtoConnection::kill() { void MTProtoConnection::waitTillFinish() { t_assert(data == nullptr && thread != nullptr); + DEBUG_LOG(("Waiting for connectionThread to finish")); thread->wait(); delete thread; thread = nullptr; diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index 6fdf6c5e10..e53c69dce9 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -741,6 +741,7 @@ void reinitWebLoadManager() { void stopWebLoadManager() { if (webLoadManager()) { _webLoadThread->quit(); + DEBUG_LOG(("Waiting for webloadThread to finish")); _webLoadThread->wait(); delete _webLoadManager; delete _webLoadMainManager; diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index 968ccd773b..2b13596be1 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -245,9 +245,9 @@ public: void clear(); - void resizeEvent(QResizeEvent *e); - void paintEvent(QPaintEvent *e); - void contextMenuEvent(QContextMenuEvent *e); + void resizeEvent(QResizeEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void contextMenuEvent(QContextMenuEvent *e) override; void scrollBy(int32 add); void scrollReset(); diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 89da54afb0..d01c91b17d 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -222,12 +222,12 @@ public: ProfileWidget(QWidget *parent, PeerData *peer); - void resizeEvent(QResizeEvent *e); - void mousePressEvent(QMouseEvent *e); - void paintEvent(QPaintEvent *e); - void dragEnterEvent(QDragEnterEvent *e); - void dropEvent(QDropEvent *e); - void keyPressEvent(QKeyEvent *e); + void resizeEvent(QResizeEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void dragEnterEvent(QDragEnterEvent *e) override; + void dropEvent(QDropEvent *e) override; + void keyPressEvent(QKeyEvent *e) override; void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth); void topBarClick(); From ebfeeb6872b8e05c9da916950655cd79dc2e3fea Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 1 Mar 2016 05:46:34 +0300 Subject: [PATCH 152/316] dev version 0.9.29 --- Telegram/SourceFiles/application.cpp | 5 +++-- Telegram/SourceFiles/config.h | 8 ++++---- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 10 +++++----- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index fca1d7df40..6989c9b2d6 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1035,8 +1035,9 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9027) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Edit your messages in channels and supergroups.\n\xe2\x80\x94 Share links to specific posts in channels via the post context menu.\n\xe2\x80\x94 Add admin signatures to messages in channels.\n\xe2\x80\x94 Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting.");// .replace('@', qsl("@") + QChar(0x200D)); + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9029) { + QString ctrl = (cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? qsl("Cmd") : qsl("Ctrl"); + versionFeatures = QString::fromUtf8("\xe2\x80\x94 %1+W or %2+F4 for close window\n\xe2\x80\x94 %3+L to lock Telegram if you use a local passcode\n\xe2\x80\x94 Bug fixes and other minor improvements").arg(ctrl).arg(ctrl).arg(ctrl);// .replace('@', qsl("@") + QChar(0x200D)); } else if (Local::oldMapVersion() < 9027) { versionFeatures = lang(lng_new_version_text).trimmed(); } else { diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 5e68c9995f..9e4060c8b8 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,10 +20,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9028; -static const wchar_t *AppVersionStr = L"0.9.28"; -static const bool DevVersion = false; -#define BETA_VERSION (9028002ULL) // just comment this line to build public version +static const int32 AppVersion = 9029; +static const wchar_t *AppVersionStr = L"0.9.29"; +static const bool DevVersion = true; +//#define BETA_VERSION (9028002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index cf5bb6c5ea..d4df84bc4c 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.28 + 0.9.29 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index f82064666b..4a040b9720 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,28,2 - PRODUCTVERSION 0,9,28,2 + FILEVERSION 0,9,29,0 + PRODUCTVERSION 0,9,29,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.28.2" + VALUE "FileVersion", "0.9.29.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.28.2" + VALUE "ProductVersion", "0.9.29.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 496b74e15b..f33e49f056 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1726,7 +1726,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.28; + CURRENT_PROJECT_VERSION = 0.9.29; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1745,7 +1745,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.28; + CURRENT_PROJECT_VERSION = 0.9.29; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1774,10 +1774,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.28; + CURRENT_PROJECT_VERSION = 0.9.29; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.28; + DYLIB_CURRENT_VERSION = 0.9.29; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1915,10 +1915,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.28; + CURRENT_PROJECT_VERSION = 0.9.29; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.28; + DYLIB_CURRENT_VERSION = 0.9.29; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index c6c53f35a0..a89b5197dd 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9028 +AppVersion 9029 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.28 -AppVersionStr 0.9.28 -DevChannel 0 -BetaVersion 9028002 +AppVersionStrSmall 0.9.29 +AppVersionStr 0.9.29 +DevChannel 1 +BetaVersion 0 9028002 From cde264e5a1af9ff4803294f1809e64285b4bcd07 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 1 Mar 2016 21:41:06 +0200 Subject: [PATCH 153/316] fixed crash in mtpFileLoader delayed destroy, finishing breakpad at the very end, 0.9.29 dev --- Telegram/SourceFiles/application.cpp | 19 +-------------- Telegram/SourceFiles/main.cpp | 24 +++++++++++++++++-- Telegram/SourceFiles/mtproto/mtp.cpp | 4 +++- Telegram/SourceFiles/mtproto/mtp.h | 4 +--- .../SourceFiles/mtproto/mtpFileLoader.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 6 +++++ 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 6989c9b2d6..2d3bc56f1a 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -344,23 +344,6 @@ void Application::closeApplication() { if (_updateThread) _updateThread->quit(); _updateThread = 0; #endif - - DEBUG_LOG(("Telegram finished, result: %1").arg("unknown")); - -#ifndef TDESKTOP_DISABLE_AUTOUPDATE - if (cRestartingUpdate()) { - DEBUG_LOG(("Application Info: executing updater to install update..")); - psExecUpdater(); - } else -#endif - if (cRestarting()) { - DEBUG_LOG(("Application Info: executing Telegram, because of restart..")); - psExecTelegram(); - } - - SignalHandlers::finish(); - PlatformSpecific::finish(); - Logs::finish(); } #ifndef TDESKTOP_DISABLE_AUTOUPDATE @@ -1067,7 +1050,7 @@ AppClass::~AppClass() { App::deinitMedia(); deinitImageLinkManager(); - MTP::stop(); + MTP::finish(); AppObject = 0; deleteAndMark(_uploader); diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 2cbe3e078d..571ef6f72a 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -43,6 +43,26 @@ int main(int argc, char *argv[]) { //int a_argc = a_cnt + 1; //char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; - Application app(argc, argv); - return app.exec(); + int result = 0; + { + Application app(argc, argv); + result = app.exec(); + } + + DEBUG_LOG(("Telegram finished, result: %1").arg(result)); + +#ifndef TDESKTOP_DISABLE_AUTOUPDATE + if (cRestartingUpdate()) { + DEBUG_LOG(("Application Info: executing updater to install update..")); + psExecUpdater(); + } else +#endif + if (cRestarting()) { + DEBUG_LOG(("Application Info: executing Telegram, because of restart..")); + psExecTelegram(); + } + + SignalHandlers::finish(); + PlatformSpecific::finish(); + Logs::finish(); } diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/mtp.cpp index 4c2ce87fb2..86493e5224 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/mtp.cpp @@ -758,6 +758,8 @@ namespace MTP { } void cancel(mtpRequestId requestId) { + if (!_started) return; + mtpMsgId msgId = 0; requestsDelays.remove(requestId); { @@ -831,7 +833,7 @@ namespace MTP { return MTP::RequestConnecting; } - void stop() { + void finish() { for (Sessions::iterator i = sessions.begin(), e = sessions.end(); i != e; ++i) { i.value()->kill(); delete i.value(); diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/mtp.h index 14a24470be..689665b81b 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/mtp.h @@ -132,9 +132,7 @@ namespace MTP { }; int32 state(mtpRequestId req); // < 0 means waiting for such count of ms - void defOnError(const RPCError &err); - - void stop(); + void finish(); void authed(int32 uid); int32 authedId(); diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp index e53c69dce9..f260f2ca43 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp @@ -527,7 +527,7 @@ void mtpFileLoader::cancelRequests() { _queue->queries -= _requests.size(); _requests.clear(); - if (!_queue->queries) { + if (!_queue->queries && App::app()) { App::app()->killDownloadSessionsStart(_dc); } } diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 3664b9bf05..214622fccd 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -1393,6 +1393,12 @@ void DocumentData::recountIsImage() { DocumentData::~DocumentData() { delete _additional; + + if (loading()) { + _loader->deleteLater(); + _loader->stop(); + _loader = 0; + } } WebPageData::WebPageData(const WebPageId &id, WebPageType type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill) : id(id) From b277f5cdb73a7a0086e5f52636d075489ac7aae0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 2 Mar 2016 20:34:42 +0200 Subject: [PATCH 154/316] ensure that closeApplication() is called only once --- Telegram/SourceFiles/_other/updater.cpp | 2 +- Telegram/SourceFiles/_other/updater_linux.cpp | 2 +- Telegram/SourceFiles/app.cpp | 23 ++++++++++--------- Telegram/SourceFiles/app.h | 10 ++++++-- Telegram/SourceFiles/application.cpp | 15 ++++++------ Telegram/SourceFiles/facades.cpp | 2 +- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/window.cpp | 14 +++-------- Telegram/SourceFiles/window.h | 2 -- 9 files changed, 35 insertions(+), 37 deletions(-) diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index 7050e9bf30..f70e65ca87 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -456,7 +456,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara ShellExecute(0, 0, (updateTo + L"Telegram.exe").c_str(), (L"-noupdate" + targs).c_str(), 0, SW_SHOWNORMAL); } - writeLog(L"Executed Telegram.exe, closing log and quiting.."); + writeLog(L"Executed Telegram.exe, closing log and quitting.."); closeLog(); return 0; diff --git a/Telegram/SourceFiles/_other/updater_linux.cpp b/Telegram/SourceFiles/_other/updater_linux.cpp index 3a3b778105..7ae72c3709 100644 --- a/Telegram/SourceFiles/_other/updater_linux.cpp +++ b/Telegram/SourceFiles/_other/updater_linux.cpp @@ -430,7 +430,7 @@ int main(int argc, char *argv[]) { case 0: execv(path, args); return 1; } - writeLog("Executed Telegram, closing log and quiting.."); + writeLog("Executed Telegram, closing log and quitting.."); closeLog(); return 0; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index d434bc26ea..85a4000aca 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -33,7 +33,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "numbers.h" namespace { - bool quiting = false; + App::LaunchState _launchState = App::Launched; UserData *self = 0; @@ -1791,7 +1791,7 @@ namespace App { } ::repliesTo.erase(j); } - if (App::main() && !App::quiting()) { + if (App::main() && !App::quitting()) { App::main()->itemRemoved(item); } } @@ -2155,21 +2155,22 @@ namespace App { } void quit() { - if (quiting()) return; + if (quitting()) return; + setLaunchState(QuitRequested); - setQuiting(); - if (wnd()) { - wnd()->quit(); - } Application::quit(); } - bool quiting() { - return ::quiting; + bool quitting() { + return _launchState != Launched; } - void setQuiting() { - ::quiting = true; + LaunchState launchState() { + return _launchState; + } + + void setLaunchState(LaunchState state) { + _launchState = state; } QImage readImage(QByteArray data, QByteArray *format, bool opaque, bool *animated) { diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index b206d462e4..20e51a806e 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -191,9 +191,15 @@ namespace App { bool isValidPhone(QString phone); + enum LaunchState { + Launched = 0, + QuitRequested = 1, + QuitProcessed = 2, + }; void quit(); - bool quiting(); - void setQuiting(); + bool quitting(); + LaunchState launchState(); + void setLaunchState(LaunchState state); QImage readImage(QByteArray data, QByteArray *format = 0, bool opaque = true, bool *animated = 0); QImage readImage(const QString &file, QByteArray *format = 0, bool opaque = true, bool *animated = 0, QByteArray *content = 0); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 2d3bc56f1a..150e41b25d 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -166,16 +166,16 @@ void Application::socketReading() { if (QRegularExpression("RES:(\\d+);").match(_localSocketReadData).hasMatch()) { uint64 pid = _localSocketReadData.mid(4, _localSocketReadData.length() - 5).toULongLong(); psActivateProcess(pid); - LOG(("Show command response received, pid = %1, activating and quiting..").arg(pid)); + LOG(("Show command response received, pid = %1, activating and quitting..").arg(pid)); return App::quit(); } } void Application::socketError(QLocalSocket::LocalSocketError e) { - if (App::quiting()) return; + if (App::quitting()) return; if (_secondInstance) { - LOG(("Could not write show command, error %1, quiting..").arg(e)); + LOG(("Could not write show command, error %1, quitting..").arg(e)); return App::quit(); } @@ -235,7 +235,7 @@ void Application::singleInstanceChecked() { void Application::socketDisconnected() { if (_secondInstance) { - DEBUG_LOG(("Application Error: socket disconnected before command response received, quiting..")); + DEBUG_LOG(("Application Error: socket disconnected before command response received, quitting..")); return App::quit(); } } @@ -314,14 +314,15 @@ void Application::removeClients() { } void Application::startApplication() { - if (App::quiting()) { + if (App::quitting()) { quit(); } } void Application::closeApplication() { + if (App::launchState() != App::QuitProcessed); + App::setLaunchState(App::QuitProcessed); App::quit(); - delete AppObject; AppObject = 0; @@ -973,7 +974,7 @@ void AppClass::onSwitchTestMode() { } FileUploader *AppClass::uploader() { - if (!_uploader && !App::quiting()) _uploader = new FileUploader(); + if (!_uploader && !App::quitting()) _uploader = new FileUploader(); return _uploader; } diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index a32ba4bc87..37e5fdaf30 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -154,7 +154,7 @@ namespace Ui { } bool hideWindowNoQuit() { - if (!App::quiting()) { + if (!App::quitting()) { if (Window *w = App::wnd()) { if (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray) { return w->minimizeToTray(); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 88db017feb..412bb0735a 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2526,7 +2526,7 @@ void History::clear(bool leaveItems) { } overview[i].clear(); overviewIds[i].clear(); - if (App::wnd() && !App::quiting()) App::wnd()->mediaOverviewUpdated(peer, MediaOverviewType(i)); + if (App::wnd() && !App::quitting()) App::wnd()->mediaOverviewUpdated(peer, MediaOverviewType(i)); } } Blocks lst = blocks; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 3431edfd51..ba6f86229d 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1105,7 +1105,7 @@ void Window::mouseReleaseEvent(QMouseEvent *e) { } bool Window::minimizeToTray() { - if (App::quiting() || !psHasTrayIcon()) return false; + if (App::quitting() || !psHasTrayIcon()) return false; hide(); if (cPlatform() == dbipWindows && trayIcon && !cSeenTrayTooltip()) { @@ -1372,16 +1372,8 @@ void Window::onClearFailed(int task, void *manager) { emit tempDirClearFailed(task); } -void Window::quit() { - delete _mediaView; - _mediaView = 0; - delete main; - main = 0; - notifyClearFast(); -} - void Window::notifySchedule(History *history, HistoryItem *item) { - if (App::quiting() || !history->currentNotification() || !main) return; + if (App::quitting() || !history->currentNotification() || !main) return; PeerData *notifyByFrom = (!history->peer->isUser() && item->mentionsMe()) ? item->from() : 0; @@ -1514,7 +1506,7 @@ void Window::notifySettingGot() { } void Window::notifyShowNext(NotifyWindow *remove) { - if (App::quiting()) return; + if (App::quitting()) return; int32 count = NotifyWindowsCount; if (remove) { diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index ab34c00d92..774a232960 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -206,8 +206,6 @@ public: TempDirState localStorageState(); void tempDirDelete(int task); - void quit(); - void notifySettingGot(); void notifySchedule(History *history, HistoryItem *item); void notifyClear(History *history = 0); From d5132a899e7872dafee1ba64a4d70a2d772cc1ef Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 2 Mar 2016 22:50:58 +0200 Subject: [PATCH 155/316] debug logs added to for shortcut events --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/window.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 150e41b25d..ad0a3cae5a 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -322,7 +322,7 @@ void Application::startApplication() { void Application::closeApplication() { if (App::launchState() != App::QuitProcessed); App::setLaunchState(App::QuitProcessed); - App::quit(); + delete AppObject; AppObject = 0; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index ba6f86229d..197d42174d 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1037,9 +1037,11 @@ 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: + DEBUG_LOG(("Shortcut event catched: %1").arg(static_cast(e)->key().toString())); if (Shortcuts::launch(static_cast(e)->shortcutId())) { return true; } From 877ff6fc4941854447350aafab93552e2a0dc3fb Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Mar 2016 16:05:18 +0200 Subject: [PATCH 156/316] fixed os x shortcuts by Qt patch --- Telegram/_qtbase_5_5_1_patch.diff | 46 +++++++++++++++++++++++++++++-- doc/building-xcode-old.md | 30 +++++++++++++------- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/Telegram/_qtbase_5_5_1_patch.diff b/Telegram/_qtbase_5_5_1_patch.diff index 8447f44c48..2b727bab4c 100644 --- a/Telegram/_qtbase_5_5_1_patch.diff +++ b/Telegram/_qtbase_5_5_1_patch.diff @@ -11203,6 +11203,19 @@ index ca92103..f681b08 100644 QPainter p(&m_qImage); p.setCompositionMode(QPainter::CompositionMode_Source); const QVector rects = region.rects(); +diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm +index c2d206f..d3881f6 100644 +--- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm ++++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm +@@ -356,7 +356,7 @@ Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers() + bool QCocoaKeyMapper::updateKeyboard() + { + const UCKeyboardLayout *uchrData = 0; +- QCFType source = TISCopyCurrentKeyboardInputSource(); ++ QCFType source = TISCopyCurrentASCIICapableKeyboardInputSource();//TISCopyCurrentKeyboardInputSource(); + if (keyboard_mode != NullMode && source == currentInputSource) { + return false; + } diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index 713758c..9b23ca2 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -11376,7 +11389,7 @@ index 3188463..cbee264 100644 [iconButton setImage:image]; [image release]; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm -index 1ec33df..03c84a1 100644 +index 1ec33df..45d436c 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1357,7 +1357,8 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) @@ -11389,7 +11402,36 @@ index 1ec33df..03c84a1 100644 m_scrolling = true; ph = Qt::ScrollBegin; } -@@ -1502,6 +1503,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) +@@ -1418,14 +1419,20 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) + quint32 nativeVirtualKey = [nsevent keyCode]; + + QChar ch = QChar::ReplacementCharacter; +- int keyCode = Qt::Key_unknown; +- if ([characters length] != 0) { +- if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0)) +- ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); +- else +- ch = QChar([characters characterAtIndex:0]); +- keyCode = [self convertKeyCode:ch]; +- } ++ if ([characters length] != 0) // https://bugreports.qt.io/browse/QTBUG-42584 ++ ch = QChar([characters characterAtIndex:0]); ++ else if ([charactersIgnoringModifiers length] != 0 && ((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier))) ++ ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); ++ ++ int keyCode = [self convertKeyCode:ch]; ++ //int keyCode = Qt::Key_unknown; ++ //if ([characters length] != 0) { ++ // if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0)) ++ // ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); ++ // else ++ // ch = QChar([characters characterAtIndex:0]); ++ // keyCode = [self convertKeyCode:ch]; ++ //} + + // we will send a key event unless the input method sets m_sendKeyEvent to false + m_sendKeyEvent = true; +@@ -1502,6 +1509,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) && qtKey == Qt::Key_Period) { [self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)]; return YES; diff --git a/doc/building-xcode-old.md b/doc/building-xcode-old.md index 00d2e3e37a..cef39bc6a4 100644 --- a/doc/building-xcode-old.md +++ b/doc/building-xcode-old.md @@ -157,25 +157,35 @@ Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg** and run sudo make install ####Qt 5.3.2, slightly patched +#####Get the source code -http://download.qt-project.org/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz +In Terminal go to **/Users/user/TBuild/Libraries** and run: -Extract to **/Users/user/TBuild/Libraries**, rename **qt-everywhere-opensource-src-5.3.2** to **QtStatic** to have **/Users/user/TBuild/Libraries/QtStatic/qtbase** folder + git clone git://code.qt.io/qt/qt5.git QtStatic + cd QtStatic + git checkout 5.3 + perl init-repository --module-subset=qtbase,qtimageformats + git checkout v5.3.2 + cd qtimageformats && git checkout v5.3.2 && cd .. + cd qtbase && git checkout v5.3.2 && cd .. -Apply patch: +#####Apply the patch -* OR copy (with overwrite!) everything from **/Users/user/TBuild/tdesktop/\_qt\_5\_3\_2\_patch/** to **/Users/user/TBuild/Libraries/QtStatic/** -* OR copy **/Users/user/TBuild/tdesktop/\_qt\_5\_3\_2\_patch.diff** to **/Users/user/TBuild/Libraries/QtStatic/**, go there in Terminal and run +From **/Users/user/TBuild/Libraries/QtStatic/qtbase**, run: - git apply _qt_5_3_2_patch.diff + git apply ../../../tdesktop/Telegram/_qtbase_5_3_2_patch.diff + +From **/Users/user/TBuild/Libraries/QtStatic/qtimageformats**, run: + + git apply ../../../tdesktop/Telegram/_qtimageformats_5_3_2_patch.diff #####Building library -In Terminal go to **/Users/user/TBuild/Libraries/QtStatic** and there run +Go to **/Users/user/TBuild/Libraries/QtStatic** and run: - ./configure -debug-and-release -opensource -confirm-license -static -opengl desktop -no-openssl -securetransport -nomake examples -nomake tests -platform macx-g++ - make -j4 module-qtbase module-qtimageformats - sudo make module-qtbase-install_subtargets module-qtimageformats-install_subtargets + ./configure -debug-and-release -opensource -confirm-license -static -opengl desktop -nomake examples -nomake tests -platform macx-g++ + make -j4 + sudo make -j4 install building (**make** command) will take really long time. From 7c62de51ff9af0e7bd1566dc1368c867cbdb1dae Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 3 Mar 2016 20:37:15 +0200 Subject: [PATCH 157/316] 0.9.30 dev version - fix forwarded text style, fixed sticker preview update on sticker load --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/layerwidget.cpp | 1 + Telegram/SourceFiles/shortcuts.cpp | 1 + Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 6 +++--- 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index ad0a3cae5a..fe7986b7d2 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -320,7 +320,7 @@ void Application::startApplication() { } void Application::closeApplication() { - if (App::launchState() != App::QuitProcessed); + if (App::launchState() == App::QuitProcessed) return; App::setLaunchState(App::QuitProcessed); delete AppObject; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 9e4060c8b8..83969d1c61 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9029; -static const wchar_t *AppVersionStr = L"0.9.29"; +static const int32 AppVersion = 9030; +static const wchar_t *AppVersionStr = L"0.9.30"; static const bool DevVersion = true; //#define BETA_VERSION (9028002ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 412bb0735a..d582b39bda 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6722,7 +6722,7 @@ void HistoryMessage::drawMessageText(Painter &p, QRect trect, uint32 selection) bool breakEverywhere = (fwd->_text.countHeight(trect.width()) > 2 * serviceFont->height); textstyleSet(&((selection == FullSelection) ? (outbg ? st::outFwdTextStyleSelected : st::inFwdTextStyleSelected) : (outbg ? st::outFwdTextStyle : st::inFwdTextStyle))); fwd->_text.drawElided(p, trect.x(), trect.y(), trect.width(), 2, style::al_left, 0, -1, 0, breakEverywhere); - textstyleRestore(); + textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); trect.setY(trect.y() + (((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * serviceFont->height)); } diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp index 63a1c0ec68..33d91eae39 100644 --- a/Telegram/SourceFiles/layerwidget.cpp +++ b/Telegram/SourceFiles/layerwidget.cpp @@ -197,6 +197,7 @@ StickerPreviewWidget::StickerPreviewWidget(QWidget *parent) : TWidget(parent) , _gif(0) , _cacheStatus(CacheNotLoaded) { setAttribute(Qt::WA_TransparentForMouseEvents); + connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); } void StickerPreviewWidget::paintEvent(QPaintEvent *e) { diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp index dd395f8804..149bea95e2 100644 --- a/Telegram/SourceFiles/shortcuts.cpp +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -287,6 +287,7 @@ namespace Shortcuts { LOG(("Warning: could not find shortcut command handler '%1'").arg(command)); } else { QShortcut *shortcut(new QShortcut(seq, App::wnd(), nullptr, nullptr, Qt::ApplicationShortcut)); + shortcut->setAutoRepeat(false); int shortcutId = shortcut->id(); if (!shortcutId) { DataPtr->errors.push_back(qsl("Could not create shortcut '%1'!").arg(keys)); diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index d4df84bc4c..d5ad09d52f 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.29 + 0.9.30 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 4a040b9720..2e6ffef053 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,29,0 - PRODUCTVERSION 0,9,29,0 + FILEVERSION 0,9,30,0 + PRODUCTVERSION 0,9,30,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.29.0" + VALUE "FileVersion", "0.9.30.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.29.0" + VALUE "ProductVersion", "0.9.30.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index f33e49f056..339fc41cfb 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1726,7 +1726,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.29; + CURRENT_PROJECT_VERSION = 0.9.30; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1745,7 +1745,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.29; + CURRENT_PROJECT_VERSION = 0.9.30; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1774,10 +1774,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.29; + CURRENT_PROJECT_VERSION = 0.9.30; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.29; + DYLIB_CURRENT_VERSION = 0.9.30; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1915,10 +1915,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.29; + CURRENT_PROJECT_VERSION = 0.9.30; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.29; + DYLIB_CURRENT_VERSION = 0.9.30; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index a89b5197dd..cb02af01c5 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9029 +AppVersion 9030 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.29 -AppVersionStr 0.9.29 +AppVersionStrSmall 0.9.30 +AppVersionStr 0.9.30 DevChannel 1 BetaVersion 0 9028002 From d1353b7e73a8ff3a8cbe3eea46d54d3cd2b0221c Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 4 Mar 2016 16:01:39 +0200 Subject: [PATCH 158/316] admin badge added to group/supergroup profile --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/profilewidget.cpp | 27 ++++++++++++++++++-------- Telegram/SourceFiles/profilewidget.h | 6 +++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 387bdd0d77..39574f5a68 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -429,6 +429,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Add Members"; "lng_profile_delete_and_exit" = "Leave"; "lng_profile_kick" = "Remove"; +"lng_profile_admin" = "admin"; "lng_profile_sure_kick" = "Remove {user} from the group?"; "lng_profile_sure_kick_channel" = "Remove {user} from the channel?"; "lng_profile_sure_kick_admin" = "Remove {user} from administrators?"; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 72e7bf5155..1f36133c14 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -947,24 +947,31 @@ void ProfileInner::paintEvent(QPaintEvent *e) { } else { data->online = App::onlineText(user, l_time); } + if (_peerChat) { + data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->admins.constFind(user) != _peerChat->admins.cend()); + } else if (_peerChannel) { + data->admin = (_peerChannel->mgInfo->lastAdmins.constFind(user) != _peerChannel->mgInfo->lastAdmins.cend()); + } else { + data->admin = false; + } if (_amCreator) { data->cankick = (user != App::self()); } else if (_peerChat && _peerChat->amAdmin()) { - data->cankick = (user != App::self()) && (_peerChat->admins.constFind(user) == _peerChat->admins.cend()) && (peerFromUser(_peerChat->creator) != user->id); + data->cankick = (user != App::self()) && !data->admin; } else if (_peerChannel && _peerChannel->amEditor()) { - data->cankick = (user != App::self()) && (_peerChannel->mgInfo->lastAdmins.constFind(user) == _peerChannel->mgInfo->lastAdmins.cend()); + data->cankick = (user != App::self()) && !data->admin; } else { data->cankick = (user != App::self()) && !_peerChannel && (_peerChat->invitedByMe.constFind(user) != _peerChat->invitedByMe.cend()); } } - p.setPen(st::profileListNameColor->p); - p.setFont(st::linkFont->f); + p.setPen(st::profileListNameColor); + p.setFont(st::linkFont); data->name.drawElided(p, _left + st::profileListPhotoSize + st::profileListPadding.width(), top + st::profileListNameTop, _width - _kickWidth - st::profileListPadding.width() - st::profileListPhotoSize - st::profileListPadding.width()); - p.setFont(st::profileSubFont->f); - p.setPen((App::onlineColorUse(user, l_time) ? st::profileOnlineColor : st::profileOfflineColor)->p); + p.setFont(st::profileSubFont); + p.setPen(App::onlineColorUse(user, l_time) ? st::profileOnlineColor : st::profileOfflineColor); p.drawText(_left + st::profileListPhotoSize + st::profileListPadding.width(), top + st::profileListPadding.height() + st::profileListPhotoSize - st::profileListStatusBottom, data->online); - if (data->cankick) { + if (_selectedRow == cnt && data->cankick) { bool over = (user == _kickOver && (!_kickDown || _kickDown == _kickOver)); p.setFont((over ? st::linkOverFont : st::linkFont)->f); if (user == _kickOver && _kickOver == _kickDown) { @@ -972,7 +979,11 @@ void ProfileInner::paintEvent(QPaintEvent *e) { } else { p.setPen(st::btnDefLink.color->p); } - p.drawText(_left + _width - _kickWidth, top + st::profileListNameTop + st::linkFont->ascent, lang(lng_profile_kick)); + p.drawTextRight(width() - _left - _width, top + st::profileListNameTop, width(), lang(lng_profile_kick), _kickWidth); + } else if (data->admin) { + p.setFont(st::profileSubFont); + p.setPen(st::profileOfflineColor); + p.drawTextRight(width() - _left - _width, top + st::profileListNameTop, width(), lang(lng_profile_admin)); } } top += fullCnt * _pHeight; diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index d01c91b17d..46d741a7f6 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -193,11 +193,11 @@ private: uint64 _contactId; UserData *_kickOver, *_kickDown, *_kickConfirm; - typedef struct { + struct ParticipantData { Text name; QString online; - bool cankick; - } ParticipantData; + bool cankick, admin; + }; typedef QVector Participants; Participants _participants; typedef QVector ParticipantsData; From 00725739251e2e86470205e2755a78873d8ba772 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 4 Mar 2016 17:34:46 +0200 Subject: [PATCH 159/316] pinned message api used, ordering by online and displaying online count in small megagroups --- Telegram/SourceFiles/apiwrap.cpp | 20 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 3 +- Telegram/SourceFiles/historywidget.cpp | 21 +- Telegram/SourceFiles/mainwidget.cpp | 13 + Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 62 +++-- Telegram/SourceFiles/mtproto/mtpScheme.h | 271 +++++++++++++------ Telegram/SourceFiles/mtproto/scheme.tl | 11 +- Telegram/SourceFiles/profilewidget.cpp | 103 +++++-- Telegram/SourceFiles/profilewidget.h | 4 + Telegram/SourceFiles/structs.cpp | 21 +- Telegram/SourceFiles/structs.h | 17 +- 12 files changed, 377 insertions(+), 171 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 78b74c727b..1d006822ca 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -317,6 +317,13 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt h->asChannelHistory()->unreadCountAll = f.vunread_count.v; } } + if (channel->isMegagroup()) { + if (f.has_pinned_msg_id()) { + channel->mgInfo->pinnedMsgId = f.vpinned_msg_id.v; + } else { + channel->mgInfo->pinnedMsgId = 0; + } + } channel->fullUpdated(); App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), f.vnotify_settings); @@ -344,14 +351,21 @@ void ApiWrap::gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mt void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestId req) { const MTPDuserFull &d(result.c_userFull()); App::feedUsers(MTP_vector(1, d.vuser), false); - App::feedPhoto(d.vprofile_photo); + if (d.has_profile_photo()) { + App::feedPhoto(d.vprofile_photo); + } App::feedUserLink(MTP_int(peerToUser(peer->id)), d.vlink.c_contacts_link().vmy_link, d.vlink.c_contacts_link().vforeign_link, false); if (App::main()) { App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings); } - peer->asUser()->setBotInfo(d.vbot_info); - peer->asUser()->blocked = mtpIsTrue(d.vblocked) ? UserIsBlocked : UserIsNotBlocked; + if (d.has_bot_info()) { + peer->asUser()->setBotInfo(d.vbot_info); + } else { + peer->asUser()->setBotInfoVersion(-1); + } + peer->asUser()->blocked = d.is_blocked() ? UserIsBlocked : UserIsNotBlocked; + peer->asUser()->about = d.has_about() ? qs(d.vabout) : QString(); if (req) { QMap::iterator i = _fullPeerRequests.find(peer); diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 86accc4bc9..c695c19494 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -1094,7 +1094,8 @@ void EditNameTitleBox::onSave() { } _sentName = first; if (_peer == App::self()) { - _requestId = MTP::send(MTPaccount_UpdateProfile(MTP_string(first), MTP_string(last)), rpcDone(&EditNameTitleBox::onSaveSelfDone), rpcFail(&EditNameTitleBox::onSaveSelfFail)); + 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)); } 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/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 91b027d791..6ab5eef103 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -5587,7 +5587,26 @@ void HistoryWidget::updateOnlineDisplay(int32 x, int32 w) { } } } else if (_peer->isChannel()) { - text = _peer->asChannel()->count ? lng_chat_status_members(lt_count, _peer->asChannel()->count) : lang(_peer->isMegagroup() ? lng_group_status : lng_channel_status); + if (_peer->isMegagroup() && _peer->asChannel()->count > 0 && _peer->asChannel()->count <= Global::ChatSizeMax()) { + if (_peer->asChannel()->mgInfo->lastParticipants.size() < _peer->asChannel()->count || _peer->asChannel()->lastParticipantsCountOutdated()) { + if (App::api()) App::api()->requestLastParticipants(_peer->asChannel()); + } + int32 onlineCount = 0; + bool onlyMe = true; + for (MentionRows::const_iterator i = _peer->asChannel()->mgInfo->lastParticipants.cbegin(), e = _peer->asChannel()->mgInfo->lastParticipants.cend(); i != e; ++i) { + if ((*i)->onlineTill > t) { + ++onlineCount; + if (onlyMe && (*i) != App::self()) onlyMe = false; + } + } + if (onlineCount && !onlyMe) { + text = lng_chat_status_members_online(lt_count, _peer->asChannel()->count, lt_count_online, onlineCount); + } else { + text = lng_chat_status_members(lt_count, _peer->asChannel()->count); + } + } else { + text = _peer->asChannel()->count ? lng_chat_status_members(lt_count, _peer->asChannel()->count) : lang(_peer->isMegagroup() ? lng_group_status : lng_channel_status); + } } if (_titlePeerText != text) { _titlePeerText = text; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 1cd34b51df..6e49f67583 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4542,6 +4542,19 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { } } break; + case mtpc_updateChannelPinnedMessage: { + const MTPDupdateChannelPinnedMessage &d(update.c_updateChannelPinnedMessage()); + + if (ChannelData *channel = App::channelLoaded(d.vchannel_id.v)) { + if (channel->isMegagroup()) { + channel->mgInfo->pinnedMsgId = d.vid.v; + if (App::api()) { + emit App::api()->fullPeerUpdated(channel); + } + } + } + } break; + case mtpc_updateReadChannelInbox: { const MTPDupdateReadChannelInbox &d(update.c_updateReadChannelInbox()); ChannelData *channel = App::channelLoaded(d.vchannel_id.v); diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index dc16848d75..53965606cd 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -368,7 +368,7 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 48; +static const mtpPrime mtpCurrentLayer = 49; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 57bc8ec598..40ec2b60ee 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1226,6 +1226,7 @@ void _serialize_channelFull(MTPStringLogger &to, int32 stage, int32 lev, Types & case 13: to.add(" bot_info: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 14: 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 15: 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 16: 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1959,12 +1960,14 @@ void _serialize_userFull(MTPStringLogger &to, int32 stage, int32 lev, Types &typ to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" user: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" link: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" profile_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; - case 4: to.add(" blocked: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" bot_info: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_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 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 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2891,6 +2894,20 @@ void _serialize_updateEditChannelMessage(MTPStringLogger &to, int32 stage, int32 } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updateChannelPinnedMessage"); + 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; + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -4304,10 +4321,6 @@ void _serialize_botCommand(MTPStringLogger &to, int32 stage, int32 lev, Types &t } } -void _serialize_botInfoEmpty(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - to.add("{ botInfoEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); -} - 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -4317,10 +4330,8 @@ void _serialize_botInfo(MTPStringLogger &to, int32 stage, int32 lev, Types &type } 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(" 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(" share_text: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" description: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" commands: "); ++stages.back(); types.push_back(00); 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 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; } } @@ -6031,8 +6042,10 @@ void _serialize_account_updateProfile(MTPStringLogger &to, int32 stage, int32 le to.add("\n").addSpaces(lev); } switch (stage) { - case 0: 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 1: 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(" 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6937,6 +6950,20 @@ void _serialize_channels_editMessage(MTPStringLogger &to, int32 stage, int32 lev } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ channels_updatePinnedMessage"); + to.add("\n").addSpaces(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(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_messages_getChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7760,6 +7787,7 @@ namespace { _serializers.insert(mtpc_updateBotInlineQuery, _serialize_updateBotInlineQuery); _serializers.insert(mtpc_updateBotInlineSend, _serialize_updateBotInlineSend); _serializers.insert(mtpc_updateEditChannelMessage, _serialize_updateEditChannelMessage); + _serializers.insert(mtpc_updateChannelPinnedMessage, _serialize_updateChannelPinnedMessage); _serializers.insert(mtpc_updates_state, _serialize_updates_state); _serializers.insert(mtpc_updates_differenceEmpty, _serialize_updates_differenceEmpty); _serializers.insert(mtpc_updates_difference, _serialize_updates_difference); @@ -7876,7 +7904,6 @@ namespace { _serializers.insert(mtpc_stickerSet, _serialize_stickerSet); _serializers.insert(mtpc_messages_stickerSet, _serialize_messages_stickerSet); _serializers.insert(mtpc_botCommand, _serialize_botCommand); - _serializers.insert(mtpc_botInfoEmpty, _serialize_botInfoEmpty); _serializers.insert(mtpc_botInfo, _serialize_botInfo); _serializers.insert(mtpc_keyboardButton, _serialize_keyboardButton); _serializers.insert(mtpc_keyboardButtonRow, _serialize_keyboardButtonRow); @@ -8072,6 +8099,7 @@ namespace { _serializers.insert(mtpc_channels_toggleInvites, _serialize_channels_toggleInvites); _serializers.insert(mtpc_channels_toggleSignatures, _serialize_channels_toggleSignatures); _serializers.insert(mtpc_channels_editMessage, _serialize_channels_editMessage); + _serializers.insert(mtpc_channels_updatePinnedMessage, _serialize_channels_updatePinnedMessage); _serializers.insert(mtpc_messages_getChats, _serialize_messages_getChats); _serializers.insert(mtpc_channels_getChannels, _serialize_channels_getChannels); _serializers.insert(mtpc_messages_getFullChat, _serialize_messages_getFullChat); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 94cd2994a5..8ffca9b897 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -136,7 +136,7 @@ enum { mtpc_channel = 0x4b1b7506, mtpc_channelForbidden = 0x2d85832c, mtpc_chatFull = 0x2e02a614, - mtpc_channelFull = 0x9e341ddf, + mtpc_channelFull = 0x97bee562, mtpc_chatParticipant = 0xc8d7493e, mtpc_chatParticipantCreator = 0xda13538a, mtpc_chatParticipantAdmin = 0xe2d6e436, @@ -197,7 +197,7 @@ enum { mtpc_inputReportReasonViolence = 0x1e22c78d, mtpc_inputReportReasonPornography = 0x2e59d922, mtpc_inputReportReasonOther = 0xe1746d0a, - mtpc_userFull = 0x5a89ac5b, + mtpc_userFull = 0x5932fc03, mtpc_contact = 0xf911c994, mtpc_importedContact = 0xd0028438, mtpc_contactBlocked = 0x561bc879, @@ -270,6 +270,7 @@ enum { mtpc_updateBotInlineQuery = 0xc01eea08, mtpc_updateBotInlineSend = 0xf69e113, mtpc_updateEditChannelMessage = 0x1b3f4df7, + mtpc_updateChannelPinnedMessage = 0x98592475, mtpc_updates_state = 0xa56c2a3e, mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_difference = 0xf49ca0, @@ -386,8 +387,7 @@ enum { mtpc_stickerSet = 0xcd303b41, mtpc_messages_stickerSet = 0xb60a24a6, mtpc_botCommand = 0xc27ac8c7, - mtpc_botInfoEmpty = 0xbb2e37ce, - mtpc_botInfo = 0x9cf585d, + mtpc_botInfo = 0x98e81d3a, mtpc_keyboardButton = 0xa2fa4880, mtpc_keyboardButtonRow = 0x77608b83, mtpc_replyKeyboardHide = 0xa03e5b85, @@ -476,7 +476,7 @@ enum { mtpc_account_updateNotifySettings = 0x84be5b93, mtpc_account_getNotifySettings = 0x12b3ad31, mtpc_account_resetNotifySettings = 0xdb7e1747, - mtpc_account_updateProfile = 0xf0888d68, + mtpc_account_updateProfile = 0x78515775, mtpc_account_updateStatus = 0x6628562c, mtpc_account_getWallPapers = 0xc04cfac2, mtpc_account_reportPeer = 0xae189d5f, @@ -612,7 +612,8 @@ enum { mtpc_channels_exportMessageLink = 0xc846d22d, mtpc_channels_toggleSignatures = 0x1f69b606, mtpc_channels_getMessageEditData = 0x27ea3a28, - mtpc_channels_editMessage = 0xdcda80ed + mtpc_channels_editMessage = 0xdcda80ed, + mtpc_channels_updatePinnedMessage = 0x84a41867 }; // Type forward declarations @@ -950,6 +951,7 @@ class MTPDupdateStickerSetsOrder; class MTPDupdateBotInlineQuery; class MTPDupdateBotInlineSend; class MTPDupdateEditChannelMessage; +class MTPDupdateChannelPinnedMessage; class MTPupdates_state; class MTPDupdates_state; @@ -3314,7 +3316,7 @@ private: 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); + 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); mtpTypeId _type; }; @@ -4425,7 +4427,7 @@ public: private: explicit MTPuserFull(MTPDuserFull *_data); - friend MTPuserFull MTP_userFull(const MTPUser &_user, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, MTPBool _blocked, const MTPBotInfo &_bot_info); + 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); }; typedef MTPBoxed MTPUserFull; @@ -5458,6 +5460,18 @@ public: return *(const MTPDupdateEditChannelMessage*)data; } + MTPDupdateChannelPinnedMessage &_updateChannelPinnedMessage() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateChannelPinnedMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateChannelPinnedMessage); + split(); + return *(MTPDupdateChannelPinnedMessage*)data; + } + const MTPDupdateChannelPinnedMessage &c_updateChannelPinnedMessage() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateChannelPinnedMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateChannelPinnedMessage); + return *(const MTPDupdateChannelPinnedMessage*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -5509,6 +5523,7 @@ private: explicit MTPupdate(MTPDupdateBotInlineQuery *_data); explicit MTPupdate(MTPDupdateBotInlineSend *_data); 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); @@ -5554,6 +5569,7 @@ private: 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); mtpTypeId _type; }; @@ -7776,39 +7792,32 @@ typedef MTPBoxed MTPBotCommand; class MTPbotInfo : private mtpDataOwner { public: - MTPbotInfo() : mtpDataOwner(0), _type(0) { - } - MTPbotInfo(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + MTPbotInfo(); + MTPbotInfo(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_botInfo) : mtpDataOwner(0) { read(from, end, cons); } MTPDbotInfo &_botInfo() { if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_botInfo) throw mtpErrorWrongTypeId(_type, mtpc_botInfo); split(); return *(MTPDbotInfo*)data; } const MTPDbotInfo &c_botInfo() const { if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_botInfo) throw mtpErrorWrongTypeId(_type, mtpc_botInfo); return *(const MTPDbotInfo*)data; } uint32 innerLength() const; mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_botInfo); void write(mtpBuffer &to) const; typedef void ResponseType; private: - explicit MTPbotInfo(mtpTypeId type); explicit MTPbotInfo(MTPDbotInfo *_data); - friend MTPbotInfo MTP_botInfoEmpty(); - friend MTPbotInfo MTP_botInfo(MTPint _user_id, MTPint _version, const MTPstring &_share_text, const MTPstring &_description, const MTPVector &_commands); - - mtpTypeId _type; + friend MTPbotInfo MTP_botInfo(MTPint _user_id, const MTPstring &_description, const MTPVector &_commands); }; typedef MTPBoxed MTPBotInfo; @@ -10005,7 +10014,7 @@ class MTPDchannelFull : public mtpDataImpl { public: 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) : 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) { + 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) { } MTPint vflags; @@ -10023,6 +10032,7 @@ public: MTPVector vbot_info; MTPint vmigrated_from_chat_id; MTPint vmigrated_from_max_id; + MTPint vpinned_msg_id; enum { flag_can_view_participants = (1 << 3), @@ -10031,6 +10041,7 @@ public: 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; } @@ -10039,6 +10050,7 @@ public: 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 { @@ -10627,15 +10639,28 @@ class MTPDuserFull : public mtpDataImpl { public: MTPDuserFull() { } - MTPDuserFull(const MTPUser &_user, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, MTPBool _blocked, const MTPBotInfo &_bot_info) : vuser(_user), vlink(_link), vprofile_photo(_profile_photo), vnotify_settings(_notify_settings), vblocked(_blocked), vbot_info(_bot_info) { + 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) { } + MTPint vflags; MTPUser vuser; + MTPstring vabout; MTPcontacts_Link vlink; MTPPhoto vprofile_photo; MTPPeerNotifySettings vnotify_settings; - MTPBool vblocked; 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 { @@ -11337,6 +11362,17 @@ public: MTPint vpts_count; }; +class MTPDupdateChannelPinnedMessage : public mtpDataImpl { +public: + MTPDupdateChannelPinnedMessage() { + } + MTPDupdateChannelPinnedMessage(MTPint _channel_id, MTPint _id) : vchannel_id(_channel_id), vid(_id) { + } + + MTPint vchannel_id; + MTPint vid; +}; + class MTPDupdates_state : public mtpDataImpl { public: MTPDupdates_state() { @@ -12488,12 +12524,10 @@ class MTPDbotInfo : public mtpDataImpl { public: MTPDbotInfo() { } - MTPDbotInfo(MTPint _user_id, MTPint _version, const MTPstring &_share_text, const MTPstring &_description, const MTPVector &_commands) : vuser_id(_user_id), vversion(_version), vshare_text(_share_text), vdescription(_description), vcommands(_commands) { + MTPDbotInfo(MTPint _user_id, const MTPstring &_description, const MTPVector &_commands) : vuser_id(_user_id), vdescription(_description), vcommands(_commands) { } MTPint vuser_id; - MTPint vversion; - MTPstring vshare_text; MTPstring vdescription; MTPVector vcommands; }; @@ -14721,30 +14755,46 @@ public: class MTPaccount_updateProfile { // RPC method 'account.updateProfile' public: + MTPint vflags; MTPstring vfirst_name; MTPstring vlast_name; + MTPstring vabout; MTPaccount_updateProfile() { } MTPaccount_updateProfile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateProfile) { read(from, end, cons); } - MTPaccount_updateProfile(const MTPstring &_first_name, const MTPstring &_last_name) : vfirst_name(_first_name), vlast_name(_last_name) { + 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) { } + 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 vfirst_name.innerLength() + vlast_name.innerLength(); + return vflags.innerLength() + (has_first_name() ? vfirst_name.innerLength() : 0) + (has_last_name() ? vlast_name.innerLength() : 0) + (has_about() ? vabout.innerLength() : 0); } mtpTypeId type() const { return mtpc_account_updateProfile; } void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_updateProfile) { - vfirst_name.read(from, end); - vlast_name.read(from, end); + vflags.read(from, end); + if (has_first_name()) { vfirst_name.read(from, end); } else { vfirst_name = MTPstring(); } + if (has_last_name()) { vlast_name.read(from, end); } else { vlast_name = MTPstring(); } + if (has_about()) { vabout.read(from, end); } else { vabout = MTPstring(); } } void write(mtpBuffer &to) const { - vfirst_name.write(to); - vlast_name.write(to); + vflags.write(to); + if (has_first_name()) vfirst_name.write(to); + if (has_last_name()) vlast_name.write(to); + if (has_about()) vabout.write(to); } typedef MTPUser ResponseType; @@ -14757,7 +14807,7 @@ public: } MTPaccount_UpdateProfile(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPaccount_UpdateProfile(const MTPstring &_first_name, const MTPstring &_last_name) : MTPBoxed(MTPaccount_updateProfile(_first_name, _last_name)) { + MTPaccount_UpdateProfile(MTPint _flags, const MTPstring &_first_name, const MTPstring &_last_name, const MTPstring &_about) : MTPBoxed(MTPaccount_updateProfile(_flags, _first_name, _last_name, _about)) { } }; @@ -20551,6 +20601,48 @@ public: } }; +class MTPchannels_updatePinnedMessage { // RPC method 'channels.updatePinnedMessage' +public: + MTPInputChannel vchannel; + MTPint vid; + + MTPchannels_updatePinnedMessage() { + } + MTPchannels_updatePinnedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_updatePinnedMessage) { + read(from, end, cons); + } + MTPchannels_updatePinnedMessage(const MTPInputChannel &_channel, MTPint _id) : vchannel(_channel), vid(_id) { + } + + uint32 innerLength() const { + return vchannel.innerLength() + vid.innerLength(); + } + mtpTypeId type() const { + return mtpc_channels_updatePinnedMessage; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_updatePinnedMessage) { + vchannel.read(from, end); + vid.read(from, end); + } + void write(mtpBuffer &to) const { + vchannel.write(to); + vid.write(to); + } + + typedef MTPUpdates ResponseType; +}; +class MTPchannels_UpdatePinnedMessage : public MTPBoxed { +public: + MTPchannels_UpdatePinnedMessage() { + } + MTPchannels_UpdatePinnedMessage(const MTPchannels_updatePinnedMessage &v) : MTPBoxed(v) { + } + MTPchannels_UpdatePinnedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPchannels_UpdatePinnedMessage(const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_updatePinnedMessage(_channel, _id)) { + } +}; + // Inline methods definition inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { @@ -22990,7 +23082,7 @@ inline uint32 MTPchatFull::innerLength() const { } case mtpc_channelFull: { const MTPDchannelFull &v(c_channelFull()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vabout.innerLength() + (v.has_participants_count() ? v.vparticipants_count.innerLength() : 0) + (v.has_admins_count() ? v.vadmins_count.innerLength() : 0) + (v.has_kicked_count() ? v.vkicked_count.innerLength() : 0) + v.vread_inbox_max_id.innerLength() + v.vunread_count.innerLength() + v.vunread_important_count.innerLength() + v.vchat_photo.innerLength() + v.vnotify_settings.innerLength() + v.vexported_invite.innerLength() + v.vbot_info.innerLength() + (v.has_migrated_from_chat_id() ? v.vmigrated_from_chat_id.innerLength() : 0) + (v.has_migrated_from_max_id() ? v.vmigrated_from_max_id.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vabout.innerLength() + (v.has_participants_count() ? v.vparticipants_count.innerLength() : 0) + (v.has_admins_count() ? v.vadmins_count.innerLength() : 0) + (v.has_kicked_count() ? v.vkicked_count.innerLength() : 0) + v.vread_inbox_max_id.innerLength() + v.vunread_count.innerLength() + v.vunread_important_count.innerLength() + v.vchat_photo.innerLength() + v.vnotify_settings.innerLength() + v.vexported_invite.innerLength() + v.vbot_info.innerLength() + (v.has_migrated_from_chat_id() ? v.vmigrated_from_chat_id.innerLength() : 0) + (v.has_migrated_from_max_id() ? v.vmigrated_from_max_id.innerLength() : 0) + (v.has_pinned_msg_id() ? v.vpinned_msg_id.innerLength() : 0); } } return 0; @@ -23030,6 +23122,7 @@ inline void MTPchatFull::read(const mtpPrime *&from, const mtpPrime *end, mtpTyp v.vbot_info.read(from, end); if (v.has_migrated_from_chat_id()) { v.vmigrated_from_chat_id.read(from, end); } else { v.vmigrated_from_chat_id = MTPint(); } if (v.has_migrated_from_max_id()) { v.vmigrated_from_max_id.read(from, end); } else { v.vmigrated_from_max_id = MTPint(); } + if (v.has_pinned_msg_id()) { v.vpinned_msg_id.read(from, end); } else { v.vpinned_msg_id = MTPint(); } } break; default: throw mtpErrorUnexpected(cons, "MTPchatFull"); } @@ -23062,6 +23155,7 @@ inline void MTPchatFull::write(mtpBuffer &to) const { v.vbot_info.write(to); if (v.has_migrated_from_chat_id()) v.vmigrated_from_chat_id.write(to); if (v.has_migrated_from_max_id()) v.vmigrated_from_max_id.write(to); + if (v.has_pinned_msg_id()) v.vpinned_msg_id.write(to); } break; } } @@ -23079,8 +23173,8 @@ inline MTPchatFull::MTPchatFull(MTPDchannelFull *_data) : mtpDataOwner(_data), _ 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)); } -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) { - 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)); +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)); } inline uint32 MTPchatParticipant::innerLength() const { @@ -24597,7 +24691,7 @@ inline MTPuserFull::MTPuserFull() : mtpDataOwner(new MTPDuserFull()) { inline uint32 MTPuserFull::innerLength() const { const MTPDuserFull &v(c_userFull()); - return v.vuser.innerLength() + v.vlink.innerLength() + v.vprofile_photo.innerLength() + v.vnotify_settings.innerLength() + v.vblocked.innerLength() + v.vbot_info.innerLength(); + return v.vflags.innerLength() + v.vuser.innerLength() + (v.has_about() ? v.vabout.innerLength() : 0) + v.vlink.innerLength() + (v.has_profile_photo() ? v.vprofile_photo.innerLength() : 0) + v.vnotify_settings.innerLength() + (v.has_bot_info() ? v.vbot_info.innerLength() : 0); } inline mtpTypeId MTPuserFull::type() const { return mtpc_userFull; @@ -24607,26 +24701,28 @@ inline void MTPuserFull::read(const mtpPrime *&from, const mtpPrime *end, mtpTyp if (!data) setData(new MTPDuserFull()); MTPDuserFull &v(_userFull()); + v.vflags.read(from, end); v.vuser.read(from, end); + if (v.has_about()) { v.vabout.read(from, end); } else { v.vabout = MTPstring(); } v.vlink.read(from, end); - v.vprofile_photo.read(from, end); + if (v.has_profile_photo()) { v.vprofile_photo.read(from, end); } else { v.vprofile_photo = MTPPhoto(); } v.vnotify_settings.read(from, end); - v.vblocked.read(from, end); - v.vbot_info.read(from, end); + if (v.has_bot_info()) { v.vbot_info.read(from, end); } else { v.vbot_info = MTPBotInfo(); } } inline void MTPuserFull::write(mtpBuffer &to) const { const MTPDuserFull &v(c_userFull()); + v.vflags.write(to); v.vuser.write(to); + if (v.has_about()) v.vabout.write(to); v.vlink.write(to); - v.vprofile_photo.write(to); + if (v.has_profile_photo()) v.vprofile_photo.write(to); v.vnotify_settings.write(to); - v.vblocked.write(to); - v.vbot_info.write(to); + if (v.has_bot_info()) v.vbot_info.write(to); } inline MTPuserFull::MTPuserFull(MTPDuserFull *_data) : mtpDataOwner(_data) { } -inline MTPuserFull MTP_userFull(const MTPUser &_user, const MTPcontacts_Link &_link, const MTPPhoto &_profile_photo, const MTPPeerNotifySettings &_notify_settings, MTPBool _blocked, const MTPBotInfo &_bot_info) { - return MTPuserFull(new MTPDuserFull(_user, _link, _profile_photo, _notify_settings, _blocked, _bot_info)); +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)); } inline MTPcontact::MTPcontact() : mtpDataOwner(new MTPDcontact()) { @@ -25439,6 +25535,10 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateEditChannelMessage &v(c_updateEditChannelMessage()); return v.vmessage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength(); } + case mtpc_updateChannelPinnedMessage: { + const MTPDupdateChannelPinnedMessage &v(c_updateChannelPinnedMessage()); + return v.vchannel_id.innerLength() + v.vid.innerLength(); + } } return 0; } @@ -25730,6 +25830,12 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vpts.read(from, end); v.vpts_count.read(from, end); } break; + case mtpc_updateChannelPinnedMessage: _type = cons; { + if (!data) setData(new MTPDupdateChannelPinnedMessage()); + MTPDupdateChannelPinnedMessage &v(_updateChannelPinnedMessage()); + v.vchannel_id.read(from, end); + v.vid.read(from, end); + } break; default: throw mtpErrorUnexpected(cons, "MTPupdate"); } } @@ -25972,6 +26078,11 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vpts.write(to); v.vpts_count.write(to); } break; + case mtpc_updateChannelPinnedMessage: { + const MTPDupdateChannelPinnedMessage &v(c_updateChannelPinnedMessage()); + v.vchannel_id.write(to); + v.vid.write(to); + } break; } } inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -26020,6 +26131,7 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateBotInlineQuery: setData(new MTPDupdateBotInlineQuery()); break; case mtpc_updateBotInlineSend: setData(new MTPDupdateBotInlineSend()); break; case mtpc_updateEditChannelMessage: setData(new MTPDupdateEditChannelMessage()); break; + case mtpc_updateChannelPinnedMessage: setData(new MTPDupdateChannelPinnedMessage()); break; default: throw mtpErrorBadTypeId(type, "MTPupdate"); } } @@ -26107,6 +26219,8 @@ inline MTPupdate::MTPupdate(MTPDupdateBotInlineSend *_data) : mtpDataOwner(_data } inline MTPupdate::MTPupdate(MTPDupdateEditChannelMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateEditChannelMessage) { } +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)); } @@ -26239,6 +26353,9 @@ inline MTPupdate MTP_updateBotInlineSend(MTPint _user_id, const MTPstring &_quer inline MTPupdate MTP_updateEditChannelMessage(const MTPMessage &_message, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateEditChannelMessage(_message, _pts, _pts_count)); } +inline MTPupdate MTP_updateChannelPinnedMessage(MTPint _channel_id, MTPint _id) { + return MTPupdate(new MTPDupdateChannelPinnedMessage(_channel_id, _id)); +} inline MTPupdates_state::MTPupdates_state() : mtpDataOwner(new MTPDupdates_state()) { } @@ -29214,61 +29331,35 @@ inline MTPbotCommand MTP_botCommand(const MTPstring &_command, const MTPstring & return MTPbotCommand(new MTPDbotCommand(_command, _description)); } +inline MTPbotInfo::MTPbotInfo() : mtpDataOwner(new MTPDbotInfo()) { +} + inline uint32 MTPbotInfo::innerLength() const { - switch (_type) { - case mtpc_botInfo: { - const MTPDbotInfo &v(c_botInfo()); - return v.vuser_id.innerLength() + v.vversion.innerLength() + v.vshare_text.innerLength() + v.vdescription.innerLength() + v.vcommands.innerLength(); - } - } - return 0; + const MTPDbotInfo &v(c_botInfo()); + return v.vuser_id.innerLength() + v.vdescription.innerLength() + v.vcommands.innerLength(); } inline mtpTypeId MTPbotInfo::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; + return mtpc_botInfo; } inline void MTPbotInfo::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_botInfoEmpty: _type = cons; break; - case mtpc_botInfo: _type = cons; { - if (!data) setData(new MTPDbotInfo()); - MTPDbotInfo &v(_botInfo()); - v.vuser_id.read(from, end); - v.vversion.read(from, end); - v.vshare_text.read(from, end); - v.vdescription.read(from, end); - v.vcommands.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPbotInfo"); - } + if (cons != mtpc_botInfo) throw mtpErrorUnexpected(cons, "MTPbotInfo"); + + if (!data) setData(new MTPDbotInfo()); + MTPDbotInfo &v(_botInfo()); + v.vuser_id.read(from, end); + v.vdescription.read(from, end); + v.vcommands.read(from, end); } inline void MTPbotInfo::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_botInfo: { - const MTPDbotInfo &v(c_botInfo()); - v.vuser_id.write(to); - v.vversion.write(to); - v.vshare_text.write(to); - v.vdescription.write(to); - v.vcommands.write(to); - } break; - } + const MTPDbotInfo &v(c_botInfo()); + v.vuser_id.write(to); + v.vdescription.write(to); + v.vcommands.write(to); } -inline MTPbotInfo::MTPbotInfo(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_botInfoEmpty: break; - case mtpc_botInfo: setData(new MTPDbotInfo()); break; - default: throw mtpErrorBadTypeId(type, "MTPbotInfo"); - } +inline MTPbotInfo::MTPbotInfo(MTPDbotInfo *_data) : mtpDataOwner(_data) { } -inline MTPbotInfo::MTPbotInfo(MTPDbotInfo *_data) : mtpDataOwner(_data), _type(mtpc_botInfo) { -} -inline MTPbotInfo MTP_botInfoEmpty() { - return MTPbotInfo(mtpc_botInfoEmpty); -} -inline MTPbotInfo MTP_botInfo(MTPint _user_id, MTPint _version, const MTPstring &_share_text, const MTPstring &_description, const MTPVector &_commands) { - return MTPbotInfo(new MTPDbotInfo(_user_id, _version, _share_text, _description, _commands)); +inline MTPbotInfo MTP_botInfo(MTPint _user_id, const MTPstring &_description, const MTPVector &_commands) { + return MTPbotInfo(new MTPDbotInfo(_user_id, _description, _commands)); } inline MTPkeyboardButton::MTPkeyboardButton() : mtpDataOwner(new MTPDkeyboardButton()) { diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 8e4b7bf2f7..876080a4bf 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -213,7 +213,7 @@ channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?t channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; -channelFull#9e341ddf flags:# can_view_participants:flags.3?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int = ChatFull; +channelFull#97bee562 flags:# can_view_participants:flags.3?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int = ChatFull; chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; chatParticipantCreator#da13538a user_id:int = ChatParticipant; @@ -296,7 +296,7 @@ inputReportReasonViolence#1e22c78d = ReportReason; inputReportReasonPornography#2e59d922 = ReportReason; inputReportReasonOther#e1746d0a text:string = ReportReason; -userFull#5a89ac5b user:User link:contacts.Link profile_photo:Photo notify_settings:PeerNotifySettings blocked:Bool bot_info:BotInfo = UserFull; +userFull#5932fc03 flags:# blocked:flags.0?true user:User about:flags.1?string link:contacts.Link profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo = UserFull; contact#f911c994 user_id:int mutual:Bool = Contact; @@ -384,6 +384,7 @@ updateSavedGifs#9375341e = Update; updateBotInlineQuery#c01eea08 query_id:long user_id:int query:string offset:string = Update; updateBotInlineSend#f69e113 user_id:int query:string id:string = Update; updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update; +updateChannelPinnedMessage#98592475 channel_id:int id:int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -553,8 +554,7 @@ messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents: botCommand#c27ac8c7 command:string description:string = BotCommand; -botInfoEmpty#bb2e37ce = BotInfo; -botInfo#9cf585d user_id:int version:int share_text:string description:string commands:Vector = BotInfo; +botInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo; keyboardButton#a2fa4880 text:string = KeyboardButton; @@ -676,7 +676,7 @@ account.unregisterDevice#65c55b40 token_type:int token:string = Bool; account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool; account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings; account.resetNotifySettings#db7e1747 = Bool; -account.updateProfile#f0888d68 first_name:string last_name:string = User; +account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User; account.updateStatus#6628562c offline:Bool = Bool; account.getWallPapers#c04cfac2 = Vector; account.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool; @@ -821,3 +821,4 @@ channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessag channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; channels.getMessageEditData#27ea3a28 channel:InputChannel id:int = channels.MessageEditData; channels.editMessage#dcda80ed flags:# no_webpage:flags.1?true channel:InputChannel id:int message:string entities:flags.3?Vector = Updates; +channels.updatePinnedMessage#84a41867 channel:InputChannel id:int = Updates; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 1f36133c14..ccc1f4a521 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -102,7 +102,8 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData , _kickDown(0) , _kickConfirm(0) -, _menu(0) { +, _menu(0) +, _updateDelayed(false) { connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); connect(App::api(), SIGNAL(fullPeerUpdated(PeerData*)), this, SLOT(onFullPeerUpdated(PeerData*))); @@ -187,9 +188,9 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData connect(App::main(), SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(peerUpdated(PeerData *))); // about - if (_peerUser && _peerUser->botInfo) { - if (!_peerUser->botInfo->shareText.isEmpty()) { - _about.setText(st::linkFont, _peerUser->botInfo->shareText, _historyBotNoMonoOptions); + if (_peerUser) { + if (!_peerUser->about.isEmpty()) { + _about.setText(st::linkFont, _peerUser->about, _peerUser->botInfo ? _historyBotNoMonoOptions : _historyTextNoMonoOptions); } updateBotLinksVisibility(); } else { @@ -526,11 +527,11 @@ void ProfileInner::onFullPeerUpdated(PeerData *peer) { } else { _photoLink = TextLinkPtr(); } - if (_peerUser->botInfo) { - if (_peerUser->botInfo->shareText.isEmpty()) { + if (_peerUser) { + if (_peerUser->about.isEmpty()) { _about = Text(st::wndMinWidth - st::profilePadding.left() - st::profilePadding.right()); } else { - _about.setText(st::linkFont, _peerUser->botInfo->shareText, _historyBotNoMonoOptions); + _about.setText(st::linkFont, _peerUser->about, _peerUser->botInfo ? _historyBotNoMonoOptions : _historyTextNoMonoOptions); } updateBotLinksVisibility(); resizeEvent(0); @@ -613,11 +614,17 @@ void ProfileInner::peerUpdated(PeerData *data) { _nameCache = _peer->name; _nameText.setText(st::profileNameFont, _nameCache, _textNameOptions); } - showAll(); - resizeEvent(0); - } else { - showAll(); } + if (!_updateDelayed) { + _updateDelayed = true; + QMetaObject::invokeMethod(this, "onUpdateDelayed", Qt::QueuedConnection); + } +} + +void ProfileInner::onUpdateDelayed() { + _updateDelayed = false; + showAll(); + resizeEvent(0); update(); } @@ -688,34 +695,76 @@ void ProfileInner::reorderParticipants() { } loadProfilePhotos(_lastPreload); } else if (_peerChannel && _peerChannel->isMegagroup() && _peerChannel->amIn() && !_peerChannel->mgInfo->lastParticipants.isEmpty()) { - bool needAdmins = _peerChannel->amEditor(), adminsOutdated = (_peerChannel->mgInfo->lastParticipantsStatus & MegagroupInfo::LastParticipantsAdminsOutdated); + bool needAdmins = true, adminsOutdated = (_peerChannel->mgInfo->lastParticipantsStatus & MegagroupInfo::LastParticipantsAdminsOutdated); + bool orderByOnline = true;// (_peerChannel->count > 0) && (_peerChannel->count <= Global::ChatSizeMax()); + + _onlineText.clear(); if (_peerChannel->mgInfo->lastParticipants.isEmpty() || (needAdmins && adminsOutdated) || _peerChannel->lastParticipantsCountOutdated()) { if (App::api()) App::api()->requestLastParticipants(_peerChannel); } else if (!_peerChannel->mgInfo->lastParticipants.isEmpty()) { const MegagroupInfo::LastParticipants &list(_peerChannel->mgInfo->lastParticipants); int32 s = list.size(); - for (int32 i = 0, l = _participants.size(); i < l; ++i) { - if (i >= s || _participants.at(i) != list.at(i)) { - if (_participantsData.at(i)) { - delete _participantsData.at(i); - _participantsData[i] = 0; - } - if (i < s) { - _participants[i] = list.at(i); + if (orderByOnline) { + _participants.clear(); + for (ParticipantsData::iterator i = _participantsData.begin(), e = _participantsData.end(); i != e; ++i) { + if (*i) { + delete *i; + *i = 0; } } - } - if (_participants.size() > s) { - _participants.resize(s); - } else { _participants.reserve(s); - for (int32 i = _participants.size(); i < s; ++i) { - _participants.push_back(list.at(i)); + + UserData *self = App::self(); + bool onlyMe = true; + for (int32 i = 0; i < s; ++i) { + UserData *user = list.at(i); + int32 until = App::onlineForSort(user, t); + Participants::iterator before = _participants.begin(); + if (user != self) { + if (before != _participants.end() && (*before) == self) { + ++before; + } + while (before != _participants.end() && App::onlineForSort(*before, t) >= until) { + ++before; + } + if (until > t && onlyMe) onlyMe = false; + } + _participants.insert(before, user); + if (until > t) { + ++onlineCount; + } + } + if (onlineCount && !onlyMe) { + _onlineText = lng_chat_status_members_online(lt_count, _peerChannel->count, lt_count_online, onlineCount); + } else { + _onlineText = lng_chat_status_members(lt_count, _peerChannel->count); + } + } else { + for (int32 i = 0, l = _participants.size(); i < l; ++i) { + if (i >= s || _participants.at(i) != list.at(i)) { + if (_participantsData.at(i)) { + delete _participantsData.at(i); + _participantsData[i] = 0; + } + if (i < s) { + _participants[i] = list.at(i); + } + } + } + if (_participants.size() > s) { + _participants.resize(s); + } else { + _participants.reserve(s); + for (int32 i = _participants.size(); i < s; ++i) { + _participants.push_back(list.at(i)); + } } } _participantsData.resize(s); } - _onlineText = (_peerChannel->count > 0) ? lng_chat_status_members(lt_count, _peerChannel->count) : lang(_peerChannel->isMegagroup() ? lng_group_status : lng_channel_status); + if (_onlineText.isEmpty()) { + _onlineText = (_peerChannel->count > 0) ? lng_chat_status_members(lt_count, _peerChannel->count) : lang(_peerChannel->isMegagroup() ? lng_group_status : lng_channel_status); + } loadProfilePhotos(_lastPreload); } else { _participants.clear(); diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 46d741a7f6..f512b442ad 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -124,6 +124,8 @@ public slots: void onBotSettings(); void onBotHelp(); + void onUpdateDelayed(); + private: void showAll(); @@ -210,6 +212,8 @@ private: QString _secretText; + bool _updateDelayed; + void blockDone(bool blocked, const MTPBool &result); bool blockFail(const RPCError &error); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 214622fccd..c2f9918855 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -263,7 +263,6 @@ void UserData::setBotInfoVersion(int32 version) { Notify::botCommandsChanged(this); } botInfo->description.clear(); - botInfo->shareText.clear(); botInfo->version = version; botInfo->inited = false; } @@ -271,33 +270,15 @@ void UserData::setBotInfoVersion(int32 version) { void UserData::setBotInfo(const MTPBotInfo &info) { switch (info.type()) { - case mtpc_botInfoEmpty: - if (botInfo) { - if (!botInfo->commands.isEmpty()) { - botInfo->commands.clear(); - Notify::botCommandsChanged(this); - } - delete botInfo; - botInfo = 0; - Notify::userIsBotChanged(this); - } - break; case mtpc_botInfo: { const MTPDbotInfo &d(info.c_botInfo()); - if (peerFromUser(d.vuser_id.v) != id) return; - - if (botInfo) { - botInfo->version = d.vversion.v; - } else { - setBotInfoVersion(d.vversion.v); - } + if (peerFromUser(d.vuser_id.v) != id || !botInfo) return; QString desc = qs(d.vdescription); if (botInfo->description != desc) { botInfo->description = desc; botInfo->text = Text(st::msgMinWidth); } - botInfo->shareText = qs(d.vshare_text); const QVector &v(d.vcommands.c_vector().v); botInfo->commands.reserve(v.size()); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 86dd227bd0..7d73b7c60e 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -334,7 +334,7 @@ struct BotInfo { bool inited; bool readsAllHistory, cantJoinGroups; int32 version; - QString shareText, description, inlinePlaceholder; + QString description, inlinePlaceholder; QList commands; Text text; // description @@ -390,6 +390,8 @@ public: Photos photos; int32 photosCount; // -1 not loaded, 0 all loaded + QString about; + BotInfo *botInfo; }; static UserData * const InlineBotLookingUpData = SharedMemoryLocation(); @@ -530,11 +532,13 @@ private: }; struct MegagroupInfo { - MegagroupInfo() : botStatus(0) - , joinedMessageFound(false) - , lastParticipantsStatus(LastParticipantsUpToDate) - , lastParticipantsCount(0) - , migrateFromPtr(0) { + MegagroupInfo() + : botStatus(0) + , pinnedMsgId(0) + , joinedMessageFound(false) + , lastParticipantsStatus(LastParticipantsUpToDate) + , lastParticipantsCount(0) + , migrateFromPtr(0) { } typedef QList LastParticipants; LastParticipants lastParticipants; @@ -546,6 +550,7 @@ struct MegagroupInfo { Bots bots; int32 botStatus; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other + MsgId pinnedMsgId; bool joinedMessageFound; enum LastParticipantsStatus { From 7609607799fa3f21796c1b641debaf0b89aefb9b Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 4 Mar 2016 18:09:58 +0200 Subject: [PATCH 160/316] correct fix of OS X shortcuts in Qt patch (see https://codereview.qt-project.org/#/c/150154/) --- Telegram/_qtbase_5_5_1_patch.diff | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Telegram/_qtbase_5_5_1_patch.diff b/Telegram/_qtbase_5_5_1_patch.diff index 2b727bab4c..2fd2db7b50 100644 --- a/Telegram/_qtbase_5_5_1_patch.diff +++ b/Telegram/_qtbase_5_5_1_patch.diff @@ -11204,18 +11204,30 @@ index ca92103..f681b08 100644 p.setCompositionMode(QPainter::CompositionMode_Source); const QVector rects = region.rects(); diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm -index c2d206f..d3881f6 100644 +index c2d206f..0d4d7ab 100644 --- a/src/plugins/platforms/cocoa/qcocoakeymapper.mm +++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm -@@ -356,7 +356,7 @@ Qt::KeyboardModifiers QCocoaKeyMapper::queryKeyboardModifiers() - bool QCocoaKeyMapper::updateKeyboard() - { - const UCKeyboardLayout *uchrData = 0; -- QCFType source = TISCopyCurrentKeyboardInputSource(); -+ QCFType source = TISCopyCurrentASCIICapableKeyboardInputSource();//TISCopyCurrentKeyboardInputSource(); - if (keyboard_mode != NullMode && source == currentInputSource) { - return false; +@@ -384,6 +384,11 @@ bool QCocoaKeyMapper::updateKeyboard() + keyboardInputLocale = QLocale::c(); + keyboardInputDirection = Qt::LeftToRight; } ++ ++ const auto newMode = keyboard_mode; ++ deleteLayouts(); ++ keyboard_mode = newMode; ++ + return true; + } + +@@ -466,7 +471,7 @@ QList QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const + Qt::KeyboardModifiers neededMods = ModsTbl[i]; + int key = kbItem->qtKey[i]; + if (key && key != baseKey && ((keyMods & neededMods) == neededMods)) { +- ret << int(key + (keyMods & ~neededMods)); ++ ret << int(key + neededMods); + } + } + return ret; diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index 713758c..9b23ca2 100755 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm From cb78bd1a10f0d4a5080ae3287fee97dfdaa309e0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 4 Mar 2016 18:47:48 +0200 Subject: [PATCH 161/316] public links display / edit done in megagroups --- Telegram/Resources/lang.strings | 4 ++ Telegram/SourceFiles/boxes/addcontactbox.cpp | 62 +++++++++++++------- Telegram/SourceFiles/boxes/addcontactbox.h | 2 + Telegram/SourceFiles/profilewidget.cpp | 6 +- 4 files changed, 49 insertions(+), 25 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 39574f5a68..95efa2589b 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -477,6 +477,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_channel_about" = "Anyone can find the channel in search and join"; "lng_create_private_channel_title" = "Private Channel"; "lng_create_private_channel_about" = "Only people with a special invite link may join"; +"lng_create_public_group_title" = "Public Group"; +"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; +"lng_create_private_group_title" = "Private Group"; +"lng_create_private_group_about" = "Only invited people may join and see the chat history"; "lng_create_channel_comments" = "Enable Comments"; "lng_create_channel_comments_about" = "If you enable comments, members will be able to discuss your posts in the channel"; "lng_create_group_skip" = "Skip"; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index c695c19494..7ba83729da 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -605,12 +605,12 @@ void GroupInfoBox::onPhotoReady(const QImage &img) { SetupChannelBox::SetupChannelBox(ChannelData *channel, bool existing) : AbstractBox() , _channel(channel) , _existing(existing) -, _public(this, qsl("channel_privacy"), 0, lang(lng_create_public_channel_title), true) -, _private(this, qsl("channel_privacy"), 1, lang(lng_create_private_channel_title)) +, _public(this, qsl("channel_privacy"), 0, lang(channel->isMegagroup() ? lng_create_public_group_title : lng_create_public_channel_title), true) +, _private(this, qsl("channel_privacy"), 1, lang(channel->isMegagroup() ? lng_create_private_group_title : lng_create_private_channel_title)) , _comments(this, lang(lng_create_channel_comments), false) , _aboutPublicWidth(width() - st::boxPadding.left() - st::boxButtonPadding.right() - st::newGroupPadding.left() - st::defaultRadiobutton.textPosition.x()) -, _aboutPublic(st::normalFont, lang(lng_create_public_channel_about), _defaultOptions, _aboutPublicWidth) -, _aboutPrivate(st::normalFont, lang(lng_create_private_channel_about), _defaultOptions, _aboutPublicWidth) +, _aboutPublic(st::normalFont, lang(channel->isMegagroup() ? lng_create_public_group_about : lng_create_public_channel_about), _defaultOptions, _aboutPublicWidth) +, _aboutPrivate(st::normalFont, lang(channel->isMegagroup() ? lng_create_private_group_about : lng_create_private_channel_about), _defaultOptions, _aboutPublicWidth) , _aboutComments(st::normalFont, lang(lng_create_channel_comments_about), _defaultOptions, _aboutPublicWidth) , _link(this, st::defaultInputField, QString(), channel->username, true) , _linkOver(false) @@ -626,7 +626,7 @@ SetupChannelBox::SetupChannelBox(ChannelData *channel, bool existing) : Abstract _checkRequestId = MTP::send(MTPchannels_CheckUsername(_channel->inputChannel, MTP_string("preston")), RPCDoneHandlerPtr(), rpcFail(&SetupChannelBox::onFirstCheckFail)); _aboutPublicHeight = _aboutPublic.countHeight(_aboutPublicWidth); - setMaxHeight(st::boxPadding.top() + st::newGroupPadding.top() + _public.height() + _aboutPublicHeight + st::newGroupSkip + _private.height() + _aboutPrivate.countHeight(_aboutPublicWidth)/* + st::newGroupSkip + _comments.height() + _aboutComments.countHeight(_aboutPublicWidth)*/ + st::newGroupSkip + st::newGroupPadding.bottom() + st::newGroupLinkPadding.top() + _link.height() + st::newGroupLinkPadding.bottom() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + updateMaxHeight(); connect(&_save, SIGNAL(clicked()), this, SLOT(onSave())); connect(&_skip, SIGNAL(clicked()), this, SLOT(onClose())); @@ -669,6 +669,14 @@ void SetupChannelBox::showDone() { _link.setFocus(); } +void SetupChannelBox::updateMaxHeight() { + if (!_channel->isMegagroup() || _public.checked()) { + setMaxHeight(st::boxPadding.top() + st::newGroupPadding.top() + _public.height() + _aboutPublicHeight + st::newGroupSkip + _private.height() + _aboutPrivate.countHeight(_aboutPublicWidth)/* + st::newGroupSkip + _comments.height() + _aboutComments.countHeight(_aboutPublicWidth)*/ + st::newGroupSkip + st::newGroupPadding.bottom() + st::newGroupLinkPadding.top() + _link.height() + st::newGroupLinkPadding.bottom() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + } else { + setMaxHeight(st::boxPadding.top() + st::newGroupPadding.top() + _public.height() + _aboutPublicHeight + st::newGroupSkip + _private.height() + _aboutPrivate.countHeight(_aboutPublicWidth)/* + st::newGroupSkip + _comments.height() + _aboutComments.countHeight(_aboutPublicWidth)*/ + st::newGroupSkip + st::newGroupPadding.bottom() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom()); + } +} + void SetupChannelBox::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) { if (_link.hasFocus()) { @@ -699,22 +707,26 @@ void SetupChannelBox::paintEvent(QPaintEvent *e) { //QRect aboutComments(st::boxPadding.left() + st::newGroupPadding.left() + st::defaultRadiobutton.textPosition.x(), _comments.y() + _comments.height(), _aboutPublicWidth, _aboutPublicHeight); //_aboutComments.drawLeft(p, aboutComments.x(), aboutComments.y(), aboutComments.width(), width()); - p.setPen(st::black); - p.setFont(st::newGroupLinkFont); - p.drawTextLeft(st::boxPadding.left() + st::newGroupPadding.left() + st::defaultInputField.textMargins.left(), _link.y() - st::newGroupLinkPadding.top() + st::newGroupLinkTop, width(), lang(_link.isHidden() ? lng_create_group_invite_link : lng_create_group_link)); + if (!_channel->isMegagroup() || !_link.isHidden()) { + p.setPen(st::black); + p.setFont(st::newGroupLinkFont); + p.drawTextLeft(st::boxPadding.left() + st::newGroupPadding.left() + st::defaultInputField.textMargins.left(), _link.y() - st::newGroupLinkPadding.top() + st::newGroupLinkTop, width(), lang(_link.isHidden() ? lng_create_group_invite_link : lng_create_group_link)); + } if (_link.isHidden()) { - QTextOption option(style::al_left); - option.setWrapMode(QTextOption::WrapAnywhere); - p.setFont(_linkOver ? st::boxTextFont->underline() : st::boxTextFont); - p.setPen(st::btnDefLink.color); - p.drawText(_invitationLink, _channel->invitationUrl, option); - if (!_goodTextLink.isEmpty() && a_goodOpacity.current() > 0) { - p.setOpacity(a_goodOpacity.current()); - p.setPen(st::setGoodColor); - p.setFont(st::boxTextFont); - p.drawTextRight(st::boxPadding.right(), _link.y() - st::newGroupLinkPadding.top() + st::newGroupLinkTop + st::newGroupLinkFont->ascent - st::boxTextFont->ascent, width(), _goodTextLink); - p.setOpacity(1); + if (!_channel->isMegagroup()) { + QTextOption option(style::al_left); + option.setWrapMode(QTextOption::WrapAnywhere); + p.setFont(_linkOver ? st::boxTextFont->underline() : st::boxTextFont); + p.setPen(st::btnDefLink.color); + p.drawText(_invitationLink, _channel->invitationUrl, option); + if (!_goodTextLink.isEmpty() && a_goodOpacity.current() > 0) { + p.setOpacity(a_goodOpacity.current()); + p.setPen(st::setGoodColor); + p.setFont(st::boxTextFont); + p.drawTextRight(st::boxPadding.right(), _link.y() - st::newGroupLinkPadding.top() + st::newGroupLinkTop + st::newGroupLinkFont->ascent - st::boxTextFont->ascent, width(), _goodTextLink); + p.setOpacity(1); + } } } else { if (!_errorText.isEmpty()) { @@ -879,6 +891,9 @@ void SetupChannelBox::onPrivacyChange() { _link.hide(); setFocus(); } + if (_channel->isMegagroup()) { + updateMaxHeight(); + } update(); } @@ -1198,11 +1213,10 @@ void EditChannelBox::showAll() { _description.show(); _save.show(); _cancel.show(); + _publicLink.show(); if (_channel->isMegagroup()) { - _publicLink.hide(); _sign.hide(); } else { - _publicLink.show(); _sign.show(); } } @@ -1259,7 +1273,11 @@ void EditChannelBox::resizeEvent(QResizeEvent *e) { _sign.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _description.y() + _description.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); - _publicLink.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _sign.y() + _sign.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); + if (_channel->isMegagroup()) { + _publicLink.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _description.y() + _description.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); + } else { + _publicLink.moveToLeft(st::boxPadding.left() + st::newGroupInfoPadding.left(), _sign.y() + _sign.height() + st::newGroupDescriptionPadding.bottom() + st::newGroupPublicLinkPadding.top()); + } _save.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _save.height()); _cancel.moveToRight(st::boxButtonPadding.right() + _save.width() + st::boxButtonPadding.left(), _save.y()); diff --git a/Telegram/SourceFiles/boxes/addcontactbox.h b/Telegram/SourceFiles/boxes/addcontactbox.h index 55e89f3e68..90e55311c3 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.h +++ b/Telegram/SourceFiles/boxes/addcontactbox.h @@ -211,6 +211,8 @@ private: bool onCheckFail(const RPCError &error); bool onFirstCheckFail(const RPCError &error); + void updateMaxHeight(); + ChannelData *_channel; bool _existing; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index ccc1f4a521..859dd74412 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -841,7 +841,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { addbyname = st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); p.setPen(st::black->p); p.drawText(_left + st::profilePhotoSize + st::profileStatusLeft, top + st::profileStatusTop + st::linkFont->ascent, '@' + _peerUser->username); - } else if (_peerChannel && !_peerChannel->isMegagroup() && (_peerChannel->isPublic() || _amCreator )) { + } else if (_peerChannel && (_peerChannel->isPublic() || _amCreator)) { addbyname = st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); } if (!_peerChannel || !_peerChannel->canViewParticipants() || _peerChannel->isMegagroup()) { @@ -1337,7 +1337,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { // profile top += st::profilePadding.top(); int32 addbyname = 0; - if (_peerChannel && !_peerChannel->isMegagroup() && (_amCreator || _peerChannel->isPublic())) { + if (_peerChannel && (_amCreator || _peerChannel->isPublic())) { _username.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + st::profileStatusTop); addbyname = st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); } @@ -1711,7 +1711,7 @@ void ProfileInner::showAll() { } else { _deleteChannel.hide(); } - if (!_peerChannel->isMegagroup() && (_peerChannel->isPublic() || _amCreator)) { + if (_peerChannel->isPublic() || _amCreator) { _username.show(); } else { _username.hide(); From 2bfb1e0f1fde41bbb4bda7b1cb7e37a7c9008b90 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 5 Mar 2016 00:04:15 +0200 Subject: [PATCH 162/316] convert to supergroup in all groups --- Telegram/Resources/lang.strings | 9 ++ Telegram/SourceFiles/boxes/addcontactbox.cpp | 10 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 121 +++++++++++++++++-- Telegram/SourceFiles/boxes/confirmbox.h | 33 ++++- Telegram/SourceFiles/gui/text.cpp | 28 +++++ Telegram/SourceFiles/gui/text.h | 14 ++- Telegram/SourceFiles/profilewidget.cpp | 17 +++ Telegram/SourceFiles/profilewidget.h | 3 +- 8 files changed, 215 insertions(+), 20 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 95efa2589b..7c3cd15cdb 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -542,6 +542,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— Notifications are muted by default"; "lng_profile_migrate_button" = "Upgrade to supergroup"; "lng_profile_migrate_sure" = "Are you sure you want to upgrade this group to supergroup? This action cannot be undone."; +"lng_profile_convert_button" = "Convert to supergroup"; +"lng_profile_convert_title" = "Convert to supergroup"; +"lng_profile_convert_about" = "In supergroups:"; +"lng_profile_convert_feature1" = "— New members can see full message history"; +"lng_profile_convert_feature2" = "— Messages are deleted for all members"; +"lng_profile_convert_feature3" = "— Members can edit their own messages"; +"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; +"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; +"lng_profile_convert_confirm" = "Convert"; "lng_channel_comments_count" = "{count:_not_used_|# comment|# comments}"; "lng_channel_hide_comments" = "Hide comments"; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 7ba83729da..0d6f55d3af 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -1213,7 +1213,11 @@ void EditChannelBox::showAll() { _description.show(); _save.show(); _cancel.show(); - _publicLink.show(); + if (_channel->amCreator()) { + _publicLink.show(); + } else { + _publicLink.hide(); + } if (_channel->isMegagroup()) { _sign.hide(); } else { @@ -1260,7 +1264,9 @@ void EditChannelBox::updateMaxHeight() { if (!_channel->isMegagroup()) { h += st::newGroupPublicLinkPadding.top() + _sign.height() + st::newGroupPublicLinkPadding.bottom(); } - h += st::newGroupPublicLinkPadding.top() + _publicLink.height() + st::newGroupPublicLinkPadding.bottom(); + if (_channel->amCreator()) { + h += st::newGroupPublicLinkPadding.top() + _publicLink.height() + st::newGroupPublicLinkPadding.bottom(); + } h += st::boxPadding.bottom() + st::newGroupInfoPadding.bottom() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom(); setMaxHeight(h); } diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index f7d3bfc64d..27eb480ed3 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -34,19 +34,19 @@ TextParseOptions _confirmBoxTextOptions = { Qt::LayoutDirectionAuto, // dir }; -ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const style::BoxButton &doneStyle, const QString &cancelText, const style::BoxButton &cancelStyle) : AbstractBox(st::boxWidth), -_informative(false), -_text(100), -_confirm(this, doneText.isEmpty() ? lang(lng_box_ok) : doneText, doneStyle), -_cancel(this, cancelText.isEmpty() ? lang(lng_cancel) : cancelText, cancelStyle) { +ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const style::BoxButton &doneStyle, const QString &cancelText, const style::BoxButton &cancelStyle) : AbstractBox(st::boxWidth) +, _informative(false) +, _text(100) +, _confirm(this, doneText.isEmpty() ? lang(lng_box_ok) : doneText, doneStyle) +, _cancel(this, cancelText.isEmpty() ? lang(lng_cancel) : cancelText, cancelStyle) { init(text); } -ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const style::BoxButton &doneStyle, bool informative) : AbstractBox(st::boxWidth), -_informative(true), -_text(100), -_confirm(this, doneText.isEmpty() ? lang(lng_box_ok) : doneText, doneStyle), -_cancel(this, QString(), st::cancelBoxButton) { +ConfirmBox::ConfirmBox(const QString &text, const QString &doneText, const style::BoxButton &doneStyle, bool informative) : AbstractBox(st::boxWidth) +, _informative(true) +, _text(100) +, _confirm(this, doneText.isEmpty() ? lang(lng_box_ok) : doneText, doneStyle) +, _cancel(this, QString(), st::cancelBoxButton) { init(text); } @@ -174,7 +174,8 @@ void ConfirmBox::resizeEvent(QResizeEvent *e) { _cancel.moveToRight(st::boxButtonPadding.right() + _confirm.width() + st::boxButtonPadding.left(), _confirm.y()); } -ConfirmLinkBox::ConfirmLinkBox(const QString &url) : ConfirmBox(lang(lng_open_this_link) + qsl("\n\n") + url, lang(lng_open_link)), _url(url) { +ConfirmLinkBox::ConfirmLinkBox(const QString &url) : ConfirmBox(lang(lng_open_this_link) + qsl("\n\n") + url, lang(lng_open_link)) +, _url(url) { connect(this, SIGNAL(confirmed()), this, SLOT(onOpenLink())); } @@ -279,3 +280,101 @@ void MaxInviteBox::resizeEvent(QResizeEvent *e) { _close.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _close.height()); _invitationLink = myrtlrect(st::boxPadding.left(), st::boxPadding.top() + _textHeight + st::boxTextFont->height, width() - st::boxPadding.left() - st::boxPadding.right(), 2 * st::boxTextFont->height); } + +ConvertToSupergroupBox::ConvertToSupergroupBox(ChatData *chat) : AbstractBox(st::boxWideWidth) +, _chat(chat) +, _text(100) +, _note(100) +, _convert(this, lang(lng_profile_convert_confirm), st::defaultBoxButton) +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) { + QStringList text; + text.push_back(lang(lng_profile_convert_feature1)); + text.push_back(lang(lng_profile_convert_feature2)); + text.push_back(lang(lng_profile_convert_feature3)); + text.push_back(lang(lng_profile_convert_feature4)); + + textstyleSet(&st::boxTextStyle); + _text.setText(st::boxTextFont, text.join('\n'), _confirmBoxTextOptions); + _note.setText(st::boxTextFont, lng_profile_convert_warning(lt_bold_start, textcmdStartSemibold(), lt_bold_end, textcmdStopSemibold()), _confirmBoxTextOptions); + _textWidth = st::boxWideWidth - st::boxPadding.left() - st::boxButtonPadding.right(); + _textHeight = _text.countHeight(_textWidth); + setMaxHeight(st::boxTitleHeight + _textHeight + st::boxPadding.bottom() + st::boxTextFont->height + st::boxButtonPadding.top() + _convert.height() + st::boxButtonPadding.bottom()); + textstyleRestore(); + + connect(&_convert, SIGNAL(clicked()), this, SLOT(onConvert())); + connect(&_cancel, SIGNAL(clicked()), this, SLOT(onClose())); + + prepare(); +} + +void ConvertToSupergroupBox::onConvert() { + MTP::send(MTPmessages_MigrateChat(_chat->inputChat), rpcDone(&ConvertToSupergroupBox::convertDone), rpcFail(&ConvertToSupergroupBox::convertFail)); +} + +void ConvertToSupergroupBox::convertDone(const MTPUpdates &updates) { + Ui::hideLayer(); + App::main()->sentUpdatesReceived(updates); + const QVector *v = 0; + switch (updates.type()) { + case mtpc_updates: v = &updates.c_updates().vchats.c_vector().v; break; + case mtpc_updatesCombined: v = &updates.c_updatesCombined().vchats.c_vector().v; break; + default: LOG(("API Error: unexpected update cons %1 (ConvertToSupergroupBox::convertDone)").arg(updates.type())); break; + } + + PeerData *peer = 0; + if (v && !v->isEmpty()) { + for (int32 i = 0, l = v->size(); i < l; ++i) { + if (v->at(i).type() == mtpc_channel) { + peer = App::channel(v->at(i).c_channel().vid.v); + Ui::showPeerHistory(peer, ShowAtUnreadMsgId); + QTimer::singleShot(ReloadChannelMembersTimeout, App::api(), SLOT(delayedRequestParticipantsCount())); + } + } + } + if (!peer) { + LOG(("API Error: channel not found in updates (ProfileInner::migrateDone)")); + } +} + +bool ConvertToSupergroupBox::convertFail(const RPCError &error) { + if (mtpIsFlood(error)) return false; + Ui::hideLayer(); + return true; +} + +void ConvertToSupergroupBox::hideAll() { + _convert.hide(); + _cancel.hide(); +} + +void ConvertToSupergroupBox::showAll() { + _convert.show(); + _cancel.show(); +} + +void ConvertToSupergroupBox::keyPressEvent(QKeyEvent *e) { + if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) { + onConvert(); + } else { + AbstractBox::keyPressEvent(e); + } +} + +void ConvertToSupergroupBox::paintEvent(QPaintEvent *e) { + Painter p(this); + if (paint(p)) return; + + paintTitle(p, lang(lng_profile_convert_title)); + + // draw box title / text + p.setPen(st::black); + textstyleSet(&st::boxTextStyle); + _text.drawLeft(p, st::boxPadding.left(), st::boxTitleHeight, _textWidth, width()); + _note.drawLeft(p, st::boxPadding.left(), st::boxTitleHeight + _textHeight + st::boxPadding.bottom(), _textWidth, width()); + textstyleRestore(); +} + +void ConvertToSupergroupBox::resizeEvent(QResizeEvent *e) { + _convert.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _convert.height()); + _cancel.moveToRight(st::boxButtonPadding.right() + _convert.width() + st::boxButtonPadding.left(), _convert.y()); +} diff --git a/Telegram/SourceFiles/boxes/confirmbox.h b/Telegram/SourceFiles/boxes/confirmbox.h index 6cfd601991..05ed14212c 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.h +++ b/Telegram/SourceFiles/boxes/confirmbox.h @@ -108,7 +108,7 @@ public: void mouseMoveEvent(QMouseEvent *e); void mousePressEvent(QMouseEvent *e); void leaveEvent(QEvent *e); - + protected: void hideAll(); @@ -133,3 +133,34 @@ private: anim::fvalue a_goodOpacity; Animation _a_good; }; + +class ConvertToSupergroupBox : public AbstractBox, public RPCSender { + Q_OBJECT + +public: + + ConvertToSupergroupBox(ChatData *chat); + void keyPressEvent(QKeyEvent *e); + void paintEvent(QPaintEvent *e); + void resizeEvent(QResizeEvent *e); + +public slots: + + void onConvert(); + +protected: + + void hideAll(); + void showAll(); + +private: + + void convertDone(const MTPUpdates &updates); + bool convertFail(const RPCError &error); + + ChatData *_chat; + Text _text, _note; + int32 _textWidth, _textHeight; + + BoxButton _convert, _cancel; +}; \ No newline at end of file diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 591a6d782f..881aeed1c6 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -212,6 +212,18 @@ QString textcmdStopColor() { return result.append(TextCommand).append(QChar(TextCommandNoColor)).append(TextCommand); } +QString textcmdStartSemibold() { + QString result; + result.reserve(3); + return result.append(TextCommand).append(QChar(TextCommandSemibold)).append(TextCommand); +} + +QString textcmdStopSemibold() { + QString result; + result.reserve(3); + return result.append(TextCommand).append(QChar(TextCommandNoSemibold)).append(TextCommand); +} + const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink) { const QChar *result = from + 1; if (*from != TextCommand || result >= end) return from; @@ -223,6 +235,8 @@ const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink) switch (cmd) { case TextCommandBold: case TextCommandNoBold: + case TextCommandSemibold: + case TextCommandNoSemibold: case TextCommandItalic: case TextCommandNoItalic: case TextCommandUnderline: @@ -498,6 +512,20 @@ public: } break; + case TextCommandSemibold: + if (!(flags & TextBlockFSemibold)) { + createBlock(); + flags |= TextBlockFSemibold; + } + break; + + case TextCommandNoSemibold: + if (flags & TextBlockFSemibold) { + createBlock(); + flags &= ~TextBlockFSemibold; + } + break; + case TextCommandItalic: if (!(flags & TextBlockFItalic)) { createBlock(); diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index 944d83fff9..d78f20cf57 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -564,11 +564,13 @@ enum TextCommands { TextCommandNoItalic = 0x04, TextCommandUnderline = 0x05, TextCommandNoUnderline = 0x06, - TextCommandLinkIndex = 0x07, // 0 - NoLink - TextCommandLinkText = 0x08, - TextCommandColor = 0x09, - TextCommandNoColor = 0x0A, - TextCommandSkipBlock = 0x0B, + TextCommandSemibold = 0x07, + TextCommandNoSemibold = 0x08, + TextCommandLinkIndex = 0x09, // 0 - NoLink + TextCommandLinkText = 0x0A, + TextCommandColor = 0x0B, + TextCommandNoColor = 0x0C, + TextCommandSkipBlock = 0x0D, TextCommandLangTag = 0x20, }; @@ -747,6 +749,8 @@ QString textcmdLink(ushort lnkIndex, const QString &text); QString textcmdLink(const QString &url, const QString &text); QString textcmdStartColor(const style::color &color); QString textcmdStopColor(); +QString textcmdStartSemibold(); +QString textcmdStopSemibold(); const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink = true); inline bool chIsSpace(QChar ch, bool rich = false) { diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 859dd74412..16ed4b4c04 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -85,6 +85,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData // actions , _searchInPeer(this, lang(lng_profile_search_messages)) +, _convertToSupergroup(this, lang(lng_profile_convert_button)) , _clearHistory(this, lang(lng_profile_clear_history)) , _deleteConversation(this, lang(_peer->isUser() ? lng_profile_delete_conversation : (_peer->isChat() ? lng_profile_clear_and_exit : (_peer->isMegagroup() ? lng_profile_leave_group : lng_profile_leave_channel)))) , _wasBlocked(_peerUser ? _peerUser->blocked : UserBlockUnknown) @@ -218,6 +219,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData // actions connect(&_searchInPeer, SIGNAL(clicked()), this, SLOT(onSearchInPeer())); + connect(&_convertToSupergroup, SIGNAL(clicked()), this, SLOT(onConvertToSupergroup())); connect(&_clearHistory, SIGNAL(clicked()), this, SLOT(onClearHistory())); connect(&_deleteConversation, SIGNAL(clicked()), this, SLOT(onDeleteConversation())); connect(&_blockUser, SIGNAL(clicked()), this, SLOT(onBlockUser())); @@ -245,6 +247,10 @@ void ProfileInner::onSearchInPeer() { App::main()->searchInPeer(_peer); } +void ProfileInner::onConvertToSupergroup() { + Ui::showLayer(new ConvertToSupergroupBox(_peerChat)); +} + void ProfileInner::onEnableNotifications() { App::main()->updateNotifySetting(_peer, _enableNotifications.checked() ? NotifySettingSetNotify : NotifySettingSetMuted); } @@ -949,6 +955,9 @@ void ProfileInner::paintEvent(QPaintEvent *e) { top += st::profileHeaderSkip; top += _searchInPeer.height() + st::setLittleSkip; + if (_peerChat && _amCreator && !_showMigrate) { + top += _convertToSupergroup.height() + st::setLittleSkip; + } if (_peerUser || _peerChat) { top += _clearHistory.height() + st::setLittleSkip; } @@ -1429,6 +1438,9 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { // actions top += st::profileHeaderSkip; _searchInPeer.move(_left, top); top += _searchInPeer.height() + st::setLittleSkip; + if (_peerChat && _amCreator && !_showMigrate) { + _convertToSupergroup.move(_left, top); top += _convertToSupergroup.height() + st::setLittleSkip; + } if (_peerUser || _peerChat) { _clearHistory.move(_left, top); top += _clearHistory.height() + st::setLittleSkip; } @@ -1585,6 +1597,11 @@ void ProfileInner::allowDecreaseHeight(int32 decreaseBy) { void ProfileInner::showAll() { _searchInPeer.show(); + if (_peerChat && _amCreator && !_showMigrate) { + _convertToSupergroup.show(); + } else { + _convertToSupergroup.hide(); + } if (_peerUser || _peerChat) { _clearHistory.show(); } else { diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index f512b442ad..4527d483d2 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -78,6 +78,7 @@ public slots: void onInviteToGroup(); void onSendMessage(); void onSearchInPeer(); + void onConvertToSupergroup(); void onEnableNotifications(); void onClearHistory(); @@ -184,7 +185,7 @@ private: QString overviewLinkText(int32 type, int32 count); // actions - LinkButton _searchInPeer, _clearHistory, _deleteConversation; + LinkButton _searchInPeer, _convertToSupergroup, _clearHistory, _deleteConversation; UserBlockedStatus _wasBlocked; mtpRequestId _blockRequest; LinkButton _blockUser, _deleteChannel; From 1c722a425d0af8af47709a6c3da6044f7641c918 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 5 Mar 2016 23:12:55 +0200 Subject: [PATCH 163/316] forwarded getState fixed, pinned message service msg dependency request and text update done --- Telegram/Resources/lang.strings | 11 ++ Telegram/SourceFiles/apiwrap.cpp | 80 +++++------ Telegram/SourceFiles/apiwrap.h | 30 ++--- Telegram/SourceFiles/app.cpp | 30 ++--- Telegram/SourceFiles/app.h | 4 +- Telegram/SourceFiles/config.h | 2 + Telegram/SourceFiles/history.cpp | 150 +++++++++++++++++---- Telegram/SourceFiles/history.h | 43 +++++- Telegram/SourceFiles/historywidget.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 2 +- Telegram/SourceFiles/mainwidget.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 16 ++- Telegram/SourceFiles/mtproto/mtpScheme.h | 41 ++++-- Telegram/SourceFiles/mtproto/scheme.tl | 5 +- 14 files changed, 299 insertions(+), 119 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 7c3cd15cdb..ffc0194cac 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -533,6 +533,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} created group «{title}»"; "lng_action_created_channel" = "Channel «{title}» created"; "lng_action_group_migrate" = "The group was upgraded to a supergroup"; +"lng_action_pinned_message" = "{from} pinned «{text}»"; +"lng_action_pinned_media" = "{from} pinned {media}"; +"lng_action_pinned_media_photo" = "a photo"; +"lng_action_pinned_media_video" = "a video file"; +"lng_action_pinned_media_music" = "a music file"; +"lng_action_pinned_media_voice" = "a voice message"; +"lng_action_pinned_media_file" = "a file"; +"lng_action_pinned_media_gif" = "a GIF animation"; +"lng_action_pinned_media_contact" = "a contact information"; +"lng_action_pinned_media_location" = "a location mark"; +"lng_action_pinned_media_sticker" = "a sticker"; "lng_profile_migrate_reached" = "{count:_not_used_|# member|# members} limit reached"; "lng_profile_migrate_about" = "If you'd like to go over this limit, you can upgrade your group to a supergroup. In supergroups:"; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 1d006822ca..c6108e8e0e 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -32,7 +32,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org ApiWrap::ApiWrap(QObject *parent) : QObject(parent) { App::initBackground(); - connect(&_replyToTimer, SIGNAL(timeout()), this, SLOT(resolveReplyTo())); + connect(&_dependencyTimer, SIGNAL(timeout()), this, SLOT(resolveDependencyItems())); connect(&_webPagesTimer, SIGNAL(timeout()), this, SLOT(resolveWebPages())); } @@ -40,78 +40,78 @@ void ApiWrap::init() { } void ApiWrap::itemRemoved(HistoryItem *item) { - if (HistoryReply *reply = item->toHistoryReply()) { - ChannelData *channel = reply->history()->peer->asChannel(); - ReplyToRequests *requests(replyToRequests(channel, true)); + if (MsgId dependencyMsgId = item->dependencyMsgId()) { + ChannelData *channel = item->history()->peer->asChannel(); + DependencyRequests *requests(dependencyRequests(channel, true)); if (requests) { - ReplyToRequests::iterator i = requests->find(reply->replyToId()); + DependencyRequests::iterator i = requests->find(dependencyMsgId); if (i != requests->cend()) { - for (QList::iterator j = i->replies.begin(); j != i->replies.end();) { - if ((*j) == reply) { - j = i->replies.erase(j); + for (QList::iterator j = i->dependentItems.begin(); j != i->dependentItems.end();) { + if ((*j) == item) { + j = i->dependentItems.erase(j); } else { ++j; } } - if (i->replies.isEmpty()) { + if (i->dependentItems.isEmpty()) { requests->erase(i); } } if (channel && requests->isEmpty()) { - _channelReplyToRequests.remove(channel); + _channelDependencyRequests.remove(channel); } } } } -void ApiWrap::requestReplyTo(HistoryReply *reply, ChannelData *channel, MsgId id) { - ReplyToRequest &req(channel ? _channelReplyToRequests[channel][id] : _replyToRequests[id]); - req.replies.append(reply); - if (!req.req) _replyToTimer.start(1); +void ApiWrap::requestDependencyItem(HistoryItem *dependency, ChannelData *channel, MsgId id) { + DependencyRequest &req(channel ? _channelDependencyRequests[channel][id] : _dependencyRequests[id]); + req.dependentItems.append(dependency); + if (!req.req) _dependencyTimer.start(1); } -ApiWrap::MessageIds ApiWrap::collectMessageIds(const ReplyToRequests &requests) { +ApiWrap::MessageIds ApiWrap::collectMessageIds(const DependencyRequests &requests) { MessageIds result; result.reserve(requests.size()); - for (ReplyToRequests::const_iterator i = requests.cbegin(), e = requests.cend(); i != e; ++i) { + for (DependencyRequests::const_iterator i = requests.cbegin(), e = requests.cend(); i != e; ++i) { if (i.value().req > 0) continue; result.push_back(MTP_int(i.key())); } return result; } -ApiWrap::ReplyToRequests *ApiWrap::replyToRequests(ChannelData *channel, bool onlyExisting) { +ApiWrap::DependencyRequests *ApiWrap::dependencyRequests(ChannelData *channel, bool onlyExisting) { if (channel) { - ChannelReplyToRequests::iterator i = _channelReplyToRequests.find(channel); - if (i == _channelReplyToRequests.cend()) { + ChannelDependencyRequests::iterator i = _channelDependencyRequests.find(channel); + if (i == _channelDependencyRequests.cend()) { if (onlyExisting) return 0; - i = _channelReplyToRequests.insert(channel, ReplyToRequests()); + i = _channelDependencyRequests.insert(channel, DependencyRequests()); } return &i.value(); } - return &_replyToRequests; + return &_dependencyRequests; } -void ApiWrap::resolveReplyTo() { - if (_replyToRequests.isEmpty() && _channelReplyToRequests.isEmpty()) return; +void ApiWrap::resolveDependencyItems() { + if (_dependencyRequests.isEmpty() && _channelDependencyRequests.isEmpty()) return; - MessageIds ids = collectMessageIds(_replyToRequests); + MessageIds ids = collectMessageIds(_dependencyRequests); if (!ids.isEmpty()) { - mtpRequestId req = MTP::send(MTPmessages_GetMessages(MTP_vector(ids)), rpcDone(&ApiWrap::gotReplyTo, (ChannelData*)0), RPCFailHandlerPtr(), 0, 5); - for (ReplyToRequests::iterator i = _replyToRequests.begin(); i != _replyToRequests.cend(); ++i) { + mtpRequestId req = MTP::send(MTPmessages_GetMessages(MTP_vector(ids)), rpcDone(&ApiWrap::gotDependencyItem, (ChannelData*)0), RPCFailHandlerPtr(), 0, 5); + for (DependencyRequests::iterator i = _dependencyRequests.begin(); i != _dependencyRequests.cend(); ++i) { if (i.value().req > 0) continue; i.value().req = req; } } - for (ChannelReplyToRequests::iterator j = _channelReplyToRequests.begin(); j != _channelReplyToRequests.cend();) { + for (ChannelDependencyRequests::iterator j = _channelDependencyRequests.begin(); j != _channelDependencyRequests.cend();) { if (j->isEmpty()) { - j = _channelReplyToRequests.erase(j); + j = _channelDependencyRequests.erase(j); continue; } MessageIds ids = collectMessageIds(j.value()); if (!ids.isEmpty()) { - mtpRequestId req = MTP::send(MTPchannels_GetMessages(j.key()->inputChannel, MTP_vector(ids)), rpcDone(&ApiWrap::gotReplyTo, j.key()), RPCFailHandlerPtr(), 0, 5); - for (ReplyToRequests::iterator i = j->begin(); i != j->cend(); ++i) { + mtpRequestId req = MTP::send(MTPchannels_GetMessages(j.key()->inputChannel, MTP_vector(ids)), rpcDone(&ApiWrap::gotDependencyItem, j.key()), RPCFailHandlerPtr(), 0, 5); + for (DependencyRequests::iterator i = j->begin(); i != j->cend(); ++i) { if (i.value().req > 0) continue; i.value().req = req; } @@ -120,7 +120,7 @@ void ApiWrap::resolveReplyTo() { } } -void ApiWrap::gotReplyTo(ChannelData *channel, const MTPmessages_Messages &msgs, mtpRequestId req) { +void ApiWrap::gotDependencyItem(ChannelData *channel, const MTPmessages_Messages &msgs, mtpRequestId req) { switch (msgs.type()) { case mtpc_messages_messages: { const MTPDmessages_messages &d(msgs.c_messages_messages()); @@ -141,10 +141,10 @@ void ApiWrap::gotReplyTo(ChannelData *channel, const MTPmessages_Messages &msgs, if (channel) { channel->ptsReceived(d.vpts.v); } else { - LOG(("App Error: received messages.channelMessages when no channel was passed! (ApiWrap::gotReplyTo)")); + LOG(("App Error: received messages.channelMessages when no channel was passed! (ApiWrap::gotDependencyItem)")); } if (d.has_collapsed()) { // should not be returned - LOG(("API Error: channels.getMessages and messages.getMessages should not return collapsed groups! (ApiWrap::gotReplyTo)")); + LOG(("API Error: channels.getMessages and messages.getMessages should not return collapsed groups! (ApiWrap::gotDependencyItem)")); } App::feedUsers(d.vusers); @@ -152,15 +152,15 @@ void ApiWrap::gotReplyTo(ChannelData *channel, const MTPmessages_Messages &msgs, App::feedMsgs(d.vmessages, NewMessageExisting); } break; } - ReplyToRequests *requests(replyToRequests(channel, true)); + DependencyRequests *requests(dependencyRequests(channel, true)); if (requests) { - for (ReplyToRequests::iterator i = requests->begin(); i != requests->cend();) { + for (DependencyRequests::iterator i = requests->begin(); i != requests->cend();) { if (i.value().req == req) { - for (QList::const_iterator j = i.value().replies.cbegin(), e = i.value().replies.cend(); j != e; ++j) { + for (QList::const_iterator j = i.value().dependentItems.cbegin(), e = i.value().dependentItems.cend(); j != e; ++j) { if (*j) { - (*j)->updateReplyTo(true); - } else { - App::main()->updateReplyTo(); + (*j)->updateDependencyItem(); + } else if (App::main()) { + App::main()->updateDependencyItem(); } } i = requests->erase(i); @@ -169,7 +169,7 @@ void ApiWrap::gotReplyTo(ChannelData *channel, const MTPmessages_Messages &msgs, } } if (channel && requests->isEmpty()) { - _channelReplyToRequests.remove(channel); + _channelDependencyRequests.remove(channel); } } } diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index 521bb05b2b..d15fb88f71 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -29,8 +29,8 @@ public: void init(); void itemRemoved(HistoryItem *item); - - void requestReplyTo(HistoryReply *reply, ChannelData *channel, MsgId id); + + void requestDependencyItem(HistoryItem *dependent, ChannelData *channel, MsgId id); void requestFullPeer(PeerData *peer); void requestPeer(PeerData *peer); @@ -59,35 +59,35 @@ signals: public slots: - void resolveReplyTo(); + void resolveDependencyItems(); void resolveWebPages(); void delayedRequestParticipantsCount(); private: - void gotReplyTo(ChannelData *channel, const MTPmessages_Messages &result, mtpRequestId req); - struct ReplyToRequest { - ReplyToRequest() : req(0) { + void gotDependencyItem(ChannelData *channel, const MTPmessages_Messages &result, mtpRequestId req); + struct DependencyRequest { + DependencyRequest() : req(0) { } mtpRequestId req; - QList replies; + QList dependentItems; }; - typedef QMap ReplyToRequests; - ReplyToRequests _replyToRequests; - typedef QMap ChannelReplyToRequests; - ChannelReplyToRequests _channelReplyToRequests; - SingleTimer _replyToTimer; + typedef QMap DependencyRequests; + DependencyRequests _dependencyRequests; + typedef QMap ChannelDependencyRequests; + ChannelDependencyRequests _channelDependencyRequests; + SingleTimer _dependencyTimer; typedef QVector MessageIds; - MessageIds collectMessageIds(const ReplyToRequests &requests); - ReplyToRequests *replyToRequests(ChannelData *channel, bool onlyExisting = false); + MessageIds collectMessageIds(const DependencyRequests &requests); + DependencyRequests *dependencyRequests(ChannelData *channel, bool onlyExisting = false); void gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mtpRequestId req); void gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestId req); bool gotPeerFullFailed(PeerData *peer, const RPCError &err); typedef QMap PeerRequests; PeerRequests _fullPeerRequests; - + void gotChat(PeerData *peer, const MTPmessages_Chats &result); void gotUser(PeerData *peer, const MTPVector &result); void gotChats(const MTPmessages_Chats &result); diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 85a4000aca..5543956a54 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -67,8 +67,8 @@ namespace { SharedContactItems sharedContactItems; GifItems gifItems; - typedef QMap > RepliesTo; - RepliesTo repliesTo; + typedef QMap > DependentItems; + DependentItems dependentItems; Histories histories; @@ -1784,12 +1784,12 @@ namespace App { } } historyItemDetached(item); - RepliesTo::iterator j = ::repliesTo.find(item); - if (j != ::repliesTo.cend()) { - for (QMap::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { - k.key()->replyToReplaced(item, 0); + DependentItems::iterator j = ::dependentItems.find(item); + if (j != ::dependentItems.cend()) { + for (OrderedSet::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { + k.key()->dependencyItemRemoved(item); } - ::repliesTo.erase(j); + ::dependentItems.erase(j); } if (App::main() && !App::quitting()) { App::main()->itemRemoved(item); @@ -1797,7 +1797,7 @@ namespace App { } void historyClearMsgs() { - ::repliesTo.clear(); + ::dependentItems.clear(); QVector toDelete; for (MsgsData::const_iterator i = msgsData.cbegin(), e = msgsData.cend(); i != e; ++i) { @@ -1869,16 +1869,16 @@ namespace App { if (App::wnd()) App::wnd()->updateGlobalMenu(); } - void historyRegReply(HistoryReply *reply, HistoryItem *to) { - ::repliesTo[to].insert(reply, true); + void historyRegDependency(HistoryItem *dependent, HistoryItem *dependency) { + ::dependentItems[dependency].insert(dependent); } - void historyUnregReply(HistoryReply *reply, HistoryItem *to) { - RepliesTo::iterator i = ::repliesTo.find(to); - if (i != ::repliesTo.cend()) { - i.value().remove(reply); + void historyUnregDependency(HistoryItem *dependent, HistoryItem *dependency) { + DependentItems::iterator i = ::dependentItems.find(dependency); + if (i != ::dependentItems.cend()) { + i.value().remove(dependent); if (i.value().isEmpty()) { - ::repliesTo.erase(i); + ::dependentItems.erase(i); } } } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 20e51a806e..f3228811c2 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -152,8 +152,8 @@ namespace App { void historyUnregItem(HistoryItem *item); void historyClearMsgs(); void historyClearItems(); - void historyRegReply(HistoryReply *reply, HistoryItem *to); - void historyUnregReply(HistoryReply *reply, HistoryItem *to); + void historyRegDependency(HistoryItem *dependent, HistoryItem *dependency); + void historyUnregDependency(HistoryItem *dependent, HistoryItem *dependency); void historyRegRandom(uint64 randomId, const FullMsgId &itemId); void historyUnregRandom(uint64 randomId); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 83969d1c61..2f488d590f 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -171,6 +171,8 @@ enum { ChoosePeerByDragTimeout = 1000, // 1 second mouse not moved to choose dialog when dragging a file ReloadChannelMembersTimeout = 1000, // 1 second wait before reload members in channel after adding + + PinnedMessageTextLimit = 16, }; inline bool isNotificationsUser(uint64 id) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index d582b39bda..e164d9da38 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1509,6 +1509,13 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo //const MTPDmessageActionChannelMigrateFrom &d(action.c_messageActionChannelMigrateFrom()); //PeerData *chat = App::peerLoaded(peerFromChat(d.vchat_id)); } break; + + case mtpc_messageActionPinMessage: { + if (d.has_reply_to_msg_id() && result && result->history()->peer->isMegagroup()) { + result->history()->peer->asChannel()->mgInfo->pinnedMsgId = d.vreply_to_msg_id.v; + if (App::main()) emit App::main()->peerUpdated(result->history()->peer); + } + } break; } } } break; @@ -1540,7 +1547,7 @@ HistoryItem *History::createItemDocument(HistoryBlock *block, MsgId id, int32 fl 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; - if (flags & MTPDmessage::flag_reply_to_msg_id && replyTo > 0) { + 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); @@ -6891,7 +6898,7 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 bool inText = false; bool breakEverywhere = (fwd->_text.countHeight(trect.width()) > 2 * st::semiboldFont->height); textstyleSet(&st::inFwdTextStyle); - fwd->_text.getState(lnk, inText, x - trect.left(), y - trect.top(), trect.right() - trect.left(), style::al_left, breakEverywhere); + fwd->_text.getState(lnk, inText, x - trect.left(), y - trect.top(), trect.width(), style::al_left, breakEverywhere); textstyleRestore(); if (breakEverywhere) { state = HistoryInForwardedCursorState; @@ -7035,7 +7042,7 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmess , _maxReplyWidth(0) , _replyToVia(0) { if (!updateReplyTo() && App::api()) { - App::api()->requestReplyTo(this, history->peer->asChannel(), replyToMsgId); + App::api()->requestDependencyItem(this, history->peer->asChannel(), replyToMsgId); } } @@ -7047,7 +7054,7 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, i , _maxReplyWidth(0) , _replyToVia(0) { if (!updateReplyTo() && App::api()) { - App::api()->requestReplyTo(this, history->peer->asChannel(), replyToMsgId); + App::api()->requestDependencyItem(this, history->peer->asChannel(), replyToMsgId); } } @@ -7059,7 +7066,7 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, i , _maxReplyWidth(0) , _replyToVia(0) { if (!updateReplyTo() && App::api()) { - App::api()->requestReplyTo(this, history->peer->asChannel(), replyToMsgId); + App::api()->requestDependencyItem(this, history->peer->asChannel(), replyToMsgId); } replyToNameUpdated(); } @@ -7089,7 +7096,7 @@ bool HistoryReply::updateReplyTo(bool force) { replyToMsg = App::histItemById(channelId(), replyToMsgId); if (replyToMsg) { - App::historyRegReply(this, replyToMsg); + App::historyRegDependency(this, replyToMsg); replyToText.setText(st::msgFont, replyToMsg->inReplyText(), _textDlgOptions); replyToNameUpdated(); @@ -7146,20 +7153,14 @@ HistoryItem *HistoryReply::replyToMessage() const { return replyToMsg; } -void HistoryReply::replyToReplaced(HistoryItem *oldItem, HistoryItem *newItem) { - if (replyToMsg == oldItem) { +void HistoryReply::dependencyItemRemoved(HistoryItem *dependency) { + if (replyToMsg == dependency) { delete _replyToVia; _replyToVia = 0; - replyToMsg = newItem; - if (!newItem) { - replyToMsgId = 0; - initDimensions(); - } else if (!replyToMsg->Is()) { - if (UserData *bot = replyToMsg->viaBot()) { - _replyToVia = new HistoryMessageVia(0); - _replyToVia->create(peerToUser(bot->id)); - } - } + + replyToMsg = nullptr; + replyToMsgId = 0; + initDimensions(); } } @@ -7301,7 +7302,7 @@ void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); if (y >= trect.top() && y < trect.top() + h) { - if (replyToMsg && y >= trect.top() + st::msgReplyPadding.top() && y < trect.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() && x >= trect.left() && x < trect.right()) { + if (replyToMsg && y >= trect.top() + st::msgReplyPadding.top() && y < trect.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() && x >= trect.left() && x < trect.left() + trect.width()) { lnk = replyToLnk; } return; @@ -7347,13 +7348,18 @@ void HistoryReply::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, i HistoryReply::~HistoryReply() { if (replyToMsg) { - App::historyUnregReply(this, replyToMsg); + App::historyUnregDependency(this, replyToMsg); } else if (replyToMsgId && App::api()) { App::api()->itemRemoved(this); } deleteAndMark(_replyToVia); } +HistoryServicePinned::HistoryServicePinned(Interfaces *) +: msgId(0) +, msg(0) { +} + void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { QList links; LangString text = lang(lng_message_empty); @@ -7486,6 +7492,15 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { } } break; + case mtpc_messageActionPinMessage: { + if (updatePinnedText(&from, &text)) { + HistoryServicePinned *pinned = Get(); + t_assert(pinned != nullptr); + + links.push_back(pinned->lnk); + } + } break; + default: from = QString(); break; } @@ -7500,19 +7515,106 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { } } +bool HistoryServiceMsg::updatePinned(bool force) { + HistoryServicePinned *pinned = Get(); + t_assert(pinned != nullptr); + + if (!pinned->msgId || pinned->msg) return true; + + if (!pinned->lnk) { + pinned->lnk = TextLinkPtr(new MessageLink(history()->peer->id, pinned->msgId)); + } + pinned->msg = App::histItemById(channelId(), pinned->msgId); + if (pinned->msg) { + App::historyRegDependency(this, pinned->msg); + updatePinnedText(); + } else if (force) { + pinned->msgId = 0; + updatePinnedText(); + } + if (force) { + initDimensions(); + Notify::historyItemResized(this); + } + return (pinned->msg || !pinned->msgId); +} + +bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { + bool result = false; + QString from, text; + if (pfrom) { + from = *pfrom; + } else { + from = textcmdLink(1, _from->name); + } + + HistoryServicePinned *pinned = Get(); + if (pinned && pinned->msg) { + HistoryMedia *media = pinned->msg->getMedia(); + QString mediaText; + switch (media ? media->type() : MediaTypeCount) { + case MediaTypePhoto: mediaText = lang(lng_action_pinned_media_photo); break; + case MediaTypeVideo: mediaText = lang(lng_action_pinned_media_video); break; + case MediaTypeContact: mediaText = lang(lng_action_pinned_media_contact); break; + case MediaTypeFile: mediaText = lang(lng_action_pinned_media_file); break; + case MediaTypeGif: mediaText = lang(lng_action_pinned_media_gif); break; + case MediaTypeSticker: mediaText = lang(lng_action_pinned_media_sticker); break; + case MediaTypeLocation: mediaText = lang(lng_action_pinned_media_location); break; + case MediaTypeMusicFile: mediaText = lang(lng_action_pinned_media_music); break; + case MediaTypeVoiceFile: mediaText = lang(lng_action_pinned_media_voice); break; + } + if (mediaText.isEmpty()) { + QString original = pinned->msg->originalText(); + int32 cutat = 0, limit = PinnedMessageTextLimit, size = original.size(); + for (; limit > 0;) { + --limit; + if (cutat >= size) break; + if (original.at(cutat).isLowSurrogate() && cutat + 1 < size && original.at(cutat + 1).isHighSurrogate()) { + cutat += 2; + } else { + ++cutat; + } + } + if (!limit && cutat + 5 < size) { + original = original.mid(0, cutat) + qstr(".."); + } + text = lng_action_pinned_message(lt_from, from, lt_text, textcmdLink(2, original)); + } else { + text = lng_action_pinned_media(lt_from, from, lt_media, textcmdLink(2, mediaText)); + } + result = true; + } else if (pinned && pinned->msgId) { + text = lng_action_pinned_media(lt_from, from, lt_media, textcmdLink(2, lang(lng_contacts_loading))); + result = true; + } else { + text = lng_action_pinned_media(lt_from, from, lt_media, lang(lng_deleted_message)); + } + if (ptext) { + *ptext = text; + } else { + setServiceText(text); + } + 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) , _text(st::msgMinWidth) -, _media(0) -{ +, _media(0) { + if (msg.has_reply_to_msg_id()) { + UpdateInterfaces(HistoryServicePinned::Bit()); + Get()->msgId = msg.vreply_to_msg_id.v; + if (!updatePinned() && App::api()) { + App::api()->requestDependencyItem(this, history->peer->asChannel(), Get()->msgId); + } + } 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) , _text(st::msgServiceFont, msg, _historySrvOptions, st::dlgMinWidth) -, _media(media) -{ +, _media(media) { } void HistoryServiceMsg::initDimensions() { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 436997fbe3..fb4df056b3 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -115,7 +115,6 @@ struct FakeDialogRow { enum HistoryMediaType { MediaTypePhoto, MediaTypeVideo, - MediaTypeGeo, MediaTypeContact, MediaTypeFile, MediaTypeGif, @@ -919,6 +918,15 @@ public: virtual int32 resize(int32 width) = 0; // return new height virtual void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const = 0; + virtual void dependencyItemRemoved(HistoryItem *dependency) { + } + virtual bool updateDependencyItem() { + return true; + } + virtual MsgId dependencyMsgId() const { + return 0; + } + virtual UserData *viaBot() const { return 0; } @@ -2229,15 +2237,19 @@ public: void initDimensions(); - bool updateReplyTo(bool force = false); - void replyToNameUpdated() const; + bool updateDependencyItem() override { + return updateReplyTo(true); + } + MsgId dependencyMsgId() const override { + return replyToId(); + } int32 replyToWidth() const; TextLinkPtr replyToLink() const; MsgId replyToId() const; HistoryItem *replyToMessage() const; - void replyToReplaced(HistoryItem *oldItem, HistoryItem *newItem); + void dependencyItemRemoved(HistoryItem *dependency) override; void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; void drawReplyTo(Painter &p, int32 x, int32 y, int32 w, bool selected, bool likeService = false) const; @@ -2265,6 +2277,9 @@ public: protected: + bool updateReplyTo(bool force = false); + void replyToNameUpdated() const; + MsgId replyToMsgId; HistoryItem *replyToMsg; TextLinkPtr replyToLnk; @@ -2296,6 +2311,14 @@ inline int32 newForwardedFlags(PeerData *p, int32 from, HistoryMessage *fwd) { return result; } +struct HistoryServicePinned : public BasicInterface { + HistoryServicePinned(Interfaces *); + + MsgId msgId; + HistoryItem *msg; + TextLinkPtr lnk; +}; + class HistoryServiceMsg : public HistoryItem { public: @@ -2304,6 +2327,16 @@ public: void initDimensions(); + bool updateDependencyItem() override { + return updatePinned(true); + } + MsgId dependencyMsgId() const override { + if (const HistoryServicePinned *pinned = Get()) { + return pinned->msgId; + } + return 0; + } + void countPositionAndSize(int32 &left, int32 &width) const; void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; @@ -2344,6 +2377,8 @@ public: protected: void setMessageByAction(const MTPmessageAction &action); + bool updatePinned(bool force = false); + bool updatePinnedText(const QString *pfrom = nullptr, QString *ptext = nullptr); Text _text; HistoryMedia *_media; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 6ab5eef103..6c72f29bf5 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3500,7 +3500,7 @@ void HistoryWidget::applyDraft(bool parseLinks) { if (_editMsgId || _replyToId) { updateReplyEditTexts(); if (!_replyEditMsg && App::api()) { - App::api()->requestReplyTo(0, _peer->asChannel(), _editMsgId ? _editMsgId : _replyToId); + App::api()->requestDependencyItem(0, _peer->asChannel(), _editMsgId ? _editMsgId : _replyToId); } } } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 6e49f67583..9ef400e1c0 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2056,7 +2056,7 @@ ApiWrap *MainWidget::api() { return _api; } -void MainWidget::updateReplyTo() { +void MainWidget::updateDependencyItem() { history.updateReplyEditTexts(true); } diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index f0318a1a4b..08c053f5b6 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -373,7 +373,7 @@ public: ImagePtr newBackgroundThumb(); ApiWrap *api(); - void updateReplyTo(); + void updateDependencyItem(); void updateBotKeyboard(History *h); void pushReplyReturn(HistoryItem *item); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 40ec2b60ee..5a4af0ce6b 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1385,8 +1385,9 @@ void _serialize_messageService(MTPStringLogger &to, int32 stage, int32 lev, Type 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 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(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" action: "); ++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 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; } } @@ -1613,6 +1614,10 @@ void _serialize_messageActionChannelMigrateFrom(MTPStringLogger &to, int32 stage } } +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) { + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6958,8 +6963,10 @@ void _serialize_channels_updatePinnedMessage(MTPStringLogger &to, int32 stage, i to.add("\n").addSpaces(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(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_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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -7683,6 +7690,7 @@ namespace { _serializers.insert(mtpc_messageActionChannelCreate, _serialize_messageActionChannelCreate); _serializers.insert(mtpc_messageActionChatMigrateTo, _serialize_messageActionChatMigrateTo); _serializers.insert(mtpc_messageActionChannelMigrateFrom, _serialize_messageActionChannelMigrateFrom); + _serializers.insert(mtpc_messageActionPinMessage, _serialize_messageActionPinMessage); _serializers.insert(mtpc_dialog, _serialize_dialog); _serializers.insert(mtpc_dialogChannel, _serialize_dialogChannel); _serializers.insert(mtpc_photoEmpty, _serialize_photoEmpty); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 8ffca9b897..577f80f59b 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -146,7 +146,7 @@ enum { mtpc_chatPhoto = 0x6153276a, mtpc_messageEmpty = 0x83e5de54, mtpc_message = 0xc09be45f, - mtpc_messageService = 0xc06b9607, + mtpc_messageService = 0x9e19a1f6, mtpc_messageMediaEmpty = 0x3ded6320, mtpc_messageMediaPhoto = 0x3d8ce53d, mtpc_messageMediaGeo = 0x56e0d474, @@ -166,6 +166,7 @@ enum { mtpc_messageActionChannelCreate = 0x95d2ac92, mtpc_messageActionChatMigrateTo = 0x51bdb021, mtpc_messageActionChannelMigrateFrom = 0xb055eaee, + mtpc_messageActionPinMessage = 0x94bd38ed, mtpc_dialog = 0xc1dd804a, mtpc_dialogChannel = 0x5b8496b2, mtpc_photoEmpty = 0x2331b22d, @@ -613,7 +614,7 @@ enum { mtpc_channels_toggleSignatures = 0x1f69b606, mtpc_channels_getMessageEditData = 0x27ea3a28, mtpc_channels_editMessage = 0xdcda80ed, - mtpc_channels_updatePinnedMessage = 0x84a41867 + mtpc_channels_updatePinnedMessage = 0xa72ded52 }; // Type forward declarations @@ -3535,7 +3536,7 @@ private: 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 _date, const MTPMessageAction &_action); + 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); mtpTypeId _type; }; @@ -3796,6 +3797,7 @@ private: 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(); mtpTypeId _type; }; @@ -10199,13 +10201,14 @@ class MTPDmessageService : public mtpDataImpl { public: MTPDmessageService() { } - MTPDmessageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _date, const MTPMessageAction &_action) : vflags(_flags), vid(_id), vfrom_id(_from_id), vto_id(_to_id), vdate(_date), vaction(_action) { + 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) { } MTPint vflags; MTPint vid; MTPint vfrom_id; MTPPeer vto_id; + MTPint vreply_to_msg_id; MTPint vdate; MTPMessageAction vaction; @@ -10217,6 +10220,7 @@ public: 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; } @@ -10226,6 +10230,7 @@ public: 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 { @@ -20603,6 +20608,7 @@ public: class MTPchannels_updatePinnedMessage { // RPC method 'channels.updatePinnedMessage' public: + MTPint vflags; MTPInputChannel vchannel; MTPint vid; @@ -20611,20 +20617,28 @@ public: MTPchannels_updatePinnedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_updatePinnedMessage) { read(from, end, cons); } - MTPchannels_updatePinnedMessage(const MTPInputChannel &_channel, MTPint _id) : vchannel(_channel), vid(_id) { + MTPchannels_updatePinnedMessage(MTPint _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 vchannel.innerLength() + vid.innerLength(); + return vflags.innerLength() + vchannel.innerLength() + vid.innerLength(); } mtpTypeId type() const { return mtpc_channels_updatePinnedMessage; } void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_channels_updatePinnedMessage) { + vflags.read(from, end); vchannel.read(from, end); vid.read(from, end); } void write(mtpBuffer &to) const { + vflags.write(to); vchannel.write(to); vid.write(to); } @@ -20639,7 +20653,7 @@ public: } MTPchannels_UpdatePinnedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPchannels_UpdatePinnedMessage(const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_updatePinnedMessage(_channel, _id)) { + MTPchannels_UpdatePinnedMessage(MTPint _flags, const MTPInputChannel &_channel, MTPint _id) : MTPBoxed(MTPchannels_updatePinnedMessage(_flags, _channel, _id)) { } }; @@ -23401,7 +23415,7 @@ inline uint32 MTPmessage::innerLength() const { } case mtpc_messageService: { const MTPDmessageService &v(c_messageService()); - return v.vflags.innerLength() + v.vid.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vto_id.innerLength() + v.vdate.innerLength() + v.vaction.innerLength(); + return v.vflags.innerLength() + v.vid.innerLength() + (v.has_from_id() ? v.vfrom_id.innerLength() : 0) + v.vto_id.innerLength() + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vaction.innerLength(); } } return 0; @@ -23443,6 +23457,7 @@ inline void MTPmessage::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vid.read(from, end); if (v.has_from_id()) { v.vfrom_id.read(from, end); } else { v.vfrom_id = MTPint(); } v.vto_id.read(from, end); + if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } v.vdate.read(from, end); v.vaction.read(from, end); } break; @@ -23478,6 +23493,7 @@ inline void MTPmessage::write(mtpBuffer &to) const { v.vid.write(to); if (v.has_from_id()) v.vfrom_id.write(to); v.vto_id.write(to); + if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); v.vdate.write(to); v.vaction.write(to); } break; @@ -23503,8 +23519,8 @@ inline MTPmessage MTP_messageEmpty(MTPint _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)); } -inline MTPmessage MTP_messageService(MTPint _flags, MTPint _id, MTPint _from_id, const MTPPeer &_to_id, MTPint _date, const MTPMessageAction &_action) { - return MTPmessage(new MTPDmessageService(_flags, _id, _from_id, _to_id, _date, _action)); +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)); } inline uint32 MTPmessageMedia::innerLength() const { @@ -23771,6 +23787,7 @@ inline void MTPmessageAction::read(const mtpPrime *&from, const mtpPrime *end, m v.vtitle.read(from, end); v.vchat_id.read(from, end); } break; + case mtpc_messageActionPinMessage: _type = cons; break; default: throw mtpErrorUnexpected(cons, "MTPmessageAction"); } } @@ -23829,6 +23846,7 @@ inline MTPmessageAction::MTPmessageAction(mtpTypeId type) : mtpDataOwner(0), _ty case mtpc_messageActionChannelCreate: setData(new MTPDmessageActionChannelCreate()); break; case mtpc_messageActionChatMigrateTo: setData(new MTPDmessageActionChatMigrateTo()); break; case mtpc_messageActionChannelMigrateFrom: setData(new MTPDmessageActionChannelMigrateFrom()); break; + case mtpc_messageActionPinMessage: break; default: throw mtpErrorBadTypeId(type, "MTPmessageAction"); } } @@ -23883,6 +23901,9 @@ inline MTPmessageAction MTP_messageActionChatMigrateTo(MTPint _channel_id) { inline MTPmessageAction MTP_messageActionChannelMigrateFrom(const MTPstring &_title, MTPint _chat_id) { return MTPmessageAction(new MTPDmessageActionChannelMigrateFrom(_title, _chat_id)); } +inline MTPmessageAction MTP_messageActionPinMessage() { + return MTPmessageAction(mtpc_messageActionPinMessage); +} inline uint32 MTPdialog::innerLength() const { switch (_type) { diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 876080a4bf..5588272f79 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -227,7 +227,7 @@ chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto; messageEmpty#83e5de54 id:int = Message; message#c09be45f flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int edit_date:flags.15?int = Message; -messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message; +messageService#9e19a1f6 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true id:int from_id:flags.8?int to_id:Peer reply_to_msg_id:flags.3?int date:int action:MessageAction = Message; messageMediaEmpty#3ded6320 = MessageMedia; messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia; @@ -249,6 +249,7 @@ messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction; messageActionChannelCreate#95d2ac92 title:string = MessageAction; messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction; messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction; +messageActionPinMessage#94bd38ed = MessageAction; dialog#c1dd804a peer:Peer top_message:int read_inbox_max_id:int unread_count:int notify_settings:PeerNotifySettings = Dialog; dialogChannel#5b8496b2 peer:Peer top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int notify_settings:PeerNotifySettings pts:int = Dialog; @@ -821,4 +822,4 @@ channels.exportMessageLink#c846d22d channel:InputChannel id:int = ExportedMessag channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates; channels.getMessageEditData#27ea3a28 channel:InputChannel id:int = channels.MessageEditData; channels.editMessage#dcda80ed flags:# no_webpage:flags.1?true channel:InputChannel id:int message:string entities:flags.3?Vector = Updates; -channels.updatePinnedMessage#84a41867 channel:InputChannel id:int = Updates; +channels.updatePinnedMessage#a72ded52 flags:# silent:flags.0?true channel:InputChannel id:int = Updates; From 420e82d421f589e17bfb5975d0e00a0549e986e5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 6 Mar 2016 19:06:05 +0200 Subject: [PATCH 164/316] fixed pinned msg service message, fixed markdown stickerpack link, fixed phrase for convert group to supergroup --- Telegram/Resources/lang.strings | 2 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- Telegram/SourceFiles/history.cpp | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index ffc0194cac..2868a71ea5 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -556,7 +556,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_convert_button" = "Convert to supergroup"; "lng_profile_convert_title" = "Convert to supergroup"; "lng_profile_convert_about" = "In supergroups:"; -"lng_profile_convert_feature1" = "— New members can see full message history"; +"lng_profile_convert_feature1" = "— New members see the full message history"; "lng_profile_convert_feature2" = "— Messages are deleted for all members"; "lng_profile_convert_feature3" = "— Members can edit their own messages"; "lng_profile_convert_feature4" = "— Creator can set a public link for the group"; diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index 27eb480ed3..fd6524e8e7 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -180,12 +180,12 @@ ConfirmLinkBox::ConfirmLinkBox(const QString &url) : ConfirmBox(lang(lng_open_th } void ConfirmLinkBox::onOpenLink() { + Ui::hideLayer(); if (reMailStart().match(_url).hasMatch()) { EmailLink(_url).onClick(Qt::LeftButton); } else { TextLink(_url).onClick(Qt::LeftButton); } - Ui::hideLayer(); } MaxInviteBox::MaxInviteBox(const QString &link) : AbstractBox(st::boxWidth) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index e164d9da38..16d36a62c9 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7548,6 +7548,7 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { from = textcmdLink(1, _from->name); } + TextLinkPtr second; HistoryServicePinned *pinned = Get(); if (pinned && pinned->msg) { HistoryMedia *media = pinned->msg->getMedia(); @@ -7582,9 +7583,11 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { } else { text = lng_action_pinned_media(lt_from, from, lt_media, textcmdLink(2, mediaText)); } + second = pinned->lnk; result = true; } else if (pinned && pinned->msgId) { text = lng_action_pinned_media(lt_from, from, lt_media, textcmdLink(2, lang(lng_contacts_loading))); + second = pinned->lnk; result = true; } else { text = lng_action_pinned_media(lt_from, from, lt_media, lang(lng_deleted_message)); @@ -7593,6 +7596,16 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { *ptext = text; } else { setServiceText(text); + _text.setLink(1, TextLinkPtr(new PeerLink(_from))); + if (second) { + _text.setLink(2, second); + } + if (history()->textCachedFor == this) { + history()->textCachedFor = 0; + } + if (App::main()) { + App::main()->dlgUpdated(history(), id); + } } return result; } From efa5fc443a6d46a0b5a3b98ae6e1af619dc944eb Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Mar 2016 13:15:21 +0300 Subject: [PATCH 165/316] pin/unpin messages in supergroups, local hide for pinned messages --- Telegram/Resources/lang.strings | 8 + Telegram/Resources/style.txt | 20 +- Telegram/SourceFiles/apiwrap.cpp | 86 +++---- Telegram/SourceFiles/apiwrap.h | 31 +-- Telegram/SourceFiles/boxes/confirmbox.cpp | 56 +++++ Telegram/SourceFiles/boxes/confirmbox.h | 35 +++ Telegram/SourceFiles/facades.cpp | 4 + Telegram/SourceFiles/facades.h | 3 + Telegram/SourceFiles/gui/flatlabel.cpp | 7 + Telegram/SourceFiles/gui/flatlabel.h | 2 + Telegram/SourceFiles/gui/twidget.h | 25 ++ Telegram/SourceFiles/history.cpp | 18 +- Telegram/SourceFiles/history.h | 19 ++ Telegram/SourceFiles/historywidget.cpp | 260 ++++++++++++++++++++- Telegram/SourceFiles/historywidget.h | 29 ++- Telegram/SourceFiles/localstorage.cpp | 78 +++++++ Telegram/SourceFiles/mainwidget.cpp | 5 +- Telegram/SourceFiles/mainwidget.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 21 +- Telegram/SourceFiles/mtproto/mtpScheme.h | 36 ++- Telegram/SourceFiles/mtproto/scheme.tl | 4 +- Telegram/SourceFiles/profilewidget.cpp | 27 ++- Telegram/SourceFiles/profilewidget.h | 4 +- Telegram/SourceFiles/types.h | 70 +----- 24 files changed, 667 insertions(+), 183 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 2868a71ea5..07d99da2dd 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "New message text.."; "lng_deleted" = "Unknown"; "lng_deleted_message" = "Deleted message"; +"lng_pinned_message" = "Pinned message"; +"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; +"lng_pinned_pin_sure" = "Would you like to pin this message?"; +"lng_pinned_pin" = "Pin"; +"lng_pinned_unpin" = "Unpin"; +"lng_pinned_notify" = "Notify all members"; "lng_intro" = "Welcome to the official [a href=\"https://telegram.org/\"]Telegram[/a] desktop app.\nIt's [b]fast[/b] and [b]secure[/b]."; "lng_start_msgs" = "START MESSAGING"; @@ -770,6 +776,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Forward Message"; "lng_context_delete_msg" = "Delete Message"; "lng_context_select_msg" = "Select Message"; +"lng_context_pin_msg" = "Pin Message"; +"lng_context_unpin_msg" = "Unpin Message"; "lng_context_cancel_upload" = "Cancel Upload"; "lng_context_copy_selected" = "Copy Selected Text"; "lng_context_forward_selected" = "Forward Selected"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 8d9dd68e6a..df9a6e6156 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -67,6 +67,13 @@ layerBg: black; overBg: #edf2f5; +labelDefFlat: flatLabel { + font: font(fsize); + minWidth: 100px; + width: 0px; + align: align(left); +} + boxBg: white; boxVerticalMargin: 10px; boxWidth: 320px; @@ -75,6 +82,8 @@ boxPadding: margins(26px, 30px, 34px, 8px); boxMaxListHeight: 600px; boxFontSize: 14px; boxTextFont: font(boxFontSize); +boxLittleSkip: 10px; +boxMediumSkip: 20px; boxTitleFg: #444444; boxTitleFont: font(boxFontSize bold); @@ -126,6 +135,10 @@ redBoxLinkButton: linkButton(defaultBoxLinkButton) { overColor: #d15948; downColor: #db6352; } +boxLabel: flatLabel(labelDefFlat) { + font: font(boxFontSize); + align: align(topleft); +} defaultInputArea: InputArea { textFg: black; @@ -611,13 +624,6 @@ scrollCountries: flatScroll(scrollDef) { lnkText: #0f7dc7; -labelDefFlat: flatLabel { - font: font(fsize); - minWidth: 100px; - width: 0px; - align: align(left); -} - introBtnTop: 288px; introSkip: 45px; introFinishSkip: 15px; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index c6108e8e0e..3f1ded1739 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -29,89 +29,65 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" -ApiWrap::ApiWrap(QObject *parent) : QObject(parent) { +ApiWrap::ApiWrap(QObject *parent) : QObject(parent) +, _messageDataResolveDelayed(new SingleDelayedCall(this, "resolveMessageDatas")) { App::initBackground(); - connect(&_dependencyTimer, SIGNAL(timeout()), this, SLOT(resolveDependencyItems())); connect(&_webPagesTimer, SIGNAL(timeout()), this, SLOT(resolveWebPages())); } void ApiWrap::init() { } -void ApiWrap::itemRemoved(HistoryItem *item) { - if (MsgId dependencyMsgId = item->dependencyMsgId()) { - ChannelData *channel = item->history()->peer->asChannel(); - DependencyRequests *requests(dependencyRequests(channel, true)); - if (requests) { - DependencyRequests::iterator i = requests->find(dependencyMsgId); - if (i != requests->cend()) { - for (QList::iterator j = i->dependentItems.begin(); j != i->dependentItems.end();) { - if ((*j) == item) { - j = i->dependentItems.erase(j); - } else { - ++j; - } - } - if (i->dependentItems.isEmpty()) { - requests->erase(i); - } - } - if (channel && requests->isEmpty()) { - _channelDependencyRequests.remove(channel); - } - } - } +void ApiWrap::requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback *callback) { + MessageDataRequest::CallbackPtr pcallback(callback); + MessageDataRequest &req(channel ? _channelMessageDataRequests[channel][msgId] : _messageDataRequests[msgId]); + req.callbacks.append(pcallback); + if (!req.req) _messageDataResolveDelayed->call(); } -void ApiWrap::requestDependencyItem(HistoryItem *dependency, ChannelData *channel, MsgId id) { - DependencyRequest &req(channel ? _channelDependencyRequests[channel][id] : _dependencyRequests[id]); - req.dependentItems.append(dependency); - if (!req.req) _dependencyTimer.start(1); -} - -ApiWrap::MessageIds ApiWrap::collectMessageIds(const DependencyRequests &requests) { +ApiWrap::MessageIds ApiWrap::collectMessageIds(const MessageDataRequests &requests) { MessageIds result; result.reserve(requests.size()); - for (DependencyRequests::const_iterator i = requests.cbegin(), e = requests.cend(); i != e; ++i) { + for (MessageDataRequests::const_iterator i = requests.cbegin(), e = requests.cend(); i != e; ++i) { if (i.value().req > 0) continue; result.push_back(MTP_int(i.key())); } return result; } -ApiWrap::DependencyRequests *ApiWrap::dependencyRequests(ChannelData *channel, bool onlyExisting) { +ApiWrap::MessageDataRequests *ApiWrap::messageDataRequests(ChannelData *channel, bool onlyExisting) { if (channel) { - ChannelDependencyRequests::iterator i = _channelDependencyRequests.find(channel); - if (i == _channelDependencyRequests.cend()) { + ChannelMessageDataRequests::iterator i = _channelMessageDataRequests.find(channel); + if (i == _channelMessageDataRequests.cend()) { if (onlyExisting) return 0; - i = _channelDependencyRequests.insert(channel, DependencyRequests()); + i = _channelMessageDataRequests.insert(channel, MessageDataRequests()); } return &i.value(); } - return &_dependencyRequests; + return &_messageDataRequests; } -void ApiWrap::resolveDependencyItems() { - if (_dependencyRequests.isEmpty() && _channelDependencyRequests.isEmpty()) return; +void ApiWrap::resolveMessageDatas() { + if (_messageDataRequests.isEmpty() && _channelMessageDataRequests.isEmpty()) return; - MessageIds ids = collectMessageIds(_dependencyRequests); + MessageIds ids = collectMessageIds(_messageDataRequests); if (!ids.isEmpty()) { - mtpRequestId req = MTP::send(MTPmessages_GetMessages(MTP_vector(ids)), rpcDone(&ApiWrap::gotDependencyItem, (ChannelData*)0), RPCFailHandlerPtr(), 0, 5); - for (DependencyRequests::iterator i = _dependencyRequests.begin(); i != _dependencyRequests.cend(); ++i) { + mtpRequestId req = MTP::send(MTPmessages_GetMessages(MTP_vector(ids)), rpcDone(&ApiWrap::gotMessageDatas, (ChannelData*)nullptr), RPCFailHandlerPtr(), 0, 5); + for (MessageDataRequests::iterator i = _messageDataRequests.begin(); i != _messageDataRequests.cend(); ++i) { if (i.value().req > 0) continue; i.value().req = req; } } - for (ChannelDependencyRequests::iterator j = _channelDependencyRequests.begin(); j != _channelDependencyRequests.cend();) { + for (ChannelMessageDataRequests::iterator j = _channelMessageDataRequests.begin(); j != _channelMessageDataRequests.cend();) { if (j->isEmpty()) { - j = _channelDependencyRequests.erase(j); + j = _channelMessageDataRequests.erase(j); continue; } MessageIds ids = collectMessageIds(j.value()); if (!ids.isEmpty()) { - mtpRequestId req = MTP::send(MTPchannels_GetMessages(j.key()->inputChannel, MTP_vector(ids)), rpcDone(&ApiWrap::gotDependencyItem, j.key()), RPCFailHandlerPtr(), 0, 5); - for (DependencyRequests::iterator i = j->begin(); i != j->cend(); ++i) { + mtpRequestId req = MTP::send(MTPchannels_GetMessages(j.key()->inputChannel, MTP_vector(ids)), rpcDone(&ApiWrap::gotMessageDatas, j.key()), RPCFailHandlerPtr(), 0, 5); + for (MessageDataRequests::iterator i = j->begin(); i != j->cend(); ++i) { if (i.value().req > 0) continue; i.value().req = req; } @@ -120,7 +96,7 @@ void ApiWrap::resolveDependencyItems() { } } -void ApiWrap::gotDependencyItem(ChannelData *channel, const MTPmessages_Messages &msgs, mtpRequestId req) { +void ApiWrap::gotMessageDatas(ChannelData *channel, const MTPmessages_Messages &msgs, mtpRequestId req) { switch (msgs.type()) { case mtpc_messages_messages: { const MTPDmessages_messages &d(msgs.c_messages_messages()); @@ -152,16 +128,12 @@ void ApiWrap::gotDependencyItem(ChannelData *channel, const MTPmessages_Messages App::feedMsgs(d.vmessages, NewMessageExisting); } break; } - DependencyRequests *requests(dependencyRequests(channel, true)); + MessageDataRequests *requests(messageDataRequests(channel, true)); if (requests) { - for (DependencyRequests::iterator i = requests->begin(); i != requests->cend();) { + for (MessageDataRequests::iterator i = requests->begin(); i != requests->cend();) { if (i.value().req == req) { - for (QList::const_iterator j = i.value().dependentItems.cbegin(), e = i.value().dependentItems.cend(); j != e; ++j) { - if (*j) { - (*j)->updateDependencyItem(); - } else if (App::main()) { - App::main()->updateDependencyItem(); - } + for (MessageDataRequest::Callbacks::const_iterator j = i.value().callbacks.cbegin(), e = i.value().callbacks.cend(); j != e; ++j) { + (*j)->call(channel, i.key()); } i = requests->erase(i); } else { @@ -169,7 +141,7 @@ void ApiWrap::gotDependencyItem(ChannelData *channel, const MTPmessages_Messages } } if (channel && requests->isEmpty()) { - _channelDependencyRequests.remove(channel); + _channelMessageDataRequests.remove(channel); } } } diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index d15fb88f71..3ea5eca0fa 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -28,9 +28,8 @@ public: ApiWrap(QObject *parent); void init(); - void itemRemoved(HistoryItem *item); - - void requestDependencyItem(HistoryItem *dependent, ChannelData *channel, MsgId id); + typedef SharedCallback2 RequestMessageDataCallback; + void requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback *callback); void requestFullPeer(PeerData *peer); void requestPeer(PeerData *peer); @@ -59,28 +58,30 @@ signals: public slots: - void resolveDependencyItems(); + void resolveMessageDatas(); void resolveWebPages(); void delayedRequestParticipantsCount(); private: - void gotDependencyItem(ChannelData *channel, const MTPmessages_Messages &result, mtpRequestId req); - struct DependencyRequest { - DependencyRequest() : req(0) { + void gotMessageDatas(ChannelData *channel, const MTPmessages_Messages &result, mtpRequestId req); + struct MessageDataRequest { + MessageDataRequest() : req(0) { } + typedef SharedCallback2::Ptr CallbackPtr; + typedef QList Callbacks; mtpRequestId req; - QList dependentItems; + Callbacks callbacks; }; - typedef QMap DependencyRequests; - DependencyRequests _dependencyRequests; - typedef QMap ChannelDependencyRequests; - ChannelDependencyRequests _channelDependencyRequests; - SingleTimer _dependencyTimer; + typedef QMap MessageDataRequests; + MessageDataRequests _messageDataRequests; + typedef QMap ChannelMessageDataRequests; + ChannelMessageDataRequests _channelMessageDataRequests; + SingleDelayedCall *_messageDataResolveDelayed; typedef QVector MessageIds; - MessageIds collectMessageIds(const DependencyRequests &requests); - DependencyRequests *dependencyRequests(ChannelData *channel, bool onlyExisting = false); + MessageIds collectMessageIds(const MessageDataRequests &requests); + MessageDataRequests *messageDataRequests(ChannelData *channel, bool onlyExisting = false); void gotChatFull(PeerData *peer, const MTPmessages_ChatFull &result, mtpRequestId req); void gotUserFull(PeerData *peer, const MTPUserFull &result, mtpRequestId req); diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index fd6524e8e7..fc0eb42370 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -378,3 +378,59 @@ void ConvertToSupergroupBox::resizeEvent(QResizeEvent *e) { _convert.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _convert.height()); _cancel.moveToRight(st::boxButtonPadding.right() + _convert.width() + st::boxButtonPadding.left(), _convert.y()); } + +PinMessageBox::PinMessageBox(ChannelData *channel, MsgId msgId) : AbstractBox(st::boxWidth) +, _channel(channel) +, _msgId(msgId) +, _text(this, lang(lng_pinned_pin_sure), st::boxLabel) +, _notify(this, lang(lng_pinned_notify), true) +, _pin(this, lang(lng_pinned_pin), st::defaultBoxButton) +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) +, _requestId(0) { + _text.resizeToWidth(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()); + setMaxHeight(st::boxPadding.top() + _text.height() + st::boxMediumSkip + _notify.height() + st::boxPadding.bottom() + st::boxButtonPadding.top() + _pin.height() + st::boxButtonPadding.bottom()); + + connect(&_pin, SIGNAL(clicked()), this, SLOT(onPin())); + connect(&_cancel, SIGNAL(clicked()), this, SLOT(onClose())); +} + +void PinMessageBox::resizeEvent(QResizeEvent *e) { + _text.moveToLeft(st::boxPadding.left(), st::boxPadding.top()); + _notify.moveToLeft(st::boxPadding.left(), _text.y() + _text.height() + st::boxMediumSkip); + _pin.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _pin.height()); + _cancel.moveToRight(st::boxButtonPadding.right() + _pin.width() + st::boxButtonPadding.left(), _pin.y()); +} + +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)); +} + +void PinMessageBox::showAll() { + _text.show(); + _notify.show(); + _pin.show(); + _cancel.show(); +} + +void PinMessageBox::hideAll() { + _text.hide(); + _notify.hide(); + _pin.hide(); + _cancel.hide(); +} + +void PinMessageBox::pinDone(const MTPUpdates &updates) { + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } + Ui::hideLayer(); +} + +bool PinMessageBox::pinFail(const RPCError &error) { + if (mtpIsFlood(error)) return false; + Ui::hideLayer(); + return true; +} diff --git a/Telegram/SourceFiles/boxes/confirmbox.h b/Telegram/SourceFiles/boxes/confirmbox.h index 05ed14212c..b2b1d2e989 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.h +++ b/Telegram/SourceFiles/boxes/confirmbox.h @@ -163,4 +163,39 @@ private: int32 _textWidth, _textHeight; BoxButton _convert, _cancel; +}; + +class PinMessageBox : public AbstractBox, public RPCSender { + Q_OBJECT + +public: + + PinMessageBox(ChannelData *channel, MsgId msgId); + + void resizeEvent(QResizeEvent *e); + +public slots: + + void onPin(); + +protected: + + void showAll(); + void hideAll(); + +private: + + void pinDone(const MTPUpdates &updates); + bool pinFail(const RPCError &error); + + ChannelData *_channel; + MsgId _msgId; + + FlatLabel _text; + Checkbox _notify; + + BoxButton _pin, _cancel; + + mtpRequestId _requestId; + }; \ No newline at end of file diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 37e5fdaf30..eccc5255c3 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -371,6 +371,8 @@ struct GlobalDataStruct { int32 PushChatLimit = 2; int32 SavedGifsLimit = 200; int32 EditTimeLimit = 172800; + + Global::HiddenPinnedMessagesMap HiddenPinnedMessages; }; GlobalDataStruct *GlobalData = 0; @@ -413,4 +415,6 @@ namespace Global { DefineVar(Global, int32, SavedGifsLimit); DefineVar(Global, int32, EditTimeLimit); + DefineVar(Global, HiddenPinnedMessagesMap, HiddenPinnedMessages); + }; diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 11ce5c75b7..e572f45c1d 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -159,6 +159,9 @@ namespace Global { DeclareVar(int32, SavedGifsLimit); DeclareVar(int32, EditTimeLimit); + typedef QMap HiddenPinnedMessagesMap; + DeclareVar(HiddenPinnedMessagesMap, HiddenPinnedMessages); + }; namespace Adaptive { diff --git a/Telegram/SourceFiles/gui/flatlabel.cpp b/Telegram/SourceFiles/gui/flatlabel.cpp index 429b96b58a..8255ff1c23 100644 --- a/Telegram/SourceFiles/gui/flatlabel.cpp +++ b/Telegram/SourceFiles/gui/flatlabel.cpp @@ -53,6 +53,13 @@ void FlatLabel::setRichText(const QString &text) { setMouseTracking(_text.hasLinks()); } +void FlatLabel::resizeToWidth(int32 width) { + textstyleSet(&_tst); + int32 w = width, h = _text.countHeight(w); + textstyleRestore(); + resize(w, h); +} + void FlatLabel::setLink(uint16 lnkIndex, const TextLinkPtr &lnk) { _text.setLink(lnkIndex, lnk); } diff --git a/Telegram/SourceFiles/gui/flatlabel.h b/Telegram/SourceFiles/gui/flatlabel.h index 43e9ebd63d..b06e3bff5e 100644 --- a/Telegram/SourceFiles/gui/flatlabel.h +++ b/Telegram/SourceFiles/gui/flatlabel.h @@ -40,6 +40,8 @@ public: void setText(const QString &text); void setRichText(const QString &text); + void resizeToWidth(int32 width); + void setLink(uint16 lnkIndex, const TextLinkPtr &lnk); private: diff --git a/Telegram/SourceFiles/gui/twidget.h b/Telegram/SourceFiles/gui/twidget.h index ad839e7016..4667e43a9e 100644 --- a/Telegram/SourceFiles/gui/twidget.h +++ b/Telegram/SourceFiles/gui/twidget.h @@ -204,3 +204,28 @@ private: const style::color &_color; }; + +class SingleDelayedCall : public QObject { + Q_OBJECT + +public: + SingleDelayedCall(QObject *parent, const char *member) : QObject(parent), _pending(false), _member(member) { + } + void call() { + if (!_pending) { + _pending = true; + QMetaObject::invokeMethod(this, "makeDelayedCall", Qt::QueuedConnection); + } + } + +private slots: + void makeDelayedCall() { + _pending = false; + QMetaObject::invokeMethod(parent(), _member); + } + +private: + bool _pending; + const char *_member; + +}; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 16d36a62c9..25442fe91b 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2909,6 +2909,12 @@ void HistoryBlock::removeItem(HistoryItem *item) { } } +void HistoryDependentItemCallback::call(ChannelData *channel, MsgId msgId) const { + if (HistoryItem *item = App::histItemById(_dependent)) { + item->updateDependencyItem(); + } +} + HistoryItem::HistoryItem(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime msgDate, int32 from) : y(0) , id(msgId) , date(msgDate) @@ -7042,7 +7048,7 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmess , _maxReplyWidth(0) , _replyToVia(0) { if (!updateReplyTo() && App::api()) { - App::api()->requestDependencyItem(this, history->peer->asChannel(), replyToMsgId); + App::api()->requestMessageData(history->peer->asChannel(), replyToMsgId, new HistoryDependentItemCallback(fullId())); } } @@ -7054,7 +7060,7 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, i , _maxReplyWidth(0) , _replyToVia(0) { if (!updateReplyTo() && App::api()) { - App::api()->requestDependencyItem(this, history->peer->asChannel(), replyToMsgId); + App::api()->requestMessageData(history->peer->asChannel(), replyToMsgId, new HistoryDependentItemCallback(fullId())); } } @@ -7066,7 +7072,7 @@ HistoryReply::HistoryReply(History *history, HistoryBlock *block, MsgId msgId, i , _maxReplyWidth(0) , _replyToVia(0) { if (!updateReplyTo() && App::api()) { - App::api()->requestDependencyItem(this, history->peer->asChannel(), replyToMsgId); + App::api()->requestMessageData(history->peer->asChannel(), replyToMsgId, new HistoryDependentItemCallback(fullId())); } replyToNameUpdated(); } @@ -7349,8 +7355,6 @@ void HistoryReply::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, i HistoryReply::~HistoryReply() { if (replyToMsg) { App::historyUnregDependency(this, replyToMsg); - } else if (replyToMsgId && App::api()) { - App::api()->itemRemoved(this); } deleteAndMark(_replyToVia); } @@ -7616,9 +7620,9 @@ HistoryServiceMsg::HistoryServiceMsg(History *history, HistoryBlock *block, cons , _media(0) { if (msg.has_reply_to_msg_id()) { UpdateInterfaces(HistoryServicePinned::Bit()); - Get()->msgId = msg.vreply_to_msg_id.v; + MsgId pinnedMsgId = Get()->msgId = msg.vreply_to_msg_id.v; if (!updatePinned() && App::api()) { - App::api()->requestDependencyItem(this, history->peer->asChannel(), Get()->msgId); + App::api()->requestMessageData(history->peer->asChannel(), pinnedMsgId, new HistoryDependentItemCallback(fullId())); } } setMessageByAction(msg.vaction); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index fb4df056b3..8e96253eeb 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -908,6 +908,17 @@ struct HistoryMessageForwarded : public BasicInterface mutable Text _text; }; +class HistoryDependentItemCallback : public SharedCallback2 { +public: + HistoryDependentItemCallback(FullMsgId dependent) : _dependent(dependent) { + } + void call(ChannelData *channel, MsgId msgId) const override; + +private: + FullMsgId _dependent; + +}; + class HistoryMedia; class HistoryItem : public HistoryElem, public Interfaces { public: @@ -1076,7 +1087,12 @@ public: return (channel->amEditor() || channel->amModerator() || out()); } + bool canPin() const { + return id > 0 && _history->peer->isMegagroup() && (_history->peer->asChannel()->amEditor() || _history->peer->asChannel()->amCreator()) && toHistoryMessage(); + } + bool canEdit(const QDateTime &cur) const; + bool hasDirectLink() const { return id > 0 && _history->peer->isChannel() && _history->peer->asChannel()->isPublic(); } @@ -1536,6 +1552,9 @@ public: } ImagePtr replyPreview(); + QString getCaption() const { + return _caption.original(); + } bool needsBubble(const HistoryItem *parent) const { return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 6c72f29bf5..57b6a2493d 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -877,6 +877,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (item->canEdit(::date(unixtime()))) { _menu->addAction(lang(lng_context_edit_msg), _widget, SLOT(onEditMessage())); } + if (item->canPin()) { + bool ispinned = (item->history()->peer->asChannel()->mgInfo->pinnedMsgId == item->id); + _menu->addAction(lang(ispinned ? lng_context_unpin_msg : lng_context_pin_msg), _widget, ispinned ? SLOT(onUnpinMessage()) : SLOT(onPinMessage())); + } } if (lnkPhoto) { _menu->addAction(lang(lng_context_save_image), this, SLOT(saveContextImage()))->setEnabled(true); @@ -933,6 +937,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (item->canEdit(::date(unixtime()))) { _menu->addAction(lang(lng_context_edit_msg), _widget, SLOT(onEditMessage())); } + if (item->canPin()) { + bool ispinned = (item->history()->peer->asChannel()->mgInfo->pinnedMsgId == item->id); + _menu->addAction(lang(ispinned ? lng_context_unpin_msg : lng_context_pin_msg), _widget, ispinned ? SLOT(onUnpinMessage()) : SLOT(onPinMessage())); + } } } else { if (item && item->id > 0 && isUponSelected != -2) { @@ -942,6 +950,10 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (item->canEdit(::date(unixtime()))) { _menu->addAction(lang(lng_context_edit_msg), _widget, SLOT(onEditMessage())); } + if (item->canPin()) { + bool ispinned = (item->history()->peer->asChannel()->mgInfo->pinnedMsgId == item->id); + _menu->addAction(lang(ispinned ? lng_context_unpin_msg : lng_context_pin_msg), _widget, ispinned ? SLOT(onUnpinMessage()) : SLOT(onPinMessage())); + } } if (item && !isUponSelected && !_contextMenuLnk) { if (HistoryMedia *media = (msg ? msg->getMedia() : 0)) { @@ -2632,6 +2644,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _editMsgId(0) , _replyEditMsg(0) , _fieldBarCancel(this, st::replyCancel) +, _pinnedBar(0) , _saveEditMsgRequestId(0) , _reportSpamStatus(dbiprsUnknown) , _previewData(0) @@ -2687,6 +2700,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _inRecord(false) , _inField(false) , _inReplyEdit(false) +, _inPinnedMsg(false) , a_recordingLevel(0, 0) , _recordingSamples(0) , a_recordOver(0, 0) @@ -2777,7 +2791,6 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) _fieldBarCancel.hide(); _scroll.hide(); - _scroll.move(0, 0); _collapseComments.setParent(&_scroll); _kbScroll.setFocusPolicy(Qt::NoFocus); @@ -3500,7 +3513,7 @@ void HistoryWidget::applyDraft(bool parseLinks) { if (_editMsgId || _replyToId) { updateReplyEditTexts(); if (!_replyEditMsg && App::api()) { - App::api()->requestDependencyItem(0, _peer->asChannel(), _editMsgId ? _editMsgId : _replyToId); + App::api()->requestMessageData(_peer->asChannel(), _editMsgId ? _editMsgId : _replyToId, new ReplyEditMessageDataCallback()); } } } @@ -3591,6 +3604,11 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re if (_migrated && _migrated->unreadBar) { _migrated->unreadBar->destroy(); } + if (_pinnedBar) { + delete _pinnedBar; + _pinnedBar = nullptr; + _inPinnedMsg = false; + } _history = _migrated = 0; updateBotKeyboard(); } @@ -3672,6 +3690,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _updateHistoryItems.stop(); + pinnedMsgVisibilityUpdated(); if (_history->lastWidth || _history->isReadyFor(_showAtMsgId, _fixedInScrollMsgId, _fixedInScrollMsgTop)) { _fixedInScrollMsgId = 0; _fixedInScrollMsgTop = 0; @@ -3681,7 +3700,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re doneShow(); } - App::main()->peerUpdated(_peer); + emit App::main()->peerUpdated(_peer); Local::readDraftsWithCursors(_history); if (_migrated) { @@ -3886,10 +3905,18 @@ void HistoryWidget::updateControlsVisibility() { _cmdStart.hide(); _attachType.hide(); _emojiPan.hide(); + if (_pinnedBar) { + _pinnedBar->cancel.hide(); + _pinnedBar->shadow.hide(); + } return; } updateToEndVisibility(); + if (_pinnedBar) { + _pinnedBar->cancel.show(); + _pinnedBar->shadow.show(); + } if (_firstLoadRequest) { _scroll.hide(); } else { @@ -4091,7 +4118,7 @@ void HistoryWidget::updateControlsVisibility() { } void HistoryWidget::updateMouseTracking() { - bool trackMouse = !_fieldBarCancel.isHidden() || (cHasAudioCapture() && _send.isHidden() && !_field.isHidden()); + bool trackMouse = !_fieldBarCancel.isHidden() || _pinnedBar || (cHasAudioCapture() && _send.isHidden() && !_field.isHidden()); setMouseTracking(trackMouse); } @@ -4874,6 +4901,10 @@ void HistoryWidget::animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTo _joinChannel.hide(); _muteUnmute.hide(); _topShadow.hide(); + if (_pinnedBar) { + _pinnedBar->shadow.hide(); + _pinnedBar->cancel.hide(); + } a_coordUnder = back ? anim::ivalue(-qFloor(st::slideShift * width()), 0) : anim::ivalue(0, -qFloor(st::slideShift * width())); a_coordOver = back ? anim::ivalue(0, width()) : anim::ivalue(width(), 0); @@ -5056,6 +5087,7 @@ void HistoryWidget::mouseMoveEvent(QMouseEvent *e) { bool inRecord = _send.geometry().contains(pos); bool inField = pos.y() >= (_scroll.y() + _scroll.height()) && pos.y() < height() && pos.x() >= 0 && pos.x() < width(); bool inReplyEdit = QRect(st::replySkip, _field.y() - st::sendPadding - st::replyHeight, width() - st::replySkip - _fieldBarCancel.width(), st::replyHeight).contains(pos) && (_editMsgId || replyToId()); + bool inPinnedMsg = QRect(0, 0, width(), st::replyHeight).contains(pos) && _pinnedBar; bool startAnim = false; if (inRecord != _inRecord) { _inRecord = inRecord; @@ -5075,6 +5107,10 @@ void HistoryWidget::mouseMoveEvent(QMouseEvent *e) { _inReplyEdit = inReplyEdit; setCursor(inReplyEdit ? style::cur_pointer : style::cur_default); } + if (inPinnedMsg != _inPinnedMsg) { + _inPinnedMsg = inPinnedMsg; + setCursor(inPinnedMsg ? style::cur_pointer : style::cur_default); + } if (startAnim) _a_record.start(); } @@ -6151,6 +6187,14 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { } _field.move(_attachDocument.x() + _attachDocument.width(), height() - kbh - _field.height() - st::sendPadding); + if (_pinnedBar) { + _scroll.move(0, st::replyHeight); + _pinnedBar->cancel.move(width() - _pinnedBar->cancel.width(), 0); + _pinnedBar->shadow.setGeometry(0, st::replyHeight, width(), st::lineWidth); + } else { + _scroll.move(0, _pinnedBar ? st::replyHeight : 0); + } + _attachDocument.move(0, height() - kbh - _attachDocument.height()); _attachPhoto.move(_attachDocument.x(), _attachDocument.y()); @@ -6250,6 +6294,9 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, newScrollHeight -= _kbScroll.height(); } } + if (_pinnedBar) { + newScrollHeight -= st::replyHeight; + } bool wasAtBottom = _scroll.scrollTop() + 1 > _scroll.scrollTopMax(), needResize = _scroll.width() != width() || _scroll.height() != newScrollHeight; if (needResize) { _scroll.resize(width(), newScrollHeight); @@ -6553,6 +6600,9 @@ void HistoryWidget::mousePressEvent(QMouseEvent *e) { _a_record.start(); } else if (_inReplyEdit) { Ui::showPeerHistory(_peer, _editMsgId ? _editMsgId : replyToId()); + } else if (_inPinnedMsg) { + t_assert(_pinnedBar != nullptr); + Ui::showPeerHistory(_peer, _pinnedBar->msgId); } } @@ -6724,6 +6774,89 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { _field.setFocus(); } +HistoryWidget::PinnedBar::PinnedBar(MsgId msgId, HistoryWidget *parent) +: msgId(msgId) +, msg(0) +, cancel(parent, st::replyCancel) +, shadow(parent, st::shadowColor) { +} + +void HistoryWidget::updatePinnedBar(bool force) { + if (!_pinnedBar || _pinnedBar->msg) { + return; + } + t_assert(_history != nullptr); + + _pinnedBar->msg = App::histItemById(_history->channelId(), _pinnedBar->msgId); + if (_pinnedBar->msg) { + _pinnedBar->text.setText(st::msgFont, _pinnedBar->msg->inDialogsText(), _textDlgOptions); + } else if (force) { + if (_peer && _peer->isMegagroup()) { + _peer->asChannel()->mgInfo->pinnedMsgId = 0; + } + delete _pinnedBar; + _pinnedBar = nullptr; + _inPinnedMsg = false; + resizeEvent(0); + update(); + } +} + +bool HistoryWidget::pinnedMsgVisibilityUpdated() { + bool result = false; + MsgId pinnedMsgId = (_peer && _peer->isMegagroup()) ? _peer->asChannel()->mgInfo->pinnedMsgId : 0; + if (pinnedMsgId && !_peer->asChannel()->amCreator() && !_peer->asChannel()->amEditor()) { + Global::HiddenPinnedMessagesMap::const_iterator it = Global::HiddenPinnedMessages().constFind(_peer->id); + if (it != Global::HiddenPinnedMessages().cend()) { + if (it.value() == pinnedMsgId) { + pinnedMsgId = 0; + } else { + Global::RefHiddenPinnedMessages().remove(_peer->id); + Local::writeUserSettings(); + } + } + } + if (pinnedMsgId) { + if (!_pinnedBar) { + _pinnedBar = new PinnedBar(pinnedMsgId, this); + if (_a_show.animating()) { + _pinnedBar->cancel.hide(); + _pinnedBar->shadow.hide(); + } else { + _pinnedBar->cancel.show(); + _pinnedBar->shadow.show(); + } + connect(&_pinnedBar->cancel, SIGNAL(clicked()), this, SLOT(onPinnedHide())); + _sideShadow.raise(); + _topShadow.raise(); + updatePinnedBar(); + result = true; + _scroll.scrollToY(_scroll.scrollTop() + st::replyHeight); + } else if (_pinnedBar->msgId != pinnedMsgId) { + _pinnedBar->msgId = pinnedMsgId; + _pinnedBar->msg = 0; + _pinnedBar->text.clean(); + updatePinnedBar(); + update(); + } + if (!_pinnedBar->msg && App::api()) { + App::api()->requestMessageData(_peer->asChannel(), _pinnedBar->msgId, new ReplyEditMessageDataCallback()); + } + } else if (_pinnedBar) { + delete _pinnedBar; + _pinnedBar = nullptr; + result = true; + _scroll.scrollToY(_scroll.scrollTop() - st::replyHeight); + } + return result; +} + +void HistoryWidget::ReplyEditMessageDataCallback::call(ChannelData *channel, MsgId msgId) const { + if (App::main()) { + App::main()->messageDataReceived(channel, msgId); + } +} + void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &caption) { if (!_history || !doc || !canSendMessages(_peer)) return; @@ -6940,6 +7073,62 @@ void HistoryWidget::onEditMessage() { } } +void HistoryWidget::onPinMessage() { + HistoryItem *to = App::contextItem(); + if (!to || !to->canPin() || !_peer || !_peer->isMegagroup()) return; + + Ui::showLayer(new PinMessageBox(_peer->asChannel(), to->id)); +} + +void HistoryWidget::onUnpinMessage() { + if (!_peer || !_peer->isMegagroup()) return; + + ConfirmBox *box = new ConfirmBox(lang(lng_pinned_unpin_sure), lang(lng_pinned_unpin)); + connect(box, SIGNAL(confirmed()), this, SLOT(onUnpinMessageSure())); + Ui::showLayer(box); +} + +void HistoryWidget::onUnpinMessageSure() { + if (!_peer || !_peer->isMegagroup()) return; + + _peer->asChannel()->mgInfo->pinnedMsgId = 0; + if (pinnedMsgVisibilityUpdated()) { + resizeEvent(0); + update(); + } + + Ui::hideLayer(); + MTP::send(MTPchannels_UpdatePinnedMessage(MTP_int(0), _peer->asChannel()->inputChannel, MTP_int(0)), rpcDone(&HistoryWidget::unpinDone)); +} + +void HistoryWidget::unpinDone(const MTPUpdates &updates) { + if (App::main()) { + App::main()->sentUpdatesReceived(updates); + } +} + +void HistoryWidget::onPinnedHide() { + if (!_peer || !_peer->isMegagroup()) return; + if (!_peer->asChannel()->mgInfo->pinnedMsgId) { + if (pinnedMsgVisibilityUpdated()) { + resizeEvent(0); + update(); + } + return; + } + + if (_peer->asChannel()->amCreator() || _peer->asChannel()->amEditor()) { + onUnpinMessage(); + } else { + Global::RefHiddenPinnedMessages().insert(_peer->id, _peer->asChannel()->mgInfo->pinnedMsgId); + Local::writeUserSettings(); + if (pinnedMsgVisibilityUpdated()) { + resizeEvent(0); + update(); + } + } +} + void HistoryWidget::onCopyPostLink() { HistoryItem *to = App::contextItem(); if (!to || !to->hasDirectLink()) return; @@ -7225,6 +7414,10 @@ void HistoryWidget::peerUpdated(PeerData *data) { QTimer::singleShot(ReloadChannelMembersTimeout, App::api(), SLOT(delayedRequestParticipantsCount())); return; } + bool resize = false; + if (pinnedMsgVisibilityUpdated()) { + resize = true; + } updateListSize(); if (_peer->isChannel()) updateReportSpamStatus(); if (App::api()) { @@ -7237,7 +7430,9 @@ void HistoryWidget::peerUpdated(PeerData *data) { } } if (!_a_show.animating()) { - bool resize = (_unblock.isHidden() == isBlocked() || (!isBlocked() && _joinChannel.isHidden() == isJoinChannel())); + if (_unblock.isHidden() == isBlocked() || (!isBlocked() && _joinChannel.isHidden() == isJoinChannel())) { + resize = true; + } bool newCanSendMessages = canSendMessages(_peer); if (newCanSendMessages != _canSendMessages) { _canSendMessages = newCanSendMessages; @@ -7247,7 +7442,10 @@ void HistoryWidget::peerUpdated(PeerData *data) { resize = true; } updateControlsVisibility(); - if (resize) resizeEvent(0); + if (resize) { + resizeEvent(0); + update(); + } } App::main()->updateOnlineDisplay(); } @@ -7383,6 +7581,16 @@ void HistoryWidget::updateTopBarSelection() { update(); } +void HistoryWidget::messageDataReceived(ChannelData *channel, MsgId msgId) { + if (!_peer || _peer->asChannel() != channel || !msgId) return; + if (_editMsgId == msgId || _replyToId == msgId) { + updateReplyEditTexts(true); + } + if (_pinnedBar && _pinnedBar->msgId == msgId) { + updatePinnedBar(true); + } +} + void HistoryWidget::updateReplyEditTexts(bool force) { if (_replyEditMsg || (!_editMsgId && !_replyToId)) { return; @@ -7556,6 +7764,40 @@ void HistoryWidget::drawRecording(Painter &p) { p.drawText(left + (right - left - _recordCancelWidth) / 2, _attachPhoto.y() + st::recordTextTop + st::recordFont->ascent, lang(lng_record_cancel)); } +void HistoryWidget::drawPinnedBar(Painter &p) { + t_assert(_pinnedBar != nullptr); + + Text *from = 0, *text = 0; + bool serviceColor = false, hasForward = readyToForward(); + ImagePtr preview; + p.fillRect(0, 0, width(), st::replyHeight, st::taMsgField.bgColor); + + QRect rbar(rtlrect(st::msgReplyBarSkip + st::msgReplyBarPos.x(), st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.width(), st::msgReplyBarSize.height(), width())); + p.fillRect(rbar, st::msgInReplyBarColor); + + int32 left = st::msgReplyBarSkip + st::msgReplyBarSkip; + if (_pinnedBar->msg) { + if (_pinnedBar->msg->getMedia() && _pinnedBar->msg->getMedia()->hasReplyPreview()) { + ImagePtr replyPreview = _pinnedBar->msg->getMedia()->replyPreview(); + if (!replyPreview->isNull()) { + QRect to(left, st::msgReplyPadding.top(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height()); + p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height())); + } + left += st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x(); + } + p.setPen(st::replyColor); + p.setFont(st::msgServiceNameFont); + p.drawText(left, st::msgReplyPadding.top() + st::msgServiceNameFont->ascent, lang(lng_pinned_message)); + + p.setPen((((_pinnedBar->msg->toHistoryMessage() && _pinnedBar->msg->toHistoryMessage()->emptyText()) || _pinnedBar->msg->serviceMsg()) ? st::msgInDateFg : st::msgColor)->p); + _pinnedBar->text.drawElided(p, left, st::msgReplyPadding.top() + st::msgServiceNameFont->height, width() - left -_fieldBarCancel.width() - st::msgReplyPadding.right()); + } else { + p.setFont(st::msgDateFont); + p.setPen(st::msgInDateFg); + p.drawText(left, st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - left - _pinnedBar->cancel.width() - st::msgReplyPadding.right())); + } +} + void HistoryWidget::paintEvent(QPaintEvent *e) { if (!App::main() || (App::wnd() && App::wnd()->contentOverlapped(this, e))) return; @@ -7614,6 +7856,9 @@ void HistoryWidget::paintEvent(QPaintEvent *e) { drawRecordButton(p); if (_recording) drawRecording(p); } + if (_pinnedBar) { + drawPinnedBar(p); + } } if (_scroll.isHidden()) { QPoint dogPos((width() - st::msgDogImg.pxWidth()) / 2, ((height() - _field.height() - 2 * st::sendPadding - st::msgDogImg.pxHeight()) * 4) / 9); @@ -7723,5 +7968,6 @@ bool HistoryWidget::touchScroll(const QPoint &delta) { } HistoryWidget::~HistoryWidget() { - delete _list; + deleteAndMark(_pinnedBar); + deleteAndMark(_list); } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index bd53f26486..23584da8ee 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -517,7 +517,7 @@ public: void updateScrollColors(); MsgId replyToId() const; - void updateReplyEditTexts(bool force = false); + void messageDataReceived(ChannelData *channel, MsgId msgId); bool lastForceReplyReplied(const FullMsgId &replyTo = FullMsgId(NoChannel, -1)) const; void cancelReply(bool lastKeyboardUsed = false); void cancelEdit(); @@ -612,6 +612,10 @@ public slots: void onCancel(); void onReplyToMessage(); void onEditMessage(); + void onPinMessage(); + void onUnpinMessage(); + void onUnpinMessageSure(); + void onPinnedHide(); void onCopyPostLink(); void onFieldBarCancel(); @@ -717,6 +721,26 @@ private: Text _replyEditMsgText; IconedButton _fieldBarCancel; + void updateReplyEditTexts(bool force = false); + + struct PinnedBar { + PinnedBar(MsgId msgId, HistoryWidget *parent); + + MsgId msgId; + HistoryItem *msg; + Text text; + IconedButton cancel; + PlainShadow shadow; + }; + PinnedBar *_pinnedBar; + void updatePinnedBar(bool force = false); + bool pinnedMsgVisibilityUpdated(); + void unpinDone(const MTPUpdates &updates); + + class ReplyEditMessageDataCallback : public SharedCallback2 { + public: + void call(ChannelData *channel, MsgId msgId) const override; + }; void sendExistingDocument(DocumentData *doc, const QString &caption); void sendExistingPhoto(PhotoData *photo, const QString &caption); @@ -724,6 +748,7 @@ private: void drawField(Painter &p); void drawRecordButton(Painter &p); void drawRecording(Painter &p); + void drawPinnedBar(Painter &p); void updateMouseTracking(); @@ -839,7 +864,7 @@ private: bool _cmdStartShown; MessageField _field; Animation _a_record, _a_recording; - bool _recording, _inRecord, _inField, _inReplyEdit; + bool _recording, _inRecord, _inField, _inReplyEdit, _inPinnedMsg; anim::ivalue a_recordingLevel; int32 _recordingSamples; anim::fvalue a_recordOver, a_recordDown; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 9764cad672..118ba1c92d 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -556,6 +556,69 @@ namespace { lskSavedGifs = 0x0f, // no data }; + enum { + dbiKey = 0x00, + dbiUser = 0x01, + dbiDcOptionOld = 0x02, + dbiChatSizeMax = 0x03, + dbiMutePeer = 0x04, + dbiSendKey = 0x05, + dbiAutoStart = 0x06, + dbiStartMinimized = 0x07, + dbiSoundNotify = 0x08, + dbiWorkMode = 0x09, + dbiSeenTrayTooltip = 0x0a, + dbiDesktopNotify = 0x0b, + dbiAutoUpdate = 0x0c, + dbiLastUpdateCheck = 0x0d, + dbiWindowPosition = 0x0e, + dbiConnectionType = 0x0f, + // 0x10 reserved + dbiDefaultAttach = 0x11, + dbiCatsAndDogs = 0x12, + dbiReplaceEmojis = 0x13, + dbiAskDownloadPath = 0x14, + dbiDownloadPathOld = 0x15, + dbiScale = 0x16, + dbiEmojiTabOld = 0x17, + dbiRecentEmojisOld = 0x18, + dbiLoggedPhoneNumber = 0x19, + dbiMutedPeers = 0x1a, + // 0x1b reserved + dbiNotifyView = 0x1c, + dbiSendToMenu = 0x1d, + dbiCompressPastedImage = 0x1e, + dbiLang = 0x1f, + dbiLangFile = 0x20, + dbiTileBackground = 0x21, + dbiAutoLock = 0x22, + dbiDialogLastPath = 0x23, + dbiRecentEmojis = 0x24, + dbiEmojiVariants = 0x25, + dbiRecentStickers = 0x26, + dbiDcOption = 0x27, + dbiTryIPv6 = 0x28, + dbiSongVolume = 0x29, + dbiWindowsNotifications = 0x30, + dbiIncludeMuted = 0x31, + dbiMegagroupSizeMax = 0x32, + dbiDownloadPath = 0x33, + dbiAutoDownload = 0x34, + dbiSavedGifsLimit = 0x35, + dbiShowingSavedGifs = 0x36, + dbiAutoPlay = 0x37, + dbiAdaptiveForWide = 0x38, + dbiHiddenPinnedMessages = 0x39, + + dbiEncryptedWithSalt = 333, + dbiEncrypted = 444, + + // 500-600 reserved + + dbiVersion = 666, + }; + + typedef QMap DraftsMap; DraftsMap _draftsMap, _draftCursorsMap; typedef QMap DraftsNotReadMap; @@ -1266,6 +1329,15 @@ namespace { cSetEmojiVariants(v); } break; + + case dbiHiddenPinnedMessages: { + Global::HiddenPinnedMessagesMap v; + stream >> v; + if (!_checkStreamStatus(stream)) return false; + + Global::SetHiddenPinnedMessages(v); + } break; + case dbiDialogLastPath: { QString path; stream >> path; @@ -1510,6 +1582,9 @@ namespace { size += sizeof(quint32) + sizeof(qint32) + (cRecentStickersPreload().isEmpty() ? cGetRecentStickers().size() : cRecentStickersPreload().size()) * (sizeof(uint64) + sizeof(ushort)); size += sizeof(quint32) + _stringSize(cDialogLastPath()); size += sizeof(quint32) + 3 * sizeof(qint32); + if (!Global::HiddenPinnedMessages().isEmpty()) { + size += sizeof(quint32) + sizeof(qint32) + Global::HiddenPinnedMessages().size() * (sizeof(PeerId) + sizeof(MsgId)); + } EncryptedDescriptor data(size); data.stream << quint32(dbiSendKey) << qint32(cCtrlEnter() ? dbiskCtrlEnter : dbiskEnter); @@ -1553,6 +1628,9 @@ namespace { } data.stream << quint32(dbiRecentStickers) << v; } + if (!Global::HiddenPinnedMessages().isEmpty()) { + data.stream << quint32(dbiHiddenPinnedMessages) << Global::HiddenPinnedMessages(); + } FileWriteDescriptor file(_userSettingsKey); file.writeEncrypted(data); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 9ef400e1c0..e8854ebc3b 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1510,7 +1510,6 @@ void MainWidget::changingMsgId(HistoryItem *row, MsgId newId) { } void MainWidget::itemRemoved(HistoryItem *item) { - api()->itemRemoved(item); dialogs.itemRemoved(item); if (history.peer() == item->history()->peer || (history.peer() && history.peer() == item->history()->peer->migrateTo())) { history.itemRemoved(item); @@ -2056,8 +2055,8 @@ ApiWrap *MainWidget::api() { return _api; } -void MainWidget::updateDependencyItem() { - history.updateReplyEditTexts(true); +void MainWidget::messageDataReceived(ChannelData *channel, MsgId msgId) { + history.messageDataReceived(channel, msgId); } void MainWidget::updateBotKeyboard(History *h) { diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 08c053f5b6..2a039fe42f 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -373,7 +373,7 @@ public: ImagePtr newBackgroundThumb(); ApiWrap *api(); - void updateDependencyItem(); + void messageDataReceived(ChannelData *channel, MsgId msgId); void updateBotKeyboard(History *h); void pushReplyReturn(HistoryItem *item); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 5a4af0ce6b..5486b9582d 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1157,14 +1157,15 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type 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(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: 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 14: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 15: 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 16: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 17: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 18: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 19: 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 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -2696,7 +2697,9 @@ void _serialize_updateChannelTooLong(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(" 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 577f80f59b..e618f914c7 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -133,7 +133,7 @@ enum { mtpc_chatEmpty = 0x9ba2d800, mtpc_chat = 0xd91cdd54, mtpc_chatForbidden = 0x7328bdb, - mtpc_channel = 0x4b1b7506, + mtpc_channel = 0xa14dca52, mtpc_channelForbidden = 0x2d85832c, mtpc_chatFull = 0x2e02a614, mtpc_channelFull = 0x97bee562, @@ -255,7 +255,7 @@ enum { mtpc_updateReadHistoryOutbox = 0x2f2f21bf, mtpc_updateWebPage = 0x7f891213, mtpc_updateReadMessagesContents = 0x68c13933, - mtpc_updateChannelTooLong = 0x60946422, + mtpc_updateChannelTooLong = 0xeb0467fb, mtpc_updateChannel = 0xb6d45656, mtpc_updateChannelGroup = 0xc36c1e3c, mtpc_updateNewChannelMessage = 0x62ba04d9, @@ -5555,7 +5555,7 @@ private: 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 _channel_id); + 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); @@ -9966,6 +9966,8 @@ public: 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), }; @@ -9981,6 +9983,8 @@ public: 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; } }; @@ -11210,10 +11214,18 @@ class MTPDupdateChannelTooLong : public mtpDataImpl { public: MTPDupdateChannelTooLong() { } - MTPDupdateChannelTooLong(MTPint _channel_id) : vchannel_id(_channel_id) { + MTPDupdateChannelTooLong(MTPint _flags, MTPint _channel_id, MTPint _pts) : vflags(_flags), vchannel_id(_channel_id), vpts(_pts) { } + MTPint vflags; MTPint vchannel_id; + MTPint vpts; + + enum { + flag_pts = (1 << 0), + }; + + bool has_pts() const { return vflags.v & flag_pts; } }; class MTPDupdateChannel : public mtpDataImpl { @@ -22948,7 +22960,7 @@ inline uint32 MTPchat::innerLength() const { } case mtpc_channel: { const MTPDchannel &v(c_channel()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vtitle.innerLength() + (v.has_username() ? v.vusername.innerLength() : 0) + v.vphoto.innerLength() + v.vdate.innerLength() + v.vversion.innerLength() + (v.has_restriction_reason() ? v.vrestriction_reason.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + (v.has_access_hash() ? v.vaccess_hash.innerLength() : 0) + v.vtitle.innerLength() + (v.has_username() ? v.vusername.innerLength() : 0) + v.vphoto.innerLength() + v.vdate.innerLength() + v.vversion.innerLength() + (v.has_restriction_reason() ? v.vrestriction_reason.innerLength() : 0); } case mtpc_channelForbidden: { const MTPDchannelForbidden &v(c_channelForbidden()); @@ -22992,7 +23004,7 @@ inline void MTPchat::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId MTPDchannel &v(_channel()); v.vflags.read(from, end); v.vid.read(from, end); - v.vaccess_hash.read(from, end); + if (v.has_access_hash()) { v.vaccess_hash.read(from, end); } else { v.vaccess_hash = MTPlong(); } v.vtitle.read(from, end); if (v.has_username()) { v.vusername.read(from, end); } else { v.vusername = MTPstring(); } v.vphoto.read(from, end); @@ -23036,7 +23048,7 @@ inline void MTPchat::write(mtpBuffer &to) const { const MTPDchannel &v(c_channel()); v.vflags.write(to); v.vid.write(to); - v.vaccess_hash.write(to); + if (v.has_access_hash()) v.vaccess_hash.write(to); v.vtitle.write(to); if (v.has_username()) v.vusername.write(to); v.vphoto.write(to); @@ -25502,7 +25514,7 @@ inline uint32 MTPupdate::innerLength() const { } case mtpc_updateChannelTooLong: { const MTPDupdateChannelTooLong &v(c_updateChannelTooLong()); - return v.vchannel_id.innerLength(); + return v.vflags.innerLength() + v.vchannel_id.innerLength() + (v.has_pts() ? v.vpts.innerLength() : 0); } case mtpc_updateChannel: { const MTPDupdateChannel &v(c_updateChannel()); @@ -25761,7 +25773,9 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI case mtpc_updateChannelTooLong: _type = cons; { if (!data) setData(new MTPDupdateChannelTooLong()); MTPDupdateChannelTooLong &v(_updateChannelTooLong()); + v.vflags.read(from, end); v.vchannel_id.read(from, end); + if (v.has_pts()) { v.vpts.read(from, end); } else { v.vpts = MTPint(); } } break; case mtpc_updateChannel: _type = cons; { if (!data) setData(new MTPDupdateChannel()); @@ -26024,7 +26038,9 @@ inline void MTPupdate::write(mtpBuffer &to) const { } break; case mtpc_updateChannelTooLong: { const MTPDupdateChannelTooLong &v(c_updateChannelTooLong()); + v.vflags.write(to); v.vchannel_id.write(to); + if (v.has_pts()) v.vpts.write(to); } break; case mtpc_updateChannel: { const MTPDupdateChannel &v(c_updateChannel()); @@ -26326,8 +26342,8 @@ inline MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPi inline MTPupdate MTP_updateReadMessagesContents(const MTPVector &_messages, MTPint _pts, MTPint _pts_count) { return MTPupdate(new MTPDupdateReadMessagesContents(_messages, _pts, _pts_count)); } -inline MTPupdate MTP_updateChannelTooLong(MTPint _channel_id) { - return MTPupdate(new MTPDupdateChannelTooLong(_channel_id)); +inline MTPupdate MTP_updateChannelTooLong(MTPint _flags, MTPint _channel_id, MTPint _pts) { + return MTPupdate(new MTPDupdateChannelTooLong(_flags, _channel_id, _pts)); } inline MTPupdate MTP_updateChannel(MTPint _channel_id) { return MTPupdate(new MTPDupdateChannel(_channel_id)); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 5588272f79..15bb62e2b9 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -209,7 +209,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#9ba2d800 id:int = Chat; chat#d91cdd54 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true admins_enabled:flags.3?true admin:flags.4?true deactivated:flags.5?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel = Chat; chatForbidden#7328bdb id:int title:string = Chat; -channel#4b1b7506 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; +channel#a14dca52 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true democracy:flags.10?true signatures:flags.11?true min:flags.12?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?string = Chat; channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; @@ -369,7 +369,7 @@ updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Upd updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; updateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update; -updateChannelTooLong#60946422 channel_id:int = Update; +updateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update; updateChannel#b6d45656 channel_id:int = Update; updateChannelGroup#c36c1e3c channel_id:int group:MessageGroup = Update; updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 16ed4b4c04..2ce22da176 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -58,6 +58,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData , _invitationLink(this, qsl("telegram.me/joinchat/")) , _botSettings(this, lang(lng_profile_bot_settings)) , _botHelp(this, lang(lng_profile_bot_help)) +, _pinnedMessage(this, lang(lng_pinned_message)) , _username(this, (_peerChannel && _peerChannel->isPublic()) ? (qsl("telegram.me/") + _peerChannel->username) : lang(lng_profile_create_public_link)) , _members(this, lng_channel_members_link(lt_count, (_peerChannel && _peerChannel->count > 0) ? _peerChannel->count : 1)) , _admins(this, lng_channel_admins_link(lt_count, (_peerChannel ? (_peerChannel->adminsCount > 0 ? _peerChannel->adminsCount : 1) : ((_peerChat && _peerChat->adminsEnabled()) ? (_peerChat->admins.size() + 1) : 0)))) @@ -180,6 +181,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData connect(&_botSettings, SIGNAL(clicked()), this, SLOT(onBotSettings())); connect(&_botHelp, SIGNAL(clicked()), this, SLOT(onBotHelp())); + connect(&_pinnedMessage, SIGNAL(clicked()), this, SLOT(onPinnedMessage())); connect(App::app(), SIGNAL(peerPhotoDone(PeerId)), this, SLOT(onPhotoUpdateDone(PeerId))); connect(App::app(), SIGNAL(peerPhotoFail(PeerId)), this, SLOT(onPhotoUpdateFail(PeerId))); @@ -201,6 +203,7 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, PeerData _botSettings.hide(); _botHelp.hide(); } + updatePinnedMessageVisibility(); // migrate to megagroup connect(&_migrate, SIGNAL(clicked()), this, SLOT(onMigrate())); @@ -591,6 +594,14 @@ void ProfileInner::onBotHelp() { updateBotLinksVisibility(); } +void ProfileInner::onPinnedMessage() { + if (!_peerChannel || !_peerChannel->isMegagroup() || !_peerChannel->mgInfo->pinnedMsgId) { + updatePinnedMessageVisibility(); + return; + } + Ui::showPeerHistory(_peer, _peerChannel->mgInfo->pinnedMsgId); +} + void ProfileInner::peerUpdated(PeerData *data) { if (data == _peer) { PhotoData *photo = 0; @@ -614,6 +625,7 @@ void ProfileInner::peerUpdated(PeerData *data) { _members.setText(lng_channel_members_link(lt_count, (_peerChannel->count > 0) ? _peerChannel->count : 1)); _admins.setText(lng_channel_admins_link(lt_count, (_peerChannel->adminsCount > 0) ? _peerChannel->adminsCount : 1)); _onlineText = (_peerChannel->count > 0) ? lng_chat_status_members(lt_count, _peerChannel->count) : lang(_peerChannel->isMegagroup() ? lng_group_status : lng_channel_status); + updatePinnedMessageVisibility(); } _photoLink = (photo && photo->date) ? TextLinkPtr(new PhotoLink(photo, _peer)) : TextLinkPtr(); if (_peer->name != _nameCache) { @@ -1352,7 +1364,10 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { } _members.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + addbyname + st::profileStatusTop); addbyname += st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); - _admins.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + addbyname + st::profileStatusTop); + if (!_admins.isHidden()) { + _admins.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + addbyname + st::profileStatusTop); + addbyname += st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); + } if ((_peerChat && _amCreator && _peerChat->canEdit()) || (_peerChannel && (_amCreator || _peerChannel->amEditor() || _peerChannel->amModerator()))) { _cancelPhoto.move(_left + _width - _cancelPhoto.width(), top + st::profilePhotoSize - st::linkFont->height); } else { @@ -1360,6 +1375,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { _botSettings.move(_left + st::profilePhotoSize + st::profilePhoneLeft, top + st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent) + st::profilePhoneTop); _botHelp.move(_botSettings.x() + (_botSettings.isHidden() ? 0 : _botSettings.width() + st::profilePhoneLeft), _botSettings.y()); } + _pinnedMessage.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + addbyname + st::profileStatusTop); top += st::profilePhotoSize; top += st::profileButtonTop; @@ -1773,12 +1789,21 @@ void ProfileInner::updateInvitationLink() { } } +void ProfileInner::updatePinnedMessageVisibility() { + if (_peerChannel && _peerChannel->isMegagroup() && _peerChannel->mgInfo->pinnedMsgId && !_amCreator && !_peerChannel->amEditor()) { + _pinnedMessage.show(); + } else { + _pinnedMessage.hide(); + } +} + void ProfileInner::updateBotLinksVisibility() { if (!_peerUser || !_peerUser->botInfo || _peerUser->botInfo->commands.isEmpty()) { _botSettings.hide(); _botHelp.hide(); return; } + bool hasSettings = false, hasHelp = false; for (int32 i = 0, l = _peerUser->botInfo->commands.size(); i != l; ++i) { QString cmd = _peerUser->botInfo->commands.at(i).command; diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 4527d483d2..23b6fcd029 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -124,6 +124,7 @@ public slots: void onBotSettings(); void onBotHelp(); + void onPinnedMessage(); void onUpdateDelayed(); @@ -132,6 +133,7 @@ private: void showAll(); void updateInvitationLink(); void updateBotLinksVisibility(); + void updatePinnedMessageVisibility(); void chatInviteDone(const MTPExportedChatInvite &result); bool updateMediaLinks(int32 *addToScroll = 0); // returns if anything changed @@ -160,7 +162,7 @@ private: FlatButton _sendMessage, _shareContact, _inviteToGroup; LinkButton _cancelPhoto, _createInvitationLink, _invitationLink; QString _invitationText; - LinkButton _botSettings, _botHelp, _username, _members, _admins; + LinkButton _botSettings, _botHelp, _pinnedMessage, _username, _members, _admins; Text _about; int32 _aboutTop, _aboutHeight; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 68d6864ced..032d69a3f2 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -323,67 +323,6 @@ protected: QString translitRusEng(const QString &rus); QString rusKeyboardLayoutSwitch(const QString &from); -enum DataBlockId { - dbiKey = 0x00, - dbiUser = 0x01, - dbiDcOptionOld = 0x02, - dbiChatSizeMax = 0x03, - dbiMutePeer = 0x04, - dbiSendKey = 0x05, - dbiAutoStart = 0x06, - dbiStartMinimized = 0x07, - dbiSoundNotify = 0x08, - dbiWorkMode = 0x09, - dbiSeenTrayTooltip = 0x0a, - dbiDesktopNotify = 0x0b, - dbiAutoUpdate = 0x0c, - dbiLastUpdateCheck = 0x0d, - dbiWindowPosition = 0x0e, - dbiConnectionType = 0x0f, -// 0x10 reserved - dbiDefaultAttach = 0x11, - dbiCatsAndDogs = 0x12, - dbiReplaceEmojis = 0x13, - dbiAskDownloadPath = 0x14, - dbiDownloadPathOld = 0x15, - dbiScale = 0x16, - dbiEmojiTabOld = 0x17, - dbiRecentEmojisOld = 0x18, - dbiLoggedPhoneNumber = 0x19, - dbiMutedPeers = 0x1a, -// 0x1b reserved - dbiNotifyView = 0x1c, - dbiSendToMenu = 0x1d, - dbiCompressPastedImage = 0x1e, - dbiLang = 0x1f, - dbiLangFile = 0x20, - dbiTileBackground = 0x21, - dbiAutoLock = 0x22, - dbiDialogLastPath = 0x23, - dbiRecentEmojis = 0x24, - dbiEmojiVariants = 0x25, - dbiRecentStickers = 0x26, - dbiDcOption = 0x27, - dbiTryIPv6 = 0x28, - dbiSongVolume = 0x29, - dbiWindowsNotifications = 0x30, - dbiIncludeMuted = 0x31, - dbiMegagroupSizeMax = 0x32, - dbiDownloadPath = 0x33, - dbiAutoDownload = 0x34, - dbiSavedGifsLimit = 0x35, - dbiShowingSavedGifs = 0x36, - dbiAutoPlay = 0x37, - dbiAdaptiveForWide = 0x38, - - dbiEncryptedWithSalt = 333, - dbiEncrypted = 444, - - // 500-600 reserved - - dbiVersion = 666, -}; - enum DBISendKey { dbiskEnter = 0, dbiskCtrlEnter = 1, @@ -815,6 +754,15 @@ private: }; +template +class SharedCallback2 { +public: + virtual R call(A1 channel, A2 msgId) const = 0; + virtual ~SharedCallback2() { + } + typedef QSharedPointer > Ptr; +}; + template class FunctionImplementation { public: From 98e270076485c2efb8396701f9b476298c3de5cb Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 10 Mar 2016 18:42:01 +0300 Subject: [PATCH 166/316] rich delete all + ban almost done in supergroups (need to clear messages on the client side as well) --- Telegram/Resources/lang.strings | 2 + Telegram/SourceFiles/apiwrap.cpp | 6 +- Telegram/SourceFiles/app.cpp | 8 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 172 +++++++++++++++++++++ Telegram/SourceFiles/boxes/confirmbox.h | 44 +++++- Telegram/SourceFiles/boxes/contactsbox.cpp | 12 +- Telegram/SourceFiles/history.cpp | 17 +- Telegram/SourceFiles/historywidget.cpp | 3 + Telegram/SourceFiles/mainwidget.cpp | 9 ++ Telegram/SourceFiles/profilewidget.cpp | 16 ++ Telegram/SourceFiles/structs.h | 12 +- 11 files changed, 279 insertions(+), 22 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 07d99da2dd..268ce1880e 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -668,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_ban_user" = "Ban User"; +"lng_delete_all_from" = "Delete all from this user"; "lng_report_spam" = "Report Spam"; "lng_report_spam_hide" = "Hide"; "lng_report_spam_thanks" = "Thank you for your report!"; diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 3f1ded1739..3eecaf9eed 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -512,7 +512,7 @@ void ApiWrap::lastParticipantsDone(ChannelData *peer, const MTPchannels_ChannelP UserData *u = App::user(userId); if (bots) { if (u->botInfo) { - peer->mgInfo->bots.insert(u, true); + peer->mgInfo->bots.insert(u); botStatus = 2;// (botStatus > 0/* || !i.key()->botInfo->readsAllHistory*/) ? 2 : 1; if (!u->botInfo->inited) { needBotsInfos = true; @@ -524,9 +524,9 @@ void ApiWrap::lastParticipantsDone(ChannelData *peer, const MTPchannels_ChannelP } else { if (peer->mgInfo->lastParticipants.indexOf(u) < 0) { peer->mgInfo->lastParticipants.push_back(u); - if (admin) peer->mgInfo->lastAdmins.insert(u, true); + if (admin) peer->mgInfo->lastAdmins.insert(u); if (u->botInfo) { - peer->mgInfo->bots.insert(u, true); + peer->mgInfo->bots.insert(u); if (peer->mgInfo->botStatus != 0 && peer->mgInfo->botStatus < 2) { peer->mgInfo->botStatus = 2; } diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 5543956a54..9426a3e822 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -664,10 +664,10 @@ namespace App { if (user) { chat->participants[user] = pversion; if (inviter == MTP::authedId()) { - chat->invitedByMe[user] = true; + chat->invitedByMe.insert(user); } if (i->type() == mtpc_chatParticipantAdmin) { - chat->admins[user] = true; + chat->admins.insert(user); if (user->isSelf()) { chat->flags |= MTPDchat::flag_admin; } @@ -736,7 +736,7 @@ namespace App { } else if (chat->participants.find(user) == chat->participants.end()) { chat->participants[user] = (chat->participants.isEmpty() ? 1 : chat->participants.begin().value()); if (d.vinviter_id.v == MTP::authedId()) { - chat->invitedByMe[user] = true; + chat->invitedByMe.insert(user); } else { chat->invitedByMe.remove(user); } @@ -876,7 +876,7 @@ namespace App { if (chat->noParticipantInfo()) { App::api()->requestFullPeer(chat); } else { - chat->admins.insert(user, true); + chat->admins.insert(user); } } else { if (user->isSelf()) { diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index fc0eb42370..79cb4efca8 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -434,3 +434,175 @@ bool PinMessageBox::pinFail(const RPCError &error) { Ui::hideLayer(); return true; } + +RichDeleteMessageBox::RichDeleteMessageBox(ChannelData *channel, UserData *from, MsgId msgId) : AbstractBox(st::boxWidth) +, _channel(channel) +, _from(from) +, _msgId(msgId) +, _text(this, lang(lng_selected_delete_sure_this), st::boxLabel) +, _banUser(this, lang(lng_ban_user), false) +, _reportSpam(this, lang(lng_report_spam), false) +, _deleteAll(this, lang(lng_delete_all_from), false) +, _delete(this, lang(lng_box_delete), st::defaultBoxButton) +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) +, _deleteRequestId(0) +, _banRequestId(0) +, _reportRequestId(0) +, _deleteAllRequestId(0) { + _text.resizeToWidth(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()); + setMaxHeight(st::boxPadding.top() + _text.height() + st::boxMediumSkip + _banUser.height() + st::boxLittleSkip + _reportSpam.height() + st::boxLittleSkip + _deleteAll.height() + st::boxPadding.bottom() + st::boxButtonPadding.top() + _delete.height() + st::boxButtonPadding.bottom()); + + connect(&_delete, SIGNAL(clicked()), this, SLOT(onDelete())); + connect(&_cancel, SIGNAL(clicked()), this, SLOT(onClose())); +} + +void RichDeleteMessageBox::resizeEvent(QResizeEvent *e) { + _text.moveToLeft(st::boxPadding.left(), st::boxPadding.top()); + _banUser.moveToLeft(st::boxPadding.left(), _text.y() + _text.height() + st::boxMediumSkip); + _reportSpam.moveToLeft(st::boxPadding.left(), _banUser.y() + _banUser.height() + st::boxLittleSkip); + _deleteAll.moveToLeft(st::boxPadding.left(), _reportSpam.y() + _reportSpam.height() + st::boxLittleSkip); + _delete.moveToRight(st::boxButtonPadding.right(), height() - st::boxButtonPadding.bottom() - _delete.height()); + _cancel.moveToRight(st::boxButtonPadding.right() + _delete.width() + st::boxButtonPadding.left(), _delete.y()); +} + +void RichDeleteMessageBox::onDelete() { + if (_deleteRequestId || _banRequestId || _reportRequestId || _deleteAllRequestId) return; + + HistoryItem *item = App::histItemById(_channel ? peerToChannel(_channel->id) : 0, _msgId); + if (!item || item->type() != HistoryItemMsg) { + Ui::hideLayer(); + return; + } + + QVector toDelete(1, MTP_int(item->id)); + History *h = item->history(); + bool wasOnServer = (item->id > 0), wasLast = (h->lastMsg == item); + bool banUser = _banUser.checked(), reportSpam = _reportSpam.checked(), deleteAll = _deleteAll.checked(); + + item->destroy(); + if (!wasOnServer && wasLast && !h->lastMsg) { + App::main()->checkPeerHistory(h->peer); + } + + Notify::historyItemsResized(); + if (wasOnServer) { + _deleteRequestId = MTP::send(MTPchannels_DeleteMessages(_channel->inputChannel, MTP_vector(1, MTP_int(item->id))), rpcDone(&RichDeleteMessageBox::deleteDone), rpcFail(&RichDeleteMessageBox::deleteFail)); + } + if (banUser) { + _banRequestId = MTP::send(MTPchannels_KickFromChannel(_channel->inputChannel, _from->inputUser, MTP_boolTrue()), rpcDone(&RichDeleteMessageBox::banDone), rpcFail(&RichDeleteMessageBox::deleteFail)); + } + if (reportSpam) { + _reportRequestId = MTP::send(MTPchannels_ReportSpam(_channel->inputChannel, _from->inputUser, MTP_vector(1, MTP_int(item->id))), rpcDone(&RichDeleteMessageBox::reportDone), rpcFail(&RichDeleteMessageBox::deleteFail)); + } + if (deleteAll) { + _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); + } +} + +void RichDeleteMessageBox::showAll() { + _text.show(); + _banUser.show(); + _reportSpam.show(); + _deleteAll.show(); + _delete.show(); + _cancel.show(); +} + +void RichDeleteMessageBox::hideAll() { + _text.hide(); + _banUser.hide(); + _reportSpam.hide(); + _deleteAll.hide(); + _delete.hide(); + _cancel.hide(); +} + +void RichDeleteMessageBox::deleteDone(const MTPmessages_AffectedMessages &result, mtpRequestId req) { + const MTPDmessages_affectedMessages &d(result.c_messages_affectedMessages()); + if (_channel->ptsUpdated(d.vpts.v, d.vpts_count.v)) { + _channel->ptsApplySkippedUpdates(); + App::emitPeerUpdated(); + } + if (History *h = App::historyLoaded(_channel->id)) { + if (!h->lastMsg && App::main()) { + App::main()->checkPeerHistory(_channel); + } + } + if (req == _deleteRequestId) { + _deleteRequestId = 0; + } else if (req == _banRequestId) { + _banRequestId = 0; + } else if (req == _reportRequestId) { + _reportRequestId = 0; + } else if (req == _deleteAllRequestId) { + _deleteAllRequestId = 0; + } + checkFinished(); +} + +void RichDeleteMessageBox::banDone(const MTPUpdates &result, mtpRequestId req) { + if (App::main()) { + App::main()->sentUpdatesReceived(result); + } + if (req == _banRequestId) { + _banRequestId = 0; + } + checkFinished(); +} + +void RichDeleteMessageBox::reportDone(const MTPBool &result, mtpRequestId req) { + if (req == _reportRequestId) { + _reportRequestId = 0; + } + checkFinished(); +} + +void RichDeleteMessageBox::deleteAllPart(const MTPmessages_AffectedHistory &result, mtpRequestId req) { + const MTPDmessages_affectedHistory &d(result.c_messages_affectedHistory()); + if (_channel->ptsUpdated(d.vpts.v, d.vpts_count.v)) { + _channel->ptsApplySkippedUpdates(); + App::emitPeerUpdated(); + } + if (req == _deleteRequestId) { + _deleteRequestId = 0; + } else if (req == _banRequestId) { + _banRequestId = 0; + } else if (req == _reportRequestId) { + _reportRequestId = 0; + } else if (req == _deleteAllRequestId) { + _deleteAllRequestId = 0; + } + + int32 offset = d.voffset.v; + if (offset <= 0) { + if (History *h = App::historyLoaded(_channel->id)) { + if (!h->lastMsg && App::main()) { + App::main()->checkPeerHistory(_channel); + } + } + checkFinished(); + return; + } + + _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); +} + +bool RichDeleteMessageBox::deleteFail(const RPCError &error, mtpRequestId req) { + if (mtpIsFlood(error)) return false; + if (req == _deleteRequestId) { + _deleteRequestId = 0; + } else if (req == _banRequestId) { + _banRequestId = 0; + } else if (req == _reportRequestId) { + _reportRequestId = 0; + } else if (req == _deleteAllRequestId) { + _deleteAllRequestId = 0; + } + checkFinished(); + return true; +} + +void RichDeleteMessageBox::checkFinished() { + if (_deleteRequestId || _banRequestId || _reportRequestId || _deleteAllRequestId) return; + Ui::hideLayer(); +} \ No newline at end of file diff --git a/Telegram/SourceFiles/boxes/confirmbox.h b/Telegram/SourceFiles/boxes/confirmbox.h index b2b1d2e989..6937b2c107 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.h +++ b/Telegram/SourceFiles/boxes/confirmbox.h @@ -198,4 +198,46 @@ private: mtpRequestId _requestId; -}; \ No newline at end of file +}; + +class RichDeleteMessageBox : public AbstractBox, public RPCSender { + Q_OBJECT + +public: + + RichDeleteMessageBox(ChannelData *channel, UserData *from, MsgId msgId); + + void resizeEvent(QResizeEvent *e); + +public slots: + + void onDelete(); + +protected: + + void showAll(); + void hideAll(); + +private: + + void deleteDone(const MTPmessages_AffectedMessages &result, mtpRequestId req); + void banDone(const MTPUpdates &result, mtpRequestId req); + void reportDone(const MTPBool &result, mtpRequestId req); + void deleteAllPart(const MTPmessages_AffectedHistory &result, mtpRequestId req); + + bool deleteFail(const RPCError &error, mtpRequestId req); + + void checkFinished(); + + ChannelData *_channel; + UserData *_from; + MsgId _msgId; + + FlatLabel _text; + Checkbox _banUser, _reportSpam, _deleteAll; + + BoxButton _delete, _cancel; + + mtpRequestId _deleteRequestId, _banRequestId, _reportRequestId, _deleteAllRequestId; + +}; diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 80eca99357..ebaf4018e8 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1669,7 +1669,7 @@ void ContactsBox::setAdminDone(UserData *user, const MTPBool &result) { if (_inner.chat()->noParticipantInfo()) { App::api()->requestFullPeer(_inner.chat()); } else { - _inner.chat()->admins.insert(user, true); + _inner.chat()->admins.insert(user); } } --_saveRequestId; @@ -2182,6 +2182,16 @@ void MembersInner::membersReceived(const MTPchannels_ChannelParticipants &result _datas.push_back(0); } } + + // update admins if we got all of them + if (_filter == MembersFilterAdmins && _channel->isMegagroup() && _rows.size() < Global::ChatSizeMax()) { + _channel->mgInfo->lastAdmins.clear(); + for (int32 i = 0, l = _rows.size(); i != l; ++i) { + if (_roles.at(i) == MemberRoleCreator || _roles.at(i) == MemberRoleEditor) { + _channel->mgInfo->lastAdmins.insert(_rows.at(i)); + } + } + } } if (_rows.isEmpty()) { _rows.push_back(App::self()); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 25442fe91b..46a42e4387 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1409,7 +1409,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo peer->asChannel()->mgInfo->lastParticipantsStatus |= MegagroupInfo::LastParticipantsAdminsOutdated; } if (user->botInfo) { - peer->asChannel()->mgInfo->bots.insert(user, true); + peer->asChannel()->mgInfo->bots.insert(user); if (peer->asChannel()->mgInfo->botStatus != 0 && peer->asChannel()->mgInfo->botStatus < 2) { peer->asChannel()->mgInfo->botStatus = 2; } @@ -1427,7 +1427,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo peer->asChannel()->mgInfo->lastParticipants.push_front(result->from()->asUser()); } if (result->from()->asUser()->botInfo) { - peer->asChannel()->mgInfo->bots.insert(result->from()->asUser(), true); + peer->asChannel()->mgInfo->bots.insert(result->from()->asUser()); if (peer->asChannel()->mgInfo->botStatus != 0 && peer->asChannel()->mgInfo->botStatus < 2) { peer->asChannel()->mgInfo->botStatus = 2; } @@ -1742,7 +1742,7 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a } else if (peer->isMegagroup()) { lastAuthors = &peer->asChannel()->mgInfo->lastParticipants; if (adding->from()->asUser()->botInfo) { - peer->asChannel()->mgInfo->bots.insert(adding->from()->asUser(), true); + peer->asChannel()->mgInfo->bots.insert(adding->from()->asUser()); if (peer->asChannel()->mgInfo->botStatus != 0 && peer->asChannel()->mgInfo->botStatus < 2) { peer->asChannel()->mgInfo->botStatus = 2; } @@ -1763,14 +1763,14 @@ 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()) { - QMap *markupSenders = 0; + OrderedSet *markupSenders = 0; if (peer->isChat()) { markupSenders = &peer->asChat()->markupSenders; } else if (peer->isMegagroup()) { markupSenders = &peer->asChannel()->mgInfo->markupSenders; } if (markupSenders) { - markupSenders->insert(adding->from(), true); + markupSenders->insert(adding->from()); } if (markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO) { // zero markup means replyKeyboardHide if (lastKeyboardFrom == adding->from()->id || (!lastKeyboardInited && !peer->isChat() && !peer->isMegagroup() && !adding->out())) { @@ -1977,7 +1977,7 @@ void History::addOlderSlice(const QVector &slice, const QVector *lastAuthors = 0; - QMap *markupSenders = 0; + OrderedSet *markupSenders = 0; if (peer->isChat()) { lastAuthors = &peer->asChat()->lastAuthors; markupSenders = &peer->asChat()->markupSenders; @@ -2007,7 +2007,7 @@ void History::addOlderSlice(const QVector &slice, const QVectormentionsMe()) { bool wasKeyboardHide = markupSenders->contains(item->author()); if (!wasKeyboardHide) { - markupSenders->insert(item->author(), true); + markupSenders->insert(item->author()); } if (!(markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO)) { if (!lastKeyboardInited) { @@ -2931,6 +2931,9 @@ void HistoryItem::destroy() { detach(); if (history()->isChannel()) { history()->asChannelHistory()->messageDeleted(this); + if (history()->peer->isMegagroup() && history()->peer->asChannel()->mgInfo->pinnedMsgId == id) { + history()->peer->asChannel()->mgInfo->pinnedMsgId = 0; + } } if (history()->lastMsg == this) { history()->fixLastMessage(wasAtBottom); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 57b6a2493d..f41f80d01a 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6258,6 +6258,9 @@ void HistoryWidget::itemRemoved(HistoryItem *item) { if (item == _replyReturn) { calcNextReplyReturn(); } + if (_pinnedBar && item->id == _pinnedBar->msgId) { + pinnedMsgVisibilityUpdated(); + } if (_kbReplyTo && item == _kbReplyTo) { onKbToggle(); _kbReplyTo = 0; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index e8854ebc3b..be48886d13 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -907,6 +907,15 @@ void MainWidget::forwardLayer(int32 forwardSelected) { } void MainWidget::deleteLayer(int32 selectedCount) { + if (selectedCount == -1 && !overview) { + if (HistoryItem *item = App::contextItem()) { + ChannelData *channel = item->history()->peer->asChannel(); + if (channel && !item->isPost() && !item->out() && item->from()->isUser() && (channel->amCreator() || channel->amEditor())) { + Ui::showLayer(new RichDeleteMessageBox(channel, item->from()->asUser(), item->id)); + return; + } + } + } QString str((selectedCount < 0) ? lang(selectedCount < -1 ? lng_selected_cancel_sure_this : lng_selected_delete_sure_this) : lng_selected_delete_sure(lt_count, selectedCount)); QString btn(lang((selectedCount < -1) ? lng_selected_upload_stop : lng_box_delete)), cancel(lang((selectedCount < -1) ? lng_continue : lng_cancel)); ConfirmBox *box = new ConfirmBox(str, btn, st::defaultBoxButton, cancel); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 2ce22da176..08e49d6ba9 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -992,6 +992,22 @@ void ProfileInner::paintEvent(QPaintEvent *e) { int32 partfrom = top; if (!_participants.isEmpty()) { + if (App::self()) { + if (_peerChat) { + if (_peerChat->amAdmin() && _peerChat->admins.constFind(App::self()) == _peerChat->admins.cend()) { + _peerChat->admins.insert(App::self()); + } else if (!_peerChat->amAdmin() && _peerChat->admins.constFind(App::self()) != _peerChat->admins.cend()) { + _peerChat->admins.remove(App::self()); + } + } else if (_peerChannel && _peerChannel->isMegagroup()) { + if ((_peerChannel->amCreator() || _peerChannel->amEditor()) && _peerChannel->mgInfo->lastAdmins.constFind(App::self()) == _peerChannel->mgInfo->lastAdmins.cend()) { + _peerChannel->mgInfo->lastAdmins.insert(App::self()); + } else if (!_peerChannel->amCreator() && !_peerChannel->amEditor() && _peerChannel->mgInfo->lastAdmins.constFind(App::self()) != _peerChannel->mgInfo->lastAdmins.cend()) { + _peerChannel->mgInfo->lastAdmins.remove(App::self()); + } + } + } + int32 cnt = 0, fullCnt = _participants.size(); for (Participants::const_iterator i = _participants.cbegin(), e = _participants.cend(); i != e; ++i, ++cnt) { int32 top = partfrom + cnt * _pHeight; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 7d73b7c60e..f03d57fe60 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -457,13 +457,13 @@ public: } typedef QMap Participants; Participants participants; - typedef QMap InvitedByMe; + typedef OrderedSet InvitedByMe; InvitedByMe invitedByMe; - typedef QMap Admins; + typedef OrderedSet Admins; Admins admins; typedef QList LastAuthors; LastAuthors lastAuthors; - typedef QMap MarkupSenders; + typedef OrderedSet MarkupSenders; MarkupSenders markupSenders; int32 botStatus; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other // ImagePtr photoFull; @@ -542,11 +542,11 @@ struct MegagroupInfo { } typedef QList LastParticipants; LastParticipants lastParticipants; - typedef QMap LastAdmins; + typedef OrderedSet LastAdmins; LastAdmins lastAdmins; - typedef QMap MarkupSenders; + typedef OrderedSet MarkupSenders; MarkupSenders markupSenders; - typedef QMap Bots; + typedef OrderedSet Bots; Bots bots; int32 botStatus; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other From b402d832f6a5617f7a76ab85166ffaf0b9d7df67 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 14:13:28 +0300 Subject: [PATCH 167/316] deleting all messages by from on client side --- Telegram/SourceFiles/boxes/confirmbox.cpp | 47 +++++++++++++++-------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index 79cb4efca8..9c22e5e5d2 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -476,16 +476,11 @@ void RichDeleteMessageBox::onDelete() { QVector toDelete(1, MTP_int(item->id)); History *h = item->history(); - bool wasOnServer = (item->id > 0), wasLast = (h->lastMsg == item); + bool deleteItem = (item->id > 0), lastDeleted = (h->lastMsg == item); bool banUser = _banUser.checked(), reportSpam = _reportSpam.checked(), deleteAll = _deleteAll.checked(); item->destroy(); - if (!wasOnServer && wasLast && !h->lastMsg) { - App::main()->checkPeerHistory(h->peer); - } - - Notify::historyItemsResized(); - if (wasOnServer) { + if (deleteItem) { _deleteRequestId = MTP::send(MTPchannels_DeleteMessages(_channel->inputChannel, MTP_vector(1, MTP_int(item->id))), rpcDone(&RichDeleteMessageBox::deleteDone), rpcFail(&RichDeleteMessageBox::deleteFail)); } if (banUser) { @@ -495,8 +490,30 @@ void RichDeleteMessageBox::onDelete() { _reportRequestId = MTP::send(MTPchannels_ReportSpam(_channel->inputChannel, _from->inputUser, MTP_vector(1, MTP_int(item->id))), rpcDone(&RichDeleteMessageBox::reportDone), rpcFail(&RichDeleteMessageBox::deleteFail)); } if (deleteAll) { + QVector toDestroy; + for (History::Blocks::const_iterator i = h->blocks.cbegin(), e = h->blocks.cend(); i != e; ++i) { + for (HistoryBlock::Items::const_iterator j = (*i)->items.cbegin(), n = (*i)->items.cend(); j != n; ++j) { + if ((*j)->from() == _from && (*j)->type() == HistoryItemMsg) { + toDestroy.push_back((*j)->id); + } + } + } + for (QVector::const_iterator i = toDestroy.cbegin(), e = toDestroy.cend(); i != e; ++i) { + if (HistoryItem *item = App::histItemById(peerToChannel(_channel->id), *i)) { + if (item == h->lastMsg) { + lastDeleted = true; + } + item->destroy(); + } + } _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); } + + if (!deleteItem && !deleteAll && lastDeleted && !h->lastMsg) { + App::main()->checkPeerHistory(h->peer); + } + + Notify::historyItemsResized(); } void RichDeleteMessageBox::showAll() { @@ -574,17 +591,17 @@ void RichDeleteMessageBox::deleteAllPart(const MTPmessages_AffectedHistory &resu } int32 offset = d.voffset.v; - if (offset <= 0) { - if (History *h = App::historyLoaded(_channel->id)) { - if (!h->lastMsg && App::main()) { - App::main()->checkPeerHistory(_channel); - } - } - checkFinished(); + if (offset > 0) { + _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); return; } - _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); + if (History *h = App::historyLoaded(_channel->id)) { + if (!h->lastMsg && App::main()) { + App::main()->checkPeerHistory(_channel); + } + } + checkFinished(); } bool RichDeleteMessageBox::deleteFail(const RPCError &error, mtpRequestId req) { From c36fc9204168d9a9ba98dc52b2c02d5087920997 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 14:14:55 +0300 Subject: [PATCH 168/316] _music -> _audio in pinned messages langpack --- Telegram/Resources/lang.strings | 2 +- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/langs/lang_de.strings | 39 ++++++- Telegram/SourceFiles/langs/lang_es.strings | 37 +++++- Telegram/SourceFiles/langs/lang_it.strings | 61 +++++++--- Telegram/SourceFiles/langs/lang_ko.strings | 35 ++++++ Telegram/SourceFiles/langs/lang_nl.strings | 107 ++++++++++++------ Telegram/SourceFiles/langs/lang_pt_BR.strings | 35 ++++++ 8 files changed, 264 insertions(+), 54 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 268ce1880e..4093e5ab1c 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -543,7 +543,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_pinned_media" = "{from} pinned {media}"; "lng_action_pinned_media_photo" = "a photo"; "lng_action_pinned_media_video" = "a video file"; -"lng_action_pinned_media_music" = "a music file"; +"lng_action_pinned_media_audio" = "an audio file"; "lng_action_pinned_media_voice" = "a voice message"; "lng_action_pinned_media_file" = "a file"; "lng_action_pinned_media_gif" = "a GIF animation"; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 46a42e4387..74746cf757 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7568,7 +7568,7 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { case MediaTypeGif: mediaText = lang(lng_action_pinned_media_gif); break; case MediaTypeSticker: mediaText = lang(lng_action_pinned_media_sticker); break; case MediaTypeLocation: mediaText = lang(lng_action_pinned_media_location); break; - case MediaTypeMusicFile: mediaText = lang(lng_action_pinned_media_music); break; + case MediaTypeMusicFile: mediaText = lang(lng_action_pinned_media_audio); break; case MediaTypeVoiceFile: mediaText = lang(lng_action_pinned_media_voice); break; } if (mediaText.isEmpty()) { diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index af025585cc..b9c34e3d3c 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Neuer Text.."; "lng_deleted" = "Gelöschter Kontakt"; "lng_deleted_message" = "Gelöschte Nachricht"; +"lng_pinned_message" = "Angeheftete Nachricht"; +"lng_pinned_unpin_sure" = "Angeheftete Nachricht wieder entfernen?"; +"lng_pinned_pin_sure" = "Möchtest du diese Nachricht anheften?"; +"lng_pinned_pin" = "Anheften"; +"lng_pinned_unpin" = "Entfernen"; +"lng_pinned_notify" = "Alle benachrichtigen"; "lng_intro" = "Willkommen beim [a href=\"https://telegram.org/\"]offiziellen Desktop Messenger[/a].\n[b]Schnell[/b] und [b]sicher[/b] chatten leicht gemacht."; "lng_start_msgs" = "JETZT STARTEN"; @@ -410,7 +416,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_edit_contact" = "Bearbeiten"; "lng_profile_enable_notifications" = "Benachrichtigungen"; "lng_profile_clear_history" = "Chatverlauf löschen"; -"lng_profile_delete_conversation" = "Chat entfernen"; +"lng_profile_delete_conversation" = "Chat löschen"; "lng_profile_clear_and_exit" = "Löschen und verlassen"; "lng_profile_leave_channel" = "Kanal verlassen"; "lng_profile_delete_channel" = "Kanal löschen"; @@ -429,6 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Neues Mitglied"; "lng_profile_delete_and_exit" = "Verlassen"; "lng_profile_kick" = "Entfernen"; +"lng_profile_admin" = "Admin"; "lng_profile_sure_kick" = "{user} aus der Gruppe entfernen?"; "lng_profile_sure_kick_channel" = "{user} aus dem Kanal entfernen?"; "lng_profile_sure_kick_admin" = "{user} als Administrator entfernen?"; @@ -476,6 +483,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_channel_about" = "Jeder kann deinen Kanal finden und beitreten"; "lng_create_private_channel_title" = "Privater Kanal"; "lng_create_private_channel_about" = "Man kann nur per Einladungslink deinem Kanal beitreten"; +"lng_create_public_group_title" = "Öffentliche Gruppe"; +"lng_create_public_group_about" = "Öffentliche Gruppen kann jeder über die Suche finden, gesamter Chatverlauf ist für alle einsehbar und jeder kann der Gruppe beitreten"; +"lng_create_private_group_title" = "Private Gruppe"; +"lng_create_private_group_about" = "Nur eingeladene Nutzer können die Gruppe betreten und den gesamten Chatverlauf einsehen"; "lng_create_channel_comments" = "Kommentare aktivieren"; "lng_create_channel_comments_about" = "Wenn du Kommentare aktivierst, können sich alle an der Diskussion beteiligen"; "lng_create_group_skip" = "Überspringen"; @@ -528,6 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} hat die Gruppe «{title}» erstellt"; "lng_action_created_channel" = "Kanal «{title}» erstellt"; "lng_action_group_migrate" = "Gruppe wurde in eine Supergruppe geändert"; +"lng_action_pinned_message" = "{from} hat «{text}» angeheftet"; +"lng_action_pinned_media" = "{from} hat {media} angeheftet"; +"lng_action_pinned_media_photo" = "ein Bild"; +"lng_action_pinned_media_video" = "ein Video"; +"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_voice" = "eine Sprachnachricht"; +"lng_action_pinned_media_file" = "eine Datei"; +"lng_action_pinned_media_gif" = "ein GIF"; +"lng_action_pinned_media_contact" = "einen Kontakt"; +"lng_action_pinned_media_location" = "einen Standort"; +"lng_action_pinned_media_sticker" = "einen Sticker"; "lng_profile_migrate_reached" = "Limit von {count:_not_used_|# Mitglied|# Mitgliedern} erreicht"; "lng_profile_migrate_about" = "Für weitere Funktionen und um das Limit aufzuheben in Supergruppe ändern:"; @@ -537,6 +559,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— Mitteilungen sind standardmäßig stumm"; "lng_profile_migrate_button" = "In Supergruppe ändern"; "lng_profile_migrate_sure" = "Wirklich diese Gruppe in eine Supergruppe ändern? Das kann nicht rückgängig gemacht werden."; +"lng_profile_convert_button" = "In Supergruppe ändern"; +"lng_profile_convert_title" = "In Supergruppe ändern"; +"lng_profile_convert_about" = "Supergruppen:"; +"lng_profile_convert_feature1" = "— Neue Mitglieder sehen gesamten Nachrichtenverlauf"; +"lng_profile_convert_feature2" = "— Gelöschte Nachrichten verschwinden für alle Mitglieder"; +"lng_profile_convert_feature3" = "— Mitglieder können eigene Nachrichten nachträglich bearbeiten"; +"lng_profile_convert_feature4" = "— Gruppenersteller kann die Gruppe öffentlich machen"; +"lng_profile_convert_warning" = "{bold_start}Wichtig:{bold_end} Die Änderung in eine Supergruppe kann nicht rückgängig gemacht werden."; +"lng_profile_convert_confirm" = "Ändern"; "lng_channel_comments_count" = "{count:_not_used_|# Kommentar|# Kommentare} »"; "lng_channel_hide_comments" = "Kommentare verstecken"; @@ -637,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (Sticker)"; +"lng_ban_user" = "Nutzer sperren"; +"lng_delete_all_from" = "Alles von diesem Nutzer löschen"; "lng_report_spam" = "Spam melden"; "lng_report_spam_hide" = "Schließen"; "lng_report_spam_thanks" = "Danke!"; @@ -717,7 +750,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_channel" = "Kanalinfo anzeigen"; "lng_context_copy_link" = "Link kopieren"; -"lng_context_copy_post_link" = "Link kopieren"; +"lng_context_copy_post_link" = "Nachrichtenlink kopieren"; "lng_context_copy_email" = "E-Mail-Adresse kopieren"; "lng_context_copy_hashtag" = "Hashtag kopieren"; "lng_context_copy_mention" = "Benutzername kopieren"; @@ -745,6 +778,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Nachricht weiterleiten"; "lng_context_delete_msg" = "Nachricht löschen"; "lng_context_select_msg" = "Nachricht auswählen"; +"lng_context_pin_msg" = "Nachricht anheften"; +"lng_context_unpin_msg" = "Nachricht entfernen"; "lng_context_cancel_upload" = "Upload abbrechen"; "lng_context_copy_selected" = "Text kopieren"; "lng_context_forward_selected" = "Auswahl weiterleiten"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 6c43144dc0..bbaada893d 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Nuevo texto..."; "lng_deleted" = "Desconocido"; "lng_deleted_message" = "Mensaje eliminado"; +"lng_pinned_message" = "Pinned message"; +"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; +"lng_pinned_pin_sure" = "Would you like to pin this message?"; +"lng_pinned_pin" = "Pin"; +"lng_pinned_unpin" = "Unpin"; +"lng_pinned_notify" = "Notify all members"; "lng_intro" = "La app oficial para PC de [a href=\"https://telegram.org/\"]Telegram[/a].\nEs [b]rápida[/b] y [b]segura[/b]."; "lng_start_msgs" = "EMPEZAR A CONVERSAR"; @@ -429,6 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Añadir miembros"; "lng_profile_delete_and_exit" = "Dejar grupo"; "lng_profile_kick" = "Eliminar"; +"lng_profile_admin" = "admin"; "lng_profile_sure_kick" = "¿Eliminar a {user} del grupo?"; "lng_profile_sure_kick_channel" = "¿Eliminar a {user} del canal?"; "lng_profile_sure_kick_admin" = "¿Eliminar a {user} de los administradores?"; @@ -476,6 +483,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_channel_about" = "Cualquiera puede encontrar el canal en la búsqueda y unirse"; "lng_create_private_channel_title" = "Canal privado"; "lng_create_private_channel_about" = "Sólo las personas con el enlace de invitación especial podrán unirse"; +"lng_create_public_group_title" = "Public Group"; +"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; +"lng_create_private_group_title" = "Private Group"; +"lng_create_private_group_about" = "Only invited people may join and see the chat history"; "lng_create_channel_comments" = "Activar comentarios"; "lng_create_channel_comments_about" = "Si activas los comentarios, las personas podrán hablar de tus mensajes en el canal"; "lng_create_group_skip" = "Omitir"; @@ -528,6 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} creó el grupo «{title}»"; "lng_action_created_channel" = "Se creó el canal «{title}»"; "lng_action_group_migrate" = "Este grupo fue convertido en un supergrupo"; +"lng_action_pinned_message" = "{from} pinned «{text}»"; +"lng_action_pinned_media" = "{from} pinned {media}"; +"lng_action_pinned_media_photo" = "a photo"; +"lng_action_pinned_media_video" = "a video file"; +"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_voice" = "a voice message"; +"lng_action_pinned_media_file" = "a file"; +"lng_action_pinned_media_gif" = "a GIF animation"; +"lng_action_pinned_media_contact" = "a contact information"; +"lng_action_pinned_media_location" = "a location mark"; +"lng_action_pinned_media_sticker" = "a sticker"; "lng_profile_migrate_reached" = "Límite de {count:_not_used_|# miembro|# miembros} alcanzado"; "lng_profile_migrate_about" = "Para superar el límite y tener características adicionales, conviértelo en un supergrupo:"; @@ -537,6 +559,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "– Notificaciones silenciadas por defecto"; "lng_profile_migrate_button" = "Convertir en supergrupo"; "lng_profile_migrate_sure" = "¿Quieres convertir este grupo en un supergrupo? No puedes deshacer esta acción."; +"lng_profile_convert_button" = "Convert to supergroup"; +"lng_profile_convert_title" = "Convert to supergroup"; +"lng_profile_convert_about" = "In supergroups:"; +"lng_profile_convert_feature1" = "— New members see the full message history"; +"lng_profile_convert_feature2" = "— Messages are deleted for all members"; +"lng_profile_convert_feature3" = "— Members can edit their own messages"; +"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; +"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; +"lng_profile_convert_confirm" = "Convert"; "lng_channel_comments_count" = "{count:_not_used_|# comentario|# comentarios}"; "lng_channel_hide_comments" = "Ocultar comentarios"; @@ -637,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_ban_user" = "Ban User"; +"lng_delete_all_from" = "Delete all from this user"; "lng_report_spam" = "Reportar spam"; "lng_report_spam_hide" = "Ocultar"; "lng_report_spam_thanks" = "¡Gracias por tu reporte!"; @@ -717,7 +750,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_channel" = "Ver información"; "lng_context_copy_link" = "Copiar enlace"; -"lng_context_copy_post_link" = "Copiar enlace"; +"lng_context_copy_post_link" = "Copiar enlace de la publicación"; "lng_context_copy_email" = "Copiar dirección de correo electrónico"; "lng_context_copy_hashtag" = "Copiar hashtag"; "lng_context_copy_mention" = "Copiar alias"; @@ -745,6 +778,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Reenviar mensaje"; "lng_context_delete_msg" = "Eliminar mensaje"; "lng_context_select_msg" = "Seleccionar mensaje"; +"lng_context_pin_msg" = "Pin Message"; +"lng_context_unpin_msg" = "Unpin Message"; "lng_context_cancel_upload" = "Cancelar envío"; "lng_context_copy_selected" = "Copiar el texto seleccionado"; "lng_context_forward_selected" = "Reenviar lo seleccionado"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 071e7d8a7a..be718a0353 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Nuovo testo messaggio.."; "lng_deleted" = "Sconosciuto"; "lng_deleted_message" = "Messaggio eliminato"; +"lng_pinned_message" = "Messaggio fissato"; +"lng_pinned_unpin_sure" = "Vuoi togliere questo messaggio?"; +"lng_pinned_pin_sure" = "Vuoi fissare questo messaggio?"; +"lng_pinned_pin" = "Fissa"; +"lng_pinned_unpin" = "Stacca"; +"lng_pinned_notify" = "Notifica tutti i membri"; "lng_intro" = "Benvenuti nell'app desktop ufficiale di [a href=\"https://telegram.org/\"]Telegram[/a].\nÈ [b]veloce[/b] e [b]sicura[/b]."; "lng_start_msgs" = "INIZIA A MESSAGGIARE"; @@ -373,7 +379,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_reset_button" = "Chiudi"; "lng_settings_reset_done" = "Altre sessioni terminate"; "lng_settings_ask_question" = "Fai una domanda"; -"lng_settings_ask_sure" = "Per favore, considera che il supporto su Telegram è offerto da volontari. Proveremo a risponderti il più velocemente possibile, ma potrebbe volerci un po' di tempo.\n\nDai un'occhiata alle FAQ di Telegram: potrai trovare importanti suggerimenti riguardo alcune problematiche e risposte alla maggior parte delle domande."; +"lng_settings_ask_sure" = "Per favore nota che il supporto di Telegram è fornito da volontari. Proviamo a rispondere quanto prima, ma potrebbe volerci del tempo.\n\nDai un'occhiata alle FAQ di Telegram: potrai trovare importanti suggerimenti riguardo alcune problematiche e risposte alla maggior parte delle domande."; "lng_settings_faq_button" = "Vai alle FAQ"; "lng_settings_ask_ok" = "Chiedi"; "lng_settings_faq" = "FAQ di Telegram"; @@ -429,6 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Aggiungi membri"; "lng_profile_delete_and_exit" = "Esci"; "lng_profile_kick" = "Rimuovi"; +"lng_profile_admin" = "amministratore"; "lng_profile_sure_kick" = "Rimuovere {user} dal gruppo?"; "lng_profile_sure_kick_channel" = "Rimuovere {user} dal canale?"; "lng_profile_sure_kick_admin" = "Rimuovere {user} dagli amministratori?"; @@ -460,11 +467,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_chat_all_members_admins" = "Tutti sono amministratori"; "lng_chat_about_all_admins" = "Tutti i membri possono aggiungere nuovi membri, modificare nome e foto del gruppo."; -"lng_chat_about_admins" = "Solo gli amministratori possono aggiungere e rimuovere membri e modificare nome e foto del gruppo."; +"lng_chat_about_admins" = "Gli amministratori possono aggiungere e rimuovere membri e modificare nome e foto del gruppo."; "lng_participant_filter" = "Cerca"; "lng_participant_invite" = "Invita"; -"lng_participant_invite_sorry" = "Spiacenti, puoi aggiungere solo {count:_not_used|il primo membro|i primi # membri} a un canale.\n\nDa adesso, le persone potranno unirsi tramite il tuo link di invito."; +"lng_participant_invite_sorry" = "Spiacenti, puoi aggiungere solo {count:_not_used|il primo membro|i primi # membri} a un canale.\n\nDa adesso, le persone potranno unirsi con il tuo link di invito."; "lng_create_group_back" = "Indietro"; "lng_create_group_next" = "Avanti"; "lng_create_group_create" = "Crea"; @@ -476,6 +483,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_channel_about" = "Chiunque può cercare il canale nella ricerca e unirsi"; "lng_create_private_channel_title" = "Canale privato"; "lng_create_private_channel_about" = "Solo le persone con uno speciale link di invito potranno unirsi"; +"lng_create_public_group_title" = "Gruppo pubblico"; +"lng_create_public_group_about" = "Chiunque può trovare il gruppo nella ricerca e unirsi, la cronologia è disponibile per tutti"; +"lng_create_private_group_title" = "Gruppo privato"; +"lng_create_private_group_about" = "Solo le persone invitate possono unirsi e vedere la cronologia"; "lng_create_channel_comments" = "Attiva i commenti"; "lng_create_channel_comments_about" = "Se attivi i commenti, i membri potranno discutere quello che pubblichi nel canale."; "lng_create_group_skip" = "Salta"; @@ -491,8 +502,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_channel_crop" = "Seleziona un riquadro per la foto del canale"; "lng_failed_add_participant" = "Impossibile aggiungere l'utente. Riprova più tardi."; -"lng_failed_add_not_mutual" = "Spiacenti, se una persona lascia un gruppo, solo un contatto in comune può reinvitarla (chi ti invita deve avere il tuo numero, e viceversa)."; -"lng_failed_add_not_mutual_channel" = "Spiacenti, se una persona lascia un canale, solo un contatto in comune può reinvitarla (chi ti invita deve avere il tuo numero, e viceversa)."; +"lng_failed_add_not_mutual" = "Spiacenti, se una persona lascia un gruppo, solo un contatto reciproco può reinvitarla (chi ti invita deve avere il tuo numero, e viceversa)."; +"lng_failed_add_not_mutual_channel" = "Spiacenti, se una persona lascia un canale, solo un contatto reciproco può reinvitarla (chi ti invita deve avere il tuo numero, e viceversa)."; "lng_sure_delete_contact" = "Sicuro di volere eliminare {contact} dalla tua lista dei contatti?"; "lng_sure_delete_history" = "Sicuro di voler eliminare tutta la cronologia dei messaggi con {contact}?\n\nQuesta azione non può essere annullata."; @@ -528,6 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} ha creato il gruppo «{title}»"; "lng_action_created_channel" = "Canale «{title}» creato"; "lng_action_group_migrate" = "Il gruppo è stato aggiornato a supergruppo"; +"lng_action_pinned_message" = "{from} ha fissato «{text}»"; +"lng_action_pinned_media" = "{from} ha fissato {media}"; +"lng_action_pinned_media_photo" = "una foto"; +"lng_action_pinned_media_video" = "un video"; +"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_voice" = "un messaggio vocale"; +"lng_action_pinned_media_file" = "un file"; +"lng_action_pinned_media_gif" = "una GIF"; +"lng_action_pinned_media_contact" = "un contatto"; +"lng_action_pinned_media_location" = "una posizione"; +"lng_action_pinned_media_sticker" = "uno sticker"; "lng_profile_migrate_reached" = "Limite di {count:_not_used_|# membro|# membri} raggiunto"; "lng_profile_migrate_about" = "Se vuoi superare questo limite, puoi aggiornare il gruppo a supergruppo. Nei supergruppi:"; @@ -537,6 +559,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— Le notifiche sono silenziate di default"; "lng_profile_migrate_button" = "Aggiorna a supergruppo"; "lng_profile_migrate_sure" = "Sicuro di voler aggiornare questo gruppo a supergruppo? Questa opzione non può essere annullata."; +"lng_profile_convert_button" = "Converti in supergruppo"; +"lng_profile_convert_title" = "Converti in supergruppo"; +"lng_profile_convert_about" = "Nei supergruppi:"; +"lng_profile_convert_feature1" = "— I nuovi membri vedono tutta la cronologia"; +"lng_profile_convert_feature2" = "— I messaggi eliminati scompaiono per tutti"; +"lng_profile_convert_feature3" = "— I membri possono modificare i loro messaggi"; +"lng_profile_convert_feature4" = "— Il creatore può creare un link pubblico per il gruppo"; +"lng_profile_convert_warning" = "{bold_start}Nota:{bold_end} Questa azione non può essere annullata"; +"lng_profile_convert_confirm" = "Converti"; "lng_channel_comments_count" = "{count:_not_used_|# commento|# commenti}"; "lng_channel_hide_comments" = "Nascondi commenti"; @@ -637,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_ban_user" = "Rimuovi utente"; +"lng_delete_all_from" = "Elimina tutto da questo utente"; "lng_report_spam" = "Segnala spam"; "lng_report_spam_hide" = "Nascondi"; "lng_report_spam_thanks" = "Grazie per la tua segnalazione!"; @@ -644,9 +677,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "Sei sicuro di voler segnalare dello spam in questo gruppo?"; "lng_report_spam_sure_channel" = "Sei sicuro di voler segnalare dello spam in questo canale?"; "lng_report_spam_ok" = "Segnala"; -"lng_cant_send_to_not_contact" = "Spiacenti, ma al momento puoi scrivere\nsolo a contatti in comune. {more_info}"; -"lng_cant_invite_not_contact" = "Spiacenti, ma al momento puoi aggiungere\nai gruppi solo contatti in comune. {more_info}"; -"lng_cant_invite_not_contact_channel" = "Spiacenti, ma al momento puoi aggiungere\nai canali solo contatti in comune. {more_info}"; +"lng_cant_send_to_not_contact" = "Spiacenti, ma al momento puoi scrivere\nsolo ai contatti reciproci. {more_info}"; +"lng_cant_invite_not_contact" = "Spiacenti, ma al momento puoi aggiungere\nai gruppi solo contatti reciproci. {more_info}"; +"lng_cant_invite_not_contact_channel" = "Spiacenti, ma al momento puoi aggiungere\nai canali solo contatti reciproci. {more_info}"; "lng_cant_more_info" = "Più info »"; "lng_cant_invite_privacy" = "Spiacenti, non puoi aggiungere questo utente al gruppo a causa delle sue impostazioni di privacy."; "lng_cant_invite_privacy_channel" = "Spiacenti, non puoi aggiungere questo utente al canale a causa delle sue impostazioni di privacy."; @@ -654,11 +687,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_button" = "Invia"; "lng_message_ph" = "Scrivi un messaggio.."; "lng_comment_ph" = "Scrivi un commento.."; -"lng_broadcast_ph" = "Diffondi un messaggio.."; -"lng_broadcast_silent_ph" = "Broadcast silenzioso.."; +"lng_broadcast_ph" = "Pubblica un post.."; +"lng_broadcast_silent_ph" = "Post silenzioso.."; "lng_record_cancel" = "Rilascia fuori da qui per annullare"; -"lng_will_be_notified" = "I membri saranno notificati quando pubblichi"; -"lng_wont_be_notified" = "I membri non saranno notificati quando pubblichi"; +"lng_will_be_notified" = "I post saranno notificati ai membri"; +"lng_wont_be_notified" = "I post non saranno notificati ai membri"; "lng_empty_history" = ""; "lng_willbe_history" = "Seleziona una chat per iniziare a messaggiare"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; @@ -745,6 +778,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Inoltra messaggio"; "lng_context_delete_msg" = "Elimina messaggio"; "lng_context_select_msg" = "Seleziona messaggio"; +"lng_context_pin_msg" = "Fissa messaggio"; +"lng_context_unpin_msg" = "Togli messaggio"; "lng_context_cancel_upload" = "Annulla caricamento"; "lng_context_copy_selected" = "Copia testo selezionato"; "lng_context_forward_selected" = "Inoltra selezione"; @@ -785,7 +820,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_add_contact" = "Crea"; "lng_add_contact_button" = "Nuovo contatto"; "lng_contacts_header" = "Contatti"; -"lng_contact_not_joined" = "Sfortunatamente {name} non si è ancora unito a Telegram, ma puoi inviargli un invito.\n\nTi notificheremo non appena qualcuno dei tuoi contatti si unirà a Telegram."; +"lng_contact_not_joined" = "Sfortunatamente {name} non si è ancora unito a Telegram, ma puoi invitarlo.\n\nTi notificheremo per ogni tuo contatto che si unisce a Telegram."; "lng_try_other_contact" = "Prova un altro"; "lng_create_group_link" = "Link"; "lng_create_group_invite_link" = "Link di invito"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 50a4e22900..0117be3926 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "새로운 메시지 내용."; "lng_deleted" = "알 수 없음"; "lng_deleted_message" = "삭제된 메시지"; +"lng_pinned_message" = "Pinned message"; +"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; +"lng_pinned_pin_sure" = "Would you like to pin this message?"; +"lng_pinned_pin" = "Pin"; +"lng_pinned_unpin" = "Unpin"; +"lng_pinned_notify" = "Notify all members"; "lng_intro" = "[a href=\"https://telegram.org/\"]텔레그램[/a] PC 공식버전에 오신 것을 환영합니다.\n[b]안전[/b]하고 [b]신속[/b]합니다."; "lng_start_msgs" = "시작하기"; @@ -429,6 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "구성원 추가"; "lng_profile_delete_and_exit" = "나가기"; "lng_profile_kick" = "삭제"; +"lng_profile_admin" = "admin"; "lng_profile_sure_kick" = "{user}를 추방하시겠습니까?"; "lng_profile_sure_kick_channel" = "{user}를 추방하시겠습니까?"; "lng_profile_sure_kick_admin" = "{user}를 관리자에서 제외 하시겠습니까?"; @@ -476,6 +483,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_channel_about" = "누구나 채널을 검색하고 입장할 수 있습니다."; "lng_create_private_channel_title" = "비공개 채널"; "lng_create_private_channel_about" = "초대 링크를 통해서만 입장이 가능합니다."; +"lng_create_public_group_title" = "Public Group"; +"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; +"lng_create_private_group_title" = "Private Group"; +"lng_create_private_group_about" = "Only invited people may join and see the chat history"; "lng_create_channel_comments" = "코멘트 허용"; "lng_create_channel_comments_about" = "코멘트가 허용되면, 구성원들이 글에 대하여 토론이 가능합니다."; "lng_create_group_skip" = "건너뛰기"; @@ -528,6 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} 님이 그룹 «{title}» 을 생성하셨습니다."; "lng_action_created_channel" = "채널명 «{title}» 생성됨"; "lng_action_group_migrate" = "이 그룹방은 슈퍼그룹방으로 변환되었습니다"; +"lng_action_pinned_message" = "{from} pinned «{text}»"; +"lng_action_pinned_media" = "{from} pinned {media}"; +"lng_action_pinned_media_photo" = "a photo"; +"lng_action_pinned_media_video" = "a video file"; +"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_voice" = "a voice message"; +"lng_action_pinned_media_file" = "a file"; +"lng_action_pinned_media_gif" = "a GIF animation"; +"lng_action_pinned_media_contact" = "a contact information"; +"lng_action_pinned_media_location" = "a location mark"; +"lng_action_pinned_media_sticker" = "a sticker"; "lng_profile_migrate_reached" = "{count:_not_used_|# 명|# 명} 한계치에 도달 되었습니다."; "lng_profile_migrate_about" = "최대허용치를 초과하시고 싶으실 경우, 슈퍼그룹방으로 업그레이드해주세요. 슈퍼그룹방은 :"; @@ -537,6 +559,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— 기본값으로 알림이 무음으로 처리됩니다"; "lng_profile_migrate_button" = "슈퍼그룹방으로 업그레이드하기"; "lng_profile_migrate_sure" = "정말로 그룹방을 슈퍼그룹방으로 변환하시겠습니까? 이 작업은 취소가 불가능합니다."; +"lng_profile_convert_button" = "Convert to supergroup"; +"lng_profile_convert_title" = "Convert to supergroup"; +"lng_profile_convert_about" = "In supergroups:"; +"lng_profile_convert_feature1" = "— New members see the full message history"; +"lng_profile_convert_feature2" = "— Messages are deleted for all members"; +"lng_profile_convert_feature3" = "— Members can edit their own messages"; +"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; +"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; +"lng_profile_convert_confirm" = "Convert"; "lng_channel_comments_count" = "{count:_not_used_|# 코멘트|# 코멘트}"; "lng_channel_hide_comments" = "코멘트 숨기기"; @@ -637,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "스티커"; "lng_in_dlg_sticker_emoji" = "{emoji} (스티커)"; +"lng_ban_user" = "Ban User"; +"lng_delete_all_from" = "Delete all from this user"; "lng_report_spam" = "스팸 신고"; "lng_report_spam_hide" = "숨기기"; "lng_report_spam_thanks" = "신고해주셔서 감사합니다!"; @@ -745,6 +778,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "메시지 전달"; "lng_context_delete_msg" = "메시지 삭제"; "lng_context_select_msg" = "메시지 선택"; +"lng_context_pin_msg" = "Pin Message"; +"lng_context_unpin_msg" = "Unpin Message"; "lng_context_cancel_upload" = "업로드 취소"; "lng_context_copy_selected" = "선택한 메시지 복사"; "lng_context_forward_selected" = "선택된 메시지 전달"; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 99a49c8fb3..8cc9612566 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -111,13 +111,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_status_connecting" = "verbinden"; "lng_chat_status_unaccessible" = "groep is ontoegankelijk"; -"lng_chat_status_members" = "{count:geen deelnemers|# deelnemer|# deelnemers}"; -"lng_chat_status_members_online" = "{count:_not_used_|# deelnemer|# deelnemers}, {count_online:_not_used_|# online|# online}"; +"lng_chat_status_members" = "{count:geen leden|# lid|# leden}"; +"lng_chat_status_members_online" = "{count:_not_used_|# lid|# leden}, {count_online:_not_used_|# online|# online}"; "lng_channel_status" = "kanaal"; "lng_group_status" = "groep"; -"lng_channel_members_link" = "{count:_not_used_|# deelnemer|# deelnemers} »"; +"lng_channel_members_link" = "{count:_not_used_|# lid|# leden} »"; "lng_channel_admins_link" = "{count:Beheerders wijzigen|# beheerders|# beheerders} »"; "lng_server_error" = "Interne serverfout."; @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Nieuw bericht..."; "lng_deleted" = "Onbekend"; "lng_deleted_message" = "Verwijderd bericht"; +"lng_pinned_message" = "Vastgezet bericht"; +"lng_pinned_unpin_sure" = "Wil je dit bericht losmaken?"; +"lng_pinned_pin_sure" = "Wil je dit bericht vastzetten?"; +"lng_pinned_pin" = "Vastzetten"; +"lng_pinned_unpin" = "Losmaken"; +"lng_pinned_notify" = "Leden informeren"; "lng_intro" = "Welkom bij de officiële [a href=\"https://telegram.org/\"]Telegram[/a] desktop-app.\n[b]Snel[/b] en [b]veilig[/b]."; "lng_start_msgs" = "BEGIN MET CHATTEN"; @@ -402,7 +408,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_bot_help" = "Help"; "lng_profile_create_public_link" = "Publieke link maken"; "lng_profile_edit_public_link" = "Publieke link wijzigen"; -"lng_profile_participants_section" = "Deelnemers"; +"lng_profile_participants_section" = "Leden"; "lng_profile_info" = "Contactinformatie"; "lng_profile_group_info" = "Groepsinformatie"; "lng_profile_channel_info" = "Kanaalinformatie"; @@ -429,6 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Lid toevoegen"; "lng_profile_delete_and_exit" = "Verlaat"; "lng_profile_kick" = "Verwijder"; +"lng_profile_admin" = "beheerder"; "lng_profile_sure_kick" = "{user} uit de groep verwijderen?"; "lng_profile_sure_kick_channel" = "{user} uit het kanaal verwijderen?"; "lng_profile_sure_kick_admin" = "{user} ontslaan als beheerder?"; @@ -450,34 +457,38 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_copy_phone" = "Telefoonnummer kopiëren"; "lng_channel_add_admins" = "Beheerder toevoegen"; -"lng_channel_add_members" = "Deelnemers toevoegen"; -"lng_channel_members" = "Deelnemers"; -"lng_channel_only_last_shown" = "De laatste {count:_not_used_|# deelnemer|# deelnemers} worden hier weergegeven"; +"lng_channel_add_members" = "Leden toevoegen"; +"lng_channel_members" = "Leden"; +"lng_channel_only_last_shown" = "De laatste {count:_not_used_|# lid|# leden} worden hier weergegeven"; "lng_channel_admins" = "Beheerders"; "lng_channel_add_admin" = "Beheerder toevoegen"; "lng_channel_admin_sure" = "{user} aan beheerders toevoegen?"; "lng_channel_admins_too_much" = "Je hebt het maximum aantal beheerders voor deze groep bereikt, Verwijder er eerst één."; "lng_chat_all_members_admins" = "Iedereen is beheerder"; -"lng_chat_about_all_admins" = "Iedereen mag deelnemers toevoegen en de groepsfoto of naam wijzigen."; -"lng_chat_about_admins" = "Beheerders mogen deelnemers beheren en de groepsfoto of naam wijzigen."; +"lng_chat_about_all_admins" = "Iedereen mag leden toevoegen en de groepsfoto of naam wijzigen."; +"lng_chat_about_admins" = "Beheerders mogen leden beheren en de groepsfoto of naam wijzigen."; "lng_participant_filter" = "Zoeken"; "lng_participant_invite" = "Uitnodigen"; -"lng_participant_invite_sorry" = "De eerste {count:_not_used|# deelnemer|# deelnemers} kun je persoonlijk uitnodigen.\n\nVanaf nu kunnen mensen via de uitnodigingslink deelnemen."; +"lng_participant_invite_sorry" = "De eerste {count:_not_used|# lid|# leden} kun je persoonlijk uitnodigen.\n\nVanaf nu kunnen mensen lid worden via de uitnodigingslink."; "lng_create_group_back" = "Vorige"; "lng_create_group_next" = "Volgende"; "lng_create_group_create" = "Maak"; "lng_create_group_title" = "Nieuwe groep"; -"lng_create_group_about" = "Groepen zijn voor kleinere gemeenschappen,\nmet maximaal {count:_not_used|# deelnemer|# deelnemers}"; +"lng_create_group_about" = "Groepen zijn voor kleinere gemeenschappen,\nmet maximaal {count:_not_used|# lid|# leden}"; "lng_create_channel_title" = "Nieuw kanaal"; "lng_create_channel_about" = "Kanalen kennen geen limiet en zijn geschikt om een groot publiek te bereiken"; "lng_create_public_channel_title" = "Publiek kanaal"; -"lng_create_public_channel_about" = "Iedereen kan je kanaal vinden en deelnemen"; +"lng_create_public_channel_about" = "Iedereen kan je kanaal vinden en er lid van worden"; "lng_create_private_channel_title" = "Privé-kanaal"; -"lng_create_private_channel_about" = "Deelnemen kan alleen via de uitnodigingslink"; +"lng_create_private_channel_about" = "Lid worden kan alleen per uitnodigingslink"; +"lng_create_public_group_title" = "Publieke groep"; +"lng_create_public_group_about" = "Iedereen kan de groep vinden, er lid van worden en de geschiedenis zien"; +"lng_create_private_group_title" = "Privé-groep"; +"lng_create_private_group_about" = "Alleen uitgenodigde mensen kunnen lid worden en de geschiedenis zien"; "lng_create_channel_comments" = "Reacties inschakelen"; -"lng_create_channel_comments_about" = "Als je reacties inschakelt kunnen deelnemers reageren op je bericht in het kanaal."; +"lng_create_channel_comments_about" = "Als je reacties inschakelt kunnen leden reageren op je bericht in het kanaal."; "lng_create_group_skip" = "Overslaan"; "lng_create_channel_link_invalid" = "Deze naam is ongeldig."; @@ -495,13 +506,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_failed_add_not_mutual_channel" = "Iemand die het kanaal verlaat kan alleen door een wederzijds contact worden toegevoegd (opgeslagen nummers)"; "lng_sure_delete_contact" = "{contact} echt verwijderen uit contacten?"; -"lng_sure_delete_history" = "Geschiedenis met {contact} echt wissen? \n\nDeze actie kan niet ongedaan worden gemaakt."; -"lng_sure_delete_group_history" = "Echt de geschiedenis van \"{group}\" wissen?\n\nHerstellen is niet mogelijk. "; -"lng_sure_delete_and_exit" = "Wil je de groep \"{group}\" verlaten en de geschiedenis wissen?\n\nDeze actie kan niet ongedaan worden gemaakt."; +"lng_sure_delete_history" = "Geschiedenis met {contact} echt wissen? \n\nJe kunt dit niet ongedaan maken."; +"lng_sure_delete_group_history" = "Echt de geschiedenis van \"{group}\" wissen?\n\nJe kunt dit niet ongedaan maken."; +"lng_sure_delete_and_exit" = "Wil je de groep \"{group}\" verlaten en de geschiedenis wissen?\n\nJe kunt dit niet ongedaan maken."; "lng_sure_leave_channel" = "Kanaal echt verlaten?"; -"lng_sure_delete_channel" = "Kanaal echt verwijderen? Berichten worden gewist en alle deelnemers verwijderd."; -"lng_sure_leave_group" = "Groep echt verlaten?\nDit kan niet ongedaan worden gemaakt."; -"lng_sure_delete_group" = "Groep echt verwijderen? Berichten worden gewist en alle deelnemers verwijderd."; +"lng_sure_delete_channel" = "Kanaal echt verwijderen? Berichten worden gewist en alle leden verwijderd."; +"lng_sure_leave_group" = "Groep echt verlaten?\nJe kunt dit niet ongedaan maken."; +"lng_sure_delete_group" = "Groep echt verwijderen? Berichten worden gewist en alle leden verwijderd."; "lng_message_empty" = "Leeg bericht"; "lng_message_unsupported" = "Dit bericht wordt niet ondersteund door jouw versie van Telegram Desktop. Werk bij naar de laatste versie via de instellingen of installeer vanuit {link}"; @@ -511,13 +522,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_add_users_and_one" = "{accumulated}, {user}"; "lng_action_add_users_and_last" = "{accumulated} en {user}"; "lng_action_add_you" = "{from} heeft je toegevoegd aan dit kanaal"; -"lng_action_you_joined" = "Je neemt deel aan het kanaal"; +"lng_action_you_joined" = "Je bent nu lid van dit kanaal"; "lng_action_add_you_group" = "{from} heeft je toegevoegd aan deze groep"; -"lng_action_you_joined_group" = "Je neemt deel aan de groep"; +"lng_action_you_joined_group" = "Je bent nu lid van deze groep"; "lng_action_kick_user" = "{from} heeft {user} verwijderd"; "lng_action_user_left" = "{from} heeft de groep verlaten"; -"lng_action_user_joined" = "{from} neemt deel aan de groep"; -"lng_action_user_joined_by_link" = "{from} neemt deel aan de groep via uitnodigingslink"; +"lng_action_user_joined" = "{from} is nu lid van de groep"; +"lng_action_user_joined_by_link" = "{from} is nu lid van de groep via uitnodigingslink"; "lng_action_user_registered" = "{from} heeft nu Telegram"; "lng_action_removed_photo" = "{from} heeft de groepsafbeelding verwijderd"; "lng_action_removed_photo_channel" = "Kanaalfoto verwijderd"; @@ -528,15 +539,35 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} heeft de groep \"{title}\" gemaakt"; "lng_action_created_channel" = "Het kanaal \"{title}\" is gemaakt"; "lng_action_group_migrate" = "De groep is opgewaardeerd naar een supergroep"; +"lng_action_pinned_message" = "{from} heeft «{text}» vastgezet"; +"lng_action_pinned_media" = "{from} heeft {media} vastgezet"; +"lng_action_pinned_media_photo" = "een foto"; +"lng_action_pinned_media_video" = "een video"; +"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_voice" = "een spraakbericht"; +"lng_action_pinned_media_file" = "een bestand"; +"lng_action_pinned_media_gif" = "een GIF"; +"lng_action_pinned_media_contact" = "een contact"; +"lng_action_pinned_media_location" = "een locatie"; +"lng_action_pinned_media_sticker" = "een sticker"; -"lng_profile_migrate_reached" = "{count:_not_used_|# deelnemer |# deelnemers} limiet bereikt"; +"lng_profile_migrate_reached" = "{count:_not_used_|# lid |# leden} limiet bereikt"; "lng_profile_migrate_about" = "Wil je extra functies en een hogere limiet? Waardeer op naar een supergroep:"; "lng_profile_migrate_feature1" = "— Supergroepen hebben tot {count:_not_used_|# lid|# leden}"; "lng_profile_migrate_feature2" = "— Nieuwe leden zien de hele geschiedenis"; "lng_profile_migrate_feature3" = "— Beheerder wist berichten voor iedereen"; "lng_profile_migrate_feature4" = "— Meldingen staan standaard uit"; "lng_profile_migrate_button" = "Opwaarderen naar supergroep."; -"lng_profile_migrate_sure" = "Groep echt omzetten naar supergroep? Dit kan niet ongedaan worden gemaakt."; +"lng_profile_migrate_sure" = "Groep echt omzetten naar supergroep? Je kunt dit niet ongedaan maken."; +"lng_profile_convert_button" = "Opwaarderen naar supergroep"; +"lng_profile_convert_title" = "Opwaarderen naar supergroep"; +"lng_profile_convert_about" = "supergroepen:"; +"lng_profile_convert_feature1" = "— Nieuwe leden zien de hele geschiedenis"; +"lng_profile_convert_feature2" = "— Gewiste berichten gelden voor alle leden"; +"lng_profile_convert_feature3" = "— Leden kunnen eigen berichten bewerken"; +"lng_profile_convert_feature4" = "— Maker kan een publieke groepslink instellen"; +"lng_profile_convert_warning" = "{bold_start}Let op:{bold_end} Je kunt dit niet ongedaan maken."; +"lng_profile_convert_confirm" = "Opwaarderen"; "lng_channel_comments_count" = "{count:_not_used_|# reactie|# reacties}"; "lng_channel_hide_comments" = "Reacties verbergen"; @@ -547,17 +578,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_channels_too_much_public" = "Het maximale aantal publieke kanalen is bereikt.\n\nMaak een privé-kanaal \nof verwijder eerst een publiek kanaal."; "lng_group_invite_bad_link" = "Deze uitnodigingslink is defect of verlopen."; -"lng_group_invite_want_join" = "Wil je deelnemen aan de groep \"{title}\"?"; -"lng_group_invite_want_join_channel" = "Wil je deelnemen aan het kanaal \"{title}\"?"; -"lng_group_invite_join" = "Deelnemen"; +"lng_group_invite_want_join" = "Wil je lid worden van de groep \"{title}\"?"; +"lng_group_invite_want_join_channel" = "Wil je lid worden van het kanaal \"{title}\"?"; +"lng_group_invite_join" = "Lid worden"; "lng_group_invite_link" = "Uitnodigingslink:"; "lng_group_invite_create" = "Uitnodigingslink maken"; -"lng_group_invite_about" = "Gebruikers kunnen aan je groep \ndeelnemen met deze link."; +"lng_group_invite_about" = "Gebruikers kunnen lid worden\nvan je groep via deze link."; "lng_group_invite_create_new" = "Intrekken"; "lng_group_invite_about_new" = "Je uitnodigingslink zal inactief worden\neen nieuwe link zal worden gegenereerd."; "lng_group_invite_copied" = "Link gekopieerd naar klembord."; -"lng_group_invite_no_room" = "De deelnemerslimiet van de groep is bereikt."; +"lng_group_invite_no_room" = "De ledenlimiet van de groep is bereikt."; "lng_channel_public_link_copied" = "Link gekopieerd naar klembord"; @@ -637,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_ban_user" = "Blacklist gebruiker"; +"lng_delete_all_from" = "Verwijder alles van gebruiker"; "lng_report_spam" = "Spam melden"; "lng_report_spam_hide" = "Verbergen"; "lng_report_spam_thanks" = "Bedankt!"; @@ -657,15 +690,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_broadcast_ph" = "Massabericht"; "lng_broadcast_silent_ph" = "Stil massabericht.."; "lng_record_cancel" = "Annuleren: uit het vak loslaten"; -"lng_will_be_notified" = "Berichtgeving voor deelnemers"; -"lng_wont_be_notified" = "Geen berichtgeving voor deelnemers"; +"lng_will_be_notified" = "Berichtgeving voor leden"; +"lng_wont_be_notified" = "Geen berichtgeving voor leden"; "lng_empty_history" = ""; "lng_willbe_history" = "Kies een chat om te beginnen"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; "lng_from_you" = "Jij"; "lng_bot_description" = "Wat kan deze bot? "; "lng_unblock_button" = "Deblokkeer"; -"lng_channel_join" = "Deelnemen"; +"lng_channel_join" = "Lid worden"; "lng_channel_mute" = "Geluid uit"; "lng_channel_unmute" = "Geluid aan"; @@ -677,7 +710,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_bot_no_groups" = "Je hebt geen groepen"; "lng_bot_groups_not_found" = "Geen groepen gevonden"; "lng_bot_sure_invite" = "De bot toevoegen aan \"{group}\"?"; -"lng_bot_already_in_group" = "De bot neemt al deel aan de groep."; +"lng_bot_already_in_group" = "Deze bot is al een groepslid."; "lng_typing" = "aan het typen"; "lng_user_typing" = "{user} is aan het typen"; @@ -717,7 +750,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_view_channel" = "Kanaalinformatie weergeven"; "lng_context_copy_link" = "Link kopiëren"; -"lng_context_copy_post_link" = "Link kopiëren"; +"lng_context_copy_post_link" = "Berichtlink kopiëren"; "lng_context_copy_email" = "E-mailadres kopiëren"; "lng_context_copy_hashtag" = "Hashtag kopiëren"; "lng_context_copy_mention" = "Gebruikersnaam kopiëren"; @@ -745,6 +778,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Bericht doorsturen"; "lng_context_delete_msg" = "Bericht verwijderen"; "lng_context_select_msg" = "Bericht kiezen"; +"lng_context_pin_msg" = "Bericht vastzetten"; +"lng_context_unpin_msg" = "Bericht losmaken"; "lng_context_cancel_upload" = "Upload annuleren"; "lng_context_copy_selected" = "Tekstselectie kopiëren"; "lng_context_forward_selected" = "Selectie doorsturen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index 73e7314ec6..62f37ff8cb 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -130,6 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Nova mensagem..."; "lng_deleted" = "Desconhecido"; "lng_deleted_message" = "Mensagem apagada"; +"lng_pinned_message" = "Pinned message"; +"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; +"lng_pinned_pin_sure" = "Would you like to pin this message?"; +"lng_pinned_pin" = "Pin"; +"lng_pinned_unpin" = "Unpin"; +"lng_pinned_notify" = "Notify all members"; "lng_intro" = "Bem vindo ao cliente oficial do [a href=\"https://telegram.org/\"]Telegram[/a].\nÉ [b]rápido[/b] e [b]seguro[/b]."; "lng_start_msgs" = "COMECE A CONVERSAR"; @@ -429,6 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Adicionar Membros"; "lng_profile_delete_and_exit" = "Sair"; "lng_profile_kick" = "Remover"; +"lng_profile_admin" = "admin"; "lng_profile_sure_kick" = "Remover {user} do grupo?"; "lng_profile_sure_kick_channel" = "Remover {user} do canal?"; "lng_profile_sure_kick_admin" = "Remover {user} dos administradores?"; @@ -476,6 +483,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_channel_about" = "Qualquer um pode encontrar o canal na busca e entrar"; "lng_create_private_channel_title" = "Canal privado"; "lng_create_private_channel_about" = "Somente pessoas com um link especial de convite poderão entrar"; +"lng_create_public_group_title" = "Public Group"; +"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; +"lng_create_private_group_title" = "Private Group"; +"lng_create_private_group_about" = "Only invited people may join and see the chat history"; "lng_create_channel_comments" = "Habilitar Comentários"; "lng_create_channel_comments_about" = "Se você habilitar comentários, membros poderão discutir seus posts no canal"; "lng_create_group_skip" = "Pular"; @@ -528,6 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} criou o grupo «{title}»"; "lng_action_created_channel" = "Canal «{title}» criado"; "lng_action_group_migrate" = "O grupo foi atualizado para um supergrupo"; +"lng_action_pinned_message" = "{from} pinned «{text}»"; +"lng_action_pinned_media" = "{from} pinned {media}"; +"lng_action_pinned_media_photo" = "a photo"; +"lng_action_pinned_media_video" = "a video file"; +"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_voice" = "a voice message"; +"lng_action_pinned_media_file" = "a file"; +"lng_action_pinned_media_gif" = "a GIF animation"; +"lng_action_pinned_media_contact" = "a contact information"; +"lng_action_pinned_media_location" = "a location mark"; +"lng_action_pinned_media_sticker" = "a sticker"; "lng_profile_migrate_reached" = "{count:_not_used_|# membro|# membros} limite alcançado"; "lng_profile_migrate_about" = "Se você deseja ir além do limite, pode converter seu grupo em um supergrupo. Nos supergrupos:"; @@ -537,6 +559,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— Notificações silenciadas por padrão"; "lng_profile_migrate_button" = "Atualizar para supergrupo"; "lng_profile_migrate_sure" = "Tem certeza que deseja converter esse grupo para um supergrupo? Essa ação não pode ser desfeita."; +"lng_profile_convert_button" = "Convert to supergroup"; +"lng_profile_convert_title" = "Convert to supergroup"; +"lng_profile_convert_about" = "In supergroups:"; +"lng_profile_convert_feature1" = "— New members see the full message history"; +"lng_profile_convert_feature2" = "— Messages are deleted for all members"; +"lng_profile_convert_feature3" = "— Members can edit their own messages"; +"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; +"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; +"lng_profile_convert_confirm" = "Convert"; "lng_channel_comments_count" = "{count:_not_used_|# comentário|# comentários}"; "lng_channel_hide_comments" = "Ocultar Comentários"; @@ -637,6 +668,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; +"lng_ban_user" = "Ban User"; +"lng_delete_all_from" = "Delete all from this user"; "lng_report_spam" = "Reportar Spam"; "lng_report_spam_hide" = "Ocultar"; "lng_report_spam_thanks" = "Obrigado por reportar!"; @@ -745,6 +778,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Encaminhar Mensagem"; "lng_context_delete_msg" = "Apagar Mensagem"; "lng_context_select_msg" = "Selecionar Mensagem"; +"lng_context_pin_msg" = "Pin Message"; +"lng_context_unpin_msg" = "Unpin Message"; "lng_context_cancel_upload" = "Cancelar Envio"; "lng_context_copy_selected" = "Copiar Texto Selecionado"; "lng_context_forward_selected" = "Encaminhar Selecionado"; From 5cab9569c3fa1a8f3459679fc325fe9434e908c5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 15:20:58 +0300 Subject: [PATCH 169/316] updating edited messages dependencies (replies, edit / reply / pinned bar), postponing notification about pinned message while the message itself is not yet available --- Telegram/SourceFiles/app.cpp | 13 ++ Telegram/SourceFiles/app.h | 1 + Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- Telegram/SourceFiles/history.cpp | 39 ++++- Telegram/SourceFiles/history.h | 9 ++ Telegram/SourceFiles/historywidget.cpp | 30 +++- Telegram/SourceFiles/historywidget.h | 1 + Telegram/SourceFiles/mainwidget.cpp | 6 + Telegram/SourceFiles/mainwidget.h | 1 + Telegram/SourceFiles/mtproto/mtpScheme.cpp | 74 ++++++++-- Telegram/SourceFiles/mtproto/mtpScheme.h | 161 +++++++++++++++++++++ Telegram/SourceFiles/mtproto/scheme.tl | 6 +- Telegram/SourceFiles/window.cpp | 41 ++++-- 13 files changed, 345 insertions(+), 39 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 9426a3e822..ec83aa1e2b 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -937,6 +937,7 @@ namespace App { if (App::main()) { App::main()->dlgUpdated(existing->history(), existing->id); } + App::historyUpdateDependent(existing); Notify::historyItemResized(existing); } } @@ -1796,6 +1797,18 @@ namespace App { } } + void historyUpdateDependent(HistoryItem *item) { + DependentItems::iterator j = ::dependentItems.find(item); + if (j != ::dependentItems.cend()) { + for (OrderedSet::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { + k.key()->updateDependencyItem(); + } + } + if (App::main()) { + App::main()->itemEdited(item); + } + } + void historyClearMsgs() { ::dependentItems.clear(); diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index f3228811c2..4fabd34d87 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -150,6 +150,7 @@ namespace App { void historyRegItem(HistoryItem *item); void historyItemDetached(HistoryItem *item); void historyUnregItem(HistoryItem *item); + void historyUpdateDependent(HistoryItem *item); void historyClearMsgs(); void historyClearItems(); void historyRegDependency(HistoryItem *dependent, HistoryItem *dependency); diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index 9c22e5e5d2..aa89e8e01f 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -493,7 +493,7 @@ void RichDeleteMessageBox::onDelete() { QVector toDestroy; for (History::Blocks::const_iterator i = h->blocks.cbegin(), e = h->blocks.cend(); i != e; ++i) { for (HistoryBlock::Items::const_iterator j = (*i)->items.cbegin(), n = (*i)->items.cend(); j != n; ++j) { - if ((*j)->from() == _from && (*j)->type() == HistoryItemMsg) { + if ((*j)->from() == _from && (*j)->type() == HistoryItemMsg && (*j)->canDelete()) { toDestroy.push_back((*j)->id); } } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 74746cf757..b9377a748d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7101,11 +7101,19 @@ void HistoryReply::initDimensions() { } bool HistoryReply::updateReplyTo(bool force) { - if (replyToMsg || !replyToMsgId) return true; - replyToMsg = App::histItemById(channelId(), replyToMsgId); + if (!force) { + if (replyToMsg || !replyToMsgId) { + return true; + } + } + if (!replyToMsg) { + replyToMsg = App::histItemById(channelId(), replyToMsgId); + if (replyToMsg) { + App::historyRegDependency(this, replyToMsg); + } + } if (replyToMsg) { - App::historyRegDependency(this, replyToMsg); replyToText.setText(st::msgFont, replyToMsg->inReplyText(), _textDlgOptions); replyToNameUpdated(); @@ -7526,22 +7534,38 @@ bool HistoryServiceMsg::updatePinned(bool force) { HistoryServicePinned *pinned = Get(); t_assert(pinned != nullptr); - if (!pinned->msgId || pinned->msg) return true; + if (!force) { + if (!pinned->msgId || pinned->msg) { + return true; + } + } if (!pinned->lnk) { pinned->lnk = TextLinkPtr(new MessageLink(history()->peer->id, pinned->msgId)); } - pinned->msg = App::histItemById(channelId(), pinned->msgId); + bool gotDependencyItem = false; + if (!pinned->msg) { + pinned->msg = App::histItemById(channelId(), pinned->msgId); + if (pinned->msg) { + App::historyRegDependency(this, pinned->msg); + gotDependencyItem = true; + } + } if (pinned->msg) { - App::historyRegDependency(this, pinned->msg); updatePinnedText(); } else if (force) { - pinned->msgId = 0; + if (pinned->msgId > 0) { + pinned->msgId = 0; + gotDependencyItem = true; + } updatePinnedText(); } if (force) { initDimensions(); Notify::historyItemResized(this); + if (gotDependencyItem && App::wnd()) { + App::wnd()->notifySettingGot(); + } } return (pinned->msg || !pinned->msgId); } @@ -7613,6 +7637,7 @@ bool HistoryServiceMsg::updatePinnedText(const QString *pfrom, QString *ptext) { if (App::main()) { App::main()->dlgUpdated(history(), id); } + App::historyUpdateDependent(this); } return result; } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 8e96253eeb..2830342605 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -937,6 +937,9 @@ public: virtual MsgId dependencyMsgId() const { return 0; } + virtual bool notificationReady() const { + return true; + } virtual UserData *viaBot() const { return 0; @@ -2355,6 +2358,12 @@ public: } return 0; } + bool notificationReady() const override { + if (const HistoryServicePinned *pinned = Get()) { + return (pinned->msg || !pinned->msgId); + } + return true; + } void countPositionAndSize(int32 &left, int32 &width) const; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index f41f80d01a..e26df0cf5b 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6267,6 +6267,15 @@ void HistoryWidget::itemRemoved(HistoryItem *item) { } } +void HistoryWidget::itemEdited(HistoryItem *item) { + if (item == _replyEditMsg) { + updateReplyEditTexts(true); + } + if (_pinnedBar && item->id == _pinnedBar->msgId) { + updatePinnedBar(true); + } +} + void HistoryWidget::updateScrollColors() { if (!App::historyScrollBarColor()) return; _scroll.updateColors(App::historyScrollBarColor(), App::historyScrollBgColor(), App::historyScrollBarOverColor(), App::historyScrollBgOverColor()); @@ -6785,12 +6794,19 @@ HistoryWidget::PinnedBar::PinnedBar(MsgId msgId, HistoryWidget *parent) } void HistoryWidget::updatePinnedBar(bool force) { - if (!_pinnedBar || _pinnedBar->msg) { + if (!_pinnedBar) { return; } + if (!force) { + if (_pinnedBar->msg) { + return; + } + } t_assert(_history != nullptr); - _pinnedBar->msg = App::histItemById(_history->channelId(), _pinnedBar->msgId); + if (!_pinnedBar->msg) { + _pinnedBar->msg = App::histItemById(_history->channelId(), _pinnedBar->msgId); + } if (_pinnedBar->msg) { _pinnedBar->text.setText(st::msgFont, _pinnedBar->msg->inDialogsText(), _textDlgOptions); } else if (force) { @@ -7595,10 +7611,14 @@ void HistoryWidget::messageDataReceived(ChannelData *channel, MsgId msgId) { } void HistoryWidget::updateReplyEditTexts(bool force) { - if (_replyEditMsg || (!_editMsgId && !_replyToId)) { - return; + if (!force) { + if (_replyEditMsg || (!_editMsgId && !_replyToId)) { + return; + } + } + if (!_replyEditMsg) { + _replyEditMsg = App::histItemById(_channel, _editMsgId ? _editMsgId : _replyToId); } - _replyEditMsg = App::histItemById(_channel, _editMsgId ? _editMsgId : _replyToId); if (_replyEditMsg) { _replyEditMsgText.setText(st::msgFont, _replyEditMsg->inDialogsText(), _textDlgOptions); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 23584da8ee..aed43ca6cc 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -513,6 +513,7 @@ public: void fillSelectedItems(SelectedItemSet &sel, bool forDelete = true); void itemRemoved(HistoryItem *item); + void itemEdited(HistoryItem *item); void updateScrollColors(); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index be48886d13..2040f44bde 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1541,6 +1541,12 @@ void MainWidget::itemRemoved(HistoryItem *item) { } } +void MainWidget::itemEdited(HistoryItem *item) { + if (history.peer() == item->history()->peer || (history.peer() && history.peer() == item->history()->peer->migrateTo())) { + history.itemEdited(item); + } +} + bool MainWidget::overviewFailed(PeerData *peer, const RPCError &error, mtpRequestId req) { if (mtpIsFlood(error)) return false; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 2a039fe42f..c350976be6 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -348,6 +348,7 @@ public: void mediaOverviewUpdated(PeerData *peer, MediaOverviewType type); void changingMsgId(HistoryItem *row, MsgId newId); void itemRemoved(HistoryItem *item); + void itemEdited(HistoryItem *item); void loadMediaBack(PeerData *peer, MediaOverviewType type, bool many = false); void peerUsernameChanged(PeerData *peer); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 5486b9582d..3133d7062b 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1213,21 +1213,22 @@ void _serialize_channelFull(MTPStringLogger &to, int32 stage, int32 lev, Types & switch (stage) { case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_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(" 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(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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 5: 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 6: 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 7: 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 8: 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 9: 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 10: to.add(" chat_photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 11: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 12: to.add(" exported_invite: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 13: to.add(" bot_info: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 14: 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 15: 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 16: 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 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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -1901,6 +1902,20 @@ void _serialize_peerNotifySettings(MTPStringLogger &to, int32 stage, int32 lev, } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ peerSettings"); + 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; + 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) { if (stage) { to.add(",\n").addSpaces(lev); @@ -5577,6 +5592,19 @@ 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_hideReportSpam"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_messages_discardEncryption(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -6974,6 +7002,19 @@ void _serialize_channels_updatePinnedMessage(MTPStringLogger &to, int32 stage, i } } +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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_getPeerSettings"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_messages_getChats(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -7719,6 +7760,7 @@ namespace { _serializers.insert(mtpc_peerNotifyEventsAll, _serialize_peerNotifyEventsAll); _serializers.insert(mtpc_peerNotifySettingsEmpty, _serialize_peerNotifySettingsEmpty); _serializers.insert(mtpc_peerNotifySettings, _serialize_peerNotifySettings); + _serializers.insert(mtpc_peerSettings, _serialize_peerSettings); _serializers.insert(mtpc_wallPaper, _serialize_wallPaper); _serializers.insert(mtpc_wallPaperSolid, _serialize_wallPaperSolid); _serializers.insert(mtpc_inputReportReasonSpam, _serialize_inputReportReasonSpam); @@ -8011,6 +8053,7 @@ namespace { _serializers.insert(mtpc_contacts_unblock, _serialize_contacts_unblock); _serializers.insert(mtpc_messages_setTyping, _serialize_messages_setTyping); _serializers.insert(mtpc_messages_reportSpam, _serialize_messages_reportSpam); + _serializers.insert(mtpc_messages_hideReportSpam, _serialize_messages_hideReportSpam); _serializers.insert(mtpc_messages_discardEncryption, _serialize_messages_discardEncryption); _serializers.insert(mtpc_messages_setEncryptedTyping, _serialize_messages_setEncryptedTyping); _serializers.insert(mtpc_messages_readEncryptedHistory, _serialize_messages_readEncryptedHistory); @@ -8111,6 +8154,7 @@ namespace { _serializers.insert(mtpc_channels_toggleSignatures, _serialize_channels_toggleSignatures); _serializers.insert(mtpc_channels_editMessage, _serialize_channels_editMessage); _serializers.insert(mtpc_channels_updatePinnedMessage, _serialize_channels_updatePinnedMessage); + _serializers.insert(mtpc_messages_getPeerSettings, _serialize_messages_getPeerSettings); _serializers.insert(mtpc_messages_getChats, _serialize_messages_getChats); _serializers.insert(mtpc_channels_getChannels, _serialize_channels_getChannels); _serializers.insert(mtpc_messages_getFullChat, _serialize_messages_getFullChat); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index e618f914c7..04b2c42cf3 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -192,6 +192,7 @@ enum { mtpc_peerNotifyEventsAll = 0x6d1ded88, mtpc_peerNotifySettingsEmpty = 0x70a68512, mtpc_peerNotifySettings = 0x9acda4c0, + mtpc_peerSettings = 0x818426cd, mtpc_wallPaper = 0xccb03657, mtpc_wallPaperSolid = 0x63117f24, mtpc_inputReportReasonSpam = 0x58dbcab8, @@ -523,6 +524,8 @@ enum { mtpc_messages_sendMedia = 0xc8f16791, mtpc_messages_forwardMessages = 0x708e0195, mtpc_messages_reportSpam = 0xcf1592db, + mtpc_messages_hideReportSpam = 0xa8f1709b, + mtpc_messages_getPeerSettings = 0x3672e09c, mtpc_messages_getChats = 0x3c6aa187, mtpc_messages_getFullChat = 0x3b831c66, mtpc_messages_editChatTitle = 0xdc452855, @@ -854,6 +857,9 @@ class MTPpeerNotifyEvents; class MTPpeerNotifySettings; class MTPDpeerNotifySettings; +class MTPpeerSettings; +class MTPDpeerSettings; + class MTPwallPaper; class MTPDwallPaper; class MTPDwallPaperSolid; @@ -1313,6 +1319,7 @@ typedef MTPBoxed MTPInputPeerNotifyEvents; typedef MTPBoxed MTPInputPeerNotifySettings; typedef MTPBoxed MTPPeerNotifyEvents; typedef MTPBoxed MTPPeerNotifySettings; +typedef MTPBoxed MTPPeerSettings; typedef MTPBoxed MTPWallPaper; typedef MTPBoxed MTPReportReason; typedef MTPBoxed MTPUserFull; @@ -4311,6 +4318,37 @@ private: }; typedef MTPBoxed MTPPeerNotifySettings; +class MTPpeerSettings : private mtpDataOwner { +public: + MTPpeerSettings(); + MTPpeerSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_peerSettings) : mtpDataOwner(0) { + read(from, end, cons); + } + + MTPDpeerSettings &_peerSettings() { + if (!data) throw mtpErrorUninitialized(); + split(); + return *(MTPDpeerSettings*)data; + } + const MTPDpeerSettings &c_peerSettings() const { + if (!data) throw mtpErrorUninitialized(); + return *(const MTPDpeerSettings*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_peerSettings); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPpeerSettings(MTPDpeerSettings *_data); + + friend MTPpeerSettings MTP_peerSettings(MTPint _flags); +}; +typedef MTPBoxed MTPPeerSettings; + class MTPwallPaper : private mtpDataOwner { public: MTPwallPaper() : mtpDataOwner(0), _type(0) { @@ -10042,6 +10080,7 @@ public: 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), @@ -10051,6 +10090,7 @@ public: }; 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; } @@ -10608,6 +10648,22 @@ public: bool is_silent() const { return vflags.v & flag_silent; } }; +class MTPDpeerSettings : public mtpDataImpl { +public: + MTPDpeerSettings() { + } + MTPDpeerSettings(MTPint _flags) : vflags(_flags) { + } + + MTPint vflags; + + enum { + flag_report_spam = (1 << 0), + }; + + bool is_report_spam() const { return vflags.v & flag_report_spam; } +}; + class MTPDwallPaper : public mtpDataImpl { public: MTPDwallPaper() { @@ -16712,6 +16768,84 @@ public: } }; +class MTPmessages_hideReportSpam { // RPC method 'messages.hideReportSpam' +public: + MTPInputPeer vpeer; + + MTPmessages_hideReportSpam() { + } + MTPmessages_hideReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_hideReportSpam) { + read(from, end, cons); + } + MTPmessages_hideReportSpam(const MTPInputPeer &_peer) : vpeer(_peer) { + } + + uint32 innerLength() const { + return vpeer.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_hideReportSpam; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_hideReportSpam) { + vpeer.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPmessages_HideReportSpam : public MTPBoxed { +public: + MTPmessages_HideReportSpam() { + } + MTPmessages_HideReportSpam(const MTPmessages_hideReportSpam &v) : MTPBoxed(v) { + } + MTPmessages_HideReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_HideReportSpam(const MTPInputPeer &_peer) : MTPBoxed(MTPmessages_hideReportSpam(_peer)) { + } +}; + +class MTPmessages_getPeerSettings { // RPC method 'messages.getPeerSettings' +public: + MTPInputPeer vpeer; + + MTPmessages_getPeerSettings() { + } + MTPmessages_getPeerSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getPeerSettings) { + read(from, end, cons); + } + MTPmessages_getPeerSettings(const MTPInputPeer &_peer) : vpeer(_peer) { + } + + uint32 innerLength() const { + return vpeer.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_getPeerSettings; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_getPeerSettings) { + vpeer.read(from, end); + } + void write(mtpBuffer &to) const { + vpeer.write(to); + } + + typedef MTPPeerSettings ResponseType; +}; +class MTPmessages_GetPeerSettings : public MTPBoxed { +public: + MTPmessages_GetPeerSettings() { + } + MTPmessages_GetPeerSettings(const MTPmessages_getPeerSettings &v) : MTPBoxed(v) { + } + MTPmessages_GetPeerSettings(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_GetPeerSettings(const MTPInputPeer &_peer) : MTPBoxed(MTPmessages_getPeerSettings(_peer)) { + } +}; + class MTPmessages_getChats { // RPC method 'messages.getChats' public: MTPVector vid; @@ -24585,6 +24719,33 @@ inline MTPpeerNotifySettings MTP_peerNotifySettings(MTPint _flags, MTPint _mute_ return MTPpeerNotifySettings(new MTPDpeerNotifySettings(_flags, _mute_until, _sound)); } +inline MTPpeerSettings::MTPpeerSettings() : mtpDataOwner(new MTPDpeerSettings()) { +} + +inline uint32 MTPpeerSettings::innerLength() const { + const MTPDpeerSettings &v(c_peerSettings()); + return v.vflags.innerLength(); +} +inline mtpTypeId MTPpeerSettings::type() const { + return mtpc_peerSettings; +} +inline void MTPpeerSettings::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != mtpc_peerSettings) throw mtpErrorUnexpected(cons, "MTPpeerSettings"); + + if (!data) setData(new MTPDpeerSettings()); + MTPDpeerSettings &v(_peerSettings()); + v.vflags.read(from, end); +} +inline void MTPpeerSettings::write(mtpBuffer &to) const { + const MTPDpeerSettings &v(c_peerSettings()); + v.vflags.write(to); +} +inline MTPpeerSettings::MTPpeerSettings(MTPDpeerSettings *_data) : mtpDataOwner(_data) { +} +inline MTPpeerSettings MTP_peerSettings(MTPint _flags) { + return MTPpeerSettings(new MTPDpeerSettings(_flags)); +} + inline uint32 MTPwallPaper::innerLength() const { switch (_type) { case mtpc_wallPaper: { diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 15bb62e2b9..f071798e67 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -213,7 +213,7 @@ channel#a14dca52 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?t channelForbidden#2d85832c id:int access_hash:long title:string = Chat; chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector = ChatFull; -channelFull#97bee562 flags:# can_view_participants:flags.3?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int = ChatFull; +channelFull#97bee562 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int = ChatFull; chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant; chatParticipantCreator#da13538a user_id:int = ChatParticipant; @@ -289,6 +289,8 @@ peerNotifyEventsAll#6d1ded88 = PeerNotifyEvents; peerNotifySettingsEmpty#70a68512 = PeerNotifySettings; peerNotifySettings#9acda4c0 flags:# show_previews:flags.0?true silent:flags.1?true mute_until:int sound:string = PeerNotifySettings; +peerSettings#818426cd flags:# report_spam:flags.0?true = PeerSettings; + wallPaper#ccb03657 id:int title:string sizes:Vector color:int = WallPaper; wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper; @@ -726,6 +728,8 @@ messages.sendMessage#fa88427a flags:# no_webpage:flags.1?true broadcast:flags.4? messages.sendMedia#c8f16791 flags:# broadcast:flags.4?true silent:flags.5?true background:flags.6?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true silent:flags.5?true background:flags.6?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; +messages.hideReportSpam#a8f1709b peer:InputPeer = Bool; +messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings; messages.getChats#3c6aa187 id:Vector = messages.Chats; messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; messages.editChatTitle#dc452855 chat_id:int title:string = Updates; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 197d42174d..0618f76761 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1408,6 +1408,9 @@ void Window::notifySchedule(History *history, HistoryItem *item) { } App::wnd()->getNotifySetting(MTP_inputNotifyPeer(history->peer->input)); } + if (!item->notificationReady()) { + haveSetting = false; + } int delay = item->Is() ? 500 : 100, t = unixtime(); uint64 ms = getms(true); @@ -1419,7 +1422,7 @@ void Window::notifySchedule(History *history, HistoryItem *item) { delay = Global::NotifyDefaultDelay(); } - uint64 when = getms(true) + delay; + uint64 when = ms + delay; notifyWhenAlerts[history].insert(when, notifyByFrom); if (cDesktopNotify() && !psSkipDesktopNotify()) { NotifyWhenMaps::iterator i = notifyWhenMaps.find(history); @@ -1487,20 +1490,38 @@ void Window::notifySettingGot() { int32 t = unixtime(); for (NotifyWaiters::iterator i = notifySettingWaiters.begin(); i != notifySettingWaiters.end();) { History *history = i.key(); - if (history->peer->notify == UnknownNotifySettings) { - ++i; - } else { + bool loaded = false, muted = false; + if (history->peer->notify != UnknownNotifySettings) { if (history->peer->notify == EmptyNotifySettings || history->peer->notify->mute <= t) { - notifyWaiters.insert(i.key(), i.value()); + loaded = true; } else if (PeerData *from = i.value().notifyByFrom) { - if (from->notify == UnknownNotifySettings) { - ++i; - continue; - } else if (from->notify == EmptyNotifySettings || from->notify->mute <= t) { - notifyWaiters.insert(i.key(), i.value()); + if (from->notify != UnknownNotifySettings) { + if (from->notify == EmptyNotifySettings || from->notify->mute <= t) { + loaded = true; + } else { + loaded = muted = true; + } } + } else { + loaded = muted = true; + } + } + if (loaded) { + if (HistoryItem *item = App::histItemById(history->channelId(), i.value().msg)) { + if (!item->notificationReady()) { + loaded = false; + } + } else { + muted = true; + } + } + if (loaded) { + if (!muted) { + notifyWaiters.insert(i.key(), i.value()); } i = notifySettingWaiters.erase(i); + } else { + ++i; } } notifyWaitTimer.stop(); From 02b05127614c63e94998f32bdd8bac7660c65736 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 18:01:32 +0300 Subject: [PATCH 170/316] min channels handled, delayed getDifference request with old updDate value added --- Telegram/SourceFiles/app.cpp | 33 ++++++++++++++++++++--------- Telegram/SourceFiles/mainwidget.cpp | 21 ++++++++++++++---- Telegram/SourceFiles/mainwidget.h | 2 ++ 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index ec83aa1e2b..cbc5952e81 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -486,6 +486,7 @@ namespace App { for (QVector::const_iterator i = v.cbegin(), e = v.cend(); i != e; ++i) { const MTPchat &chat(*i); data = 0; + bool minimal = false; switch (chat.type()) { case mtpc_chat: { const MTPDchat &d(chat.c_chat()); @@ -566,24 +567,36 @@ namespace App { const MTPDchannel &d(chat.c_channel()); PeerId peer(peerFromChannel(d.vid.v)); - data = App::channel(peer); - data->input = MTP_inputPeerChannel(d.vid, d.vaccess_hash); + minimal = d.is_min(); + if (minimal) { + data = App::channelLoaded(peer); + if (!data) { + continue; // minimal is not loaded, need to make getDifference + } + } else { + data = App::channel(peer); + data->input = MTP_inputPeerChannel(d.vid, d.has_access_hash() ? d.vaccess_hash : MTP_long(0)); + } ChannelData *cdata = data->asChannel(); - cdata->inputChannel = MTP_inputChannel(d.vid, d.vaccess_hash); - + if (minimal) { + int32 mask = MTPDchannel::flag_broadcast | MTPDchannel::flag_verified | MTPDchannel::flag_megagroup | MTPDchannel::flag_democracy; + cdata->flags = (cdata->flags & ~mask) | (d.vflags.v & mask); + } else { + cdata->inputChannel = MTP_inputChannel(d.vid, d.vaccess_hash); + cdata->access = d.vaccess_hash.v; + cdata->date = d.vdate.v; + cdata->flags = d.vflags.v; + if (cdata->version < d.vversion.v) { + cdata->version = d.vversion.v; + } + } QString uname = d.has_username() ? textOneLine(qs(d.vusername)) : QString(); cdata->setName(qs(d.vtitle), uname); - cdata->access = d.vaccess_hash.v; - cdata->date = d.vdate.v; - cdata->flags = d.vflags.v; cdata->isForbidden = false; cdata->flagsUpdated(); cdata->setPhoto(d.vphoto); - if (cdata->version < d.vversion.v) { - cdata->version = d.vversion.v; - } } break; case mtpc_channelForbidden: { const MTPDchannelForbidden &d(chat.c_channelForbidden()); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 2040f44bde..471d941f6c 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -431,6 +431,7 @@ MainWidget::MainWidget(Window *window) : TWidget(window) connect(&_idleFinishTimer, SIGNAL(timeout()), this, SLOT(checkIdleFinish())); connect(&_bySeqTimer, SIGNAL(timeout()), this, SLOT(getDifference())); connect(&_byPtsTimer, SIGNAL(timeout()), this, SLOT(onGetDifferenceTimeByPts())); + connect(&_byMinChannelTimer, SIGNAL(timeout()), this, SLOT(getDifference())); connect(&_failDifferenceTimer, SIGNAL(timeout()), this, SLOT(onGetDifferenceTimeAfterFail())); connect(_api, SIGNAL(fullPeerUpdated(PeerData*)), this, SLOT(onFullPeerUpdated(PeerData*))); connect(this, SIGNAL(peerUpdated(PeerData*)), &history, SLOT(peerUpdated(PeerData*))); @@ -2915,8 +2916,12 @@ bool MainWidget::updateFail(const RPCError &e) { } void MainWidget::updSetState(int32 pts, int32 date, int32 qts, int32 seq) { - if (pts) _ptsWaiter.init(pts); - if (updDate < date) updDate = date; + if (pts) { + _ptsWaiter.init(pts); + } + if (updDate < date && !_byMinChannelTimer.isActive()) { + updDate = date; + } if (qts && updQts < qts) { updQts = qts; } @@ -4507,7 +4512,13 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { case mtpc_updateNewChannelMessage: { const MTPDupdateNewChannelMessage &d(update.c_updateNewChannelMessage()); ChannelData *channel = App::channelLoaded(peerToChannel(peerFromMessage(d.vmessage))); - + if (!channel && !_ptsWaiter.requesting()) { + MTP_LOG(0, ("getDifference { good - after no channel in updateNewChannelMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); + if (!_byMinChannelTimer.isActive()) { // getDifference after timeout + _byMinChannelTimer.start(WaitForSkippedTimeout); + } + return; + } if (channel && !_handlingChannelDifference) { if (channel->ptsRequesting()) { // skip global updates while getting channel difference return; @@ -4605,7 +4616,9 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { case mtpc_updateChannelTooLong: { const MTPDupdateChannelTooLong &d(update.c_updateChannelTooLong()); if (ChannelData *channel = App::channelLoaded(d.vchannel_id.v)) { - getChannelDifference(channel); + if (!d.has_pts() || channel->pts() < d.vpts.v) { + getChannelDifference(channel); + } } } break; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index c350976be6..ada84278ae 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -625,6 +625,8 @@ private: QMap _bySeqUpdates; SingleTimer _bySeqTimer; + SingleTimer _byMinChannelTimer; + mtpRequestId _onlineRequest; SingleTimer _onlineTimer, _onlineUpdater, _idleFinishTimer; bool _lastWasOnline; From 0913833f6c606605d7a506ab373d60404e47e9cd Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 18:21:05 +0300 Subject: [PATCH 171/316] can_set_username bit support added --- Telegram/SourceFiles/boxes/addcontactbox.cpp | 18 ++++++++++++------ Telegram/SourceFiles/historywidget.cpp | 4 ++-- Telegram/SourceFiles/profilewidget.cpp | 6 +++--- Telegram/SourceFiles/structs.h | 3 +++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 0d6f55d3af..3fcd143a66 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -944,7 +944,10 @@ bool SetupChannelBox::onCheckFail(const RPCError &error) { _checkRequestId = 0; QString err(error.type()); - if (err == "CHANNELS_ADMIN_PUBLIC_TOO_MUCH") { + if (err == qstr("CHANNEL_PUBLIC_GROUP_NA")) { + Ui::hideLayer(); + return true; + } else if (err == qstr("CHANNELS_ADMIN_PUBLIC_TOO_MUCH")) { if (_existing) { Ui::showLayer(new InformBox(lang(lng_channels_too_much_public_existing))); } else { @@ -953,11 +956,11 @@ bool SetupChannelBox::onCheckFail(const RPCError &error) { onPrivacyChange(); } return true; - } else if (err == "USERNAME_INVALID") { + } else if (err == qstr("USERNAME_INVALID")) { _errorText = lang(lng_create_channel_link_invalid); update(); return true; - } else if (err == "USERNAME_OCCUPIED" && _checkUsername != _channel->username) { + } else if (err == qstr("USERNAME_OCCUPIED") && _checkUsername != _channel->username) { _errorText = lang(lng_create_channel_link_occupied); update(); return true; @@ -972,7 +975,10 @@ bool SetupChannelBox::onFirstCheckFail(const RPCError &error) { _checkRequestId = 0; QString err(error.type()); - if (err == "CHANNELS_ADMIN_PUBLIC_TOO_MUCH") { + if (err == qstr("CHANNEL_PUBLIC_GROUP_NA")) { + Ui::hideLayer(); + return true; + } else if (err == qstr("CHANNELS_ADMIN_PUBLIC_TOO_MUCH")) { if (_existing) { Ui::showLayer(new InformBox(lang(lng_channels_too_much_public_existing))); } else { @@ -1213,7 +1219,7 @@ void EditChannelBox::showAll() { _description.show(); _save.show(); _cancel.show(); - if (_channel->amCreator()) { + if (_channel->canEditUsername()) { _publicLink.show(); } else { _publicLink.hide(); @@ -1264,7 +1270,7 @@ void EditChannelBox::updateMaxHeight() { if (!_channel->isMegagroup()) { h += st::newGroupPublicLinkPadding.top() + _sign.height() + st::newGroupPublicLinkPadding.bottom(); } - if (_channel->amCreator()) { + if (_channel->canEditUsername()) { h += st::newGroupPublicLinkPadding.top() + _publicLink.height() + st::newGroupPublicLinkPadding.bottom(); } h += st::boxPadding.bottom() + st::newGroupInfoPadding.bottom() + st::boxButtonPadding.top() + _save.height() + st::boxButtonPadding.bottom(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index e26df0cf5b..63cb7abee8 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4166,7 +4166,7 @@ void HistoryWidget::historyCleared(History *history) { bool HistoryWidget::messagesFailed(const RPCError &error, mtpRequestId requestId) { if (mtpIsFlood(error)) return false; - if (error.type() == qstr("CHANNEL_PRIVATE")) { + if (error.type() == qstr("CHANNEL_PRIVATE") || error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")) { PeerData *was = _peer; Ui::showChatsList(); Ui::showLayer(new InformBox(lang((was && was->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible))); @@ -4762,7 +4762,7 @@ bool HistoryWidget::joinFail(const RPCError &error, mtpRequestId req) { if (mtpIsFlood(error)) return false; if (_unblockRequest == req) _unblockRequest = 0; - if (error.type() == qstr("CHANNEL_PRIVATE")) { + if (error.type() == qstr("CHANNEL_PRIVATE") || error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")) { Ui::showLayer(new InformBox(lang((_peer && _peer->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible))); return true; } diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 08e49d6ba9..6798f27067 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -859,7 +859,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { addbyname = st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); p.setPen(st::black->p); p.drawText(_left + st::profilePhotoSize + st::profileStatusLeft, top + st::profileStatusTop + st::linkFont->ascent, '@' + _peerUser->username); - } else if (_peerChannel && (_peerChannel->isPublic() || _amCreator)) { + } else if (_peerChannel && (_peerChannel->isPublic() || _peerChannel->canEditUsername())) { addbyname = st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); } if (!_peerChannel || !_peerChannel->canViewParticipants() || _peerChannel->isMegagroup()) { @@ -1374,7 +1374,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { // profile top += st::profilePadding.top(); int32 addbyname = 0; - if (_peerChannel && (_amCreator || _peerChannel->isPublic())) { + if (_peerChannel && (_peerChannel->isPublic() || _peerChannel->canEditUsername())) { _username.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + st::profileStatusTop); addbyname = st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent); } @@ -1760,7 +1760,7 @@ void ProfileInner::showAll() { } else { _deleteChannel.hide(); } - if (_peerChannel->isPublic() || _amCreator) { + if (_peerChannel->isPublic() || _peerChannel->canEditUsername()) { _username.show(); } else { _username.hide(); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index f03d57fe60..629360d285 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -607,6 +607,9 @@ public: bool isPublic() const { return flags & MTPDchannel::flag_username; } + bool canEditUsername() const { + return amCreator() && (flagsFull & MTPDchannelFull::flag_can_set_username); + } bool amCreator() const { return flags & MTPDchannel::flag_creator; } From 9ad9d5a12f66ba4d1a9a9dd4969fa0f9d11c332d Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 18:28:32 +0300 Subject: [PATCH 172/316] marked methods as override in history.h --- Telegram/SourceFiles/history.h | 56 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 2830342605..3cbcf5ccd3 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -2257,7 +2257,7 @@ public: 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); - void initDimensions(); + void initDimensions() override; bool updateDependencyItem() override { return updateReplyTo(true); @@ -2273,25 +2273,25 @@ public: HistoryItem *replyToMessage() const; void dependencyItemRemoved(HistoryItem *dependency) override; - 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; 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; - int32 resize(int32 width); + 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; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const; - void getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const; - void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) 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; PeerData *replyTo() const { return replyToMsg ? replyToMsg->author() : 0; } - QString selectedText(uint32 selection) const; + QString selectedText(uint32 selection) const override; - HistoryReply *toHistoryReply() { // dynamic_cast optimize + HistoryReply *toHistoryReply() override { // dynamic_cast optimize return this; } - const HistoryReply *toHistoryReply() const { // dynamic_cast optimize + const HistoryReply *toHistoryReply() const override { // dynamic_cast optimize return this; } @@ -2347,7 +2347,7 @@ 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); - void initDimensions(); + void initDimensions() override; bool updateDependencyItem() override { return updatePinned(true); @@ -2367,36 +2367,36 @@ public: void countPositionAndSize(int32 &left, int32 &width) const; - void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const; - int32 resize(int32 width); - bool hasPoint(int32 x, int32 y) 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; - uint32 adjustSelection(uint16 from, uint16 to, TextSelectType type) 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; + uint32 adjustSelection(uint16 from, uint16 to, TextSelectType type) const override { return _text.adjustSelection(from, to, type); } - void linkOver(const TextLinkPtr &lnk) { + void linkOver(const TextLinkPtr &lnk) override { if (_media) _media->linkOver(this, lnk); } - void linkOut(const TextLinkPtr &lnk) { + void linkOut(const TextLinkPtr &lnk) override { if (_media) _media->linkOut(this, lnk); } - void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const; - QString notificationText() const; + void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const override; + QString notificationText() const override; - bool needCheck() const { + bool needCheck() const override { return false; } - bool serviceMsg() const { + bool serviceMsg() const override { return true; } - QString selectedText(uint32 selection) const; - QString inDialogsText() const; - QString inReplyText() const; + QString selectedText(uint32 selection) const override; + QString inDialogsText() const override; + QString inReplyText() const override; - HistoryMedia *getMedia(bool inOverview = false) const; + HistoryMedia *getMedia(bool inOverview = false) const override; void setServiceText(const QString &text); From c289c6c6ebc5f3607829234d5d3d92002f301c04 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 18:29:24 +0300 Subject: [PATCH 173/316] beta 9030001 --- Telegram/SourceFiles/config.h | 4 ++-- Telegram/Telegram.rc | 8 ++++---- Telegram/Version | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 2f488d590f..0009490920 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -22,8 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9030; static const wchar_t *AppVersionStr = L"0.9.30"; -static const bool DevVersion = true; -//#define BETA_VERSION (9028002ULL) // just comment this line to build public version +static const bool DevVersion = false; +#define BETA_VERSION (9030001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 2e6ffef053..6db3f6b71b 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,30,0 - PRODUCTVERSION 0,9,30,0 + FILEVERSION 0,9,30,1 + PRODUCTVERSION 0,9,30,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.30.0" + VALUE "FileVersion", "0.9.30.1" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.30.0" + VALUE "ProductVersion", "0.9.30.1" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index cb02af01c5..5fc3cb2b8b 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -2,5 +2,5 @@ AppVersion 9030 AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.30 AppVersionStr 0.9.30 -DevChannel 1 -BetaVersion 0 9028002 +DevChannel 0 +BetaVersion 9030001 From 588de7966f9bfbeae373419cad992200734bba53 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 20:15:49 +0300 Subject: [PATCH 174/316] fixed langs for group creating and converting --- Telegram/Resources/lang.strings | 2 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 2 +- Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 4093e5ab1c..2ff3b72d43 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -476,7 +476,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Next"; "lng_create_group_create" = "Create"; "lng_create_group_title" = "New Group"; -"lng_create_group_about" = "Groups are ideal for smaller communities,\nthey can have up to {count:_not_used|# member|# members}"; +"lng_create_group_about" = "Groups are ideal for limited communities,\nthey can have up to {count:_not_used|# member|# members}"; "lng_create_channel_title" = "New Channel"; "lng_create_channel_about" = "Channels are a tool for broadcasting your messages to unlimited audiences"; "lng_create_public_channel_title" = "Public Channel"; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 3fcd143a66..c70c7caf0d 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -275,7 +275,7 @@ NewGroupBox::NewGroupBox() : AbstractBox(), _group(this, qsl("group_type"), 0, lang(lng_create_group_title), true), _channel(this, qsl("group_type"), 1, lang(lng_create_channel_title)), _aboutGroupWidth(width() - st::boxPadding.left() - st::boxButtonPadding.right() - st::newGroupPadding.left() - st::defaultRadiobutton.textPosition.x()), -_aboutGroup(st::normalFont, lng_create_group_about(lt_count, Global::ChatSizeMax()), _defaultOptions, _aboutGroupWidth), +_aboutGroup(st::normalFont, lng_create_group_about(lt_count, Global::MegagroupSizeMax()), _defaultOptions, _aboutGroupWidth), _aboutChannel(st::normalFont, lang(lng_create_channel_about), _defaultOptions, _aboutGroupWidth), _next(this, lang(lng_create_group_next), st::defaultBoxButton), _cancel(this, lang(lng_cancel), st::cancelBoxButton) { diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index aa89e8e01f..5c9e5f1527 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -298,7 +298,7 @@ ConvertToSupergroupBox::ConvertToSupergroupBox(ChatData *chat) : AbstractBox(st: _note.setText(st::boxTextFont, lng_profile_convert_warning(lt_bold_start, textcmdStartSemibold(), lt_bold_end, textcmdStopSemibold()), _confirmBoxTextOptions); _textWidth = st::boxWideWidth - st::boxPadding.left() - st::boxButtonPadding.right(); _textHeight = _text.countHeight(_textWidth); - setMaxHeight(st::boxTitleHeight + _textHeight + st::boxPadding.bottom() + st::boxTextFont->height + st::boxButtonPadding.top() + _convert.height() + st::boxButtonPadding.bottom()); + setMaxHeight(st::boxTitleHeight + _textHeight + st::boxPadding.bottom() + _note.countHeight(_textWidth) + st::boxButtonPadding.top() + _convert.height() + st::boxButtonPadding.bottom()); textstyleRestore(); connect(&_convert, SIGNAL(clicked()), this, SLOT(onConvert())); From abc0d03eb3871efa632e21b4dd3a351061cc744e Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 22:10:56 +0300 Subject: [PATCH 175/316] some phrases changed, limit on last crash report reading added --- Telegram/Resources/lang.strings | 4 ++-- Telegram/SourceFiles/logs.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 4093e5ab1c..3c6a246f46 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -484,9 +484,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_private_channel_title" = "Private Channel"; "lng_create_private_channel_about" = "Only people with a special invite link may join"; "lng_create_public_group_title" = "Public Group"; -"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; +"lng_create_public_group_about" = "Anyone can find the group in search and join, chat history is available to everybody"; "lng_create_private_group_title" = "Private Group"; -"lng_create_private_group_about" = "Only invited people may join and see the chat history"; +"lng_create_private_group_about" = "People can only join if they were invited or have an invite link"; "lng_create_channel_comments" = "Enable Comments"; "lng_create_channel_comments_about" = "If you enable comments, members will be able to discuss your posts in the channel"; "lng_create_group_skip" = "Skip"; diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 67c1e55afe..a704760548 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -938,9 +938,9 @@ namespace SignalHandlers { if (FILE *f = fopen(QFile::encodeName(CrashDumpPath).constData(), "rb")) { #endif QByteArray lastdump; - char buffer[64 * 1024] = { 0 }; - int32 read = 0; - while ((read = fread(buffer, 1, 64 * 1024, f)) > 0) { + char buffer[256 * 1024] = { 0 }; + int32 read = fread(buffer, 1, 256 * 1024, f); + if (read > 0) { lastdump.append(buffer, read); } fclose(f); From 17aaa5ceab91e076e4394635be33df90e425b719 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 23:07:13 +0300 Subject: [PATCH 176/316] fixed double fclose of crash dump file, removed block user context menu item for App::self() --- Telegram/SourceFiles/dialogswidget.cpp | 2 +- Telegram/SourceFiles/logs.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index c2b685e275..620e3b9dd8 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -619,7 +619,7 @@ void DialogsInner::contextMenuEvent(QContextMenuEvent *e) { if (_menuPeer->isUser()) { _menu->addAction(lang(lng_profile_clear_history), this, SLOT(onContextClearHistory()))->setEnabled(true); _menu->addAction(lang(lng_profile_delete_conversation), this, SLOT(onContextDeleteAndLeave()))->setEnabled(true); - if (_menuPeer->asUser()->access != UserNoAccess) { + if (_menuPeer->asUser()->access != UserNoAccess && _menuPeer != App::self()) { _menu->addAction(lang((_menuPeer->asUser()->blocked == UserIsBlocked) ? (_menuPeer->asUser()->botInfo ? lng_profile_unblock_bot : lng_profile_unblock_user) : (_menuPeer->asUser()->botInfo ? lng_profile_block_bot : lng_profile_block_user)), this, SLOT(onContextToggleBlock()))->setEnabled(true); connect(App::main(), SIGNAL(peerUpdated(PeerData*)), this, SLOT(peerUpdated(PeerData*))); } diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index a704760548..84bd345387 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -607,7 +607,7 @@ void _moveOldDataFiles(const QString &wasDir) { namespace SignalHandlers { QString CrashDumpPath; - FILE *CrashDumpFile = 0; + FILE *CrashDumpFile = nullptr; int CrashDumpFileNo = 0; char LaunchedDateTimeStr[32] = { 0 }; char LaunchedBinaryName[256] = { 0 }; @@ -999,6 +999,8 @@ namespace SignalHandlers { FinishBreakpad(); if (CrashDumpFile) { fclose(CrashDumpFile); + CrashDumpFile = nullptr; + #ifdef Q_OS_WIN _wunlink(CrashDumpPath.toStdWString().c_str()); #else From d3f3f5e095a572e821e44783d800e96c0a4b713f Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Sat, 12 Mar 2016 01:12:07 +0100 Subject: [PATCH 177/316] Create ISSUE_TEMPLATE.md Signed-off-by: Christoph Auer --- CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 .github/ISSUE_TEMPLATE.md | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..42a39d90b9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,26 @@ + +### Steps to reproduce +1. +2. +3. + +### Expected behaviour +Tell us what should happen + +### Actual behaviour +Tell us what happens instead + +### Configuration +**Operating system:** + +**Version of Telegram Desktop:** + +### Logs +Insert logs here (if necessary) + +You can type "debugmode" in settings and then see ~/.TelegramDesktop/DebugLogs/log_...txt for log files. +Type "debugmode" in settings again to disable logs. From 5aa5a62b74c316a47b7c95fe26cb7786a6aa1c81 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 12 Mar 2016 19:32:28 +0300 Subject: [PATCH 178/316] cloud synced report spam panel visibility --- Telegram/SourceFiles/app.cpp | 8 +- Telegram/SourceFiles/history.cpp | 8 -- Telegram/SourceFiles/historywidget.cpp | 143 +++++++++++++------------ Telegram/SourceFiles/historywidget.h | 5 + Telegram/SourceFiles/structs.h | 51 ++++++--- Telegram/SourceFiles/types.h | 10 +- 6 files changed, 128 insertions(+), 97 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index cbc5952e81..36ec4357c2 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -433,8 +433,8 @@ namespace App { data->setBotInfoVersion(-1); } data->contact = (d.is_contact() || d.is_mutual_contact()) ? 1 : (data->phone.isEmpty() ? -1 : 0); - if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsNoButton) != dbiprsNoButton) { - cRefReportSpamStatuses().insert(data->id, dbiprsNoButton); + if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsHidden) != dbiprsHidden) { + cRefReportSpamStatuses().insert(data->id, dbiprsHidden); Local::writeReportSpamStatuses(); } if (d.is_self() && ::self != data) { @@ -1158,8 +1158,8 @@ namespace App { switch (myLink.type()) { case mtpc_contactLinkContact: user->contact = 1; - if (user->contact == 1 && cReportSpamStatuses().value(user->id, dbiprsNoButton) != dbiprsNoButton) { - cRefReportSpamStatuses().insert(user->id, dbiprsNoButton); + if (user->contact == 1 && cReportSpamStatuses().value(user->id, dbiprsHidden) != dbiprsHidden) { + cRefReportSpamStatuses().insert(user->id, dbiprsHidden); Local::writeReportSpamStatuses(); } break; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index b9377a748d..4a74b85fdd 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -7417,9 +7417,6 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { text = lng_action_add_users_many(lt_from, from, lt_users, text); } if (foundSelf) { - if (unread() && history()->peer->isChat() && !history()->peer->asChat()->inviterForSpamReport && _from->isUser()) { - history()->peer->asChat()->inviterForSpamReport = peerToUser(_from->id); - } if (history()->peer->isMegagroup()) { history()->peer->asChannel()->mgInfo->joinedMessageFound = true; } @@ -7443,11 +7440,6 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) { case mtpc_messageActionChatCreate: { const MTPDmessageActionChatCreate &d(action.c_messageActionChatCreate()); text = lng_action_created_chat(lt_from, from, lt_title, textClean(qs(d.vtitle))); - if (unread()) { - if (history()->peer->isChat() && !history()->peer->asChat()->inviterForSpamReport && _from->isUser() && peerToUser(_from->id) != MTP::authedId()) { - history()->peer->asChat()->inviterForSpamReport = peerToUser(_from->id); - } - } } break; case mtpc_messageActionChannelCreate: { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 63cb7abee8..80137d8ecc 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -2647,6 +2647,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _pinnedBar(0) , _saveEditMsgRequestId(0) , _reportSpamStatus(dbiprsUnknown) +, _reportSpamSettingRequestId(ReportSpamRequestNeeded) , _previewData(0) , _previewRequest(0) , _previewCancelled(false) @@ -3644,6 +3645,10 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re } _unblockRequest = _reportSpamRequest = 0; + if (_reportSpamSettingRequestId > 0) { + MTP::cancel(_reportSpamSettingRequestId); + } + _reportSpamSettingRequestId = ReportSpamRequestNeeded; _titlePeerText = QString(); _titlePeerTextWidth = 0; @@ -3789,96 +3794,94 @@ bool HistoryWidget::contentOverlapped(const QRect &globalRect) { void HistoryWidget::updateReportSpamStatus() { if (!_peer || (_peer->isUser() && (peerToUser(_peer->id) == MTP::authedId() || isNotificationsUser(_peer->id) || isServiceUser(_peer->id) || _peer->asUser()->botInfo))) { - _reportSpamStatus = dbiprsNoButton; + _reportSpamStatus = dbiprsHidden; return; } else { ReportSpamStatuses::const_iterator i = cReportSpamStatuses().constFind(_peer->id); if (i != cReportSpamStatuses().cend()) { _reportSpamStatus = i.value(); + if (_reportSpamStatus == dbiprsNoButton) { + _reportSpamStatus = dbiprsHidden; + if (!_peer->isUser() || _peer->asUser()->contact < 1) { + MTP::send(MTPmessages_HideReportSpam(_peer->input)); + } + + cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus); + Local::writeReportSpamStatuses(); + } else if (_reportSpamStatus == dbiprsShowButton) { + requestReportSpamSetting(); + } _reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent, _peer); return; } else if (_peer->migrateFrom()) { // migrate report status i = cReportSpamStatuses().constFind(_peer->migrateFrom()->id); if (i != cReportSpamStatuses().cend()) { _reportSpamStatus = i.value(); - _reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent, _peer); + if (_reportSpamStatus == dbiprsNoButton) { + _reportSpamStatus = dbiprsHidden; + if (!_peer->isUser() || _peer->asUser()->contact < 1) { + MTP::send(MTPmessages_HideReportSpam(_peer->input)); + } + } else if (_reportSpamStatus == dbiprsShowButton) { + requestReportSpamSetting(); + } cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus); Local::writeReportSpamStatuses(); + + _reportSpamPanel.setReported(_reportSpamStatus == dbiprsReportSent, _peer); return; } } } - if (!cContactsReceived() || _firstLoadRequest) { + if (!cContactsReceived()) { _reportSpamStatus = dbiprsUnknown; - } else if (!_history->loadedAtTop() && (_history->blocks.size() < 2 || (_history->blocks.size() == 2 && _history->blocks.at(1)->items.size() < 2))) { - _reportSpamStatus = dbiprsUnknown; - } else if (_peer->isUser()) { - if (_peer->asUser()->contact > 0) { - _reportSpamStatus = dbiprsNoButton; - } else { - bool anyFound = false, outFound = false; - for (int32 i = 0, l = _history->blocks.size(); i < l; ++i) { - for (int32 j = 0, c = _history->blocks.at(i)->items.size(); j < c; ++j) { - anyFound = true; - if (_history->blocks.at(i)->items.at(j)->out()) { - outFound = true; - break; - } - } - } - if (anyFound) { - if (outFound) { - _reportSpamStatus = dbiprsNoButton; - } else { - _reportSpamStatus = dbiprsShowButton; - } - } else { - _reportSpamStatus = dbiprsUnknown; - } - } - } else if (_peer->isChat()) { - if (_peer->asChat()->inviterForSpamReport > 0) { - UserData *user = App::userLoaded(_peer->asChat()->inviterForSpamReport); - if (user && user->contact > 0) { - _reportSpamStatus = dbiprsNoButton; - } else { - _reportSpamStatus = dbiprsShowButton; - } - } else { - _reportSpamStatus = dbiprsNoButton; - } - } else if (_peer->isChannel()) { - if (_peer->migrateFrom() && _peer->migrateFrom()->isChat()) { - if (_peer->migrateFrom()->asChat()->inviterForSpamReport > 0) { - UserData *user = App::userLoaded(_peer->migrateFrom()->asChat()->inviterForSpamReport); - if (user && user->contact > 0) { - _reportSpamStatus = dbiprsNoButton; - } else { - _reportSpamStatus = dbiprsShowButton; - } - } else { - _reportSpamStatus = dbiprsNoButton; - } - } else if (!_peer->asChannel()->inviter || _history->asChannelHistory()->maxReadMessageDate().isNull()) { - _reportSpamStatus = dbiprsUnknown; - } else if (_peer->asChannel()->inviter > 0) { - UserData *user = App::userLoaded(_peer->asChannel()->inviter); - if ((user && user->contact > 0) || (_peer->asChannel()->inviter == MTP::authedId()) || _history->asChannelHistory()->maxReadMessageDate() > _peer->asChannel()->inviteDate) { - _reportSpamStatus = dbiprsNoButton; - } else { - _reportSpamStatus = dbiprsShowButton; - } - } else { - _reportSpamStatus = dbiprsNoButton; - } + } else if (_peer->isUser() && _peer->asUser()->contact > 0) { + _reportSpamStatus = dbiprsHidden; + } else { + _reportSpamStatus = dbiprsRequesting; + requestReportSpamSetting(); } - if (_reportSpamStatus == dbiprsShowButton || _reportSpamStatus == dbiprsNoButton) { + if (_reportSpamStatus == dbiprsHidden) { _reportSpamPanel.setReported(false, _peer); cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus); Local::writeReportSpamStatuses(); } } +void HistoryWidget::requestReportSpamSetting() { + if (_reportSpamSettingRequestId >= 0 || !_peer) return; + + _reportSpamSettingRequestId = MTP::send(MTPmessages_GetPeerSettings(_peer->input), rpcDone(&HistoryWidget::reportSpamSettingDone), rpcFail(&HistoryWidget::reportSpamSettingFail)); +} + +void HistoryWidget::reportSpamSettingDone(const MTPPeerSettings &result, mtpRequestId req) { + if (req != _reportSpamSettingRequestId) return; + + _reportSpamSettingRequestId = 0; + if (result.type() == mtpc_peerSettings) { + const MTPDpeerSettings &d(result.c_peerSettings()); + DBIPeerReportSpamStatus status = d.is_report_spam() ? dbiprsShowButton : dbiprsHidden; + if (status != _reportSpamStatus) { + _reportSpamStatus = status; + _reportSpamPanel.setReported(false, _peer); + + cRefReportSpamStatuses().insert(_peer->id, _reportSpamStatus); + Local::writeReportSpamStatuses(); + + updateControlsVisibility(); + } + } +} + +bool HistoryWidget::reportSpamSettingFail(const RPCError &error, mtpRequestId req) { + if (mtpIsFlood(error)) return false; + + if (req == _reportSpamSettingRequestId) { + req = 0; + } + return true; +} + void HistoryWidget::updateControlsVisibility() { _topShadow.setVisible(_peer ? true : false); if (!_history || _a_show.animating()) { @@ -4166,7 +4169,7 @@ void HistoryWidget::historyCleared(History *history) { bool HistoryWidget::messagesFailed(const RPCError &error, mtpRequestId requestId) { if (mtpIsFlood(error)) return false; - if (error.type() == qstr("CHANNEL_PRIVATE") || error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")) { + if (error.type() == qstr("CHANNEL_PRIVATE") || error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA") || error.type() == qstr("USER_BANNED_IN_CHANNEL")) { PeerData *was = _peer; Ui::showChatsList(); Ui::showLayer(new InformBox(lang((was && was->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible))); @@ -4762,7 +4765,7 @@ bool HistoryWidget::joinFail(const RPCError &error, mtpRequestId req) { if (mtpIsFlood(error)) return false; if (_unblockRequest == req) _unblockRequest = 0; - if (error.type() == qstr("CHANNEL_PRIVATE") || error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")) { + if (error.type() == qstr("CHANNEL_PRIVATE") || error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA") || error.type() == qstr("USER_BANNED_IN_CHANNEL")) { Ui::showLayer(new InformBox(lang((_peer && _peer->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible))); return true; } @@ -6074,10 +6077,12 @@ bool HistoryWidget::reportSpamFail(const RPCError &error, mtpRequestId req) { void HistoryWidget::onReportSpamHide() { if (_peer) { - cRefReportSpamStatuses().insert(_peer->id, dbiprsNoButton); + cRefReportSpamStatuses().insert(_peer->id, dbiprsHidden); Local::writeReportSpamStatuses(); + + MTP::send(MTPmessages_HideReportSpam(_peer->input)); } - _reportSpamStatus = dbiprsNoButton; + _reportSpamStatus = dbiprsHidden; updateControlsVisibility(); } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index aed43ca6cc..a787bb978d 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -759,7 +759,12 @@ private: bool saveEditMsgFail(History *history, const RPCError &error, mtpRequestId req); DBIPeerReportSpamStatus _reportSpamStatus; + mtpRequestId _reportSpamSettingRequestId; + static const mtpRequestId ReportSpamRequestNeeded = -1; void updateReportSpamStatus(); + void requestReportSpamSetting(); + void reportSpamSettingDone(const MTPPeerSettings &result, mtpRequestId req); + bool reportSpamSettingFail(const RPCError &error, mtpRequestId req); QString _previewLinks; WebPageData *_previewData; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 629360d285..a5c5c8a0b9 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -351,7 +351,14 @@ class PhotoData; class UserData : public PeerData { public: - UserData(const PeerId &id) : PeerData(id), access(0), flags(0), onlineTill(0), contact(-1), blocked(UserBlockUnknown), photosCount(-1), botInfo(0) { + UserData(const PeerId &id) : PeerData(id) + , access(0) + , flags(0) + , onlineTill(0) + , contact(-1) + , blocked(UserBlockUnknown) + , photosCount(-1) + , botInfo(0) { setName(QString(), QString(), QString(), QString()); } void setPhoto(const MTPUserProfilePhoto &photo); @@ -399,7 +406,16 @@ static UserData * const InlineBotLookingUpData = SharedMemoryLocation 0 - user who invited me to chat in unread service msg, < 0 - have outgoing message int32 flags; bool isForbidden; @@ -477,14 +492,14 @@ enum PtsSkippedQueue { class PtsWaiter { public: - PtsWaiter() : - _good(0), - _last(0), - _count(0), - _applySkippedLevel(0), - _requesting(false), - _waitingForSkipped(false), - _waitingForShortPoll(false) { + PtsWaiter() + : _good(0) + , _last(0) + , _count(0) + , _applySkippedLevel(0) + , _requesting(false) + , _waitingForSkipped(false) + , _waitingForShortPoll(false) { } void init(int32 pts) { _good = _last = _count = pts; @@ -567,7 +582,19 @@ struct MegagroupInfo { class ChannelData : public PeerData { public: - ChannelData(const PeerId &id) : PeerData(id), access(0), inputChannel(MTP_inputChannel(MTP_int(bareId()), MTP_long(0))), count(1), adminsCount(1), date(0), version(0), flags(0), flagsFull(0), mgInfo(0), isForbidden(true), inviter(0), _lastFullUpdate(0) { + ChannelData(const PeerId &id) : PeerData(id) + , access(0) + , inputChannel(MTP_inputChannel(MTP_int(bareId()), MTP_long(0))) + , count(1) + , adminsCount(1) + , date(0) + , version(0) + , flags(0) + , flagsFull(0) + , mgInfo(nullptr) + , isForbidden(true) + , inviter(0) + , _lastFullUpdate(0) { setName(QString(), QString()); } void setPhoto(const MTPChatPhoto &photo, const PhotoId &phId = UnknownPeerPhotoId); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 032d69a3f2..5cf498de29 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -397,10 +397,12 @@ enum DBIPlatform { }; enum DBIPeerReportSpamStatus { - dbiprsNoButton, - dbiprsUnknown, - dbiprsShowButton, - dbiprsReportSent, + dbiprsNoButton = 0, // hidden, but not in the cloud settings yet + dbiprsUnknown = 1, // contacts not loaded yet + dbiprsShowButton = 2, // show report spam button, each show peer request setting from cloud + dbiprsReportSent = 3, // report sent, but the report spam panel is not hidden yet + dbiprsHidden = 4, // hidden in the cloud or not needed (bots, contacts, etc), no more requests + dbiprsRequesting = 5, // requesting the cloud setting right now }; typedef enum { From bf5a5fd5290e7233de89906efd02eef4cc996602 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 12 Mar 2016 19:38:17 +0300 Subject: [PATCH 179/316] fixed mentionsdropdown with pinned message display --- Telegram/SourceFiles/dropdown.cpp | 6 +++--- Telegram/SourceFiles/historywidget.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 0241da6b79..87d4501962 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4578,10 +4578,10 @@ void MentionsDropdown::recount(bool resetScroll) { if (h > _boundings.height()) h = _boundings.height(); if (h > maxh) h = maxh; if (width() != _boundings.width() || height() != h) { - setGeometry(0, _boundings.height() - h, _boundings.width(), h); + setGeometry(_boundings.x(), _boundings.y() + _boundings.height() - h, _boundings.width(), h); _scroll.resize(_boundings.width(), h); - } else if (y() != _boundings.height() - h) { - move(0, _boundings.height() - h); + } else if (y() != _boundings.y() + _boundings.height() - h) { + move(_boundings.x(), _boundings.y() + _boundings.height() - h); } if (resetScroll) st = 0; if (st != oldst) _scroll.scrollToY(st); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 80137d8ecc..ee0d57ae8a 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6193,11 +6193,15 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { _field.move(_attachDocument.x() + _attachDocument.width(), height() - kbh - _field.height() - st::sendPadding); if (_pinnedBar) { - _scroll.move(0, st::replyHeight); + if (_scroll.y() != st::replyHeight) { + _scroll.move(0, st::replyHeight); + _attachMention.setBoundings(_scroll.geometry()); + } _pinnedBar->cancel.move(width() - _pinnedBar->cancel.width(), 0); _pinnedBar->shadow.setGeometry(0, st::replyHeight, width(), st::lineWidth); - } else { - _scroll.move(0, _pinnedBar ? st::replyHeight : 0); + } else if (_scroll.y() != 0) { + _scroll.move(0, 0); + _attachMention.setBoundings(_scroll.geometry()); } _attachDocument.move(0, height() - kbh - _attachDocument.height()); From 4c13377d1e2469a05cb7f3decdeea4c7ed24ce4c Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 12 Mar 2016 21:52:46 +0300 Subject: [PATCH 180/316] fixed pinned bar delayed message load updating --- Telegram/SourceFiles/historywidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index ee0d57ae8a..4a8a352e76 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6818,6 +6818,7 @@ void HistoryWidget::updatePinnedBar(bool force) { } if (_pinnedBar->msg) { _pinnedBar->text.setText(st::msgFont, _pinnedBar->msg->inDialogsText(), _textDlgOptions); + update(); } else if (force) { if (_peer && _peer->isMegagroup()) { _peer->asChannel()->mgInfo->pinnedMsgId = 0; From 6792f9c77b6cbb7ca429c7d3eebdcf657e30b021 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 16:21:26 +0300 Subject: [PATCH 181/316] fixed pinned message display if input field is hidden, fixed pinned message remove, removed copy post link context menu item from public supergroup messages --- Telegram/SourceFiles/history.h | 2 +- Telegram/SourceFiles/historywidget.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 3cbcf5ccd3..abc72437ff 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1097,7 +1097,7 @@ public: bool canEdit(const QDateTime &cur) const; bool hasDirectLink() const { - return id > 0 && _history->peer->isChannel() && _history->peer->asChannel()->isPublic(); + return id > 0 && _history->peer->isChannel() && _history->peer->asChannel()->isPublic() && !_history->peer->isMegagroup(); } QString directLink() const { return hasDirectLink() ? qsl("https://telegram.me/") + _history->peer->asChannel()->username + '/' + QString::number(id) : QString(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 4a8a352e76..4d5dc0db9b 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6876,6 +6876,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { _pinnedBar = nullptr; result = true; _scroll.scrollToY(_scroll.scrollTop() - st::replyHeight); + resizeEvent(0); } return result; } @@ -7889,9 +7890,9 @@ void HistoryWidget::paintEvent(QPaintEvent *e) { drawRecordButton(p); if (_recording) drawRecording(p); } - if (_pinnedBar) { - drawPinnedBar(p); - } + } + if (_pinnedBar && !_pinnedBar->cancel.isHidden()) { + drawPinnedBar(p); } if (_scroll.isHidden()) { QPoint dogPos((width() - st::msgDogImg.pxWidth()) / 2, ((height() - _field.height() - 2 * st::sendPadding - st::msgDogImg.pxHeight()) * 4) / 9); From b09aa49749da36dc13a55ecc399764205c0132a1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 16:25:19 +0300 Subject: [PATCH 182/316] not sending typing when edit post is finished --- Telegram/SourceFiles/historywidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 4d5dc0db9b..1a6e8e947d 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -7228,7 +7228,11 @@ void HistoryWidget::cancelEdit() { updateMouseTracking(); } + int32 old = _textUpdateEventsFlags; + _textUpdateEventsFlags = 0; onTextChange(); + _textUpdateEventsFlags = old; + updateBotKeyboard(); updateFieldPlaceholder(); From 621052645c07fe4c23d53a4302e998c669cbdb7f Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 16:34:27 +0300 Subject: [PATCH 183/316] fixed searchInPeer when some search was active already --- Telegram/SourceFiles/dialogswidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index 620e3b9dd8..a90b299a7b 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -2094,6 +2094,7 @@ void DialogsWidget::onChooseByDrag() { void DialogsWidget::searchMessages(const QString &query, PeerData *inPeer) { if ((_filter.getLastText() != query) || (inPeer && inPeer != _searchInPeer && inPeer->migrateTo() != _searchInPeer)) { if (inPeer) { + onCancelSearch(); _searchInPeer = inPeer->migrateTo() ? inPeer->migrateTo() : inPeer; _searchInMigrated = _searchInPeer ? _searchInPeer->migrateFrom() : 0; _inner.searchInPeer(_searchInPeer); From 86a4a388c3dd1a215b3d06240be5f81d3d8d9577 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 18:45:00 +0300 Subject: [PATCH 184/316] ban / report / deleteAll done in MainWidget instead of RichDeleteMessageBox --- Telegram/SourceFiles/app.h | 9 ++ Telegram/SourceFiles/boxes/confirmbox.cpp | 154 +++------------------- Telegram/SourceFiles/boxes/confirmbox.h | 11 -- Telegram/SourceFiles/history.h | 6 + Telegram/SourceFiles/mainwidget.cpp | 59 ++++++++- Telegram/SourceFiles/mainwidget.h | 9 +- 6 files changed, 92 insertions(+), 156 deletions(-) diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 4fabd34d87..aeaaf5c87b 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -144,6 +144,15 @@ namespace App { History *historyFromDialog(const PeerId &peer, int32 unreadCnt, int32 maxInboxRead); History *historyLoaded(const PeerId &peer); HistoryItem *histItemById(ChannelId channelId, MsgId itemId); + inline History *history(const PeerData *peer) { + return history(peer->id); + } + inline History *historyLoaded(const PeerData *peer) { + return historyLoaded(peer->id); + } + inline HistoryItem *histItemById(const ChannelData *channel, MsgId itemId) { + return histItemById(channel ? peerToChannel(channel->id) : 0, itemId); + } inline HistoryItem *histItemById(const FullMsgId &msgId) { return histItemById(msgId.channel, msgId.msg); } diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index 5c9e5f1527..b73b15d896 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -444,11 +444,9 @@ RichDeleteMessageBox::RichDeleteMessageBox(ChannelData *channel, UserData *from, , _reportSpam(this, lang(lng_report_spam), false) , _deleteAll(this, lang(lng_delete_all_from), false) , _delete(this, lang(lng_box_delete), st::defaultBoxButton) -, _cancel(this, lang(lng_cancel), st::cancelBoxButton) -, _deleteRequestId(0) -, _banRequestId(0) -, _reportRequestId(0) -, _deleteAllRequestId(0) { +, _cancel(this, lang(lng_cancel), st::cancelBoxButton) { + t_assert(_channel != nullptr); + _text.resizeToWidth(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()); setMaxHeight(st::boxPadding.top() + _text.height() + st::boxMediumSkip + _banUser.height() + st::boxLittleSkip + _reportSpam.height() + st::boxLittleSkip + _deleteAll.height() + st::boxPadding.bottom() + st::boxButtonPadding.top() + _delete.height() + st::boxButtonPadding.bottom()); @@ -466,54 +464,26 @@ void RichDeleteMessageBox::resizeEvent(QResizeEvent *e) { } void RichDeleteMessageBox::onDelete() { - if (_deleteRequestId || _banRequestId || _reportRequestId || _deleteAllRequestId) return; - - HistoryItem *item = App::histItemById(_channel ? peerToChannel(_channel->id) : 0, _msgId); - if (!item || item->type() != HistoryItemMsg) { - Ui::hideLayer(); - return; + if (_banUser.checked()) { + MTP::send(MTPchannels_KickFromChannel(_channel->inputChannel, _from->inputUser, MTP_boolTrue()), App::main()->rpcDone(&MainWidget::sentUpdatesReceived)); } - - QVector toDelete(1, MTP_int(item->id)); - History *h = item->history(); - bool deleteItem = (item->id > 0), lastDeleted = (h->lastMsg == item); - bool banUser = _banUser.checked(), reportSpam = _reportSpam.checked(), deleteAll = _deleteAll.checked(); - - item->destroy(); - if (deleteItem) { - _deleteRequestId = MTP::send(MTPchannels_DeleteMessages(_channel->inputChannel, MTP_vector(1, MTP_int(item->id))), rpcDone(&RichDeleteMessageBox::deleteDone), rpcFail(&RichDeleteMessageBox::deleteFail)); + if (_reportSpam.checked()) { + MTP::send(MTPchannels_ReportSpam(_channel->inputChannel, _from->inputUser, MTP_vector(1, MTP_int(_msgId)))); } - if (banUser) { - _banRequestId = MTP::send(MTPchannels_KickFromChannel(_channel->inputChannel, _from->inputUser, MTP_boolTrue()), rpcDone(&RichDeleteMessageBox::banDone), rpcFail(&RichDeleteMessageBox::deleteFail)); + if (_deleteAll.checked()) { + App::main()->deleteAllFromUser(_channel, _from); } - if (reportSpam) { - _reportRequestId = MTP::send(MTPchannels_ReportSpam(_channel->inputChannel, _from->inputUser, MTP_vector(1, MTP_int(item->id))), rpcDone(&RichDeleteMessageBox::reportDone), rpcFail(&RichDeleteMessageBox::deleteFail)); - } - if (deleteAll) { - QVector toDestroy; - for (History::Blocks::const_iterator i = h->blocks.cbegin(), e = h->blocks.cend(); i != e; ++i) { - for (HistoryBlock::Items::const_iterator j = (*i)->items.cbegin(), n = (*i)->items.cend(); j != n; ++j) { - if ((*j)->from() == _from && (*j)->type() == HistoryItemMsg && (*j)->canDelete()) { - toDestroy.push_back((*j)->id); - } - } + if (auto item = App::histItemById(_channel ? peerToChannel(_channel->id) : 0, _msgId)) { + bool wasLast = (item->history()->lastMsg == item); + item->destroy(); + if (_msgId > 0) { + App::main()->deleteMessages(_channel, QVector(1, MTP_int(_msgId))); + } else if (wasLast) { + App::main()->checkPeerHistory(_channel); } - for (QVector::const_iterator i = toDestroy.cbegin(), e = toDestroy.cend(); i != e; ++i) { - if (HistoryItem *item = App::histItemById(peerToChannel(_channel->id), *i)) { - if (item == h->lastMsg) { - lastDeleted = true; - } - item->destroy(); - } - } - _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); } - - if (!deleteItem && !deleteAll && lastDeleted && !h->lastMsg) { - App::main()->checkPeerHistory(h->peer); - } - Notify::historyItemsResized(); + Ui::hideLayer(); } void RichDeleteMessageBox::showAll() { @@ -533,93 +503,3 @@ void RichDeleteMessageBox::hideAll() { _delete.hide(); _cancel.hide(); } - -void RichDeleteMessageBox::deleteDone(const MTPmessages_AffectedMessages &result, mtpRequestId req) { - const MTPDmessages_affectedMessages &d(result.c_messages_affectedMessages()); - if (_channel->ptsUpdated(d.vpts.v, d.vpts_count.v)) { - _channel->ptsApplySkippedUpdates(); - App::emitPeerUpdated(); - } - if (History *h = App::historyLoaded(_channel->id)) { - if (!h->lastMsg && App::main()) { - App::main()->checkPeerHistory(_channel); - } - } - if (req == _deleteRequestId) { - _deleteRequestId = 0; - } else if (req == _banRequestId) { - _banRequestId = 0; - } else if (req == _reportRequestId) { - _reportRequestId = 0; - } else if (req == _deleteAllRequestId) { - _deleteAllRequestId = 0; - } - checkFinished(); -} - -void RichDeleteMessageBox::banDone(const MTPUpdates &result, mtpRequestId req) { - if (App::main()) { - App::main()->sentUpdatesReceived(result); - } - if (req == _banRequestId) { - _banRequestId = 0; - } - checkFinished(); -} - -void RichDeleteMessageBox::reportDone(const MTPBool &result, mtpRequestId req) { - if (req == _reportRequestId) { - _reportRequestId = 0; - } - checkFinished(); -} - -void RichDeleteMessageBox::deleteAllPart(const MTPmessages_AffectedHistory &result, mtpRequestId req) { - const MTPDmessages_affectedHistory &d(result.c_messages_affectedHistory()); - if (_channel->ptsUpdated(d.vpts.v, d.vpts_count.v)) { - _channel->ptsApplySkippedUpdates(); - App::emitPeerUpdated(); - } - if (req == _deleteRequestId) { - _deleteRequestId = 0; - } else if (req == _banRequestId) { - _banRequestId = 0; - } else if (req == _reportRequestId) { - _reportRequestId = 0; - } else if (req == _deleteAllRequestId) { - _deleteAllRequestId = 0; - } - - int32 offset = d.voffset.v; - if (offset > 0) { - _deleteAllRequestId = MTP::send(MTPchannels_DeleteUserHistory(_channel->inputChannel, _from->inputUser), rpcDone(&RichDeleteMessageBox::deleteAllPart), rpcFail(&RichDeleteMessageBox::deleteFail)); - return; - } - - if (History *h = App::historyLoaded(_channel->id)) { - if (!h->lastMsg && App::main()) { - App::main()->checkPeerHistory(_channel); - } - } - checkFinished(); -} - -bool RichDeleteMessageBox::deleteFail(const RPCError &error, mtpRequestId req) { - if (mtpIsFlood(error)) return false; - if (req == _deleteRequestId) { - _deleteRequestId = 0; - } else if (req == _banRequestId) { - _banRequestId = 0; - } else if (req == _reportRequestId) { - _reportRequestId = 0; - } else if (req == _deleteAllRequestId) { - _deleteAllRequestId = 0; - } - checkFinished(); - return true; -} - -void RichDeleteMessageBox::checkFinished() { - if (_deleteRequestId || _banRequestId || _reportRequestId || _deleteAllRequestId) return; - Ui::hideLayer(); -} \ No newline at end of file diff --git a/Telegram/SourceFiles/boxes/confirmbox.h b/Telegram/SourceFiles/boxes/confirmbox.h index 6937b2c107..05b8febf35 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.h +++ b/Telegram/SourceFiles/boxes/confirmbox.h @@ -220,15 +220,6 @@ protected: private: - void deleteDone(const MTPmessages_AffectedMessages &result, mtpRequestId req); - void banDone(const MTPUpdates &result, mtpRequestId req); - void reportDone(const MTPBool &result, mtpRequestId req); - void deleteAllPart(const MTPmessages_AffectedHistory &result, mtpRequestId req); - - bool deleteFail(const RPCError &error, mtpRequestId req); - - void checkFinished(); - ChannelData *_channel; UserData *_from; MsgId _msgId; @@ -238,6 +229,4 @@ private: BoxButton _delete, _cancel; - mtpRequestId _deleteRequestId, _banRequestId, _reportRequestId, _deleteAllRequestId; - }; diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index abc72437ff..928c2d9c4f 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1096,6 +1096,12 @@ public: bool canEdit(const QDateTime &cur) const; + bool suggestBanReportDeleteAll() const { + auto channel = history()->peer->asChannel(); + if (!channel || (!channel->amEditor() && !channel->amCreator())) return false; + return !isPost() && !out() && from()->isUser() && toHistoryMessage(); + } + bool hasDirectLink() const { return id > 0 && _history->peer->isChannel() && _history->peer->asChannel()->isPublic() && !_history->peer->isMegagroup(); } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 471d941f6c..6b51634d3b 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -909,10 +909,9 @@ void MainWidget::forwardLayer(int32 forwardSelected) { void MainWidget::deleteLayer(int32 selectedCount) { if (selectedCount == -1 && !overview) { - if (HistoryItem *item = App::contextItem()) { - ChannelData *channel = item->history()->peer->asChannel(); - if (channel && !item->isPost() && !item->out() && item->from()->isUser() && (channel->amCreator() || channel->amEditor())) { - Ui::showLayer(new RichDeleteMessageBox(channel, item->from()->asUser(), item->id)); + if (auto item = App::contextItem()) { + if (item->suggestBanReportDeleteAll()) { + Ui::showLayer(new RichDeleteMessageBox(item->history()->peer->asChannel(), item->from()->asUser(), item->id)); return; } } @@ -992,9 +991,16 @@ void MainWidget::deleteHistoryAfterLeave(PeerData *peer, const MTPUpdates &updat void MainWidget::deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHistory &result) { const MTPDmessages_affectedHistory &d(result.c_messages_affectedHistory()); - if (ptsUpdated(d.vpts.v, d.vpts_count.v)) { - ptsApplySkippedUpdates(); - App::emitPeerUpdated(); + if (peer && peer->isChannel()) { + if (peer->asChannel()->ptsUpdated(d.vpts.v, d.vpts_count.v)) { + peer->asChannel()->ptsApplySkippedUpdates(); + App::emitPeerUpdated(); + } + } else { + if (ptsUpdated(d.vpts.v, d.vpts_count.v)) { + ptsApplySkippedUpdates(); + App::emitPeerUpdated(); + } } int32 offset = d.voffset.v; @@ -1057,6 +1063,45 @@ void MainWidget::deleteConversation(PeerData *peer, bool deleteHistory) { } } +void MainWidget::deleteAllFromUser(ChannelData *channel, UserData *from) { + t_assert(channel != nullptr && from != nullptr); + + QVector toDestroy; + if (auto history = App::historyLoaded(channel->id)) { + for (auto i = history->blocks.cbegin(), e = history->blocks.cend(); i != e; ++i) { + for (auto j = (*i)->items.cbegin(), n = (*i)->items.cend(); j != n; ++j) { + if ((*j)->from() == from && (*j)->type() == HistoryItemMsg && (*j)->canDelete()) { + toDestroy.push_back((*j)->id); + } + } + } + for (auto i = toDestroy.cbegin(), e = toDestroy.cend(); i != e; ++i) { + if (auto item = App::histItemById(peerToChannel(channel->id), *i)) { + item->destroy(); + } + } + } + MTP::send(MTPchannels_DeleteUserHistory(channel->inputChannel, from->inputUser), rpcDone(&MainWidget::deleteAllFromUserPart, { channel, from })); +} + +void MainWidget::deleteAllFromUserPart(DeleteAllFromUserParams params, const MTPmessages_AffectedHistory &result) { + const MTPDmessages_affectedHistory &d(result.c_messages_affectedHistory()); + if (params.channel->ptsUpdated(d.vpts.v, d.vpts_count.v)) { + params.channel->ptsApplySkippedUpdates(); + App::emitPeerUpdated(); + } + + int32 offset = d.voffset.v; + if (!MTP::authedId()) return; + if (offset > 0) { + MTP::send(MTPchannels_DeleteUserHistory(params.channel->inputChannel, params.from->inputUser), rpcDone(&MainWidget::deleteAllFromUserPart, params)); + } else if (auto h = App::historyLoaded(params.channel)) { + if (!h->lastMsg) { + checkPeerHistory(params.channel); + } + } +} + void MainWidget::clearHistory(PeerData *peer) { if (History *h = App::historyLoaded(peer->id)) { if (h->lastMsg) { diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index ada84278ae..30e40dbc34 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -306,11 +306,11 @@ public: bool leaveChatFailed(PeerData *peer, const RPCError &e); void deleteHistoryAfterLeave(PeerData *peer, const MTPUpdates &updates); - void deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHistory &result); void deleteMessages(PeerData *peer, const QVector &ids); void deletedContact(UserData *user, const MTPcontacts_Link &result); void deleteConversation(PeerData *peer, bool deleteHistory = true); void clearHistory(PeerData *peer); + void deleteAllFromUser(ChannelData *channel, UserData *from); void addParticipants(PeerData *chatOrChannel, const QVector &users); bool addParticipantFail(UserData *user, const RPCError &e); @@ -562,6 +562,13 @@ private: void feedUpdateVector(const MTPVector &updates, bool skipMessageIds = false); void feedMessageIds(const MTPVector &updates); + void deleteHistoryPart(PeerData *peer, const MTPmessages_AffectedHistory &result); + struct DeleteAllFromUserParams { + ChannelData *channel; + UserData *from; + }; + void deleteAllFromUserPart(DeleteAllFromUserParams params, const MTPmessages_AffectedHistory &result); + void updateReceived(const mtpPrime *from, const mtpPrime *end); bool updateFail(const RPCError &e); From 0249d3fe618e87e78c84ce55d71a84301cdad799 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 19:01:43 +0300 Subject: [PATCH 185/316] improved create group / add members box, displaying info about supergroup when trying to add more than 200 members there --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/boxes/contactsbox.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index dc96bbfb83..31858f0eb6 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -568,6 +568,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_convert_feature4" = "— Creator can set a public link for the group"; "lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; "lng_profile_convert_confirm" = "Convert"; +"lng_profile_add_more_after_upgrade" = "You will be able to add up to {count:_not_used_|# member|# members} after you upgrade your group to a supergroup."; "lng_channel_comments_count" = "{count:_not_used_|# comment|# comments}"; "lng_channel_hide_comments" = "Hide comments"; diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index ebaf4018e8..be668e709a 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -427,7 +427,7 @@ void ContactsInner::paintDialog(Painter &p, PeerData *peer, ContactData *data, b sel = false; } } else { - if (data->inchat || data->check || selectedCount() >= ((_channel && _channel->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) { + if (data->inchat || data->check || selectedCount() >= Global::MegagroupSizeMax()) { sel = false; } } @@ -771,6 +771,8 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) { data->check = true; _checkedContacts.insert(peer, true); ++_selCount; + } else if ((!_channel || !_channel->isMegagroup()) && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) { + Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers); } if (cnt != _selCount) emit chosenChanged(); } @@ -1535,7 +1537,7 @@ void ContactsBox::paintEvent(QPaintEvent *e) { paintTitle(p, lang(lng_channel_admins)); } else if (_inner.chat() || _inner.creating() != CreatingGroupNone) { QString title(lang(addingAdmin ? lng_channel_add_admin : lng_profile_add_participant)); - QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(((_inner.channel() && _inner.channel()->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax()))); + QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax())); paintTitle(p, title, additional); } else if (_inner.bot()) { paintTitle(p, lang(lng_bot_choose_group)); From 0e8e0989323a6a954978c5094e4363dfa9c461ae Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 19:02:57 +0300 Subject: [PATCH 186/316] beta 9030002 --- Telegram/SourceFiles/config.h | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Version | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 0009490920..8807dc4d2d 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9030; static const wchar_t *AppVersionStr = L"0.9.30"; static const bool DevVersion = false; -#define BETA_VERSION (9030001ULL) // just comment this line to build public version +#define BETA_VERSION (9030002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 6db3f6b71b..df51f019c7 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,30,1 - PRODUCTVERSION 0,9,30,1 + FILEVERSION 0,9,30,2 + PRODUCTVERSION 0,9,30,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.30.1" + VALUE "FileVersion", "0.9.30.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.30.1" + VALUE "ProductVersion", "0.9.30.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 5fc3cb2b8b..0ce492c311 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.30 AppVersionStr 0.9.30 DevChannel 0 -BetaVersion 9030001 +BetaVersion 9030002 From 6706b3882d05a62faa67f77b72148106bdeca749 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 13 Mar 2016 20:50:00 +0300 Subject: [PATCH 187/316] shortcuts repeat mode is defined by the command --- Telegram/SourceFiles/shortcuts.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/shortcuts.cpp b/Telegram/SourceFiles/shortcuts.cpp index 149bea95e2..d1258a8730 100644 --- a/Telegram/SourceFiles/shortcuts.cpp +++ b/Telegram/SourceFiles/shortcuts.cpp @@ -263,6 +263,13 @@ namespace Shortcuts { QMap sequences; QMap handlers; + + QSet autoRepeatCommands = { + qsl("media_previous"), + qsl("media_next"), + qsl("next_chat"), + qsl("previous_chat"), + }; }; void _createCommand(const QString &command, ShortcutCommands::Handler handler) { @@ -287,7 +294,9 @@ namespace Shortcuts { LOG(("Warning: could not find shortcut command handler '%1'").arg(command)); } else { QShortcut *shortcut(new QShortcut(seq, App::wnd(), nullptr, nullptr, Qt::ApplicationShortcut)); - shortcut->setAutoRepeat(false); + if (!DataPtr->autoRepeatCommands.contains(command)) { + shortcut->setAutoRepeat(false); + } int shortcutId = shortcut->id(); if (!shortcutId) { DataPtr->errors.push_back(qsl("Could not create shortcut '%1'!").arg(keys)); From 2a9f24d77404d03e29a76076dbc417bc6388d06f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 08:31:33 +0300 Subject: [PATCH 188/316] fixed destroy of pinned service msg (unreg dependency), displaying HistoryVideo in webpage-with-document --- Telegram/SourceFiles/history.cpp | 12 ++++++++++-- Telegram/SourceFiles/history.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 4a74b85fdd..f7550d8788 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3579,7 +3579,7 @@ ImagePtr HistoryPhoto::replyPreview() { return _data->makeReplyPreview(); } -HistoryVideo::HistoryVideo(DocumentData *document, const QString &caption, HistoryItem *parent) : HistoryFileMedia() +HistoryVideo::HistoryVideo(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() , _data(document) , _thumbw(1) , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) { @@ -3659,6 +3659,7 @@ int32 HistoryVideo::resize(int32 width, const HistoryItem *parent) { tw = width; } + _thumbw = qMax(tw, 1); int32 minWidth = qMax(st::minPhotoSize, parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x())); minWidth = qMax(minWidth, documentMaxStatusWidth(_data) + 2 * int32(st::msgDateImgDelta + st::msgDateImgPadding.x())); _width = qMax(_thumbw, int32(minWidth)); @@ -5245,6 +5246,8 @@ void HistoryWebPage::initDimensions(const HistoryItem *parent) { _attach = new HistorySticker(_data->doc); } else if (_data->doc->isAnimation()) { _attach = new HistoryGif(_data->doc, QString(), parent); + } else if (_data->doc->isVideo()) { + _attach = new HistoryVideo(_data->doc, QString(), parent); } else { _attach = new HistoryDocument(_data->doc, QString(), parent); } @@ -7840,7 +7843,12 @@ HistoryMedia *HistoryServiceMsg::getMedia(bool inOverview) const { } HistoryServiceMsg::~HistoryServiceMsg() { - delete _media; + if (auto pinned = Get()) { + if (pinned->msg) { + App::historyUnregDependency(this, pinned->msg); + } + } + deleteAndMark(_media); } HistoryDateMsg::HistoryDateMsg(History *history, HistoryBlock *block, const QDate &date) : diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 928c2d9c4f..b76268e1d1 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1527,7 +1527,7 @@ private: class HistoryVideo : public HistoryFileMedia { public: - HistoryVideo(DocumentData *document, const QString &caption, HistoryItem *parent); + HistoryVideo(DocumentData *document, const QString &caption, const HistoryItem *parent); HistoryVideo(const HistoryVideo &other); HistoryMediaType type() const { return MediaTypeVideo; From cab19a141fcd1b3a010a2925118e985092892034 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 08:54:24 +0300 Subject: [PATCH 189/316] no report spam if history is empty or there are out messages --- Telegram/SourceFiles/historywidget.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 1a6e8e947d..6523f1235d 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3796,6 +3796,13 @@ void HistoryWidget::updateReportSpamStatus() { if (!_peer || (_peer->isUser() && (peerToUser(_peer->id) == MTP::authedId() || isNotificationsUser(_peer->id) || isServiceUser(_peer->id) || _peer->asUser()->botInfo))) { _reportSpamStatus = dbiprsHidden; return; + } else if (!_firstLoadRequest && _history->isEmpty()) { + _reportSpamStatus = dbiprsNoButton; + if (cReportSpamStatuses().contains(_peer->id)) { + cRefReportSpamStatuses().remove(_peer->id); + Local::writeReportSpamStatuses(); + } + return; } else { ReportSpamStatuses::const_iterator i = cReportSpamStatuses().constFind(_peer->id); if (i != cReportSpamStatuses().cend()) { @@ -3833,7 +3840,7 @@ void HistoryWidget::updateReportSpamStatus() { } } } - if (!cContactsReceived()) { + if (!cContactsReceived() || _firstLoadRequest) { _reportSpamStatus = dbiprsUnknown; } else if (_peer->isUser() && _peer->asUser()->contact > 0) { _reportSpamStatus = dbiprsHidden; @@ -3851,7 +3858,20 @@ void HistoryWidget::updateReportSpamStatus() { void HistoryWidget::requestReportSpamSetting() { if (_reportSpamSettingRequestId >= 0 || !_peer) return; - _reportSpamSettingRequestId = MTP::send(MTPmessages_GetPeerSettings(_peer->input), rpcDone(&HistoryWidget::reportSpamSettingDone), rpcFail(&HistoryWidget::reportSpamSettingFail)); + bool outFound = false; + for (auto i : _history->blocks) { + for (auto j : i->items) { + if (j->out()) { + outFound = true; + break; + } + } + } + if (outFound) { + _reportSpamStatus = dbiprsNoButton; + } else { + _reportSpamSettingRequestId = MTP::send(MTPmessages_GetPeerSettings(_peer->input), rpcDone(&HistoryWidget::reportSpamSettingDone), rpcFail(&HistoryWidget::reportSpamSettingFail)); + } } void HistoryWidget::reportSpamSettingDone(const MTPPeerSettings &result, mtpRequestId req) { From b38163b026aada6b5971e337f0f1e0a49e8501b5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 09:10:24 +0300 Subject: [PATCH 190/316] adding / removing lastParticipants / lastAdmins in supergroups on adding / removing users / admins --- Telegram/SourceFiles/apiwrap.cpp | 14 +++++++++++--- Telegram/SourceFiles/boxes/contactsbox.cpp | 12 ++++++++++++ Telegram/SourceFiles/history.cpp | 13 ++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 3eecaf9eed..4632b36f19 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -633,15 +633,23 @@ void ApiWrap::kickParticipantDone(KickRequest kick, const MTPUpdates &result, mt int32 i = kick.first->asChannel()->mgInfo->lastParticipants.indexOf(kick.second); if (i >= 0) { kick.first->asChannel()->mgInfo->lastParticipants.removeAt(i); - kick.first->asChannel()->mgInfo->lastAdmins.remove(kick.second); } - kick.first->asChannel()->mgInfo->bots.remove(kick.second); if (kick.first->asChannel()->count > 1) { - kick.first->asChannel()->count--; + --kick.first->asChannel()->count; } else { kick.first->asChannel()->mgInfo->lastParticipantsStatus |= MegagroupInfo::LastParticipantsCountOutdated; kick.first->asChannel()->mgInfo->lastParticipantsCount = 0; } + if (kick.first->asChannel()->mgInfo->lastAdmins.contains(kick.second)) { + kick.first->asChannel()->mgInfo->lastAdmins.remove(kick.second); + if (kick.first->asChannel()->adminsCount > 1) { + --kick.first->asChannel()->adminsCount; + } + } + kick.first->asChannel()->mgInfo->bots.remove(kick.second); + if (kick.first->asChannel()->mgInfo->bots.isEmpty() && kick.first->asChannel()->mgInfo->botStatus > 0) { + kick.first->asChannel()->mgInfo->botStatus = -1; + } } emit fullPeerUpdated(kick.first); } diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index be668e709a..833054800d 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -257,6 +257,18 @@ void ContactsInner::addAdminDone(const MTPUpdates &result, mtpRequestId req) { if (req != _addAdminRequestId) return; _addAdminRequestId = 0; + if (_addAdmin && _channel && _channel->isMegagroup()) { + if (_channel->mgInfo->lastParticipants.indexOf(_addAdmin) < 0) { + _channel->mgInfo->lastParticipants.push_front(_addAdmin); + } + _channel->mgInfo->lastAdmins.insert(_addAdmin); + if (_addAdmin->botInfo) { + _channel->mgInfo->bots.insert(_addAdmin); + if (_channel->mgInfo->botStatus != 0 && _channel->mgInfo->botStatus < 2) { + _channel->mgInfo->botStatus = 2; + } + } + } if (_addAdminBox) _addAdminBox->onClose(); emit adminAdded(); } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f7550d8788..f3187d2491 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1454,7 +1454,18 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo if (index >= 0) { peer->asChannel()->mgInfo->lastParticipants.removeAt(index); } - peer->asChannel()->mgInfo->lastAdmins.remove(user); + if (peer->asChannel()->count > 1) { + --peer->asChannel()->count; + } else { + peer->asChannel()->mgInfo->lastParticipantsStatus |= MegagroupInfo::LastParticipantsCountOutdated; + peer->asChannel()->mgInfo->lastParticipantsCount = 0; + } + if (peer->asChannel()->mgInfo->lastAdmins.contains(user)) { + peer->asChannel()->mgInfo->lastAdmins.remove(user); + if (peer->asChannel()->adminsCount > 1) { + --peer->asChannel()->adminsCount; + } + } peer->asChannel()->mgInfo->bots.remove(user); if (peer->asChannel()->mgInfo->bots.isEmpty() && peer->asChannel()->mgInfo->botStatus > 0) { peer->asChannel()->mgInfo->botStatus = -1; From f25e63bad7d04fad27bf0ae07a606ab85f163d0f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 12:25:48 +0300 Subject: [PATCH 191/316] offering to send current username in crash report --- Telegram/SourceFiles/app.cpp | 3 + Telegram/SourceFiles/historywidget.cpp | 16 +----- Telegram/SourceFiles/logs.cpp | 16 +++++- Telegram/SourceFiles/logs.h | 2 + Telegram/SourceFiles/window.cpp | 79 ++++++++++++++++++++++++-- Telegram/SourceFiles/window.h | 12 ++++ 6 files changed, 108 insertions(+), 20 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 36ec4357c2..61e44eef0b 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -413,6 +413,9 @@ namespace App { QString pname = (showPhoneChanged || phoneChanged || nameChanged) ? ((showPhone && !phone.isEmpty()) ? formatPhone(phone) : QString()) : data->nameOrPhone; + if (!minimal && d.is_self() && uname != data->username) { + SignalHandlers::setSelfUsername(uname); + } data->setName(fname, lname, pname, uname); if (d.has_photo()) { data->setPhoto(d.vphoto); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 6523f1235d..a8dc52ad84 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3858,20 +3858,7 @@ void HistoryWidget::updateReportSpamStatus() { void HistoryWidget::requestReportSpamSetting() { if (_reportSpamSettingRequestId >= 0 || !_peer) return; - bool outFound = false; - for (auto i : _history->blocks) { - for (auto j : i->items) { - if (j->out()) { - outFound = true; - break; - } - } - } - if (outFound) { - _reportSpamStatus = dbiprsNoButton; - } else { - _reportSpamSettingRequestId = MTP::send(MTPmessages_GetPeerSettings(_peer->input), rpcDone(&HistoryWidget::reportSpamSettingDone), rpcFail(&HistoryWidget::reportSpamSettingFail)); - } + _reportSpamSettingRequestId = MTP::send(MTPmessages_GetPeerSettings(_peer->input), rpcDone(&HistoryWidget::reportSpamSettingDone), rpcFail(&HistoryWidget::reportSpamSettingFail)); } void HistoryWidget::reportSpamSettingDone(const MTPPeerSettings &result, mtpRequestId req) { @@ -6876,6 +6863,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { _pinnedBar->shadow.show(); } connect(&_pinnedBar->cancel, SIGNAL(clicked()), this, SLOT(onPinnedHide())); + _reportSpamPanel.raise(); _sideShadow.raise(); _topShadow.raise(); updatePinnedBar(); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 84bd345387..4cc7edd41f 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -739,8 +739,8 @@ namespace SignalHandlers { if (!LoggingCrashHeaderWritten) { LoggingCrashHeaderWritten = true; const AnnotationsMap c_ProcessAnnotations(ProcessAnnotations); - for (AnnotationsMap::const_iterator i = c_ProcessAnnotations.begin(), e = c_ProcessAnnotations.end(); i != e; ++i) { - dump() << i->first.c_str() << ": " << i->second.c_str() << "\n"; + for (const auto &i : c_ProcessAnnotations) { + dump() << i.first.c_str() << ": " << i.second.c_str() << "\n"; } psWriteDump(); dump() << "\n"; @@ -835,6 +835,7 @@ namespace SignalHandlers { } bool SetSignalHandlers = true; + bool CrashLogged = false; #if !defined Q_OS_MAC || defined MAC_USE_BREAKPAD google_breakpad::ExceptionHandler* BreakpadExceptionHandler = 0; @@ -846,6 +847,9 @@ namespace SignalHandlers { bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, bool success) #endif { + if (CrashLogged) return success; + CrashLogged = true; + #ifdef Q_OS_WIN BreakpadDumpPathW = _minidump_id; Handler(-1); @@ -1009,4 +1013,12 @@ namespace SignalHandlers { } } + void setSelfUsername(const QString &username) { + if (username.trimmed().isEmpty()) { + ProcessAnnotations.erase("Username"); + } else { + ProcessAnnotations["Username"] = username.toUtf8().constData(); + } + } + } diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index df23981171..1599ee408a 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -107,4 +107,6 @@ namespace SignalHandlers { Status restart(); // can be only CantOpen or Started void finish(); + void setSelfUsername(const QString &username); + } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 0618f76761..4d82a0711f 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2041,6 +2041,25 @@ void PreLaunchButton::setText(const QString &text) { resize(sizeHint()); } +PreLaunchCheckbox::PreLaunchCheckbox(QWidget *parent) : QCheckBox(parent) { + setTristate(false); + setCheckState(Qt::Checked); + + QFont closeFont(font()); + closeFont.setFamily(qsl("Open Sans Semibold")); + closeFont.setPixelSize(static_cast(parent)->basicSize()); + setFont(closeFont); + + setCursor(Qt::PointingHandCursor); + show(); +}; + +void PreLaunchCheckbox::setText(const QString &text) { + QCheckBox::setText(text); + updateGeometry(); + resize(sizeHint()); +} + NotStartedWindow::NotStartedWindow() : _label(this) , _log(this) @@ -2097,6 +2116,7 @@ LastCrashedWindow::LastCrashedWindow() , _showReport(this) , _saveReport(this) , _getApp(this) +, _includeUsername(this) , _reportText(QString::fromUtf8(Sandbox::LastCrashDump())) , _reportShown(false) , _reportSaved(false) @@ -2111,6 +2131,8 @@ LastCrashedWindow::LastCrashedWindow() , _updatingSkip(this, false) #endif { + excludeReportUsername(); + if (!cDevVersion() && !cBetaVersion()) { // currently accept crash reports only from testers _sendingState = SendingNoReport; } @@ -2214,7 +2236,9 @@ LastCrashedWindow::LastCrashedWindow() _yourReportName.setCursor(style::cur_text); _yourReportName.setTextInteractionFlags(Qt::TextSelectableByMouse); - _report.setPlainText(_reportText); + _includeUsername.setText(qsl("Include username @%1 as your contact info").arg(_reportUsername)); + + _report.setPlainText(_reportTextNoUsername); _showReport.setText(qsl("VIEW REPORT")); connect(&_showReport, SIGNAL(clicked()), this, SLOT(onViewReport())); @@ -2247,17 +2271,38 @@ void LastCrashedWindow::onSaveReport() { if (!to.isEmpty()) { QFile file(to); if (file.open(QIODevice::WriteOnly)) { - file.write(Sandbox::LastCrashDump()); + file.write(getCrashReportRaw()); _reportSaved = true; updateControls(); } } } +QByteArray LastCrashedWindow::getCrashReportRaw() const { + QByteArray result(Sandbox::LastCrashDump()); + if (!_reportUsername.isEmpty() && _includeUsername.checkState() != Qt::Checked) { + result.replace((qsl("Username: ") + _reportUsername).toUtf8(), "Username: _not_included_"); + } + return result; +} + void LastCrashedWindow::onGetApp() { QDesktopServices::openUrl(qsl("https://desktop.telegram.org")); } +void LastCrashedWindow::excludeReportUsername() { + QString prefix = qstr("Username:"); + QStringList lines = _reportText.split('\n'); + for (int32 i = 0, l = lines.size(); i < l; ++i) { + if (lines.at(i).trimmed().startsWith(prefix)) { + _reportUsername = lines.at(i).trimmed().mid(prefix.size()).trimmed(); + lines.removeAt(i); + break; + } + } + _reportTextNoUsername = _reportUsername.isEmpty() ? _reportText : lines.join('\n'); +} + QString LastCrashedWindow::getReportField(const QLatin1String &name, const QLatin1String &prefix) { QStringList lines = _reportText.split('\n'); for (int32 i = 0, l = lines.size(); i < l; ++i) { @@ -2441,7 +2486,7 @@ void LastCrashedWindow::onCheckingFinished() { QHttpPart reportPart; reportPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/octet-stream")); reportPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"report\"; filename=\"report.telegramcrash\"")); - reportPart.setBody(Sandbox::LastCrashDump()); + reportPart.setBody(getCrashReportRaw()); multipart->append(reportPart); QString dmpName = minidumpFileName(); @@ -2520,6 +2565,7 @@ void LastCrashedWindow::updateControls() { _continue.hide(); _pleaseSendReport.hide(); _yourReportName.hide(); + _includeUsername.hide(); _getApp.hide(); _showReport.hide(); _report.hide(); @@ -2537,6 +2583,7 @@ void LastCrashedWindow::updateControls() { if (_sendingState == SendingNoReport) { _pleaseSendReport.hide(); _yourReportName.hide(); + _includeUsername.hide(); _getApp.hide(); _showReport.hide(); _report.hide(); @@ -2549,6 +2596,12 @@ void LastCrashedWindow::updateControls() { h += _showReport.height() + padding + _yourReportName.height() + padding; _pleaseSendReport.show(); _yourReportName.show(); + if (_reportUsername.isEmpty()) { + _includeUsername.hide(); + } else { + h += _includeUsername.height() + padding; + _includeUsername.show(); + } if (_sendingState == SendingTooOld || _sendingState == SendingUnofficial) { QString verStr = getReportField(qstr("version"), qstr("Version:")); qint64 ver = verStr.isEmpty() ? 0 : verStr.toLongLong(); @@ -2557,6 +2610,10 @@ void LastCrashedWindow::updateControls() { _getApp.show(); h -= _yourReportName.height() + padding; // hide report name _yourReportName.hide(); + if (!_reportUsername.isEmpty()) { + h -= _includeUsername.height() + padding; + _includeUsername.hide(); + } } else { _getApp.hide(); } @@ -2612,6 +2669,7 @@ void LastCrashedWindow::updateControls() { _getApp.hide(); _pleaseSendReport.hide(); _yourReportName.hide(); + _includeUsername.hide(); _showReport.hide(); _report.hide(); _minidump.hide(); @@ -2634,6 +2692,7 @@ void LastCrashedWindow::updateControls() { if (_sendingState == SendingNoReport) { _pleaseSendReport.hide(); _yourReportName.hide(); + _includeUsername.hide(); _showReport.hide(); _report.hide(); _minidump.hide(); @@ -2646,6 +2705,12 @@ void LastCrashedWindow::updateControls() { h += _showReport.height() + padding + _yourReportName.height() + padding; _pleaseSendReport.show(); _yourReportName.show(); + if (_reportUsername.isEmpty()) { + _includeUsername.hide(); + } else { + h += _includeUsername.height() + padding; + _includeUsername.show(); + } if (_reportShown) { h += (_pleaseSendReport.height() * 12.5) + padding + (_minidumpName.isEmpty() ? 0 : (_minidump.height() + padding)); _report.show(); @@ -2888,6 +2953,7 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) { _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); _showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding); _yourReportName.move(padding, _showReport.y() + _showReport.height() + padding); + _includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding); _getApp.move((width() - _getApp.width()) / 2, _showReport.y() + _showReport.height() + padding); if (_sendingState == SendingFail || _sendingState == SendingProgress) { @@ -2909,10 +2975,15 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) { _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); _showReport.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); _yourReportName.move(padding, _showReport.y() + _showReport.height() + padding); + _includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding); _networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); #endif - _report.setGeometry(padding, _yourReportName.y() + _yourReportName.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); + if (_reportUsername.isEmpty()) { + _report.setGeometry(padding, _yourReportName.y() + _yourReportName.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); + } else { + _report.setGeometry(padding, _includeUsername.y() + _includeUsername.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); + } _minidump.move(padding, _report.y() + _report.height() + padding); _saveReport.move(_showReport.x(), _showReport.y()); diff --git a/Telegram/SourceFiles/window.h b/Telegram/SourceFiles/window.h index 774a232960..29b8566f9b 100644 --- a/Telegram/SourceFiles/window.h +++ b/Telegram/SourceFiles/window.h @@ -397,6 +397,12 @@ public: void setText(const QString &text); }; +class PreLaunchCheckbox : public QCheckBox { +public: + PreLaunchCheckbox(QWidget *parent); + void setText(const QString &text); +}; + class NotStartedWindow : public PreLaunchWindow { public: @@ -467,10 +473,16 @@ private: PreLaunchLabel _label, _pleaseSendReport, _yourReportName, _minidump; PreLaunchLog _report; PreLaunchButton _send, _sendSkip, _networkSettings, _continue, _showReport, _saveReport, _getApp; + PreLaunchCheckbox _includeUsername; QString _minidumpName, _minidumpFull, _reportText; + QString _reportUsername, _reportTextNoUsername; + QByteArray getCrashReportRaw() const; + bool _reportShown, _reportSaved; + void excludeReportUsername(); + enum SendingState { SendingNoReport, SendingUpdateCheck, From eb728fb36ec2dcc113e2a67e25dcfc4c8a44f068 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 12:48:53 +0300 Subject: [PATCH 192/316] calling connectTcp/Http even if _conn4 / _conn6 were already nulled --- .../SourceFiles/mtproto/mtpConnection.cpp | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 2a089a14f9..470bc0db34 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -1294,7 +1294,7 @@ void MTProtoConnectionPrivate::createConn(bool createIPv4, bool createIPv6) { void MTProtoConnectionPrivate::destroyConn(MTPabstractConnection **conn) { if (conn) { - MTPabstractConnection *toDisconnect = 0; + MTPabstractConnection *toDisconnect = nullptr; { QWriteLocker lock(&stateConnMutex); @@ -1305,7 +1305,7 @@ void MTProtoConnectionPrivate::destroyConn(MTPabstractConnection **conn) { disconnect(*conn, SIGNAL(error(bool)), 0, 0); disconnect(*conn, SIGNAL(receivedData()), 0, 0); disconnect(*conn, SIGNAL(receivedSome()), 0, 0); - *conn = 0; + *conn = nullptr; } } if (toDisconnect) { @@ -1315,7 +1315,7 @@ void MTProtoConnectionPrivate::destroyConn(MTPabstractConnection **conn) { } else { destroyConn(&_conn4); destroyConn(&_conn6); - _conn = 0; + _conn = nullptr; } } @@ -1324,9 +1324,9 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne , _needSessionReset(false) , dc(_dc) , _owner(owner) -, _conn(0) -, _conn4(0) -, _conn6(0) +, _conn(nullptr) +, _conn4(nullptr) +, _conn6(nullptr) , retryTimeout(1) , oldConnection(true) , _waitForReceived(MTPMinReceiveDelay) @@ -2072,17 +2072,17 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%3]:%4 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); _waitForConnectedTimer.start(_waitForConnected); - if (_conn4) { - connect(_conn4, SIGNAL(connected()), this, SLOT(onConnected4())); - connect(_conn4, SIGNAL(disconnected()), this, SLOT(onDisconnected4())); - _conn4->connectTcp(ip[IPv4address][TcpProtocol].c_str(), port[IPv4address][TcpProtocol], flags[IPv4address][TcpProtocol]); - _conn4->connectHttp(ip[IPv4address][HttpProtocol].c_str(), port[IPv4address][HttpProtocol], flags[IPv4address][HttpProtocol]); + if (auto conn = _conn4) { + connect(conn, SIGNAL(connected()), this, SLOT(onConnected4())); + connect(conn, SIGNAL(disconnected()), this, SLOT(onDisconnected4())); + conn->connectTcp(ip[IPv4address][TcpProtocol].c_str(), port[IPv4address][TcpProtocol], flags[IPv4address][TcpProtocol]); + conn->connectHttp(ip[IPv4address][HttpProtocol].c_str(), port[IPv4address][HttpProtocol], flags[IPv4address][HttpProtocol]); } - if (_conn6) { - connect(_conn6, SIGNAL(connected()), this, SLOT(onConnected6())); - connect(_conn6, SIGNAL(disconnected()), this, SLOT(onDisconnected6())); - _conn6->connectTcp(ip[IPv6address][TcpProtocol].c_str(), port[IPv6address][TcpProtocol], flags[IPv6address][TcpProtocol]); - _conn6->connectHttp(ip[IPv6address][HttpProtocol].c_str(), port[IPv6address][HttpProtocol], flags[IPv6address][HttpProtocol]); + if (auto conn = _conn6) { + connect(conn, SIGNAL(connected()), this, SLOT(onConnected6())); + connect(conn, SIGNAL(disconnected()), this, SLOT(onDisconnected6())); + conn->connectTcp(ip[IPv6address][TcpProtocol].c_str(), port[IPv6address][TcpProtocol], flags[IPv6address][TcpProtocol]); + conn->connectHttp(ip[IPv6address][HttpProtocol].c_str(), port[IPv6address][HttpProtocol], flags[IPv6address][HttpProtocol]); } } From 6220b88ae9eb8d7415b501376ea774ab9a134018 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 12:58:43 +0300 Subject: [PATCH 193/316] fixed possible crash in playInline() call --- Telegram/SourceFiles/structs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index c2f9918855..b1122e5593 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -860,14 +860,14 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) { if (App::main()) App::main()->mediaMarkRead(data); } else if (data->size < MediaViewImageSizeLimit) { if (!data->data().isEmpty() && playAnimation) { - if (action == ActionOnLoadPlayInline) { + if (action == ActionOnLoadPlayInline && item->getMedia()) { item->getMedia()->playInline(item); } else { App::wnd()->showDocument(data, item); } } else if (location.accessEnable()) { - if ((App::hoveredLinkItem() || App::contextItem()) && (data->isAnimation() || QImageReader(location.name()).canRead())) { - if (action == ActionOnLoadPlayInline) { + if (item && (data->isAnimation() || QImageReader(location.name()).canRead())) { + if (action == ActionOnLoadPlayInline && item->getMedia()) { item->getMedia()->playInline(item); } else { App::wnd()->showDocument(data, item); @@ -1143,7 +1143,7 @@ void DocumentData::performActionOnLoad() { } } else if (playAnimation) { if (loaded()) { - if (_actionOnLoad == ActionOnLoadPlayInline) { + if (_actionOnLoad == ActionOnLoadPlayInline && item->getMedia()) { item->getMedia()->playInline(item); } else { App::wnd()->showDocument(this, item); @@ -1163,7 +1163,7 @@ void DocumentData::performActionOnLoad() { if (App::main()) App::main()->mediaMarkRead(this); } else if (loc.accessEnable()) { if (showImage && QImageReader(loc.name()).canRead()) { - if (_actionOnLoad == ActionOnLoadPlayInline) { + if (_actionOnLoad == ActionOnLoadPlayInline && item->getMedia()) { item->getMedia()->playInline(item); } else { App::wnd()->showDocument(this, item); From 54c4ac7cd8bbfaed0ac09ea5002c230af92ccaa3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 13:23:39 +0300 Subject: [PATCH 194/316] langs updated --- Telegram/Resources/lang.strings | 2 +- Telegram/SourceFiles/application.cpp | 11 +-- Telegram/SourceFiles/langs/lang_de.strings | 17 ++-- Telegram/SourceFiles/langs/lang_es.strings | 75 +++++++++--------- Telegram/SourceFiles/langs/lang_it.strings | 23 +++--- Telegram/SourceFiles/langs/lang_ko.strings | 75 +++++++++--------- Telegram/SourceFiles/langs/lang_nl.strings | 9 ++- Telegram/SourceFiles/langs/lang_pt_BR.strings | 79 ++++++++++--------- 8 files changed, 149 insertions(+), 142 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 31858f0eb6..9039db9024 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -880,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop was updated to version {version}\n\n{changes}\n\nFull version history is available here:\n{link}"; "lng_new_version_minor" = "— Bug fixes and other minor improvements"; -"lng_new_version_text" = "— Edit your messages in channels and supergroups.\n— Share links to specific posts in channels via the post context menu.\n— Add admin signatures to messages in channels.\n— Send silent messages in channels that will not notify members. Useful for non-urgent or late night posting."; +"lng_new_version_text" = "PUBLIC GROUPS, PINNED POSTS, 5,000 MEMBERS\n\n— Groups can now have 5,000 members (up from 1,000)\n— Groups of any size may be converted to supergroups\n\nNew tools for supergroup admins:\n\n— Make your group public by setting up a public link – anyone will be able to view the chat and join it\n— Pin messages to keep important updates visible and notify all members\n— Select messages to delete, report as spam, block users, or remove all messages from a user\n\nMore about this update:\n{link}"; "lng_menu_insert_unicode" = "Insert Unicode control character"; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index fe7986b7d2..610f6a26a0 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1019,11 +1019,12 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9029) { - QString ctrl = (cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? qsl("Cmd") : qsl("Ctrl"); - versionFeatures = QString::fromUtf8("\xe2\x80\x94 %1+W or %2+F4 for close window\n\xe2\x80\x94 %3+L to lock Telegram if you use a local passcode\n\xe2\x80\x94 Bug fixes and other minor improvements").arg(ctrl).arg(ctrl).arg(ctrl);// .replace('@', qsl("@") + QChar(0x200D)); - } else if (Local::oldMapVersion() < 9027) { - versionFeatures = lang(lng_new_version_text).trimmed(); + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9031) { +// QString ctrl = (cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? qsl("Cmd") : qsl("Ctrl"); +// versionFeatures = QString::fromUtf8("\xe2\x80\x94 %1+W or %2+F4 for close window\n\xe2\x80\x94 %3+L to lock Telegram if you use a local passcode\n\xe2\x80\x94 Bug fixes and other minor improvements").arg(ctrl).arg(ctrl).arg(ctrl);// .replace('@', qsl("@") + QChar(0x200D)); + versionFeatures = lng_new_version_text(lt_link, qsl("https://telegram.org/blog/supergroups5k")).trimmed(); + } else if (Local::oldMapVersion() < 9031) { + versionFeatures = lng_new_version_text(lt_link, qsl("https://telegram.org/blog/supergroups5k")).trimmed(); } else { versionFeatures = lang(lng_new_version_minor).trimmed(); } diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index b9c34e3d3c..3e247d1c58 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -131,7 +131,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_deleted" = "Gelöschter Kontakt"; "lng_deleted_message" = "Gelöschte Nachricht"; "lng_pinned_message" = "Angeheftete Nachricht"; -"lng_pinned_unpin_sure" = "Angeheftete Nachricht wieder entfernen?"; +"lng_pinned_unpin_sure" = "Angeheftete Nachricht entfernen?"; "lng_pinned_pin_sure" = "Möchtest du diese Nachricht anheften?"; "lng_pinned_pin" = "Anheften"; "lng_pinned_unpin" = "Entfernen"; @@ -476,7 +476,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Weiter"; "lng_create_group_create" = "Erstellen"; "lng_create_group_title" = "Neue Gruppe erstellen"; -"lng_create_group_about" = "{count:_not_used|# Mitglied|# Mitglieder} passen in jede Gruppe, \npraktisch für eine kleinere Gemeinschaft."; +"lng_create_group_about" = "{count:_not_used|# Mitglied|# Mitglieder} passen in jede Gruppe, praktisch für eine kleinere Gemeinschaft."; "lng_create_channel_title" = "Neuen Kanal erstellen"; "lng_create_channel_about" = "In einen Kanal passen unbegrenzt viele Leute, also ideal für ein großes Publikum."; "lng_create_public_channel_title" = "Öffentlicher Kanal"; @@ -543,7 +543,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_pinned_media" = "{from} hat {media} angeheftet"; "lng_action_pinned_media_photo" = "ein Bild"; "lng_action_pinned_media_video" = "ein Video"; -"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_audio" = "ein Audio"; "lng_action_pinned_media_voice" = "eine Sprachnachricht"; "lng_action_pinned_media_file" = "eine Datei"; "lng_action_pinned_media_gif" = "ein GIF"; @@ -562,12 +562,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_convert_button" = "In Supergruppe ändern"; "lng_profile_convert_title" = "In Supergruppe ändern"; "lng_profile_convert_about" = "Supergruppen:"; -"lng_profile_convert_feature1" = "— Neue Mitglieder sehen gesamten Nachrichtenverlauf"; -"lng_profile_convert_feature2" = "— Gelöschte Nachrichten verschwinden für alle Mitglieder"; -"lng_profile_convert_feature3" = "— Mitglieder können eigene Nachrichten nachträglich bearbeiten"; -"lng_profile_convert_feature4" = "— Gruppenersteller kann die Gruppe öffentlich machen"; +"lng_profile_convert_feature1" = "— Neue Mitglieder sehen gesamten Verlauf"; +"lng_profile_convert_feature2" = "— Nachrichten werden bei allen gelöscht"; +"lng_profile_convert_feature3" = "— Jeder kann eigene Nachrichten bearbeiten"; +"lng_profile_convert_feature4" = "— Gründer kann Gruppe öffentlich machen"; "lng_profile_convert_warning" = "{bold_start}Wichtig:{bold_end} Die Änderung in eine Supergruppe kann nicht rückgängig gemacht werden."; "lng_profile_convert_confirm" = "Ändern"; +"lng_profile_add_more_after_upgrade" = "Du kannst nach der Änderung der Gruppe in eine Supergruppe bis zu {count:_not_used_|# Mitglied|# Mitglieder} hinzufügen."; "lng_channel_comments_count" = "{count:_not_used_|# Kommentar|# Kommentare} »"; "lng_channel_hide_comments" = "Kommentare verstecken"; @@ -879,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop wurde aktualisiert auf Version {version}\n\n{changes}\n\nGesamter Versionsverlauf:\n{link}"; "lng_new_version_minor" = "— Fehlerbehebungen und Softwareoptimierungen"; -"lng_new_version_text" = "— Bearbeite deine Nachrichten in Kanälen und Supergruppen.\n— Teile direkt Links zu einzelnen Kanal-Nachrichten über das Teilen-Symbol neben der Nachricht.\n— Unterschreibe Nachrichten in Kanälen - so kann jeder sehen, welcher Admin die Nachricht geschrieben hat.\n— Sende 'lautlose Nachrichten' in Kanälen. Klasse, wenn man mal wieder mitten in der Nacht eine Nachricht senden muss."; +"lng_new_version_text" = "ÖFFENTLICHE GRUPPEN, NACHRICHTEN ANHEFTEN, 5000 MITGLIEDER\n\n— Gruppen dürfen nun 5.000 Mitglieder haben (zuvor waren es 1.000)\n— Jede Gruppe - egal wie groß - kann ab sofort in eine Supergruppe geändert werden\n\nNeue Werkzeuge für Supergruppen-Admins:\n\n— Mache deine Gruppe öffentlich: Jeder kann den Inhalt einsehen und sie betreten\n— Hefte Nachrichten an: Perfekt um Gruppenmitglieder über Neuigkeiten zu informieren\n— Lösche mehrere Nachrichten, melde sie aufgrund von Spam, blockiere Mitglieder oder entferne alle Nachrichten von bestimmten Nutzern\n\nMehr Infos zum neuen Update:\n{link}"; "lng_menu_insert_unicode" = "Unicode-Steuerzeichen einfügen"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index bbaada893d..dfa3a6261e 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -130,12 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Nuevo texto..."; "lng_deleted" = "Desconocido"; "lng_deleted_message" = "Mensaje eliminado"; -"lng_pinned_message" = "Pinned message"; -"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; -"lng_pinned_pin_sure" = "Would you like to pin this message?"; -"lng_pinned_pin" = "Pin"; -"lng_pinned_unpin" = "Unpin"; -"lng_pinned_notify" = "Notify all members"; +"lng_pinned_message" = "Mensaje anclado"; +"lng_pinned_unpin_sure" = "¿Quieres desanclar este mensaje?"; +"lng_pinned_pin_sure" = "¿Quieres anclar este mensaje?"; +"lng_pinned_pin" = "Anclar"; +"lng_pinned_unpin" = "Desanclar"; +"lng_pinned_notify" = "Notificar a todos los miembros"; "lng_intro" = "La app oficial para PC de [a href=\"https://telegram.org/\"]Telegram[/a].\nEs [b]rápida[/b] y [b]segura[/b]."; "lng_start_msgs" = "EMPEZAR A CONVERSAR"; @@ -435,7 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Añadir miembros"; "lng_profile_delete_and_exit" = "Dejar grupo"; "lng_profile_kick" = "Eliminar"; -"lng_profile_admin" = "admin"; +"lng_profile_admin" = "administrador"; "lng_profile_sure_kick" = "¿Eliminar a {user} del grupo?"; "lng_profile_sure_kick_channel" = "¿Eliminar a {user} del canal?"; "lng_profile_sure_kick_admin" = "¿Eliminar a {user} de los administradores?"; @@ -476,17 +476,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Siguiente"; "lng_create_group_create" = "Crear"; "lng_create_group_title" = "Nuevo grupo"; -"lng_create_group_about" = "Los grupos son ideales para las comunidades\nmás pequeñas, de hasta {count:_not_used|# miembro|# miembros}"; +"lng_create_group_about" = "Los grupos son ideales para las comunidades limitadas. Pueden tener hasta {count:_not_used|# miembro|# miembros}"; "lng_create_channel_title" = "Nuevo canal"; "lng_create_channel_about" = "Los canales permiten difundir tus mensajes a audiencias ilimitadas"; "lng_create_public_channel_title" = "Canal público"; "lng_create_public_channel_about" = "Cualquiera puede encontrar el canal en la búsqueda y unirse"; "lng_create_private_channel_title" = "Canal privado"; "lng_create_private_channel_about" = "Sólo las personas con el enlace de invitación especial podrán unirse"; -"lng_create_public_group_title" = "Public Group"; -"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; -"lng_create_private_group_title" = "Private Group"; -"lng_create_private_group_about" = "Only invited people may join and see the chat history"; +"lng_create_public_group_title" = "Grupo público"; +"lng_create_public_group_about" = "Cualquiera puede encontrar el grupo en la búsqueda y unirse. El historial del chat está disponible para todos"; +"lng_create_private_group_title" = "Grupo privado"; +"lng_create_private_group_about" = "Las personas pueden unirse sólo si son invitadas o tienen un enlace de invitación"; "lng_create_channel_comments" = "Activar comentarios"; "lng_create_channel_comments_about" = "Si activas los comentarios, las personas podrán hablar de tus mensajes en el canal"; "lng_create_group_skip" = "Omitir"; @@ -539,17 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} creó el grupo «{title}»"; "lng_action_created_channel" = "Se creó el canal «{title}»"; "lng_action_group_migrate" = "Este grupo fue convertido en un supergrupo"; -"lng_action_pinned_message" = "{from} pinned «{text}»"; -"lng_action_pinned_media" = "{from} pinned {media}"; -"lng_action_pinned_media_photo" = "a photo"; -"lng_action_pinned_media_video" = "a video file"; -"lng_action_pinned_media_audio" = "an audio file"; -"lng_action_pinned_media_voice" = "a voice message"; -"lng_action_pinned_media_file" = "a file"; -"lng_action_pinned_media_gif" = "a GIF animation"; -"lng_action_pinned_media_contact" = "a contact information"; -"lng_action_pinned_media_location" = "a location mark"; -"lng_action_pinned_media_sticker" = "a sticker"; +"lng_action_pinned_message" = "{from} ancló «{text}»"; +"lng_action_pinned_media" = "{from} ancló {media}"; +"lng_action_pinned_media_photo" = "una foto"; +"lng_action_pinned_media_video" = "un vídeo"; +"lng_action_pinned_media_audio" = "un audio"; +"lng_action_pinned_media_voice" = "un mensaje de voz"; +"lng_action_pinned_media_file" = "un archivo"; +"lng_action_pinned_media_gif" = "un GIF"; +"lng_action_pinned_media_contact" = "un contacto"; +"lng_action_pinned_media_location" = "una ubicación"; +"lng_action_pinned_media_sticker" = "un sticker"; "lng_profile_migrate_reached" = "Límite de {count:_not_used_|# miembro|# miembros} alcanzado"; "lng_profile_migrate_about" = "Para superar el límite y tener características adicionales, conviértelo en un supergrupo:"; @@ -559,15 +559,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "– Notificaciones silenciadas por defecto"; "lng_profile_migrate_button" = "Convertir en supergrupo"; "lng_profile_migrate_sure" = "¿Quieres convertir este grupo en un supergrupo? No puedes deshacer esta acción."; -"lng_profile_convert_button" = "Convert to supergroup"; -"lng_profile_convert_title" = "Convert to supergroup"; -"lng_profile_convert_about" = "In supergroups:"; -"lng_profile_convert_feature1" = "— New members see the full message history"; -"lng_profile_convert_feature2" = "— Messages are deleted for all members"; -"lng_profile_convert_feature3" = "— Members can edit their own messages"; -"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; -"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; -"lng_profile_convert_confirm" = "Convert"; +"lng_profile_convert_button" = "Convertir en supergrupo"; +"lng_profile_convert_title" = "Convertir en supergrupo"; +"lng_profile_convert_about" = "En los supergrupos:"; +"lng_profile_convert_feature1" = "— Los nuevos miembros ven todo el historial"; +"lng_profile_convert_feature2" = "— Los mensajes son eliminados para todos"; +"lng_profile_convert_feature3" = "— Un miembro puede editar sus mensajes"; +"lng_profile_convert_feature4" = "— El creador puede generar un enlace público"; +"lng_profile_convert_warning" = "{bold_start}Importante:{bold_end} Esta acción no se puede deshacer"; +"lng_profile_convert_confirm" = "Convertir"; +"lng_profile_add_more_after_upgrade" = "Podrás añadir hasta {count:_not_used_|# miembro|# miembros} una vez que conviertas tu grupo en un supergrupo."; "lng_channel_comments_count" = "{count:_not_used_|# comentario|# comentarios}"; "lng_channel_hide_comments" = "Ocultar comentarios"; @@ -668,8 +669,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; -"lng_ban_user" = "Ban User"; -"lng_delete_all_from" = "Delete all from this user"; +"lng_ban_user" = "Suspender usuario"; +"lng_delete_all_from" = "Eliminar todo lo de este usuario"; "lng_report_spam" = "Reportar spam"; "lng_report_spam_hide" = "Ocultar"; "lng_report_spam_thanks" = "¡Gracias por tu reporte!"; @@ -778,8 +779,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Reenviar mensaje"; "lng_context_delete_msg" = "Eliminar mensaje"; "lng_context_select_msg" = "Seleccionar mensaje"; -"lng_context_pin_msg" = "Pin Message"; -"lng_context_unpin_msg" = "Unpin Message"; +"lng_context_pin_msg" = "Anclar mensaje"; +"lng_context_unpin_msg" = "Desanclar mensaje"; "lng_context_cancel_upload" = "Cancelar envío"; "lng_context_copy_selected" = "Copiar el texto seleccionado"; "lng_context_forward_selected" = "Reenviar lo seleccionado"; @@ -879,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop ha sido actualizada a la versión {version}\n\n{changes}\n\nEl historial completo está disponible aquí:\n{link}"; "lng_new_version_minor" = "— Corrección de errores y otras mejoras menores"; -"lng_new_version_text" = "— Edita tus mensajes en canales y supergrupos.\n— Comparte enlaces a publicaciones específicas en canales, a través del menú contextual de la publicación. \n— Añade firmas de los administradores a los mensajes en canales.\n— Envía mensajes silenciosos en canales, que no serán notificados a los miembros. Es útil para publicaciones que no son urgentes o en medio de la noche."; +"lng_new_version_text" = "GRUPOS PÚBLICOS, PUBLICACIONES ANCLADAS, 5000 MIEMBROS\n\n— Los grupos ahora pueden tener hasta 5000 miembros (antes eran 1000)\n— Los grupos de cualquier tamaño pueden ser convertidos en supergrupos\n\nNuevas herramientas para los administradores de supergrupos:\n\n— Haz público tu grupo, generando un enlace público. Cualquiera podrá ver el chat y unirse.\n— Ancla mensajes, para mantener visible lo importante, y notifica a todos los miembros.\n— Elige varios mensajes para eliminar, reportar como spam, bloquear usuarios o quitar todos los mensajes de un usuario en particular.\n\nMás sobre esta actualización:\n{link}"; "lng_menu_insert_unicode" = "Insertar caracteres de control Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index be718a0353..1a8e00d880 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -265,9 +265,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_replace_emojis" = "Riconosci emoji"; "lng_settings_view_emojis" = "Visualizza lista"; "lng_settings_emoji_list" = "Emoji supportate"; -"lng_settings_send_enter" = "Spedisci con Invio"; -"lng_settings_send_ctrlenter" = "Spedisci con Ctrl+Invio"; -"lng_settings_send_cmdenter" = "Spedisci con Cmd+Invio"; +"lng_settings_send_enter" = "Invia con tasto invio"; +"lng_settings_send_ctrlenter" = "Invia con Ctrl+Invio"; +"lng_settings_send_cmdenter" = "Invia con Cmd+Invio"; "lng_settings_section_background" = "Sfondo chat"; "lng_settings_bg_from_gallery" = "Scegli dalla galleria"; @@ -379,10 +379,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_reset_button" = "Chiudi"; "lng_settings_reset_done" = "Altre sessioni terminate"; "lng_settings_ask_question" = "Fai una domanda"; -"lng_settings_ask_sure" = "Per favore nota che il supporto di Telegram è fornito da volontari. Proviamo a rispondere quanto prima, ma potrebbe volerci del tempo.\n\nDai un'occhiata alle FAQ di Telegram: potrai trovare importanti suggerimenti riguardo alcune problematiche e risposte alla maggior parte delle domande."; -"lng_settings_faq_button" = "Vai alle FAQ"; +"lng_settings_ask_sure" = "Per favore nota che il supporto di Telegram è fornito da volontari. Proviamo a rispondere quanto prima, ma potrebbe volerci del tempo.\n\nDai un'occhiata alle domande frequenti su Telegram: potrai trovare importanti suggerimenti riguardo alcune problematiche e risposte alla maggior parte delle domande."; +"lng_settings_faq_button" = "Domande frequenti"; "lng_settings_ask_ok" = "Chiedi"; -"lng_settings_faq" = "FAQ di Telegram"; +"lng_settings_faq" = "Domande frequenti"; "lng_settings_logout" = "Disconnetti"; "lng_sure_logout" = "Sicuro di volerti disconnettere?"; @@ -476,7 +476,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Avanti"; "lng_create_group_create" = "Crea"; "lng_create_group_title" = "Nuovo gruppo"; -"lng_create_group_about" = "I gruppi sono ideali per le piccole community,\npossono avere fino a {count:_not_used|# membro|# membri}"; +"lng_create_group_about" = "I gruppi sono ideali per le community limitate,\npossono avere fino a {count:_not_used|# membro|# membri}"; "lng_create_channel_title" = "Nuovo canale"; "lng_create_channel_about" = "I canali sono uno strumento per diffondere i tuoi messaggi a un pubblico illimitato"; "lng_create_public_channel_title" = "Canale pubblico"; @@ -486,7 +486,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_group_title" = "Gruppo pubblico"; "lng_create_public_group_about" = "Chiunque può trovare il gruppo nella ricerca e unirsi, la cronologia è disponibile per tutti"; "lng_create_private_group_title" = "Gruppo privato"; -"lng_create_private_group_about" = "Solo le persone invitate possono unirsi e vedere la cronologia"; +"lng_create_private_group_about" = "Le persone si possono unire solo se invitate o con un link di invito"; "lng_create_channel_comments" = "Attiva i commenti"; "lng_create_channel_comments_about" = "Se attivi i commenti, i membri potranno discutere quello che pubblichi nel canale."; "lng_create_group_skip" = "Salta"; @@ -543,7 +543,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_pinned_media" = "{from} ha fissato {media}"; "lng_action_pinned_media_photo" = "una foto"; "lng_action_pinned_media_video" = "un video"; -"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_audio" = "un file audio"; "lng_action_pinned_media_voice" = "un messaggio vocale"; "lng_action_pinned_media_file" = "un file"; "lng_action_pinned_media_gif" = "una GIF"; @@ -568,6 +568,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_convert_feature4" = "— Il creatore può creare un link pubblico per il gruppo"; "lng_profile_convert_warning" = "{bold_start}Nota:{bold_end} Questa azione non può essere annullata"; "lng_profile_convert_confirm" = "Converti"; +"lng_profile_add_more_after_upgrade" = "Sarai in grado di aggiungere fino a {count:_not_used_|# membro|# membri} dopo aver aggiornato a supergruppo."; "lng_channel_comments_count" = "{count:_not_used_|# commento|# commenti}"; "lng_channel_hide_comments" = "Nascondi commenti"; @@ -849,7 +850,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_about_version" = "versione {version}"; "lng_about_text_1" = "App ufficiale basata sulle [a href=\"https://core.telegram.org/api\"]API di Telegram[/a]\nper velocità e sicurezza"; "lng_about_text_2" = "Questo software è sotto licenza [a href=\"https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\"]GNU GPL[/a] versione 3.\nIl source code è disponibile su [a href=\"https://github.com/telegramdesktop/tdesktop\"]GitHub[/a]."; -"lng_about_text_3" = "Visita le {faq_open}FAQ di Telegram{faq_close} per maggiori info."; +"lng_about_text_3" = "Visita le {faq_open}domande frequenti{faq_close} per maggiori info."; "lng_about_done" = "Fatto"; "lng_search_found_results" = "{count:Nessun messaggio trovato|# messaggio trovato|# messaggi trovati}"; @@ -879,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop si è aggiornato alla versione {version}\n\n{changes}\n\nLa cronologia degli aggiornamenti è disponibile qui:\n{link}"; "lng_new_version_minor" = "— Risoluzione di problemi e altri miglioramenti minori"; -"lng_new_version_text" = "— Modifica i tuoi messaggi nei canali e nei supergruppi.\n— Condividi link per post specifici nei canali con il menu contestuale dei post.\n— Aggiungi le firme per i messaggi degli amministratori nei canali.\n— Invia messaggi silenziosi nei canali che non notificheranno i membri.\nUtile per i post non urgenti o fatti di notte."; +"lng_new_version_text" = "GRUPPI PUBBLICI, POST FISSATI, 5000 MEMBRI\n\n— I gruppi possono ora avere fino a 5000 membri (dai precedenti 1000)\n— Puoi convertire qualsiasi gruppo in supergruppo\n\nNuovi strumenti per gli amministratori dei supergruppi:\n\n— Rendi pubblico il tuo gruppo inserendo un link - chiunque sarà in grado di vedere la chat e unirsi\n— Fissa i messaggi per rendere gli aggiornamenti importanti visibili\n— Seleziona diversi messaggi per eliminarli, segnalarli, bloccare utenti ed eliminare i loro messaggi\n\nPiù info su questo aggiornamento:\n{link}"; "lng_menu_insert_unicode" = "Inserisci carattere di controllo Unicode"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index 0117be3926..cf661c075c 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -130,12 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "새로운 메시지 내용."; "lng_deleted" = "알 수 없음"; "lng_deleted_message" = "삭제된 메시지"; -"lng_pinned_message" = "Pinned message"; -"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; -"lng_pinned_pin_sure" = "Would you like to pin this message?"; -"lng_pinned_pin" = "Pin"; -"lng_pinned_unpin" = "Unpin"; -"lng_pinned_notify" = "Notify all members"; +"lng_pinned_message" = "고정된 메시지"; +"lng_pinned_unpin_sure" = "메시지를 고정 해제하시겠습니까?"; +"lng_pinned_pin_sure" = "메시지를 고정 하시겠습니까?"; +"lng_pinned_pin" = "고정"; +"lng_pinned_unpin" = "고정해제"; +"lng_pinned_notify" = "모두알림"; "lng_intro" = "[a href=\"https://telegram.org/\"]텔레그램[/a] PC 공식버전에 오신 것을 환영합니다.\n[b]안전[/b]하고 [b]신속[/b]합니다."; "lng_start_msgs" = "시작하기"; @@ -435,7 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "구성원 추가"; "lng_profile_delete_and_exit" = "나가기"; "lng_profile_kick" = "삭제"; -"lng_profile_admin" = "admin"; +"lng_profile_admin" = "관리자"; "lng_profile_sure_kick" = "{user}를 추방하시겠습니까?"; "lng_profile_sure_kick_channel" = "{user}를 추방하시겠습니까?"; "lng_profile_sure_kick_admin" = "{user}를 관리자에서 제외 하시겠습니까?"; @@ -476,17 +476,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "다음"; "lng_create_group_create" = "만들기"; "lng_create_group_title" = "새로운 그룹"; -"lng_create_group_about" = "작은 커뮤니티에게는 {count:_not_used|# 구성원|# 구성원}명까지 한계인 그룹대화가 적합합니다."; +"lng_create_group_about" = "그룹방은 제한된 커뮤니티에 적합하며,\n{count:_not_used|# member|# members} 명까지 구성이 가능합니다."; "lng_create_channel_title" = "새로운 채널"; "lng_create_channel_about" = "채널은 제한이 없는 구성원들에게 메시지를 전달하는 툴입니다."; "lng_create_public_channel_title" = "공개 채널"; "lng_create_public_channel_about" = "누구나 채널을 검색하고 입장할 수 있습니다."; "lng_create_private_channel_title" = "비공개 채널"; "lng_create_private_channel_about" = "초대 링크를 통해서만 입장이 가능합니다."; -"lng_create_public_group_title" = "Public Group"; -"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; -"lng_create_private_group_title" = "Private Group"; -"lng_create_private_group_about" = "Only invited people may join and see the chat history"; +"lng_create_public_group_title" = "공개그룹"; +"lng_create_public_group_about" = "누구나 그룹을 검색 및 참여가 가능하며, 채팅 히스토리가 공개됩니다."; +"lng_create_private_group_title" = "비공개그룹"; +"lng_create_private_group_about" = "초대 및 초대링크를 통하여 참여 가능합니다."; "lng_create_channel_comments" = "코멘트 허용"; "lng_create_channel_comments_about" = "코멘트가 허용되면, 구성원들이 글에 대하여 토론이 가능합니다."; "lng_create_group_skip" = "건너뛰기"; @@ -539,17 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} 님이 그룹 «{title}» 을 생성하셨습니다."; "lng_action_created_channel" = "채널명 «{title}» 생성됨"; "lng_action_group_migrate" = "이 그룹방은 슈퍼그룹방으로 변환되었습니다"; -"lng_action_pinned_message" = "{from} pinned «{text}»"; -"lng_action_pinned_media" = "{from} pinned {media}"; -"lng_action_pinned_media_photo" = "a photo"; -"lng_action_pinned_media_video" = "a video file"; -"lng_action_pinned_media_audio" = "an audio file"; -"lng_action_pinned_media_voice" = "a voice message"; -"lng_action_pinned_media_file" = "a file"; -"lng_action_pinned_media_gif" = "a GIF animation"; -"lng_action_pinned_media_contact" = "a contact information"; -"lng_action_pinned_media_location" = "a location mark"; -"lng_action_pinned_media_sticker" = "a sticker"; +"lng_action_pinned_message" = "{from} 님이 «{text}» 를 고정함"; +"lng_action_pinned_media" = "{from} 님이 {media} 를 고정함"; +"lng_action_pinned_media_photo" = "사진"; +"lng_action_pinned_media_video" = "비디오 파일"; +"lng_action_pinned_media_audio" = "오디오 파일"; +"lng_action_pinned_media_voice" = "음성 메시지"; +"lng_action_pinned_media_file" = "파일"; +"lng_action_pinned_media_gif" = "GIF 파일"; +"lng_action_pinned_media_contact" = "연락처 정보"; +"lng_action_pinned_media_location" = "위치 마크"; +"lng_action_pinned_media_sticker" = "스티커"; "lng_profile_migrate_reached" = "{count:_not_used_|# 명|# 명} 한계치에 도달 되었습니다."; "lng_profile_migrate_about" = "최대허용치를 초과하시고 싶으실 경우, 슈퍼그룹방으로 업그레이드해주세요. 슈퍼그룹방은 :"; @@ -559,15 +559,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— 기본값으로 알림이 무음으로 처리됩니다"; "lng_profile_migrate_button" = "슈퍼그룹방으로 업그레이드하기"; "lng_profile_migrate_sure" = "정말로 그룹방을 슈퍼그룹방으로 변환하시겠습니까? 이 작업은 취소가 불가능합니다."; -"lng_profile_convert_button" = "Convert to supergroup"; -"lng_profile_convert_title" = "Convert to supergroup"; -"lng_profile_convert_about" = "In supergroups:"; -"lng_profile_convert_feature1" = "— New members see the full message history"; -"lng_profile_convert_feature2" = "— Messages are deleted for all members"; -"lng_profile_convert_feature3" = "— Members can edit their own messages"; -"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; -"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; -"lng_profile_convert_confirm" = "Convert"; +"lng_profile_convert_button" = "슈퍼그룹으로 전환"; +"lng_profile_convert_title" = "슈퍼그룹으로 전환"; +"lng_profile_convert_about" = "슈퍼그룹:"; +"lng_profile_convert_feature1" = "— 모든 구성원이 이전 대화 내용 조회"; +"lng_profile_convert_feature2" = "— 메시지 삭제시 모두에게 삭제"; +"lng_profile_convert_feature3" = "— 개인 메시지 수정 가능"; +"lng_profile_convert_feature4" = "— 방 생성자가 그룹 공개링크 생성가능"; +"lng_profile_convert_warning" = "{bold_start}주위:{bold_end} 이 작업은 되돌릴 수 없습니다."; +"lng_profile_convert_confirm" = "변환"; +"lng_profile_add_more_after_upgrade" = "그룹에서 슈퍼그룹으로 업그레이드시 {count:_not_used_|# 명|# 명} 까지 추가 가능합니다."; "lng_channel_comments_count" = "{count:_not_used_|# 코멘트|# 코멘트}"; "lng_channel_hide_comments" = "코멘트 숨기기"; @@ -668,8 +669,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "스티커"; "lng_in_dlg_sticker_emoji" = "{emoji} (스티커)"; -"lng_ban_user" = "Ban User"; -"lng_delete_all_from" = "Delete all from this user"; +"lng_ban_user" = "차단하기"; +"lng_delete_all_from" = "모두에게 메시지 삭제"; "lng_report_spam" = "스팸 신고"; "lng_report_spam_hide" = "숨기기"; "lng_report_spam_thanks" = "신고해주셔서 감사합니다!"; @@ -778,8 +779,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "메시지 전달"; "lng_context_delete_msg" = "메시지 삭제"; "lng_context_select_msg" = "메시지 선택"; -"lng_context_pin_msg" = "Pin Message"; -"lng_context_unpin_msg" = "Unpin Message"; +"lng_context_pin_msg" = "메시지 고정"; +"lng_context_unpin_msg" = "메시지 고정해제"; "lng_context_cancel_upload" = "업로드 취소"; "lng_context_copy_selected" = "선택한 메시지 복사"; "lng_context_forward_selected" = "선택된 메시지 전달"; @@ -879,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "텔레그램 데스크탑은 {version} 버전으로 업데이트 되었습니다.\n\n{changes}\n\n전체 버전 히스토리는 아래에서 확인 가능합니다:\n{link}"; "lng_new_version_minor" = "— 버그 수정 및 일부 기능 향상"; -"lng_new_version_text" = "— 채널과 슈퍼그룹에 메시지 수정\n— 메시지 작성란에서 특정 메시지 링크 공유\n— 채널 메시지에 관리자 서명 추가\n— 알림이 가지 않은 채널 메시지 작성. 급하지 않거나 늦은 시간 메시지등에 활용"; +"lng_new_version_text" = "공개 그룹, 메시지 고정, 5,000명\n\n— 그룹은 5,000명까지 가능 (기존 1,000명)\n— 모든 그룹은 구성원 크기에 상관 없이 슈퍼그룹으로 변환 가능\n\n슈퍼그룹 관리기능 추가:\n\n— 공개링크를 생성하여 그룹공개 가능 - 누구나 참여하여 대화가능\n— 메시지를 고정하여 중요한 내용을 표시하고 모두에게 알림\n— 여러 메시지를 선택하여 삭제, 스팸신고, 차단 혹은 특정 유저에게 메시지 삭제 가능\n\n자세한 사항:\n{link}"; "lng_menu_insert_unicode" = "유니코드 문자를 입력하세요."; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 8cc9612566..801c4b822a 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -476,7 +476,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Volgende"; "lng_create_group_create" = "Maak"; "lng_create_group_title" = "Nieuwe groep"; -"lng_create_group_about" = "Groepen zijn voor kleinere gemeenschappen,\nmet maximaal {count:_not_used|# lid|# leden}"; +"lng_create_group_about" = "Groepen zijn voor beperkte gemeenschappen,\nmet maximaal {count:_not_used|# lid|# leden}"; "lng_create_channel_title" = "Nieuw kanaal"; "lng_create_channel_about" = "Kanalen kennen geen limiet en zijn geschikt om een groot publiek te bereiken"; "lng_create_public_channel_title" = "Publiek kanaal"; @@ -486,7 +486,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_public_group_title" = "Publieke groep"; "lng_create_public_group_about" = "Iedereen kan de groep vinden, er lid van worden en de geschiedenis zien"; "lng_create_private_group_title" = "Privé-groep"; -"lng_create_private_group_about" = "Alleen uitgenodigde mensen kunnen lid worden en de geschiedenis zien"; +"lng_create_private_group_about" = "Lid worden kan alleen op uitnodiging of via uitnodigingslink"; "lng_create_channel_comments" = "Reacties inschakelen"; "lng_create_channel_comments_about" = "Als je reacties inschakelt kunnen leden reageren op je bericht in het kanaal."; "lng_create_group_skip" = "Overslaan"; @@ -543,7 +543,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_pinned_media" = "{from} heeft {media} vastgezet"; "lng_action_pinned_media_photo" = "een foto"; "lng_action_pinned_media_video" = "een video"; -"lng_action_pinned_media_audio" = "an audio file"; +"lng_action_pinned_media_audio" = "een audiobestand"; "lng_action_pinned_media_voice" = "een spraakbericht"; "lng_action_pinned_media_file" = "een bestand"; "lng_action_pinned_media_gif" = "een GIF"; @@ -568,6 +568,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_convert_feature4" = "— Maker kan een publieke groepslink instellen"; "lng_profile_convert_warning" = "{bold_start}Let op:{bold_end} Je kunt dit niet ongedaan maken."; "lng_profile_convert_confirm" = "Opwaarderen"; +"lng_profile_add_more_after_upgrade" = "Waardeer op naar een supergroep om tot {count:_not_used_|# lid|# leden} toe te voegen"; "lng_channel_comments_count" = "{count:_not_used_|# reactie|# reacties}"; "lng_channel_hide_comments" = "Reacties verbergen"; @@ -879,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram is bijgewerkt naar versie {version}\n\n{changes} \n\nVolledige versiegeschiedenis is hier te vinden:\n{link}"; "lng_new_version_minor" = "— Probleemoplossing en andere kleine verbeteringen"; -"lng_new_version_text" = "— Bewerk nu je berichten in kanalen en supergroepen.\n— Deel links naar specifieke berichten in kanalen via het contextmenu.\n— Onderteken berichten in kanalen.\n— Stuur 'stille berichten' in kanalen. Ideaal voor als je toch echt iets moet sturen in het holst van de nacht."; +"lng_new_version_text" = "PUBLIEKE GROEPEN, BERICHTEN VASTZETTEN, 5000 LEDEN\n\n— Ledenlimiet voor iedere groepsvorm opgehoogd naar 5000 (voorheen 1000).\n— Iedere groep met een willekeurig aantal leden kan nu worden opgewaardeerd naar een supergroep.\n\nNieuwe functies voor beheerders van supergroepen:\n\n— Maak je groep openbaar door een publieke link in te stellen - iedereen kan de chat zien en er lid van worden.\n— Zet berichten vast om belangrijke informatie weer te geven en alle leden te informeren.\n— Selecteer berichten om te verwijderen, ze als spam te melden, gebruikers te blokkeren of om alle berichten van bepaalde gebruikers ineens te verwijderen.\n\nMeer informatie over deze update:\n{link}"; "lng_menu_insert_unicode" = "Unicode-besturingsteken invoegen"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index 62f37ff8cb..e0e255d99a 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -130,12 +130,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_message_text" = "Nova mensagem..."; "lng_deleted" = "Desconhecido"; "lng_deleted_message" = "Mensagem apagada"; -"lng_pinned_message" = "Pinned message"; -"lng_pinned_unpin_sure" = "Would you like to unpin this message?"; -"lng_pinned_pin_sure" = "Would you like to pin this message?"; -"lng_pinned_pin" = "Pin"; -"lng_pinned_unpin" = "Unpin"; -"lng_pinned_notify" = "Notify all members"; +"lng_pinned_message" = "Mensagem fixada"; +"lng_pinned_unpin_sure" = "Você gostaria de desafixar essa mensagem?"; +"lng_pinned_pin_sure" = "Você gostaria de fixar essa mensagem?"; +"lng_pinned_pin" = "Fixar"; +"lng_pinned_unpin" = "Desafixar"; +"lng_pinned_notify" = "Notificar todos os membros"; "lng_intro" = "Bem vindo ao cliente oficial do [a href=\"https://telegram.org/\"]Telegram[/a].\nÉ [b]rápido[/b] e [b]seguro[/b]."; "lng_start_msgs" = "COMECE A CONVERSAR"; @@ -435,7 +435,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_add_participant" = "Adicionar Membros"; "lng_profile_delete_and_exit" = "Sair"; "lng_profile_kick" = "Remover"; -"lng_profile_admin" = "admin"; +"lng_profile_admin" = "administrador"; "lng_profile_sure_kick" = "Remover {user} do grupo?"; "lng_profile_sure_kick_channel" = "Remover {user} do canal?"; "lng_profile_sure_kick_admin" = "Remover {user} dos administradores?"; @@ -476,17 +476,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Próximo"; "lng_create_group_create" = "Criar"; "lng_create_group_title" = "Novo Grupo"; -"lng_create_group_about" = "Grupos são ideais para comunidades menores,\ncom até {count:_not_used|# membro|# membros}"; +"lng_create_group_about" = "Grupos são ideais para comunidades limitadas,\neles podem conter até {count:_not_used|# membro|# membros}"; "lng_create_channel_title" = "Novo Canal"; "lng_create_channel_about" = "Canais são uma ferramenta para transmitir suas mensagens para audiências ilimitadas"; "lng_create_public_channel_title" = "Canal Público"; "lng_create_public_channel_about" = "Qualquer um pode encontrar o canal na busca e entrar"; "lng_create_private_channel_title" = "Canal privado"; "lng_create_private_channel_about" = "Somente pessoas com um link especial de convite poderão entrar"; -"lng_create_public_group_title" = "Public Group"; -"lng_create_public_group_about" = "Anyone can find the group in search and join, all chat history is available to everybody"; -"lng_create_private_group_title" = "Private Group"; -"lng_create_private_group_about" = "Only invited people may join and see the chat history"; +"lng_create_public_group_title" = "Grupo Público"; +"lng_create_public_group_about" = "Qualquer um pode encontrar o grupo pela busca e entrar, todo o histórico estará disponível"; +"lng_create_private_group_title" = "Grupo Privado"; +"lng_create_private_group_about" = "Somente pessoas convidadas ou com link de convite podem entrar"; "lng_create_channel_comments" = "Habilitar Comentários"; "lng_create_channel_comments_about" = "Se você habilitar comentários, membros poderão discutir seus posts no canal"; "lng_create_group_skip" = "Pular"; @@ -539,17 +539,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_action_created_chat" = "{from} criou o grupo «{title}»"; "lng_action_created_channel" = "Canal «{title}» criado"; "lng_action_group_migrate" = "O grupo foi atualizado para um supergrupo"; -"lng_action_pinned_message" = "{from} pinned «{text}»"; -"lng_action_pinned_media" = "{from} pinned {media}"; -"lng_action_pinned_media_photo" = "a photo"; -"lng_action_pinned_media_video" = "a video file"; -"lng_action_pinned_media_audio" = "an audio file"; -"lng_action_pinned_media_voice" = "a voice message"; -"lng_action_pinned_media_file" = "a file"; -"lng_action_pinned_media_gif" = "a GIF animation"; -"lng_action_pinned_media_contact" = "a contact information"; -"lng_action_pinned_media_location" = "a location mark"; -"lng_action_pinned_media_sticker" = "a sticker"; +"lng_action_pinned_message" = "{from} fixou «{text}»"; +"lng_action_pinned_media" = "{from} fixou {media}"; +"lng_action_pinned_media_photo" = "uma foto"; +"lng_action_pinned_media_video" = "um vídeo"; +"lng_action_pinned_media_audio" = "um áudio"; +"lng_action_pinned_media_voice" = "uma mensagem de voz"; +"lng_action_pinned_media_file" = "um arquivo"; +"lng_action_pinned_media_gif" = "um GIF"; +"lng_action_pinned_media_contact" = "um contato"; +"lng_action_pinned_media_location" = "uma localização"; +"lng_action_pinned_media_sticker" = "um sticker"; "lng_profile_migrate_reached" = "{count:_not_used_|# membro|# membros} limite alcançado"; "lng_profile_migrate_about" = "Se você deseja ir além do limite, pode converter seu grupo em um supergrupo. Nos supergrupos:"; @@ -559,15 +559,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_migrate_feature4" = "— Notificações silenciadas por padrão"; "lng_profile_migrate_button" = "Atualizar para supergrupo"; "lng_profile_migrate_sure" = "Tem certeza que deseja converter esse grupo para um supergrupo? Essa ação não pode ser desfeita."; -"lng_profile_convert_button" = "Convert to supergroup"; -"lng_profile_convert_title" = "Convert to supergroup"; -"lng_profile_convert_about" = "In supergroups:"; -"lng_profile_convert_feature1" = "— New members see the full message history"; -"lng_profile_convert_feature2" = "— Messages are deleted for all members"; -"lng_profile_convert_feature3" = "— Members can edit their own messages"; -"lng_profile_convert_feature4" = "— Creator can set a public link for the group"; -"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone"; -"lng_profile_convert_confirm" = "Convert"; +"lng_profile_convert_button" = "Converter a Supergrupo"; +"lng_profile_convert_title" = "Converter a Supergrupo"; +"lng_profile_convert_about" = "Em supergrupos:"; +"lng_profile_convert_feature1" = "— Novos membros podem ver todo o histórico"; +"lng_profile_convert_feature2" = "— Mensagens apagadas desaparecerão para todos"; +"lng_profile_convert_feature3" = "— Membros podem editar as próprias mensagens"; +"lng_profile_convert_feature4" = "— Criador pode definir um link público para o grupo"; +"lng_profile_convert_warning" = "{bold_start}Nota:{bold_end} Essa ação não pode ser desfeita"; +"lng_profile_convert_confirm" = "Converter"; +"lng_profile_add_more_after_upgrade" = "Você pode adicionar até {count:_not_used_|# membro|# membros} depois de atualizar seu grupo para um supergrupo."; "lng_channel_comments_count" = "{count:_not_used_|# comentário|# comentários}"; "lng_channel_hide_comments" = "Ocultar Comentários"; @@ -594,8 +595,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_forwarded" = "Encaminhado de {user}"; "lng_forwarded_channel" = "Encaminhado de {channel}"; -"lng_forwarded_via" = "Encaminhado de {user} via {online_bot}"; -"lng_forwarded_channel_via" = "Encaminhado de {channel} via {online_bot}"; +"lng_forwarded_via" = "Encaminhado de {user} via {inline_bot}"; +"lng_forwarded_channel_via" = "Encaminhado de {channel} via {inline_bot}"; "lng_forwarded_signed" = "{channel} ({user})"; "lng_in_reply_to" = "Em resposta a"; @@ -668,8 +669,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; -"lng_ban_user" = "Ban User"; -"lng_delete_all_from" = "Delete all from this user"; +"lng_ban_user" = "Banir Usuário"; +"lng_delete_all_from" = "Apagar tudo deste usuário"; "lng_report_spam" = "Reportar Spam"; "lng_report_spam_hide" = "Ocultar"; "lng_report_spam_thanks" = "Obrigado por reportar!"; @@ -778,8 +779,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_forward_msg" = "Encaminhar Mensagem"; "lng_context_delete_msg" = "Apagar Mensagem"; "lng_context_select_msg" = "Selecionar Mensagem"; -"lng_context_pin_msg" = "Pin Message"; -"lng_context_unpin_msg" = "Unpin Message"; +"lng_context_pin_msg" = "Fixar Mensagem"; +"lng_context_unpin_msg" = "Desafixar Mensagem"; "lng_context_cancel_upload" = "Cancelar Envio"; "lng_context_copy_selected" = "Copiar Texto Selecionado"; "lng_context_forward_selected" = "Encaminhar Selecionado"; @@ -879,7 +880,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_new_version_wrap" = "Telegram Desktop foi atualizado para a versão {version}\n\n{changes}\n\nHistórico completo de mudanças disponível aqui:\n{link}"; "lng_new_version_minor" = "— Resolução de bugs e outras melhorias menores"; -"lng_new_version_text" = "— Edite suas mensagens em canais e supergrupos.\n— Compartilhe links para postagens específicas nos canais pelo menu de contexto do post.\n— Adicione assinaturas de administradores nas mensagens dos canais.\n— Envie mensagens silenciosas em canais, que não notificarão os membros. Útil para mensagens não urgentes ou enviadas tarde da noite."; +"lng_new_version_text" = "GRUPOS PÚBLICOS, POSTS FIXADOS, 5.000 MEMBROS\n\n— Grupos agora podem ter até 5.000 membros (mais que 1.000)\n— Grupos de qualquer tamanho podem ser convertidos a supergrupos\n\nNovas ferramentas para administradores dos supergrupos:\n\n— Torne seu grupo público configurando um link público - qualquer um poderá ver a conversa e entrar nela\n— Fixe mensagens para manter as atualizações mais importantes visíveis e notificar todos os membros\n— Selecione várias mensagens para apagar, reporte por spam, bloqueie usuários ou remova todas as mensagens de certos usuários\n\nMais sobre essa atualização:\n{link}"; "lng_menu_insert_unicode" = "Inserir caractere de controle Unicode"; From 3e37be5d5c3f512a5fe2f027cfa925acd5883dc6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 13:34:32 +0300 Subject: [PATCH 195/316] version 0.9.31 stable --- Telegram/SourceFiles/config.h | 6 +++--- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 8807dc4d2d..fc2d7ac222 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,10 +20,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9030; -static const wchar_t *AppVersionStr = L"0.9.30"; +static const int32 AppVersion = 9031; +static const wchar_t *AppVersionStr = L"0.9.31"; static const bool DevVersion = false; -#define BETA_VERSION (9030002ULL) // just comment this line to build public version +//#define BETA_VERSION (9030002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index d5ad09d52f..3e8b9e29f5 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.30 + 0.9.31 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index df51f019c7..c80a0f8386 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,30,2 - PRODUCTVERSION 0,9,30,2 + FILEVERSION 0,9,31,0 + PRODUCTVERSION 0,9,31,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.30.2" + VALUE "FileVersion", "0.9.31.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.30.2" + VALUE "ProductVersion", "0.9.31.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 339fc41cfb..65122a0428 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1726,7 +1726,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.30; + CURRENT_PROJECT_VERSION = 0.9.31; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1745,7 +1745,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.30; + CURRENT_PROJECT_VERSION = 0.9.31; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1774,10 +1774,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.30; + CURRENT_PROJECT_VERSION = 0.9.31; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.30; + DYLIB_CURRENT_VERSION = 0.9.31; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1915,10 +1915,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.30; + CURRENT_PROJECT_VERSION = 0.9.31; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.30; + DYLIB_CURRENT_VERSION = 0.9.31; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 0ce492c311..0ba9a8588c 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9030 +AppVersion 9031 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.30 -AppVersionStr 0.9.30 +AppVersionStrSmall 0.9.31 +AppVersionStr 0.9.31 DevChannel 0 -BetaVersion 9030002 +BetaVersion 0 9030002 From 680ea9f6162d0950b0593cf009ca86715b4a2acf Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 16:27:01 +0300 Subject: [PATCH 196/316] report spam panel positioned under the pinned message --- Telegram/SourceFiles/historywidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a8dc52ad84..28aa496e7e 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -6202,12 +6202,14 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { if (_pinnedBar) { if (_scroll.y() != st::replyHeight) { _scroll.move(0, st::replyHeight); + _reportSpamPanel.move(0, st::replyHeight); _attachMention.setBoundings(_scroll.geometry()); } _pinnedBar->cancel.move(width() - _pinnedBar->cancel.width(), 0); _pinnedBar->shadow.setGeometry(0, st::replyHeight, width(), st::lineWidth); } else if (_scroll.y() != 0) { _scroll.move(0, 0); + _reportSpamPanel.move(0, 0); _attachMention.setBoundings(_scroll.geometry()); } From ebe6db3c48f7d2763754e15aba570c508973df64 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 18:28:39 +0300 Subject: [PATCH 197/316] crash fixed in migrated message highlight, xcode version fixed in docs --- Telegram/SourceFiles/historywidget.cpp | 4 ++-- doc/building-xcode-old.md | 2 +- doc/building-xcode.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index a8dc52ad84..5ce8f3564a 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1465,7 +1465,7 @@ HistoryItem *HistoryInner::prevItem(HistoryItem *item) { if (blockIndex > 0) { return item->history()->blocks[blockIndex - 1]->items.back(); } - if (item->history() == _history && _migrated && _history->loadedAtTop() && _migrated->loadedAtBottom() && !_migrated->isEmpty()) { + if (item->history() == _history && _migrated && _history->loadedAtTop() && !_migrated->isEmpty() && _migrated->loadedAtBottom()) { return _migrated->blocks.back()->items.back(); } return 0; @@ -6397,7 +6397,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, _animActiveStart = getms(); _animActiveTimer.start(AnimationTimerDelta); _activeAnimMsgId = _showAtMsgId; - if (item->isGroupMigrate() && _migrated && _migrated->loadedAtBottom() && _migrated->blocks.back()->items.back()->isGroupMigrate() && _list->historyTop() != _list->historyDrawTop()) { + if (item->isGroupMigrate() && _migrated && !_migrated->isEmpty() && _migrated->loadedAtBottom() && _migrated->blocks.back()->items.back()->isGroupMigrate() && _list->historyTop() != _list->historyDrawTop()) { _activeAnimMsgId = -_migrated->blocks.back()->items.back()->id; } } diff --git a/doc/building-xcode-old.md b/doc/building-xcode-old.md index cef39bc6a4..a42f03f1f5 100644 --- a/doc/building-xcode-old.md +++ b/doc/building-xcode-old.md @@ -1,4 +1,4 @@ -##Build instructions for Xcode 6.4 +##Build instructions for Xcode 7.2.1 ###Prepare folder diff --git a/doc/building-xcode.md b/doc/building-xcode.md index cdc229f7d4..e520697818 100644 --- a/doc/building-xcode.md +++ b/doc/building-xcode.md @@ -1,4 +1,4 @@ -##Build instructions for Xcode 6.4 +##Build instructions for Xcode 7.2.1 ###Prepare folder From 3a8824a9a66dfb6866ad899d315940e6682572d2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 19:59:18 +0300 Subject: [PATCH 198/316] intro rewrite started, new code sending methods --- Telegram/SourceFiles/boxes/confirmbox.cpp | 2 +- Telegram/SourceFiles/history.h | 2 +- Telegram/SourceFiles/intro/introcode.cpp | 77 +- Telegram/SourceFiles/intro/introcode.h | 18 +- Telegram/SourceFiles/intro/introphone.cpp | 85 +- Telegram/SourceFiles/intro/introphone.h | 18 +- Telegram/SourceFiles/intro/intropwdcheck.cpp | 33 +- Telegram/SourceFiles/intro/intropwdcheck.h | 11 +- Telegram/SourceFiles/intro/introsignup.cpp | 26 +- Telegram/SourceFiles/intro/introsignup.h | 11 +- .../intro/{introsteps.cpp => introstart.cpp} | 35 +- .../intro/{introsteps.h => introstart.h} | 16 +- .../intro/{intro.cpp => introwidget.cpp} | 190 ++--- .../intro/{intro.h => introwidget.h} | 78 +- Telegram/SourceFiles/mainwidget.cpp | 18 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 190 +++-- Telegram/SourceFiles/mtproto/mtpScheme.h | 745 +++++++++++------- Telegram/SourceFiles/mtproto/scheme.tl | 22 +- Telegram/SourceFiles/window.cpp | 2 +- Telegram/Telegram.pro | 8 +- Telegram/Telegram.vcxproj | 50 +- Telegram/Telegram.vcxproj.filters | 42 +- Telegram/Telegram.xcodeproj/project.pbxproj | 32 +- Telegram/Telegram.xcodeproj/qt_preprocess.mak | 20 +- 25 files changed, 966 insertions(+), 767 deletions(-) rename Telegram/SourceFiles/intro/{introsteps.cpp => introstart.cpp} (77%) rename Telegram/SourceFiles/intro/{introsteps.h => introstart.h} (79%) rename Telegram/SourceFiles/intro/{intro.cpp => introwidget.cpp} (69%) rename Telegram/SourceFiles/intro/{intro.h => introwidget.h} (73%) diff --git a/Telegram/SourceFiles/boxes/confirmbox.cpp b/Telegram/SourceFiles/boxes/confirmbox.cpp index b73b15d896..9de6652530 100644 --- a/Telegram/SourceFiles/boxes/confirmbox.cpp +++ b/Telegram/SourceFiles/boxes/confirmbox.cpp @@ -473,7 +473,7 @@ void RichDeleteMessageBox::onDelete() { if (_deleteAll.checked()) { App::main()->deleteAllFromUser(_channel, _from); } - if (auto item = App::histItemById(_channel ? peerToChannel(_channel->id) : 0, _msgId)) { + if (HistoryItem *item = App::histItemById(_channel ? peerToChannel(_channel->id) : 0, _msgId)) { bool wasLast = (item->history()->lastMsg == item); item->destroy(); if (_msgId > 0) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index b76268e1d1..ece0bbc722 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1097,7 +1097,7 @@ public: bool canEdit(const QDateTime &cur) const; bool suggestBanReportDeleteAll() const { - auto channel = history()->peer->asChannel(); + ChannelData *channel = history()->peer->asChannel(); if (!channel || (!channel->amEditor() && !channel->amCreator())) return false; return !isPost() && !out() && from()->isUser() && toHistoryMessage(); } diff --git a/Telegram/SourceFiles/intro/introcode.cpp b/Telegram/SourceFiles/intro/introcode.cpp index 35f2540ea8..803c1d2649 100644 --- a/Telegram/SourceFiles/intro/introcode.cpp +++ b/Telegram/SourceFiles/intro/introcode.cpp @@ -25,7 +25,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" #include "intro/introcode.h" -#include "intro/intro.h" +#include "intro/introsignup.h" +#include "intro/intropwdcheck.h" CodeInput::CodeInput(QWidget *parent, const style::flatInput &st, const QString &ph) : FlatInput(parent, st, ph) { } @@ -72,7 +73,7 @@ void CodeInput::correctValue(const QString &was, QString &now) { if (strict) emit codeEntered(); } -IntroCode::IntroCode(IntroWidget *parent) : IntroStage(parent) +IntroCode::IntroCode(IntroWidget *parent) : IntroStep(parent) , a_errorAlpha(0) , _a_error(animation(this, &IntroCode::step_error)) , next(this, lang(lng_intro_next), st::btnIntroNext) @@ -80,11 +81,10 @@ IntroCode::IntroCode(IntroWidget *parent) : IntroStage(parent) , _noTelegramCode(this, lang(lng_code_no_telegram), st::introLink) , _noTelegramCodeRequestId(0) , code(this, st::inpIntroCode, lang(lng_code_ph)) +, sentRequest(0) , waitTillCall(intro()->getCallTimeout()) { - setVisible(false); setGeometry(parent->innerRect()); - connect(&next, SIGNAL(stateChanged(int, ButtonStateChangeSource)), parent, SLOT(onDoneStateChanged(int, ButtonStateChangeSource))); connect(&next, SIGNAL(clicked()), this, SLOT(onSubmitCode())); connect(&code, SIGNAL(changed()), this, SLOT(onInputChange())); connect(&callTimer, SIGNAL(timeout()), this, SLOT(onSendCall())); @@ -92,6 +92,11 @@ IntroCode::IntroCode(IntroWidget *parent) : IntroStage(parent) connect(&_noTelegramCode, SIGNAL(clicked()), this, SLOT(onNoTelegramCode())); updateDescText(); + + waitTillCall = intro()->getCallTimeout(); + if (!intro()->codeByTelegram()) { + callTimer.start(1000); + } } void IntroCode::updateDescText() { @@ -172,7 +177,7 @@ void IntroCode::step_error(float64 ms, bool timer) { _a_error.stop(); a_errorAlpha.finish(); if (!a_errorAlpha.current()) { - error = ""; + error.clear(); } } else { a_errorAlpha.update(dt, st::introErrFunc); @@ -181,30 +186,29 @@ void IntroCode::step_error(float64 ms, bool timer) { } void IntroCode::activate() { - waitTillCall = intro()->getCallTimeout(); - if (!intro()->codeByTelegram()) { - callTimer.start(1000); - } - error = ""; - a_errorAlpha = anim::fvalue(0); - sentCode = QString(); - show(); - code.setDisabled(false); + IntroStep::activate(); code.setFocus(); } -void IntroCode::prepareShow() { +void IntroCode::finished() { + IntroStep::finished(); + error.clear(); + a_errorAlpha = anim::fvalue(0); + + sentCode.clear(); + code.setDisabled(false); + + callTimer.stop(); code.setText(QString()); + rpcClear(); +} + +void IntroCode::cancelled() { if (sentRequest) { MTP::cancel(sentRequest); sentRequest = 0; } -} - -void IntroCode::deactivate() { - callTimer.stop(); - hide(); - code.clearFocus(); + MTP::send(MTPauth_CancelCode(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash()))); } void IntroCode::stopCheck() { @@ -218,9 +222,9 @@ void IntroCode::onCheckRequest() { if (leftms >= 1000) { if (sentRequest) { MTP::cancel(sentRequest); - sentCode = ""; + sentRequest = 0; + sentCode.clear(); } - sentRequest = 0; if (!code.isEnabled()) { code.setDisabled(false); code.setFocus(); @@ -234,6 +238,7 @@ void IntroCode::onCheckRequest() { void IntroCode::codeSubmitDone(const MTPauth_Authorization &result) { stopCheck(); + sentRequest = 0; code.setDisabled(false); const MTPDauth_authorization &d(result.c_auth_authorization()); if (d.vuser.type() != mtpc_user || !d.vuser.c_user().is_self()) { // wtf? @@ -246,10 +251,11 @@ void IntroCode::codeSubmitDone(const MTPauth_Authorization &result) { bool IntroCode::codeSubmitFail(const RPCError &error) { stopCheck(); + sentRequest = 0; code.setDisabled(false); const QString &err = error.type(); if (err == "PHONE_NUMBER_INVALID" || err == "PHONE_CODE_EXPIRED") { // show error - onBack(); + intro()->onBack(); return true; } else if (err == "PHONE_CODE_EMPTY" || err == "PHONE_CODE_INVALID") { showError(lang(lng_bad_code)); @@ -257,7 +263,7 @@ bool IntroCode::codeSubmitFail(const RPCError &error) { return true; } else if (err == "PHONE_NUMBER_UNOCCUPIED") { // success, need to signUp intro()->setCode(sentCode); - intro()->onIntroNext(); + intro()->nextStep(new IntroSignup(intro())); return true; } else if (err == "SESSION_PASSWORD_NEEDED") { intro()->setCode(sentCode); @@ -280,14 +286,14 @@ bool IntroCode::codeSubmitFail(const RPCError &error) { } void IntroCode::onInputChange() { - showError(""); + showError(QString()); if (code.text().length() == 5) onSubmitCode(); } void IntroCode::onSendCall() { if (!--waitTillCall) { callTimer.stop(); - MTP::send(MTPauth_SendCall(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::callDone)); + MTP::send(MTPauth_ResendCode(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::callDone)); } update(); } @@ -301,6 +307,7 @@ void IntroCode::callDone(const MTPBool &v) { void IntroCode::gotPassword(const MTPaccount_Password &result) { stopCheck(); + sentRequest = 0; code.setDisabled(false); switch (result.type()) { case mtpc_account_noPassword: // should not happen @@ -312,18 +319,18 @@ void IntroCode::gotPassword(const MTPaccount_Password &result) { intro()->setPwdSalt(qba(d.vcurrent_salt)); intro()->setHasRecovery(mtpIsTrue(d.vhas_recovery)); intro()->setPwdHint(qs(d.vhint)); - intro()->onIntroNext(); + intro()->nextStep(new IntroPwdCheck(intro())); } break; } } -void IntroCode::onSubmitCode(bool force) { - if (!force && (code.text() == sentCode || !code.isEnabled())) return; +void IntroCode::onSubmitCode() { + if (sentRequest) return; code.setDisabled(true); setFocus(); - showError(""); + showError(QString()); checkRequest.start(1000); @@ -336,7 +343,7 @@ void IntroCode::onSubmitCode(bool force) { void IntroCode::onNoTelegramCode() { if (_noTelegramCodeRequestId) return; - _noTelegramCodeRequestId = MTP::send(MTPauth_SendSms(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::noTelegramCodeDone), rpcFail(&IntroCode::noTelegramCodeFail)); + _noTelegramCodeRequestId = MTP::send(MTPauth_ResendCode(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::noTelegramCodeDone), rpcFail(&IntroCode::noTelegramCodeFail)); } void IntroCode::noTelegramCodeDone(const MTPBool &result) { @@ -359,10 +366,6 @@ bool IntroCode::noTelegramCodeFail(const RPCError &error) { return false; } -void IntroCode::onNext() { +void IntroCode::onSubmit() { onSubmitCode(); } - -void IntroCode::onBack() { - intro()->onIntroBack(); -} diff --git a/Telegram/SourceFiles/intro/introcode.h b/Telegram/SourceFiles/intro/introcode.h index 174cb7c2b1..def8f28713 100644 --- a/Telegram/SourceFiles/intro/introcode.h +++ b/Telegram/SourceFiles/intro/introcode.h @@ -23,9 +23,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include "gui/flatbutton.h" #include "gui/flatinput.h" -#include "intro.h" +#include "intro/introwidget.h" -class CodeInput : public FlatInput { +class CodeInput final : public FlatInput { Q_OBJECT public: @@ -42,7 +42,7 @@ protected: }; -class IntroCode : public IntroStage, public RPCSender { +class IntroCode final : public IntroStep { Q_OBJECT public: @@ -54,15 +54,13 @@ public: void step_error(float64 ms, bool timer); - void activate(); - void prepareShow(); - void deactivate(); - void onNext(); - void onBack(); - bool hasBack() const { return true; } + void activate() override; + void finished() override; + void cancelled() override; + void onSubmit() override; void codeSubmitDone(const MTPauth_Authorization &result); bool codeSubmitFail(const RPCError &error); @@ -71,7 +69,7 @@ public: public slots: - void onSubmitCode(bool force = false); + void onSubmitCode(); void onNoTelegramCode(); void onInputChange(); void onSendCall(); diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index 482e478111..05cfc240c1 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" #include "intro/introphone.h" -#include "intro/intro.h" +#include "intro/introcode.h" namespace { class SignUpLink : public ITextLink { @@ -45,7 +45,7 @@ namespace { }; } -IntroPhone::IntroPhone(IntroWidget *parent) : IntroStage(parent) +IntroPhone::IntroPhone(IntroWidget *parent) : IntroStep(parent) , a_errorAlpha(0) , _a_error(animation(this, &IntroPhone::step_error)) , changed(false) @@ -54,11 +54,11 @@ IntroPhone::IntroPhone(IntroWidget *parent) : IntroStage(parent) , phone(this, st::inpIntroPhone) , code(this, st::inpIntroCountryCode) , _signup(this, lng_phone_notreg(lt_signup_start, textcmdStartLink(1), lt_signup_end, textcmdStopLink()), st::introErrLabel, st::introErrLabelTextStyle) -, _showSignup(false) { +, _showSignup(false) +, sentRequest(0) { setVisible(false); setGeometry(parent->innerRect()); - connect(&next, SIGNAL(stateChanged(int, ButtonStateChangeSource)), parent, SLOT(onDoneStateChanged(int, ButtonStateChangeSource))); connect(&next, SIGNAL(clicked()), this, SLOT(onSubmitPhone())); connect(&phone, SIGNAL(voidBackspace(QKeyEvent*)), &code, SLOT(startErasing(QKeyEvent*))); connect(&country, SIGNAL(codeChanged(const QString &)), &code, SLOT(codeSelected(const QString &))); @@ -145,7 +145,7 @@ void IntroPhone::step_error(float64 ms, bool timer) { _a_error.stop(); a_errorAlpha.finish(); if (!a_errorAlpha.current()) { - error = ""; + error.clear(); _signup.hide(); } else if (!error.isEmpty() && _showSignup) { _signup.show(); @@ -164,7 +164,7 @@ void IntroPhone::countryChanged() { void IntroPhone::onInputChange() { changed = true; - showError(""); + showError(QString()); } void IntroPhone::disableAll() { @@ -183,8 +183,8 @@ void IntroPhone::enableAll(bool failed) { if (failed) phone.setFocus(); } -void IntroPhone::onSubmitPhone(bool force) { - if (!force && !next.isEnabled()) return; +void IntroPhone::onSubmitPhone() { + if (sentRequest || isHidden()) return; if (!App::isValidPhone(fullNumber())) { showError(lang(lng_bad_phone)); @@ -193,7 +193,7 @@ void IntroPhone::onSubmitPhone(bool force) { } disableAll(); - showError(""); + showError(QString()); checkRequest.start(1000); @@ -226,45 +226,56 @@ void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) { const MTPDauth_checkedPhone &d(result.c_auth_checkedPhone()); if (mtpIsTrue(d.vphone_registered)) { disableAll(); - showError(""); + showError(QString()); checkRequest.start(1000); - sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(5), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + 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)); } else { showError(lang(lng_bad_phone_noreg), true); enableAll(true); + sentRequest = 0; } } void IntroPhone::phoneSubmitDone(const MTPauth_SentCode &result) { stopCheck(); - enableAll(false); + sentRequest = 0; + enableAll(true); - if (result.type() == mtpc_auth_sentCode) { - const MTPDauth_sentCode &d(result.c_auth_sentCode()); - intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), mtpIsTrue(d.vphone_registered)); - intro()->setCallTimeout(d.vsend_call_timeout.v); - } else if (result.type() == mtpc_auth_sentAppCode) { - const MTPDauth_sentAppCode &d(result.c_auth_sentAppCode()); - intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), mtpIsTrue(d.vphone_registered)); - intro()->setCallTimeout(d.vsend_call_timeout.v); - intro()->setCodeByTelegram(true); + if (result.type() != mtpc_auth_sentCode) { + showError(lang(lng_server_error)); + return; } - intro()->onIntroNext(); + + const MTPDauth_sentCode &d(result.c_auth_sentCode()); + switch (d.vtype.type()) { + case mtpc_auth_sentCodeTypeApp: intro()->setCodeByTelegram(true); + case mtpc_auth_sentCodeTypeSms: intro()->setCodeByTelegram(false); + case mtpc_auth_sentCodeTypeCall: intro()->setCodeByTelegram(false); + case mtpc_auth_sentCodeTypeFlashCall: LOG(("Error: should not be flashcall!")); break; + } + intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), d.is_phone_registered()); + if (d.has_timeout() && d.has_next_type() && d.vnext_type.type() == mtpc_auth_codeTypeCall) { + intro()->setCallTimeout(d.vtimeout.v); + } + intro()->nextStep(new IntroCode(intro())); } void IntroPhone::toSignUp() { disableAll(); - showError(""); + showError(QString()); checkRequest.start(1000); - sentRequest = MTP::send(MTPauth_SendCode(MTP_string(sentPhone), MTP_int(0), MTP_int(ApiId), MTP_string(ApiHash), MTP_string(Sandbox::LangSystemISO())), rpcDone(&IntroPhone::phoneSubmitDone), rpcFail(&IntroPhone::phoneSubmitFail)); + 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)); } bool IntroPhone::phoneSubmitFail(const RPCError &error) { stopCheck(); + sentRequest = 0; const QString &err = error.type(); if (err == "PHONE_NUMBER_INVALID") { // show error showError(lang(lng_bad_phone)); @@ -293,21 +304,27 @@ void IntroPhone::selectCountry(const QString &c) { } void IntroPhone::activate() { - error = ""; + IntroStep::activate(); + phone.setFocus(); +} + +void IntroPhone::finished() { + IntroStep::finished(); + checkRequest.stop(); + rpcClear(); + + error.clear(); a_errorAlpha = anim::fvalue(0); - show(); enableAll(true); } -void IntroPhone::deactivate() { - checkRequest.stop(); - hide(); - phone.clearFocus(); +void IntroPhone::cancelled() { + if (sentRequest) { + MTP::cancel(sentRequest); + sentRequest = 0; + } } -void IntroPhone::onNext() { +void IntroPhone::onSubmit() { onSubmitPhone(); } - -void IntroPhone::onBack() { -} diff --git a/Telegram/SourceFiles/intro/introphone.h b/Telegram/SourceFiles/intro/introphone.h index 3a4357112c..d129b05f8a 100644 --- a/Telegram/SourceFiles/intro/introphone.h +++ b/Telegram/SourceFiles/intro/introphone.h @@ -23,26 +23,26 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include "gui/flatbutton.h" #include "gui/countryinput.h" -#include "intro.h" +#include "intro/introwidget.h" -class IntroPhone : public IntroStage, public RPCSender { +class IntroPhone final : public IntroStep { Q_OBJECT public: IntroPhone(IntroWidget *parent); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; void step_error(float64 ms, bool timer); void selectCountry(const QString &country); - void activate(); - void deactivate(); - void onNext(); - void onBack(); + void activate() override; + void finished() override; + void cancelled() override; + void onSubmit() override; void phoneCheckDone(const MTPauth_CheckedPhone &result); void phoneSubmitDone(const MTPauth_SentCode &result); @@ -54,7 +54,7 @@ public slots: void countryChanged(); void onInputChange(); - void onSubmitPhone(bool force = false); + void onSubmitPhone(); void onCheckRequest(); private: diff --git a/Telegram/SourceFiles/intro/intropwdcheck.cpp b/Telegram/SourceFiles/intro/intropwdcheck.cpp index 9e4ba5acdc..3f2a0d5bdd 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.cpp +++ b/Telegram/SourceFiles/intro/intropwdcheck.cpp @@ -28,9 +28,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" #include "intro/intropwdcheck.h" -#include "intro/intro.h" -IntroPwdCheck::IntroPwdCheck(IntroWidget *parent) : IntroStage(parent) +IntroPwdCheck::IntroPwdCheck(IntroWidget *parent) : IntroStep(parent) , a_errorAlpha(0) , _a_error(animation(this, &IntroPwdCheck::step_error)) , _next(this, lang(lng_intro_submit), st::btnIntroNext) @@ -130,7 +129,7 @@ void IntroPwdCheck::step_error(float64 ms, bool timer) { _a_error.stop(); a_errorAlpha.finish(); if (!a_errorAlpha.current()) { - error = ""; + error.clear(); } } else { a_errorAlpha.update(dt, st::introErrFunc); @@ -139,7 +138,7 @@ void IntroPwdCheck::step_error(float64 ms, bool timer) { } void IntroPwdCheck::activate() { - show(); + IntroStep::activate(); if (_pwdField.isHidden()) { _codeField.setFocus(); } else { @@ -147,8 +146,11 @@ void IntroPwdCheck::activate() { } } -void IntroPwdCheck::deactivate() { - hide(); +void IntroPwdCheck::cancelled() { + if (sentRequest) { + MTP::cancel(sentRequest); + sentRequest = 0; + } } void IntroPwdCheck::stopCheck() { @@ -202,7 +204,7 @@ bool IntroPwdCheck::pwdSubmitFail(const RPCError &error) { _pwdField.notaBene(); return true; } else if (err == "PASSWORD_EMPTY") { - intro()->onIntroBack(); + intro()->onBack(); } else if (mtpIsFlood(error)) { showError(lang(lng_flood_error)); _pwdField.notaBene(); @@ -224,7 +226,7 @@ bool IntroPwdCheck::codeSubmitFail(const RPCError &error) { _codeField.setDisabled(false); const QString &err = error.type(); if (err == "PASSWORD_EMPTY") { - intro()->onIntroBack(); + intro()->onBack(); return true; } else if (err == "PASSWORD_RECOVERY_NA") { recoverStartFail(error); @@ -265,7 +267,7 @@ bool IntroPwdCheck::recoverStartFail(const RPCError &error) { _codeField.hide(); _pwdField.setFocus(); update(); - showError(""); + showError(QString()); return true; } @@ -275,7 +277,7 @@ void IntroPwdCheck::onToRecover() { MTP::cancel(sentRequest); sentRequest = 0; } - showError(""); + showError(QString()); _toRecover.hide(); _toPassword.show(); _pwdField.hide(); @@ -335,11 +337,11 @@ bool IntroPwdCheck::deleteFail(const RPCError &error) { void IntroPwdCheck::deleteDone(const MTPBool &v) { Ui::hideLayer(); - intro()->onIntroNext(); + intro()->onBack(); } void IntroPwdCheck::onInputChange() { - showError(""); + showError(QString()); } void IntroPwdCheck::onSubmitPwd(bool force) { @@ -359,7 +361,7 @@ void IntroPwdCheck::onSubmitPwd(bool force) { _pwdField.setDisabled(true); setFocus(); - showError(""); + showError(QString()); QByteArray pwdData = _salt + _pwdField.text().toUtf8() + _salt, pwdHash(32, Qt::Uninitialized); hashSha256(pwdData.constData(), pwdData.size(), pwdHash.data()); @@ -367,9 +369,6 @@ void IntroPwdCheck::onSubmitPwd(bool force) { } } -void IntroPwdCheck::onNext() { +void IntroPwdCheck::onSubmit() { onSubmitPwd(); } - -void IntroPwdCheck::onBack() { -} diff --git a/Telegram/SourceFiles/intro/intropwdcheck.h b/Telegram/SourceFiles/intro/intropwdcheck.h index 9a0d1c1f69..9814a5743a 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.h +++ b/Telegram/SourceFiles/intro/intropwdcheck.h @@ -23,9 +23,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include "gui/flatbutton.h" #include "gui/flatinput.h" -#include "intro.h" +#include "intro/introwidget.h" -class IntroPwdCheck final : public IntroStage, public RPCSender { +class IntroPwdCheck final : public IntroStep { Q_OBJECT public: @@ -37,10 +37,9 @@ public: void step_error(float64 ms, bool timer); - void activate(); - void deactivate(); - void onNext(); - void onBack(); + void activate() override; + void cancelled() override; + void onSubmit() override; void pwdSubmitDone(bool recover, const MTPauth_Authorization &result); bool pwdSubmitFail(const RPCError &error); diff --git a/Telegram/SourceFiles/intro/introsignup.cpp b/Telegram/SourceFiles/intro/introsignup.cpp index 78d01ffb64..5902317272 100644 --- a/Telegram/SourceFiles/intro/introsignup.cpp +++ b/Telegram/SourceFiles/intro/introsignup.cpp @@ -28,9 +28,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" #include "intro/introsignup.h" -#include "intro/intro.h" -IntroSignup::IntroSignup(IntroWidget *parent) : IntroStage(parent) +IntroSignup::IntroSignup(IntroWidget *parent) : IntroStep(parent) , a_errorAlpha(0) , a_photoOver(0) , _a_error(animation(this, &IntroSignup::step_error)) @@ -38,6 +37,7 @@ IntroSignup::IntroSignup(IntroWidget *parent) : IntroStage(parent) , next(this, lang(lng_intro_finish), st::btnIntroNext) , first(this, st::inpIntroName, lang(lng_signup_firstname)) , last(this, st::inpIntroName, lang(lng_signup_lastname)) +, sentRequest(0) , _invertOrder(langFirstNameGoesSecond()) { setVisible(false); setGeometry(parent->innerRect()); @@ -180,7 +180,7 @@ void IntroSignup::step_error(float64 ms, bool timer) { _a_error.stop(); a_errorAlpha.finish(); if (!a_errorAlpha.current()) { - error = ""; + error.clear(); } } else { a_errorAlpha.update(dt, st::introErrFunc); @@ -201,7 +201,7 @@ void IntroSignup::step_photo(float64 ms, bool timer) { } void IntroSignup::activate() { - show(); + IntroStep::activate(); if (_invertOrder) { last.setFocus(); } else { @@ -209,8 +209,11 @@ void IntroSignup::activate() { } } -void IntroSignup::deactivate() { - hide(); +void IntroSignup::cancelled() { + if (sentRequest) { + MTP::cancel(sentRequest); + sentRequest = 0; + } } void IntroSignup::stopCheck() { @@ -264,7 +267,7 @@ bool IntroSignup::nameSubmitFail(const RPCError &error) { last.setDisabled(false); const QString &err = error.type(); if (err == "PHONE_NUMBER_INVALID" || err == "PHONE_CODE_EXPIRED" || err == "PHONE_CODE_EMPTY" || err == "PHONE_CODE_INVALID" || err == "PHONE_NUMBER_OCCUPIED") { - intro()->onIntroBack(); + intro()->onBack(); return true; } else if (err == "FIRSTNAME_INVALID") { showError(lang(lng_bad_name)); @@ -297,7 +300,7 @@ bool IntroSignup::nameSubmitFail(const RPCError &error) { } void IntroSignup::onInputChange() { - showError(""); + showError(QString()); } void IntroSignup::onSubmitName(bool force) { @@ -324,16 +327,13 @@ void IntroSignup::onSubmitName(bool force) { last.setDisabled(true); setFocus(); - showError(""); + showError(QString()); firstName = first.text().trimmed(); lastName = last.text().trimmed(); sentRequest = MTP::send(MTPauth_SignUp(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash()), MTP_string(intro()->getCode()), MTP_string(firstName), MTP_string(lastName)), rpcDone(&IntroSignup::nameSubmitDone), rpcFail(&IntroSignup::nameSubmitFail)); } -void IntroSignup::onNext() { +void IntroSignup::onSubmit() { onSubmitName(); } - -void IntroSignup::onBack() { -} diff --git a/Telegram/SourceFiles/intro/introsignup.h b/Telegram/SourceFiles/intro/introsignup.h index 4a9f7df3e3..cd166b8a5e 100644 --- a/Telegram/SourceFiles/intro/introsignup.h +++ b/Telegram/SourceFiles/intro/introsignup.h @@ -23,9 +23,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include "gui/flatbutton.h" #include "gui/flatinput.h" -#include "intro.h" +#include "intro/introwidget.h" -class IntroSignup : public IntroStage, public RPCSender { +class IntroSignup final : public IntroStep { Q_OBJECT public: @@ -40,10 +40,9 @@ public: void step_error(float64 ms, bool timer); void step_photo(float64 ms, bool timer); - void activate(); - void deactivate(); - void onNext(); - void onBack(); + void activate() override; + void cancelled() override; + void onSubmit() override; void nameSubmitDone(const MTPauth_Authorization &result); bool nameSubmitFail(const RPCError &error); diff --git a/Telegram/SourceFiles/intro/introsteps.cpp b/Telegram/SourceFiles/intro/introstart.cpp similarity index 77% rename from Telegram/SourceFiles/intro/introsteps.cpp rename to Telegram/SourceFiles/intro/introstart.cpp index d55c7ccad8..fa900a45ee 100644 --- a/Telegram/SourceFiles/intro/introsteps.cpp +++ b/Telegram/SourceFiles/intro/introstart.cpp @@ -24,16 +24,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" -#include "intro/introsteps.h" -#include "intro/intro.h" +#include "intro/introstart.h" +#include "intro/introphone.h" #include "langloaderplain.h" -IntroSteps::IntroSteps(IntroWidget *parent) : IntroStage(parent), -_intro(this, lang(lng_intro), st::introLabel, st::introLabelTextStyle), -_changeLang(this, QString()), -_next(this, lang(lng_start_msgs), st::btnIntroNext) { - +IntroStart::IntroStart(IntroWidget *parent) : IntroStep(parent) +, _intro(this, lang(lng_intro), st::introLabel, st::introLabelTextStyle) +, _changeLang(this, QString()) +, _next(this, lang(lng_start_msgs), st::btnIntroNext) { _changeLang.hide(); if (cLang() == languageDefault) { int32 l = Sandbox::LangSystem(); @@ -56,15 +55,14 @@ _next(this, lang(lng_start_msgs), st::btnIntroNext) { setGeometry(parent->innerRect()); - connect(&_next, SIGNAL(stateChanged(int, ButtonStateChangeSource)), parent, SLOT(onDoneStateChanged(int, ButtonStateChangeSource))); - connect(&_next, SIGNAL(clicked()), parent, SLOT(onIntroNext())); + connect(&_next, SIGNAL(clicked()), parent, SLOT(onStepSubmit())); connect(&_changeLang, SIGNAL(clicked()), parent, SLOT(onChangeLang())); setMouseTracking(true); } -void IntroSteps::paintEvent(QPaintEvent *e) { +void IntroStart::paintEvent(QPaintEvent *e) { bool trivial = (rect() == e->rect()); QPainter p(this); @@ -80,7 +78,7 @@ void IntroSteps::paintEvent(QPaintEvent *e) { p.drawPixmap(QPoint((width() - st::aboutIcon.pxWidth()) / 2, hy - st::introIconSkip - st::aboutIcon.pxHeight()), App::sprite(), st::aboutIcon); } -void IntroSteps::resizeEvent(QResizeEvent *e) { +void IntroStart::resizeEvent(QResizeEvent *e) { if (e->oldSize().width() != width()) { _next.move((width() - _next.width()) / 2, st::introBtnTop); _intro.move((width() - _intro.width()) / 2, _next.y() - _intro.height() - st::introSkip); @@ -88,17 +86,6 @@ void IntroSteps::resizeEvent(QResizeEvent *e) { } } -void IntroSteps::activate() { - show(); -} - -void IntroSteps::deactivate() { - hide(); -} - -void IntroSteps::onNext() { - intro()->onIntroNext(); -} - -void IntroSteps::onBack() { +void IntroStart::onSubmit() { + intro()->nextStep(new IntroPhone(intro())); } diff --git a/Telegram/SourceFiles/intro/introsteps.h b/Telegram/SourceFiles/intro/introstart.h similarity index 79% rename from Telegram/SourceFiles/intro/introsteps.h rename to Telegram/SourceFiles/intro/introstart.h index e554f11fb9..8bd86075df 100644 --- a/Telegram/SourceFiles/intro/introsteps.h +++ b/Telegram/SourceFiles/intro/introstart.h @@ -20,21 +20,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -#include "gui/flatbutton.h" -#include "intro.h" +#include "intro/introwidget.h" -class IntroSteps : public IntroStage { +class IntroStart final : public IntroStep { public: - IntroSteps(IntroWidget *parent); + IntroStart(IntroWidget *parent); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; - void activate(); - void deactivate(); - void onNext(); - void onBack(); + void onSubmit() override; private: diff --git a/Telegram/SourceFiles/intro/intro.cpp b/Telegram/SourceFiles/intro/introwidget.cpp similarity index 69% rename from Telegram/SourceFiles/intro/intro.cpp rename to Telegram/SourceFiles/intro/introwidget.cpp index ec2c1bafde..bb5a255550 100644 --- a/Telegram/SourceFiles/intro/intro.cpp +++ b/Telegram/SourceFiles/intro/introwidget.cpp @@ -24,8 +24,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" -#include "intro/intro.h" -#include "intro/introsteps.h" +#include "intro/introwidget.h" +#include "intro/introstart.h" #include "intro/introphone.h" #include "intro/introcode.h" #include "intro/introsignup.h" @@ -52,19 +52,12 @@ namespace { } } -IntroWidget::IntroWidget(Window *window) : TWidget(window) +IntroWidget::IntroWidget(QWidget *parent) : TWidget(parent) , _langChangeTo(0) , _a_stage(animation(this, &IntroWidget::step_stage)) , _cacheHideIndex(0) , _cacheShowIndex(0) , _a_show(animation(this, &IntroWidget::step_show)) -, steps(new IntroSteps(this)) -, phone(0) -, code(0) -, signup(0) -, pwdcheck(0) -, current(0) -, moving(0) , _callTimeout(60) , _registered(false) , _hasRecovery(false) @@ -74,7 +67,7 @@ IntroWidget::IntroWidget(Window *window) : TWidget(window) , _backTo(0) { setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight)); - connect(&_back, SIGNAL(clicked()), this, SLOT(onIntroBack())); + connect(&_back, SIGNAL(clicked()), this, SLOT(onBack())); _back.hide(); countryForReg = psCurrentCountry(); @@ -82,11 +75,10 @@ IntroWidget::IntroWidget(Window *window) : TWidget(window) MTP::send(MTPhelp_GetNearestDc(), rpcDone(gotNearestDC)); signalEmitOn = this; - stages[0] = steps; - memset(stages + 1, 0, sizeof(QWidget*) * 3); + _stepHistory.push_back(new IntroStart(this)); _back.raise(); - connect(window, SIGNAL(resized(const QSize&)), this, SLOT(onParentResize(const QSize&))); + connect(parent, SIGNAL(resized(const QSize&)), this, SLOT(onParentResize(const QSize&))); show(); setFocus(); @@ -112,92 +104,77 @@ void IntroWidget::onParentResize(const QSize &newSize) { resize(newSize); } -void IntroWidget::onIntroBack() { - if (!current) return; - moving = (current == 4) ? -2 : -1; - prepareMove(); +void IntroWidget::onStepSubmit() { + step()->onSubmit(); } -void IntroWidget::onIntroNext() { - if (!createNext()) return; - moving = 1; - prepareMove(); +void IntroWidget::onBack() { + historyMove(MoveBack); } -bool IntroWidget::createNext() { - if (current == sizeof(stages) / sizeof(stages[0]) - 1) return false; - if (!stages[current + 1]) { - switch (current) { - case 0: stages[current + 1] = phone = new IntroPhone(this); break; - case 1: stages[current + 1] = code = new IntroCode(this); break; - case 2: - if (_pwdSalt.isEmpty()) { - if (signup) delete signup; - stages[current + 1] = signup = new IntroSignup(this); - } else { - stages[current + 1] = pwdcheck = new IntroPwdCheck(this); - } - break; - case 3: stages[current + 1] = signup = new IntroSignup(this); break; - } - } - _back.raise(); - return true; -} +void IntroWidget::historyMove(MoveType type) { + if (_a_stage.animating()) return; + + t_assert(_stepHistory.size() > 1); -void IntroWidget::prepareMove() { if (App::app()) App::app()->mtpPause(); - if (_cacheHide.isNull() || _cacheHideIndex != current) makeHideCache(); + switch (type) { + case MoveBack: { + _cacheHide = grabStep(); - stages[current + moving]->prepareShow(); - if (_cacheShow.isNull() || _cacheShowIndex != current + moving) makeShowCache(); + IntroStep *back = step(); + _backFrom = back->hasBack() ? 1 : 0; + _stepHistory.pop_back(); + back->cancelled(); + delete back; + } break; - int32 m = (moving > 0) ? 1 : -1; + case MoveForward: { + _cacheHide = grabStep(1); + _backFrom = step(1)->hasBack() ? 1 : 0; + step(1)->finished(); + } break; + + case MoveReplace: { + _cacheHide = grabStep(1); + IntroStep *replaced = step(1); + _backFrom = replaced->hasBack() ? 1 : 0; + _stepHistory.removeAt(_stepHistory.size() - 2); + replaced->finished(); + delete replaced; + } break; + } + + _cacheShow = grabStep(); + _backTo = step()->hasBack() ? 1 : 0; + + int32 m = (type == MoveBack) ? -1 : 1; a_coordHide = anim::ivalue(0, -m * st::introSlideShift); a_opacityHide = anim::fvalue(1, 0); a_coordShow = anim::ivalue(m * st::introSlideShift, 0); a_opacityShow = anim::fvalue(0, 1); _a_stage.start(); - _backTo = stages[current + moving]->hasBack() ? 1 : 0; - _backFrom = stages[current]->hasBack() ? 1 : 0; _a_stage.step(); if (_backFrom > 0 || _backTo > 0) { _back.show(); } else { _back.hide(); } - stages[current]->deactivate(); - stages[current + moving]->hide(); + step()->hide(); } -void IntroWidget::onDoneStateChanged(int oldState, ButtonStateChangeSource source) { - if (_a_stage.animating()) return; - if (source == ButtonByPress) { - if (oldState & Button::StateDown) { - _cacheHide = QPixmap(); - } else { - makeHideCache(); - } - } else if (source == ButtonByHover && current != 2) { - if (!createNext()) return; - if (!_cacheShow) makeShowCache(current + 1); - } +void IntroWidget::pushStep(IntroStep *step, MoveType type) { + _stepHistory.push_back(step); + _back.raise(); + _stepHistory.back()->hide(); + + historyMove(type); } -void IntroWidget::makeHideCache(int stage) { - if (stage < 0) stage = current; - int w = st::introSize.width(), h = st::introSize.height(); - _cacheHide = myGrab(stages[stage], QRect(st::introSlideShift, 0, w, h)); - _cacheHideIndex = stage; -} - -void IntroWidget::makeShowCache(int stage) { - if (stage < 0) stage = current + moving; - int w = st::introSize.width(), h = st::introSize.height(); - _cacheShow = myGrab(stages[stage], QRect(st::introSlideShift, 0, w, h)); - _cacheShowIndex = stage; +QPixmap IntroWidget::grabStep(int skip) { + return myGrab(step(skip), QRect(st::introSlideShift, 0, st::introSize.width(), st::introSize.height())); } void IntroWidget::animShow(const QPixmap &bgAnimCache, bool back) { @@ -206,8 +183,8 @@ void IntroWidget::animShow(const QPixmap &bgAnimCache, bool back) { (back ? _cacheOver : _cacheUnder) = bgAnimCache; _a_show.stop(); - stages[current]->show(); - if (stages[current]->hasBack()) { + step()->show(); + if (step()->hasBack()) { _back.setOpacity(1); _back.show(); } else { @@ -215,8 +192,7 @@ void IntroWidget::animShow(const QPixmap &bgAnimCache, bool back) { } (back ? _cacheUnder : _cacheOver) = myGrab(this); - stages[current]->deactivate(); - stages[current]->hide(); + step()->hide(); _back.hide(); a_coordUnder = back ? anim::ivalue(-qFloor(st::slideShift * width()), 0) : anim::ivalue(0, -qFloor(st::slideShift * width())); @@ -239,9 +215,8 @@ void IntroWidget::step_show(float64 ms, bool timer) { _cacheUnder = _cacheOver = QPixmap(); setFocus(); - stages[current]->show(); - stages[current]->activate(); - if (stages[current]->hasBack()) { + step()->activate(); + if (step()->hasBack()) { _back.setOpacity(1); _back.show(); } @@ -269,11 +244,9 @@ void IntroWidget::step_stage(float64 ms, bool timer) { _cacheHide = _cacheShow = QPixmap(); - current += moving; - moving = 0; setFocus(); - stages[current]->activate(); - if (!stages[current]->hasBack()) { + step()->activate(); + if (!step()->hasBack()) { _back.hide(); } if (App::app()) App::app()->mtpUnpause(); @@ -312,9 +285,9 @@ void IntroWidget::paintEvent(QPaintEvent *e) { p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow); } else if (_a_stage.animating()) { p.setOpacity(a_opacityHide.current()); - p.drawPixmap(stages[current]->x() + st::introSlideShift + a_coordHide.current(), stages[current]->y(), _cacheHide); + p.drawPixmap(step()->x() + st::introSlideShift + a_coordHide.current(), step()->y(), _cacheHide); p.setOpacity(a_opacityShow.current()); - p.drawPixmap(stages[current + moving]->x() + st::introSlideShift + a_coordShow.current(), stages[current + moving]->y(), _cacheShow); + p.drawPixmap(step()->x() + st::introSlideShift + a_coordShow.current(), step()->y(), _cacheShow); } } @@ -339,11 +312,6 @@ void IntroWidget::setCode(const QString &code) { void IntroWidget::setPwdSalt(const QByteArray &salt) { _pwdSalt = salt; - delete signup; - delete pwdcheck; - stages[3] = stages[4] = 0; - signup = 0; - pwdcheck = 0; } void IntroWidget::setHasRecovery(bool has) { @@ -356,7 +324,6 @@ void IntroWidget::setPwdHint(const QString &hint) { void IntroWidget::setCodeByTelegram(bool byTelegram) { _codeByTelegram = byTelegram; - if (code) code->updateDescText(); } void IntroWidget::setCallTimeout(int32 callTimeout) { @@ -397,15 +364,9 @@ bool IntroWidget::codeByTelegram() const { void IntroWidget::resizeEvent(QResizeEvent *e) { QRect r(innerRect()); - if (steps) steps->setGeometry(r); - if (phone) phone->setGeometry(r); - if (code) code->setGeometry(r); - if (signup) signup->setGeometry(r); - if (pwdcheck) pwdcheck->setGeometry(r); -} - -void IntroWidget::mousePressEvent(QMouseEvent *e) { - + for (IntroStep *step : _stepHistory) { + step->setGeometry(r); + } } void IntroWidget::finish(const MTPUser &user, const QImage &photo) { @@ -419,9 +380,11 @@ void IntroWidget::keyPressEvent(QKeyEvent *e) { if (_a_show.animating() || _a_stage.animating()) return; if (e->key() == Qt::Key_Escape) { - stages[current]->onBack(); + if (step()->hasBack()) { + onBack(); + } } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return || e->key() == Qt::Key_Space) { - stages[current]->onNext(); + onStepSubmit(); } } @@ -429,17 +392,16 @@ void IntroWidget::updateAdaptiveLayout() { } void IntroWidget::rpcClear() { - if (phone) phone->rpcClear(); - if (code) code->rpcClear(); - if (signup) signup->rpcClear(); - if (pwdcheck) pwdcheck->rpcClear(); + for (IntroStep *step : _stepHistory) { + step->rpcClear(); + } } IntroWidget::~IntroWidget() { - delete steps; - delete phone; - delete code; - delete signup; - delete pwdcheck; + while (!_stepHistory.isEmpty()) { + IntroStep *back = _stepHistory.back(); + _stepHistory.pop_back(); + delete back; + } if (App::wnd()) App::wnd()->noIntro(this); } diff --git a/Telegram/SourceFiles/intro/intro.h b/Telegram/SourceFiles/intro/introwidget.h similarity index 73% rename from Telegram/SourceFiles/intro/intro.h rename to Telegram/SourceFiles/intro/introwidget.h index bec0f7eb08..dc3868e154 100644 --- a/Telegram/SourceFiles/intro/intro.h +++ b/Telegram/SourceFiles/intro/introwidget.h @@ -20,26 +20,17 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -class Window; -class IntroSteps; -class IntroPhone; -class IntroCode; -class IntroSignup; -class IntroPwdCheck; -class IntroStage; -class Text; - +class IntroStep; class IntroWidget final : public TWidget { Q_OBJECT public: - IntroWidget(Window *window); + IntroWidget(QWidget *window); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void keyPressEvent(QKeyEvent *e) override; void updateAdaptiveLayout(); @@ -74,13 +65,19 @@ public: void rpcClear(); void langChangeTo(int32 langId); - ~IntroWidget(); + void nextStep(IntroStep *step) { + pushStep(step, MoveForward); + } + void replaceStep(IntroStep *step) { + pushStep(step, MoveReplace); + } + + ~IntroWidget() override; public slots: - void onIntroNext(); - void onIntroBack(); - void onDoneStateChanged(int oldState, ButtonStateChangeSource source); + void onStepSubmit(); + void onBack(); void onParentResize(const QSize &newSize); void onChangeLang(); @@ -90,12 +87,9 @@ signals: private: - void makeHideCache(int stage = -1); - void makeShowCache(int stage = -1); - void prepareMove(); - bool createNext(); + QPixmap grabStep(int skip = 0); - int32 _langChangeTo; + int _langChangeTo; Animation _a_stage; QPixmap _cacheHide, _cacheShow; @@ -108,13 +102,18 @@ private: anim::ivalue a_coordUnder, a_coordOver; anim::fvalue a_shadow; - IntroSteps *steps; - IntroPhone *phone; - IntroCode *code; - IntroSignup *signup; - IntroPwdCheck *pwdcheck; - IntroStage *stages[5]; - int current, moving; + QVector _stepHistory; + IntroStep *step(int skip = 0) { + t_assert(_stepHistory.size() + skip > 0); + return _stepHistory.at(_stepHistory.size() - skip - 1); + } + enum MoveType { + MoveBack, + MoveForward, + MoveReplace, + }; + void historyMove(MoveType type); + void pushStep(IntroStep *step, MoveType type); QString _phone, _phone_hash; int32 _callTimeout; @@ -133,21 +132,24 @@ private: }; -class IntroStage : public TWidget { +class IntroStep : public TWidget, public RPCSender { public: - IntroStage(IntroWidget *parent) : TWidget(parent) { + IntroStep(IntroWidget *parent) : TWidget(parent) { } - virtual void activate() = 0; // show and activate - virtual void prepareShow() { - } - virtual void deactivate() = 0; // deactivate and hide - virtual void onNext() = 0; - virtual void onBack() = 0; virtual bool hasBack() const { return false; } + virtual void activate() { + show(); + } + virtual void cancelled() { + } + virtual void finished() { + hide(); + } + virtual void onSubmit() = 0; protected: diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 6b51634d3b..a6058b3aec 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -909,7 +909,7 @@ void MainWidget::forwardLayer(int32 forwardSelected) { void MainWidget::deleteLayer(int32 selectedCount) { if (selectedCount == -1 && !overview) { - if (auto item = App::contextItem()) { + if (HistoryItem *item = App::contextItem()) { if (item->suggestBanReportDeleteAll()) { Ui::showLayer(new RichDeleteMessageBox(item->history()->peer->asChannel(), item->from()->asUser(), item->id)); return; @@ -1067,16 +1067,16 @@ void MainWidget::deleteAllFromUser(ChannelData *channel, UserData *from) { t_assert(channel != nullptr && from != nullptr); QVector toDestroy; - if (auto history = App::historyLoaded(channel->id)) { - for (auto i = history->blocks.cbegin(), e = history->blocks.cend(); i != e; ++i) { - for (auto j = (*i)->items.cbegin(), n = (*i)->items.cend(); j != n; ++j) { - if ((*j)->from() == from && (*j)->type() == HistoryItemMsg && (*j)->canDelete()) { - toDestroy.push_back((*j)->id); + if (History *history = App::historyLoaded(channel->id)) { + for (HistoryBlock *block : history->blocks) { + for (HistoryItem *item : block->items) { + if (item->from() == from && item->type() == HistoryItemMsg && item->canDelete()) { + toDestroy.push_back(item->id); } } } - for (auto i = toDestroy.cbegin(), e = toDestroy.cend(); i != e; ++i) { - if (auto item = App::histItemById(peerToChannel(channel->id), *i)) { + for (const MsgId &msgId : toDestroy) { + if (HistoryItem *item = App::histItemById(peerToChannel(channel->id), msgId)) { item->destroy(); } } @@ -1095,7 +1095,7 @@ void MainWidget::deleteAllFromUserPart(DeleteAllFromUserParams params, const MTP if (!MTP::authedId()) return; if (offset > 0) { MTP::send(MTPchannels_DeleteUserHistory(params.channel->inputChannel, params.from->inputUser), rpcDone(&MainWidget::deleteAllFromUserPart, params)); - } else if (auto h = App::historyLoaded(params.channel)) { + } else if (History *h = App::historyLoaded(params.channel)) { if (!h->lastMsg) { checkPeerHistory(params.channel); } diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index 53965606cd..3e2647d17a 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -368,7 +368,7 @@ static const mtpTypeId mtpLayers[] = { mtpTypeId(mtpc_invokeWithLayer18), }; static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 49; +static const mtpPrime mtpCurrentLayer = 50; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 3133d7062b..2efc246a11 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -1772,26 +1772,12 @@ void _serialize_auth_sentCode(MTPStringLogger &to, int32 stage, int32 lev, Types to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" phone_registered: "); ++stages.back(); types.push_back(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); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" send_call_timeout: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" is_password: "); ++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_auth_sentAppCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ auth_sentAppCode"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" phone_registered: "); ++stages.back(); types.push_back(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); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" send_call_timeout: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" is_password: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_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 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -3847,20 +3833,6 @@ void _serialize_accountDaysTTL(MTPStringLogger &to, int32 stage, int32 lev, Type } } -void _serialize_account_sentChangePhoneCode(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ account_sentChangePhoneCode"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: 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 1: to.add(" send_call_timeout: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - void _serialize_documentAttributeImageSize(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -5174,6 +5146,70 @@ void _serialize_channels_messageEditData(MTPStringLogger &to, int32 stage, int32 } } +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) { + 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) { + 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) { + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ auth_sentCodeTypeApp"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ auth_sentCodeTypeSms"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ auth_sentCodeTypeCall"); + 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ auth_sentCodeTypeFlashCall"); + 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_req_pq(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { if (stage) { to.add(",\n").addSpaces(lev); @@ -5303,20 +5339,6 @@ void _serialize_register_saveDeveloperInfo(MTPStringLogger &to, int32 stage, int } } -void _serialize_auth_sendCall(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ auth_sendCall"); - 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; - 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) { to.add("{ auth_logOut }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -5355,11 +5377,11 @@ void _serialize_auth_bindTempAuthKey(MTPStringLogger &to, int32 stage, int32 lev } } -void _serialize_auth_sendSms(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 flag) { if (stage) { to.add(",\n").addSpaces(lev); } else { - to.add("{ auth_sendSms"); + to.add("{ auth_cancelCode"); to.add("\n").addSpaces(lev); } switch (stage) { @@ -5943,11 +5965,43 @@ 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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ auth_resendCode"); + 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(" sms_type: "); ++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_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(" api_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(" lang_code: "); ++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; + 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) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ account_sendChangePhoneCode"); + 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } } @@ -6162,19 +6216,6 @@ void _serialize_account_getAccountTTL(MTPStringLogger &to, int32 stage, int32 le to.add("{ account_getAccountTTL }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } -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) { - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ account_sendChangePhoneCode"); - 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } -} - 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) { to.add("{ account_getAuthorizations }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); } @@ -7746,7 +7787,6 @@ namespace { _serializers.insert(mtpc_geoPoint, _serialize_geoPoint); _serializers.insert(mtpc_auth_checkedPhone, _serialize_auth_checkedPhone); _serializers.insert(mtpc_auth_sentCode, _serialize_auth_sentCode); - _serializers.insert(mtpc_auth_sentAppCode, _serialize_auth_sentAppCode); _serializers.insert(mtpc_auth_authorization, _serialize_auth_authorization); _serializers.insert(mtpc_auth_exportedAuthorization, _serialize_auth_exportedAuthorization); _serializers.insert(mtpc_inputNotifyPeer, _serialize_inputNotifyPeer); @@ -7918,7 +7958,6 @@ namespace { _serializers.insert(mtpc_privacyValueDisallowUsers, _serialize_privacyValueDisallowUsers); _serializers.insert(mtpc_account_privacyRules, _serialize_account_privacyRules); _serializers.insert(mtpc_accountDaysTTL, _serialize_accountDaysTTL); - _serializers.insert(mtpc_account_sentChangePhoneCode, _serialize_account_sentChangePhoneCode); _serializers.insert(mtpc_documentAttributeImageSize, _serialize_documentAttributeImageSize); _serializers.insert(mtpc_documentAttributeAnimated, _serialize_documentAttributeAnimated); _serializers.insert(mtpc_documentAttributeSticker, _serialize_documentAttributeSticker); @@ -8020,6 +8059,13 @@ namespace { _serializers.insert(mtpc_exportedMessageLink, _serialize_exportedMessageLink); _serializers.insert(mtpc_messageFwdHeader, _serialize_messageFwdHeader); _serializers.insert(mtpc_channels_messageEditData, _serialize_channels_messageEditData); + _serializers.insert(mtpc_auth_codeTypeSms, _serialize_auth_codeTypeSms); + _serializers.insert(mtpc_auth_codeTypeCall, _serialize_auth_codeTypeCall); + _serializers.insert(mtpc_auth_codeTypeFlashCall, _serialize_auth_codeTypeFlashCall); + _serializers.insert(mtpc_auth_sentCodeTypeApp, _serialize_auth_sentCodeTypeApp); + _serializers.insert(mtpc_auth_sentCodeTypeSms, _serialize_auth_sentCodeTypeSms); + _serializers.insert(mtpc_auth_sentCodeTypeCall, _serialize_auth_sentCodeTypeCall); + _serializers.insert(mtpc_auth_sentCodeTypeFlashCall, _serialize_auth_sentCodeTypeFlashCall); _serializers.insert(mtpc_req_pq, _serialize_req_pq); _serializers.insert(mtpc_req_DH_params, _serialize_req_DH_params); @@ -8030,12 +8076,11 @@ namespace { _serializers.insert(mtpc_ping_delay_disconnect, _serialize_ping_delay_disconnect); _serializers.insert(mtpc_destroy_session, _serialize_destroy_session); _serializers.insert(mtpc_register_saveDeveloperInfo, _serialize_register_saveDeveloperInfo); - _serializers.insert(mtpc_auth_sendCall, _serialize_auth_sendCall); _serializers.insert(mtpc_auth_logOut, _serialize_auth_logOut); _serializers.insert(mtpc_auth_resetAuthorizations, _serialize_auth_resetAuthorizations); _serializers.insert(mtpc_auth_sendInvites, _serialize_auth_sendInvites); _serializers.insert(mtpc_auth_bindTempAuthKey, _serialize_auth_bindTempAuthKey); - _serializers.insert(mtpc_auth_sendSms, _serialize_auth_sendSms); + _serializers.insert(mtpc_auth_cancelCode, _serialize_auth_cancelCode); _serializers.insert(mtpc_account_registerDevice, _serialize_account_registerDevice); _serializers.insert(mtpc_account_unregisterDevice, _serialize_account_unregisterDevice); _serializers.insert(mtpc_account_updateNotifySettings, _serialize_account_updateNotifySettings); @@ -8078,6 +8123,8 @@ namespace { _serializers.insert(mtpc_invokeWithoutUpdates, _serialize_invokeWithoutUpdates); _serializers.insert(mtpc_auth_checkPhone, _serialize_auth_checkPhone); _serializers.insert(mtpc_auth_sendCode, _serialize_auth_sendCode); + _serializers.insert(mtpc_auth_resendCode, _serialize_auth_resendCode); + _serializers.insert(mtpc_account_sendChangePhoneCode, _serialize_account_sendChangePhoneCode); _serializers.insert(mtpc_auth_signUp, _serialize_auth_signUp); _serializers.insert(mtpc_auth_signIn, _serialize_auth_signIn); _serializers.insert(mtpc_auth_importAuthorization, _serialize_auth_importAuthorization); @@ -8095,7 +8142,6 @@ namespace { _serializers.insert(mtpc_account_getPrivacy, _serialize_account_getPrivacy); _serializers.insert(mtpc_account_setPrivacy, _serialize_account_setPrivacy); _serializers.insert(mtpc_account_getAccountTTL, _serialize_account_getAccountTTL); - _serializers.insert(mtpc_account_sendChangePhoneCode, _serialize_account_sendChangePhoneCode); _serializers.insert(mtpc_account_getAuthorizations, _serialize_account_getAuthorizations); _serializers.insert(mtpc_account_getPassword, _serialize_account_getPassword); _serializers.insert(mtpc_account_getPasswordSettings, _serialize_account_getPasswordSettings); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 04b2c42cf3..db65f23781 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -177,8 +177,7 @@ enum { mtpc_geoPointEmpty = 0x1117dd5f, mtpc_geoPoint = 0x2049d70c, mtpc_auth_checkedPhone = 0x811ea28e, - mtpc_auth_sentCode = 0xefed51d9, - mtpc_auth_sentAppCode = 0xe325edcf, + mtpc_auth_sentCode = 0x5e002502, mtpc_auth_authorization = 0xff036af1, mtpc_auth_exportedAuthorization = 0xdf969c2d, mtpc_inputNotifyPeer = 0xb8bc5b0c, @@ -350,7 +349,6 @@ enum { mtpc_privacyValueDisallowUsers = 0xc7f49b7, mtpc_account_privacyRules = 0x554abb6f, mtpc_accountDaysTTL = 0xb8d0afdf, - mtpc_account_sentChangePhoneCode = 0xa4f58c4c, mtpc_documentAttributeImageSize = 0x6c37c15c, mtpc_documentAttributeAnimated = 0x11b58939, mtpc_documentAttributeSticker = 0x3a556302, @@ -452,14 +450,20 @@ enum { mtpc_exportedMessageLink = 0x1f486803, mtpc_messageFwdHeader = 0xc786ddcb, mtpc_channels_messageEditData = 0x67e1255f, + mtpc_auth_codeTypeSms = 0x72a3158c, + mtpc_auth_codeTypeCall = 0x741cd3e3, + mtpc_auth_codeTypeFlashCall = 0x226ccefb, + mtpc_auth_sentCodeTypeApp = 0x3dbb5986, + mtpc_auth_sentCodeTypeSms = 0xc000bba2, + mtpc_auth_sentCodeTypeCall = 0x5353e5a7, + mtpc_auth_sentCodeTypeFlashCall = 0xab03c6d9, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_initConnection = 0x69796de9, mtpc_invokeWithLayer = 0xda9b0d0d, mtpc_invokeWithoutUpdates = 0xbf9459b7, mtpc_auth_checkPhone = 0x6fe51dfb, - mtpc_auth_sendCode = 0x768d5f4d, - mtpc_auth_sendCall = 0x3c51564, + mtpc_auth_sendCode = 0xccfd70cf, mtpc_auth_signUp = 0x1b067634, mtpc_auth_signIn = 0xbcd51581, mtpc_auth_logOut = 0x5717da40, @@ -468,11 +472,12 @@ enum { mtpc_auth_exportAuthorization = 0xe5bfffcd, mtpc_auth_importAuthorization = 0xe3ef9613, mtpc_auth_bindTempAuthKey = 0xcdd42a05, - mtpc_auth_sendSms = 0xda9f3e8, mtpc_auth_importBotAuthorization = 0x67a3ff2c, mtpc_auth_checkPassword = 0xa63011e, mtpc_auth_requestPasswordRecovery = 0xd897bc66, mtpc_auth_recoverPassword = 0x4ea56e92, + mtpc_auth_resendCode = 0x3ef1a9bf, + mtpc_auth_cancelCode = 0x1f040578, mtpc_account_registerDevice = 0x446c712c, mtpc_account_unregisterDevice = 0x65c55b40, mtpc_account_updateNotifySettings = 0x84be5b93, @@ -489,7 +494,7 @@ enum { mtpc_account_deleteAccount = 0x418d4e0b, mtpc_account_getAccountTTL = 0x8fc711d, mtpc_account_setAccountTTL = 0x2442485e, - mtpc_account_sendChangePhoneCode = 0xa407a8f4, + mtpc_account_sendChangePhoneCode = 0x8e57deb, mtpc_account_changePhone = 0x70c32edb, mtpc_account_updateDeviceLocked = 0x38df3532, mtpc_account_getAuthorizations = 0xe320c158, @@ -836,7 +841,6 @@ class MTPDauth_checkedPhone; class MTPauth_sentCode; class MTPDauth_sentCode; -class MTPDauth_sentAppCode; class MTPauth_authorization; class MTPDauth_authorization; @@ -1071,9 +1075,6 @@ class MTPDaccount_privacyRules; class MTPaccountDaysTTL; class MTPDaccountDaysTTL; -class MTPaccount_sentChangePhoneCode; -class MTPDaccount_sentChangePhoneCode; - class MTPdocumentAttribute; class MTPDdocumentAttributeImageSize; class MTPDdocumentAttributeSticker; @@ -1254,6 +1255,14 @@ class MTPDmessageFwdHeader; class MTPchannels_messageEditData; class MTPDchannels_messageEditData; +class MTPauth_codeType; + +class MTPauth_sentCodeType; +class MTPDauth_sentCodeTypeApp; +class MTPDauth_sentCodeTypeSms; +class MTPDauth_sentCodeTypeCall; +class MTPDauth_sentCodeTypeFlashCall; + // Boxed types definitions typedef MTPBoxed MTPResPQ; @@ -1368,7 +1377,6 @@ typedef MTPBoxed MTPInputPrivacyRule; typedef MTPBoxed MTPPrivacyRule; typedef MTPBoxed MTPaccount_PrivacyRules; typedef MTPBoxed MTPAccountDaysTTL; -typedef MTPBoxed MTPaccount_SentChangePhoneCode; typedef MTPBoxed MTPDocumentAttribute; typedef MTPBoxed MTPmessages_Stickers; typedef MTPBoxed MTPStickerPack; @@ -1419,6 +1427,8 @@ typedef MTPBoxed MTPmessages_BotResults; typedef MTPBoxed MTPExportedMessageLink; typedef MTPBoxed MTPMessageFwdHeader; typedef MTPBoxed MTPchannels_MessageEditData; +typedef MTPBoxed MTPauth_CodeType; +typedef MTPBoxed MTPauth_SentCodeType; // Type classes definitions @@ -4048,52 +4058,32 @@ typedef MTPBoxed MTPauth_CheckedPhone; class MTPauth_sentCode : private mtpDataOwner { public: - MTPauth_sentCode() : mtpDataOwner(0), _type(0) { - } - MTPauth_sentCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + MTPauth_sentCode(); + MTPauth_sentCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sentCode) : mtpDataOwner(0) { read(from, end, cons); } MTPDauth_sentCode &_auth_sentCode() { if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_auth_sentCode) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCode); split(); return *(MTPDauth_sentCode*)data; } const MTPDauth_sentCode &c_auth_sentCode() const { if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_auth_sentCode) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCode); return *(const MTPDauth_sentCode*)data; } - MTPDauth_sentAppCode &_auth_sentAppCode() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_auth_sentAppCode) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentAppCode); - split(); - return *(MTPDauth_sentAppCode*)data; - } - const MTPDauth_sentAppCode &c_auth_sentAppCode() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_auth_sentAppCode) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentAppCode); - return *(const MTPDauth_sentAppCode*)data; - } - uint32 innerLength() const; mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sentCode); void write(mtpBuffer &to) const; typedef void ResponseType; private: - explicit MTPauth_sentCode(mtpTypeId type); explicit MTPauth_sentCode(MTPDauth_sentCode *_data); - explicit MTPauth_sentCode(MTPDauth_sentAppCode *_data); - friend MTPauth_sentCode MTP_auth_sentCode(MTPBool _phone_registered, const MTPstring &_phone_code_hash, MTPint _send_call_timeout, MTPBool _is_password); - friend MTPauth_sentCode MTP_auth_sentAppCode(MTPBool _phone_registered, const MTPstring &_phone_code_hash, MTPint _send_call_timeout, MTPBool _is_password); - - mtpTypeId _type; + friend MTPauth_sentCode MTP_auth_sentCode(MTPint _flags, const MTPauth_SentCodeType &_type, const MTPstring &_phone_code_hash, const MTPauth_CodeType &_next_type, MTPint _timeout); }; typedef MTPBoxed MTPauth_SentCode; @@ -6973,37 +6963,6 @@ private: }; typedef MTPBoxed MTPAccountDaysTTL; -class MTPaccount_sentChangePhoneCode : private mtpDataOwner { -public: - MTPaccount_sentChangePhoneCode(); - MTPaccount_sentChangePhoneCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sentChangePhoneCode) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDaccount_sentChangePhoneCode &_account_sentChangePhoneCode() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDaccount_sentChangePhoneCode*)data; - } - const MTPDaccount_sentChangePhoneCode &c_account_sentChangePhoneCode() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDaccount_sentChangePhoneCode*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sentChangePhoneCode); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPaccount_sentChangePhoneCode(MTPDaccount_sentChangePhoneCode *_data); - - friend MTPaccount_sentChangePhoneCode MTP_account_sentChangePhoneCode(const MTPstring &_phone_code_hash, MTPint _send_call_timeout); -}; -typedef MTPBoxed MTPaccount_SentChangePhoneCode; - class MTPdocumentAttribute : private mtpDataOwner { public: MTPdocumentAttribute() : mtpDataOwner(0), _type(0) { @@ -9133,6 +9092,111 @@ private: }; typedef MTPBoxed MTPchannels_MessageEditData; +class MTPauth_codeType { +public: + MTPauth_codeType() : _type(0) { + } + MTPauth_codeType(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : _type(0) { + read(from, end, cons); + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPauth_codeType(mtpTypeId type); + + friend MTPauth_codeType MTP_auth_codeTypeSms(); + friend MTPauth_codeType MTP_auth_codeTypeCall(); + friend MTPauth_codeType MTP_auth_codeTypeFlashCall(); + + mtpTypeId _type; +}; +typedef MTPBoxed MTPauth_CodeType; + +class MTPauth_sentCodeType : private mtpDataOwner { +public: + MTPauth_sentCodeType() : mtpDataOwner(0), _type(0) { + } + MTPauth_sentCodeType(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { + read(from, end, cons); + } + + MTPDauth_sentCodeTypeApp &_auth_sentCodeTypeApp() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeApp) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeApp); + split(); + return *(MTPDauth_sentCodeTypeApp*)data; + } + const MTPDauth_sentCodeTypeApp &c_auth_sentCodeTypeApp() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeApp) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeApp); + return *(const MTPDauth_sentCodeTypeApp*)data; + } + + MTPDauth_sentCodeTypeSms &_auth_sentCodeTypeSms() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeSms) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeSms); + split(); + return *(MTPDauth_sentCodeTypeSms*)data; + } + const MTPDauth_sentCodeTypeSms &c_auth_sentCodeTypeSms() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeSms) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeSms); + return *(const MTPDauth_sentCodeTypeSms*)data; + } + + MTPDauth_sentCodeTypeCall &_auth_sentCodeTypeCall() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeCall) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeCall); + split(); + return *(MTPDauth_sentCodeTypeCall*)data; + } + const MTPDauth_sentCodeTypeCall &c_auth_sentCodeTypeCall() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeCall) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeCall); + return *(const MTPDauth_sentCodeTypeCall*)data; + } + + MTPDauth_sentCodeTypeFlashCall &_auth_sentCodeTypeFlashCall() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeFlashCall) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeFlashCall); + split(); + return *(MTPDauth_sentCodeTypeFlashCall*)data; + } + const MTPDauth_sentCodeTypeFlashCall &c_auth_sentCodeTypeFlashCall() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_auth_sentCodeTypeFlashCall) throw mtpErrorWrongTypeId(_type, mtpc_auth_sentCodeTypeFlashCall); + return *(const MTPDauth_sentCodeTypeFlashCall*)data; + } + + uint32 innerLength() const; + mtpTypeId type() const; + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); + void write(mtpBuffer &to) const; + + typedef void ResponseType; + +private: + explicit MTPauth_sentCodeType(mtpTypeId type); + explicit MTPauth_sentCodeType(MTPDauth_sentCodeTypeApp *_data); + explicit MTPauth_sentCodeType(MTPDauth_sentCodeTypeSms *_data); + 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); + + mtpTypeId _type; +}; +typedef MTPBoxed MTPauth_SentCodeType; + // Type constructors with data class MTPDresPQ : public mtpDataImpl { @@ -10555,26 +10619,24 @@ class MTPDauth_sentCode : public mtpDataImpl { public: MTPDauth_sentCode() { } - MTPDauth_sentCode(MTPBool _phone_registered, const MTPstring &_phone_code_hash, MTPint _send_call_timeout, MTPBool _is_password) : vphone_registered(_phone_registered), vphone_code_hash(_phone_code_hash), vsend_call_timeout(_send_call_timeout), vis_password(_is_password) { + 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) { } - MTPBool vphone_registered; + MTPint vflags; + MTPauth_SentCodeType vtype; MTPstring vphone_code_hash; - MTPint vsend_call_timeout; - MTPBool vis_password; -}; + MTPauth_CodeType vnext_type; + MTPint vtimeout; -class MTPDauth_sentAppCode : public mtpDataImpl { -public: - MTPDauth_sentAppCode() { - } - MTPDauth_sentAppCode(MTPBool _phone_registered, const MTPstring &_phone_code_hash, MTPint _send_call_timeout, MTPBool _is_password) : vphone_registered(_phone_registered), vphone_code_hash(_phone_code_hash), vsend_call_timeout(_send_call_timeout), vis_password(_is_password) { - } + enum { + flag_phone_registered = (1 << 0), + flag_next_type = (1 << 1), + flag_timeout = (1 << 2), + }; - MTPBool vphone_registered; - MTPstring vphone_code_hash; - MTPint vsend_call_timeout; - MTPBool vis_password; + 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 { @@ -12156,17 +12218,6 @@ public: MTPint vdays; }; -class MTPDaccount_sentChangePhoneCode : public mtpDataImpl { -public: - MTPDaccount_sentChangePhoneCode() { - } - MTPDaccount_sentChangePhoneCode(const MTPstring &_phone_code_hash, MTPint _send_call_timeout) : vphone_code_hash(_phone_code_hash), vsend_call_timeout(_send_call_timeout) { - } - - MTPstring vphone_code_hash; - MTPint vsend_call_timeout; -}; - class MTPDdocumentAttributeImageSize : public mtpDataImpl { public: MTPDdocumentAttributeImageSize() { @@ -13347,6 +13398,46 @@ public: bool is_caption() const { return vflags.v & flag_caption; } }; +class MTPDauth_sentCodeTypeApp : public mtpDataImpl { +public: + MTPDauth_sentCodeTypeApp() { + } + MTPDauth_sentCodeTypeApp(MTPint _length) : vlength(_length) { + } + + MTPint vlength; +}; + +class MTPDauth_sentCodeTypeSms : public mtpDataImpl { +public: + MTPDauth_sentCodeTypeSms() { + } + MTPDauth_sentCodeTypeSms(MTPint _length) : vlength(_length) { + } + + MTPint vlength; +}; + +class MTPDauth_sentCodeTypeCall : public mtpDataImpl { +public: + MTPDauth_sentCodeTypeCall() { + } + MTPDauth_sentCodeTypeCall(MTPint _length) : vlength(_length) { + } + + MTPint vlength; +}; + +class MTPDauth_sentCodeTypeFlashCall : public mtpDataImpl { +public: + MTPDauth_sentCodeTypeFlashCall() { + } + MTPDauth_sentCodeTypeFlashCall(const MTPstring &_pattern) : vpattern(_pattern) { + } + + MTPstring vpattern; +}; + // RPC methods class MTPreq_pq { // RPC method 'req_pq' @@ -13996,8 +14087,9 @@ public: class MTPauth_sendCode { // RPC method 'auth.sendCode' public: + MTPint vflags; MTPstring vphone_number; - MTPint vsms_type; + MTPBool vcurrent_number; MTPint vapi_id; MTPstring vapi_hash; MTPstring vlang_code; @@ -14007,25 +14099,35 @@ public: MTPauth_sendCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCode) { read(from, end, cons); } - MTPauth_sendCode(const MTPstring &_phone_number, MTPint _sms_type, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_lang_code) : vphone_number(_phone_number), vsms_type(_sms_type), vapi_id(_api_id), vapi_hash(_api_hash), vlang_code(_lang_code) { + 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) { } + 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 vphone_number.innerLength() + vsms_type.innerLength() + vapi_id.innerLength() + vapi_hash.innerLength() + vlang_code.innerLength(); + return vflags.innerLength() + vphone_number.innerLength() + (has_current_number() ? vcurrent_number.innerLength() : 0) + vapi_id.innerLength() + vapi_hash.innerLength() + vlang_code.innerLength(); } mtpTypeId type() const { return mtpc_auth_sendCode; } void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCode) { + vflags.read(from, end); vphone_number.read(from, end); - vsms_type.read(from, end); + if (has_current_number()) { vcurrent_number.read(from, end); } else { vcurrent_number = MTPBool(); } vapi_id.read(from, end); vapi_hash.read(from, end); vlang_code.read(from, end); } void write(mtpBuffer &to) const { + vflags.write(to); vphone_number.write(to); - vsms_type.write(to); + if (has_current_number()) vcurrent_number.write(to); vapi_id.write(to); vapi_hash.write(to); vlang_code.write(to); @@ -14041,49 +14143,7 @@ public: } MTPauth_SendCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPauth_SendCode(const MTPstring &_phone_number, MTPint _sms_type, MTPint _api_id, const MTPstring &_api_hash, const MTPstring &_lang_code) : MTPBoxed(MTPauth_sendCode(_phone_number, _sms_type, _api_id, _api_hash, _lang_code)) { - } -}; - -class MTPauth_sendCall { // RPC method 'auth.sendCall' -public: - MTPstring vphone_number; - MTPstring vphone_code_hash; - - MTPauth_sendCall() { - } - MTPauth_sendCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCall) { - read(from, end, cons); - } - MTPauth_sendCall(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : vphone_number(_phone_number), vphone_code_hash(_phone_code_hash) { - } - - uint32 innerLength() const { - return vphone_number.innerLength() + vphone_code_hash.innerLength(); - } - mtpTypeId type() const { - return mtpc_auth_sendCall; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendCall) { - vphone_number.read(from, end); - vphone_code_hash.read(from, end); - } - void write(mtpBuffer &to) const { - vphone_number.write(to); - vphone_code_hash.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPauth_SendCall : public MTPBoxed { -public: - MTPauth_SendCall() { - } - MTPauth_SendCall(const MTPauth_sendCall &v) : MTPBoxed(v) { - } - MTPauth_SendCall(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPauth_SendCall(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : MTPBoxed(MTPauth_sendCall(_phone_number, _phone_code_hash)) { + 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)) { } }; @@ -14416,48 +14476,6 @@ public: } }; -class MTPauth_sendSms { // RPC method 'auth.sendSms' -public: - MTPstring vphone_number; - MTPstring vphone_code_hash; - - MTPauth_sendSms() { - } - MTPauth_sendSms(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendSms) { - read(from, end, cons); - } - MTPauth_sendSms(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : vphone_number(_phone_number), vphone_code_hash(_phone_code_hash) { - } - - uint32 innerLength() const { - return vphone_number.innerLength() + vphone_code_hash.innerLength(); - } - mtpTypeId type() const { - return mtpc_auth_sendSms; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_sendSms) { - vphone_number.read(from, end); - vphone_code_hash.read(from, end); - } - void write(mtpBuffer &to) const { - vphone_number.write(to); - vphone_code_hash.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPauth_SendSms : public MTPBoxed { -public: - MTPauth_SendSms() { - } - MTPauth_SendSms(const MTPauth_sendSms &v) : MTPBoxed(v) { - } - MTPauth_SendSms(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPauth_SendSms(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : MTPBoxed(MTPauth_sendSms(_phone_number, _phone_code_hash)) { - } -}; - class MTPauth_importBotAuthorization { // RPC method 'auth.importBotAuthorization' public: MTPint vflags; @@ -14615,6 +14633,90 @@ public: } }; +class MTPauth_resendCode { // RPC method 'auth.resendCode' +public: + MTPstring vphone_number; + MTPstring vphone_code_hash; + + MTPauth_resendCode() { + } + MTPauth_resendCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_resendCode) { + read(from, end, cons); + } + MTPauth_resendCode(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : vphone_number(_phone_number), vphone_code_hash(_phone_code_hash) { + } + + uint32 innerLength() const { + return vphone_number.innerLength() + vphone_code_hash.innerLength(); + } + mtpTypeId type() const { + return mtpc_auth_resendCode; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_resendCode) { + vphone_number.read(from, end); + vphone_code_hash.read(from, end); + } + void write(mtpBuffer &to) const { + vphone_number.write(to); + vphone_code_hash.write(to); + } + + typedef MTPauth_SentCode ResponseType; +}; +class MTPauth_ResendCode : public MTPBoxed { +public: + MTPauth_ResendCode() { + } + MTPauth_ResendCode(const MTPauth_resendCode &v) : MTPBoxed(v) { + } + MTPauth_ResendCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPauth_ResendCode(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : MTPBoxed(MTPauth_resendCode(_phone_number, _phone_code_hash)) { + } +}; + +class MTPauth_cancelCode { // RPC method 'auth.cancelCode' +public: + MTPstring vphone_number; + MTPstring vphone_code_hash; + + MTPauth_cancelCode() { + } + MTPauth_cancelCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_cancelCode) { + read(from, end, cons); + } + MTPauth_cancelCode(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : vphone_number(_phone_number), vphone_code_hash(_phone_code_hash) { + } + + uint32 innerLength() const { + return vphone_number.innerLength() + vphone_code_hash.innerLength(); + } + mtpTypeId type() const { + return mtpc_auth_cancelCode; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_auth_cancelCode) { + vphone_number.read(from, end); + vphone_code_hash.read(from, end); + } + void write(mtpBuffer &to) const { + vphone_number.write(to); + vphone_code_hash.write(to); + } + + typedef MTPBool ResponseType; +}; +class MTPauth_CancelCode : public MTPBoxed { +public: + MTPauth_CancelCode() { + } + MTPauth_CancelCode(const MTPauth_cancelCode &v) : MTPBoxed(v) { + } + MTPauth_CancelCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPauth_CancelCode(const MTPstring &_phone_number, const MTPstring &_phone_code_hash) : MTPBoxed(MTPauth_cancelCode(_phone_number, _phone_code_hash)) { + } +}; + class MTPaccount_registerDevice { // RPC method 'account.registerDevice' public: MTPint vtoken_type; @@ -15266,30 +15368,44 @@ public: class MTPaccount_sendChangePhoneCode { // RPC method 'account.sendChangePhoneCode' public: + MTPint vflags; MTPstring vphone_number; + MTPBool vcurrent_number; MTPaccount_sendChangePhoneCode() { } MTPaccount_sendChangePhoneCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sendChangePhoneCode) { read(from, end, cons); } - MTPaccount_sendChangePhoneCode(const MTPstring &_phone_number) : vphone_number(_phone_number) { + MTPaccount_sendChangePhoneCode(MTPint _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 vphone_number.innerLength(); + return vflags.innerLength() + vphone_number.innerLength() + (has_current_number() ? vcurrent_number.innerLength() : 0); } mtpTypeId type() const { return mtpc_account_sendChangePhoneCode; } void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_account_sendChangePhoneCode) { + vflags.read(from, end); vphone_number.read(from, end); + if (has_current_number()) { vcurrent_number.read(from, end); } else { vcurrent_number = MTPBool(); } } void write(mtpBuffer &to) const { + vflags.write(to); vphone_number.write(to); + if (has_current_number()) vcurrent_number.write(to); } - typedef MTPaccount_SentChangePhoneCode ResponseType; + typedef MTPauth_SentCode ResponseType; }; class MTPaccount_SendChangePhoneCode : public MTPBoxed { public: @@ -15299,7 +15415,7 @@ public: } MTPaccount_SendChangePhoneCode(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { } - MTPaccount_SendChangePhoneCode(const MTPstring &_phone_number) : MTPBoxed(MTPaccount_sendChangePhoneCode(_phone_number)) { + MTPaccount_SendChangePhoneCode(MTPint _flags, const MTPstring &_phone_number, MTPBool _current_number) : MTPBoxed(MTPaccount_sendChangePhoneCode(_flags, _phone_number, _current_number)) { } }; @@ -24381,79 +24497,39 @@ inline MTPauth_checkedPhone MTP_auth_checkedPhone(MTPBool _phone_registered) { return MTPauth_checkedPhone(new MTPDauth_checkedPhone(_phone_registered)); } +inline MTPauth_sentCode::MTPauth_sentCode() : mtpDataOwner(new MTPDauth_sentCode()) { +} + inline uint32 MTPauth_sentCode::innerLength() const { - switch (_type) { - case mtpc_auth_sentCode: { - const MTPDauth_sentCode &v(c_auth_sentCode()); - return v.vphone_registered.innerLength() + v.vphone_code_hash.innerLength() + v.vsend_call_timeout.innerLength() + v.vis_password.innerLength(); - } - case mtpc_auth_sentAppCode: { - const MTPDauth_sentAppCode &v(c_auth_sentAppCode()); - return v.vphone_registered.innerLength() + v.vphone_code_hash.innerLength() + v.vsend_call_timeout.innerLength() + v.vis_password.innerLength(); - } - } - return 0; + const MTPDauth_sentCode &v(c_auth_sentCode()); + return v.vflags.innerLength() + v.vtype.innerLength() + v.vphone_code_hash.innerLength() + (v.has_next_type() ? v.vnext_type.innerLength() : 0) + (v.has_timeout() ? v.vtimeout.innerLength() : 0); } inline mtpTypeId MTPauth_sentCode::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; + return mtpc_auth_sentCode; } inline void MTPauth_sentCode::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_auth_sentCode: _type = cons; { - if (!data) setData(new MTPDauth_sentCode()); - MTPDauth_sentCode &v(_auth_sentCode()); - v.vphone_registered.read(from, end); - v.vphone_code_hash.read(from, end); - v.vsend_call_timeout.read(from, end); - v.vis_password.read(from, end); - } break; - case mtpc_auth_sentAppCode: _type = cons; { - if (!data) setData(new MTPDauth_sentAppCode()); - MTPDauth_sentAppCode &v(_auth_sentAppCode()); - v.vphone_registered.read(from, end); - v.vphone_code_hash.read(from, end); - v.vsend_call_timeout.read(from, end); - v.vis_password.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPauth_sentCode"); - } + if (cons != mtpc_auth_sentCode) throw mtpErrorUnexpected(cons, "MTPauth_sentCode"); + + if (!data) setData(new MTPDauth_sentCode()); + MTPDauth_sentCode &v(_auth_sentCode()); + v.vflags.read(from, end); + v.vtype.read(from, end); + v.vphone_code_hash.read(from, end); + if (v.has_next_type()) { v.vnext_type.read(from, end); } else { v.vnext_type = MTPauth_CodeType(); } + if (v.has_timeout()) { v.vtimeout.read(from, end); } else { v.vtimeout = MTPint(); } } inline void MTPauth_sentCode::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_auth_sentCode: { - const MTPDauth_sentCode &v(c_auth_sentCode()); - v.vphone_registered.write(to); - v.vphone_code_hash.write(to); - v.vsend_call_timeout.write(to); - v.vis_password.write(to); - } break; - case mtpc_auth_sentAppCode: { - const MTPDauth_sentAppCode &v(c_auth_sentAppCode()); - v.vphone_registered.write(to); - v.vphone_code_hash.write(to); - v.vsend_call_timeout.write(to); - v.vis_password.write(to); - } break; - } + const MTPDauth_sentCode &v(c_auth_sentCode()); + v.vflags.write(to); + v.vtype.write(to); + v.vphone_code_hash.write(to); + if (v.has_next_type()) v.vnext_type.write(to); + if (v.has_timeout()) v.vtimeout.write(to); } -inline MTPauth_sentCode::MTPauth_sentCode(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_auth_sentCode: setData(new MTPDauth_sentCode()); break; - case mtpc_auth_sentAppCode: setData(new MTPDauth_sentAppCode()); break; - default: throw mtpErrorBadTypeId(type, "MTPauth_sentCode"); - } +inline MTPauth_sentCode::MTPauth_sentCode(MTPDauth_sentCode *_data) : mtpDataOwner(_data) { } -inline MTPauth_sentCode::MTPauth_sentCode(MTPDauth_sentCode *_data) : mtpDataOwner(_data), _type(mtpc_auth_sentCode) { -} -inline MTPauth_sentCode::MTPauth_sentCode(MTPDauth_sentAppCode *_data) : mtpDataOwner(_data), _type(mtpc_auth_sentAppCode) { -} -inline MTPauth_sentCode MTP_auth_sentCode(MTPBool _phone_registered, const MTPstring &_phone_code_hash, MTPint _send_call_timeout, MTPBool _is_password) { - return MTPauth_sentCode(new MTPDauth_sentCode(_phone_registered, _phone_code_hash, _send_call_timeout, _is_password)); -} -inline MTPauth_sentCode MTP_auth_sentAppCode(MTPBool _phone_registered, const MTPstring &_phone_code_hash, MTPint _send_call_timeout, MTPBool _is_password) { - return MTPauth_sentCode(new MTPDauth_sentAppCode(_phone_registered, _phone_code_hash, _send_call_timeout, _is_password)); +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)); } inline MTPauth_authorization::MTPauth_authorization() : mtpDataOwner(new MTPDauth_authorization()) { @@ -28462,35 +28538,6 @@ inline MTPaccountDaysTTL MTP_accountDaysTTL(MTPint _days) { return MTPaccountDaysTTL(new MTPDaccountDaysTTL(_days)); } -inline MTPaccount_sentChangePhoneCode::MTPaccount_sentChangePhoneCode() : mtpDataOwner(new MTPDaccount_sentChangePhoneCode()) { -} - -inline uint32 MTPaccount_sentChangePhoneCode::innerLength() const { - const MTPDaccount_sentChangePhoneCode &v(c_account_sentChangePhoneCode()); - return v.vphone_code_hash.innerLength() + v.vsend_call_timeout.innerLength(); -} -inline mtpTypeId MTPaccount_sentChangePhoneCode::type() const { - return mtpc_account_sentChangePhoneCode; -} -inline void MTPaccount_sentChangePhoneCode::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_account_sentChangePhoneCode) throw mtpErrorUnexpected(cons, "MTPaccount_sentChangePhoneCode"); - - if (!data) setData(new MTPDaccount_sentChangePhoneCode()); - MTPDaccount_sentChangePhoneCode &v(_account_sentChangePhoneCode()); - v.vphone_code_hash.read(from, end); - v.vsend_call_timeout.read(from, end); -} -inline void MTPaccount_sentChangePhoneCode::write(mtpBuffer &to) const { - const MTPDaccount_sentChangePhoneCode &v(c_account_sentChangePhoneCode()); - v.vphone_code_hash.write(to); - v.vsend_call_timeout.write(to); -} -inline MTPaccount_sentChangePhoneCode::MTPaccount_sentChangePhoneCode(MTPDaccount_sentChangePhoneCode *_data) : mtpDataOwner(_data) { -} -inline MTPaccount_sentChangePhoneCode MTP_account_sentChangePhoneCode(const MTPstring &_phone_code_hash, MTPint _send_call_timeout) { - return MTPaccount_sentChangePhoneCode(new MTPDaccount_sentChangePhoneCode(_phone_code_hash, _send_call_timeout)); -} - inline uint32 MTPdocumentAttribute::innerLength() const { switch (_type) { case mtpc_documentAttributeImageSize: { @@ -31230,5 +31277,143 @@ inline MTPchannels_messageEditData MTP_channels_messageEditData(MTPint _flags) { return MTPchannels_messageEditData(new MTPDchannels_messageEditData(_flags)); } +inline uint32 MTPauth_codeType::innerLength() const { + return 0; +} +inline mtpTypeId MTPauth_codeType::type() const { + if (!_type) throw mtpErrorUninitialized(); + return _type; +} +inline void MTPauth_codeType::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + switch (cons) { + case mtpc_auth_codeTypeSms: _type = cons; break; + case mtpc_auth_codeTypeCall: _type = cons; break; + case mtpc_auth_codeTypeFlashCall: _type = cons; break; + default: throw mtpErrorUnexpected(cons, "MTPauth_codeType"); + } +} +inline void MTPauth_codeType::write(mtpBuffer &to) const { + switch (_type) { + } +} +inline MTPauth_codeType::MTPauth_codeType(mtpTypeId type) : _type(type) { + switch (type) { + case mtpc_auth_codeTypeSms: break; + case mtpc_auth_codeTypeCall: break; + case mtpc_auth_codeTypeFlashCall: break; + default: throw mtpErrorBadTypeId(type, "MTPauth_codeType"); + } +} +inline MTPauth_codeType MTP_auth_codeTypeSms() { + return MTPauth_codeType(mtpc_auth_codeTypeSms); +} +inline MTPauth_codeType MTP_auth_codeTypeCall() { + return MTPauth_codeType(mtpc_auth_codeTypeCall); +} +inline MTPauth_codeType MTP_auth_codeTypeFlashCall() { + return MTPauth_codeType(mtpc_auth_codeTypeFlashCall); +} + +inline uint32 MTPauth_sentCodeType::innerLength() const { + switch (_type) { + case mtpc_auth_sentCodeTypeApp: { + const MTPDauth_sentCodeTypeApp &v(c_auth_sentCodeTypeApp()); + return v.vlength.innerLength(); + } + case mtpc_auth_sentCodeTypeSms: { + const MTPDauth_sentCodeTypeSms &v(c_auth_sentCodeTypeSms()); + return v.vlength.innerLength(); + } + case mtpc_auth_sentCodeTypeCall: { + const MTPDauth_sentCodeTypeCall &v(c_auth_sentCodeTypeCall()); + return v.vlength.innerLength(); + } + case mtpc_auth_sentCodeTypeFlashCall: { + const MTPDauth_sentCodeTypeFlashCall &v(c_auth_sentCodeTypeFlashCall()); + return v.vpattern.innerLength(); + } + } + return 0; +} +inline mtpTypeId MTPauth_sentCodeType::type() const { + if (!_type) throw mtpErrorUninitialized(); + return _type; +} +inline void MTPauth_sentCodeType::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { + if (cons != _type) setData(0); + switch (cons) { + case mtpc_auth_sentCodeTypeApp: _type = cons; { + if (!data) setData(new MTPDauth_sentCodeTypeApp()); + MTPDauth_sentCodeTypeApp &v(_auth_sentCodeTypeApp()); + v.vlength.read(from, end); + } break; + case mtpc_auth_sentCodeTypeSms: _type = cons; { + if (!data) setData(new MTPDauth_sentCodeTypeSms()); + MTPDauth_sentCodeTypeSms &v(_auth_sentCodeTypeSms()); + v.vlength.read(from, end); + } break; + case mtpc_auth_sentCodeTypeCall: _type = cons; { + if (!data) setData(new MTPDauth_sentCodeTypeCall()); + MTPDauth_sentCodeTypeCall &v(_auth_sentCodeTypeCall()); + v.vlength.read(from, end); + } break; + case mtpc_auth_sentCodeTypeFlashCall: _type = cons; { + if (!data) setData(new MTPDauth_sentCodeTypeFlashCall()); + MTPDauth_sentCodeTypeFlashCall &v(_auth_sentCodeTypeFlashCall()); + v.vpattern.read(from, end); + } break; + default: throw mtpErrorUnexpected(cons, "MTPauth_sentCodeType"); + } +} +inline void MTPauth_sentCodeType::write(mtpBuffer &to) const { + switch (_type) { + case mtpc_auth_sentCodeTypeApp: { + const MTPDauth_sentCodeTypeApp &v(c_auth_sentCodeTypeApp()); + v.vlength.write(to); + } break; + case mtpc_auth_sentCodeTypeSms: { + const MTPDauth_sentCodeTypeSms &v(c_auth_sentCodeTypeSms()); + v.vlength.write(to); + } break; + case mtpc_auth_sentCodeTypeCall: { + const MTPDauth_sentCodeTypeCall &v(c_auth_sentCodeTypeCall()); + v.vlength.write(to); + } break; + case mtpc_auth_sentCodeTypeFlashCall: { + const MTPDauth_sentCodeTypeFlashCall &v(c_auth_sentCodeTypeFlashCall()); + v.vpattern.write(to); + } break; + } +} +inline MTPauth_sentCodeType::MTPauth_sentCodeType(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_auth_sentCodeTypeApp: setData(new MTPDauth_sentCodeTypeApp()); break; + case mtpc_auth_sentCodeTypeSms: setData(new MTPDauth_sentCodeTypeSms()); break; + case mtpc_auth_sentCodeTypeCall: setData(new MTPDauth_sentCodeTypeCall()); break; + case mtpc_auth_sentCodeTypeFlashCall: setData(new MTPDauth_sentCodeTypeFlashCall()); break; + default: throw mtpErrorBadTypeId(type, "MTPauth_sentCodeType"); + } +} +inline MTPauth_sentCodeType::MTPauth_sentCodeType(MTPDauth_sentCodeTypeApp *_data) : mtpDataOwner(_data), _type(mtpc_auth_sentCodeTypeApp) { +} +inline MTPauth_sentCodeType::MTPauth_sentCodeType(MTPDauth_sentCodeTypeSms *_data) : mtpDataOwner(_data), _type(mtpc_auth_sentCodeTypeSms) { +} +inline MTPauth_sentCodeType::MTPauth_sentCodeType(MTPDauth_sentCodeTypeCall *_data) : mtpDataOwner(_data), _type(mtpc_auth_sentCodeTypeCall) { +} +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)); +} +inline MTPauth_sentCodeType MTP_auth_sentCodeTypeSms(MTPint _length) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeSms(_length)); +} +inline MTPauth_sentCodeType MTP_auth_sentCodeTypeCall(MTPint _length) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeCall(_length)); +} +inline MTPauth_sentCodeType MTP_auth_sentCodeTypeFlashCall(const MTPstring &_pattern) { + return MTPauth_sentCodeType(new MTPDauth_sentCodeTypeFlashCall(_pattern)); +} + // 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/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index f071798e67..e01da730da 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -266,8 +266,7 @@ geoPoint#2049d70c long:double lat:double = GeoPoint; auth.checkedPhone#811ea28e phone_registered:Bool = auth.CheckedPhone; -auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode; -auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode; +auth.sentCode#5e002502 flags:# phone_registered:flags.0?true type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode; auth.authorization#ff036af1 user:User = auth.Authorization; @@ -496,8 +495,6 @@ account.privacyRules#554abb6f rules:Vector users:Vector = acc accountDaysTTL#b8d0afdf days:int = AccountDaysTTL; -account.sentChangePhoneCode#a4f58c4c phone_code_hash:string send_call_timeout:int = account.SentChangePhoneCode; - documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker#3a556302 alt:string stickerset:InputStickerSet = DocumentAttribute; @@ -649,6 +646,15 @@ messageFwdHeader#c786ddcb flags:# from_id:flags.0?int date:int channel_id:flags. channels.messageEditData#67e1255f flags:# caption:flags.0?true = channels.MessageEditData; +auth.codeTypeSms#72a3158c = auth.CodeType; +auth.codeTypeCall#741cd3e3 = auth.CodeType; +auth.codeTypeFlashCall#226ccefb = auth.CodeType; + +auth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType; +auth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType; +auth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType; +auth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -658,8 +664,7 @@ invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X; invokeWithoutUpdates#bf9459b7 {X:Type} query:!X = X; auth.checkPhone#6fe51dfb phone_number:string = auth.CheckedPhone; -auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode; -auth.sendCall#3c51564 phone_number:string phone_code_hash:string = Bool; +auth.sendCode#ccfd70cf flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool api_id:int api_hash:string lang_code:string = auth.SentCode; auth.signUp#1b067634 phone_number:string phone_code_hash:string phone_code:string first_name:string last_name:string = auth.Authorization; auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization; auth.logOut#5717da40 = Bool; @@ -668,11 +673,12 @@ auth.sendInvites#771c1d97 phone_numbers:Vector message:string = Bool; auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization; auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization; auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool; -auth.sendSms#da9f3e8 phone_number:string phone_code_hash:string = Bool; auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization; auth.checkPassword#a63011e password_hash:bytes = auth.Authorization; auth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery; auth.recoverPassword#4ea56e92 code:string = auth.Authorization; +auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode; +auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool; account.registerDevice#446c712c token_type:int token:string device_model:string system_version:string app_version:string app_sandbox:Bool lang_code:string = Bool; account.unregisterDevice#65c55b40 token_type:int token:string = Bool; @@ -690,7 +696,7 @@ account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.deleteAccount#418d4e0b reason:string = Bool; account.getAccountTTL#8fc711d = AccountDaysTTL; account.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool; -account.sendChangePhoneCode#a407a8f4 phone_number:string = account.SentChangePhoneCode; +account.sendChangePhoneCode#8e57deb flags:# allow_flashcall:flags.0?true phone_number:string current_number:flags.0?Bool = auth.SentCode; account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User; account.updateDeviceLocked#38df3532 period:int = Bool; account.getAuthorizations#e320c158 = account.Authorizations; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 4d82a0711f..90ef602b87 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -30,7 +30,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "pspecific.h" #include "title.h" #include "passcodewidget.h" -#include "intro/intro.h" +#include "intro/introwidget.h" #include "mainwidget.h" #include "layerwidget.h" #include "settingswidget.h" diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 3ea1905073..15192dbd93 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -160,12 +160,12 @@ SOURCES += \ ./SourceFiles/boxes/sessionsbox.cpp \ ./SourceFiles/boxes/stickersetbox.cpp \ ./SourceFiles/boxes/usernamebox.cpp \ - ./SourceFiles/intro/intro.cpp \ + ./SourceFiles/intro/introwidget.cpp \ ./SourceFiles/intro/introcode.cpp \ ./SourceFiles/intro/introphone.cpp \ ./SourceFiles/intro/intropwdcheck.cpp \ ./SourceFiles/intro/introsignup.cpp \ - ./SourceFiles/intro/introsteps.cpp + ./SourceFiles/intro/introstart.cpp HEADERS += \ ./SourceFiles/stdafx.h \ @@ -254,12 +254,12 @@ HEADERS += \ ./SourceFiles/boxes/sessionsbox.h \ ./SourceFiles/boxes/stickersetbox.h \ ./SourceFiles/boxes/usernamebox.h \ - ./SourceFiles/intro/intro.h \ + ./SourceFiles/intro/introwidget.h \ ./SourceFiles/intro/introcode.h \ ./SourceFiles/intro/introphone.h \ ./SourceFiles/intro/intropwdcheck.h \ ./SourceFiles/intro/introsignup.h \ - ./SourceFiles/intro/introsteps.h + ./SourceFiles/intro/introstart.h win32 { SOURCES += \ diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 6f0ffc6536..99397eaaab 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -263,10 +263,6 @@ true true - - true - true - true true @@ -283,6 +279,10 @@ true true + + true + true + true true @@ -521,10 +521,6 @@ true true - - true - true - true true @@ -541,6 +537,10 @@ true true + + true + true + true true @@ -805,10 +805,6 @@ true true - - true - true - true true @@ -825,6 +821,10 @@ true true + + true + true + true true @@ -1001,12 +1001,12 @@ - + - + @@ -1662,19 +1662,19 @@ $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) - - Moc%27ing intro.h... + + 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/intro.h" - Moc%27ing intro.h... - Moc%27ing intro.h... + "$(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" + Moc%27ing introwidget.h... + Moc%27ing introwidget.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/intro/intro.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/intro/intro.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/intro/introwidget.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/intro/introwidget.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) Moc%27ing introcode.h... @@ -1732,7 +1732,7 @@ .\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/intro/intropwdcheck.h" - + Moc%27ing layerwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index 3c80ea71f0..a0da01041d 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -201,9 +201,6 @@ boxes - - intro - intro @@ -213,9 +210,6 @@ intro - - intro - Source Files @@ -426,15 +420,6 @@ Generated Files\Release - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - Generated Files\Deploy @@ -909,6 +894,21 @@ Source Files + + intro + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + intro + @@ -962,9 +962,6 @@ gui - - intro - gui @@ -1010,6 +1007,9 @@ Source Files + + intro + @@ -1117,9 +1117,6 @@ boxes - - intro - intro @@ -1234,6 +1231,9 @@ Source Files + + intro + diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 65122a0428..65609b1efe 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -99,7 +99,7 @@ 07DE92AD1AA4928B00A18F6F /* moc_passcodebox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07DE92AB1AA4928B00A18F6F /* moc_passcodebox.cpp */; }; 07DE92AE1AA4928B00A18F6F /* moc_passcodewidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07DE92AC1AA4928B00A18F6F /* moc_passcodewidget.cpp */; }; 0CB7DE9A54CC9BF86FB7B5CA /* mtp.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6D50D70712776D7ED3B00E5C /* mtp.cpp */; settings = {ATTRIBUTES = (); }; }; - 0F7872E39EA570249D420912 /* moc_intro.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = A37C7E516201B0264A4CDA38 /* moc_intro.cpp */; settings = {ATTRIBUTES = (); }; }; + 0F7872E39EA570249D420912 /* moc_introwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = A37C7E516201B0264A4CDA38 /* moc_introwidget.cpp */; settings = {ATTRIBUTES = (); }; }; 113AA97DEE7847C7D2DCFF71 /* logs.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 974DB34EEB8F83B91614C0B0 /* logs.cpp */; settings = {ATTRIBUTES = (); }; }; 1299DDAE203A7EDFED9F5D6B /* main.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 5271C394C1E7646D117CE67E /* main.cpp */; settings = {ATTRIBUTES = (); }; }; 15364689D2AB5A30E87A689F /* Security.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 205259EEEE2BADA5E64741E3 /* Security.framework */; }; @@ -156,7 +156,7 @@ 8771A8C96E9C391044035D99 /* OpenGL.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D4B32C2222F82AC56BADEB21 /* OpenGL.framework */; }; 8883FF366F2623E89D90A9E6 /* qgenericbearer in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 9A55B8F7C143D66AD9EAE304 /* qgenericbearer */; }; 89ADB41E48A3B5E24ABB626C /* profilewidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = CF32DF59C7823E4F3397EF3C /* profilewidget.cpp */; settings = {ATTRIBUTES = (); }; }; - 8B22E794EFF0EAFF964A3043 /* introsteps.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = C34459FA465B57DF4DB80D12 /* introsteps.cpp */; settings = {ATTRIBUTES = (); }; }; + 8B22E794EFF0EAFF964A3043 /* introstart.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = C34459FA465B57DF4DB80D12 /* introstart.cpp */; settings = {ATTRIBUTES = (); }; }; 8B71D1C7BB9DCEE6511219C2 /* moc_flatlabel.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 2181F5E34DE0A4B2F811E2E2 /* moc_flatlabel.cpp */; settings = {ATTRIBUTES = (); }; }; 8C4BA0DB55E2C40DE5F5E990 /* moc_pspecific_mac.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 74772222DA764BE4623EAC5D /* moc_pspecific_mac.cpp */; settings = {ATTRIBUTES = (); }; }; 8D267F2E4776F0ECA2F49DC8 /* IOKit.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = A1A67BEAA744704B29168D39 /* IOKit.framework */; }; @@ -217,7 +217,7 @@ E3D7A5CA24541D5DB69D6606 /* images.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6A510365F9F6367ECB0DB065 /* images.cpp */; settings = {ATTRIBUTES = (); }; }; E45E51A644D5FC9F942ECE55 /* AGL.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 8D9815BDB5BD9F90D2BC05C5 /* AGL.framework */; }; E8B28580819B882A5964561A /* moc_addcontactbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 81780025807318AEA3B8A6FF /* moc_addcontactbox.cpp */; settings = {ATTRIBUTES = (); }; }; - E8D95529CED88F18818C9A8B /* intro.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0771C4C94B623FC34BF62983 /* intro.cpp */; settings = {ATTRIBUTES = (); }; }; + E8D95529CED88F18818C9A8B /* introwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0771C4C94B623FC34BF62983 /* introwidget.cpp */; settings = {ATTRIBUTES = (); }; }; E97B3CFAB59B49BACFFC5F7C /* moc_title.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 1080B6D395843B8F76A2E45E /* moc_title.cpp */; settings = {ATTRIBUTES = (); }; }; E9F1CE7F9B18C7C85A50E62D /* style_auto.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 99B8D38F7F5858601230911E /* style_auto.cpp */; settings = {ATTRIBUTES = (); }; }; EBE29731916DB43BF49FE7A4 /* aboutbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = C194EDD00F76216057D48A5C /* aboutbox.cpp */; settings = {ATTRIBUTES = (); }; }; @@ -313,7 +313,7 @@ 0764D5581ABAD6F900FBFEED /* apiwrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = apiwrap.cpp; path = SourceFiles/apiwrap.cpp; sourceTree = SOURCE_ROOT; }; 0764D5591ABAD6F900FBFEED /* apiwrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apiwrap.h; path = SourceFiles/apiwrap.h; sourceTree = SOURCE_ROOT; }; 0764D55C1ABAD71B00FBFEED /* moc_apiwrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_apiwrap.cpp; path = GeneratedFiles/Debug/moc_apiwrap.cpp; sourceTree = SOURCE_ROOT; }; - 0771C4C94B623FC34BF62983 /* intro.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = intro.cpp; path = SourceFiles/intro/intro.cpp; sourceTree = ""; }; + 0771C4C94B623FC34BF62983 /* introwidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = introwidget.cpp; path = SourceFiles/intro/introwidget.cpp; sourceTree = ""; }; 078A2FC91A811C5900CCC7A0 /* moc_backgroundbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_backgroundbox.cpp; path = GeneratedFiles/Debug/moc_backgroundbox.cpp; sourceTree = SOURCE_ROOT; }; 078A2FCB1A811CA600CCC7A0 /* backgroundbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = backgroundbox.cpp; path = SourceFiles/boxes/backgroundbox.cpp; sourceTree = SOURCE_ROOT; }; 078A2FCC1A811CA600CCC7A0 /* backgroundbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = backgroundbox.h; path = SourceFiles/boxes/backgroundbox.h; sourceTree = SOURCE_ROOT; }; @@ -393,7 +393,7 @@ 135FD3715BFDC50AD7B00E04 /* text.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = text.cpp; path = SourceFiles/gui/text.cpp; sourceTree = ""; }; 143405635D04698F421A12EA /* aboutbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = aboutbox.h; path = SourceFiles/boxes/aboutbox.h; sourceTree = ""; }; 14437BFDCD58FF1742EF1B35 /* photocropbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = photocropbox.h; path = SourceFiles/boxes/photocropbox.h; sourceTree = ""; }; - 152B8D1BCECEB7B0C77E073C /* intro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = intro.h; path = SourceFiles/intro/intro.h; sourceTree = ""; }; + 152B8D1BCECEB7B0C77E073C /* introwidget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = introwidget.h; path = SourceFiles/intro/introwidget.h; sourceTree = ""; }; 16DD53E17C65AC8B450CC6C3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_quick.pri"; sourceTree = ""; }; 186D09F4CB713AD4B8BDD260 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; 19618554524B8D928F13940D /* emoji_config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = emoji_config.h; path = SourceFiles/gui/emoji_config.h; sourceTree = ""; }; @@ -580,7 +580,7 @@ A1479F94376F9732B57C69DB /* moc_animation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_animation.cpp; path = GeneratedFiles/Debug/moc_animation.cpp; sourceTree = ""; }; A1A67BEAA744704B29168D39 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; A3622760CEC6D6827A25E710 /* mtpPublicRSA.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpPublicRSA.h; path = SourceFiles/mtproto/mtpPublicRSA.h; sourceTree = ""; }; - A37C7E516201B0264A4CDA38 /* moc_intro.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_intro.cpp; path = GeneratedFiles/Debug/moc_intro.cpp; sourceTree = ""; }; + A37C7E516201B0264A4CDA38 /* moc_introwidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_introwidget.cpp; path = GeneratedFiles/Debug/moc_introwidget.cpp; sourceTree = ""; }; A4D8AC60897F435C1C3B9D02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri"; sourceTree = ""; }; A59F74CD76FDC2B4B9910E18 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri"; sourceTree = ""; }; A5B17ABEFBA1C2F43443D644 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras.pri"; sourceTree = ""; }; @@ -596,7 +596,7 @@ AC9B5F6FB4B984C8D76F7AE2 /* moc_dropdown.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_dropdown.cpp; path = GeneratedFiles/Debug/moc_dropdown.cpp; sourceTree = ""; }; ACC8A73268E5D9AF64E97AF4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth.pri"; sourceTree = ""; }; AD0C395D671BC024083A5FC7 /* localimageloader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = localimageloader.h; path = SourceFiles/localimageloader.h; sourceTree = ""; }; - AD90723EF02EAD016FD49CC9 /* introsteps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = introsteps.h; path = SourceFiles/intro/introsteps.h; sourceTree = ""; }; + AD90723EF02EAD016FD49CC9 /* introstart.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = introstart.h; path = SourceFiles/intro/introstart.h; sourceTree = ""; }; ADC6308023253CEA51F86E21 /* qwebp */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qwebp; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqwebp$(QT_LIBRARY_SUFFIX).a"; sourceTree = ""; }; ADFC79902C14A612AE93A89A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_svg.pri"; sourceTree = ""; }; AEA456A2F75ED9F5CDA7BCBE /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; @@ -629,7 +629,7 @@ C194EDD00F76216057D48A5C /* aboutbox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = aboutbox.cpp; path = SourceFiles/boxes/aboutbox.cpp; sourceTree = ""; }; C19DF71B273A4843553518F2 /* app.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = app.h; path = SourceFiles/app.h; sourceTree = ""; }; C20F9DD8C7B031B8E20D5653 /* application.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = application.cpp; path = SourceFiles/application.cpp; sourceTree = ""; }; - C34459FA465B57DF4DB80D12 /* introsteps.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = introsteps.cpp; path = SourceFiles/intro/introsteps.cpp; sourceTree = ""; }; + C34459FA465B57DF4DB80D12 /* introstart.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = introstart.cpp; path = SourceFiles/intro/introstart.cpp; sourceTree = ""; }; C4295BE59CCEBCDD16268349 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qico.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qico.pri"; sourceTree = ""; }; C505A18319B9B63C63877858 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_script_private.pri"; sourceTree = ""; }; C63C6D083EBEB13A60256DF3 /* historywidget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = historywidget.h; path = SourceFiles/historywidget.h; sourceTree = ""; }; @@ -908,18 +908,18 @@ 5E35A03E5F2C51353EBCBF00 /* intro */ = { isa = PBXGroup; children = ( - 0771C4C94B623FC34BF62983 /* intro.cpp */, + 0771C4C94B623FC34BF62983 /* introwidget.cpp */, A0090709DE1B155085362C36 /* introcode.cpp */, 61C679D8B4B332026BD34200 /* introphone.cpp */, 07DB674F1AD07CB800A51329 /* intropwdcheck.cpp */, A9FF4818C6775109B3DBFA18 /* introsignup.cpp */, - C34459FA465B57DF4DB80D12 /* introsteps.cpp */, - 152B8D1BCECEB7B0C77E073C /* intro.h */, + C34459FA465B57DF4DB80D12 /* introstart.cpp */, + 152B8D1BCECEB7B0C77E073C /* introwidget.h */, 098EA7CE256AAFAE4A17EB77 /* introcode.h */, EF1AD6A66D0C28A6A15E2C30 /* introphone.h */, 07DB67501AD07CB800A51329 /* intropwdcheck.h */, DC23E0B79FF53F35BA8F76A1 /* introsignup.h */, - AD90723EF02EAD016FD49CC9 /* introsteps.h */, + AD90723EF02EAD016FD49CC9 /* introstart.h */, ); name = intro; sourceTree = ""; @@ -1203,7 +1203,7 @@ 0C0DC15EB416789673526AA5 /* moc_emojibox.cpp */, AF61D864B8C444ADD4E1B391 /* moc_photocropbox.cpp */, 9E0704DE8650D7952DC6B7AE /* moc_photosendbox.cpp */, - A37C7E516201B0264A4CDA38 /* moc_intro.cpp */, + A37C7E516201B0264A4CDA38 /* moc_introwidget.cpp */, 8B98A212C068D6CC7CE73CAA /* moc_introcode.cpp */, 1B4A65B84270FF2FED008EB6 /* moc_introphone.cpp */, 58A7114F60E7D09E73283983 /* moc_introsignup.cpp */, @@ -1603,11 +1603,11 @@ 07D703BB19B88FB900C4EED2 /* moc_audio.cpp in Compile Sources */, 77B998AC22A13EF3DDEE07AC /* photocropbox.cpp in Compile Sources */, F278C423357CA99797EA30AB /* photosendbox.cpp in Compile Sources */, - E8D95529CED88F18818C9A8B /* intro.cpp in Compile Sources */, + E8D95529CED88F18818C9A8B /* introwidget.cpp in Compile Sources */, 9357E7B12AD6D88B157ACA05 /* introcode.cpp in Compile Sources */, 4BF3F8D0797BC8A0C1FAD13C /* introphone.cpp in Compile Sources */, 4978DE680549639AE9AA9CA6 /* introsignup.cpp in Compile Sources */, - 8B22E794EFF0EAFF964A3043 /* introsteps.cpp in Compile Sources */, + 8B22E794EFF0EAFF964A3043 /* introstart.cpp in Compile Sources */, 74343521EECC740F777DAFE6 /* pspecific_mac.cpp in Compile Sources */, 26A81090DC8B5BCF7278FDFF /* qrc_telegram.cpp in Compile Sources */, 07AF95F51AFD03B90060B057 /* qrc_telegram_mac.cpp in Compile Sources */, @@ -1675,7 +1675,7 @@ 9D294F23E02CFDF22C288382 /* moc_emojibox.cpp in Compile Sources */, 9809A3AF1946D51ACB41D716 /* moc_photocropbox.cpp in Compile Sources */, AC6C131416AEC557C854BA70 /* moc_photosendbox.cpp in Compile Sources */, - 0F7872E39EA570249D420912 /* moc_intro.cpp in Compile Sources */, + 0F7872E39EA570249D420912 /* moc_introwidget.cpp in Compile Sources */, 4F27F5F76AA3F78C8CA27339 /* moc_introcode.cpp in Compile Sources */, 07D8509519F5C97E00623D75 /* mtpScheme.cpp in Compile Sources */, 0250AB6761AC71A2E3155EEA /* moc_introphone.cpp in Compile Sources */, diff --git a/Telegram/Telegram.xcodeproj/qt_preprocess.mak b/Telegram/Telegram.xcodeproj/qt_preprocess.mak index 109bb8a076..961347559a 100644 --- a/Telegram/Telegram.xcodeproj/qt_preprocess.mak +++ b/Telegram/Telegram.xcodeproj/qt_preprocess.mak @@ -50,7 +50,7 @@ compilers: GeneratedFiles/qrc_telegram.cpp GeneratedFiles/qrc_telegram_emojis.cp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp\ GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp\ GeneratedFiles/Debug/moc_passcodebox.cpp\ - GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_intro.cpp\ + GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_introwidget.cpp\ GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp\ GeneratedFiles/Debug/moc_pspecific_mac.cpp compiler_objective_c_make_all: @@ -99,9 +99,9 @@ GeneratedFiles/qrc_telegram_mac.cpp: SourceFiles/telegram_mac.qrc \ SourceFiles/art/osxtray.png /usr/local/Qt-5.5.1/bin/rcc -name telegram_mac SourceFiles/telegram_mac.qrc -o GeneratedFiles/qrc_telegram_mac.cpp -compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_intro.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp +compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp compiler_moc_header_clean: - -$(DEL_FILE) GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamedbox.cpp GeneratedFiles/Debug/moc_intro.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp + -$(DEL_FILE) GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamedbox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp GeneratedFiles/Debug/moc_apiwrap.cpp: SourceFiles/types.h \ SourceFiles/logs.h \ SourceFiles/apiwrap.h @@ -548,7 +548,7 @@ GeneratedFiles/Debug/moc_usernamebox.cpp: SourceFiles/boxes/abstractbox.h \ SourceFiles/boxes/usernamebox.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/boxes/usernamebox.h -o GeneratedFiles/Debug/moc_usernamebox.cpp -GeneratedFiles/Debug/moc_intro.cpp: ../../Libraries/QtStatic/qtbase/include/QtWidgets/QWidget \ +GeneratedFiles/Debug/moc_introwidget.cpp: ../../Libraries/QtStatic/qtbase/include/QtWidgets/QWidget \ SourceFiles/gui/flatbutton.h \ SourceFiles/gui/button.h \ SourceFiles/gui/twidget.h \ @@ -562,8 +562,8 @@ GeneratedFiles/Debug/moc_intro.cpp: ../../Libraries/QtStatic/qtbase/include/QtWi SourceFiles/style.h \ GeneratedFiles/style_classes.h \ GeneratedFiles/style_auto.h \ - SourceFiles/intro/intro.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/intro/intro.h -o GeneratedFiles/Debug/moc_intro.cpp + SourceFiles/intro/introwidget.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/intro/introwidget.h -o GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp: ../../Libraries/QtStatic/qtbase/include/QtWidgets/QWidget \ SourceFiles/gui/flatbutton.h \ @@ -581,7 +581,7 @@ GeneratedFiles/Debug/moc_introcode.cpp: ../../Libraries/QtStatic/qtbase/include/ GeneratedFiles/style_auto.h \ SourceFiles/gui/flatinput.h \ ../../Libraries/QtStatic/qtbase/include/QtWidgets/QLineEdit \ - SourceFiles/intro/intro.h \ + SourceFiles/intro/introwidget.h \ SourceFiles/intro/introcode.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/intro/introcode.h -o GeneratedFiles/Debug/moc_introcode.cpp @@ -605,7 +605,7 @@ GeneratedFiles/Debug/moc_introphone.cpp: ../../Libraries/QtStatic/qtbase/include SourceFiles/gui/scrollarea.h \ ../../Libraries/QtStatic/qtbase/include/QtWidgets/QScrollArea \ SourceFiles/gui/boxshadow.h \ - SourceFiles/intro/intro.h \ + SourceFiles/intro/introwidget.h \ SourceFiles/intro/introphone.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/intro/introphone.h -o GeneratedFiles/Debug/moc_introphone.cpp @@ -629,7 +629,7 @@ GeneratedFiles/Debug/moc_intropwdcheck.cpp: ../../Libraries/QtStatic/qtbase/incl SourceFiles/gui/scrollarea.h \ ../../Libraries/QtStatic/qtbase/include/QtWidgets/QScrollArea \ SourceFiles/gui/boxshadow.h \ - SourceFiles/intro/intro.h \ + SourceFiles/intro/introwidget.h \ SourceFiles/intro/intropwdcheck.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/intro/intropwdcheck.h -o GeneratedFiles/Debug/moc_intropwdcheck.cpp @@ -649,7 +649,7 @@ GeneratedFiles/Debug/moc_introsignup.cpp: ../../Libraries/QtStatic/qtbase/includ GeneratedFiles/style_auto.h \ SourceFiles/gui/flatinput.h \ ../../Libraries/QtStatic/qtbase/include/QtWidgets/QLineEdit \ - SourceFiles/intro/intro.h \ + SourceFiles/intro/introwidget.h \ SourceFiles/intro/introsignup.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/intro/introsignup.h -o GeneratedFiles/Debug/moc_introsignup.cpp From 9d07456a29e4e43f31244bc6f05c4f5e84dbdb68 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 20:45:59 +0300 Subject: [PATCH 199/316] fixed scroll to convert group to supergroup service message --- Telegram/SourceFiles/historywidget.cpp | 38 +++++++++++++++++--------- Telegram/SourceFiles/historywidget.h | 12 +++++++- Telegram/SourceFiles/window.cpp | 5 +++- 3 files changed, 40 insertions(+), 15 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 5ce8f3564a..07dc36bc75 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3133,7 +3133,7 @@ void HistoryWidget::sendActionDone(const MTPBool &result, mtpRequestId req) { } void HistoryWidget::activate() { - if (_history) updateListSize(0, true); + if (_history) updateListSize(true); if (App::wnd()) App::wnd()->setInnerFocus(); } @@ -3239,7 +3239,7 @@ void HistoryWidget::notify_clipStopperHidden(ClipStopperType type) { } void HistoryWidget::notify_historyItemResized(const HistoryItem *row, bool scrollToIt) { - updateListSize(0, false, false, row, scrollToIt); + updateListSize(false, false, { ScrollChangeNone, 0 }, row, scrollToIt); } void HistoryWidget::cmd_search() { @@ -4955,7 +4955,7 @@ void HistoryWidget::doneShow() { updateReportSpamStatus(); updateBotKeyboard(); updateControlsVisibility(); - updateListSize(0, true); + updateListSize(true); onListScroll(); if (App::wnd()) { App::wnd()->checkHistoryActivation(); @@ -6215,7 +6215,7 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) { _attachPhoto.move(_attachDocument.x(), _attachDocument.y()); _fieldBarCancel.move(width() - _fieldBarCancel.width(), _field.y() - st::sendPadding - _fieldBarCancel.height()); - updateListSize(App::main() ? App::main()->contentScrollAddToY() : 0); + updateListSize(false, false, { ScrollChangeAdd, App::main() ? App::main()->contentScrollAddToY() : 0 }); bool kbShowShown = _history && !_kbShown && _keyboard.hasMarkup(); _field.resize(width() - _send.width() - _attachDocument.width() - _attachEmoji.width() - (kbShowShown ? _kbShow.width() : 0) - (_cmdStartShown ? _cmdStart.width() : 0) - (hasBroadcastToggle() ? _broadcast.width() : 0) - (hasSilentToggle() ? _silent.width() : 0), _field.height()); @@ -6301,7 +6301,7 @@ MsgId HistoryWidget::replyToId() const { return _replyToId ? _replyToId : (_kbReplyTo ? _kbReplyTo->id : 0); } -void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, const HistoryItem *resizedItem, bool scrollToIt) { +void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change, const HistoryItem *resizedItem, bool scrollToIt) { if (!_history || (initial && _histInited) || (!initial && !_histInited)) return; if (_firstLoadRequest) { if (resizedItem) _list->recountHeight(resizedItem); @@ -6360,6 +6360,12 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, } if ((!initial && !wasAtBottom) || (loadedDown && (!_history->showFrom || _history->unreadBar || _history->loadedAtBottom()) && (!_migrated || !_migrated->showFrom || _migrated->unreadBar || _history->loadedAtBottom()))) { + int32 addToY = 0; + if (change.type == ScrollChangeAdd) { + addToY = change.value; + } else if (change.type == ScrollChangeOldHistoryHeight) { + addToY = _list->historyHeight() - change.value; + } _scroll.scrollToY(newSt + addToY); return; } @@ -6378,7 +6384,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, if (iy < 0) { setMsgId(0); _histInited = false; - return updateListSize(addToY, initial); + return updateListSize(initial, false, change); } else { toY = (_scroll.height() > item->height()) ? qMax(iy - (_scroll.height() - item->height()) / 2, 0) : iy; _animActiveStart = getms(); @@ -6391,7 +6397,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, if (iy < 0) { setMsgId(0); _histInited = false; - return updateListSize(addToY, initial); + return updateListSize(initial, false, change); } else { toY = (_scroll.height() > item->height()) ? qMax(iy - (_scroll.height() - item->height()) / 2, 0) : iy; _animActiveStart = getms(); @@ -6429,7 +6435,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, _fixedInScrollMsgId = 0; _fixedInScrollMsgTop = 0; _histInited = false; - return updateListSize(addToY, initial); + return updateListSize(initial, false, change); } } else { toY = qMax(iy + item->height() - _fixedInScrollMsgTop, 0); @@ -6445,7 +6451,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, if (_migrated->unreadBar) { setMsgId(ShowAtUnreadMsgId); _histInited = false; - updateListSize(0, true); + updateListSize(true); App::wnd()->checkHistoryActivation(); return; } @@ -6457,7 +6463,7 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, if (_history->unreadBar) { setMsgId(ShowAtUnreadMsgId); _histInited = false; - updateListSize(0, true); + updateListSize(true); App::wnd()->checkHistoryActivation(); return; } @@ -6468,10 +6474,16 @@ void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, } void HistoryWidget::addMessagesToFront(PeerData *peer, const QVector &messages, const QVector *collapsed) { - int32 oldH = _list->historyHeight(); + int oldH = _list->historyHeight(); _list->messagesReceived(peer, messages, collapsed); if (!_firstLoadRequest) { - updateListSize(_list->historyHeight() - oldH); + updateListSize(false, false, { ScrollChangeOldHistoryHeight, oldH }); + 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()) { + _activeAnimMsgId = -_migrated->blocks.back()->items.back()->id; + } + } updateBotKeyboard(); } } @@ -6479,7 +6491,7 @@ void HistoryWidget::addMessagesToFront(PeerData *peer, const QVector void HistoryWidget::addMessagesToBack(PeerData *peer, const QVector &messages, const QVector *collapsed) { _list->messagesReceivedDown(peer, messages, collapsed); if (!_firstLoadRequest) { - updateListSize(0, false, true); + updateListSize(false, true); } } diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index a787bb978d..917eb73018 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -782,10 +782,20 @@ private: QList _replyReturns; bool messagesFailed(const RPCError &error, mtpRequestId requestId); - void updateListSize(int32 addToY = 0, bool initial = false, bool loadedDown = false, const HistoryItem *resizedItem = 0, bool scrollToIt = false); void addMessagesToFront(PeerData *peer, const QVector &messages, const QVector *collapsed); void addMessagesToBack(PeerData *peer, const QVector &messages, const QVector *collapsed); + enum ScrollChangeType { + ScrollChangeNone, + ScrollChangeAdd, + ScrollChangeOldHistoryHeight, + }; + struct ScrollChange { + 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 saveGifDone(DocumentData *doc, const MTPBool &result); void reportSpamDone(PeerData *peer, const MTPBool &result, mtpRequestId request); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 4d82a0711f..66a3a02a11 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -78,7 +78,10 @@ void ConnectingWidget::onReconnect() { MTP::restart(); } -NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) : history(msg->history()), item(msg), fwdCount(fwdCount) +NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y, int32 fwdCount) : TWidget(0) +, history(msg->history()) +, item(msg) +, fwdCount(fwdCount) #ifdef Q_OS_WIN , started(GetTickCount()) #endif From f13c61fbaf05343168dd2a95ebe8edd7896ca3d9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Mar 2016 20:47:40 +0300 Subject: [PATCH 200/316] stable 0.9.32 --- Telegram/SourceFiles/config.h | 4 ++-- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index fc2d7ac222..d8b4814f5b 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9031; -static const wchar_t *AppVersionStr = L"0.9.31"; +static const int32 AppVersion = 9032; +static const wchar_t *AppVersionStr = L"0.9.32"; static const bool DevVersion = false; //#define BETA_VERSION (9030002ULL) // just comment this line to build public version diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 3e8b9e29f5..ccbf8be3b3 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.31 + 0.9.32 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index c80a0f8386..a798dcff0d 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,31,0 - PRODUCTVERSION 0,9,31,0 + FILEVERSION 0,9,32,0 + PRODUCTVERSION 0,9,32,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.31.0" + VALUE "FileVersion", "0.9.32.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.31.0" + VALUE "ProductVersion", "0.9.32.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 65122a0428..b2574c90f8 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1726,7 +1726,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.31; + CURRENT_PROJECT_VERSION = 0.9.32; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1745,7 +1745,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.31; + CURRENT_PROJECT_VERSION = 0.9.32; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1774,10 +1774,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.31; + CURRENT_PROJECT_VERSION = 0.9.32; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.31; + DYLIB_CURRENT_VERSION = 0.9.32; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1915,10 +1915,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.31; + CURRENT_PROJECT_VERSION = 0.9.32; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.31; + DYLIB_CURRENT_VERSION = 0.9.32; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 0ba9a8588c..1ad348a09f 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9031 +AppVersion 9032 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.31 -AppVersionStr 0.9.31 +AppVersionStrSmall 0.9.32 +AppVersionStr 0.9.32 DevChannel 0 BetaVersion 0 9030002 From 54af494224483906e143d8e3bc9c7eec979d28c1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 13:37:56 +0300 Subject: [PATCH 201/316] added some asserts in adding history messages, added for_const range-based loop macro, remotecontent() in Qt patch is limited to 64 Mb --- Telegram/SourceFiles/history.cpp | 122 +++++++++++++++++------------- Telegram/SourceFiles/history.h | 21 +++-- Telegram/SourceFiles/types.h | 32 +++----- Telegram/_qtbase_5_5_1_patch.diff | 26 ++++--- 4 files changed, 111 insertions(+), 90 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f3187d2491..fcf242e6c4 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -852,16 +852,19 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp clear(true); } - HistoryBlock *to = 0; + 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) ? 0 : to, msg, (type == NewMessageUnread)); - if (type == NewMessageLast) { + HistoryItem *item = createItem((type == NewMessageLast) ? nullptr : to, msg, (type == NewMessageUnread)); + if (type == NewMessageLast && item) { if (!item->detached()) { + t_assert(!newBlock); return item; } item->attach(to); @@ -896,10 +899,8 @@ void ChannelHistory::switchMode() { OtherList savedList; if (!blocks.isEmpty()) { savedList.reserve(((blocks.size() - 2) * MessagesPerPage + blocks.back()->items.size()) * (onlyImportant() ? 2 : 1)); - for (Blocks::const_iterator i = blocks.cbegin(), e = blocks.cend(); i != e; ++i) { - HistoryBlock *block = *i; - for (HistoryBlock::Items::const_iterator j = block->items.cbegin(), end = block->items.cend(); j != end; ++j) { - HistoryItem *item = *j; + for_const (const HistoryBlock *block, blocks) { + for_const (HistoryItem *item, block->items) { HistoryItemType itemType = item->type(); if (itemType == HistoryItemMsg || itemType == HistoryItemGroup) { savedList.push_back(item); @@ -994,7 +995,7 @@ HistoryBlock *ChannelHistory::findGroupBlock(MsgId msgId) const { // find block if (blocks.size() > 1) for (int32 minBlock = 0, maxBlock = blocks.size();;) { for (int32 startCheckBlock = (minBlock + maxBlock) / 2, checkBlock = startCheckBlock;;) { HistoryBlock *block = blocks.at(checkBlock); - HistoryBlock::Items::const_iterator i = block->items.cbegin(), e = block->items.cend(); + auto i = block->items.cbegin(), e = block->items.cend(); for (; i != e; ++i) { // out msgs could be a mess in monotonic ids if (((*i)->id > 0 && !(*i)->out()) || (*i)->type() == HistoryItemGroup) { MsgId threshold = ((*i)->id > 0) ? (*i)->id : static_cast(*i)->minId(); @@ -1106,6 +1107,12 @@ void ChannelHistory::messageWithIdDeleted(MsgId msgId) { } } +ChannelHistory::~ChannelHistory() { + // all items must be destroyed before ChannelHistory is destroyed + // or they will call history()->asChannelHistory() -> undefined behaviour + clearOnDestroy(); +} + bool DialogsList::del(const PeerId &peerId, DialogRow *replacedBy) { RowByPeer::iterator i = rowByPeer.find(peerId); if (i == rowByPeer.cend()) return false; @@ -1299,7 +1306,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo case mtpc_message: msgId = msg.c_message().vid.v; break; case mtpc_messageService: msgId = msg.c_messageService().vid.v; break; } - if (!msgId) return 0; + if (!msgId) return nullptr; HistoryItem *result = App::histItemById(channelId(), msgId); if (result) { @@ -1574,6 +1581,8 @@ HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString & to = new HistoryBlock(this); } else { to = blocks.back(); + t_assert(!to->items.isEmpty()); + t_assert(to->items.back() != nullptr); } HistoryItem *result = new HistoryServiceMsg(this, to, msgId, date, text, flags, media); @@ -1595,16 +1604,19 @@ HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) return item; } - HistoryBlock *to = 0; + 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) ? 0 : to, msg, (type == NewMessageUnread)); - if (type == NewMessageLast) { + HistoryItem *item = createItem((type == NewMessageLast) ? nullptr : to, msg, (type == NewMessageUnread)); + if (type == NewMessageLast && item) { if (!item->detached()) { + t_assert(!newBlock); return item; } item->attach(to); @@ -1613,16 +1625,18 @@ HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) } HistoryItem *History::addToHistory(const MTPMessage &msg) { - return createItem(0, msg, false); + return createItem(nullptr, msg, false); } HistoryItem *History::addNewForwarded(MsgId id, int32 flags, QDateTime date, int32 from, HistoryMessage *item) { - HistoryBlock *to = 0; + 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(to, id, flags, date, from, item), true); } @@ -1634,6 +1648,8 @@ HistoryItem *History::addNewDocument(MsgId id, int32 flags, int32 viaBotId, MsgI to = new HistoryBlock(this); } else { to = blocks.back(); + 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); } @@ -1645,6 +1661,8 @@ HistoryItem *History::addNewPhoto(MsgId id, int32 flags, int32 viaBotId, MsgId r to = new HistoryBlock(this); } else { to = blocks.back(); + 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); } @@ -1913,10 +1931,10 @@ void History::addOlderSlice(const QVector &slice, const QVectorconstData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; - HistoryItem *oldFirst = 0, *last = 0; + HistoryItem *oldFirst = nullptr, *last = nullptr; HistoryBlock *block = new HistoryBlock(this); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); - for (QVector::const_iterator i = slice.cend(), e = slice.cbegin(); i != e;) { + for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { --i; HistoryItem *adding = createItem(block, *i, false); if (!adding) continue; @@ -2079,11 +2097,11 @@ void History::addNewerSlice(const QVector &slice, const QVectorisEmpty())) { const MTPMessageGroup *groupsBegin = (isChannel() && collapsed) ? collapsed->constData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; - HistoryItem *prev = blocks.isEmpty() ? 0 : blocks.back()->items.back(); + HistoryItem *prev = blocks.isEmpty() ? nullptr : blocks.back()->items.back(); HistoryBlock *block = new HistoryBlock(this); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); - for (QVector::const_iterator i = slice.cend(), e = slice.cbegin(); i != e;) { + for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { --i; HistoryItem *adding = createItem(block, *i, false); if (!adding) continue; @@ -2148,9 +2166,9 @@ void History::addNewerSlice(const QVector &slice, const QVectoritems.cend(), en = (*i)->items.cbegin(); j != en;) { + for (auto j = (*i)->items.cend(), en = (*i)->items.cbegin(); j != en;) { --j; if ((*j)->id > 0 && (*j)->id <= upTo) { break; @@ -2165,9 +2183,9 @@ int32 History::countUnread(MsgId upTo) { void History::updateShowFrom() { if (showFrom) return; - for (Blocks::const_iterator i = blocks.cend(); i != blocks.cbegin();) { + for (auto i = blocks.cend(); i != blocks.cbegin();) { --i; - for (HistoryBlock::Items::const_iterator j = (*i)->items.cend(); j != (*i)->items.cbegin();) { + for (auto j = (*i)->items.cend(); j != (*i)->items.cbegin();) { --j; if ((*j)->type() == HistoryItemMsg && (*j)->id > 0 && (!(*j)->out() || !showFrom)) { if ((*j)->id >= inboxReadBefore) { @@ -2463,10 +2481,10 @@ void History::fixLastMessage(bool wasAtBottom) { } MsgId History::minMsgId() const { - for (Blocks::const_iterator i = blocks.cbegin(), e = blocks.cend(); i != e; ++i) { - for (HistoryBlock::Items::const_iterator j = (*i)->items.cbegin(), en = (*i)->items.cend(); j != en; ++j) { - if ((*j)->id > 0) { - return (*j)->id; + for_const (const HistoryBlock *block, blocks) { + for_const (const HistoryItem *item, block->items) { + if (item->id > 0) { + return item->id; } } } @@ -2474,9 +2492,9 @@ MsgId History::minMsgId() const { } MsgId History::maxMsgId() const { - for (Blocks::const_iterator i = blocks.cend(), e = blocks.cbegin(); i != e;) { + for (auto i = blocks.cend(), e = blocks.cbegin(); i != e;) { --i; - for (HistoryBlock::Items::const_iterator j = (*i)->items.cend(), en = (*i)->items.cbegin(); j != en;) { + for (auto j = (*i)->items.cend(), en = (*i)->items.cbegin(); j != en;) { --j; if ((*j)->id > 0) { return (*j)->id; @@ -2547,14 +2565,7 @@ void History::clear(bool leaveItems) { if (App::wnd() && !App::quitting()) App::wnd()->mediaOverviewUpdated(peer, MediaOverviewType(i)); } } - Blocks lst = blocks; - blocks.clear(); - for (Blocks::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { - if (leaveItems) { - (*i)->clear(true); - } - delete *i; - } + clearBlocks(leaveItems); if (leaveItems) { lastKeyboardInited = false; } else { @@ -2574,6 +2585,21 @@ void History::clear(bool leaveItems) { if (leaveItems && App::main()) App::main()->historyCleared(this); } +void History::clearBlocks(bool leaveItems) { + Blocks lst; + std::swap(lst, blocks); + for_const (HistoryBlock *block, lst) { + if (leaveItems) { + block->clear(true); + } + delete block; + } +} + +void History::clearOnDestroy() { + clearBlocks(false); +} + QPair History::adjustByPosInChatsList(DialogsIndexed &indexed) { int32 movedFrom = _chatListLinks[0]->pos * st::dlgHeight; indexed.adjustByPos(_chatListLinks); @@ -2716,12 +2742,6 @@ void History::blockResized(HistoryBlock *block, int32 dh) { } } -void History::clearUpto(MsgId msgId) { - for (HistoryItem *item = isEmpty() ? 0 : blocks.back()->items.back(); item && (item->id < 0 || item->id >= msgId); item = isEmpty() ? 0 : blocks.back()->items.back()) { - item->destroy(); - } -} - void History::removeBlock(HistoryBlock *block) { int32 i = blocks.indexOf(block), h = block->height; if (i >= 0) { @@ -2741,15 +2761,14 @@ void History::removeBlock(HistoryBlock *block) { } History::~History() { - clear(); + clearOnDestroy(); deleteAndMark(msgDraft); deleteAndMark(editDraft); } int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem) { int32 y = 0; - for (Items::iterator i = items.begin(), e = items.end(); i != e; ++i) { - HistoryItem *item = *i; + for_const (HistoryItem *item , items) { bool updTransform = ytransform && (*ytransform >= item->y) && (*ytransform < item->y + item->height()); if (updTransform) *ytransform -= item->y; item->y = y; @@ -2768,15 +2787,16 @@ int32 HistoryBlock::geomResize(int32 newWidth, int32 *ytransform, const HistoryI } void HistoryBlock::clear(bool leaveItems) { - Items lst = items; - items.clear(); + Items lst; + std::swap(lst, items); + if (leaveItems) { - for (Items::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { - (*i)->detachFast(); + for_const (HistoryItem *item, lst) { + item->detachFast(); } } else { - for (Items::const_iterator i = lst.cbegin(), e = lst.cend(); i != e; ++i) { - delete *i; + for_const (HistoryItem *item, lst) { + delete item; } } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index b76268e1d1..0363da7993 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -238,7 +238,6 @@ public: return blocks.isEmpty(); } void clear(bool leaveItems = false); - void clearUpto(MsgId msgId); void blockResized(HistoryBlock *block, int32 dh); void removeBlock(HistoryBlock *block); @@ -315,7 +314,7 @@ public: void removeNotification(HistoryItem *item) { if (!notifies.isEmpty()) { - for (NotifyQueue::iterator i = notifies.begin(), e = notifies.end(); i != e; ++i) { + for (auto i = notifies.begin(), e = notifies.end(); i != e; ++i) { if ((*i) == item) { notifies.erase(i); break; @@ -429,6 +428,10 @@ public: void changeMsgId(MsgId oldId, MsgId newId); +protected: + + void clearOnDestroy(); + private: ChatListLinksMap _chatListLinks; @@ -438,6 +441,8 @@ private: MediaOverviewIds overviewIds[OverviewCount]; int32 overviewCountData[OverviewCount]; // -1 - not loaded, 0 - all loaded, > 0 - count, but not all loaded + void clearBlocks(bool leaveItems); + friend class HistoryBlock; friend class ChannelHistory; @@ -448,6 +453,8 @@ private: HistoryItem *addMessageGroupAfterPrevToBlock(const MTPDmessageGroup &group, HistoryItem *prev, HistoryBlock *block); HistoryItem *addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem *prev); + History(const History &) = delete; + History &operator=(const History &) = delete; }; class HistoryGroup; @@ -490,6 +497,8 @@ public: void checkJoinedMessage(bool createUnread = false); const QDateTime &maxReadMessageDate(); + ~ChannelHistory(); + private: friend class History; @@ -815,6 +824,9 @@ public: int32 geomResize(int32 newWidth, int32 *ytransform, const HistoryItem *resizedItem); // return new size int32 y, height; History *history; + + HistoryBlock(const HistoryBlock &) = delete; + HistoryBlock &operator=(const HistoryBlock &) = delete; }; class HistoryElem { @@ -1198,9 +1210,6 @@ public: protected: - HistoryItem(const HistoryItem &); - HistoryItem &operator=(const HistoryItem &); - PeerData *_from; History *_history; HistoryBlock *_block; @@ -1208,6 +1217,8 @@ protected: mutable int32 _authorNameVersion; + HistoryItem(const HistoryItem &) = delete; + HistoryItem &operator=(const HistoryItem &) = delete; }; class MessageLink : public ITextLink { diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 5cf498de29..ed7f9deff1 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -36,28 +36,6 @@ T *exchange(T *&ptr) { struct NullType { }; -#if __cplusplus < 199711L -#define TDESKTOP_CUSTOM_NULLPTR -#endif - -#ifdef TDESKTOP_CUSTOM_NULLPTR -class NullPointerClass { -public: - template - operator T*() const { - return 0; - } - template - operator T C::*() const { - return 0; - } - -private: - void operator&() const; -}; -extern NullPointerClass nullptr; -#endif - template class OrderedSet : public QMap { public: @@ -68,6 +46,16 @@ public: }; +// using for_const instead of plain range-based for loop to ensure usage of const_iterator +// it is important for the copy-on-write Qt containers +// if you have "QVector v" then "for (T * const p : v)" will still call QVector::detach(), +// while "for_const(T *p, v)" won't and "for_const(T *&p, v)" won't compile +template +struct ForConstTraits { + typedef const T &ExpressionType; +}; +#define for_const(range_declaration, range_expression) for (range_declaration : static_cast::ExpressionType>(range_expression)) + //typedef unsigned char uchar; // Qt has uchar typedef qint16 int16; typedef quint16 uint16; diff --git a/Telegram/_qtbase_5_5_1_patch.diff b/Telegram/_qtbase_5_5_1_patch.diff index 2fd2db7b50..79677c7981 100644 --- a/Telegram/_qtbase_5_5_1_patch.diff +++ b/Telegram/_qtbase_5_5_1_patch.diff @@ -11456,7 +11456,7 @@ index 1ec33df..45d436c 100644 } return [super performKeyEquivalent:nsevent]; diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp -index da0ba27..9fd21d4 100644 +index da0ba27..3f6388c 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -713,6 +713,9 @@ public: @@ -11546,7 +11546,7 @@ index da0ba27..9fd21d4 100644 private: inline IFileOpenDialog *openFileDialog() const -@@ -1546,6 +1580,55 @@ QList QWindowsNativeOpenFileDialog::dialogResult() const +@@ -1546,6 +1580,57 @@ QList QWindowsNativeOpenFileDialog::dialogResult() const return result; } @@ -11587,13 +11587,15 @@ index da0ba27..9fd21d4 100644 + continue; + + quint64 fullSize = stat.cbSize.QuadPart; -+ result.resize(fullSize); -+ ULONG read = 0; -+ HRESULT r = stream->Read(result.data(), fullSize, &read); -+ if (r == S_FALSE || r == S_OK) -+ return result; ++ if (fullSize <= 64 * 1024 * 1024) { ++ result.resize(fullSize); ++ ULONG read = 0; ++ HRESULT r = stream->Read(result.data(), fullSize, &read); ++ if (r == S_FALSE || r == S_OK) ++ return result; + -+ result.clear(); ++ result.clear(); ++ } + } + } + return result; @@ -11602,7 +11604,7 @@ index da0ba27..9fd21d4 100644 QList QWindowsNativeOpenFileDialog::selectedFiles() const { QList result; -@@ -1609,6 +1692,8 @@ public: +@@ -1609,6 +1694,8 @@ public: virtual QUrl directory() const Q_DECL_OVERRIDE; virtual void selectFile(const QUrl &filename) Q_DECL_OVERRIDE; virtual QList selectedFiles() const Q_DECL_OVERRIDE; @@ -11611,7 +11613,7 @@ index da0ba27..9fd21d4 100644 virtual void setFilter() Q_DECL_OVERRIDE; virtual void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE; virtual QString selectedNameFilter() const Q_DECL_OVERRIDE; -@@ -1702,6 +1787,12 @@ QList QWindowsFileDialogHelper::selectedFiles() const +@@ -1702,6 +1789,12 @@ QList QWindowsFileDialogHelper::selectedFiles() const return m_data.selectedFiles(); } @@ -11624,7 +11626,7 @@ index da0ba27..9fd21d4 100644 void QWindowsFileDialogHelper::setFilter() { qCDebug(lcQpaDialogs) << __FUNCTION__; -@@ -1992,6 +2083,8 @@ public: +@@ -1992,6 +2085,8 @@ public: virtual QUrl directory() const Q_DECL_OVERRIDE; virtual void selectFile(const QUrl &url) Q_DECL_OVERRIDE; virtual QList selectedFiles() const Q_DECL_OVERRIDE; @@ -11633,7 +11635,7 @@ index da0ba27..9fd21d4 100644 virtual void setFilter() Q_DECL_OVERRIDE {} virtual void selectNameFilter(const QString &) Q_DECL_OVERRIDE; virtual QString selectedNameFilter() const Q_DECL_OVERRIDE; -@@ -2035,6 +2128,12 @@ QList QWindowsXpFileDialogHelper::selectedFiles() const +@@ -2035,6 +2130,12 @@ QList QWindowsXpFileDialogHelper::selectedFiles() const return m_data.selectedFiles(); } From 3226c93f885929bb215b4fdc2dca25b0a9aa6a98 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 13:55:27 +0300 Subject: [PATCH 202/316] order by online in supergroups only 200 users max --- Telegram/SourceFiles/profilewidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 6798f27067..c28c5fba1a 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -714,7 +714,7 @@ void ProfileInner::reorderParticipants() { loadProfilePhotos(_lastPreload); } else if (_peerChannel && _peerChannel->isMegagroup() && _peerChannel->amIn() && !_peerChannel->mgInfo->lastParticipants.isEmpty()) { bool needAdmins = true, adminsOutdated = (_peerChannel->mgInfo->lastParticipantsStatus & MegagroupInfo::LastParticipantsAdminsOutdated); - bool orderByOnline = true;// (_peerChannel->count > 0) && (_peerChannel->count <= Global::ChatSizeMax()); + bool orderByOnline = (_peerChannel->count > 0) && (_peerChannel->count <= Global::ChatSizeMax()); _onlineText.clear(); if (_peerChannel->mgInfo->lastParticipants.isEmpty() || (needAdmins && adminsOutdated) || _peerChannel->lastParticipantsCountOutdated()) { From 9e1a6d3d3d017355ee4fb89145d3ed7c1adff12e Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 15:18:12 +0300 Subject: [PATCH 203/316] crash fixed in Title::updateCounter, assertion message added to crash report --- Telegram/SourceFiles/logs.cpp | 4 ++++ Telegram/SourceFiles/logs.h | 1 + Telegram/SourceFiles/pspecific_wnd.cpp | 6 ++++-- Telegram/SourceFiles/types.h | 10 ++++++---- Telegram/SourceFiles/window.cpp | 2 ++ 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 4cc7edd41f..5a1e5d5200 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -1021,4 +1021,8 @@ namespace SignalHandlers { } } + void setAssertionInfo(const QString &info) { + ProcessAnnotations["Assertion"] = info.toUtf8().constData(); + } + } diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 1599ee408a..6e997e4cf7 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -108,5 +108,6 @@ namespace SignalHandlers { void finish(); void setSelfUsername(const QString &username); + void setAssertionInfo(const QString &info); } diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 3dc358887b..898ac1cee8 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -851,8 +851,10 @@ namespace { } else { _psShadowWindows.setColor(_shInactive); } - QTimer::singleShot(0, App::wnd(), SLOT(updateCounter())); - App::wnd()->update(); + 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; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 5cf498de29..a415cb8b8a 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -68,6 +68,9 @@ public: }; +#define qsl(s) QStringLiteral(s) +#define qstr(s) QLatin1String(s, sizeof(s) - 1) + //typedef unsigned char uchar; // Qt has uchar typedef qint16 int16; typedef quint16 uint16; @@ -109,7 +112,9 @@ using std::swap; static volatile int *t_assert_nullptr = 0; inline void t_noop() {} inline void t_assert_fail(const char *message, const char *file, int32 line) { - LOG(("Assertion Failed! %1 %2:%3").arg(message).arg(file).arg(line)); + QString info(qsl("%1 %2:%3").arg(message).arg(file).arg(line)); + LOG(("Assertion Failed! %1 %2:%3").arg(info)); + SignalHandlers::setAssertionInfo(info); *t_assert_nullptr = 0; } #define t_assert_full(condition, message, file, line) ((!(condition)) ? t_assert_fail(message, file, line) : t_noop()) @@ -277,9 +282,6 @@ private: }; -#define qsl(s) QStringLiteral(s) -#define qstr(s) QLatin1String(s, sizeof(s) - 1) - inline QString fromUtf8Safe(const char *str, int32 size = -1) { if (!str || !size) return QString(); if (size < 0) size = int32(strlen(str)); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 66a3a02a11..aef78db088 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -697,6 +697,8 @@ void Window::setupMain(bool anim, const MTPUser *self) { } void Window::updateCounter() { + if (App::quitting()) return; + psUpdateCounter(); title->updateCounter(); } From 1828b14cda7626d8d53f65f2c7d4da84a6955ec9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 21:08:17 +0300 Subject: [PATCH 204/316] checking auth in onViewsIncrement --- Telegram/SourceFiles/mainwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index a6058b3aec..f8c8d7b747 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2166,6 +2166,8 @@ void MainWidget::scheduleViewIncrement(HistoryItem *item) { } void MainWidget::onViewsIncrement() { + if (!App::main() || !MTP::authedId()) return; + for (ViewsIncrement::iterator i = _viewsToIncrement.begin(); i != _viewsToIncrement.cend();) { if (_viewsIncrementRequests.contains(i.key())) { ++i; From 98b0ebcce6188ad2c7f9fe04c21c64b73ff1f4f4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 21:15:31 +0300 Subject: [PATCH 205/316] _inPinnedMsg flag now always is set to false when destroying _pinnedBar --- Telegram/SourceFiles/historywidget.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index c80aec5f41..0ba8554d69 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3606,9 +3606,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _migrated->unreadBar->destroy(); } if (_pinnedBar) { - delete _pinnedBar; - _pinnedBar = nullptr; - _inPinnedMsg = false; + destroyPinnedBar(); } _history = _migrated = 0; updateBotKeyboard(); @@ -6844,9 +6842,7 @@ void HistoryWidget::updatePinnedBar(bool force) { if (_peer && _peer->isMegagroup()) { _peer->asChannel()->mgInfo->pinnedMsgId = 0; } - delete _pinnedBar; - _pinnedBar = nullptr; - _inPinnedMsg = false; + destroyPinnedBar(); resizeEvent(0); update(); } @@ -6894,8 +6890,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { App::api()->requestMessageData(_peer->asChannel(), _pinnedBar->msgId, new ReplyEditMessageDataCallback()); } } else if (_pinnedBar) { - delete _pinnedBar; - _pinnedBar = nullptr; + destroyPinnedBar(); result = true; _scroll.scrollToY(_scroll.scrollTop() - st::replyHeight); resizeEvent(0); @@ -6903,6 +6898,12 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { return result; } +void HistoryWidget::destroyPinnedBar() { + delete _pinnedBar; + _pinnedBar = nullptr; + _inPinnedMsg = false; +} + void HistoryWidget::ReplyEditMessageDataCallback::call(ChannelData *channel, MsgId msgId) const { if (App::main()) { App::main()->messageDataReceived(channel, msgId); From c6437ce8935f66494ab8537ce10313b3f0858b45 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 21:29:20 +0300 Subject: [PATCH 206/316] returned the fake -style=0 arg for QApplication, currently it must not load gtk library itself, see https://github.com/telegramdesktop/tdesktop/issues/1774 --- Telegram/SourceFiles/main.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 571ef6f72a..b79c0f7adb 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -38,14 +38,21 @@ int main(int argc, char *argv[]) { Logs::start(); // must be started before PlatformSpecific is started PlatformSpecific::start(); // must be started before QApplication is created - //QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable - //static const int a_cnt = sizeof(args) / sizeof(args[0]); - //int a_argc = a_cnt + 1; - //char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; + // prepare fake args to disable QT_STYLE_OVERRIDE env variable + // currently this is required in some desktop environments, including Xubuntu 15.10 + // when we don't default style to "none" Qt dynamically loads GTK somehow internally and + // our own GTK dynamic load and usage leads GTK errors and freeze of the current main thread + // we can't disable our own GTK loading because it is required by libappindicator, which + // provides the tray icon for this system, because Qt tray icon is broken there + // see https://github.com/telegramdesktop/tdesktop/issues/1774 + QByteArray args[] = { "-style=0" }; + static const int a_cnt = sizeof(args) / sizeof(args[0]); + int a_argc = a_cnt + 1; + char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; int result = 0; { - Application app(argc, argv); + Application app(a_argc, a_argv); result = app.exec(); } From bc172cf70c6882239cf163b40c654be650fc632f Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 22:38:30 +0300 Subject: [PATCH 207/316] call after sms is optional now --- Telegram/SourceFiles/historywidget.h | 1 + Telegram/SourceFiles/intro/introcode.cpp | 74 ++++++++++++++++------ Telegram/SourceFiles/intro/introcode.h | 6 +- Telegram/SourceFiles/intro/introphone.cpp | 8 ++- Telegram/SourceFiles/intro/introwidget.cpp | 10 +-- Telegram/SourceFiles/intro/introwidget.h | 16 ++++- 6 files changed, 82 insertions(+), 33 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 917eb73018..1ee9fc014b 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -736,6 +736,7 @@ private: PinnedBar *_pinnedBar; void updatePinnedBar(bool force = false); bool pinnedMsgVisibilityUpdated(); + void destroyPinnedBar(); void unpinDone(const MTPUpdates &updates); class ReplyEditMessageDataCallback : public SharedCallback2 { diff --git a/Telegram/SourceFiles/intro/introcode.cpp b/Telegram/SourceFiles/intro/introcode.cpp index 803c1d2649..71ed0bdf27 100644 --- a/Telegram/SourceFiles/intro/introcode.cpp +++ b/Telegram/SourceFiles/intro/introcode.cpp @@ -82,7 +82,7 @@ IntroCode::IntroCode(IntroWidget *parent) : IntroStep(parent) , _noTelegramCodeRequestId(0) , code(this, st::inpIntroCode, lang(lng_code_ph)) , sentRequest(0) -, waitTillCall(intro()->getCallTimeout()) { +, callStatus(intro()->getCallStatus()) { setGeometry(parent->innerRect()); connect(&next, SIGNAL(clicked()), this, SLOT(onSubmitCode())); @@ -93,9 +93,10 @@ IntroCode::IntroCode(IntroWidget *parent) : IntroStep(parent) updateDescText(); - waitTillCall = intro()->getCallTimeout(); if (!intro()->codeByTelegram()) { - callTimer.start(1000); + if (callStatus.type == IntroWidget::CallWaiting) { + callTimer.start(1000); + } } } @@ -106,8 +107,8 @@ void IntroCode::updateDescText() { callTimer.stop(); } else { _noTelegramCode.hide(); - waitTillCall = intro()->getCallTimeout(); - if (!callTimer.isActive()) { + callStatus = intro()->getCallStatus(); + if (callStatus.type == IntroWidget::CallWaiting && !callTimer.isActive()) { callTimer.start(1000); } } @@ -130,15 +131,27 @@ void IntroCode::paintEvent(QPaintEvent *e) { } if (codeByTelegram) { } else { - QString callText = lang(lng_code_calling); - if (waitTillCall >= 3600) { - callText = lng_code_call(lt_minutes, qsl("%1:%2").arg(waitTillCall / 3600).arg((waitTillCall / 60) % 60, 2, 10, QChar('0')), lt_seconds, qsl("%1").arg(waitTillCall % 60, 2, 10, QChar('0'))); - } else if (waitTillCall > 0) { - callText = lng_code_call(lt_minutes, QString::number(waitTillCall / 60), lt_seconds, qsl("%1").arg(waitTillCall % 60, 2, 10, QChar('0'))); - } else if (waitTillCall < 0) { + QString callText; + switch (callStatus.type) { + case IntroWidget::CallWaiting: { + if (callStatus.timeout >= 3600) { + callText = lng_code_call(lt_minutes, qsl("%1:%2").arg(callStatus.timeout / 3600).arg((callStatus.timeout / 60) % 60, 2, 10, QChar('0')), lt_seconds, qsl("%1").arg(callStatus.timeout % 60, 2, 10, QChar('0'))); + } else { + callText = lng_code_call(lt_minutes, QString::number(callStatus.timeout / 60), lt_seconds, qsl("%1").arg(callStatus.timeout % 60, 2, 10, QChar('0'))); + } + } break; + + case IntroWidget::CallCalling: { + callText = lang(lng_code_calling); + } break; + + case IntroWidget::CallCalled: { callText = lang(lng_code_called); + } break; + } + if (!callText.isEmpty()) { + p.drawText(QRect(textRect.left(), code.y() + code.height() + st::introCallSkip, st::introTextSize.width(), st::introErrHeight), callText, style::al_center); } - p.drawText(QRect(textRect.left(), code.y() + code.height() + st::introCallSkip, st::introTextSize.width(), st::introErrHeight), callText, style::al_center); } if (_a_error.animating() || error.length()) { p.setOpacity(a_errorAlpha.current()); @@ -291,16 +304,22 @@ void IntroCode::onInputChange() { } void IntroCode::onSendCall() { - if (!--waitTillCall) { - callTimer.stop(); - MTP::send(MTPauth_ResendCode(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::callDone)); + if (callStatus.type == IntroWidget::CallWaiting) { + if (--callStatus.timeout <= 0) { + callStatus.type = IntroWidget::CallCalling; + callTimer.stop(); + MTP::send(MTPauth_ResendCode(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::callDone)); + } else { + intro()->setCallStatus(callStatus); + } } update(); } -void IntroCode::callDone(const MTPBool &v) { - if (!waitTillCall) { - waitTillCall = -1; +void IntroCode::callDone(const MTPauth_SentCode &v) { + if (callStatus.type == IntroWidget::CallCalling) { + callStatus.type = IntroWidget::CallCalled; + intro()->setCallStatus(callStatus); update(); } } @@ -346,7 +365,24 @@ void IntroCode::onNoTelegramCode() { _noTelegramCodeRequestId = MTP::send(MTPauth_ResendCode(MTP_string(intro()->getPhone()), MTP_string(intro()->getPhoneHash())), rpcDone(&IntroCode::noTelegramCodeDone), rpcFail(&IntroCode::noTelegramCodeFail)); } -void IntroCode::noTelegramCodeDone(const MTPBool &result) { +void IntroCode::noTelegramCodeDone(const MTPauth_SentCode &result) { + if (result.type() != mtpc_auth_sentCode) { + showError(lang(lng_server_error)); + return; + } + + const MTPDauth_sentCode &d(result.c_auth_sentCode()); + switch (d.vtype.type()) { + case mtpc_auth_sentCodeTypeApp: intro()->setCodeByTelegram(true); + case mtpc_auth_sentCodeTypeSms: + case mtpc_auth_sentCodeTypeCall: intro()->setCodeByTelegram(false); + case mtpc_auth_sentCodeTypeFlashCall: LOG(("Error: should not be flashcall!")); break; + } + if (d.has_next_type() && d.vnext_type.type() == mtpc_auth_codeTypeCall) { + intro()->setCallStatus({ IntroWidget::CallWaiting, d.has_timeout() ? d.vtimeout.v : 60 }); + } else { + intro()->setCallStatus({ IntroWidget::CallDisabled, 0 }); + } intro()->setCodeByTelegram(false); updateDescText(); } diff --git a/Telegram/SourceFiles/intro/introcode.h b/Telegram/SourceFiles/intro/introcode.h index def8f28713..682f60105e 100644 --- a/Telegram/SourceFiles/intro/introcode.h +++ b/Telegram/SourceFiles/intro/introcode.h @@ -78,7 +78,7 @@ public slots: private: void showError(const QString &err); - void callDone(const MTPBool &v); + void callDone(const MTPauth_SentCode &v); void gotPassword(const MTPaccount_Password &result); void stopCheck(); @@ -94,14 +94,14 @@ private: mtpRequestId _noTelegramCodeRequestId; QRect textRect; - void noTelegramCodeDone(const MTPBool &result); + void noTelegramCodeDone(const MTPauth_SentCode &result); bool noTelegramCodeFail(const RPCError &result); CodeInput code; QString sentCode; mtpRequestId sentRequest; QTimer callTimer; - int32 waitTillCall; + IntroWidget::CallStatus callStatus; QTimer checkRequest; }; diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index 05cfc240c1..cf1e5f4d3e 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -252,13 +252,15 @@ void IntroPhone::phoneSubmitDone(const MTPauth_SentCode &result) { const MTPDauth_sentCode &d(result.c_auth_sentCode()); switch (d.vtype.type()) { case mtpc_auth_sentCodeTypeApp: intro()->setCodeByTelegram(true); - case mtpc_auth_sentCodeTypeSms: intro()->setCodeByTelegram(false); + case mtpc_auth_sentCodeTypeSms: case mtpc_auth_sentCodeTypeCall: intro()->setCodeByTelegram(false); case mtpc_auth_sentCodeTypeFlashCall: LOG(("Error: should not be flashcall!")); break; } intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), d.is_phone_registered()); - if (d.has_timeout() && d.has_next_type() && d.vnext_type.type() == mtpc_auth_codeTypeCall) { - intro()->setCallTimeout(d.vtimeout.v); + if (d.has_next_type() && d.vnext_type.type() == mtpc_auth_codeTypeCall) { + intro()->setCallStatus({ IntroWidget::CallWaiting, d.has_timeout() ? d.vtimeout.v : 60 }); + } else { + intro()->setCallStatus({ IntroWidget::CallDisabled, 0 }); } intro()->nextStep(new IntroCode(intro())); } diff --git a/Telegram/SourceFiles/intro/introwidget.cpp b/Telegram/SourceFiles/intro/introwidget.cpp index bb5a255550..8c7055b864 100644 --- a/Telegram/SourceFiles/intro/introwidget.cpp +++ b/Telegram/SourceFiles/intro/introwidget.cpp @@ -58,7 +58,7 @@ IntroWidget::IntroWidget(QWidget *parent) : TWidget(parent) , _cacheHideIndex(0) , _cacheShowIndex(0) , _a_show(animation(this, &IntroWidget::step_show)) -, _callTimeout(60) +, _callStatus({ CallDisabled, 0 }) , _registered(false) , _hasRecovery(false) , _codeByTelegram(false) @@ -326,8 +326,8 @@ void IntroWidget::setCodeByTelegram(bool byTelegram) { _codeByTelegram = byTelegram; } -void IntroWidget::setCallTimeout(int32 callTimeout) { - _callTimeout = callTimeout; +void IntroWidget::setCallStatus(const CallStatus &status) { + _callStatus = status; } const QString &IntroWidget::getPhone() const { @@ -342,8 +342,8 @@ const QString &IntroWidget::getCode() const { return _code; } -int32 IntroWidget::getCallTimeout() const { - return _callTimeout; +const IntroWidget::CallStatus &IntroWidget::getCallStatus() const { + return _callStatus; } const QByteArray &IntroWidget::getPwdSalt() const { diff --git a/Telegram/SourceFiles/intro/introwidget.h b/Telegram/SourceFiles/intro/introwidget.h index dc3868e154..66ac6f02c0 100644 --- a/Telegram/SourceFiles/intro/introwidget.h +++ b/Telegram/SourceFiles/intro/introwidget.h @@ -43,9 +43,19 @@ public: QRect innerRect() const; QString currentCountry() const; + enum CallStatusType { + CallWaiting, + CallCalling, + CallCalled, + CallDisabled, + }; + struct CallStatus { + CallStatusType type; + int timeout; + }; void setPhone(const QString &phone, const QString &phone_hash, bool registered); void setCode(const QString &code); - void setCallTimeout(int32 callTimeout); + void setCallStatus(const CallStatus &status); void setPwdSalt(const QByteArray &salt); void setHasRecovery(bool hasRecovery); void setPwdHint(const QString &hint); @@ -54,7 +64,7 @@ public: const QString &getPhone() const; const QString &getPhoneHash() const; const QString &getCode() const; - int32 getCallTimeout() const; + const CallStatus &getCallStatus() const; const QByteArray &getPwdSalt() const; bool getHasRecovery() const; const QString &getPwdHint() const; @@ -116,7 +126,7 @@ private: void pushStep(IntroStep *step, MoveType type); QString _phone, _phone_hash; - int32 _callTimeout; + CallStatus _callStatus; bool _registered; QString _code; From d31c8b36026c2db1839f9c3ba4dcee0820544fb2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 22:53:38 +0300 Subject: [PATCH 208/316] fixed app code and call on login, accent fold better --- Telegram/SourceFiles/gui/text.cpp | 1 + Telegram/SourceFiles/intro/introphone.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 881aeed1c6..000c239bdb 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -4559,6 +4559,7 @@ namespace { case 65359: return QChar(111); case 65363: return QChar(115); case 65367: return QChar(119); + case 1105: return QChar(1077); default: break; } diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index cf1e5f4d3e..810f3fb532 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -251,9 +251,9 @@ void IntroPhone::phoneSubmitDone(const MTPauth_SentCode &result) { const MTPDauth_sentCode &d(result.c_auth_sentCode()); switch (d.vtype.type()) { - case mtpc_auth_sentCodeTypeApp: intro()->setCodeByTelegram(true); + case mtpc_auth_sentCodeTypeApp: intro()->setCodeByTelegram(true); break; case mtpc_auth_sentCodeTypeSms: - case mtpc_auth_sentCodeTypeCall: intro()->setCodeByTelegram(false); + case mtpc_auth_sentCodeTypeCall: intro()->setCodeByTelegram(false); break; case mtpc_auth_sentCodeTypeFlashCall: LOG(("Error: should not be flashcall!")); break; } intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), d.is_phone_registered()); From b3f11e7dffe40e4d4a7a4a5129f0c57dab2d9745 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 16 Mar 2016 00:13:32 +0300 Subject: [PATCH 209/316] crash in pinnedbar fix, assertion info added to crash report, onViewsIncrement() and updateCounter() checks added, returned style fake qt args for Xubuntu 15.10, 0.9.33 stable (Linux only) --- Telegram/SourceFiles/config.h | 4 ++-- Telegram/SourceFiles/historywidget.cpp | 17 +++++++++-------- Telegram/SourceFiles/historywidget.h | 1 + Telegram/SourceFiles/logs.cpp | 4 ++++ Telegram/SourceFiles/logs.h | 1 + Telegram/SourceFiles/main.cpp | 17 ++++++++++++----- Telegram/SourceFiles/mainwidget.cpp | 2 ++ Telegram/SourceFiles/types.h | 10 ++++++---- Telegram/SourceFiles/window.cpp | 2 ++ Telegram/Version | 6 +++--- 10 files changed, 42 insertions(+), 22 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index d8b4814f5b..fd7b7f1f03 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9032; -static const wchar_t *AppVersionStr = L"0.9.32"; +static const int32 AppVersion = 9033; +static const wchar_t *AppVersionStr = L"0.9.33"; static const bool DevVersion = false; //#define BETA_VERSION (9030002ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 07dc36bc75..1b4f4c4ed9 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3606,9 +3606,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _migrated->unreadBar->destroy(); } if (_pinnedBar) { - delete _pinnedBar; - _pinnedBar = nullptr; - _inPinnedMsg = false; + destroyPinnedBar(); } _history = _migrated = 0; updateBotKeyboard(); @@ -6842,9 +6840,7 @@ void HistoryWidget::updatePinnedBar(bool force) { if (_peer && _peer->isMegagroup()) { _peer->asChannel()->mgInfo->pinnedMsgId = 0; } - delete _pinnedBar; - _pinnedBar = nullptr; - _inPinnedMsg = false; + destroyPinnedBar(); resizeEvent(0); update(); } @@ -6892,8 +6888,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { App::api()->requestMessageData(_peer->asChannel(), _pinnedBar->msgId, new ReplyEditMessageDataCallback()); } } else if (_pinnedBar) { - delete _pinnedBar; - _pinnedBar = nullptr; + destroyPinnedBar(); result = true; _scroll.scrollToY(_scroll.scrollTop() - st::replyHeight); resizeEvent(0); @@ -6901,6 +6896,12 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { return result; } +void HistoryWidget::destroyPinnedBar() { + delete _pinnedBar; + _pinnedBar = nullptr; + _inPinnedMsg = false; +} + void HistoryWidget::ReplyEditMessageDataCallback::call(ChannelData *channel, MsgId msgId) const { if (App::main()) { App::main()->messageDataReceived(channel, msgId); diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 917eb73018..1ee9fc014b 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -736,6 +736,7 @@ private: PinnedBar *_pinnedBar; void updatePinnedBar(bool force = false); bool pinnedMsgVisibilityUpdated(); + void destroyPinnedBar(); void unpinDone(const MTPUpdates &updates); class ReplyEditMessageDataCallback : public SharedCallback2 { diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 4cc7edd41f..5a1e5d5200 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -1021,4 +1021,8 @@ namespace SignalHandlers { } } + void setAssertionInfo(const QString &info) { + ProcessAnnotations["Assertion"] = info.toUtf8().constData(); + } + } diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index 1599ee408a..6e997e4cf7 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -108,5 +108,6 @@ namespace SignalHandlers { void finish(); void setSelfUsername(const QString &username); + void setAssertionInfo(const QString &info); } diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 571ef6f72a..b79c0f7adb 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -38,14 +38,21 @@ int main(int argc, char *argv[]) { Logs::start(); // must be started before PlatformSpecific is started PlatformSpecific::start(); // must be started before QApplication is created - //QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable - //static const int a_cnt = sizeof(args) / sizeof(args[0]); - //int a_argc = a_cnt + 1; - //char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; + // prepare fake args to disable QT_STYLE_OVERRIDE env variable + // currently this is required in some desktop environments, including Xubuntu 15.10 + // when we don't default style to "none" Qt dynamically loads GTK somehow internally and + // our own GTK dynamic load and usage leads GTK errors and freeze of the current main thread + // we can't disable our own GTK loading because it is required by libappindicator, which + // provides the tray icon for this system, because Qt tray icon is broken there + // see https://github.com/telegramdesktop/tdesktop/issues/1774 + QByteArray args[] = { "-style=0" }; + static const int a_cnt = sizeof(args) / sizeof(args[0]); + int a_argc = a_cnt + 1; + char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; int result = 0; { - Application app(argc, argv); + Application app(a_argc, a_argv); result = app.exec(); } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 6b51634d3b..1687823598 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2166,6 +2166,8 @@ void MainWidget::scheduleViewIncrement(HistoryItem *item) { } void MainWidget::onViewsIncrement() { + if (!App::main() || !MTP::authedId()) return; + for (ViewsIncrement::iterator i = _viewsToIncrement.begin(); i != _viewsToIncrement.cend();) { if (_viewsIncrementRequests.contains(i.key())) { ++i; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index ed7f9deff1..9adbd6b08a 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -46,6 +46,9 @@ public: }; +#define qsl(s) QStringLiteral(s) +#define qstr(s) QLatin1String(s, sizeof(s) - 1) + // using for_const instead of plain range-based for loop to ensure usage of const_iterator // it is important for the copy-on-write Qt containers // if you have "QVector v" then "for (T * const p : v)" will still call QVector::detach(), @@ -97,7 +100,9 @@ using std::swap; static volatile int *t_assert_nullptr = 0; inline void t_noop() {} inline void t_assert_fail(const char *message, const char *file, int32 line) { - LOG(("Assertion Failed! %1 %2:%3").arg(message).arg(file).arg(line)); + QString info(qsl("%1 %2:%3").arg(message).arg(file).arg(line)); + LOG(("Assertion Failed! %1 %2:%3").arg(info)); + SignalHandlers::setAssertionInfo(info); *t_assert_nullptr = 0; } #define t_assert_full(condition, message, file, line) ((!(condition)) ? t_assert_fail(message, file, line) : t_noop()) @@ -265,9 +270,6 @@ private: }; -#define qsl(s) QStringLiteral(s) -#define qstr(s) QLatin1String(s, sizeof(s) - 1) - inline QString fromUtf8Safe(const char *str, int32 size = -1) { if (!str || !size) return QString(); if (size < 0) size = int32(strlen(str)); diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 66a3a02a11..aef78db088 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -697,6 +697,8 @@ void Window::setupMain(bool anim, const MTPUser *self) { } void Window::updateCounter() { + if (App::quitting()) return; + psUpdateCounter(); title->updateCounter(); } diff --git a/Telegram/Version b/Telegram/Version index 1ad348a09f..f6b6466c7f 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9032 +AppVersion 9033 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.32 -AppVersionStr 0.9.32 +AppVersionStrSmall 0.9.33 +AppVersionStr 0.9.33 DevChannel 0 BetaVersion 0 9030002 From c2f1e95f3f80dbfdf15139fee1d269e6e10641c4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 16 Mar 2016 14:54:37 +0300 Subject: [PATCH 210/316] fixed opening of uncompressed image sent from clipboard, intro refactoring finished --- Telegram/SourceFiles/boxes/stickersetbox.cpp | 8 +- Telegram/SourceFiles/history.cpp | 2 +- Telegram/SourceFiles/historywidget.cpp | 20 ++--- Telegram/SourceFiles/intro/introcode.cpp | 4 +- Telegram/SourceFiles/intro/intropwdcheck.cpp | 6 +- Telegram/SourceFiles/intro/introwidget.h | 4 +- Telegram/SourceFiles/layout.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 53 ++----------- Telegram/SourceFiles/mediaview.cpp | 13 ++-- Telegram/SourceFiles/overviewwidget.cpp | 17 +++-- Telegram/SourceFiles/playerwidget.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 78 +++++++++++++------- Telegram/SourceFiles/structs.h | 18 ++++- 13 files changed, 115 insertions(+), 112 deletions(-) diff --git a/Telegram/SourceFiles/boxes/stickersetbox.cpp b/Telegram/SourceFiles/boxes/stickersetbox.cpp index 65fdd9b32a..b9632b4f8e 100644 --- a/Telegram/SourceFiles/boxes/stickersetbox.cpp +++ b/Telegram/SourceFiles/boxes/stickersetbox.cpp @@ -224,12 +224,8 @@ void StickerSetInner::paintEvent(QPaintEvent *e) { if (doc->status == FileReady) { doc->automaticLoad(0); } - if (doc->sticker()->img->isNull() && doc->loaded() && doc->loaded(true)) { - if (doc->data().isEmpty()) { - doc->sticker()->img = ImagePtr(doc->already()); - } else { - doc->sticker()->img = ImagePtr(doc->data()); - } + if (doc->sticker()->img->isNull() && doc->loaded(DocumentData::FilePathResolveChecked)) { + doc->sticker()->img = doc->data().isEmpty() ? ImagePtr(doc->filepath()) : ImagePtr(doc->data()); } } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index fcf242e6c4..067d97cdbe 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3859,7 +3859,7 @@ void HistoryVideo::updateStatusText(const HistoryItem *parent) const { statusSize = _data->uploadOffset; } else if (_data->loading()) { statusSize = _data->loadOffset(); - } else if (!_data->already().isEmpty()) { + } else if (_data->loaded()) { statusSize = FileStatusSizeLoaded; } else { statusSize = FileStatusSizeReady; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 0ba8554d69..0b8b34fb82 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -657,10 +657,10 @@ void HistoryInner::onDragExec() { mimeData->setData(qsl("application/x-td-forward-pressed"), "1"); } if (lnkDocument) { - QString already = static_cast(textlnkDown().data())->document()->already(true); - if (!already.isEmpty()) { + QString filepath = static_cast(textlnkDown().data())->document()->filepath(DocumentData::FilePathResolveChecked); + if (!filepath.isEmpty()) { QList urls; - urls.push_back(QUrl::fromLocalFile(already)); + urls.push_back(QUrl::fromLocalFile(filepath)); mimeData->setUrls(urls); } } @@ -892,7 +892,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkDocument && lnkDocument->document()->loaded() && lnkDocument->document()->isGifv()) { _menu->addAction(lang(lng_context_save_gif), this, SLOT(saveContextGif()))->setEnabled(true); } - if (lnkDocument && !lnkDocument->document()->already(true).isEmpty()) { + if (lnkDocument && !lnkDocument->document()->filepath(DocumentData::FilePathResolveChecked).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); @@ -976,7 +976,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (doc->isGifv()) { _menu->addAction(lang(lng_context_save_gif), this, SLOT(saveContextGif()))->setEnabled(true); } - if (!doc->already(true).isEmpty()) { + if (!doc->filepath(DocumentData::FilePathResolveChecked).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } _menu->addAction(lang(lng_context_save_file), this, SLOT(saveContextFile()))->setEnabled(true); @@ -1101,17 +1101,19 @@ void HistoryInner::cancelContextDownload() { } void HistoryInner::showContextInFolder() { - QString already; + QString filepath; if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { - already = lnkDocument->document()->already(true); + filepath = lnkDocument->document()->filepath(DocumentData::FilePathResolveChecked); } else if (HistoryItem *item = App::contextItem()) { if (HistoryMedia *media = item->getMedia()) { if (DocumentData *doc = media->getDocument()) { - already = doc->already(true); + filepath = doc->filepath(DocumentData::FilePathResolveChecked); } } } - if (!already.isEmpty()) psShowInFolder(already); + if (!filepath.isEmpty()) { + psShowInFolder(filepath); + } } void HistoryInner::saveContextFile() { diff --git a/Telegram/SourceFiles/intro/introcode.cpp b/Telegram/SourceFiles/intro/introcode.cpp index 71ed0bdf27..225161d2f1 100644 --- a/Telegram/SourceFiles/intro/introcode.cpp +++ b/Telegram/SourceFiles/intro/introcode.cpp @@ -276,7 +276,7 @@ bool IntroCode::codeSubmitFail(const RPCError &error) { return true; } else if (err == "PHONE_NUMBER_UNOCCUPIED") { // success, need to signUp intro()->setCode(sentCode); - intro()->nextStep(new IntroSignup(intro())); + intro()->replaceStep(new IntroSignup(intro())); return true; } else if (err == "SESSION_PASSWORD_NEEDED") { intro()->setCode(sentCode); @@ -338,7 +338,7 @@ void IntroCode::gotPassword(const MTPaccount_Password &result) { intro()->setPwdSalt(qba(d.vcurrent_salt)); intro()->setHasRecovery(mtpIsTrue(d.vhas_recovery)); intro()->setPwdHint(qs(d.vhint)); - intro()->nextStep(new IntroPwdCheck(intro())); + intro()->replaceStep(new IntroPwdCheck(intro())); } break; } } diff --git a/Telegram/SourceFiles/intro/intropwdcheck.cpp b/Telegram/SourceFiles/intro/intropwdcheck.cpp index 3f2a0d5bdd..da5927ec8d 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.cpp +++ b/Telegram/SourceFiles/intro/intropwdcheck.cpp @@ -19,6 +19,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" +#include "intro/intropwdcheck.h" + #include "lang.h" #include "style.h" @@ -27,7 +29,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "application.h" -#include "intro/intropwdcheck.h" +#include "intro/introsignup.h" IntroPwdCheck::IntroPwdCheck(IntroWidget *parent) : IntroStep(parent) , a_errorAlpha(0) @@ -337,7 +339,7 @@ bool IntroPwdCheck::deleteFail(const RPCError &error) { void IntroPwdCheck::deleteDone(const MTPBool &v) { Ui::hideLayer(); - intro()->onBack(); + intro()->replaceStep(new IntroSignup(intro())); } void IntroPwdCheck::onInputChange() { diff --git a/Telegram/SourceFiles/intro/introwidget.h b/Telegram/SourceFiles/intro/introwidget.h index 66ac6f02c0..7aafd5593d 100644 --- a/Telegram/SourceFiles/intro/introwidget.h +++ b/Telegram/SourceFiles/intro/introwidget.h @@ -164,7 +164,9 @@ public: protected: IntroWidget *intro() { - return qobject_cast(parent()); + IntroWidget *result = qobject_cast(parentWidget()); + t_assert(result != nullptr); + return result; } }; diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 31605b763c..b7bfc4ab0b 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -533,7 +533,7 @@ void LayoutOverviewVideo::updateStatusText() const { statusSize = _data->uploadOffset; } else if (_data->loading()) { statusSize = _data->loadOffset(); - } else if (!_data->already().isEmpty()) { + } else if (_data->loaded()) { statusSize = FileStatusSizeLoaded; } else { statusSize = FileStatusSizeReady; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index f8c8d7b747..99d8b1da6f 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1753,24 +1753,9 @@ void MainWidget::audioPlayProgress(const AudioMsgId &audioId) { audioPlayer()->clearStoppedAtStart(audioId); DocumentData *audio = audioId.audio; - QString already = audio->already(true); - if (already.isEmpty() && !audio->data().isEmpty()) { - bool mp3 = (audio->mime == qstr("audio/mp3")); - QString filename = saveFileName(lang(lng_save_audio), mp3 ? qsl("MP3 Audio (*.mp3);;All files (*.*)") : qsl("OGG Opus Audio (*.ogg);;All files (*.*)"), qsl("audio"), mp3 ? qsl(".mp3") : qsl(".ogg"), false); - if (!filename.isEmpty()) { - QFile f(filename); - if (f.open(QIODevice::WriteOnly)) { - if (f.write(audio->data()) == audio->data().size()) { - f.close(); - already = filename; - audio->setLocation(FileLocation(StorageFilePartial, filename)); - Local::writeFileLocation(mediaKey(AudioFileLocation, audio->dc, audio->id), FileLocation(mtpToStorageType(mtpc_storage_filePartial), filename)); - } - } - } - } - if (!already.isEmpty()) { - psOpenFile(already); + QString filepath = audio->filepath(DocumentData::FilePathResolveSaveFromData); + if (!filepath.isEmpty()) { + psOpenFile(filepath); } } @@ -1790,35 +1775,9 @@ void MainWidget::documentPlayProgress(const SongMsgId &songId) { audioPlayer()->clearStoppedAtStart(songId); DocumentData *document = songId.song; - QString already = document->already(true); - if (already.isEmpty() && !document->data().isEmpty()) { - QString name = document->name, filter; - MimeType mimeType = mimeTypeForName(document->mime); - QStringList p = mimeType.globPatterns(); - QString pattern = p.isEmpty() ? QString() : p.front(); - if (name.isEmpty()) { - name = pattern.isEmpty() ? qsl(".unknown") : pattern.replace('*', QString()); - } - if (pattern.isEmpty()) { - filter = QString(); - } else { - filter = mimeType.filterString() + qsl(";;All files (*.*)"); - } - QString filename = saveFileName(lang(lng_save_file), filter, qsl("doc"), name, false); - if (!filename.isEmpty()) { - QFile f(filename); - if (f.open(QIODevice::WriteOnly)) { - if (f.write(document->data()) == document->data().size()) { - f.close(); - already = filename; - document->setLocation(FileLocation(StorageFilePartial, filename)); - Local::writeFileLocation(mediaKey(DocumentFileLocation, document->dc, document->id), FileLocation(mtpToStorageType(mtpc_storage_filePartial), filename)); - } - } - } - } - if (!already.isEmpty()) { - psOpenFile(already); + QString filepath = document->filepath(DocumentData::FilePathResolveSaveFromData); + if (!filepath.isEmpty()) { + psOpenFile(filepath); } } diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 492189aa43..fc1734194c 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -313,7 +313,7 @@ void MediaView::updateControls() { _docRadial.start(_doc->progress()); } } else { - if (_doc->loaded(true)) { + if (_doc->loaded(DocumentData::FilePathResolveChecked)) { _docDownload.hide(); _docSaveAs.moveToLeft(_docRect.x() + 2 * st::mvDocPadding + st::mvDocIconSize, _docRect.y() + st::mvDocPadding + st::mvDocLinksTop); _docSaveAs.show(); @@ -333,7 +333,7 @@ void MediaView::updateControls() { _docCancel.hide(); } - _saveVisible = ((_photo && _photo->loaded()) || (_doc && (_doc->loaded(true) || (!fileShown() && (_photo || _doc))))); + _saveVisible = ((_photo && _photo->loaded()) || (_doc && (_doc->loaded(DocumentData::FilePathResolveChecked) || (!fileShown() && (_photo || _doc))))); _saveNav = myrtlrect(width() - st::mvIconSize.width() * 2, height() - st::mvIconSize.height(), st::mvIconSize.width(), st::mvIconSize.height()); _saveNavIcon = centersprite(_saveNav, st::mvSave); _moreNav = myrtlrect(width() - st::mvIconSize.width(), height() - st::mvIconSize.height(), st::mvIconSize.width(), st::mvIconSize.height()); @@ -394,7 +394,7 @@ void MediaView::updateControls() { void MediaView::updateDropdown() { _btnSaveCancel->setVisible(_doc && _doc->loading()); _btnToMessage->setVisible(_msgid > 0); - _btnShowInFolder->setVisible(_doc && !_doc->already(true).isEmpty()); + _btnShowInFolder->setVisible(_doc && !_doc->filepath(DocumentData::FilePathResolveChecked).isEmpty()); _btnSaveAs->setVisible(true); _btnCopy->setVisible((_doc && fileShown()) || (_photo && _photo->loaded())); _btnForward->setVisible(_canForward); @@ -685,8 +685,11 @@ void MediaView::onSaveCancel() { void MediaView::onShowInFolder() { if (!_doc) return; - QString already(_doc->already(true)); - if (!already.isEmpty()) psShowInFolder(already); + + QString filepath = _doc->filepath(DocumentData::FilePathResolveChecked); + if (!filepath.isEmpty()) { + psShowInFolder(filepath); + } } void MediaView::onForward() { diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 2430d02d5c..67013cf181 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -661,10 +661,10 @@ void OverviewInner::onDragExec() { mimeData->setData(qsl("application/x-td-forward-pressed-link"), "1"); if (lnkDocument) { - QString already = static_cast(textlnkDown().data())->document()->already(true); - if (!already.isEmpty()) { + QString filepath = static_cast(textlnkDown().data())->document()->filepath(DocumentData::FilePathResolveChecked); + if (!filepath.isEmpty()) { QList urls; - urls.push_back(QUrl::fromLocalFile(already)); + urls.push_back(QUrl::fromLocalFile(filepath)); mimeData->setUrls(urls); } } @@ -1275,7 +1275,7 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkDocument && lnkDocument->document()->loading()) { _menu->addAction(lang(lng_context_cancel_download), this, SLOT(cancelContextDownload()))->setEnabled(true); } else { - if (lnkDocument && !lnkDocument->document()->already(true).isEmpty()) { + if (lnkDocument && !lnkDocument->document()->filepath(DocumentData::FilePathResolveChecked).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); @@ -1496,9 +1496,12 @@ void OverviewInner::cancelContextDownload() { } void OverviewInner::showContextInFolder() { - DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - QString already = lnkDocument ? lnkDocument->document()->already(true) : QString(); - if (!already.isEmpty()) psShowInFolder(already); + if (DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data())) { + QString filepath = lnkDocument->document()->filepath(DocumentData::FilePathResolveChecked); + if (!filepath.isEmpty()) { + psShowInFolder(filepath); + } + } } void OverviewInner::saveContextFile() { diff --git a/Telegram/SourceFiles/playerwidget.cpp b/Telegram/SourceFiles/playerwidget.cpp index 1ab72f6c51..eefeb4da01 100644 --- a/Telegram/SourceFiles/playerwidget.cpp +++ b/Telegram/SourceFiles/playerwidget.cpp @@ -324,7 +324,7 @@ void PlayerWidget::preloadNext() { if (next) { if (HistoryDocument *document = static_cast(next->getMedia())) { DocumentData *d = document->getDocument(); - if (!d->loaded(true)) { + if (!d->loaded(DocumentData::FilePathResolveSaveFromDataSilent)) { DocumentOpenLink::doOpen(d, ActionOnLoadNone); } } diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index b1122e5593..ce45404dde 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -787,7 +787,7 @@ bool StickerData::setInstalled() const { return false; } -QString documentSaveFilename(DocumentData *data, bool forceSavingAs = false, const QString already = QString(), const QDir &dir = QDir()) { +QString documentSaveFilename(const DocumentData *data, bool forceSavingAs = false, const QString already = QString(), const QDir &dir = QDir()) { QString name, filter, caption, prefix; MimeType mimeType = mimeTypeForName(data->mime); QStringList p = mimeType.globPatterns(); @@ -914,22 +914,21 @@ void GifOpenLink::onClick(Qt::MouseButton button) const { void DocumentSaveLink::doSave(DocumentData *data, bool forceSavingAs) { if (!data->date) return; - QString already = data->already(true); - bool openWith = !already.isEmpty(); - if (openWith && !forceSavingAs) { + QString filepath = data->filepath(DocumentData::FilePathResolveSaveFromData, forceSavingAs); + if (!filepath.isEmpty() && !forceSavingAs) { QPoint pos(QCursor::pos()); - if (!psShowOpenWithMenu(pos.x(), pos.y(), already)) { - psOpenFile(already, true); + if (!psShowOpenWithMenu(pos.x(), pos.y(), filepath)) { + psOpenFile(filepath, true); } } else { - QFileInfo alreadyInfo(already); - QDir alreadyDir(already.isEmpty() ? QDir() : alreadyInfo.dir()); - QString alreadyName(already.isEmpty() ? QString() : alreadyInfo.fileName()); - QString filename = documentSaveFilename(data, forceSavingAs, alreadyName, alreadyDir); - if (!filename.isEmpty()) { - ActionOnLoad action = already.isEmpty() ? ActionOnLoadNone : ActionOnLoadOpenWith; + QFileInfo fileinfo(filepath); + QDir filedir(filepath.isEmpty() ? QDir() : fileinfo.dir()); + QString filename(filepath.isEmpty() ? QString() : fileinfo.fileName()); + QString newfname = documentSaveFilename(data, forceSavingAs, filename, filedir); + if (!newfname.isEmpty()) { + ActionOnLoad action = filename.isEmpty() ? ActionOnLoadNone : ActionOnLoadOpenWith; FullMsgId actionMsgId = App::hoveredLinkItem() ? App::hoveredLinkItem()->fullId() : (App::contextItem() ? App::contextItem()->fullId() : FullMsgId()); - data->save(filename, action, actionMsgId); + data->save(newfname, action, actionMsgId); } } } @@ -1180,7 +1179,7 @@ void DocumentData::performActionOnLoad() { _actionOnLoad = ActionOnLoadNone; } -bool DocumentData::loaded(bool check) const { +bool DocumentData::loaded(FilePathResolveType type) const { if (loading() && _loader->done()) { if (_loader->fileType() == mtpc_storage_fileUnknown) { _loader->deleteLater(); @@ -1200,7 +1199,7 @@ bool DocumentData::loaded(bool check) const { } notifyLayoutChanged(); } - return !_data.isEmpty() || !already(check).isEmpty(); + return !data().isEmpty() || !filepath(type).isEmpty(); } bool DocumentData::loading() const { @@ -1230,18 +1229,26 @@ bool DocumentData::uploading() const { } void DocumentData::save(const QString &toFile, ActionOnLoad action, const FullMsgId &actionMsgId, LoadFromCloudSetting fromCloud, bool autoLoading) { - if (loaded(true)) { + _actionOnLoad = action; + _actionOnLoadMsgId = actionMsgId; + + if (loaded(FilePathResolveChecked)) { const FileLocation &l(location(true)); if (!toFile.isEmpty()) { if (!_data.isEmpty()) { QFile f(toFile); f.open(QIODevice::WriteOnly); f.write(_data); + f.close(); + + setLocation(FileLocation(StorageFilePartial, toFile)); + Local::writeFileLocation(mediaKey(), FileLocation(mtpToStorageType(mtpc_storage_filePartial), toFile)); } else if (l.accessEnable()) { QFile(l.name()).copy(toFile); l.accessDisable(); } } + performActionOnLoad(); return; } @@ -1253,15 +1260,11 @@ void DocumentData::save(const QString &toFile, ActionOnLoad action, const FullMs } } - _actionOnLoad = action; - _actionOnLoadMsgId = actionMsgId; - if (_loader) { if (fromCloud == LoadFromCloudOrLocal) _loader->permitLoadFromCloud(); } else { status = FileReady; - LocationType type = voice() ? AudioFileLocation : (isVideo() ? VideoFileLocation : DocumentFileLocation); - _loader = new mtpFileLoader(dc, id, access, type, toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); + _loader = new mtpFileLoader(dc, id, access, locationType(), toFile, size, (saveToCache() ? LoadToCacheAsWell : LoadToFileOnly), fromCloud, autoLoading); _loader->connect(_loader, SIGNAL(progress(FileLoader*)), App::main(), SLOT(documentLoadProgress(FileLoader*))); _loader->connect(_loader, SIGNAL(failed(FileLoader*,bool)), App::main(), SLOT(documentLoadFailed(FileLoader*,bool))); _loader->start(); @@ -1312,11 +1315,6 @@ QByteArray documentWaveformEncode5bit(const VoiceWaveform &waveform) { return result; } -QString DocumentData::already(bool check) const { - if (check && _location.name().isEmpty()) return QString(); - return location(check).name(); -} - QByteArray DocumentData::data() const { return _data; } @@ -1334,6 +1332,34 @@ void DocumentData::setLocation(const FileLocation &loc) { } } +QString DocumentData::filepath(FilePathResolveType type, bool forceSavingAs) const { + bool check = (type != FilePathResolveCached); + QString result = (check && _location.name().isEmpty()) ? QString() : location(check).name(); + bool saveFromData = result.isEmpty() && !data().isEmpty(); + if (saveFromData) { + if (type != FilePathResolveSaveFromData && type != FilePathResolveSaveFromDataSilent) { + saveFromData = false; + } else if (type == FilePathResolveSaveFromDataSilent && cAskDownloadPath()) { + saveFromData = false; + } + } + if (saveFromData) { + QString filename = documentSaveFilename(this, forceSavingAs); + if (!filename.isEmpty()) { + QFile f(filename); + if (f.open(QIODevice::WriteOnly)) { + if (f.write(data()) == data().size()) { + f.close(); + const_cast(this)->_location = FileLocation(StorageFilePartial, filename); + Local::writeFileLocation(mediaKey(), _location); + result = filename; + } + } + } + } + return result; +} + ImagePtr DocumentData::makeReplyPreview() { if (replyPreview->isNull() && !thumb->isNull()) { if (thumb->loaded()) { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index a5c5c8a0b9..23616afcdd 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -916,7 +916,13 @@ public: void automaticLoad(const HistoryItem *item); // auto load sticker or video void automaticLoadSettingsChanged(); - bool loaded(bool check = false) const; + enum FilePathResolveType { + FilePathResolveCached, + FilePathResolveChecked, + FilePathResolveSaveFromData, + FilePathResolveSaveFromDataSilent, + }; + bool loaded(FilePathResolveType type = FilePathResolveCached) const; bool loading() const; bool displayLoading() const; void save(const QString &toFile, ActionOnLoad action = ActionOnLoadNone, const FullMsgId &actionMsgId = FullMsgId(), LoadFromCloudSetting fromCloud = LoadFromCloudOrLocal, bool autoLoading = false); @@ -925,11 +931,12 @@ public: int32 loadOffset() const; bool uploading() const; - QString already(bool check = false) const; QByteArray data() const; const FileLocation &location(bool check = false) const; void setLocation(const FileLocation &loc); + QString filepath(FilePathResolveType type = FilePathResolveCached, bool forceSavingAs = false) const; + bool saveToCache() const; void performActionOnLoad(); @@ -1007,8 +1014,7 @@ public: int32 md5[8]; MediaKey mediaKey() const { - LocationType t = isVideo() ? VideoFileLocation : (voice() ? AudioFileLocation : DocumentFileLocation); - return ::mediaKey(t, dc, id); + return ::mediaKey(locationType(), dc, id); } private: @@ -1018,6 +1024,10 @@ private: DocumentAdditionalData *_additional; int32 _duration; + LocationType locationType() const { + return voice() ? AudioFileLocation : (isVideo() ? VideoFileLocation : DocumentFileLocation); + } + ActionOnLoad _actionOnLoad; FullMsgId _actionOnLoadMsgId; mutable mtpFileLoader *_loader; From c8f2f6bc2bd784925d90722d90c4302c47b05382 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 16 Mar 2016 15:45:54 +0300 Subject: [PATCH 211/316] fixed duplicates in mentions list with inline bots, fixed bot command autocompletes that start with a digit --- Telegram/SourceFiles/dropdown.cpp | 16 ++++++++++++++++ Telegram/SourceFiles/gui/flattextarea.cpp | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 87d4501962..5a4823d1ce 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4353,6 +4353,18 @@ bool MentionsDropdown::clearFilteredBotCommands() { return true; } +namespace { + template + inline int indexOfInFirstN(const T &v, const U &elem, int last) { + for (auto b = v.cbegin(), i = b, e = b + qMax(v.size(), last); i != e; ++i) { + if (*i == elem) { + return (i - b); + } + } + return -1; + } +} + void MentionsDropdown::updateFiltered(bool resetScroll) { int32 now = unixtime(), recentInlineBots = 0; MentionRows mrows; @@ -4413,6 +4425,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { UserData *user = i.key(); if (user->username.isEmpty()) continue; if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; + if (indexOfInFirstN(mrows, user, recentInlineBots) >= 0) continue; ordered.insertMulti(App::onlineForSort(user, now), user); } } @@ -4420,6 +4433,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { UserData *user = *i; if (user->username.isEmpty()) continue; if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; + if (indexOfInFirstN(mrows, user, recentInlineBots) >= 0) continue; mrows.push_back(user); if (!ordered.isEmpty()) { ordered.remove(App::onlineForSort(user, now), user); @@ -4441,6 +4455,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { UserData *user = *i; if (user->username.isEmpty()) continue; if (_filter.size() > 1 && (!user->username.startsWith(_filter.midRef(1), Qt::CaseInsensitive) || user->username.size() + 1 == _filter.size())) continue; + if (indexOfInFirstN(mrows, user, recentInlineBots) >= 0) continue; mrows.push_back(user); } } @@ -4546,6 +4561,7 @@ void MentionsDropdown::rowsUpdated(const MentionRows &mrows, const HashtagRows & _scroll.show(); } recount(resetScroll); + update(); if (hidden) { hide(); showStart(); diff --git a/Telegram/SourceFiles/gui/flattextarea.cpp b/Telegram/SourceFiles/gui/flattextarea.cpp index 87573907e5..2cd77e2004 100644 --- a/Telegram/SourceFiles/gui/flattextarea.cpp +++ b/Telegram/SourceFiles/gui/flattextarea.cpp @@ -392,7 +392,7 @@ void FlatTextarea::onMentionHashtagOrBotCommandInsert(QString str) { QString t(fr.text()); for (int i = pos - p; i > 0; --i) { if (t.at(i - 1) == '@' || t.at(i - 1) == '#' || t.at(i - 1) == '/') { - if ((i == pos - p || t.at(i).isLetter() || t.at(i - 1) == '#') && (i < 2 || !(t.at(i - 2).isLetterOrNumber() || t.at(i - 2) == '_'))) { + if ((i == pos - p || (t.at(i - 1) == '/' ? t.at(i).isLetterOrNumber() : t.at(i).isLetter()) || t.at(i - 1) == '#') && (i < 2 || !(t.at(i - 2).isLetterOrNumber() || t.at(i - 2) == '_'))) { c.setPosition(p + i - 1, QTextCursor::MoveAnchor); int till = p + i; for (; (till < e) && (till - p - i + 1 < str.size()); ++till) { From b9616bdf75ab1221145e8ce39c348654f735083d Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 16 Mar 2016 16:29:44 +0300 Subject: [PATCH 212/316] some crashes fixed, 0.9.34 dev version --- Telegram/SourceFiles/boxes/photosendbox.cpp | 8 ++++---- Telegram/SourceFiles/config.h | 6 +++--- Telegram/SourceFiles/gui/popupmenu.cpp | 2 +- Telegram/SourceFiles/history.cpp | 22 ++++++++++++++------- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 +++++------ Telegram/Version | 8 ++++---- 8 files changed, 38 insertions(+), 30 deletions(-) diff --git a/Telegram/SourceFiles/boxes/photosendbox.cpp b/Telegram/SourceFiles/boxes/photosendbox.cpp index 9ef73bebd5..487e2d5378 100644 --- a/Telegram/SourceFiles/boxes/photosendbox.cpp +++ b/Telegram/SourceFiles/boxes/photosendbox.cpp @@ -69,8 +69,8 @@ PhotoSendBox::PhotoSendBox(const FileLoadResultPtr &file) : AbstractBox(st::boxW if (_animated) { int32 limitW = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); int32 limitH = st::confirmMaxHeight; - maxW = dimensions.width(); - maxH = dimensions.height(); + maxW = qMax(dimensions.width(), 1); + maxH = qMax(dimensions.height(), 1); if (maxW * limitH > maxH * limitW) { if (maxW < limitW) { maxH = maxH * limitW / maxW; @@ -446,8 +446,8 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth) if (_animated) { int32 limitW = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right(); int32 limitH = st::confirmMaxHeight; - maxW = dimensions.width(); - maxH = dimensions.height(); + maxW = qMax(dimensions.width(), 1); + maxH = qMax(dimensions.height(), 1); if (maxW * limitH > maxH * limitW) { if (maxW < limitW) { maxH = maxH * limitW / maxW; diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index fd7b7f1f03..e52f185726 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9033; -static const wchar_t *AppVersionStr = L"0.9.33"; -static const bool DevVersion = false; +static const int32 AppVersion = 9034; +static const wchar_t *AppVersionStr = L"0.9.34"; +static const bool DevVersion = true; //#define BETA_VERSION (9030002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/SourceFiles/gui/popupmenu.cpp b/Telegram/SourceFiles/gui/popupmenu.cpp index 38c2d90566..d78746c874 100644 --- a/Telegram/SourceFiles/gui/popupmenu.cpp +++ b/Telegram/SourceFiles/gui/popupmenu.cpp @@ -561,7 +561,7 @@ void PopupTooltip::onShow() { } void PopupTooltip::onWndActiveChanged() { - if (!App::wnd()->windowHandle()->isActive()) { + if (!App::wnd() || !App::wnd()->windowHandle() || !App::wnd()->windowHandle()->isActive()) { PopupTooltip::Hide(); } } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 067d97cdbe..846ae6e762 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1118,7 +1118,9 @@ bool DialogsList::del(const PeerId &peerId, DialogRow *replacedBy) { if (i == rowByPeer.cend()) return false; DialogRow *row = i.value(); - emit App::main()->dialogRowReplaced(row, replacedBy); + if (App::main()) { + emit App::main()->dialogRowReplaced(row, replacedBy); + } if (row == current) { current = row->next; @@ -6179,7 +6181,7 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id, , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _media(0) { +, _media(nullptr) { UserData *fwdViaBot = fwd->viaBot(); int32 viaBotId = fwdViaBot ? peerToUser(fwdViaBot->id) : 0; int32 fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1); @@ -6197,7 +6199,7 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id, , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) - , _media(0) { + , _media(nullptr) { create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); setText(msg, entities); @@ -6208,7 +6210,7 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _media(0) { +, _media(nullptr) { create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); initMediaFromDocument(doc, caption); @@ -6220,7 +6222,7 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_ , _text(st::msgMinWidth) , _textWidth(0) , _textHeight(0) -, _media(0) { +, _media(nullptr) { create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); _media = new HistoryPhoto(photo, caption, this); @@ -6516,8 +6518,10 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media) { bool mediaWasDisplayed = false; if (_media) { mediaWasDisplayed = _media->isDisplayed(); + + _media->unregItem(this); delete _media; - _media = 0; + _media = nullptr; } QString t; initMedia(media, t); @@ -7504,6 +7508,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); } text = isPost() ? lang(lng_action_changed_photo_channel) : lng_action_changed_photo(lt_from, from); } break; @@ -7879,7 +7884,10 @@ HistoryServiceMsg::~HistoryServiceMsg() { App::historyUnregDependency(this, pinned->msg); } } - deleteAndMark(_media); + if (_media) { + _media->unregItem(this); + deleteAndMark(_media); + } } HistoryDateMsg::HistoryDateMsg(History *history, HistoryBlock *block, const QDate &date) : diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index ccbf8be3b3..9b9e5021ac 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.32 + 0.9.34 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index a798dcff0d..561c9685c3 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,32,0 - PRODUCTVERSION 0,9,32,0 + FILEVERSION 0,9,34,0 + PRODUCTVERSION 0,9,34,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.32.0" + VALUE "FileVersion", "0.9.34.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.32.0" + VALUE "ProductVersion", "0.9.34.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index ae8d312aa8..0596a0e839 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1726,7 +1726,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.32; + CURRENT_PROJECT_VERSION = 0.9.34; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1745,7 +1745,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.32; + CURRENT_PROJECT_VERSION = 0.9.34; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1774,10 +1774,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.32; + CURRENT_PROJECT_VERSION = 0.9.34; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.32; + DYLIB_CURRENT_VERSION = 0.9.34; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1915,10 +1915,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.32; + CURRENT_PROJECT_VERSION = 0.9.34; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.32; + DYLIB_CURRENT_VERSION = 0.9.34; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index f6b6466c7f..e08da93b46 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9033 +AppVersion 9034 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.33 -AppVersionStr 0.9.33 -DevChannel 0 +AppVersionStrSmall 0.9.34 +AppVersionStr 0.9.34 +DevChannel 1 BetaVersion 0 9030002 From ddc802c0af522e981c814676c4948c86ec442440 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 17 Mar 2016 12:23:38 +0300 Subject: [PATCH 213/316] top bar search icon added --- .gitignore | 1 + Telegram/Resources/style.txt | 15 +++++++++++++++ Telegram/SourceFiles/art/sprite.png | Bin 181707 -> 182077 bytes Telegram/SourceFiles/art/sprite_200x.png | Bin 247697 -> 248464 bytes Telegram/SourceFiles/mainwidget.cpp | 21 +++++++++++++++++++-- Telegram/SourceFiles/mainwidget.h | 3 +++ 6 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 19c18e0cfb..94b1d353e3 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ *.suo *.sdf *.opensdf +*.opendb /Telegram/*.aps /Win32/ ipch/ diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index df9a6e6156..1e45af88d0 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -975,6 +975,21 @@ topBarBackAlpha: 0.8; topBarBackImg: sprite(65px, 112px, 9px, 16px); topBarBackColor: #005faf; topBarBackFont: font(16px); +topBarSearch: iconedButton(btnDefIconed) { + bgColor: transparent; + overBgColor: transparent; + + icon: sprite(84px, 374px, 18px, 18px); + iconPos: point(13px, 18px); + downIcon: sprite(84px, 374px, 18px, 18px); + downIconPos: point(13px, 18px); + + opacity: 0.22; + overOpacity: 0.36; + + width: 44px; + height: topBarHeight; +} topBarMinPadding: 5px; topBarButton: flatButton(btnDefFlat) { color: btnYesColor; diff --git a/Telegram/SourceFiles/art/sprite.png b/Telegram/SourceFiles/art/sprite.png index 33ee6037f923e9e8912229cd06054c9fb81832d3..86e0fd4ecb0300dd0a0299afadf9c798ad421df8 100644 GIT binary patch delta 16576 zcma*ObyyeC7B)&smvl&XcZW1eNp~Zi(m8Y^Qqqke-QBHpcY}0y^9|>G=ef_le_h~F z*uR-Qd+$~6de@qvNTjy!NI&=>U1RxU$=TT0NO|~}*|>N)*tr-<*;(1RSXlX3*jSlZ z+4$L5`Po^kj$@!8x#E4G15h}a*mzXIK{hUaR^E7I7{33{h%$^2CATRzD=RM_FB3Z- zyD1YVs~HEA5uY(H6Nd>eD;ozZ2NxHINlgum2F(AjE903Fc+vk~k7Z!xh;N2d09S+n z?^W{=vF-VT7&{jyAD<*27cU!|Bo{9`8y_z(hq$De7!R+6c#<(v+3GNDxIn8$fB3u2@n6f56_#8JSvNJ9(FCQfto7r8DG z4vt?Jq11Vg4mK}E?e4GD#YT7O@v)1~YCDg;^>@loh*D~5*drq&wY9ZD@#Q~AT>%AISwi%Q_dz)Ulk@X<8hmQ$3N+Z**x)_E8hkY=0Rd1_F~maaTXm@g zN-8SiE-o%H){yzXez93j=KJblwTpz(6ql52m1o?ZuEq3h>{Vq9MB$5zigsn!I=Q%T zsi~<6)jN55^2gICes6JQrltK7aKLSkUbnzoC-{Bt?65UUKA8s3N9fuXyXE~TH)oSZGW+GI$@bGZC zWLE!#goMrrgY%Gqt(;%Kf&<~uCRbM#zz1`f4WoC31!M@gfg6-DHYUfUQ6PGMtgEH< z$;(Rsz{kf=ch&Z0DjbhDJyy0@w zM$FjR*=1y9O%7+vz>kWHi%s3>p`^bP3mKhasp#19HC4)_2cvNpwOg4 zde5foP4qKY4{}%bD347>(p3zphYEgJDOtE$6S-M=e>u*%3JaCL)^{a#yI5IJkEoFk zR5z0;L9=kQ%-2@DIWS99DBxRgTH%x} z9K|K&5GCUfHTu?^I7Fl4?iiC6T}P~Lf3jZBhmf9WLU6|3qs0o$?;CgY3~f7Ony6q& z(Uhbo+HcX$NiF)O3_7*!Rk)l3f;dcJHq4 z{c=KHQ=e~1C2*p0mPgN-@my>PIu;7tj&@_XoO+P0drg$f5Z9RNjX8QkD2RP)$^yM` zspGQpku_6t=2cJsHDxesuMq632WJel9SN2L^(U2sJOw&UCU#Cs|y4>7@_PrA_J@R1Vry|L8gB$guX*5y5v{WtM)@@VUuwLsEiZ~FU=6=wcchnu~# z50BBOwT@c?D=R1V$wvQa7GP7wiW3GV8DXH}VJW)6QnO55Sw-cOq9ToukX~khkzdb7c2!kuK|#UC2lU83F>P&v{r!Ck z`jDNE@iDdot=p9Jj4@Rvw>91&i9XT#^&c+Z@$bGcb4)*phT^t+0I7+=_h#?qXv&~p zS>v)$qy@b%YyZqCot&Ky>g(-wZ(LclHjj^`OXkZeI!;7!F+BkxVT&7#0uAV=RMpgCGcy%HXAlNI`1o7h4Jk9t1kt&< zD$Z~+2H5=(8eIou`q8M)u^TYBU5=9R$PVb-S;hVuIMy3tlsjDAFj(!|Dr%h=(1Ba_ zzci<$ZS<+En(d*AXEa^vMzeKsH(D`ri!t6PT*<3?sSI_bo7JC7f$vBERbT%T8V(i0 zuudDAuYeH;DI$0MTayDX5s{E5=Z_#}9-gF6@zj4Y*@AupMMXK))$HS=9v&X~g@q<{ z2OnaWjtjsO4GDP%Iv3Q?z}8klYQ;>!(!*b^N)7O%gQrV#UPkRHZm1sfPTjZ;BFEZ0 z9jMLcck3DACkg==c3uuCu@)}Yf(=u_G!}FABh}THjWIk7D}q(O0ue0fKbZwDQ^G!K zI^lMW-?ai=gxAk@c4yy4RHI?y z*+wTDIe~cK^W&|GMj?ya(HPZiU4|_;VNp?0)CYl|2M1QDANa9&&3GgG9Vw70hH&%- z=3I!kntpi-mkF8}H|OZ}7^~XOv9qKbB51y!ut5WuIo{iUIQz2VsmwI`hl`D3NWwR6 z@VkjV5p%SybX&42UQ(_rCUS+8>a671c!I_bo78v1JB|_h2r(rkjD-cE3hZ23L|9l@ zN-C-<^D*Ls!^6LS{*W>-$Yw_Iz8zz8Ge4H3(O?2y6ag2#u|NzyM@W7?rR(Xcyq?|% ze0%^OBP%B7b3EH>mff)ytC?xayo;cBOsb8vC1d)~(>}sbn1Oy3LdemOF+)^J>K!Jv+eSxo<&X7BT%U5uMyzC>vv`_QC7u*rSvvF!{=s( z^hLujnOQ99Yy#EhJtn55mDT3nMBasIucLqf5o)Qrbp?4DhyXr){!B1?e543;DXpzG zoF_JOGkwu-WY+*4=u1pS0?`c&V;Xgm)IJ8}fX^H`n$bqa<^O9WA8e0jDiFubd^Qy$Rnm#ZS3kt;Qm}#YO4EC~cTouUNx7k5RuZC)KckRsPpiSlaP`H<86ftc{Z94|C&lUfGX$ z-HASJ8k5!QuT*UL(s0p6G>$HFhVClnK!jNjp&y?{J_6{Baf6NaAH2hch7=_Ze>VwsE!^odi_b$2~XPRBAZCX>7^E1na z+GxC6D+O+@*9_*5cS7(HRXF;l;rl8}u;n)&L%CjzXf1)=%qF{LV!s;@42hh4>vKLL zacjEE?iUaE#9~f5q>BBgo(}8RA-S7bW;ja}o7;ONzcLhkt0iYLEpD<4uaj3BSJ!WU zqkkT#lf2d}(4mbxG_aPcGZ4qXfzhJRcwY^lIf>!RPxLHJMx154hFT|>i+HSdz4Xrb zEVs&yFgPFyw>)K0sK$nMggH9tw)wuYKd`v7Arh0H3V|q$J}p`|>A?MH9VB4LjdD;SC_t*!Hlio)~rSA`f~&d;Z(Rrgc25^8HX7Z(>nmpeI% z!7DV-duv8>)^hy88`QM{HkQjvIZ%J)^y9>UYDu?_GV7_k%Kjd67f)8*00g@fY<`sc zH}qGmPU59-_eW7#le76&@8=R6uySfPhTt=5>RAvDq7JA_O7SXa+^#)wX=M!!X&)b- z3ZY+5N}c3*=PRQiuAZKmxn5K$24T&YS%=*yUCb>Us*3}CTo7o07WU=a{L~ikq9I=w z5>x2Y zJn5K8F#dh}#tudf(7fsLq@r`dxC1`S%Gw%V$kVxEiEq~2^mkm^Z-=Gypw5RSa4)~@ zrz|cl`~~Hv*iCc*FVaB(c_2tN(I9>1w!uTq|K5XoXP0Ua*D@dJ-Cp}W7($5z-G6Lv zZ~tZro}E>vr>DPS5wj~7#1_xaNJ~xSby$b^`}ePs4k8Hu!6X7Y>Q7R@c@h1VN|~cU z0cil6g?flc)^xdE3oRpK6fML+42k*c%k!PL@V9T@dYkdc)k6RfK9rY#2hlOR<7RKz zvFp)1+u+d9`Mvk{&dztdLvkW}_2&CsNVJGtxH&yti&!`YWQD@ak%`?)B{elkTU#dZ z%e^g@gD_Q&T3K27&)67R3hC5Vpj*kZxAI|5ai6p_)&d%)93to?akkU=?1%sI;iZjm zuS47PFzXxx`Jdv)IitZ~3vLdoM+JoAkQD?m1DG;~yIBw)xU8lt6}^PglLbB4!34y> zfaH&ET2_{#nVDIGYk5%-Lamd60;;5>Bt`Q{J;~*T_WfVHV3A`dmE?kN+ChF?uckNo zcsTfrsue8J+H(c5#{QT6$&Z|lLU^qj|29TG^8hOBa?6545dp+CHD8B*CI@=9>D!am z`GUB{X?GN*7m~}>;>k)@Ak+kz_2|q>mA4iA0ipNK_oi@DO5{<~D33;0>X%PvU{ZB+ zx<=xD5mqNB-{aXK&W$!THL;C(AmgHPKi=&^@+hE@skj5L zmwurQXr7fR8w|lX{lUp@nqGf;M9>aT!a~Gops)*DThn)T%<63xx>L+E z!_l}%ahg8S8!%O~gJIqni@E2R7>L#zXlqqJ*>tFhF|f7VE$8q$m1;E};dZ&cFkXw` zT55kMh%8v=>2dyAs#zlsnJ_aH>C>al`eYx+$HzB4HwX6~(^K%F$C^9sle|0?1%-G> zb_g%HQ&4?CoBU7Ikv)G{;$vcpj*5!Hcout0qt47ffFYN-3{?bJ`u?ElGWyr0_Bmn3 z%kgo&XiT7yE5M?)vZY1yj!tOvgc?uay9bD+BR_}YMt<6;WyHkA))tUYo~yri-_1^2 zp=qu4;(W_3L}t5FJa&F$96a<8PnIIabEtx&7%JItk+6ICE-Gb+YHHF@##M%00l$OD z$GcKTz$L~3iHUtQS>Eq8A-|E_6WQIwCgp#d3+VlAEc-;6ioNqMH6`=wW{2>ElJh@3_1q&j=qK7KrB3+3tT?zRwk~Y{Sw!EC)Cu53n-T>)m=cmPIcJ;P;?5?dYoqdP@$~)Oh z?XvpKU5Ez{gmgK$ARl>=vSvNpU0Z76U8avNs&9jmo>7tJoEqamUR0d z*_sk;t>Vg$H=5_w#9NpK%bf5~Oa4oqB1Dfi2*p4Fq!ueTiLv(eR`-r6ak}m}-7OX2 z2+nqWJ{W2AFz{^`@U}Sd$9~-!Ap+bUpk%x18@a#?GkQDJZn&6uNh!gu+bpC*t+6FM zSY#~`Sk0|C+`gMLu(Y$=LH888;hNa6>=yzVgnsW*G8_#8V+?wHO`Zw#F7zOy(P10R zU7Td-zmGUOX;8+H4~VWvm-3|?0jKS}{mXPirCE_kOh>#sD9+1}6UiB!KzcU(3FZeO zuLp0VsHUkiRYfoBy#a8?%7IUQbc@#f|I*}eD5^4R8w zS8=ZCa-BtwyM~%~Y-MW4NHwRma*1i?+8$=143#lMa2>0QT}*ul>9N*gkQec)q*sKe z9wx&XJHj`aXE#Ga>bzn}99{|Gn>Lsva~^lrO)UeGzv700mA+gMEriOaal2gnWKSDO z2VU-{r>DOtDRsf(>Z0EXkPfD#q&xQG=Y;MF61=t*)ikK)YHeuj(p-v0hw{+tKAi+4 zbguapn5EwR#m5LlpD7Qh^7N>p`BS||7uJvR#A+9s55fcxhjQ}pz|9um(aR7Q&o4EB z09^4<8%RfdvbI3}<+|!Pyksf(3R(-OR)08`Z({hkxMwqu9M&ps92ES+_fu9vWuGny z^dz^U5qU1Z$?@tEw1|iK<#xtZnU!bEHUSqElXDu{o|+W8N>|rBJG-eK4TC*|*mgu@ zqiL2Zo>)kJ9|T;%oOO7*NQI7;w)5B(jxieeqU+EFi&631^x*?&{*KqvFr&<@Qzx?) zheoQWZn*iq5AE47S~#oBn9CaukUZu3`cKBoNd5lMaJ0M1S`4Jus}iAehrtD617lo;g0ISUi5sAnOaA!z^XCrE!H?_b?iQAo8|z(xwG9pNKYz}axD-ee zfZQdB?+`+Jx^}aG(cW;(PzeDIb@l(tu7RHtvR?}^=-i&7-6U8!TKn@we#y8iJ<6mp z!HwqLn#ta-3>Da+HdNZ^;Mq53Ojy$4~L_nv)XI`74 z9)p991Q9B0Vvxs^y9dGe!G0gN>rPB`yS%jI&?Zi+Yk!7+WZ}pKT3f4mo+Ms@7?fD}-S10WuDLutU!=UHc&1oRV0z4I z92YGM-w>9Q69pVz_;3^>CPC%#Z(<3J)xBQ}D2hux9evy_02eXS zA$)1D5SiLP1GqPiqUBbV7BpsFp}FCmht-B>ki4sLYIgeym*#D{h&5Rn!HgrI*nIlX zmLptxem0sDzsqcY1+{T$^>2H7e0;n!M?934mNx8e_@OK|Gdaz~Og1poC3HDm&(JKr zaF=Y+G6f@;mvzEc&Ow?3`5ypjr`gte_piL?iz5@BZ$30J{vY&J2<wKhH6YJ~mW&Wkl z)skKL-6HfWPoCD!xsK0QFsQt(7%PtAv4+ZbJC+D5Pf`uU*VUdi#63W4N;Zf{TreZM zITM#Dkx1q|q2o^zQAvnNjOJF7`CaH03gg?nZf`8Kdb_z)%7~mE+`rmO$NZFxvhcG9 z9rlp_nj{&{5K0wmnZ7>Jtc(06D~wUHa)MEA&hs{*LvYW)U`&QLUF4L6wNwpgR?~I_|*6EUQS{uc5IGGDMW7dt{4!;+0xx0)(cH2C|Mg0$N)I^?i z=##+vg>d@Y^h7Ln)UEW1ogaX7_u77iW{s^jmht%rh~x~kfhw~!1kcfIa#832Ryi%s zX0P4Jjo^U>XOIz^jQDMJ9t`?TNwPQ?SM12sF?rHok>(R~5scm*xm4(dRljn~sgje; zHoa;vt0WdEiV(doISHMBmjaY5L* z^g4${6ZusD6vU;ZEPTQOsS@Z{xYy%>EYuZKc38$_L+K#LqGofgN?KEzV*l5`SK)E}{qkYgtf z!B~-W_*R8`mVSB1D}ChYga>as=tGY#Y;XneEcv=QIF@?RcB!PCW9xpO9UJSYT27Ar z;d0!43i>GF@;iqbw$Znlt5Wx{y?=CW-z`zZ_sKnLacjQH1R_5_pH*0`Voq=15vQ@S zM}~lpS`ww6nRC6Qb4|T;fg8BK*vx`vXdya)YB$ovIRKZO`YQc~rD%D^YD1ju0VcP* zdEeoo`n**ICmdfJv*0u{*HOHUsVm0X2@nWWxMD<`C@^iZF6x<6$E9I4TYs*jf7*_c z*!d?VlA39y*61KM_86n6rp2zXw)-*Z;mn+$nT6%F&IBxkAmp!&jg6U$w)>WM{A_{h z`BF8xGXaKv=BJm7C?i@}+IN$H9}jqz-1gu)4It29wQzVIb{WZ0#KR5YyWw+4wNB^7 z!~6RQ>JH3F;|PBlH{r@Eoz&l(j_U|we!c4bd^l^6ME>0!1Tf`BjwML zQii~N_&&9-s~I`wl!@Z}?JoqJ$+FKeDMl=5He@5k4hp!qD{LnHKY-NK&pJAUS>6{2 z*VordW%auxA;lFHyYY&`Ib~(h2?<#JQTRO`CRbe2R!iQ3cb^2lUK6J)?bthda)Izz z@amI5ovr8ckcSDshif#P89uNJX^;Q2f6VU{s@6DR1k(zx?%Z=#7X$I>(TLUp@+pz~| z!}I_nzP-_3cUeHc7~u}(jQEVLa!n+q4NL&BR|tzW!h*?gLRg0xktLPdUFa($r)t+m zeXh^wd{*mqxtNQ)O4hj;jQh-Lq8oSRsM}yg(a9rwwz$)5?`10B@Z;XYi0)}I5<{Fo zv~s7F_3b;qe9fN?*2D`Sh2QAgr0E=s0s#3=9_epBVTSMlq(L~5rx0jxww`E>QlN>z zh{EGURzNF$n|yZ0bO@i?x54ZJ2hpF5&tLsSve85#k06-8@n?LG)#o99o0F!`nC*;4 zfgk1=j@g+%14UWjZ5Y{}-H%0z4hPAfhquYM7h_#kq3|+HH4pR^@I7gOw;}YIn*#L~ z5)Dp`KLGiuzu;X@^*qZAZ2%d(7)#^js6gTAYTKjN{r&x{iVKSQzXeU7QCgc=4vZIs zWaxZo0QOsVSf8q4Miq%4w9lw)$%x&w1BG3D^kEb24vzAi@BMX&AJtKvi1f#?9 z>*r3=jxWg)FV;q``M?SgmH7)h8(t`|q%Kl33hr}2Z$8Qjp;i3<=AjX}|2qvw;(f+l zvtV=WE_i~g@4m6p)gE%+gdlhxOk_hHj9SrO@~A`p;ew5(rXGs%ojTlemVH>C<`#hK z5InW-t*EUFo@bE$Ssux=#eq1QkaLRx<4MbDyMYLB)(I^DcS$h%=hOOM(kjjKE+ygO zXnM!>%TAWSmsjR9AyOnwYfa+pimyHy;8Z&Qo2rN8#bK~mt;CKeZA86d?ohw!+rOzo zF~-b?%}-T#qF2TnyUgn&*{>SVr+F+Uh!54IJOUY`bNPLete{rFGN_j(U!3)z0grv% zPOs0mB0k_hXa^E!t)xTU|EBIX;H2*>xpxw__18TOTh2RRlQFLDKY)^pncRGnYS4NJ zp&edQLPGuxB~Fas#h+ud8on;{NP{)EHJ@jCoGA`3{ckS%3Q&qZWT6r@%s3+Mue2o7 zH=fUka1MOUEjFyTd>NxO|A25XZG<6%aa;A+y)w`A*eT5Neb@&mDJh)~q1#`dPjR0w zk~&&fY`AGa+H4FOP4LVai0sqy;C`v(O;SUuQ4$a9-_LU%BA+N-=Vpu)27UH7ej2o= zhN=BljZAn9WKr~PhplKHX127E*(n8q<0vrIS|MU2SbKfBjU)y&%XD&*!NEfE}r|C!*k0Zkoxm%|_o#TBxoIdnl%Y(bhU{MTwQ#2t5 zaOKY@AZYi3FdI$hTVo+`TXq~U6=$^Zt-9-D@vZV9E#D9k;qNcJ_6+N-CY?yO4wJm- z1lO4cDewT8HlRaSZ)TE4v4XUK9uh9I_csvJH^?Wm8ZClp%Rjo<^u)i_Z}gj;b9FSh@3l&P1D>;jh_>Sfy3OQ14(9ey+jG~nds+WXnh zch4QiL=Uncio$~Z9VJU}VvN3!PeeZ0Z3cKtFmH!S9^M}Si6Du}ty#4|2BAm(d%JmFQm!0&HoKzS&EW5hts9sxoTpM zl7Jkiio)Lu^k!ZYnirq>_Ac=O&KIfPT-<<-+gywgIG4*Emxr~}QzL%-6)Q*uX@kQ? z2$^@2ew3sbGF&&ZTia~hTW}^iix9fa?>J$f*GB*TWM=7v-GA8%qlVeYF@~^|%H>3+kV+o7}JVn`do{*D%g8e%Jo?EC6C zD$zSsC^$~}k~rxWjQ}I)Oeki8oSAdQ_1V^H_P^9LS1rk5hF1!d!=28C#phFNb$c*3 z1R^b5@|S<|h!PEx$1h)4K5VF6pgO4NYo%ypqKd-g*#lRWsNzZqTAhsItnUyBS(ok> z%4i2&<)`Y0wuoZ0!ZiJq;6&aL|13r~K5&=HCPfYl&Y>OTbyiGkLiS}0MVp7RndLmL zueAVKglH7Ritgn0SuUe3w+5mSCV8L;;YlUh$sm_@5K2<1 zm#I;}EdtPV?lztdCxs6*GNO%$LuG`*>0c1Cff1hM93dM)0LA(Xa!G zW$XY=JZOuzOJjs_T3JyU%*ZOI8>Jv|A~l2R*l}dJ;KfeEdG~D_2Qx!YAh9ckp-Lli zTbHt!8|_=q`+tLY)yw}fTAmOr&YZMu$H@ZU`yKVt>0(@BTrQhc14*w?xe$lQSNpoh zRM%TysySDEACFT$efs33s@A5aHj~mnR`&MSe})}((M-0hel}wSiDDz0jBYNIk>hmb zI+i;g`*a&u2^JJvsW%|1%rHjwU1$=`iAD&{D)R)eq9^x+1qTRs30cFhPB8-6l1d2; zb?uT=%qRcM9Ty4$rlU#0Qijvny677iey` zMdF?DyJZS0D_IRcNz@1tU_LvOy5UXBmpihYnLfq0_u@yL{M;YQOnV*~Z{OS$W9bcWU`1siSt|vJY6|h-K6ZVU44s zr$^-5#m0^VqIHv)xKFenhTdcJTqWUSv!X+?1eCGu35^xs*$( z!P@GR$m`TmSy6bXP1Pn9Rg}fx;Gjd3u3V;I3Rq_bD~`-bkzlDGEP=%I8E>RJjfM|) zCo71UW$4vfOeFKHd0#FTW_liMf>K&_$%>7Ym`pNhv z>oq<8V&$}emV2pa^pVPAAP8dwOtc(ZR^A$vKt@gY^~ni*HrTy}3qBG|Atbz^Z>K8G zaljIoogblntD_w#*lQ49XeOtnc@^{56!rY-Qd5&xQB#YqmfsTRd5@X6tz-A;!}Y@< zUp)}X9G5;3;1B`EJE+UuF&Yt(teYFxgM$O`FyH>TzuZ;P)SSQk+%Ym<|k1ae(pu)fMET8e*`mF1G3B8tRi84dfjJ~^q3 z(rMQ)v}8?LH8jHYOXSYbY%)=!Ih6$Psr}n#GGK_NMlHhtPmxht%2-`p?Roow+ZT88 zmEoU@$<5J%M@9R?!JO~wPLCd zDd;oSt}^b+ot&Kf*Rbk&7$BOwhG)KP&D-TZcIWe*46)&w6t4mH^iaf=6(q6cg$zSY;X4zItFLKVv+(Xf zjboy5Zu~=1uD7A)M>i-&z2++>`KfZGdaymp$s*NtW%8Ho8sh34a74NR72zYicG$Bo zs;a8i9v#3614BVW%xpT5E4lT09s}q;E<26s@dGbU0g(Li^Im$bfcrT;=FAnt)Mi*LQtMsLH~UI*Pw=p*iWE@_ zit~OlYE?V^jiXAkPQ8(s+uRTB?Cg@Tw!N+syjE4YELI!2aKQ??!;Ly>Y{FAht7zIu z)jFK3Fz^KdZZ-o(PyW(D&iTVYN9UoZ zHj~&jAh9B9rJdDQG+VAGFp6F)(5iom@{%o~rl#Welk9x^-kW#LyXJWBR}y!v@S{!1 z&Ns{dJi8y+w0BAJ7g(BpdfF8cc|9npVD{aPl@|6s2I}TqKZy9Ywvj}foa-ksYF#LR zD_{q`mxkK4viuY?GacOmjJNSo^+%-y4lKzki&XVO%S9e=(-#VixY@LWUsDTKiY&E< zeQhIhYahJZ*B(>?A>K%JYminJhW0JA)aG+gZxwMqVbW1Z)G1SGzvzZ1n~t<>NUFwZ z0QyT>mgarr6oc4=mWI`);$^C6jgZ=){~Vl_v>leWjC!1P!LjUJ{s=Cp@_l}|cuT0B zL5P2AND?VfZn;=Ner(D(@=#k`Y=HFq?dZ`-M`y`x%du#-+2hic<4>kC7&Y_q*y#@r z+eQ=xCyt&5L>3j5t~viDCdwzZOW*-H&hMjoM)cKv$0Z_LYQE=dVx92OL^~F(#0fCa z|G*k^`%Q}|`;(DQyTNXSClf4=44IE*X3T|d<~GmCGB<7S#Zk$YFE`j{%^Y4cU)bMz zwng3?FPZCAoBmC7Y%Oo#Imw*-j#_r@)?qE|x$qUG@CzfD*lyl`uwCixws!#pJMx&e z*~~imvFt`|xYNozULF>34ZP2{2Z+6nw%~}}vw6x(*;Wo4+OL^-DywR1vHXyj8x6P6 ze;0F;axj-mOzmlQw6}R&ADG#zsR_cTC^jRAjxTsjf4DRkXVwNgfEYYLw4E}!d>(DS zChP_(BWQqUaBP_&)Fy<*+7?H^uqC5T@ae3Fr1fHuL7=zbKrqzz<}gEx+@|5c+Y32XYzK*}Wa{1=kN$ZIZ;+MTDYwv|YS7EVx@SP40U+ zp~AWyzCOS|i1b{R+f;-oC^JHlUC6>IzMUL?F+CAj?~1iPhOrXVtlR~qLWwjtM` zaqw^?0P2r|EHaFvaKb1LM?c6&t^H9#ELvs8&s3wP2ThnOku-k9)XsVBOEhvro6mXLQlM5DRiC~$0` zW1@yz1;4`~&P&W0RMHSoCEiY8v_Pju8fCh?+Rn%NfJ?^9n~eKBAx-k(0ZfLUCZl;) z?;1qkM_Qb)&GtIGbawa|K=gqJ4+xUWghL~?X+5rAdhuBJn$-4C0X&y1?>nRZOv{^U z99aE^B*s)yMUjT)>aD0>4SpYu}!|qEGQMrb(HSLK2Yb=Fv6+s&diAfR5M|GXbc;_FVoc5>6-`1;GIR;Kxa*@3E=XL^wMre*c+ z`BXU5p5ct$q0Czz!krF8sU_g4#x>Rc>6cdfaKyi}QSrFgcK@v?9k+N zxpTjo!qHz@S=~=ozzHd^B$iaF&x;u;@oB3RdD=kB8W4TH^E-Z_k~8U?9-BKCK0|ci zdgwi*zd|?(>~sfusv9wV+P<&lD(c=Qx~>y;UhYALP^dAs$AamgwF5lVmvobj^57!D zrl!O(D?OWXCpNa8;ca9+#2X&Z-!@n4Go(zS|LUjW=|=hZHdjC4amp{D+TcrF*Yq_O zs{Dny+9)eQnUH}wfxgL;cGk#7Q@QWkob?sFbp$zj5%|IG9>;xZn4B65 zK`X`G(h2oef`qKIGuL174Gb9xS>t`1;23dTq1*dN1stiQhU%)l_*(H4Ple|n!!SMC z$%dMkbJ=J-EB?g8Nzo_%*O^t%E0B%vXdb@Ik@#gn;G+7$VzanU=w*=nWnfrh&)o^#b3@8R6VD$xTb&5!-)ebZ#$M7;cOx#XRY*ZJ7}u{(k2 zbmUqjNva3d1PNTE0Q98B6+5v1tVu{Grf{{6AwD;koDoOXCcr36sw|iGC4Al;H@dB} zCAHw1o5GS)wxa;@>)z%24PH}C>@ZDmWfkCCFlYOPS(~mc0=6Y(W&egb#=zF(UrTHl zTTD?21cwu$o|}osoey|Zz!z<8D}bvs2+Gh5EA)vgK=XHML5}4j*;eT43rI&JQ+nMT z?St(r>I0cVUd9cq&6)(K*({Fu_Lv)l6T6JL#3A%dOk9vd{!8J)zip{2dAo%-b12}u zf2`k~Z?OSp-|HPr6t--y3@h)`A9$lZued0MkNaS5YdTTbh%rYt6-43&fG_AlIUf~Q z%o@k0@f5QyQ*RK?-aTl(6onDr;P3j1Pt__KV@HA*n=lt0Nhi!Ubf3?09qq{V@$mu= zF@RN8Axe#;7T z_zOrob?u4r)-yy@FYO5e&yk1=5BCHad&FP7{8!p!DCZMr;j=`HG%<6|a%oV!5mrnF zEgP1osxnC7$?=pTLf}?pEn9MFO~%{8sI$FDsBWs~UGt`d;fca#9_gSA#1$zpBIf)_ zB$PsMdC6j8-tKC{jiJv*yaN#=BPp5?B0u3D2<3@Oocl}cCSd#$k_$R|k70xh!X>o; zMdqhc%SwA)ZS9rZm4tU>)JU4&8niv8ubPl3`n%Xe-;TbEO?jskWz6%y>a9iVx^M=K zI89YfLz*J5eg5j7Wxa7i4!e!(eGKlKvL(r}LN25vhU)t4iMi?dkhYi}jIg435d3`b zWqK|30~tw7I>2n1y)q>IX;bLU#RX*B7tyaVTM?-V#y^&T62jyuCciuYJvZ(ExbB|y%d zEOczHK_*PW5iii#vXuk=XaAyTC8q=@XcuD1BWB)!FbQ$YiA8EM-YU)C*A&2@W?@;6 zRpP%_WSW|pL4mIW!FNXCb9A2^z7BU(yw3lKT?P3}0#HF&z}JedUfQbP`zhr~v4Ps^ zcfH;~X*QNQ@>?m7|M*aZ+r|nV0|f&`6g>nDeC>&niz^ZQ5A5xM{OIc|3?`>$0GJvv zYS)JKMdHS1WubkPl!T>GNGAm^1pCEr81er1qymMR9#qgU7plJ^F(FJ>VyZ{ps8Tof~6!l78>1zqLtT^M_{@@lC7C_p8Z~NcB9Lu*p9Pv<8$Gvef z@EwlSg4m>_0lwXIOh%lK$onIb|2U=>vA zerD9Em(!}ZNtv7y_IZ!|UlD*T@C5h`RzHBQ|NdrVp#o@Yr>cW~hyd$c0>9v18rY0TK!v?LuK%uBG9-}!7CrZDGdN9-++MbFBsE*)##gR%w63Gveg$7CN`N#W1waU?qhJ{plkPWln5?!A6G z*s^|f6MML6cyznC&*ZroO!p^+r|7EITthR4JVOK4xzvb&UBl9mtJlvJJ4M!d*gQy)%B5pB zVDb3I&qVbPzSG-mL1fl?=}75zPlwR@knI)?ONup1#~rmx$64TIH_V~1Eh)`@hsUmu z2jyQwU8>%{X%k+YuC*pS02KiabGf!Wx6#JfLNZq^9kYZyR7z**{&(I13y^;ADx4<5Q*sUC+z`HJ0ZZDB@k!~^Dk<|nulN;MWN z7_@7UK9a~o#l-#3=t6IT#(%ab`hPVLCI^6h(?pp6XW;d}14cmzQU)5`htvcH2pRCTb@(wtaxm{iu#Avu8$b48@ZRg>V`x}}N@1=mPmVZ)_5 z5^yOAo|W}~SX{|^yg9!pPPqmg+*d*w2x@3LAG*@2+Jt;d#{G(mMTXD!NSVG2r&*74 zu}6FrYl93cUg;H?nLw7H6nGyDR#}Y616VHZNv2${06L#LAN%W_{9F8o{Oe_W7|*N? zInI{w#-5oBnH?BBZx#$|iAQmV-PiFAG0rf~NIG*?)kCy0;Xq;iNcKze`x+vnYiILX zLPp5~sR6M{Jb1@-mXVDrtUYmubJh_8LEGu(<$*Q^g^LHUz`nrGziB)A0~#z?Y<~>^ z`wvNAo}4_BR-#N1mcTeo<#7Y^b@ z;QPcm4(#!z(E7eGq9~&=#t>0|jdNxX!24F{4j6Z1hSe9(>gYrduR)oBFZhEVO|%8D zI8Z%2N!d$Ks1K2AckOBXryAvq1N{n9+W%_XUmw$R1mIL=#yb%(ualeTFy=y5p}lpE z1dyhaNBG}@)uPeYq0VMJ$$m(0$a$PVi;qW6IE50drjt78L9wHn>t&<>*!hqKLK|f3 z&4O%H!4+C-8?*uE4EWOugp)5(aI;V&{io;usqVK?4D87S3f#5$y+-Cly>fgqtvE6@pqx31nl|c!cejX1^d@9{BZIvt)M0~1@yso0`^$p~soRQnb02!%?D9wXY%e0IidZr_P*wR&qDP%=z7#&9$y&^px{k|pR0sr zyhgrNV+soGAze}w%d6NHW{=pE>tNfgCU4d%7*tRw)Drsd4iXzt>YNU6V?SAi|J?IbN`L1yud< zpZ4v TO0r`R;MXTf1&MMo!+`$-cQ`}y delta 16237 zcma+3byOVB6Fv%~!7ag^K#<_U-5~@EPH+p(VqtLxcL^ata19XL-8HzoI|O%!JAA&s z`=0mSzwYiH&TdZ+-Cb4vR6W%-%~5Cr;b`CaV3}k1W8Si{b5io~v9NP-^YHO7QGNh_ zv$FBBeqdu}s;{)>tE;V*uel|{icAi*t1it@Qiwc4e zjj@Tbk+G2}Co>NhhY2$$Cp!nTktr_+GcSh;2Nw^I5f3;>WhH_p!vCk9u`DRO*#D1V z8QC~u8<6@dMNyj{Yo(E4Au9;HaETiUbvv*uaLa_XyF0MQ>A>dOg$f&!0q&kU7?h$& zveh8g?*YWd;*PS}U4IfNP!QznX?6Wjupw{(UD(><;w%9OCSPbdRhdYx-^xM$v1m_C z)!aU^SMJAEF&-AUy%Rc~kz+j^9!^Q+Gr#iO=G);L>GXw1A{6m%(jt}^?2Dy?KTJtZ z7N9g9i*wlMSpyvF^NWjrH#Mc4ZuG{crLn|`2ofzsn>Z<5_uWqv1g&u>7EhAre^{Yz z*pw@0Bve;d=j7p;7$1Mlo#UvY@){8l(I1Kl{;jI183$X-%=p#Q=H$UEeSLlYZ?&_1 zvt^>kCnqPZ1(cFFEk}oq#&cw=s;WlE$2*Re8asg+r%#{yGeY7i(FuO`^z{4+`?LOy z|4)8?#-Be7P5p^On_FA#(1Teqiqa|0$fP9Vg2FIzWs+QS5Qj+qGT?CiuQB=FE2>gwq!fD?{BOi4=W|H+_gT#|ZzcJ?!)0b_1DIN8hd z^M(-sWJkYIjKr^%{vk!xnajqdu$5A7MoS}8%W2Kle-Np(-~5yG>U(O2{gxVy)z zhLUY1dW{w~HZ;P*X|l1j7~#;8qN1GUW+1hyigTEkx@Mf=f`$;|keKz@Nm=9gkbON3 zZg7Cx!8s91_bA0yrjqFN#3(fHw9 zU=zsEsj907cCNLVRVwT1Milg1iGQn{lh@WJW?*2jS*XDX?i5p3k3(0w>=?_Iu>@>v zy38us&4*KrCWf812aWcpi#fTu9WQprjMxRMAL|n6YU?d{_+{^TId--a`^p$-ba0cF zi0M*@k2O8$h5i{iH7DrNrFgp3#I4Iue2*g<{|B$FOWZfD+T8Hvw`zQl1;&WKg7CD> zp(w1ky%{MY!|Ma%S=1nauplFYavKncF;r9kosr=q*G(go^9GbpT$io5B> zB3WnEdm4~r5(0HEPbe@rfW$>!LncrSwSC0F!Z;KjCbBlWB8+`tqjs|h`yG3F>*-5Z zZ=@O1!*^dQ_8lsm`d}Fyj>($B!R^`Wy|G}scms8*y(cl#;xjKw#AIzM>%~(~Ttn70 z(_9wZ-98=R|H#$}3|E}3x}7f8w@HT?b*ok1Xg&Uk^;d|QY6Wt|_LQ-dAp5Hu+N_Er ze~1Y3WHz$3S(P9z<)`^b3b8BOWfg3%_ARF=O!^O@*_Ol_g>jpkrYfqcvI+`ujfM!T z_Pn57=YZQ4Te!=(9Nd}WR#yM=wI!U&`g*T6^efi!G$iNB@4v8j_CHCpE<}64r=E)@ z5LrECbfOsmBAxwNx*QIs4Dc^=;EThvojZH*dR*uWi=Tw;lAJ#H#hVcIYlukIr&dP!CP<# zHZ?UVm(w42YA-RnLgE=l_oU@gWJR71JIT3$DR;QE&w2x%)r&(5!AnfZhHC?X@#M8G z%$1bCJ%Rx#g6O<6X$m{?Z%8d7%!=)Y{tDIPEU7kB6Zqa1g`H^o(RCiUXd;K?kr*<9 z5lR(T^}~{EK@8Q^)ue*1*f51t#3Afo%e6k^A|?!gyK;55+{Bmi+uYooe45~wqYxuN zQb7SDE-ua&I^5Ss#l?kJsD2!>2;qs0jO66x1Z8W_OS-wa$@aDXCypNLR%C-z8CxwN zatv;RW#I#(V_Ac?$13Z@Xa3Ee4gXrKMgbJ*y2JLbSJH(#8*_Rrf?|!{*70$Abe>Jh zd)wv3Wb*RLvTTf|bo8^miH*oXJ%BmJa!9F*oPUCK80WhD2NYo|gzT&=zq>nkQLOv# z2?;Z{MS?6WEM@$Sxw%2qGEoRoIAet5q`dY%4g5k&(<3(BY zxcK-#66c&su%(p$4h&FJQTaA|T&oxuD1l%{L`39h-o*xradK)ZlO9zyPx0&EFZSjd zCvR_I6cm($xys;%2L5qieB8ZRB#2R=#}z23HgEqGV`O|CdLm?%Rqod?RgB0KQS#Nh zzU=(7n%#o`z(J&**bcs(MqR_lTG9zyR2P=AwJA~ci)upSHz3A?&IT_72{R&>+k<$Wo0E@1Q>QD<7qDuACfbViUqId znRj3E(@a*!9&4LPGzPsg4c6*j8ZF6$G4T`L*EZvw7bKp+|KjGUgEYi~k*B$lm`dhp z+Yt9agC_<1MVS2}f-nK5H8^6*>Tsf?J|%^8ePhGY%4!|7I#3$+0s^F%MH<%W8rnPC z+dsa4XUkdu<|zEKTbh9lMrT{?j3)c9C3EBL%@lkLeCsG$+zKp_c-KGRoMu133KySOl#aI5i8D*Etrt zU)$at`rbLzq96DX!31G+EHk;q!NI|cr4s;(TA8S>PGryym41%KEDwWYbSKi*P+V6) zYr~Vxr0l*5)-Fg%G)g<E+$EH`W~Y!3LGX z9}cg<^F+TIlFF2BNGp(OzVEmqOEGdBD*SwZ?yqHG=?oJ zZkMx7W}z9NyLw8wFJvB8WT}r)S^Br3sgvReANdWf)2e#?)YZOmNsB37IBw0c9_}kj zd1$wB`yo_L;94Bw2YSp6*M~|>Zh-u9^{j(SYKeN_)x^QLt7UpJmX%;Ws%Il_iR$+@ zFzl%a7WL}pZrh4w#*s>RTzMxEo7`;e9nnsM?`Ri6*#1#bF}JulGB=m@_3Jxm>&`X%j{?^niC<`2cm$&Ipx;i!B7;+Vn+HeO9fq|y_y82tQ2eFG z8qllz6Jw=M?}e|e%iB*BjT-$$${t+Kx4JC9&WT<`2<$ewU;bL}by5otxk{Vdkr4c0-2jNsFP1p<`HoPj*AK zlY=j@a*vP^0;;r`87=5pzyKVHKh}a5dO$cdG(Ql3uWr7&zPEl(IL(w)@mOaL0yppApWzf2elH$qro(=&}!lZ9v)xFEho|VoE z;Le@o2S-8^D8?-a&_}(_larJAzU^X%hKAzkpcWSwtEs8&iUb_k)H4Q&3Gi@nIh?GD zy?*nCx&~KUM~8ux6^Sqo3-Qelby^x7lNNa~1e3o-=z!p#rA8Ok&!0yNVN!S<{NRx= zSI=+%_V>TuH~s}^5n%@VgGdZLobS$&jdi!J-RO;0)z^<2*`XE?@R-yhSaZ!D9}>ZG z|BUP9u=EZQzrMU<_1nKOQZHc&(A!T=PlLR}Z)U;6R3f%d5+oiV>QKR(x_h1|#wABv z3xUzjZV2U_QHm^;i0oIflEm|KrJ?p&n;J0+LlOsI%!*DaEh5(v^tPXsm2n8uKFP_U zxlXwXrisD`JR|J>VmFcYoZXM<0{O!zXXM@8o#^KL;-c>O#6)AYlY)XmMrvh61w9iJ z>6CNrMqPsDfKsvY&AB%ZxRcE@pE3>d2oLH&x zHi4fegTw8b`qP|lj3Ltqw;U+#lk7=+JU%8VFE(_gt4p$?qC)!d&5nIeSs5D}$}-5z z2qCC5!(iZ{JmMCCi^+9=vm?f%hy_qdxIUj}1lMA^l_jo)BjWc2|8miCne7z8YN-FJ zs9VZcwj_MB!Qyo&#pa>Z@EI>Ku)e%L=?BQLmT1ftu=7(rK=2Y(rG}+ z=a-gZA<$m9UL?=haL1;kfJ`R|T@1siqO!7YcsRGDY1r~U&8hDs5t>bM%% z+8iW`g^xB${f|}$ub?36RhMzQA0iHlRE9rSavv}}OiNAeA1(64`yJL%q@L9BDke6= zvDfb=WIFyPl!p-{fgD1eU7(`~A8svN)cwHa-s=-*UCS7xrHdknrR5u}S+b<~-6FyU zjan`EZG?@Zqod?QXW4l`ZL$`P4jw*H>Qyk8zP8_)DmY0f`8AY;|14qcgXD&X)B3MB zfH>z>+QsQ{!3m_sR_`se$!)aTdaFc~Sff^HV}c*+>m_*!Ls+NqatEC=dD`6CfhieR zW7C1a-j+`%2-~R=v4XX|L&0Kxai+?@l5$mkfgdYl$AbAjDW0EN53c&8iQIu<^YcDZ zB#~O*@S-|8#A|F9q-|}PDKe3oA5?%$uJ`50wCzRqQkijdwS2ev)1B{Bv+>a;Kz%QR z>jY3-hq2K_V8;m6{iu+$Q>$3w#Vgd;(xkY@BOQ*z>8uv3`{rahKZqk-4=Abd9bLSV z+~6^i?4*d{E~-N+zF@JtfW8hl^dxSotA)q78F-2+n>+c0*~l<_K&ohZ3m|aNrL>5? zpT)23iGNj!^Dr9uWoibBo0|k~hhw}Wi1Avq%T{{ru3Z`_@DvAfLd@(L69Aqp%}Dor z&CG7Hm)O|hHx+)SpRe;93>o=b-mg zHha`nF*Mq7u*=xM4Cw(5c()OXSB2-sD)UBm&W2Kh^4#ZjBnTpxXI&?kWZ6(v)FA10 zCJXFdey!G<+R;iQUPmLqQC^{z&k@;H?Q6Jc1t%xN5CI_}z1p_<1qc4roV+|FeIy-1 zZyq3hB$&>^wQnTGjKVeukB3>WHGbnzIEs%e_jfW}sXsINvo4@o_dxmN7E&_RU?x>w z<9K*g=u>Uf)iI*vJBy31t`5@A8_yQVk$HL4b1pGthxt(OY~hQ4zN7km$AJK|-c~Y4 zv0(EA-fZud|BB82YVJDka6fk@Og+kb?7PtG2T!NG`e-k@W_ZU)yr|KwL2{EU-ia<5 zXYwbFqa*e|YJgvTqt>_Xjngu>^KHdt6|>4jG?qFaFwyh={rkF;4m9{u_^gz);VYR$#~vgVsDRUTwR+xx>X5i5%upGKJlE!R=Vp2ExJRDW+|Vsk*tjFOi-CawnjD8wM*yT#&FibRe{j~f zHw21h2>(p6D~9g7*9(xD!|_1OZar|RkCbgE7|#=&$c_Z_k`t4Y0U&p-91%7Fvxl8osf>(_mj6qxfmgAT z@6zJ_++QPke5$UiZcCBMSM<~{8;LCs?@c|9QmkaMVFmHr=`hT zpy{aJfa(d1B^c40cuDh2ux=xCnpHaV5Sf2gSC?{f;$UWG7K*}2Qyetokd>7MnSN|~ zI_rDvuL2_}e6jya?{YHDyVZU9zA`r|9j2biHq^CVPTQhdB+v;G`9oSl0)k(OF-GF> zH53yBV{tt0me9`Fs}rU2AqWr|JirfEUq(k;_^|&yxwi&-orWr<+z`r9Ib`$a*keIS zmWy4W&_ffN-zU?cK-FEaYh1qn^S)$-_gQQEMF&N8QP+oDWImOH@sm`$=kO%8u>JmU`tUR?2l5dvx z$%>bFLR-VabD5{R_78LH-UZQ{hzGLrOh22UE zIdiy0UGCq0hrH;7Yv&7#FOs3JZZt}kTHsvY!sfU7x9@tV$3fQjw`#z=9$nLeyEPJ-UPIU)%iJ)_D@n3i+e^J` z3K~EHv*||gOg+85mG)~L-}l*iqR2?job60|3Ky%{s5bc{oO+WaT8=P)yjIY~SmK0q z&&(9jdpm3a^M|y%e12g}#Ml8i{p;mR0tuL`f(_OF|E5(nB-O)NbF^TXFmY(g3bi}| z2&t@|V0ep)#hM817r1@S8t#iCgjf}MPdlh!JhBIkx^HQ^k%^+luKBVbZd^KRnZrN| z@0lOMRz+Vtq@)rwfy5-J)xr}?`0azfXM3koUmws1f|twdz?++!w)@o??}xQf1zOcM zKNP4WVS15AJYu-GSrf4<#lxMNhZU?GBk~Fun6iR#=sh9`Y0v0&tpo$>Nx>sc&C^3m^$h+y?>8(5MYeCI_d-i zIPuhi92^P{_WGWsEEV{8EqXTL^zwIK=4e4gAkb1Kv&xr+ElG!9LeC0`Wa}Q2*rxdhpCqwlF3B9%% z^Z{|b$}Fw(=TJlB4*D0zO|_&043G&!Nv|s&f7MQ;1X3h_StH>Pkcl|4bjO|l2!;U( zjUhb_dDHuB^JM0|v8mV%)}LzLKWrAcZhw^#PD-;;ud^^7xmWtA@r7T1Wydh#?nH*4 z1;mz0lc3%Wlz^3yp&^iSJ?R0AE{H*yS-*#}Pir0ZZXUOYIzOX+M$Z9Y?22?7y_R31 zdl+)$3MRv-g)*VpfaZ#YXwpZh;2nxZX^ojI?;(ROm&S6N13ZwUBKSAu#JfqsPD0VIM`BU z%F)6bK3vaAPES_?934N{+S+G1t71ZLjvO6=FX0jcT1X6 zPR&s7BSo#M#&J85(F1;-W_HnXCp_4&kX!1(C(;^gK7(Kwf69;KI#I^y{px||gsjtf zniU_1F@Ah@HotGgYV$`@QUMHjSS2SAZEEy)0PP~+3HX`Su2y^J3e5|5l=+UN*5vn! z6QNr(DJl0XGI6PU{aXes31*{P_IS6O8$JtbmGQq`OD?EIvstdd+T_P*)z1wF(=!ns zsZ6Pxo3MR#1cNuGT;Cl=(zBem<_|UDS)J#q;p;3wXo&0)ZjTRSO(7{p4nhuMLq+Ty ziQ3Qy^WUy>c17i*KDdQP7}dNpleWX+yn!P-8@prKFVuQ|p4dV07$lUAPEJHT5Z&FB zWtk4<_4{*R%c*qB+9Xu3P$F~*Uj#wOrDHI1SsBQ|i zgWgypmmv#pR@_BR{cA@6iZ8DUyziI5-@qFtrc^_szp7lYt%%Er!f=>3bd?~ZDarDX zxI`&u>*~Ok{uP)>-(Rb^Q*V)U)mUFj%2#~7FkRRq!|95bQu$WfhI=8ual~|72OA;N z#ldybtg@K!@RCwO#g7tMD7@RN&DLketg@Onb+|QZx&a$a0vmyF{0r2$V zoC!t_qC^(AD8IoxF&xcx@wEmwvKV%NVfoGb6W+WTs6*{*dsi2rUs4G&;AorJPfe?Q(_c$^=;n79A))ObH`s=j2q7Y<8oxzRMlJR zC^!Rq{#2RY#8Ti0gmas40EzGOh8kOoy)iq<4Z(Lq8!I-ZaCnu-w}gI_7rqO2tzLI& zLLMy%$;sA2dOKxoy*)`zy@vZjuh-Ij`9$BJ@K7>FXyL-{M?S)k?mFQM{O*4F&%5v< zk9$gaOCHC~JW9#jw!=M`i=WAsbDLC}24N4^?y zFnn|6(&rl;U!bCJcyGnn_S#Tk^j=qjsfXxTuPq@(ai?*7{eP>Wc-)nd!V)}bEA}q0 z+e!2Ac3SZQt`CX(op>1;qk8?jjJNK4Z_2o{+I&Y~ThZO0^;SJZUzH7)35t$<^-7)C z^OV!pMUcP_5I*Uoc(VWZZ>rFaD|twxbY@?_+G;8`Pl74!=7FL7Mr_k~Z3lBTGUM9X z=X!MFmtPwGX0l@5xw@spiw^JF`r{b$gl|^;y~}}y=~O|>u_e!{Iod*7av|2F~bMf*;SjW@4fPo{OPX9kluOxbYv5*eQ+ zdmPo9i*_5kyN@tv?tJY&?b@jb;n_Dn^}mif^|nnv*W~qK99{bAU*Eg;O_;?c02u%+ zkE-tRY9UYL@nS;caWhuwiGziuM2F(!@fc`5Noal8DmJU+8{Rp0J8C>`p+nMU!rz{~ z>HJ}%!P+m0K}BpHHO3t7TIsh?#&k!8@7=#gDtNL2E*4Tx{bI(*osm4tb(7$!^$71q zL?yS~^23nf*v->*tHI5v1QxJlRjvhR>~Ov0a!k1ER0pwo%^llOaf-4exiQG@Aoz64 z^cubVrv1LxwX}!tvq3ZLjnJK63)&_GyB*wbNW-8#JW;ra_)+(@f zb!-!a8$7HN2)x=LecJEb@Kh;fjnN{fA$Gzj|42$&esZqR79~8#3`qK#F1`s+1~UT1 z)?-;x(RTAyd-0)f=oFLroVFiQ1zdWfDMY-(44BAWSAAD7tun)Q6PYN|IjmKJ@bt$6^K^_UK5%M0&-XtqZn}*(Rzm{`Zr(Q} z7i&sNycq4SCx%}8=)Nm$z0 z{0vRUk+-rcfcvbc2eNLzzJUR>8zP3Vv*HOimZaQA$PuHA;{IdJWx?qu-#@Mbi< zu1$VJW_M__$EOmOCV_E2^yDF0e9*)?K4ye#Esm-)!9>{dg#4y@0W8W8aEAkw7ZGb8 zJh1NUCnyqHbf2cMHU4V)ioE8edB;Wf(kn!oZVbCTg#1e#9dbtqLF8}N1b^Z5Q<)8} zxA; z9>@OvCPx?Kw}g+`22O-PSk@q%8Id2m)~wH5&kDJeGSnieMgp>)F(J#by&6m@I;9boH1{(y@8-if;5wY`EC9mDD5UDbY6!R31)-o-o==_4DvEmLju1@1} z!PlM6-)U;ACnG7*Uv0A)XJ#nbj}QmVaH3f#;{sdE#X#Zfgp1S4UpA^@|D>_|2L@h_ zJU|2jbLV9q9h8h1GFlQI7cwowbAW-2VVUc(3UpnrNW`@*U z-*tUu>Q5Gd`)AgYMbA}UQ)ky1gppvC1QoekZ?KRmQkz&|DC3}8!hfb~_da&Lbe#{Akfhnu6$ zfK)_UhgMIm0-Ea8rQsN{cv813&im8N^`5t9)L>$`l)ir=EUSwl>;uWoMU`&cToH|~ zi{6hzG=q;8w}*Dg3(t2m+@393jdZ~4-!B6M1_n|Er*zmJhs|%HK=Iw{qGLLAHhUL%3$Hrk5U-G34jt@_Daa?FIE9|-po&HLT4#X_j&7Z$*zO!QqP z1V0GJ8Hx{&d$jT51Jo2IeqxYttJT!jrk5~Tyl0bB{`o7^vCvXGIg1|fBA2_q_3WK4 zH4u?d{&}ya{-`puZnD+Gsgw?p1@89P$w;`Xc%J`h4lO4oX@%f3>Z^3*=N1*ACk%9h z>6E`iL*3wEBUr^&Sh&&V3$Mk5KP+^;7{U~>hi*7I*Bwr<(|X!NG9!H2^(H|c421?Q zi?U&xO9bx#f1?tC5m(w~( z+S=N>5)2?ZY+mDX=TudxO>hpCoA&*vvOr~FW}bpMfHn#?U(rJ6=5i11?9T|1$e|EfI~XVq;>&q@|@-ygPfI;a&-=>hplhPCf5uEcM*FZhe0Iy_4cJ z96(h>O%hXI{weqag4XtMwb{dIw26xMX}B5}wFy1*TT276-4TiO6&0ciRyFlY@aB|i zu+R`MTJY@e8Cd!D8!L`$dLlR}mk(E}yx0I}6~=4ZIad!_n0ZbFRtV9G(>@3u3C7(F zu*eafU$>gS^FB`w4f}#`geE@tY=bA&2h)RftD4(wtX=Q8wGJNr;qk0^p8HY#S|PO4 zwdQSiow)%@s8DM!C<$v3j`u~N^e4BT3c>~l%=WvCpNzATzMT&-$kwi;y%muW3-JQb zsF6ZM^yt_e*1M`e()X}FqwjH85YEz&KWbKqF`aGJsLY43!IevmP^pjw46853paI;p1XUh&82W( z?m%7$&O)D&fuWDRD6)7Uo_WCvSxQk>w$HktpafNzb{$h?;_gtP8nV=I8kDiLed%s@ z!um-~oeRZ+2;U`bB=|g%XFf^~`bA=&W2DN8C4u%u#I}Q?+C`~q;IY)=2=H`{R?>3! zZ#|gYeb-;pz{?r924lT>q>NqiQs=$#-*zA_GHK#&@u{n`PH-On0AE9Gy*(^wxKey_ z%DCaVmd;7JUbZhiWt`x`vUE!<=MR%|r4DCu=|2^Y?A)h{a3Z&X8TGmvP-d#D3+$HjU?M33!1HjT`#6bwV=R%%CQ$dNcFDrogf}7GL zW8^AI;E4D7>HfI2Y()Y;sV4}7q#u;o^7XRYPO8Ks(@{XKW$TeG9W~c}Y(atdyNk~9 zV^%PeuoBs=R_uJfeP|RS^c(c`J<_IXlQSO46dpx$x6wdVdhS2Veg?*57OzmYPkS@~ zp-fV9k$Y<>zKc1TYz6(IGX!-bwh_@qLyeLuzVx#)Zaj;gcAfX*T`34_PMU*hLIQad z-BRC*6ZGBp%3m~J4?KGp&g|lb0iPt?w7WDU%gAv{jl`{F}p4INBiN7 z)@n0%#dcl;7&h;jnGshz&{!8a(F+PNK1PRfjB)aF+gRA?SLV*?sNz*n*)de;!i0031- zq;MpVwD`aHKFkiyiyiF=U-mYejbqPMdHzzjeDX;AAT7YakIfw+n+jji^!e$r7s*xK zh5l{xH136Hpen|Ik+3~^b7Nso$0y^^J{o6gWPe&hXHkJX24h?BD62O+TKH})R!O-2 zH@GrO?AC&%x@r4Om=$<@LVU?(Hrom9|01MJ#+epxKZNiO4uan@UZic|31)`VoQDBf z^fH9Ndee+>`p7ki(+BQ1Yr!H97ZXas#`HTOxt4V9H=eNeGstzU(0(Oqrp6r9fU$^$ z1ra3a=Zj{v7iu&&f(Y-gnCFx)sOcUqfp=)HLRN-&gMCwB6xRhuGG@~A zG3s>KLiCTCKby8}8GThf*Zd+e3Vz@L0uXmsGiv?2;?2bar>*qvcLZv}OcCoLu^_{T zNAMshvUbsNK!mmR;Y{=CvJ{BJ%GBbGv_4?$^>OjJ_hm$PV1{FBJq zE?tIac?gVvnWiWsG;+;%ui9H;-D^Ee9Bydxo<<(-@1nWjEs`{T)AzTuyMKZ<0!zzu zX|C%V24F;#4j!GQ31T=`D@{}t&|j^*YKkPE_9SVzR%Kjkwqat2+6lsVDi%d3PItqr zV02jI(szn~Nlkucv@?g)1lG^tLj)K@^J=T16*Nyy(6>&Nmn?_R{R{BDuMj#{{$S=9 z&Vm&RBRdoNUYAp;*3(6|oBmjUFmI}o%YD}3bA`7yOHtX9R$}&pO9diOr`muf=2My$(*~cM zl9Vd?DP>-kK8fE`u(~)>$y(3XF#)bg4ppv zdD)5ItD@P#{n7xIK8DJ=8ibD{X1z$2`Y1I(Y@&*+Z5l^SL?_akxHv`hdi4%In~@-3 zq;8uPBwMN9L5SfG@9Df!!;h+7pUQa139fyg+N8dh^N_=WkJhX0Hk&pt%f$bMP%o{& z2X?NrN&jD@HPIojuRsLm1znpIb(bG1NX-dOJ}Z8i1B5Nz#gG+#NEvNC&@>UNal6-@ z3waG)H1GUoV;G8Hh-j4OX$Sp$NEUrMTmt$z|E=0Y6}6)^!YtCFsUUI+)}WZdP+CY@ z!?a(^{0gzD7jy`tgze_GBY8KisDcd}F)X(hi(k{7v>U`hXMNnXe;F9VyUy+^Pw9~Tu-T~)LD4HH|HSg8 zF`Q;=%q43B11JpW>vT!V!m6rCMAN=v8sv_ATyzOeQjl>43ri|<%9of^oTTMiMu|N{ zeKUM#PwmbE=0F0BLKhBm!N)yxI4&x0`Rklj}TNun;Z9>uQeX-8*N2+?h*!>5q{Z zyAnd>{g{RlKi5R)nVGAJHN?r;IQ%4@ro*-J9Z69A*hps^UF_(}k!$#`j+RK81IK{w zaaR(d?yp4(0e0f)l_9Q#1>k}ZieMn`&ZKNPeBU)6P?PifQKF+Mrtsoins0wZI1%qG9Vy~)9Pvp537Bk3kj)0gT^Q=17+)i>_0ghsS-k^kA-}dojU30?|PRSL%qc=EJH7;CLb)l>Mm@L%6fpndhm&dHI@9Vo62_;W%8g4c#Z^@oHW#9v;gLhh zzANx{I1)y}2u7TM)6#LRw*F0zZtbMxLB>JTmA378fqEAKKIVMFWV0(7(SW8=A8FHZ z-AN$p=`4W;2X&5zerGUKHNXPeowOr_r2ZYg!O zrAp{$sm`0IH+EQQ7WoZV4*L!5Z!pxyD4vepO_*!n`kgAMx z8pHQDRTh|SXX~)x-Z;NKas4JUadUGbEc=4_NkiL5e&FSo4u5Hcgvfk)dZb~@27lo| z4S;9!C$GoeAl*IY|I^_uGqb|+3L_&dA%_`yrTGY^7M8c1@zudx1QAE>M9Y&&XV5F0 zG3+sH1fxwh%W)d8_>#}cw_N_6gWs?~eI##gs`W@T>evtI2J+L3`fi16ee)!B7OdmqDJxV`ci<{=4b50#?P} zYy#yXw(s{}P8!fTeZaEHO0eKUmxUlK>wgbvyax*r0DrJ@mQw*N*j3Thl{Ygp%diWh z*Dlr~Hnv3eWBc%TaBy?cY2+Op9g@NXSX@FX?D?xR7;D3x7p#Q@>&subwqZF;7P1}7 z{}ErCaXFj$FljuqPESW58vFtQi|*fwuLHk0%oYDOEh}$zf|C1Bb{X`a40%xjO7NKn zDHM_SV%XAjRtA`_|LY}&AR!69u>)d4Umw}so^AD?Z4JbwUF{_phFFAH zfcpSHCR_oL zz)kaiE2M1Ob2Syb_u>DqSEcW@oSa;q3qgc_Rw-tP1^T$lH~h%<+bF}a(N}+*B{@Oa zegZ2-=@R1O^;NaC-IXjY_rlvs8xKC{(5~mV?9s#ZTIQ>UaUrOmfOJl zDsNf}tWagMo(e!+SKCph^-W6f11h!Yoymaad7DUzg|IDliv;TgawN;z5F)6)7<#xC z3|(0Hu#+=ZW?sYVJ|@{$H&YR5@U~?WfBcn!$QGYmu3>*_h8y7Z4CC z{*Avyt$h8eKq$wb0D(%QI}6*Dgnrjtnb_VR6<$Qv%Xq0x@#D(fbep2^%H^GKA_uq| zIJNLeUWqcnJi#^EWrTeiVh@%m9{^KQ zwg4R3ruJ06S{x@doSE^3I^n(8Mu0X!0{rvX0EDbfwr#3Y7z=I%1ZQ$&cG$Pz9`<89 zK-tQyB)MTVg#B(1#6zYW3_7W}ljrmZ_9$qaRLOt5p-)~0L|7RIx)hxsC!<@@^ zJ_)`f3x`)62he-gL+Cvnv=My%ZosG=lFPE{4nkzE^_-Dj(Th&8gWk;$<9DR{8aFO^ zM=n7Co(>ZoA35+Qv`pcHF*-1%4^DHI9Uq+5RU!EQO6a4kVdBBDo!6kd&N#vU8+iRa zs42xNJr4UcQ2IG}sc*F}>Hb@R;E4yPl$(6q5&$`_eiP}MSohx@yR-#$Z{HGw2bXUN z-xB}#1)dT7_Wx*L{a-`2JlkC|N@=piMP*Y-*4l_G&*!YQeRHVTe|xAhP(h zA-A*JvskN|+BOKJ*!-t@7nw97TRpLE{-?qNyRK;dSGVLRrXqoq#N{Dom>Wd=BSxgJ z!Lu>3U6BOX(yS2!!;mh%APWRlixBDf(`7W>P~p}wg0Yb4iV!unR{-vRr^>1C+C*Rr zPg{m&!6Ljz0yq+0uDmrk7Va7;YGUk1wx7r^5NDZ1=t}Srs81>^6qGUZ1Y4&O++;K#3zx+U2vUAH`1Sx(yV@Rl?0nKC(lA1AP6K(@yq4)|Q?{zoFE_-VRrlrg~127i&H`V?g6zMJAmdL&X4sGRM2! z&QIRc_EybORf6abW#O0QoL$}$d^A(?JJ=stE=E5Z8-eP(cw;9L6-h%NkuQ5}F>NV1 z;8W81J#HB^5wjB5Wmq%9V*r5^UPI=~@L^lD|MD@w)qkYG zNE}(be(I_w7w)Z7VWgSzvM6Zd;fQ}p!Ao$`NYC#i=-CifoiDoG*0hix48CjCMSKA6 z-s6ut9sFSq!cM_2e>vL|~k#@{O)EO_5 z!(Vt`fwLj3`(<@6;t3c=H$7=@|CE7i<@)~T*HiAiGb0$A9Ew}E|4IoO&R2HRl)U?S ztM#)Hco}yqr`n!fh=F=$RFD{)$P6?lb>VNZ^ZU zBmDAd%`%_1&h`kKe$KweEzTq93x2sENka(dz5hon?z@aDX^}vx4btXImFf^x=+YTtnI56N#R!UK_MBLEt{{ms2u>Jr5 diff --git a/Telegram/SourceFiles/art/sprite_200x.png b/Telegram/SourceFiles/art/sprite_200x.png index d8de7abeb8fa30201cfc75d035d78a0eeada48bd..3c2c54606d01214719da5442ae0e0e7c5d9e63e4 100644 GIT binary patch delta 39287 zcma&NWmr_*8!s#^QV$^=3J45bg3&46uB*@J#`W#&37nI-=izCDq|G%z0!&MhQt#m_BfX<@-_B`#;HFW3{oAiBEQ>y!AMdBk`zNrj9y+@R8&AgNnBWrpI=E>OkPkyPE1r@fKOaZK{>(I z4ucax`vfCC3)|Dmku;%f3xfx9QafyM3j?vZg}JBz&AWcZn+SufKV|8Zv#Pso$4gRA zKF*aBVUSn<{hsU|POL*$th`94)u2ck?|asiJ8HKdyl*6v$8V+9(ZDlzK}C zb`B1U&?y?;zOYN^jdVh|FDF?)d-g20Y|_10C+ikwscW`rgJ^6GC3yoBXBAk7Z74WMNlBCbc{ylj! zv7~)6TT$)a9ZyfspOidWt+cD?u-#wXmZB#|yGj10p~5Cf({E8+T`LWVLBb2i4d7mR zG^Mn3 z2YEG~e$;c;360#Qhj*rKn9uf$947i7Pb05{sqa@2+JERn$&~OMe~3C-yep&tD~rFS z9`vFyBM|ihbNiM-iG;4o=HGB$t>@ySx7aZ(gMQ;qMhY)(a!F zlH3#$ahejlH|H(IXzV?YgOoYnuwYVKgE$IeTtkUjA7{6GYmxN+Z1C9}Ey*d^sVy0g zb6kFUvQ=XwbZ`=8aJkgzF=xT>dZEj0Zm@CfetZ&fEw76o?+%se<->&i0KIZAO9d`L z-iIHY@wu)MdNUgTZf>!|nYlVBe!93b`bSz?`b$E>;P`k_57T$f*pOdvIPw}w{j63k zeepCkheG_MbFI&1*Ecw!sD4`9u=4iEPZm4FDzZuzjmjNN?na#gah-R)c=dSxmK5DS zf-egduU+ObXoGOS)y%qczC8~zY2ORYYx<9rH0FM9l3-YRdU|oGj~5K~%-9$?ZVgW> zDD{DpT#%jc1^buy_D2ZGNVPwL&LJMJ-OFQ%UAz|-{w^?DrWCl`j?k@Wdbj;{>FN93 zL``^8SpGUHgO#qY=bGzYaX%%leLKvWN1ktMh|70Z3`Z~Qh5D_XrpDcqK~f%c&RaO% zwCsD~?hDzscfN5yMRJ*nxX9fT<0jy`-VSmLWJ?x(K@|Go!v{k9{tP891E_*)!`;!* zF&LS|KLSG0;P_AVRJ3WiDD-GbfSrQ=y#8>plUT;c&T|Y#y%X|)N2Y#GuW~14C&g%b zN{7_7@&vE=??=xnCcigETRIGC3-b6o@XMoJyb`vd$%q%6eIYM6T`0ydF7PYa{)71$ zX<_#s|K%gdzt$<5H5>ls58->`+cP&tJ*LjXo58%o%O8KW!`Iy+jG^0jbC6>NdL{30 z2q@nN{Hm%-N-*}thocg{SVG`tHQEK;b+^{(#y{J*tXJ^B${9J2l>`SWt&AmRjgmTj z2BRXghL=hu++}r^q87OW8V_%N;AX9o9tRPeqqx(71o@N@^8nU$;M~@?b2v?t+YFh9 zpTb;SEouFc$efDYF_iW8KFE2NH@(TiJ?YYt8}1+I4TQE1~Z1&>Dcxt7eSMYcAa@u;dLjAZ|8y@>r><;3S2Pk)MS zHZUiS^0*PEU1Jd7zuQYpT&6;wsxb#+;8=LZ_|gQY_{`{eYh}8l93m(3u{eSF$VDF6 z82N(lJMHDFJO2t8vx5j-PP*?SB_$;@I3(-6bI-Zq5;hQj4UVQJ2*dV!bvMducJt4s zB&C4Jh|dWMA!!3s5hm&E2bFMSMU^JucX22KZa$<`@Ge+w`Suq<(cIKS*8+C2L`5ma za?G3PQtbU-IgN$GnT}3BeY#WOFdqBGvcX2d9%(xIxJEzV!rPu|JzpBSxO_|^J2Ma> zc}8h6PUUDbEIe}ZCHDxLA+2X*8g#Qu)CaZnXXGh`=GLplGRRGKXgQ@86sb2tI(?HeOyU{n_yV>eON}GX#w4Mo~d_5IQL583Hh7AzRd}- z5pu(PJ~F6f=-2J)fQM0sLU_|7eC0PCuKLcMJ7W7if+driorXQIg7Nse#+pV%$(g!^ zR0)r$?0+(WY7LzyXS-&-5Z@t)8XP^x!O>f@?X-bIc(rGsfV@XZP_MY}{-icO`)IJ` zyNb>5!!<>qqt&bI2xmH78gnW2E;ulqtaoA1V5Ikm>*2quiO=HF4>c>%={tfgCIj~(eE!zlI9*i_mXFYwB**ppqgQidw#jG{!dlC2$k)b!8bfel{Y`xl(W zcRJY0#-GqS|8i@!ZD3PdyV;3-ODcLbUxOvnw5c$OOuCU=OJFecyh4RvJ^#wQizH)bFHlJ}u z4?j!H?$fJpZuQA;4{`9|kRXds(7%*Xr3SkWpgXbdQ#i)9!bteYaq{=<5WB$Hyl>MJ zp9}p%4guF{JYyuNzBKz612HH5l->m1G$(FkU#v~&i=@9z(+IM=`1V~UkQF119-Ge{ zamh$+#MeW!ePeU+)0wkYT?@V`YXTqGN1&ybSnO;%F(S9r-}rC3Ph|2N zbeD9li;&IUe%6$Z^NVn*o~%+Bc^E+5ac3%!FjxJlIMb~w7MF9`w-A$^+3>$p&5Dxc zJNU0Um_KONcE6R&`=Icgta8RL*vUlh!u`#~y_KUvumSCNPEe@X@}H;w`j6_T%EM5> z3TO(XQbUtn_1zbIRp7$R=C$c{e+I7Lm>ao;$4`N%UdZ+RNoc@k5k~&$v~AEi6P{DF zs}a+pp2`&#Yc>s)9Q+)AE~D}C8n<3-todL2B~{}#!R-R!jx%TFSdlmuRD?TyJxl5x zZGt^rAN$a%hxqTkve31BmZ!)$=&`Hd$Q1Rz%Eit&4|02nJ(DvkOTh>5j$)fm$IaGc z@aUrt3(ttZvG0_UpAfk;7mB9t+J=ND7P5LMW^YH%`QeO4a6x##KK?DY#)K1AL({kM zei`T7GQmfDKKtLfI`xfV`pZO(hHWZ*PpVBC+0M9j`b)>`EoRgRxfLA!b#G)0g*%(` zjC8!I3nX-)YjUf=O2CLdV5DvIYZPoE`1ub~DlR6{7tr4Go4fLRFG57i!HY?PGu;sR z9i7_I4y~CC8kp?}>>TPmM9ZFs6tM@r_}^hLWA(PtN>m`Q_9^FdGf%E$3Eqd!tRKi? z<+pGl#QyWQ!rf|+Ur~I^vbj&c9&FZ<9Pzv0SWP&F43sC*k||sYylF2pVS_G)AIICc z0`Ioy^m;#!92snxG)8H7Y!(Z)WxskKRZvoDJ<<1zM& zmu)-nxdw2DZk?A*EI4C|%=os@gq0nJ9@4uw_Fdux!Ar`-d(275Cg#s78&P_`CC8!v z%cZ@rPhT5{8-F}rOXtE{-T>;cE*&&x!MMSM9r7bhD|U0XpH2oWDr+qx^>noygvH* z>QZr$qPC}m1^2^9NJ^j{_P5(_glG3uijgnB$uzqyyE+(0ejh7VZk(XI_=c$*EAD&n zkcfz=th~H`a8NMY(zVLa!pbT(E>6MNn2{$zT~d{`Yrm?#KE0wsq`IaZMt#=P)AM;> zTu@LK{8v>=EAyOo<4=|YO7=Ixr9PYSHO6NrAQVd!45SquDWGnN602FpE#}$AHS-eL zprwfHaRb_yx)LVXOB>h~?fMUKB3S!oX0#j~xg#SZPcE;rI9|PaMP+1UBqSnogcHS~ zoBj0Jvy3!0fj_5)y1EMB>scBqEiKIh1{>(>>!T9O)<|mp!l7F>7@KPMjco>2v-B$g z*_J#mZcQ<>1qC$HA*K!o!koZ!$?;tLvuIHeH5OCJ@*jPBvrl6tDbKm%-$cEq80G~F zu8!R2$0Upvg98ID5^0%%_unL2jWw1)*MY@kye#5@0eojuNJ=&ZUT|7;V zj~B_aTw7VW?I#0(_;2S~8Dd7Mj*HWMPnmF5?Ml7((6II!p?sRspnruZ|3w^WTx1Y@ zKJ?=>$&_g5l0VnZevn!GB%_k)vqn{s7cX8sfAJzjD*o$NB{?~aICgC|Y3Trs?$P04 zC2MPTZf-!kh35}_F?LS$o?y0eHdLAEJ{C2ck<;qg?nx9JuOwM8azZ0m@ zHdqR}T}hg6(yCX@`kw#~x-!@oRGkGBcyg5Jx*gIkoGoOlQ*xm5G^s}Lk@i=A;vqRx!q zaf8hsrlCOe0oE4JZII3INT34A*m7)~-^-LxWGbv6!IT&(OzuteaiXq}OPf#wRw$+ImgO3G*Y`pE)lcS}pljsylA92_p= zT0Kb^p+<^`rtsZnZm&9_Y^a_6WJM?To`~bS{^9<9Ie>6yF9GnPhynO#W=0gO8-uF4)n!b;A&+~uX=O=?o77nj+M;}R#3=Iic$leq)kN^WC zBW*Kve&@^OAn>^K%WkJ|AHrHdP$!DJTg_fhOiX;%CyLqqRbKw})2C0L_kDK%wsQE$ zXs1bheO+pGI9>GfCrzKM1|Y-F)`I!(OiWJx%+JsK_3PI*#NWcFSLrgJ=(QNtey}>| zS~EQ~qOYLz>gCIUv9XRa+rbVLs@(};kM6FNg4^5MpGTd~>{peQ3H>}XRJ3o4psAd8 zva_?hCFZg6A9zq2aGA7s?=aI)0EqA(Hhl;}q1RIgi}Lfsx3--8Wla7QAtpB$tP)=h z3jNH@{q__3$&ojDNZgPD>Inz}aIO-?Z@$S;e-wwWudmxWI{v7sNdXJZMWJ^Edh%_P zHzvwCv-ichxeJ}iWYbV3GzBEeUS3{?=<;?FVTQmckL0o{O<(_!wSi4saa&wnL85Gn zahE99C4;;#y7EAe%0-1fH2ssAlM^;Ep`Qok=bIa=fLtoIMro}khr58iuP%oDf_X2>njQ z&Cw_?t!+elC&}tyC{XbIJ!SDeczE~jUH;1!O>OO*Z{Obj{rkp{XS8x!Sq2{6)}~BL zM`!Eo9Bpd=f|1{A%kXz;sb?RDX+$E(ci8p}!ytchOpF}Z)Pn~P7OwoAY;3-jl*Ck2 zR3uisfWbuemwN|Kr9NSpn}oxm_G3S9L{pe-TLZ2LRutR;{kKYMc_~uEQ!ej|pz$z6 zU|@MwSTeGY#Ai4|2${4>O?5+Dz$z=L$II#KxX{VWj!v|#=?D1n&c|wsF*hUK3PsGWW5C*>9 znO1YwnuwO`)V~=WU(ZID?@(vFB@G5urow6Z)2#FGWOhzYsc93Yo10siD_Jh+RF~(+ z$ByWY4TpGM$mADM=G&O33=9koJDlTgB%Ly>8j{2~R-Fg45bImb8wdfZVSH@AthleQ4GuWoEl zYT6fboDT{0mmyi6G;($2qi(_?CdP>cEA#TZZpg%CXfBu_Rg6q;KJ)GUc^itKX4obN zH|zC3bxYOC5z%;e80c3Ua1PTL%&MzP0|nZX^6UFM^((y{9j2|H?n=N_9=p2o)6md3 zOjZhiwx7@BHvT+AmgST}pD(~UTQXl$O}r@XCwU8Q!z z79Xm+w{?^}Rn^qP)kSQ&n#r zhSio;YdYztNA*&hEJcKll5jhb!|`cg9UjzX_SgfP#bUF_`uHGW>eeJ&cQ=*#*^c2HKJUm=Ey;V;jFKiN{Xk%k@8xn^P?|Lt4 zCJBT9sbc|Fv%0mF4a(@$l%ZpySW+V#QG;h#Hc43Nt3$hP)plGI;8~J3+zJzU?pp;V z(3$k%tgQ>nq>6|#nZ$?kYjx2?W;?|}Tl+gN3!|Ojoe>UnrEU&Ao#p%w22Gz;9}XIj zyZ0O7X->1HtkqUxiJL>d6_NIo;+?Q4hr8-w?OBte#p3#i(X1A8Vgm!#jJN#q`UVE) zPSIifTe?AJ)EenhRn8AhaR_NX?pNjJs?u3}L83Dp-?u_foJ{SmUYLcar1iGjF*D9A znDw(t60nUwt4@vaJ^PlxPV8;tP9hzpY>rSfM?@D!%2WuQoghMNxw;TI$w840VOzw} zo!!GS#sx=i-XD-VPO`N+3k#97OoG21Q~9TxRtGmMAc^Oh_djNiNnjTpkBRaUhy5P2 zQBzl!JPPaE9Kj_`Lve6b!o%Aa`f)!7qu$FpdWDt!`KZwb0*+uga7Tw8IQGMzcBFSo4Nsmjg=U^dDKQn=dcYh=)of zB@*C?2#UmE_R5ItpR(QpB`7oydOz=19ZMm*x&}_Anxx$OT4JL5!rQy4#5j-<7h>M^ zUER}?Q)7-Uy`Y3Ala5&8Srf*Z!d)ivCkWJw4UH!1`p@D0e4WDNnvK*_IIZ)Kn4SYG?r(H#73~yByh6#lmg0 z)n#~&NV!;VELqs=#4;X1dc<0(JBTlks)>gUt_oNAh1G0lNO#*77xcCHl*(HZX(L*C z=;`S4YO$J?ieKf`8S+7sYWnXC)XJ+h84Fz6@ACM*pg-I<4M~aSQDYI+ybl^38!H^u zKHn1d^XJc1x>4B-+2nuR;@OKAO3KQ(f>u3G@nA8mV(|RDJTbRLRgD{n_y82-o@8Nl z^uE}kTe(4sB{q>9IB2X4&-+fJr>YAGIQfm^GD0(xX zG}1!TN*07jG+-=`I63j8;e&&N3P|+Ker0B+dE;rV-?39(etwd)pNNl-&qU)w2j``- zx$iY$dm^D=@}`iOeQ2=Ck*|E$h~Iqrqa}K+@7;58-Gi&UNj>y$zWe|I5%x%`<){R> zPFhZVxnz@q0{U8FG3f?>4{5#v8^DfkZ~0|ZBd?6WwEq%6 zV@1Z3VBg_+Ad&;TvJLyd{{H?Zz^sx)9BE6fdIv%&X@2bcv_~;uAwf6asNWa&RxEe% zP08k^*4{|sv=GkH_U;9L6^y00STR3Rt=Z{W@=!AH9UX*ybm1fabow<8*tBO06zwD zMWr^qwpMCyZ!b~Oi$_>km|o1~+qS=q{|O&JFMt)OqTN4Dj!;ivFK3ape?VsPr8W}= z$33C1ed%6M@y0&Wx$(z|%hJ^J2D-wl`uvRNVwUj)8o;OdvOG!l`@(d|A9|O}QRn-o zo31=qR9j!yfxX3SXTXe?t#2WC)V>xUpBhB07o9&#Mf9xwPD%BcR@B)W)d&i0-N*m9 zl`}~d^$l@rXM+5n&u28;_-?>W{46r563u8iS>Z^l^~~aZSy@@J=lTdBDNXNi3LwKO zfjpP~S-@rV>U=#rSl``z7GOUKxUS*OqHE(fs-euE5Y18fNhS~4#H&U@LizZlpq;E7 zELh`xGO;YlOTs|oACvPNueEsK+k~rpb%p&X*&|=?d}MnKkqk`ebZqo*PIe2^@YCuv z#yBi)7SW^4tCzA2#%X?JlF+azYgJSfF>GsU{J1cy*D4cGn_s4+J*ytS0cQOD`?r|) z&bPy`{L(n18d!

N5us%cn7l0DoJ9z`Kv$&rk~gdx!E8g$^O0iv9YvH3$pu42fot zgcSn}2l~gFs`W~Ug_P#2h{vT2SRZnzoUa9jJkG+5vKw6Xg&{)WFom*i6@8?Q&xOk@ z56NbF6M0k8AOjbn#umc=cUl5gfbN7eTl5wI5gSjKoD*$NSIKUFt1am;?ZL^nR%y2u z8KzBska4>VtODOx8#KxGed{)6>T0&%`~iFLSRHsD5^k!Sqh$$>`#zO?9o0i-0Ri;> z-cmO?C67GBlb5Y|v*$(snFgoVCMpi>hsf^kC z2NCxro~zV=vyT|fSEi2y*V;^J!VPd=#?=4`s_2Mq9dIF&gsY!O`wbEXrWhf{5 z#ShyHsa$QPY6h8VF>bS)W6iC9xYJ@UEQ4E9kDwdLdN(e|Vy)Tzd-vyETd7y8t>ix@2S zTHt`!oOQ|Yi}ONQPBk;cc=yr75(~Gr5N(ZSay8zy-F3t&@dyQpR0AMm)=GU+w90)% z!t$}ZsygCoheu(z@~c{G0@uadmo)|k2QgMwSHJ)Ir6sAzO5D^-l%oyTl9Ox7tvfDw zT`G@61BSc#nIdi_eDOn4OjtT$7^$u}fdC;gX=yI?b(C3)JQvg*#%V3}JMFXhABp89 z;=tFIf>D>$b+Qt*N*D^t>VWXij-7;>0f|i@Z`&C$snCX!1zoP=y)iRcReXFrNaLB*;f;!D#1sPv!1%oz- zm&Ucd1*JJ%Rd;K;Movu%f;zaI)@2e>Y$PHdM}hBD!KOIS%meP5KyWBzn%B{WbXe>R#+c_QCpz!i*~nLP1F89x|Lba z&#QYaz?Etd{xg-A;b?Dr$;kis(22N=m`N1?$%}(c#;b)89%G4($e*b(e46T5rf|* z%^-v8*V613Z2;^ONUH1D(v0)Xy>mvhI9>cq!ez5cPss74EF|We#kB}q^wHe;j#9rz zTiWcLI~*2n0RkhXH@`f{d2p>u!DkWS;pure4XZLVH)c%e9u}oidG#s*GgS2s994&b z^|TREy^lk4gV8r^OX}y3Q;JI_x_`*URYhh;4jW&{nE>^x^e}RT!cqJccCXv!ZcEza z)W!PSgmOU!E{*5KNWxr7x4m`a>te)O*7NT zX3wrKO${lVyZql?k7RiSL*;_x#{o_NGLfH4v(y*C$F^zs?j)#YJr9ntc-NjIN~qby z0+xb3-~b2;9#kX-Gdul*K{EK8NGnZ3;=0R3{O^(po;f-Auc*}j~iP->NwK8)FWD1+^(ce*&yev5 zEcwDREQLWc^B7^_r+d$WOD&UC_r3yi&NW|W{0V*gRk3fKxh#>L3(dQ3Hs%(0iD;uC zKp**ewf|k=*t>4RWim*n+#~V@d;(q(xdHX`_eziWVUv{G3C=C34>luh(jF~oly$*m z?_P$s)|p1drDB6j@bN?ChK3tUCi`Fb)SQ`q!c=}jz-Y_njh$Q)>ySD3Va0#sR4Rr$ z)neh(>GydT>(c1!07O`D;m7T-e#O10>-xzSUuBUGsh ze}i7=9^h-!5htIY_GLOuYp-820S*5TnbDgYI*bpP8PH)t%}<1~)f5!402X45`%N$I zmbDF&lM8}H-PETr5+-n_QDcNBLwg=>gHr{v6cZ-fn-WaUqo;a&oo$`E^r>V`9qOPS zjN19vzFe?G_3!kW-8A>S0ig_<|F~at(G&$cUe(i5VChM+{5JDa8Mv&OdhYdpdtZQi z^5#=%kSfraVkqw3JrvFn^FP^1H2e%S+rE(ztIHCh2>zOfWNMzRt*rrQci=reOGN=o zV}gI-ty$x6_&{Qs`NE75V|CqksyM%>vvK#K-T+B6tEfnhB-|=n+*R0mS53S1z?#U< zRiU2_bhVKIp)GS0N=S@-)d+-Jn}48>MjjNb+@mi!*rcZ07C4h45-sfDB<5pVeL;>B zfo~0DW#C)=J@j2&Tg&+Q({`xARmx@Vv8s>I-w4$W6KZ-1kK09~>cIH|UJ(T)Wt1Ha zV24!C7}HP--Jo=FaTo880_ix92$Fj}zMS)$`^>Y5qr~0QmiCmU?LCKenLaed)*BR) zA5S@Uy3@RvOLH=Z$?j+1KXjN<=>H_U=`O*6=wrZ3>1(EuzzYE;$J5zXIb~&KRlJ>; zA)r?5IikV!GF`>LVsL=Ikbul#jMaGY0s-JYL!-(wbMs6j8vmYb%Uo&ukJ6%6)WW&6 zgVT;#n;3I}Sz}ix1mj6xw=hn3l#dsrZRMe}?sa)O?Bv#ZQQ}NHoX^)X7tT3&ik9Iu zz!auw*Q{_~m14)CNgk93Ys&hmoAd0|D-|yl% z3?%Bp!bq?VL9eYTQa@BwRMcmedAF)WnSg3os46BB4F>6o9VaUQw4bdH=t&WERzyMQ zG)b?})EiLOhfKW3_Jhulue}q;y>TH7$WnF^niErO(?K&GG_c@QpTJ!TKN7iyPA0co{hrh_PHd*x~0=GUJd~N%0t*yNQ_9wnHJlLKG zSbo5YlYlE(D0+B#r6@?LXlfDxzzT-Q7IwXN&dDJ`P5^G%0hk3Y2(TbII5<95sd?!l zK$&5L37_XW9S<(^@3PtK?RnJ51%}F*g*IjQOR~p{C2r8x((aiT&%H8=&0U@ z1NedCzby&e(a0ZJS***4FfcP}U_d7TMNT_egE37B_z#ppxlFqF;{4-$CalCb>xGMP zEv<*oHse`^Jc_MRjNthB%{NFpL zZ4JJmm+?;oVh-?c-?osBZ*8osd;<@{;&0(&J1cO?r0_&$vdL2^p!FE?Q28BiZA!v{ zwW|K&#a$3x--?U*fV~WSu)MrH4D|lM4|Pu&bvShHRppaCYvEOsa=GEOHJ>4_B~!*H z9L95)G!ily#U@*x7U=8$Il-y;;cQ#y1DF6kEkB1bqb$7>Lf%#4c4E3Xff&9w!?ere-gqiDeNn=icMH!cr)R`{r2RL7y-|@}C15c1e0$x*7(~^$*XZUdi01J)i zHdRx)*qoVJedGc=`!BWys6Ne!QtNm0SeAPrd3yfd-k(4c6+c{K)_PxT#=IMyTj=H8 z{7|-Zm)-7O>43PSal(^EL-vGTCTdj@1_?zarPdF_`ic}{0Wvps+vKLzNWp8fgmIUS z7OcC{5oR~a#8g#z3Z<6>x`!6pk6mfd{?v&?E>|u@WrBl)z|;6#+-LBDIuckeR;YAo zJM+D8)s@p)x1}dQ764u>p*VbUa`N2jR`hc)aRTDJ|C9?0h}?o30@_RmY+RwwGys+2@XNC>bo9V-41Vl5w^-!vT%F2EKdsk|Dm^AlZNUByaHuYbM1 z6f`Y;fTA4y?T{)n-MJ?(sl-DUg&p~F`A{Js0S=4^5yqqUJ!ejsBwJf%&#Id~KIk`! zo%KJCSKPG1D#nm$WIU<6b0W;gaKa1Cr8l}Me;dPX+#D_3;WUj91RWN%GGM-|>gtjM zS)9}>6_lAw-~t0*9r$VG{7P+l!1Du`A^ZFHAYcgsYD_!)Pc=6)`;N56`1X4m^~*{Y z5UroDMWRw1tfBRt_Q9Z+vcLd&wY{Jk2KNYS`s)vzsf-3_z}GuEXZy{;v4I~MtpIWP z=_!=rYvZnRbXaQJ42+1^zSW$zY)$IJE~Nfu7f!*^rPlfhF~AFVn5~z#ph@XfwzcIL z%+YS=Bb(LewJMDPqbV<6QVLolv-0x5Fv6$L4QZ1I=k0ua+RS@7a!*Oo^!!fsK5l@B+16@i zQ}A?6-KgxK#>K?Q0ZraL;G#5^F#j|K<HEa1=@y=b;rPXffoKq!SWu?C2CHYG0Qs zl>*9V;3ygaFg*FQlzkPU(fE)kt@;$ta|^s=aqoCDw^TvCGPu&?#8Zr=l_s zqhGh-HQ*zhx6Hiu8k=l3M z4Co(ckWkgZm=4{~%9`M_fIrQo0Z}0&zG2YZt=3{JTj7fr&D01Gr!jiFSe81x>MWMQj-0@ z$;5@;b>W%fd1f8Zo_#V$sC2}rxo-WT6G$)GBc4RRdC0ARUD$qHo8_>DYpg1w;++I6Ko~p?VgFaa?iE{N)SM);BB!P!cB$H=GC)VObl#AmJ zdl4n~P{>p%I$QoDrVm1f{#Pd+luHKApu><4{FLP645tyaiWslrGjAgVW%TUK;vkBr zJkIuhT6K=)xR`z0nCGv+Yr_1h=gx4#!S|x}QX23@+CpaRuyA3$-i*-X^G0Img5RY^ z)Pm6W+t|(f4quL7Y0eZgEp+{E3Pc2xbOOdjAAi*b4$`hZVnoXQ^1kwH?3HC9q^g^e zsWi72b;b=~2?P%kHM{z$I&|rf7HBvtjIb(%T^&|4&f~E5#c5n7l9%2m{RYz)=k942 zbG=TCW1I7v5+LAvHn z%8_FB^}gP!gh$Em@e)Y(snvT8OFJN*qCp&TCIr zCvCX#1J`?dX1$qV;cy-Z+#ot7zbUio1%~#EzDGUvX9GWC4eV63wn>3?gFC(N4GWpkZExVEtSEam!*c*@Jxsr{hwz&4uPO zJITvhk1_IN-!+NL4ccrecQ?nW-x6sCFLREEdER0u*ss~KsHG&Hm?mLBTH7gQB6rEfHL(sSW8VCJ3 zFX#5H8RF@|zZ^0{ZHmDaUf6E8mFz*Jq^naS7g*L&PjI5VUOsxeDG$pbD9IXP@f67j=F>50=mygsCY7N7!II) z;Jv9^z!$s`hrhLb_xi9kW7#atSW!!i2ZnK66H0&gYAYb%T_Wp^249@5-2i!Lpbcx| zktGUB&R3E<=RVnWfdm+E1zF%Gpu7VMyI_`O1c^90Cxn+N!d1hDoZV{Ovghenl2Q> zL`)`9cH3oNIgvIugIhTW-h|TT`#Tq}Gi5gpsQE#@e$aoQlK`FkWEr&r17-4G6-8C0q8RsfHtrw4U3QAb2}Jdj z>_T6Mc?7VqXl|yv%+CwVkE2SXd(|i|yv2T;!kk_+xa$6%b1}mWArO4%G8TH9YUc5Y zi+OJ!gLAKvNff4x>{y%~vv3cNT2W{yuH$DN(_}UvMVK82eL$jzB;mmbFhxo_GxHWD zOLop*wrZCJ2(G`QCT{Dm`4&0n4(~#U&A(8db#{&9Whjb1fw95_Ajl+-^WtolGX@*M zxdIyEK)32}5?+rZqYF0mO7HVc1c0Jms+B8+RkwXm{7xk<>yt)O#Wn1#hCpiN*buFO zF;_T$sg;wS6za;<_qvsM{n{nJ>)R|||&ROG%3wHUTm*{h*i7GRN}6HdSI%FG-?~EoHs7 zGPOS}d@ebXdK`b2>rv$b?3$Lqy6Ce$oY$x!EIk%IqH|UbvxM+7b$FZLX zdQjsM8|j?(rRiX!iPv2sj?a|!jbWTdSW_64#A)X$4>EcFgYB=dwWyQ)=IZL|8wJXw z@}E^cJ2%swqnV-%AYh{7K1gdiOmtYcnM=3bD-a&j**RM7Zu0$!{=C}+)yCV7%)^tN zk^mYV5KwWd8N$P@=CB&qgCOK`vJLOcoBifjtb?JQy5pJ5^70pSY)#;V$La(8OoaV` zRtctcCir5X4rXhvOWv?bpW|sS5D37S)dyk&rJD?U%h<`nxXZp?tr2>m^FCXi-`}@k zy@xG@EJs@XI6=t~-{nIw{2gp*bMOumybIg9nJSLvqWK^KiW)*NxD{Dc)OkW-H@u z%94XBF?{>bEyaVX+-)MNpySm|J;wNCRU#H{?#R=9bScoh>OYr&NlFmG99&$il9C3Q z{eL>3P1qoKy8uikbtt9xTIp_vM2wx*0_Xo`Ab?5$aM~weY!DE`#l^)H|EPU`FpJFS zB7=ehcx>~&T#?UUf0k3~IsKvgjDxjF*w$rXV7i2uf90*eTaOK?Z_~))gB~Von96@S zX4we<1(>vCAmeesohp-J2qS_CL+4@>=6}m*D6DC@IuWIOvy`sZ2h0g_DzU?FC@ffI z4k)asy)$|URQxp7YI;7{rQwoGwH)h>JSDV#)weO;k6WTMFezo1D?>GJ$D`G})|Zys zpW)jQBKXkI8w}}whQm={KmjO{&a?mJfuYu+;bGeaRz1MbfZFqblM_;>Q&3)J@|MF0 zr{cY#-$3aFuUY`fYeI|#>@!7F8@>N9kz$_Jdwb{{m*Ep^>^fw1*W`i{_psCE_WOvY z=2nJDdG@AKnw{0Vs{t)bzj&gy-xLeYB7U&W^3BfY z{ic?_it_Rjzhh`C=sdGbC{I5MF&pUDXbu9Ap^wmBtchG6mqfu}d>QRr zuOp0$M6+NlhW9=yR(fKil1PiRipEEG{fZxxeRNsZqqxkq=@$x@z_7QNR@|slp1Ttz z9KHwPehmWv(Cm>Z>tlU=S}=v44TcPW$9yw-;OzWLrC+SV8sr~nuV21=VQt-j3zS4P zfHwpLEW0RZX=!cj?K2AtHPP;=Xm>C_ubZvWe=60bmGpNmB=5VVZ@al#P#Sp->(<|T zpe4(`vMxrnqB`Z)iC($)vo{qcEko$>q%`{l)7YUm6jcr-hTc)Cm2dwXwA==gWTtap z7zp>ohDCf)7e!{Qwnf5Vk{x6=(gWuO$gY}a=OPmuh5}p znl_^iMXkwXl1wJa${Bum8Za6Sm=Yz=1=~fSJ;`UJ8a|;!La#QOYTM&MtBjO&ykIsd z{0%-;C`L=Tdn{@Hrme3qk8Y@J{{?hiBUK{t>nujqWSkC+QNMp(A_GQMWBBt}-f=)cZFr1~z;9Pf7_OQmIkyE~R z_T<3DNGM~dqXJ8|S_^c5`xS&{FmxpnDXG6_sJ?simfy3fo7N0)*sXL{*oQyal&Zca#*!O zMD>yS)6qj0n(w_gOX%=3#6S!pWb-OMRhzb4jtL?c!;;ZvHn zAwD6v=!;5`-id8=ZeABQPA@$8U1VwcxHHO~=i~S0ROmDD3lP1A>bGjwX;95P|%!nRct_bBzkQ%1CL#0j=Ty|XVO99h)aQ)T-eD5 z@;WxBhla;{23R=|-y9^v{IvpM^+m6cQI6L)bY9mebKoB%cKW005YIs>k~;PM0*VWi zoAvep2%KWOG}*d%0qhf%C!fDGg2+E`ByYB|Q5`=$F-BD&q~|+a9lSaT%#-ypp?FP}%9?9-WOUS-uVW+W4UHD-14t+a`xC!tX{DcLvv)n-7WQHFotAZ{{ve0?4q5sz1ZZCX6tWZWgBk!nzM3U;zGNzj?b$ z3_o_CoW7E|B}r*$UlE(1&q??}D}P@!l;KZkP$kog?QI~rnl%fmTnvD!=(|YM3y{Nh zBfYi1NfP|uYrQ?I5gvB9`Gl?3)MSih8a(W-d1XX2C{12hQ!5LAPb)Cy(JD28F?RPupSgH=4 zvqolu>|Irv_$f%N0!80VvLBcp+;8c*9lx>@7$y$An9A|MPXE?*`ujqvYg2GrqRdk4;$6!$&N#RGvqPp)iG@;UeRm}=1YuhaR8&ErNN!|1bZ_>hel z)2UdjIBBN*;^IKYbUGj(nk|eit`U7*Q zg7+o-MpNhs+6`=}k@3af!gYinMugq*1GJt zO5HXZ=o8)BeoG);yToUP!6juVYk=fTMD`L=ETR->UReuv`+E95wXe1dkayrY@Ll$+ zRypi%LtUk?p}TCShB!aTA;x3b3sw3uV2X3fiPm#GI<(yCMCmKrli`OIl(z#yY3`;~ z53(#q-Mlt7@v)CTliT4!6fo!8xRLsLadE|mV)($MpWyyls%UXLvJV0f8IuGX=GB|u z*BNBoEi5gA3`NAnB2EK5tA)%hEvW`$&1CmUQ4v1RU^DL9M0oWY#{3)gU|P5EBf^(v zB8AME>KWed6_L~^w-SHEW*@7)mHb}!`+e(zN`VJJ{_hE{t^l~Ma&M~iVBw9Yb-yP* z00&?f1>DGBI!y$^O>)`prnFP80fzE3^nU(&Lrvmh_J zN2dZQcotC_uX=u#>IW&17LHGPbIRQ;7nDDs{f}KCW%*09MWIPB>X`(P_EYKvxG0_n zgpEH5qPc6zN@EEiJ2^Ry;R|649###XH51duk|*b8zQNKyJpgvOO6PBEZt%m0eQ`;Q z*gI=wW#xL62@IG@4yGX-GjXz`Yx4ouJK{cU*VnRKC^>%fr`fpi@w%UvNp)j2-bwC0 zluLCoDyY=-90exvVa))-KkIj}hlb%_sa;sn+5V{~y?jHqdvd;Q*o=NWXTUuuah^Rf zA083R73f*=n_djz#icOG{w^vy*g{Z?aTLk^re*%CGVPDoNjftV*4$+(&-50^Eu^QC z4=&cY9kBdh4Q!cBLn0+aq5v=)0%@L0^Gd*@Tkf`g!6O@qgvGWD6I;K%-4R>;Xoo`T zRlnNs_{_B5Sn6&3oNKNWuM$VS_UWW^xmxcV5m&L&3VFTp597+dFc!U2N^-{R#2oo| z50qIrGB~9%Dees2(e7Mbh*xQADRA6PYkHw|hkHmdP<)k=-uliZG^D|UXo`!q4*el~ zqC+uJQ)=b4hYSnmpRy%FNXdtHFr_Gzc{_7iI7w3Qf1-!@RFD_Y1up}~BS0j%&Q8AA z=+s9Z1oAU~{CM#o{_dwtb&&i3e!l>(|6^BD0ARCK$E;7{Sn}m7d=C2N_zk~p2{QaF z(*U8yosFzE12!mK{|k_fg$|vh^qSdc^yEYyXVoM>n-^Gx7;-HZ)>!#Z{O#%bjz@xC zV9g$`WD!QMP5;TD8!RuS`pL>eFXW0hwxd#Uta}R)Lihr+~dMTiujZ$UpT^y;BctRWhZ;LV|}ZY~^7T^>I0| z+ksX|?JRlV1%42>zF|-%GIO&U-2rkIJywebu!*i9m4cL#5hP;*+d8MR0i-Pu zQAC#mggD591R2BTFhsS8ta-KjiNkt3OV#!hZpI59-xhbK?-~y-Y<_y+c7P3%LT-l3 zGiL^}Y?C!Ozl`GL7S75}%Pw=}(ls$m*;Z*iPYD~3+GL!#O(93Ssv`<>d`6&I$j#3F zuI6PAMO7YG5|Egax2(D}|(k`HIphkp4#nt@xWZObxq9J=XSc`aG;VYB zL$`y&ku?@ry(xo!(RJ#bP04Go`@9LQ?ZWI|+K`NN5G6aA_US8i-+-2lx zx8+I@l@78)LxU$H8YPTg&gxR!+N6~9aCoZK8gOq*36<&@H;P-qY1pFfbVVM)}wpMg#(pHxNijFynErPCQ6I`mr$iQ%WFRH2;^0K69CT zp`cg6H$hx8$qli7CC^%)4jiVM7c9GXbo7G@=h)p3$20XTZr}okIye;#(I9203VNF) zZtX4ebdgjVPX~Kt9SI7Eu}PHeX%4x%M~bnnsN(`K6956~92*1vj=wMzs08FZ($Gmz z)LsFO5|9%67lZP9_N8)B#A}K-33}!msdg~~)-o$E_8gI8+6f~X`tlUzxFEN>r@$7Z z+7)EhDd;+J&i zn$T`-U!P?|!1$BcxfBPwJfn)h%Q|ZQtuLmJ>mHVp43JUPg`+TxQ-{|hL=!GypAkfk z6ub!z`1I!29G3i?{Je)B{L|6xL!1rzY!jx|KG39N>2u37@`{RT=e+gyGd3b%f{SpV>wMtI{l zgPfQw?y?3kOFhFoSHXR}l)kz1C>nM2=Jcxx%xlH^W)!pIuO8A9<}5vP!AKl&<8Y>{ ze+QYq?7i-Z&H%Z}kk=xh59Cj78cA(>HXl*&_S1)?sI^N*1ZNb3$FgU-6InNZ^;{Sw zLKZRZS!FJw~34xtv{YqA>36Wo_j0G`)CLg%U`ikLkbt-veciPs+)3Nb}A zNbabOe^}1*+QpmZ;LpX5b%J)nC(h=f=bI(0tS{@)yxeZ@eWN8-ejJccxRg_Mv?Q$X#H&nnSotaxkY8xhbHCF&5x!aVfPs;(VOM|M1} z_BoBM2?*`)?+7X|b?I*(J!W@a_EoQ7_w$D;-q*HvoOu;}avP{J*kEW$f)`-u!_a zBWN28!_ps^YOE&{#P$g!lcx8sAl_>+!1!NCd3)u1J*ZXA8Sv9q$*Uk8C6M{{@Ax%p z>H{emtMnf{5CIptp`+bpMlMCdySg^t%0l0t2=Cx?SuS&Tit&*VTz*{ME{mHaoWza8UN>2KV6+qZ_dR>mphI!^N z9H=_>^PPCK-WyWHVY+V>JVWUkT9;=#=nk!EW=4*_?pqvTp40UvLE}aaXcXqPXQX3ei97^}>V{9y1MhS`JyIezvqSEF!*8;G&w<6{< znL`I-7bmA;X4UEWU#;TWT`0qlIY4xJ^L8K^1*=!a+r-gcMgYHg7t{DvXxgWgFac8-KL ze6mS*mHtl6S=44%q|Z(6?q z>77+cjq>k_$tmNfFM~o|s8*oE_A=rolJNIKY9B=GqKpO9OSEwEOmMtQ`FSYK?zn$H2l8y z#A|0AfxPryyc-AmzL*O#XJeF)_;os?s8i2jHl#C?L9B8wPj?5<{eVqFY$EN77xMY( zf~x$h5qTt$^J->5En{wMdr zHk11tg&i=UEu1>rE2(~n-4hrO`=$kOSt&m|TDJFGNDYe6$XLz&T3@TFz?S~Kk&OPh zK^>{n1aR`;e8EMrHo~N~*Az{OxQGZ-)np(e7lc4AJnWj9yf4tJOZ{9-bi5`&F))md z@;>jo8WD}3O$Rrh)b?h^M>AxK_3f}`iuF5m*)xB|(Z-iNP42!}e2M-a2E-^Oe{vm7 zkaCVSM0pULJP4kDo-nvZS+N#0`j0s(q4F;K{L%u%$U_1t$Pg+)*Gi)9FS86fy~tjs ztk}EOJM>rWDA5YNR&21k=^xrd%m0rd$HswZaut}ULYw$K`C1G}AQiyX^i;bfesdQ%NtGHZ@g|%n9vENFy{I-|0e|phf;+L9 zV<%bm7GW-_JK-RSh}ENDH83}Dg_6tXGh-@OB0wZZkoet6cJT{-3%>k-Nncn6i41`Z z3sQjn(%q(mHL&?kNQ}quJ-d%(e>q^c(xom*Z-{RLZk#EmdS|_{$S)-azZ!q7{)OvR z_DfbxS0t1u_K<36@Jy@Bvmn7RyljgrF}cHU=U-;?m69)yC~!9p`yS(AzIjUY)0Hu2 z$vTtkB`k9Fi1aBbH1s-n3m!>cK48=N!6(kYN_<9>b@)ID+-AUSQSncoF)T2eR0BT~ z2fBLere4s)r|(lns7Y93h#oiC!&GE-hN<|g5g39Q^V z33Z`I#M3#rnWTwu4Qx>3SAb)hz&eTy+^j;F1u1IP@IL|)$FMi6Rs@ROrpBcvun}L| zOsg`NZ|ZoFc`2#UX)|%%sGE*7{Wqq7grE@y^P5MJB~Y8@SY}I4;6uk4xS4DfKjMs3 z$3u`KGTN@3B4{PV*19sGi`3Di^q`A4!fb+w`N0a>=^=Jw!1S~2*OqC;(rv zm4b;EjDH%8|6@$vFtI?-+*$zzvPm#3hO)M^wdGQXw%}XQh5qFn4*v%7a<2jl1UibDF=4a2(nUso7#>C^AWX^+DJ#A{Q<|ZF$@GY-uhp-Zw+f8MJ;Nq zM2zOe<0jg|R06Hy*E6Pw-2rj_9A2X5TIq3-G|du)Ene464zLXTphZV^2d=2}HiiO4 zGV4)4KR8hO?)z6 zE?ck*;I@HQ4f6J?#u?xC@jne`kam$)7{|{oH$Op9GK#&&i5#>k-lr@AN*JO<+KiRC z#GmjI6=mrqk(}Irs%Yx)7)TuZ=fc6kVdON{X_dFy0&0{^pW&@j*+3&1+kKl~^_}4PUd+)|7)cx(5HBE2?GkC~-Tn<6YTC3-U-@0^250D>IXu zou;sc`xfkhXK$lTUKq@|&? zS$}#sa%clIHP{HgG*~xi;VNCM9%FOXpi=ExdftGxlap|Qm~GAcHm;7Y?(ZKDvp}-8 zcGFgE2r}fo3Czil2DCI9;^)mqQ|k{S{kHJQ@(!2$rjlcOoA^BJ@#8?(@(5-KjARUW zc8_cDd^_gN=G&7 zO4mi%Kogt2LobYHyX3qK!(wPM*o5f#OpgE)7^6nd$;lS!7GEKsJenxVW6Wg;PH!;t z0y8TxQpN&RkoWZBGC|T<1+IbRpQDzgTiyaBE2!(npIjex>k~b|7qGrhu?l#>Pm#5g z2WD4zBKJm8rX3{Ou@}_F4$1jMws~9+?B*X{-K!?z;vzu)5os&ERj)K+SzM#&x#m_a z-Rv^^;jt}d9aH2kX1}+f77>Ew_SMhis3VeX2viwwExfrC7Ep~sw&T4e8akkR70cUy*s!B3L^QJk<;VM)c zUK6~fZqokhhLLipVXx*Dwlg9aBBs_o}o5}HPx5hYX$e>GfOoS*kyodr>F%CkWGu5 zuPQC7jde**`YZ~Pq?Lw5)9yj*V$P*u+1lRMxu>T>4OXj<9zNX{?r^rw0xF7vA2>__ zfoAyN*6ln>N8R^COhHm)T*A^02xFt>D+7z_7hh@w)piZw&VWUdB_EV}fFybM(*Wj- z(oR`xI^K-j-d?XLK;=24-hO(1EICtBheZYO>8?KYd-U^(=yES~UpuMjMc?&Z`P>_d z%o{OD+po#_zY)8ymCjcIk9CW!*vNYlqb#t{mubI2f!K4P zzUONKQ+btdSh%;d)^EzcMQuNQj z($k~ggR4l0zgnhX19O(cvmI|Ol$VwN5Gy@6ZBaNMame45PH-nV-)m;Huh`5BV)Z$A z(r1x-CAWi9au$jB#Rp_bCd@D^RVC<{<72F4%i&h+HW{l|F3)LU4{f2#N^mfV!@-6L zI1-YEo~xpO$S%mB3a}W0TV~9B3X}{ot0Eyalzt)^WBa57EY`^9@B}NBmOwbgwVr^A zA=Ksi)kVVGHnDoau*Km^94Gt6?M#gsMyEfFy9Ior*W-j$(c?fN`s?ZH`T^Jm;O!G1 zcYgzbiwdznfBl-<9WeS@S_&^2(NtFU>T#ev;0Dt2n)=|rDbL~I;UZ819nfWvZ)aTz zZc{9|BdZabfX%gV@+mz$Q1?aroL$nr>9Nmo!ZpNg09cxm)) z;v#$EzqF^#0P8ORH=)gd@K^!R)TV*i`T2t9x?V1nY?>JqwLBDv zjLgDW6S^#w@6?uRwS59Wmarb8;FjLg<=zcJ82GhXME(l30YS6V?yfn z^q;q!Hi&PLtyQ|c946(KC{hOcCk0IN)3cXxNx<1%8il96iwjtdG?NHA@BtM*k> zHFz0!yAOT?NT5A!pRE|)lvhjNBN49_zl3tBb;i*S2Ia9{RA7!aTX~<@yUtA$d0q<5Ku zRL?{p^gt#Qacyul+kK3?kXwcAAP7tia74;%MFY4nYbEf9uwv1xZ4&Yy=kV;qdjDwl z?9@pK7hA=%BrORALeJEVO4>iTLQCJ_N&Dj?#A-cUFnIBlspmKq6lb*Y zRsOP6EFWX!sjvt)Xq|J8_0B72%)Qt64Xvbw(JNTDZ^tX(TmFRrY0jgLFcH)7SfH^e zC2!djN5RKVeIQIyrqz)t3B6o38k*NxUc-!c)5D$-NIv?d!F$kR#5M1;{M4iPHD1Db zSlP?QkG#A!gjVnsV9dPgR2xV+Fy`3EOwVUj{)IwM!-hJ#oYA)4?mN{lyTm1|KC4Qy|QZKSy=k`GpF=LY<<3p+v4gX?Fe( zv-B?8k5?SVM9Lj4xJ+k=ameRtr_XI48m_r@L91`5O!A5+C;9)3O><&@{(ZTWaQ)G^1fxENTB#YuSKn*D*4 z&=+0H#|}`$a)SGy7E|?{{Mod;77MWgN2d2HAcf^X2U$lKE+*Kj`1qW0zm6?k%uJB^ z@ZrNV&?OZ$0)a^d*`q6&33g3~54}7{~L{AHX-WU%L4!`KLko9$KTP;tBNf z-W#WSvbIm)E^^5d#nY9UJ2L~#WQ_S7ug+t(Q!pnbqSpPbYLlO-JLD>*4#@jHMeD}(U`kA1D-X&ODgA5ODXP5T)mgq z$kHN0F)e+&a$Z7s@snk8^AoWArLq4qtav-~!6@5}%Z)(4r?1}?gv)e_h%?rTXtTRPV~p6iwSwb%3#bZG}m zbftmR-p7|Gk<_s%zMBHhPD3HbLBGaAN}a1TXJ)es>#ldDH-eC<~bO zxrxS8A50H+xhB8Ti>r;6qy<>0k+#f zeCDA_6Ruf-_jAB5ei`h#(TCB$=1b?3%U@vM0Ml~&l)nNE^2;k+{Y!rT;vA&9j1A#* zIcR4aK;?Vt)#&Qc^?iE^8bJ}_1~r1JU;G8r5z@m9{N>qI$3~c?embx+>NoK9i4&u* z6B>e2I=vv@ef&MeGmo>w`K+pwS%DlhV8KY`9770v$}D9|zMO4T?ehhg$(1HB?p>&T zeg6?W&@pFV*#J<8F=A(t1qEg+V*3#CiebLc2yS17j51FiI3NLWeae!&xJuejYzu7` zPwfkaxFVbDv#rEl$t1hXC%KK6*YcGECr&7&vw=E+DNp&!n8q;2!?w74v3uSfGZ8K`V(V5hpz2r zTKPDG>t0cM9yRt)BwlzDlASBhMP3Jth_nrO%b{62K)JR|9=xtba9rwv$k+sOaJ~cF z4Oan1J;e>$x6>Zc_UWGTnNJE4k$R7nvUn;7&_!7vpVIGd-tgTn$xKR`pCHf5Z_RL#@VKA_beAz}_Q-u>OwTNP}is~f%C zrOH~lBmf<@T)i91ulX^AoTkiv0IZ@s=)=871Y(kb8xf?YUEheGzRaJNc?dI|+>K9y zPOVjIpT+jM0QasE1wD=(GYLC;H#()*Sp|S^m!!QDv0^S$H;k$(HbC}C zxfReVK~*5YATQof1Sdt8`1#PS;~HUYS4k8c%)AAxVL0l*CcfiS=AqC=H#pw?%T2+b zq}Wuy&wq(68-dQY#n%1sX}oE_urN~sVQZtB9&1b41-X^}{9PNNB5;?CnVLAv*>ttam;q(`2Oz$mS=yc3Q@ zy2b@tBQ8KA9X|ct2a{9-ya?=#8H)bBYO@pZ$C}yK0DM<7MNZZlM7hK(L6I+2P_?d5 zK5Xi#H9AvHvrv5D<7O9VGikN@%w_mfTQ8A7nUthL>9-FE$8npIk( z-@2UWj`@p>_JQa42 zV*C9<%!(!7n%lUpCc>sS3{*70e*cAVUB~?PC#-1(w8>Viec0yAtKWt8_l*Yp58h{z z27b^z4G%xt0~d#)<-Eo+!9GwD5_Ep=rZM!5!#Hu=eL8#?yY`q@K)_tM`nU^x7wr$b z`u)%;#k%#h1Jk+;MBUn+^xAWAX{q-&roP6r0*6U~Zx^8NO907m5unQ9hTPYlMU5H< zzr9tYAe&;^ao?jc%2)%voUxzhz7ti{^Dc{EEmhT^{SoxpULfF{TH=GA7Bi_&rDgV3 z@d*gH;r94mMIHM}f@GyiG2ARUmV+w}M7b~?3Yl?|6+A;c7NT+Zi>q^kA_HAIwdWq0 zd;G>seHOtR)kPhac7wT-odeZpyYuh9rPS-Zb47z#;5=>&K0PMOm&R|_&$r83HPL?C zXMz}8#zX$<#bJvgTSjQP=_T5&p=~WA-*+aL7@Q zWIaCIR2__=SyVYlLVa5M3_%|u zWG3u<4x<{R{=rUp@ltI}=^ZN!>qKEsvh8gM-TzOeX?GbbbjmS@2;OAXzlanx3g}~#=2Ms3UNxzyzc68j zS~mHJW<4ksxEOXuabuZY$cNPH9(~ApwE2<&>RVT)FEB`p4PA$xL3i)ob;@){23x0q z6&dl9`7Cmgy`O*|6^jGyah_IK;)(BKcu-fB`eUaxv$+f~1pS1vXCb$6;8_vqA}Qgk zDlX^ljuwNb(jKKhh<$r3GMs9+T5oz(kNfIUikKA{r8vYVBzRVB1PI80B)7efKtZ#> zsaUV&YMbpkUwJU|rPK0Eq54=ljfB2Z%J**G3+a!$Pxrr@K|7^;3msq17hY}0aAkj- zWzqNM;ISkQaKVUBq`yofq{tbtmfJw#OWT#N77sKkge&LX=@Bto62JJZQsT{w)gEog zv~SO`>>jBpW5AC$W|}`<9h)b<7Cq{dHrp8bk;kRc+LxjkqR8u@p8%}<2E~oe!Vffy zZ>o=$vQ!~0sl^O=BM>&FiYRc14)*@^VtO9RMW254do-<&PS9trcw=x=C8dqPuqWku zNVl~g_AGG;M#}H_=vu7sjU87PW6Iu0zP4kS<`3ke# ze&}Xwl*z!Fx4*t%wUpP(;#x#+aE?ncR>{5LmHXw4-Sc8lbmoaM;QQR3IyYOQ!{>!HaMTZiD(51)I!9yM(i-bXn z;X_AZzwDrA5CKJx2qR_fH&p!gm1ljuz0QWf8mD3g5K(bI5C{&iiVshRafuPWuH!Q1 z?L_G5iP16FE&F{}*tfidxtJt;G-l5A(s0Dl6yvCPaJU>Jh$&hP1nGk+UIV^ z9^dnW3M`nd$7i6z-+bK9oG=l;Oss{lkN)s3LgLu_!|}am+G<9TDm9O_R zk*NHz?M+T*L1Td@u`JNZ<|$2v%T_YBX2Qb4YPTKpv`xIhVjN>v(M+CzRC{`pA3cch~N`XCm z+X!pco~W z&{UY0k@dNdT%2(FL031nrFDjHw&ciXRnJ+$iF+-mJ9ELpI*44T@EQ){r*wvu8AEL zk+AeYJ4CPd%(2lkiH&Asmni(}p38P`)k1$Mva>n7k&=bqIBt?(vu9Lgt57!9Z=7-^ zJ!H*Ozb*Yb{vs!K|g^X z66~g1xGkJE@g9vXm%00e3Z%rznj>Li#soHy#R@k(#*YF2SY;CLtQ>8&?Q29c%+0|7 z;q>FRUCXDufD?;TlI{ba{zQE6(AbEza}GpopCihyys=OE*mAfn)T9;ab?4`b2;+Q5 zfuZN(>#$(MX_y^uj|de!FpqSZ(O8`&L8B*efqAqVV7PD|;HKcO5&MuN!Y7Z!OkJP_ zpPR}8auC@G^MRNH|22unnf@5zu)ezWAe5c$1>h0sYh{uac0zdN_SP2@QI#iDu2}8m zmp3!!Bdq-15FTE*v(3yV?5z5Sdh%t0uN6vYH9jMkFISr@fBm9Q|I`F(Q%FyBecG27 zuY?{~S-*fq+_;T3pV~S(bid)Zt0d&xCk9>X@BBiKS1R@F-aXz8f$ZPJy|nj~lrFs( zGPg8xM{a)aRADShd`~k_#z6)Sg)2O8lTHUuqn{sspAz*HyrDT^yRnMWMmlVs3Px6o zYt`HqDaJRdVW`@-$^O)?O*pqed*{gafNVo%PY9 zMX%Fy=BB$-w#Gd-m;u!rZ9_}b@R{DM7_(EOQ6@&F&y?1MB^OYPJLNRiaYOwmv!J|q zdFDPg5aXudGA5|NrNx1`t$V^l2JnxK(~kO;$my>pTpGW$wm={s2;_yi|4`cFK@m+F z>*sYz!_Mh;+#64fSv8a};eFrBt1*hA^gx)ie}@a=v8BV^FI#7@z?mPSvixl24JrHj zPZIQNy8_AS<$EWw)lT2ZFy&PMNW_~!lZvoDk3yXUMG~ zfwWh^E>_I;A1E&6vb-8 zw+ANSbfPbq%kY_V?)rZ6(}^bTp$y~gt~?@ zUHuchQWrmO`XDe3T;?Fw4c!TRKZoe&>-d>hjb-_yM6i=^i6j0=u)E!hNQZ$jNs=y{O@{(V2f{F&v6OsB^J~y7!nNo z>dQ5uWSsA69ZWQ#IYH?}`|2WK<>|m3$9b!=Sa7w*-X#tM1cEc@M$~?d7FJx4!L`AH zIVjz0fMZJa8iE$5Tm^7FK{D@rUA)SH^{5{77W)M}73AkUR(B@-jyjfSKW^qyvQXK? zbZyb551N#LPca|`A|8$!=;`grCM9Dx+V{qrPwdU(E$BD$0qO^JXTlvNr%+r#!w5y~H=J{L zPJwMXaaK;fSdYkD~&Tsp=ns7SQ-|fud!-8Ysd-ykkFZKL}6yl4K|n z!alP`E_NH+O)%FA7USQ|oomx4fL$w-)y!rH{R<6x_gSN@4qbXY30(bu^o@YUS&V=1 z0yu`ATtUnb{ptIngFWGZN%@jOI`JTdjTl8btv>AF(|h)jO&%TG2f$pDZvNxSx-lj( zu(_y2n~|N}N{Q?uc!kA30&q+^Ow1L(oU)dOU=H62UmmWm*K3!}C3oxxe0p5V3;GyF zOO!+6ykADC}(?#RDRr3!gF{C#*;#!RNn& z-G7QA*R3ifmH3*SZ4;vfT>aqi9Qt+%*!1ERp`e676LY*C-)px>b;9}@uXH)RI`Dh- znSW#aFaGO$aZJmfKZZ911mvj>F6&6OP8pyCd`G~0FI>)t(u5?3oz|#u_mgOPz5o#0wIVV(Woa8#uCl9XZ6Yi3$SBz($%KugJ_ z6pWs94%c$Y;#k~|1anEPmA;DO)69lo*G7p|@Q2UQeW!*;)$!e|H6of3b|=?jv@kFJ ztVh{b?wD1%H4La+H>cR^70GTsko)j$|7fv*_+V+ssi9WVbfLo^w4pX*^D{yG{%%i7 z<_YoQ_tDm_@b4JOajE=I_E6={^m`0b0u}S@*AA9WI2TwCp)NckU&TP|3;X34Bc)E< zUrf`wWCYh`Ks z_>^tmfd5hJ@)BnFY?(#Kn8%#Q90D*+@LvYY*BFFFZXTaZXYUqX;*fVn5@T8JFF8W_rF94L1yc9h;%Jfp6 zn>z^5M5|PegMUHIUg4RtH|P|ei<@yg_>_h#1tam4%IJ@GJA}GiT3Paugm^WmT=uksS-G_y9f1uHlz)j#2 z5dy`Gf_8p`TBWqKv`X}X*sidh0Re1;naBkNbG_t@n#^3wlj@;RdQi!UArllX(bLmI zI{{bq!m=Lwus%&A|MkBeI|_De z94Jf04K}LpJg7)T0Jyq9$yWu9<>GKi$?xBz0Q@jqBWgeYx5WVD`Tw??(mUbv^ZNI= z^8Dv#wJoCa1A2Z$LBha)j;l%C)_uUVv_-T0s)6%AUkS4>&U3$i{=rzG68uY0`+rVY z+JAm#Z)W_@;i3J{&kcUSV4QAgX%TKTKw+oq?_|MgzT$NNA0vH4`G1-b;?lwu1MhaQ zxc%pm%r$Nh8S(?cZU>G2ci1;?GP|c@^~N;+f5#l6j=B$|AS=WF+lDy~#0#=p_8tFw z%p3ff4_rJv4)?(T!yPaGcigQIt{ae~BOH$h2VMIfT3q)o8-+gbe%kEIx!_*0cb0Yk zg}|2%L~}+D@!viA{)ovs^Vf{0rI#&g`Vq#;>5g~AhXSt6zJhswS=AkJtRc`4y0!I^ zQIIi?ycI7Kcb&LBd}1~d{}CvY?GgdFf%TizivHh!m6~+UGov0{p#6ffg8WjZ{l46i zDR8YOLjdL8FEWT%{9sh)1^)*`FX9eX+F0QQ6o5HN1hb9?!)GOO#f9*I-5nx~@D*i4 zx7^ljvb@_D{`LR1T{ry=iw__bhm46R8CUL2--#9Hj#g8NDPWQKza65R%aejIG(3Z> zjj1*+e}4Xc{FT&(DU$T?UOtryRLc8kDzQ{@mMRLI+0wFC_y0ff{nI1s+7M|l70&S1_G@L66zbL)g^ zW{ID`0P$SMXG>SR1~ea5?Wx@h3_V0KL!6H=ec`A@@Z}G`sV=}W_5Km^O7Gh3eG@sa zcci0A!5`aBQ%Iz#{?~XAXuQSODdw9RMDUA;mv@c6cw#RY{@OcWDj|6mym z0*fR!fz!!S`^pDr6!4$TG1}lZ>g23Z!keWaZ58__wSEtwSGQI2+he*Ih2D83pKIKZ z6*JT*&&PdSdz=nDd)yJ<+h7>U3V31U2W}G>$^t`q2cWWsasqj8DG7Vb|3XMwu%&}d z9Av=dJ@@A(Ih_9Nl%tlvz+wse3)sEexh(`1*(_NxDm1HD`^LZepad5x_a&shaV7@x zh9RH;4c@Oii8`P!h9doz|NQyG5^U~WtVVaw>HERA()ZYDtD876sZpkK5YGiBxs4_m zfIu20J@s>Z{xA`Q64Uu{!!DY6ueWnlV|nh;vsQjy-tsE&;U1Dohz~5XUNKudJ-FST zOFLi$C@HBJ0((}>LA^St+|LMS8+2R+j)I=_Yh^HbjrAj4Rh@LJ`7+Qp@?0KMYQJxs6=6~-WG5TLIPObh|I-eVLWU&7!vUe4+4wd-ykjGz@j~(RypI*QY zPWL||I(mlkyb-L8`2Q#C&lm25Fl>*L3T|dtWun*+7i%9Eb#rd^{<%KpR%REX9* zI4YWU79`w3oXUrRBye?IxxYqY2#w&``x^mpPIFGpLn2bR`u!>eMV0RN+UI7IxhX-I zv>*Mu|F5ho4`(ZT!&hRdHum~SYKfxEGu4z3wUrq=wY0{PYK*A8QH`ptMJyd`N-#K?V&-cDZ-&f7` z+sm8ek{`WtGBRDh+eR=2e7=AgA0pKP1y0===dQZ0+&`)ByFEX}dvNX3A#nt0XS1*5 zc;Q}1dN=)Y%0y|Tjf$FQ0)>Jm;+oL&?}ZcYOK z$ZRtbm~#1UM;jUi(uO9)>A^*YMADI^VC9rG3dB)#+tG#k8T0liNmU=@SE~D}q47AF zvEBeW+oF~X*&nmb#`I%&%N*tgbRN=l3JB}eY!K2<>d1GooT;I?dMhEzGo(H=zTBFM$z*S74WCww3VAa3vnj0Ay8b5FS3(YdTYNp~XaQfq zM>p~C6Nx=MVPB;y#sAs>#R3eM7~bQn7`nB&F^SztS&Y(6uU9X2>b6Nv%ghO6OVj=7 zCA6JWwUax}T*s5Th_b}Y)Do37zY2G@kk<1_E= zs~(iJTVlgJVVHxXu{7&PRH7cJ4Mj)>5hbLPJs&BctqgH{UX#H5W7&`gUwH*klyW_y zGO1L+3B4vrOwCy|%FEC`GQBGj0v_rm5BZ@sqKEt_{a%J;7g&7zBPX5tm~tqs{x`7idn1aRvC)_lZ@v z6snS6%6%=R*_mab_cw%}8$k-=;tB5k3rt7UeWF%i(+(6onWGuT0_P3VrqyOkrKJ2vd0;bEC*5R^;ig(pwUJW(UINlj77bt7&7#Yth6u(D(-+qr=#R+THqH|O2lh*P zey!DAJ722JD52ws(7cFh>z{36F(*Isj?o5bwh7!T_%WQZ-UE?+^^V@IjlFTt7DoBZ z&b_3PfT)`ft)sWL_yKI*&+|Vr09d=TD2jDav1`P#HZ7^B7%zM9Zp7IIieqt73*ptJ zLm|aUAv3co*PiI7l&TabCY=$=PCP@bMLkV)mQ)xLy?Hf^Ut$~b)YgT^pe5|`-Uj3ZeIyO9-^qO6l z6Qa1ORMg^Ys>w{Q9}Goe`A#Ct7)Zn;(Nh>-2cA{`9mKo@%g@yGBSE zRT2&W_FM6!lIeo9L4|6Qpj96~jb^`?p~e%~>~7Al`O6-|i)Oe1c|=cuF@H2Mv(5&m zaQVGmgx_{pn}_Gd$&3@u06?-w4~se>-D(EET}QgqI7Y{0W>MTI!<2wXeUx6_wXs?I z&ZYK>Fk}88Yw|KV?H92Nwdw|wF*3tKpfAr^?>CQb(e7bZ2cG0$2#ogRcf~`frH0F7 z@}KExw!2+c8jZ{~X#NwF6Rv${%wOW2(fD2Auc9yjD2p!l{@*K-+vC__ol@?nqN z*njaylP;710QKlcw^##4(tMK`=Yp{b1G;i){SN=_34;#{@-x{HSxp8Y)&uiX$ra*q zdePfWtXHhxmf2Z2xR*IDcv4QxdL(3St$wB$*8u?dP>!2vy4S>x$7$CclQ@!7cy$Y@ zGw&&D+F#LwBhNhyp4dLrF__b3h~%1nCZ?q(Qm|knS9sp}VAp zemBqmetGYw`)wEpX76+MTI*NGAJHV?VI)6)d!Wp@^`5p=i!?^hc1ce3JAM${o zIk|*5dAK;ZghlvyMYwoMw!<(Z-S3b@24guA@o@0)t8fd6fPdr?j3m4*{C~ZpbX%NB zfLFlKNSIHUL%^6vkb{qxkDEhSh=+%R&%jWSi`R&ckJpI1wDk5e!T-}IBh&Es?+S2m z{r|rigY*Mflc!%FX=NWNhN4iV@f(b&jN57VYahg3?qI+$$KwMzb}=eBb}^Tvpnbb2 z+^crUQt6>wt%xVpF5Pq?Ru4xWCKCV5y!*z7?6rOM((6aDOFKibWW77F@MlbqqV8hK z-a)+&A-z4^L^aLf()p(*A7+&}$50#Lk~uRfAXhtda_N3*Z0_QGJjlyC+t#RevI^N}dmhnL&pC2(YGD_7Q^oc%d@i(AK@;+N=Im$vBL0*_-iJnNcq^dDPhpWc!SGj z&Be89Z}+Qo3PMs+QtE|_NJV_%?R@iux_@14e0+Qv+EqeybMlgsuO0P>^O`CZdseV` zJvXB@iO^fW@|zN=(P|f0?N4Z@%70bLKc(?|1a^ocWpwenHM(wdbJK0Vm2%%bFjT!_ zYFkA`<-LkZRDz(;6*m>K-U^Dxy1=R8qCV&7{Ij=xzcfD5zZc4lg`|;D* z`9#J;hfU-%!{|gx4W?R0=;%Ft)?$1OzP0L4C^~)GhNcnj+QXr@k*a?ks3uPF+7q5mcsR1(y>KGUf9U$xfj;OQ|X<3hU~6 zQ&U^3d@8&4)g+yE6*B!d$6_35P9#pgYW_sPyG}$1UN^h6l4s*WLJ7lk+6iu2?iY z5<;SWVg3D#w$wiD#GwzZY4+DY(dm zh%^F=qHm%6t`7ED9>e?IVM!98uecgiSFUkXFzBxAS8kR1246Ip$3y4Pe(XVMNnMT> z*Q-~rj5LBNAdZg{e~cfcZmzA}sWoZS&~Ah^8i4Z{wyem(+W^exdug`y9V3 zvGwwvlQgLL8X^=?BnYRg;;G#?zt$RJeKgT+3`gfgPybV~R)5(i68-YUA`)SP#jtsR8#tM=xZL1u&CG_SB|zg*@3~w6oBb4ed=+wC z2`)^%h+*5R@!h?nutnF)B4G)EHL{1$moBIphT81^yMJbLEBUIZAL~~NkK%vd_tAbM zC!5FX?C?iFov{5Eq#h(b3Vlf>@=ohD|5xBrW9~q_eNvV^(?U77wV-c0($sl-XC$5n zMvkJ*yVYPv$#1t~>VZHG%cLc>KG^kECEEJ#An8ka0LT8X$BLnN7XQHi+0 zJg`Zyfl=4DiOJ)3S3JY}zP8)P_o?K6rG#nyZwn^>r=ha56P|jis*-D0S}Sz^(fd;( z&N(eUu;WZ3ISGxm1ZYu0;^XaM700NM`gZjl(8rv@_$8j?U8j0{*==txOG?O619xEI zW95|aYLdfvu>n?caj^?Rne<~?@;D1u}kqN8K>ZC5p-zKS@)W!fyX{!vHw2i)yL&Z<+xOM*Ivnh|-xQB~wotuP@~j1-|q431J04;kV(2O^oY4Uwij4`LCc^CHbB5W>mym zfeLNewRSZ1-W62^=nnpULm6=ldrn@M&^ex^D%Dr>PwKZly@Y%(%Wymk%s)wk=HN(9 zPHuNRVQN^erCc4Cj8@Zj#@fZ4YZlaHv;b$|C4@!``%x^?{`IrD^veMQf^vQ{u>l87 z->@z#j>rRVuy~EWxQ+{c*SC@GGAE@Yly!10$ zk(uA>bV#b3qZ!Y2A$ZB6^QUCykGD>P;NJs&L?iggt4Px9%fGJ(>BEb2x2fyh#^!BN zxtHIogT}JI+BESC!-}yVhZo9<`cilnVCMP2Ki4We+4$m9RLNAFD!5-h5;bqZ&vt8) z?56R(3c$hJc`6by)ep2zeomHv*lxVg1y6iHJyBHaU;QYDgv zK1Hhf+L-4&zB-6?v*k8~@k7K{5?WDq=Q(e4AFc%yiTKyQ%k@ zL65S*f=FD~B(9&Kc(}1=;f*O@F0Js8gnG^jbQD z8=?Z|h|wTlFIJBrDe0y3>Zg>nMar{G|6^e4p0wJ7H9z9fd8o&q7832re&I{or!l=P{o zep(gz+$0tL|9)==w2O_FN{M#PuhTkRx4jAAuICD-N4YBt|5WuOt~X~wdW2#=p$2_+ zp$F{}-bC`pP(8J)>+LShWhm7fQbqs>KuRt9Xc7FKGj-G}&(z%A+h-To&KQlDiZ!5P zNTl16Rz~0MhdK^tNIi=XG2zPyC+@mqOO!Ik+#FZ4Z{D0aLj9#x2KWCKM9Wu!nfeZO z^r-#4*%O;AqMG%_*uPnK=oLx!b|2W(qt*2}TZ$^VDd&1VUV7iQWN5N?##Fx*c9cqk z@IaLM(&k{_46#>BRbrkT&(*F^c1frC%`z_TL#|AybJ3u>l~<1%_W3V~a5%B_82s(8 zyxybT@ij94JCTe$BbJ`Z?Z+hgv-qCwWOLWqR|5l3>Xod%Q_wcWxnIBh^-0m)y1S^? z=VI;c`Wky2GMap2mp6@!UlqtyrO`*+$9^eDo{=No2mAwta=s1KmMO zAfXmLu{XEsR&}WM_I07@? z!?_F7{B2M>J+mv~2oLwx6ISq8Th~u&${W_Mvw0M!RxGQZ#yO?>*u* zu44B6*lzyZ-T36>?*>%4p5dfbDanefzZ*;y6+;V6!w-qbacncMP5wnOZP`C+Fqdw$ zpAzS+$Gf2d))|2KlTHMRx zyNlXvSpNPob^Ezt)G|8?T|*PDvDfQU&bjvjJA}+(Yn(eFAz^K8Ev=}?M!tK&R;Z(| zkC~G*?DJ>L2gHHIKVF9*9SjX0)6vl#9*1u89ZpP4yg)iQgZA^|^{2pKX#|7Mu z@9gYk)z&6vWo7vyxQ)BWvgG4``Nb@ZVDj&8K-(1_x+0WwU43rpd(OL9vsK$Eu@a7; z*u>L$Szy@1cXpruXXdT-Xs> zyL+(Ok33?J5Sjl-+F*AteWE9h;NoUgS_Ls7RhIv*X{{5+u@G2>8htDm*AiSk&Y~ah z$m3Jxfc*r34W_l*+uJ{V_Uz-orA{LglThE>2V zY=r;p>C^Z3+y4Hm|3FN6`2gKU56_gkt0!>#iosSUZj}T}aFJG>I|g>3+bS&d>k(<>dwE=H~kDmX?-k7VE#5B$VML^o!>;g?LQ+l6>2>w6!0HJ|?B^M;@ez zdwecjbv!LjyLM0Ex1exX?W1$e&&+(XAOtu)DJa6B!NH~muXCKS^5Us&cCE5I!A~xU zTcTK%7_w86c$={pt%4b zG&6??+n%m%ZDsuY=^GFb;M-2vqCem4Zz%CYlyo@zUHiJDlHP9OvznTkgq0POEQLfF z1A|9ud8)X2ZOcb+Jv~X=*%Q6~<>h5o{uM?wUXvaK_ziV+T*Q1!p!ugyAI}cg!Npm3 zryvdgZB8ijK#aa0@zGUWT>S9(cwyi5mp4>D`iV|(xGo_}4ghox4i4`6Lg;L!u1@UV z!2#>DXG34falbdc?mLrzTvuV(=wxTcPN$!mni?w@z3v|R zu8Nxqd<0Ji3F91bauc4k8k*-@KR`Rjn)7#bbHycCaXo4O>=i;gH1v1ar>j&rA%{+~{R#wYKiFulQ8Ie8M|8 zn+)53=jMLfB(XLzVV0Jbj*5u^eYeeu&P|LSRFS#0byjI9Z(&VWXQ#o=boJ88%0`AV zf{MGKpkQmFl%>#tkBu$(*DuDduCBJrqv?^6SD=_cgSH!0wT7%=2P?h9M`GVF457qW z7LqF0%1%GQzBwEUEX5?t<)Lcl74i^yhZi+bydTPSbiGS5!)kU=4F3|OsgneU1z;}& zFaw_IGuiU~@i^H@YiCwS_zN1JozMd#W8)miJ|szz1(YkOwwtlBu|eb7XHr^X)Oimy zEtL=WRFE8UXsEeRr}i^F8#{YOM#h)?e0DHM3Ri^+O|yrEZN*)jopE&fyJI-OBAYSN z%aKb>;)=8RCrst?EU}u^Sz><8OfynhZ-pb5k=p03>DFug3FiLS61^|JKEB-TCFcUS zmw0Ao#&W8Hs0fL)PK=N51l^^hyIXmg=>r626)y1us^6>A)9@Hhy~1xF5U+C!3t<)3 zGc=Ckv9Yn6?uvf`0&tFZ=NKHtQ*E2^a^pzxsW=&&9Ij!M^*eisy*=gNPzlC7>fZ23 z)D5%Am(q!qb23FY$Y~1rZBkAM8)|(#XwCo&%p5lU7g>4M9CNCt*s-+qC;XBNYT5Re zJr!xq_?A^ zv%A~ycx&Q;nCo31sX$^tatl}aqCsCz5_Z6$m=|+g`++HQ&rJah%~VL}k_=v&sOCfu zXHRPA&|GFO3OoBbm`)10WPPus6|1u!>0JpxdD#eUWzCq|cmI=TZ$m#bWuMkHb4YNN z@A&hwqW8`O;}3KHR)4kQN+PSKr@aDkk&^!wWh#hi78m&EXPCoo&S*&H%F2pwQE+hZ zXrL=uRCM$QZS7!ac>O`uBb5_!xd1Rv(>67+!enPbD;2U|x}%sKIXkO6IW^VU->=@v z)N%W&szrDyYvv=OJeWsAkher~JMV2lKCJvt$z-ozZL%w-^?SXd1N};&)4zWRL+q6L zG|CPWF1#9pD>uXs-Q`V|wBn*o4HO&vStoEJdAzRAv_C?yc#HH*q>+OkZMLMTe1Ey^ z45MiEak$mTb^G{3_W)K+5_;8$c^GN1*XBan**q34eJR5+0=@95+3H87-P z7TjU1tRMVChK}G$N<3WTwz9H;-~wMPrUfgMH_d!sA=jufu)`^hMCYJu;sq$kG^$); zdDoQDkV3h2))Ez*r(FWpMO~m%KukP@8B05V9gn?=6C;XK3N#5*grv$vsSBKrQF?Yla_{S@=ShbW;w$%BD&R| zB5U=N0Vy~ns=mBG*M|EBBa@TG_ncf@DxbZAB7QY`kfjZXe8bfC#xf0#L~n_&EDzQf zrnOU0YE>IcQ4(TH|qPj5mnIV%0_cT`{(Ew?g>T zBAWLpT*wlK0H1wnoQOT3XbOo+wFC_p(yNnq2^N>BB{=F-3x=74IvSTMhNa;7~ z=JZ@VYp0~h$n;IO&u+&*g41=H1jE!}#mWhEmu`D6zbAUQh?HodYCs3)g&x;T`6vZ8 zMH6gI*KeZ(C1h*sK%ZD>o;c2k<<%{TauDjRXKtLBY@ao3hhpHhOL%JkR*NayrmAL24N@?pcq-w%ctG_8Kb93{b<>ipm_`5p*6oFCytGM{R-=e}1?ZJvuv`e4|$snC`uGhYk2UetMRq$QT~ zZX0PtX!pH(rQA2~SgWuz11jCTzl4^Zt-`h`AEnyDTfoH&^*6WCocypQU5nNdr0lJT z3}4b!+E$DV%uB-a5B64VuM>kWFB!h&>F9soaThxTuXAzVcBzAOV`BqnnjXvhF~4IPOo*26aw-OKe1vYJ{Q zWUk+#r6C8)n+C^yjhc7P?(8nNes=NViB6aBR{8R0`bs(Q!68PrY=!ba`9h8&uH}8b zd9pL4C&+1we_F|jrP(Y+F!^CY?Xi`%rGjq_)q^byj3gGOlkflDEcGv+!p7z%fV6lU z%Cr5}m674$+Y;pSeD8Gaj&%-%T~3jWm~W*v47yDc&EK zP=7yhW-~pUnbgASOy&8>joFJnGM>~#Gj~_OEu)Kni;4gkP!F6O&Q!FA)CM7m$?fHM zDOkkB!GJ|GZy=nV^$!<^Y>T5bhT%)wYWUV{y{MTp+g|U`(40c^yzQ%LS;!^#rjhSZ z>gecfjhFbD4`*>(jIpbhbv)JS7j@ZrU@yM9azkr;d2{`T=8|)Ba?DZgJ6l^u=f~Uf zsS?Q(rKWkm+I?4adCf+lPr(?binO(obEb-=`)F?@;^9ucm2QGZuWykdtLfXK&Z#T^ ze`>K>tTZNPV;U7C>V0NeLHv8)S06U7qG6n3HAvxsH#~8zd*wWbk{-n~-D4&sEYVEa zsUtgMi$^K)-^H0dwCZn=95<<>v$K+_s|wH-%sVaL((#P?z8nCE(1qN$;rI{)3LI%hqy~(V`Gz%k#PYo z1x}-o>mCYm(n@&3!w?n{rtyM@N6>Zz)chk`M^yHl(Hg>Y)+Dk{saDAs)4 zdJ!{HfP6zsoHo^T`psds`$7-5h>px?-~pFbvvJ+0tKxlWzJp%$bB3Lh5^&+jpM~As zEvoZHdGc&YqTPMb2iq^OvML2VPNyU&ZTMXQu5Ia~AUU6^1H`~E;Z5a~v3;=>w6xLy ztbok!0*iMG*%TpU$kEYO07r2oqRTYcqhe!O$k;I_ww)>1HJ&Rf0)d0>-{r!_jtSr$ z>^e1M!P3+!OqwF1q7&5)reG6hgTKCfZbfan0TQ*ev}C)7YVzH5TkT6`*K2?y9TG$) z={z6DzebX`%vrVHx<}m#iB=Ih&CD89QnQb^6NQi2205LZbyKs&Qqqra{~9KjAWagV zX?uCS;N8ul?KUAPaDySyS1A33V(KMRM7|gSgLV?BYTk=f+{vWJg4+ir5|I*N@#Aug z_Y>$pm*C1v-&$yQL zX_Bw2yBi1qK*v~nn32==f*|d*4d-t*^t_mQ&q<7#2TtB1O z50`}4F?|iX&TwE_tw|Mg;{i?S^85sAU|`_+hYy26w`sz^np|I90;ULR`E3k4b@Zm& z?ri-nz|%mao^W{dtxA%8Zuoz7v(p5URN<=z67L1T`z7H=gE@di%1TN35eL1-#H^)N1fA~JuU{WLb~Q^)uyy)@EFkjG zoOwd9^8;@>iMXb~<3f81V+gRg?l!kl%a#Ct*9sEVzE?|=k3^d#R+a-B3;s~GUsGRR zJGuvB286_bo%vSp6Sbt}=Ub}G&3!7z=}mt8XsTUl8Fr2!yknM?N+(1j5v z<>lo7G0Bgmk^J?zzqaDA7!mTjvi?zXg7OspOd&@5EgZ_;l0Y5y-B}&Q ztGX#Ui_}8y`0)|xXV};kRG?pbp@!QBL2lp`V7~y}2qi0q(urm@Ofll=_5;O%s&rEr z@LPb?0o4SQH+}LO<5$*BfzQ?&wC?iwi*VeAk=^Vw&8P(OAxUx*4o5FjOa?zW@wqijU4Xl1RSHyz+n`Tt-0M?0^GFDSD z-GT$#U1Anm;?t}+9i30h6{_)dHs6Te2K6XGGxN)p+UMv4YnB=7a+4r%p-cMu`h3mV z9qjGfmWKPhTU%SP^eW5C*HJ-Cwl|Y4B08Gi#263$UK#1&zOMJ~=Uj?m3ODC4iibVP z=xbgQC!O5^XSBHI>X9yS1qs9JPa^dfOWP7x+pYAvA`78;NrPMpdKRxzadSi6+#tsy zf^16qiOq%ZXLB@E(waDx?ER?jJf8SyLB~cfdOeG_u(^%&YV}7_%oI-HZ@7VOfTb69 zbXXi8ACEPY0kRa}o*2@&z8X^S@bGw}(|`Hjn?QsCZ!)>R4gOp^QKz{(-$J19t^N1; z2Zth?-hkJ}Ar(nsTTX+Ekbv;G^*=vBk7_$Poa}d{MAR3Sm^biXSCK`re;=8`KNIs_ zc(bMs;QB+?G^Ewg_AwFRu5;ocx^Z@Hg@}f|;VLcIQWP%M9%_I-cANS{5Vq}5k~2nE zHYtRdC*~wk7e4L5zq};FCZv80geNRL(FdX2oMA2VR2sqQ*-*ADh7{BHqSY%OjHmh; z;lJ4Zu(2tQD^4ZmPZElA#(I}Af~&u00hUyU!O+pqSxnfoMrI+bemmcO`(HC)%79`4 zsA&aYi~cRZe=PHzN!E89n~f}{mv6i72PI|`*ZkfMEpYlN)UDr|cG6c)3vU$iGj3HI zW3VkL;()61OBw>fZD)!GOcX8h__1M6_kF6TXMO=euUPgHv|NAK;a5#Hne9HM^ zw^M%? zP$LqY*S&2dWB1iaYktFCR8J?F-0o51d>5YWshH@pKg9!qxo?v(24h)Vd%ew0lTg%N zYVWZd)ewh;QdZMseCN4XWl6iyB?dBxVe<$VE@d)*?`w<}my$f{;xORn6W3Rc;=#`Y zuwhA7i$$vKHta|SM{W)z>M$q$Ap0UZ-TKOo3*C0yJR!it{xy2|Bf`IQJ4v{=El*Z_ z%lha&sJ6IamrF7us-BMW;{5S0=sZg!(5n1vR?@BR-~x7zKSPTG=3CtBj;C!pfHc&= z8}_MYV3DxOuicBAeNJO#1En%YQ)656YiT(aoC$^`_&Q(B*0@iHiCILoWUjD27xdEa zOw2E}Wl~3p9G<@=;~LV+^=clM#3J@-{e{Cxs?*P-)|Y6!nmLK09hW_UYBYp8X->|F z2S06byE)qIDV&cyAXx4F!%~n`eY}|G7$zfp-l7mX^IA*2loH3OJ0Zf#b~0+IOn1yB z@xnYiGMOX&q}E6_Skj2SGmTyQk<_p3My{L~v}HR~QZr-NNcc&g8nc_3v88k>Y;L3q zUdYV}*dlnx{NG6vCIh6GKzfMh4g^SsimH^}w%XzEF+i`rMi!a57Tz*~$CB*lVxKFr9)X!3y=>N~rW|0B=f@QWmIkG8csY%gXdbq-9L z{wW=W-s+RiNkKK7M}Scr0b zw*dwe@Fr5Z#m&=>@W(YN?WDmNsk$k0-T{$Bfqw0q^)smXZ5$E;W=$cdZ{LT1#ku8l z8v|w-h}@Xo5~rvU?E#Y=uAK6M{r<1ax5D?Gez%AYeExXL!t|Bk_Rec}+e#>MvT(pq zH*1*&eC#Iy;OERBkrUy&Lna&gfI5;k0$>;s5fRTub|S+b>u;}ybj;1y5l3)k<;Z(T z2RXT~#63d#RJPl{2u)TstDwqYU6;MyrCCGWV|s^w2v}Uasll6y7v2FcvPNB2XI8n* zT@pr|5>;Hj>>8#T^HzC7;a(jg_ZAD1?DX_tk&`~urDJ_%c3n{=dM8;e%ZUPlQJ)EC zuD)Wnec=U05HPLmYG;4}0L&?#jZ`6eF;}kNVhMIKOjjg?#0(N4Q`@xP(yXok5;D7Ca}=+dm13mY zb&u-X;CxS4gHL6Ip0>WpK)R>FDNvJmGKI>;KBIexPjx?Z^po*qnfU_=Pgm5+LpC-x zvs>ubpUlni&dMCX`yx*n@!Q7hWF5frQlZ^LT zqvL^|m{@QX6LOzfyV^4)`4@YE`6IBVp^+SAb2GEF%1TOr`F*i)H7YD8f*Ng1O<6pS zxA2|?nk16S^^}m$6HW_I7KW6z}SZ31?pPKdnpWV~In7RE-URQi$ zrJkAdd{V3`Al`Vy+V>P&O-;VSc2b4bKR%#~di#46HY_DFfdf<7p54>kzfB7aF*J2R zQ=Qwvc(nsdmidiM1=bMRl zrr4s0RtC~&Tm8j_r%6xT3nwT3TLA02*6XhHr=}jBYyhu1Hy1y97!SSDsaIwDpMCX` zNe+3?6VHna)kutuj?VA9YE;?I2f_PmU3Q6UQYbmJGJtsYM_XSl#b49yS$5D<{X1M< zXN~}3g1>!>Pe5P@IJjV|5o3Y1z?=KM+{{G?nA2$VOQue+3g6-N4B)Z>*Sjt zg8(vnu~xyz*cfI*Aqg-8fXOHfY@@dNxs()oAPV7HJD+im1KShgF&|=5t?Rf0ZWBx` z&q-hBTVJ0dFh9D0iv^O%!5)n_@)i<_Tc8J$SeiG&f+_W$T794?Nv+WMPV21|pe5T@ zBuBm(sd*wtM0cYmot?S&xXSL6v@GrqjE+jHt5f#&_TJRNpFcb|L|RQvZKP@8`uKQX z4XUTz?H~h`RSuXYI+T_+$9t7tii)rsCnSE+y|^AzhK7sK4^WtSTcPnrNHWWO;mCag zya4^l;D7d_L8-KhP;E_(8K^)l*Y4B=%{o`R5z4Hfzb@kaDdMz&E&ti2g{xlY#~+lH zTYyUU6b1`jcel2-hJfmC(s5MhxUK{yGpcDuF@>&dd?rPW(?jdL$|y9MghReR=dF0w zZkv^9aO{~irx*Rx4n7UQ*hYBRGzEI&qMpW5hB}_TG?%M*;rvC!%F@zks=~@uEad}7 zx_JU{{|Cp%J0hOE1=)l*f4AqX934(78hlG6($y7R)BB*_+VAw%8WEkW%5AF!RbaQQ ztgO^`sKG^VFq%fTgOI?@W`%`?fz$&eM*m)u$Gp4_D4g4#sZkZ><%3A1pwS#K0!+Xi z{xCNZ^!nqQw{JW9`b+>-280aw#N)sVs;;j7pwkaP`JWy3 z=4fw@AKqr?tWa7g)_*%>X>85OckDU=jEG@U^?}@7=DocX31(xOBsj$s$7#WdwZfQz zz%7UXg^_=Ct&Y)nI}7U?V|sP2Z;x{7R@FfOxh{5yT^2AzfdGEv@&dWMpnzk;R~eYy zz*GMK2(h0km#5g9xxn%!3rv1e!RqxTc;neMv$}Ebf>tLD_RebFMzf235N4u zI@O5FNFWJ1%aet}W{>amP^hz8XBjm+tc;6|^H{V17%M<5f@%vma~>@M`{%l{I*i!V zkwG$%`NA$RGSgH<$%M4dk%-b)unh>hz@yt0_)}RKdn5Q+8J1`~<>WL4RY@iDuQo@M zodUSL9l(_a0tHaW-vfvLu+{-2Ft9k9P_z#F*>p|Ne6zK0Sd^*#v7=}V>6(IRDFWbM zWe4{BMDtaD8cGuNBO*dZL0`%3HA8P-r~Eb}jf>WfTSYfLmk}uQce!<$&)8w4opr?uC1?AYxLw@4-Z_u<8^Rwz=g?>%GGaH zmqBGwK**`ni1;o6Dv1# zR9sxwZ4-#-rGTu3BNdw&)lj8ehaFyFFBR5Q2Eu=FJ5`Oo*N{G~z=OG+L zavwqwRp#Z@W*`9-gu(xYmvay2fNH`^cb z)-DY^cR3oIz7L14tYbT0#CA40bM`;5w`(?{Wnk@3V;6NC0Pe0>1+vq^sqm+A@-gD4 zGiMR9+Rd!8NtJ-t_4;t_d@d0oNFoxHIV0aUx*X0$IK|4bhc^NkDBE z$`B*~_q_TmPeFb*3t$G!?7a&(2LEYc76xr0)S%V~Lps+|bv{uJf5vfo*Ii=U7g9nC zzr3Pu*ipJPnO->P| zd~hXkQJIoXps0{Es?(*^cB{{_$;x{*-ZH%pq>so(S!&psu(&O z_`U-{_okEe&dh}9mb1-hZQvIIA0W2XD$vsx+V8hix}V0b)}CG^){8-9?XBQj(hB7} z@hMqu%i|18PSTY1z6QbS7z3dG(O*3Bw6I{S)$)T1OJ&S@q|1PLO6ZFdYsZww`VgLf zo1T^#etRXL)|Ym-&OrJvfzp4;TXWc?^?Qpq1xb=qeMz2kGsnIHoc;99(&X=dd4;VD zw-p;a8jA@5Za1Xmem_y!@l)TxmlAM0+K+`7CsUDMBrSK1|FkrLR@CTLgln2~5(t7k z4$VdZB_Yl^+oa5P&m?bh;5 z^1o*SLX;zU0cQwWGK4U1p1$y*BH$w{KoJffwiP&&T(ils8iGo^konJV@Q| zU8AYt+#CVjx0QWOECkKsw z=o_{v1tL!1oIuQu($UOU?2t}kzgGVy$+>VvPLHrBvrjS`rn=wC!tr*qe@=Dp7rbFY_zaHgk}P{gjb z)YCuTIf$a_!9Ae9y57D*4M5?VmnR1@h-(38U~NvI|9~Y4Bumw*sFj2?hVxq zUY_I+Yxf(?#VeEboARoAm#4-^q0_(4u{W$xJ5z{H{U|$T0=-H~BHH5l$Lnfqe)H<{ zg!8O9;pJJTw3;F;7`jTRwhgt>Ybj_PWZ;qKah;3WYuuf|6VQi?ASE)4_1~t8E{84_ zQuP0LNVenZd7#2(GwR{$SQJ^a6RsKIUS&&~7aB_J?%}b%wstG6xcCR)nvXb$FO?ln zZ0>LD|5z@c08yv6RY{|Cx(V*}DlTZnI%$73W>ac1l23MK(9ZtQl1;T1ne8+t1Id#q z6E5DfBV+gjhWA$cxc-Pz;o{8Z?Z!%m3kb511rJlO`2JyfFeHN=B6K5JjE&)-&vwbl z$bKuyyl`Ya}cLq~WBfgVlZY%R=`vU=^>GEDdVn%q!(~h7t7pjEX$#W>>STC19-2V2?oz(uKXW^ZkU)Y;(0i;~WQV49>@MvQci{Tl) zxO>!%tz^4Xy-I9JiFSPoc-4)&xMMHjGTsU~1SU(>)QZnvLnbNyMfuJ@wo^M$%jwoB z{fl9h&%N3&^T%HgRQkp!k;=;lVeDbo&_PizV{v7_y*9th{(o@vI ze2NNXj)C>-Gmuoxc`4%y@?fO-!6OF3NZ4lrYrX+)P5fqS-Xz7SjAJIN`dH#dSlVpwo zCica;WDPu5h*CkBzbtYf&69yp5u!F4`}X4wuNxy;5`hf|*4~g{X?YXH1B_a==Z*-7 zLIL5tp~Jc|Z}fG<4I~BmVMOJglDT;fh@7bb(C#RnH)^)zs(_vl^-`fD@bYs{>wW8H zu+&f1;$-TcJ}VX2-D#D_^VLZMZV=PdSk$>7YjZ^GA;kdYJZT{}MVxl!_7wXKOA-C1 zv-ldt+JXrzL#08!@w=zd%uh3`3xi!Vp`a(6mhYOhfCQc z{&Oa#!GVGsi?zDn{&;dwKlxB*6bG#g>{ApW-Ow$^<5>|pKr$74*ZI-i8a8WS zI}DbE{>KaaP8%b>CbbO>60;t=;vlG_$}KlGFn|E28&1MJz|J75qtyCZNdY`e3-pcc z?d2JlIk0<7AS+BXczJ-30=~mym}yIa;l8t9U^XMWN+qypIKH=RKfZb~C=DRt>qjlO zBpUeqc(K}`w{>c(D=t%KdouCZZ|MG`m`J42hdA=nK9Tkm_fj(E((~R7c|Y1%qrJ;v zx|Y7X0^_rWUvWd)+S<}csFccsjZlAaVtc!TjQ5VrO3wVG#SCGJO_eWQc-r86$AJXb z=Z7ThByu_#0pa1{O&6yJHz4qN2cSu~nVFdoU`dgQiFp%d3rmh7H>pa1r`DMJKbHJH zdMUHzu3M~+QR}=-bB7v``tMnkqvS-3aJj7fy3WM&zq~3 zZHuXnrthZsHorxzAuc-hP~gp3t*kVS18MH^0+}aPO(egz3RG2$`-LDDQw9@Yc%a^p zf(#68+{^O+^4>VAickcQ&u=0mH+fuY9v%o0{7s|Il^dLBx~dfL@ODm7k@|87;z-P9 zRt#j|^_8N6QT4-Xc%tOn#Sj7S{l-%cVyei&B@*iS=2o34Kgy<3s=avfc&y>&LYTsq zNpamkSCg~N8@l#t?9Te8?qgzE>VBj&4 z+&k3K(2o-PXDW_HrXzQ6ZnqWO7DT4f^h zs|NTIh+W(N-Y9u`tU35`oxko?%SXBJ=*VoQ-IWHRZq%H*X-QFUcMirmL^Nv8{jjq>euYva zKG|me{kO7@Q9|td)2^Yft9+J1TJAhyW3$j73QS2!sghj6?Hg-f(viPez5VD9!jMw8$~;i93o+^fXIB*EUiMuwSck}isLp6c=pmL z3Et0Z+NUD@S__;Ms5O$O+N0Lt^;?+_F)!Zk?zyZ6%xe!=?`Z_{8w2Bn&(A1~IBtt8 zZYu}|2lHjSLgHbhas-uQVO(nGb=`2}z4pC2&EqN)&u=VnDjY(=0~>|dSo+GZkNbRA z!KBA3AiPw*Jh|@MCcy>a068M6eW2aZnHjrg4~h?bQ-QXMZQ~^$0EOf)9T$v%lvUdyp$6u-K9peepFOF!_nmjm&;S9&u#zw~uV8ZVj~k zT!K-WYJRCn>!^BW5)h&^(jtl>(~Juj{a5f|z72jD7#xmIePc0lRxlsRK|E2$+Cm-y z;?Vr%tNSoZ3N-RQuiMIx#AJ^7N?rv$!5mj)%Nf~-1pv(?~{zV_}kM!;FdhH0E_pkr>B&V`in>FuA&M{=tCk}^I3f}*m8DvH3 z!G+-h3?WI3p!6Sy7^JlPO$2^R9#G_2c8|Z<6!+-@Kj`ZAfgbc7m`Noi;caa)pyrAv zEURX$ffJ^*kZ@+^#tiz8RM?c!+w??^@75+Onqb(vPcx6w8Hy;HR{eieT?ags?fZAk z?2x@)BNC3iS0N)KGP75997VQ=LJ0|FkD`RkWUmuhWp>PLva{DQ&;LI4zQ6bVcl!7o z$9eAOe(w9auYG;50%r^bx4l}d+RXhKqet~O_Ot&Ixs1RT%f^e}&Y%rAiv%f#2Od5< zhi8ySiMfN5|MqtJu*5rKcn0ga;||_~brr>ekkYPJy!uRW?CUgl%u_5O2kSuSlS9Q?d^TsAc6YtOYAH{mn~4_$ zar|`V*q9T5T3+xz>nm22x7&x4&`PF5_iU&J%Z0`ITB>z@ww|yC|ugN(w(NhJ5 z5_ok5A|V1B9_U{rz*}4}uSHbF(%{iCJP4R+vecCvs>{8i6*Q@lLr$N|2#J=MXLNz! z&dCooCwVmx)oCvAwu$>l0@8^++eB!+Y7j7x+7BpbYpwW=d36Sx^x!P3X^IFNNT38I z@+eUH2mAxTvwa=L4LDWjF+I@N$Yr<;YdR9CCs^r#3iP@bq(m4~>cD8Yu$wRA<~-60 zB!_bE1=z`I>4S z9gP@o{}`wGsC`BMdGnQrrdJ-SV*D})^K$luJe>B05Qns{FVske1xp>Zw&h))ZP7v; z=BK#i+{fyu?_q89j5WKe)VAWv#mFp z;{>aousSp?nf?r5ZCH#Qkvmv>MrPI5X;*H;Y-qW0$@KiKXa9vj^JSIQo#|ioz&E?b z2TQhQN8oK;%kZ3j>X{k+dA3Dm3#w!OUGh9{8P#fY{rVo%1So1^TbI4$f|Q{yAqo_b)gZQ0ue7!~N5nkRek@e_P)`<@qtyef@v@DV{%NrwVUvi&w31*n z&=!UHwD~*VYIChJz6Qk$($K?Ym-|ncm+w^*HJ7}1`ZYpJ{3~+E8fyPcLoL1^6Wrp= z_DNAEMU&>(Tv#;pBy=3OlOjf-tA3%(VM-n7;bP=nvUNII*PFiqEaIbVCW}TDP31>7 z7W(R2<3<`hlf_n(qC=K?V?rh)HD>32ejN3zQkQkm{wiK`uk!JVrUf3*(E^LV-4q-i8>TzaHwJ_c@Xe?1Y6Eh%+y;$Dt#cmi0e&gu4Uo@f! z8kQ%BZY~P6?C?ysmPpfqI zTHejYe5To|bi@h5t7*ijKj&}|$EC-^aNn=aKgY~_Eb3!jrkY}Oc;L`e?XGQ1(?UT8 z3lg(oljVJ?{%3Y_YL|`{LFU8;TNw8A|D zGrH{vkv;q$ zYwm}r8NRvNuX$Or>ETCvL*s}h=PJS32uhB<&`phbVHOHtfI#m)hrKO)21*_Dn|aL4 z%zz$ztKS|NCekcT_GNkE=zt?PBkR$z3bpUg=_o1JiL;pebP5E2`QHb;su-De@m4S^ z+Ui>8RyZ-EAezuyU2Kta3sW=h_q&Mw`=C#>SPISjrJOz^fD7`x*ln-@mvjXFtOQ${ zbJ;ln1)U?x^8}72!<8dq{Ew1S2wTWCO?_+l=iOpeZaMPJKC54U(a6mVJ-&}aqH4U~0sdh)%KMRgK^g8=+aEgt;}q)LEX zXuN62+19at8xc55Zyw-R-rnZCw<@aR*984&6RO(7@3DL3B7yF2DIr7KXUIC}0X zQF3pO&8Lx|k`&wAFG>|A`o^c5Y|=AwC=wI+Qx=PlpuDcm+XdvwlqOr&KivM|R_XW|R} zZjZ_7`~9(xvb{e13=jc{7pfU>73m(aBaT=^ceZuF=FCS}qa*DS$>B4M|D`PuqV`e-zP>{;#weqc83?eFV@NZuuG;0nQ-Z7)i+ zxbA^H2FVKK{--}hnb(6;9iyIquWR4n z@+T&*LRZf$X#C;TWvwJ(U^P7*ZyaBS7B}t%?*+6k_BrMa&44-|8K0Yon$E8zx(~2^ z?a0zVRN)ohGlQA*P!#(`vX;17gjY~zEV97mWMnK<*v%F=>`8!T2mUi|!g8m-yx&bd27;*b)#GmDYTnJ8lew5IE`r7B#~8=7!vY zjXZIN``gBk(+AS-j0gh@Ug?vtcXj?nn7z!FWK+aJB)it5;5gbuNy>W%#A!1VzZKD(qx_<70iPDX zaS_NAO0KJeWI^dUaC>}N@#YakFhpKgQzHcN_)Bzjw~dV>TW6oTuw!$Ai#q328hJnf zZgg^WR^xp##rxDxUJS-~JECNHOJ=~Lx~r2Kn=tA~YtG1Fu?Gtb^9|bvz#oc1#Q?9X zHG=Bm)nlTt4sEO^<&aU%fLOi6|6aHJ`=~wiv3N{nNJI!^tEL5NPvm(nW`Y_shbP$3 z3y4DiYe{tMjUh)DDHABZwgusSKFeN^qZ_^GfY5iPdvFgq!c#_W9o=q@e1J9+2*9nN z@1XCB=CSZ&_yKHDcHf2w6#ew z!mEF#7Oz2veyn1fvZOOJkDN9%`hyF_8Q+bQMf8=^eb;|R(dgA57!(ce%jXCYu@=c` zoRES->fe)y--cQxaZdzrBymZ(+;{C~o)m`s8JJON7Hxvw`@c7H_XUH4a=uZSoiTnNAD zF&l6SHAa`imaQ@wE!Em+M9U{hMJ2O%6h?J ze?LjcBEurB%aZn8x3;{408xx^-x*Ggc>5V6+VN4HWQ%0!%v!?2Ae1WjTmKbZ)m1$D zdHOypU{wp0_}|3=hcJRtVXr@&lrgcQXu?PzSgh9hS00$w%5A^czB98R+;?X?Hr|x2 z^*jVONVa9yJTyAYBXjJ})7ewQvj8@v5Irp|L67^(^mKD{`t<3dJ&mA6cTWY8g4JT# z&U#`r^%zu1Q$sDyvUr3W^uaY*wY(IA-$XroWQjbwmfq|B=Q;JO1NK)>-)Dy$Ydvly zxMpr{K3_Rvb@C)ikFxEK@rJCEa}7@ZhWBplNE%IWwAu__xTldR&M86X)3P`r91QF1 z(PO0l`62Z`tM*-!cR^vdTg>|E)vHh%6Q_l^<-@VNN|T>l4A%TgpX6vmHJ$8CaM!wt ziBn~~eFaTM-ZM6Y!mN|G8R-P$Vr@F7JdxfSCB1}f#SJV+QElh8a33w3{RWa=fF4F` zVzCYMn%!&~PKyak{gwvd**Sw(5u<2)8r%quINw0yp=HloF zG4tQY#bGehZ!XH8S<)SSJ0CGHH8tf820Y!1pto{n+}zhoahWZ7p!_77i;D(+98BqV zrDfOme$c(>=ujdC*|zm-Z1`|k)oM50Z}MhLL~H}p#o&UP8b7nAh=Cw5)P#sv%MHF= z(#Xi@A8@H`sL-9I00C=)-_FLFqSy_>;0BD~#9a)rP?JIsY(@UF1tO&MAjgY>5nfWa zT9^&;=Op6}1As4uv?U^%o=N7%I@^lf-jm0dtyS!(r(-kD(*IH&xF zoN_(dp3&BVMXB)tC^KTp;n7KyAzP1qwZjo2UF`6$yyWEcK9g*UMlyxK^RR||Z#O!H z?*U^Q{)f7GX6@$NW32`F_=xG@A$7K`k$F)U;UV-KkVVkPk6~Q7?C|5sI8UDq=O8Nd z?h)ASOL1(qfy?AhT+ zsggN+WR-BAXUj+c$Dd=j9TBaW$ny%Ooho|w03bzruYnX%mVwAF6mk7b=@N=;4KOlLdQR)w9fd z>l9S*-r-ju)feEUQ71Q_E(m1<)Ss)QLD+K13hR)g1zVN&oEy;}K|Zo)>_zy7#uEf= z>#;#}>O3X=Sq?el5hGm)4TnWgq3A-(jpjyVF>JaS7s`0-iKzY~w7zT%n|lVo23R%s zw&o3h2e|@-l*%~l2XbzV0l?I`Vxat0C`UxQmDDaihfe3&$yaVuPDAw(c~ftqCk6Sx z&PY)yt3frU)Flg?KEO#}jq8hp!N0oYll}MEN6R0K+V2A_$+KH35i!8S-wTa_l;mb| z3Pw^o0YJ|cD&f)gBNh*OSZ^sFIjG1EwSK0M$}V)jz$ltTe|KxG;z?wTe7%r`067($ z>2!7u0U)J9tO=*$Jg+NYbueIE$~y%8vS+WyLhdN2cBY*40aieI#$i9z;Qu_?DuBC}}=F&Q=6Voy!Kw!%ta}Uz?42_YcP>g5-R&4V1l-d^#V%OQR-5_Yjcy{xP99 zJIiB4IZ$L`Oy z))!>rdz01jU0{X(P&z1&n-rm&wc}=WKCE>3v`2og>jFL8qr{yh5kVDweHM47d064o zq0$KU2VM&SvU)IqgXA~Ghq>=zn1dQpa-Q-(ycYt5MH0#KhQVSfoChlrN82UrFww>7vtQCMt3MFayx*%t)9j{m;CW^ zt~#%>0$N$E^~DR3i|`*PIg34|*DwAYKhe4Ko#f`hkU5%c^c|=ZBp0sKY_~IS`u&Vo zf3EvBV03(OE-CcI!1pCm`jZaL8Z2@EmNpqBC>7B&@wY;D5`85lBv@-#@}P7ci<)JV zp~X3rkfh$irliDFON4S{44sYvKR{8|Degpzn4t#q(&N+eBqzzT@+7AaBF^mZVSPCM zkF&mCs!F(sg)syQXS_o=sh-v!X7}`p1#sE^c|!2FmK(QQ!JvQZVOP|i{Zjd}g4~u6 zn#c-r>TmT&qSn}c1O_ym>^C2{h>!k}hN_oDah2N{y~3l#F2Vm?q6#*o)9-51i`nS| zz6jDk+M0gn1$xmO*Dk$p5r5xAoP*1^<^|P7_uHJqFE3L z8RL0r_U)P%@s9jguJku_aPk#~3>7}@JESuHDOH525aW#~A>aEzNJ74{HwIEfU&oCk#J z29e&`M`yboVy303l{Cf{d+MI5^5{XGricAj7p$I^DmhsE#8}NLtMS_8lc=^ga?WVa zc-zpHUF4qYldn@6LZMPxg8#}>E00VnGyz0fz*Tkc@lc8%z*SQQ6qTS1dfHW z-;bqB_Aw{2Tg)>dL6aq_s$jwJBcCGTqPf#;(;Sa67bEqlgM!<3Wu}rR!ZuOY zH)h;ivZu(Y0Dv4+~kGQ@N%M1N{Lk z$|)nM%g7^J1~o}Ym^=mdCF~uVu*l5rwD#WlmIzI=mRM7|@w|x;ATA}Ilxac_}@_krhSb8Xr5pZB!v4K?CuRaSqLMv9LlRCV+R!(w; z(ZvZMZc3nw-yh(E}wlc-f7#4>&g7d_Xm6J0kluE|*<$Su@1CH5x zp?8l2Y@#sJBCW!Op;uAjhs&Q5^o41s$y88=v^26dintbpEJi-yDB!9g@;mpY^MwfM z;zQ0ld7;_0k7ez`F_TER&3l)$VA(bY{GWJ~S1m3GPeO2uNY4Zk;7*TX6((!##7R2B z2r>}uyP#FR+u79GGK`0<=efxG6lzlUm1pOq=KQR=kCE{rZ8G`-0Bm_2k-}v5j7{Za z(d{mi@GXqFJ41V5o{PuG3Xdj20TESrov`)`1bIxnFT4n_+Udb9QV5Fhb$_DkF3pc| z+JxCM?1l;Exv&kp@OoXvJ69R{%l4FLOQ6Z6@`kEIkY+NSE1sRX9Or<|tT5R;+06YQ zvDc=&{hGG>nC@ieNUum+1`11F>L;Ev%n%3l%_a;BmIWE)Qe$sKYC)1gbm`U%bPPWj z`TXu&mMUskdFF8;A!9qy+0rwt2}Q;b*;jx*CK596p)@75uw!U1h_rQHxEs~Z%h*Pz zuDLe7l6_kOe6t38)AkZBJuW>g(P&6T`(UIe;=GQUn3uFhdFU_wx{N{76hl=YN)wpi zj(GGq?+c$j@wti!YwlH5hGf`d8(%Chob)k*b>5}|b2EM9neo}q$a9bmZ|P`F*P)EW zC~P?c{M9>t(8U#y2C;Nvl)?)+E3wcA?yg33m*Oz4!@-nIdh)bas2ZuWar1DM930kXNg4Z^igJj-j!!UD_hy zOq|=iBOw3{S8xZdqF{lh> zmhuq5W2-O~*o^*^IkFZ^USl^|=VNxtPqF{OIFszuQi8*)CdYkuQOb~51%ck6P%88*}Dcf(3xQClAo3Ri#3gvAS1_V_^ zIBq1=-8M!-&qXKNdobeVN-H3D5*KOvvICLz(#gpQqyI!4o~Cfqdjo9CmkSK%jB&lH z_Heb^YzW7zJ@9>CjAVi&eR%AVYK1907^K8Oy#pMvcS;Jc{l27zlHpu}x%V0XA&#`0 zi7~vx+bSHh)-hK}lR~FWlPSl^DcXb=2@S2F^rp84#POsBZy29i$*GlQ=8GB;(j`?*XZM&JGM|5qNrnzN(fmY=RqIM8yFM#t0 zw9NQ+^(`|bjxJ1hh=W<|{apG;NOxYT1X-&rU1=tgM=kSCu_=$vN5Ay+M%kag2f!lS zxlc7P#&zIb10Kl_#>D_bNSJS&l6Mt;8{CaRcbJ3u0q;p%gfm?Lk}c+zPmlWK0T%WFOM%UVgea`-Hvs!r^HoIWxRs z%-x)*G-d;%XrIF-ck=z+K~DW@%CavjBEkW6I`#dawH&6bJXgb?UHqXu~vtj_1 zBJKjVC5`5@* zRpECge(!e~xAZnjLk ze}Ao066XbICb7X{WBwLF^_R&L;hFGk#Yy9>Ty|QzsbJsud$Y>vuBuDVftHq~ zah8@0i@sfq1k{@5a}2G#?=!1(ebvs67Es39GRQp3iH5u4`<)*xHQQC1@e9&@dwIqB z1E0A{r)lNY3UnU?@4}Q~u9jV*bqR{Z60hcdC=le1g;Spn_V;V8fE^fzIUZ?lLW3?I zX$30Fq>s<-c?wpRkN4L|r939k=B>gWaod&0FBMrn&~`wtOdRPk)0kHd*1ndK#u8Pl z6M)mcBxgWU+g!g&fBMoumoIQWR!Z@FIXBL#beN0|9hdqxPyR`3`H)@t1a*g-#LzOL z`3nh&fWP(m{p;JUl*tZRUXhQguyccf#Htp+X#3ns8`S`GUD-H5bKF@>_uK(JPXLTo zJQYOD5RG~>=PsG<1zH;PLV(mu8qbf{OtiONmzyTvel~?;E?@uzR!JJe>@?AX#ZjKK zIr&~Gig*QGs(A})A(gNO)`XOH*$Z2A zTqbTiIwy?4>&&r&acsmgIo)SAVl1=y?4EjGZrsE9OhmVG z4+>bZkVTwLB_RF#Ml`jX+l5umy9{dO7#@k@OaS;VW)-|Y#Jo|rR`QM4w7MYT+@7Ht zxPZ>9K7NG0gM4vuEM1Jp!?&E9v$X}1=Ipf2rJD5hyfJ5qV!EVH66@c8e;akD02K>NXxDtmY$7mjn{*<3e zk=xl9VR-TLEH5*@Z}QS425;L1&Q3zUx3auX))R|B+MSUG(3BGLDPuB*T3eTc`l^_Q%&~U1c`UT=^yFGH*#L7x>rSWj8ej(K+Od0| z{aX#5>dayD$>b*ClPEmmm+RNw2J?q@=KloK?yNmpZ0L$pFirrwc&89(U-6yC$H#M| z3`hYR3ru;XS#djbw3MxM^2)@jb{6ZPJ?U`i@7!Vk=7*)i`ewAreaw#~`;7!B*x{Ce^hE7X5~&%49d%#d{1~z% zH!b6IcD!#=3Zj-9(qv3t>{_kDRRo!T(P{NR+psD<^ng&}3SQx)aU*Mua^IVXnybn1 z)flfIyy6#ocE0z%>uCDaG3;G_=Wq8`0z)*W9UjO@5EBBtLtRrfUi0L>z>jkITe48L zWEO5DCZ)YwyeFA(a<7#9^c-|48V4%X=KSd9W}n<r!VU zN~c?`*DE%DjaP44H(G7F4Q!y+_M56aK`{+^&@UjVs?zfOgWn#q2{l-4UPpm9~1~zE(fZMoUY}Ei-{6 zM%egJ22cX}z@oZ?o*wKXI=g0PUo|NYX!$=mg75@*(p+t$*+c*?>jf=k`dXo}Jv6w0 zoJoyuzs?nJAK*D76=@rE62+T!VfDTbN=ItH#JqX~f9D)bz zoAfx;TpKPv*#mx%L1y$1-Yh@Pap4$G^?*Jv$L|$=is=;(*MAV{pyY?v_SptsC8c$j zz&)3Qps|gBO$DgOnFsh2-=F&k-!!8A3`*DIcL9G6*%>miRyeNh3*IR3o$`M#+Y=IA z6IakNU&~wr_`U<4sX$Tz@H;^uBe|g%vS@2=`-u7V>z9%_`21`-uyM)*6ZqUD3uKWK z^;d%XOJVi%1>_lB^a6>c3t!9HyQMDPdN~NV&?r2$qD^SAUQMNFTZS9gq6#@bp>*Z$ ztulKyY;T`zHe*^{hST)tl&VDJFsHkeIMbA}`T|McfU19#ec3D@tMfa7ad)m$LerQm zO`trd^pS|ykbyshjMVw8mFxvHVi?=L)qB%E7XUg?ZxXYoyDR3Pdc6G(RI@xhKuZ-b zLdN9HS>tB-TJvD$;CMkkeEF(aK?DK!;cHUzjuPFjsKm^WA>UF8F)gC}qnFWd& z?_z<$X6;f|5#Xnaz`!dGivthuG+bQo zQd6G5vt_N+;!`F^@LXl+Lupfhz#t9Q(D@3j?ZXcP8q<~W$%?~7sKZL%cl-i!;&~o_ ziSw_s4y6Dizz{jR?&7S4R(yYl1VSsl?%sHn`Rz9X;J_&NU>(uq=~AAG8977y2`*{O zG-IEEmS}8NJUq=5>GgGHslmzku1rgeo$DmbM>O zaf2X|G_GTJ<+GbT_xSG-1d_<kp~q)O zJL4YpIGya9%}>8ddS=Oz5It^M%HCY5+3lt1i|3+wb2q;c7+!71V!WK9Z&J$LPmlF^ z(_J%uxl(v^T3fg;LEVgu8L|>wS?*yl3*wCYP^xS|vwcF)(Kjh}znQR1J_hkA37uWf zs0{}Y!MFNK}FV;t{@?QZX)oYMivS=otIpa+thwL_6F-~z9g)S30vOX z+3m4pagClxfA}ygR;cJJhmzRpz$HA`ygf3AAm$4wl|KmDNz4xV1z=$s`7Vhcq~`fs zQ+p0#zS)%rNyP{IHBNbASw^$ZnYucROJr)%(R0ZY8XwqQ&Ykq*o%pGTjU$jSa6qkX zaaNme%jN3YPZQkvt>q-7e!Q>^^(0fPdVXW>=FOWdaZ2ZC3FsJ=4L1ilFogmZDTDU) z9+P#LgMdcfw7jESWE(o?0_<=K1*qCpPteW5lR~lbyWl%?aUp5dXpq@jM&bB`g(rKQ0>TlHhSD~ zrvdbD0ZYFGb7K7M)Np$|SK*@QnYQ>1sRbC{_-ipP52kRI+@@r!)%DY{KG_K(O5MFX zFOR(?0k3_X+2c_q)pkC%aKJ+^mp&=LS9OC`Sk!2;>u#l4>@Ebn00*Eq+;(~P=}+GD zte~APJo`)HYI~!{k6Q^tLEPpwPi-YQDyY=Ia=U`JUf1tBDYU*~ePN&jzX(`gCT zn7=J;Qv*<^dl^a(iurW!S_lUQbpKJ8&Nl0{-y39igEe^Thg?=M7~+`(SQXBzOW$jBN9$bI&VL`B^i#+7Oz_YjuBrj4WltwuXG9*g z>nFc>b~xQUzodjYVzzInvHA-v+K3oO$W0V}YqEZ0PtO$AtZQ6~;tdcUV!nwD9()(E zasJEZ(G&#S{l|Sli((i*Ac-m7n+|xpqo%`CE*I=uV=85UWz_h3GlD)qZnN$K>euS+ zj~W?fAzYklwgrK2@&AB=)PFda@}7)_WFvI}`1LM~SuIAtnE z&|y6_2_djtf-PJ+BXvJumbf(?uYO=3E4Np-OuIC;rc_mMk>`GxvJC`BP$MJ}bb2|= zZ*5)Pxej2dWrbE)8|5xSmP>WTz=v#TbaeE=ZjThE5hQ%^#7h|6&w5qvYAT&qClHPem$I*Cn{f@9VJRI6>W=Kl2vG>~})WV7YY8ZBiF~TU_qlTR&-`Zz>A` zpb$XV-IJ4L3*p9y#Eyua>*>GN^66eTqJ8??aioUn3BinTu?n{|W|Jeudpv*xn%4{o zjL}6EN`+6m&*e7!f>}P9;ulKlh?T&y&WEEb^s3(*>PLHi{t{#q@dbL#DxKpBSYx>j zX#*dDZpsxUG*&+EJ;*+pFxYI^)!mmq-KIWEl?~&xWaImcZ`CRlYQ=3r|wL zRT+_hs(!+~cja*;{C;xw<}%UAnhm~!pAfuTg9eXylDbFumQK*hGFh*)paM_IeK&NeNaqipm=!GIl^_uO$)osV#^EpHLi5U5B-b_c#K| z*edpaQ3bG?>q_f4>eN9M#$qaTZ5H?SSMi=jeKMN#v+H(ZW#rDq`T5I(3ksZ8I8%hi zAFgsgs{ZYf*S_|RXZ&%yt+#ArgW+U{OvQ6w&yVIaRR;I{5l($&f{adpmeVdje;qc5 zBV=?)5WC;mQ-)vpa#VTp?VLH@XN~Hc>uYPfr!z!Kek)zP+492I>r^0u1rGNUNe(L%mP=NPx1He$_w8V`zUCXkX3jJEdhf}8}V+84xY*0u=-_KjUE~s%iLjsDtJY{bj^oT3%kh1gxa&0fkeEPXa^D))(;zUx}yU%SSR_;stxxM*^yFlZ$4lEDWs7bN3 znO~$)_AUK*qt2yGio#z1su45{(rcbi1?~1gBQ9b#zJ-z38THdc%|oZ(@P+UeDq>{H zG>t%<@9~0@8G7`i`^NYbtN7)6?@`|-Hy>^%XDVdKa6N9j0f0dTyZ3}%noQ2VY3%z} zLMH{3?CbM_xUFp+Np};oU7`eSQu0>B$>tS;Cf^pxYV&pBH8`c^89+uN913_AL=yy; z@@08mN(Kqimll9<3wOrYk#SSm)hG2+YZR;SA$IYssp)U16Z`R{IXgM2?2C#PNMV#^ zT3#*dbc;(u+SEQfS89zUjDAHn({!W}lfrKScupCZR?yK;3%KQshM#pZ9I>^K_<$>t z^y$Qn!f84iNxdRS<>l?PvktYNe<2vRZp=K$|2F8ifE$8$sw94{rmAY^ee_7c_|=&I ze7>0b$a}r}VglF)Hpp`%^Uh`JEyJGdRuBLn>_xrNOQJpqK+xtD%&pcPZM~4L&X_>ipNU?5j4yaN9QSSga z15rzB&#h`g1>bQ#f8uqy!cY)1j9mH;*4y7rY_eCj2)AzN{UViU(CqO% zE*gP*#*X7XlfGU|iXb|jj`d6%dx)`z)VF*f**pW#V3kK3xfO_a1y|Q-C^l;3tm7Kb z(~muxo5a4_OD_N$is9B0U`_|{Z|O{4$%P(+>$q0C?0CSbMisvY!d5Q^NE%26^N-bZ z$hQicH#+$DCFrs7P9pd1hEDMwl}Ou$7|*Tz;SPp7J;-k$s>(#EqmZOAY1Z)I5h#uX%?}L-Bjhc|5cyt4XVBONRc|}o-{oZI{ zY3ULuDz->xoX~XqmZY4gn|brjov~#?G63h$Axy@s7v@>Tpqb?{lMQUb#Kq4oBojEN z7p=cVfXko8aJ+|5U4fg8ATdw9a|t9?0@dRk=(RauZx3A%)`g zckB1LB{?}QiABLi#>VH==uZ>{;8G3OQGn8@04WTVj!d9Xt-YD$`@_}TAIi>ejc0dA zUAZ%dB9qU?6{IJA5(CuLZ(+~?2Q64oO>z))`}FD4m(x1XUCzurH@kZcFav@xSTK;;==(>=Lm>|7!= zepXh+Uul3cV;*A2=L%#qs2ZPpMr=@7tCoUt4SY0gtAHxxgOBEqz6x0daFJ?4F6dZj zXywLSzz!5O<5uA;LbK3BD6C7i=z3bHRG5@DN?e`8q8m1ab5m`_Nh{KNO&m*InnFqO z6SXV5vSnL3$`=xQ@iQR4N z`b39*l|JS@^AR=6a=b*OZDMFRh)c;`79Gfc^=i|HZw9KWkSZ{8)z)IQQNLhTl4Q9| zroWgr^+?NmK=#c`KjC0kyGUp&?oCbJ$B#Sp$d2tExC9LX zXB`Qf;hWh+_Bxbs!U4=g=KK<3Xz+ z%ODDz6K$0C&{+Ao)aOtyM{x68IF^X1G{1#XT@+8-)`8ZJL7v22q(IQwp%ZR|ymQiSGMBXdf{;+KO=eg5`KKux80NLiLwAAxDY+(!9U%S_CBx$uH3dD&1{aV<^G_B{ zI|Fy14y9241#$FrJw?8RPKDeg#r+#M+LS<6rVvgD4BG>ga!U!B3GBT6I_&-fZE}Jj z=DKYz^E8=G;0e1JS?+}^EmDrTIMaX4S^UL3{d!It*}Lr{B_B$V(t)6P{!!Ph@8?7-AEsK$byhGB8hpG-r-N41T`&*aWrAX|<$d)`QosT4R3&A= zAz{S6urpY>2g2$g!{YXxJ6#}B)&A>@kWh`^;fli*$N|d_-j;#}G?AwPpQeSJ7cWPU zVPC(u>C1}(OIp!O;DsgE@7W`3F|9+1W zbXU1PU0qd07@Q5trUAOH{nRG-2|Ala*K8sWtH`QV{x{M1JyHgMF9G)Bbq5HLJqeG{ zz~VFr2~h@sfCxv0VcR8P>_hx{jN71VpnkvUh2(EH?m_qN^-F?Y=!v?re1%Eal-TIq)Up*2yMP7?AJgmodaTvvoRQ~+}i>0y3%)&y!A`P+?hyy?-!bi}0a=7SD>)r~g ztE-FA5B>+g65HyLPRJ@|$dx>xxMO}6G^wDPMp0{p{kxvGM?OI=D3GNz6PWz1?O=Ue z#bbQ>Yz4%8-{j;x0?rp*nT3~6C-XsUg$-!e4DByqGfAeT#V_7~7f@z66VgBtBk(g5 z2Nc!Trh+JJ_@O1JZUP`N{r2Ev#*b=|m$Nc|Z}gvi&I27P$?jC=fYznJ|3R?=hiJ*; zI$D7n72BpLprNb`p^*|LX9Fk$ynd5L$vdrNij_rxY4-&f#y3H?fx#01O0on36z>WO z_?EXD8swAUmP|VmNvb3z|4uDHR8$o7!5Mh*V)lM57VQP#)z|?PA0WE`9-GWo5I{y2 z6odpp94QW9*?^4O=Num%E-fsSgT9~OTIHtd^0PFzZdEAs^c8<9I6Ti?E)OgD-D^4N z%&1M!bb7wt=e2FEl(wZftZmul+jsmU<(y^Y+*YgQ#8k$O+FHT4*VH;YGUNtGbkj&< zxNp7bEejkl9WNrb=Zs8EJHNlv0{91{c+~Enm)|GF4CW;Lrg@mPR{Pgi{3_31JsrxB z0rejD?~a1P;v@%JtAA--q9;=>Iq{ZaDz>+WV7nAc{bX;^oeJrrpNXk*z8;39<=hoB z|DL}BJ}If>qur$ki>Xfc=c0JAy`Dg)MsbIF2;{4afZufGw^e)PceMd#@+|<1JGg1D z`SA09D8(E!x&)0P=Rr~d)6Rq@Z{`YA^uskuaZ6We@;=m)HlN0ckeDly?XU(Y##ofNykK?!j^yx zi0-ib&p3=U?_ufSQ>VE4|4dethYnB3#Mn4Xc;i2_=}bwXXaN0>j?TU4|2zLL+%qd* zp|4*lWB>mcA48h~t33Z!L;9bo+P9FL0=;G@5KOSW22A{a^R{193atlIDIRclcW+)~ z63Yy!`oQS*P`m&LVn+qDGJ9oZU?)=L(2_Ll;0iAF>j0;(T zblUcTn266vcZwNI{v!k~30&m`8*olNN*Y9Ph4Ec=7R9O9;G-ZH8AAIquqx$!6A1^r z8jIbpEX?a=)}iN+gn`M&>eZG{7@1RhQE@`7etBEMBIqKTRZl#!ZJD5?G(R8R92Tm7 zHqV~^#_{e=S|B~Sf4XZG%%uyRUHK_+vtW+5kCjYH?sj26c>|U|yMJ!MX(A62yYcKN ztVvH_f14jitI${M=Kh9C!IYrJWH45iwOiJpvoDcAzaO?4Xb0~fL1h21_@{3pHu17= zm5UnTIRWBlVZHEs!?B_?;Ro33Qo`HCp63)ZF~DWQdPa%g!};#-v%|^92w%kWjW?S& zk%Bn^RnL$}QQ9HR?0*tfrWtqVcD{TZ-V)G8KT$v-oIhp%9h?a}I8N`aH=Ji|HHBca zc?T11>3?A5CsumKi%` zI$brWQ)9?S^jJl$up|*68{Q7e#B#Uzs9*EQ35Kde98a7+m?vx;3Tp+LP>C?C9d=5( zg^3(1rLU>X$(f^XrTwe$Rl}}H2}{KbeauW{t4E^DgN2lcm}t!LfNk|1F(2$NZkV#W zqxVkvjpK%HdVXCiR?jJtY%$5)SjWT?T7ASWw`e!G&0BMWT*SPn$HX<=NSlzM70tkMkM>j^} zJY%D)?StQ39)>_2!XH7``BaX+^8i{W3?UZ)qhVJe$0L0Dgf-~HgU#5bwj@8RxBnY@ zl@o&z!f^v*p1%XD)p@01Q*GufDx5*9LCEl*&7u-xuc>QUn$!>Id$L8oyrJR1o1|*> z@BHQppFM+~H9wy_Im4}~0w!YW@^gWxjcZsjgI&pl4`2$xm!>xgz@iBOQu0eI7t<1b znDfsxT$mlr5^I&TK0f^4%HPzc=Npd6_I%KkPqJfj>`X&Fspwg44^bBMhKQG)~3>)lI)rCLS%7) zna2Sj9Q@J1c#M&wStJBe7e#O91c92Rn=gfwJ2j$q_MJ2(htqj3NV9f_ATmY?vb+2B)!$>CifW_qZ8|DP%tCL$vT>4Nwf2@Z ze{*jpoPEkXt0PgT5{K`pO*@vSBXM~aN56FqsP8xphFE8>dTViH+?)2r1f=yYi((Bz z#wWi^V^q1--s4UaDB^yK7|X*!^Ka?Q>~l9av!W9rOkC{uzMu%qQX?^oU@D2KTi~zhq*VQ>f83E(ApxmnO8C4LfB- zzs9IxR`oA1n&40#O`l*w-Rv(gc2O`)o=Mi|W5L)<0Y%JWT7 zyK?kcqnT+&9D@O%zh`Q)4)~GLA?4vQ4ummUVZ4!JiyyC4{V6Po7cs$Uz%RP6Jpr@H z#H__4CoYb=6ZAryLCJ;Ar;If`U*>_~0&3DiD34Xzoe5)>!k*by72pp)ZzHxFkib3$ zr~X$QHgX#H7SS^$+{18UdbIV4b4vQYvx4@r@nbURV$J=REfFZ|q=70P&GDEEf68ez z#EZ~%_?B$8>1s3Hn32*M=4`6od8AP&Z|{x;F?4#lB^IL|)*OqddAgvGF!pGG;wO29 zj?<<83=krsU9;RS^k-q|*o8j1GpV0psQ#wsr4gLpahCgz4>MgkxL&mqAo~(N#o|K0Ys_QnZo!nE zZZ$-Ca!iwRWCgZkEZ%NhSK4Y;FAR?{q@yANijb0(%SIMz?Mf~1;UjA-tx%f-JCNtm^Ji>r3?Pc3=;XS!MQHO}t> z|5w+!M?u+4iXo4bHPNae5@|G^BkvFs_ufUC9%qz7o}-kw_f{y0 zF+!O<#xP#@5|=^|gB}tYLZ)k&d&XF;{<;6{^PTnWefBx~`_5YXoZsGV3V?R%c-tFb z7EzvB;iAW~GLOsrwL^U>=Ds-Alsz61Yd4+8Fq1!dRBX8k!`Z)=9Ls((bk4){5x< zis$IbY+~(=9eMpM#`Y)utRz|V6b5Tc1sM;DIYQpKF~U06g+x2|mi4XbC_zB_?}Mu= zn7{g2h4SbrH7qMBdL&C`+n|sEhq|kA-9@zspl^M1(gnT`R!We@9Cv)p(6WmS34xVd z(`#N3CNN?TiC2xoi%>Q%8F!Db$sedwk5J%qcWEJ*!~P%R@fzUFh$*M>MNUM_3`?bT zkH1!FbA+0aNOg)q9WJj zLNG$ZeDr!yzV&+LHi(T77|@E78ZugnlhWIJR(V@pYZ_-D{0|J~$C?wYLIlQ6!y8~2 zp?(Vq5f7CH*r#+Cvq#Ne?<-$6v$2bl-Ut;nUvzfp;M=fnu|h<-z)>d#;?ZE{?-BC4YSYoeF)honXqflkcO&^lyKej zO@C@X3Sa;`kk8I(F|T(7+h?P(*-v|f0LvQ5*@)xCPWGVuX>ua@8pb&!04f|1RXHsLc6wEU&g}{Q8tTq ziOg<2;F3u87@Ky@LAI}12pH)q*wcbg_30Q`%CW$ei(`%Y1g4uf`rNGfD5(1avfF1& zA@Q!q9u=f*PaycU*|B`#eg%@vfI(KR zV~U8HbTsVknp^yN7cjOUh613J?cU~bUAIRbHxAF6tWBm(ED5CrXO%du%X6_!G9Om( zH51Rp3oPw%r@*=w+KTX14y`efo_&PwXYksQ0`^yR;fOD_ils&kU_G#zHJC}ftWGfO-y&!y37yQbw z001~(U|=CJszp|!j3CkHg?C<(qacoDb%QoZ(nj!MFKMGFU9X|U6LC`2)w#&aGv;-j z&DWMz^4CmzZO|d$WbcYEKNxWN EKbaNBasU7T diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 99d8b1da6f..fb337c85b3 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -35,6 +35,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" +#include "shortcuts.h" + #include "audio.h" TopBarWidget::TopBarWidget(MainWidget *w) : TWidget(w) @@ -56,6 +58,7 @@ TopBarWidget::TopBarWidget(MainWidget *w) : TWidget(w) , _addContact(this, lang(lng_profile_add_contact), st::topBarButton) , _deleteContact(this, lang(lng_profile_delete_contact), st::topBarButton) , _mediaType(this, lang(lng_media_type), st::topBarButton) +, _search(this, st::topBarSearch) , _sideShadow(this, st::shadowColor) { connect(&_forward, SIGNAL(clicked()), this, SLOT(onForwardSelection())); @@ -66,6 +69,7 @@ TopBarWidget::TopBarWidget(MainWidget *w) : TWidget(w) connect(&_deleteContact, SIGNAL(clicked()), this, SLOT(onDeleteContact())); connect(&_edit, SIGNAL(clicked()), this, SLOT(onEdit())); connect(&_leaveGroup, SIGNAL(clicked()), this, SLOT(onDeleteAndExit())); + connect(&_search, SIGNAL(clicked()), this, SLOT(onSearch())); setCursor(style::cur_pointer); showAll(); @@ -147,6 +151,10 @@ void TopBarWidget::onDeleteAndExitSure() { } } +void TopBarWidget::onSearch() { + Shortcuts::launch(qsl("search")); +} + void TopBarWidget::enterEvent(QEvent *e) { a_over.start(1); _a_appearance.start(); @@ -261,6 +269,7 @@ void TopBarWidget::resizeEvent(QResizeEvent *e) { if (!_edit.isHidden()) _edit.move(r -= _edit.width(), 0); if (!_addContact.isHidden()) _addContact.move(r -= _addContact.width(), 0); if (!_mediaType.isHidden()) _mediaType.move(r -= _mediaType.width(), 0); + _search.move(width() - (_info.isHidden() ? st::topBarForwardPadding.right() : _info.width()) - _search.width(), 0); _sideShadow.resize(st::lineWidth, height()); _sideShadow.moveToLeft(0, 0); @@ -276,6 +285,7 @@ void TopBarWidget::startAnim() { _delete.hide(); _forward.hide(); _mediaType.hide(); + _search.hide(); _animating = true; } @@ -318,6 +328,7 @@ void TopBarWidget::showAll() { _delete.hide(); _forward.hide(); _mediaType.hide(); + _search.hide(); } else { if (p && p->isChannel() && (p->asChannel()->amCreator() || (p->isMegagroup() && p->asChannel()->amEditor()))) { _edit.show(); @@ -346,9 +357,15 @@ void TopBarWidget::showAll() { _mediaType.hide(); } } - if (App::main() && App::main()->historyPeer() && !o && !p && _clearSelection.isHidden() && Adaptive::OneColumn()) { - _info.show(); + if (h && !o && !p && _clearSelection.isHidden()) { + if (Adaptive::OneColumn()) { + _info.show(); + } else { + _info.hide(); + } + _search.show(); } else { + _search.hide(); _info.hide(); } } diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 30e40dbc34..58561a2085 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -78,6 +78,7 @@ public slots: void onDeleteContactSure(); void onDeleteAndExit(); void onDeleteAndExitSure(); + void onSearch(); signals: @@ -105,6 +106,8 @@ private: FlatButton _edit, _leaveGroup, _addContact, _deleteContact; FlatButton _mediaType; + IconedButton _search; + PlainShadow _sideShadow; }; From 47c7f76f2cc38a8ad896dc79ac008706acbf4704 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 17 Mar 2016 21:03:08 +0300 Subject: [PATCH 214/316] 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 4a54d780a7..f87d403cfd 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 eccc5255c3..63b8df37c3 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 e572f45c1d..26bcf391de 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 f260f2ca43..311fbebf8e 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 a6c0b8d887..a21faec32c 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 580306d090c84dc5f1042b2947f7b7f7dd6955ce Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Thu, 17 Mar 2016 20:46:09 +0100 Subject: [PATCH 215/316] Fix path in doc/building-xcode.md Closes #1794 Signed-off-by: Christoph Auer --- doc/building-xcode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/building-xcode.md b/doc/building-xcode.md index e520697818..a88516bc02 100644 --- a/doc/building-xcode.md +++ b/doc/building-xcode.md @@ -235,7 +235,7 @@ In Terminal go to **/Users/user/TBuild/Libraries** and run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git cd gyp ./setup.py build - sudo setup.py install + sudo ./setup.py install cd .. #####Build crashpad From 729a024ddf2330bbe5b5587848467c64d7f0542a Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Wed, 24 Feb 2016 22:10:28 +0100 Subject: [PATCH 216/316] Add Travis CI files Signed-off-by: Christoph Auer --- .travis.yml | 42 +++++++ .travis/arch.sh | 296 +++++++++++++++++++++++++++++++++++++++++++++++ .travis/build.sh | 191 ++++++++++++++++++++++++++++++ 3 files changed, 529 insertions(+) create mode 100644 .travis.yml create mode 100755 .travis/arch.sh create mode 100755 .travis/build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..11a9c3adbd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,42 @@ +sudo: required + +language: cpp + +env: + - BUILD_VERSION="" + - BUILD_VERSION="no_autoupdate" + - BUILD_VERSION="no_custom_scheme" + - BUILD_VERSION="no_autoupdate+no_custom_scheme" + +arch: + packages: + - bzr + - wget + - qt5-base + + - git + - patch + - libunity + - libappindicator-gtk2 + + - ffmpeg + - icu + - jasper + - libexif + - libmng + - libwebp + - libxkbcommon-x11 + - libinput + - libproxy + - mtdev + - openal + - libva + - desktop-file-utils + - gtk-update-icon-cache + + script: + - libtool --finish /usr/lib + - .travis/build.sh + +script: + - .travis/arch.sh \ No newline at end of file diff --git a/.travis/arch.sh b/.travis/arch.sh new file mode 100755 index 0000000000..fbe132bbd9 --- /dev/null +++ b/.travis/arch.sh @@ -0,0 +1,296 @@ +#!/bin/bash +# Copyright (C) 2016 Mikkel Oscar Lyderik Larsen +# +# This program 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. +# +# This program 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. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Source: https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh + +# Script for setting up and running a travis-ci build in an up to date +# Arch Linux chroot + +ARCH_TRAVIS_MIRROR=${ARCH_TRAVIS_MIRROR:-"https://lug.mtu.edu/archlinux"} +ARCH_TRAVIS_ARCH_ISO=${ARCH_TRAVIS_ARCH_ISO:-"$(date +%Y.%m).01"} +mirror_entry='Server = '$ARCH_TRAVIS_MIRROR'/\$repo/os/\$arch' +archive="archlinux-bootstrap-$ARCH_TRAVIS_ARCH_ISO-x86_64.tar.gz" +default_root="root.x86_64" +ARCH_TRAVIS_CHROOT=${ARCH_TRAVIS_CHROOT:-"$default_root"} +user="travis" +user_home="/home/$user" +user_build_dir="/build" +user_uid=$UID + +if [ -n "$CC" ]; then + # store travis CC + TRAVIS_CC=$CC + # reset to gcc for building arch packages + CC=gcc +fi + + +# default packages +default_packages=("base-devel" "git") + +# pacman.conf repository line +repo_line=70 + +# setup working Arch Linux chroot +setup_chroot() { + arch_msg "Setting up Arch chroot" + + if [ ! -f $archive ]; then + # get root fs + local curl=$(curl --fail -O "$ARCH_TRAVIS_MIRROR/iso/$ARCH_TRAVIS_ARCH_ISO/$archive" 2>&1) + + # if it fails, try arch iso form the previous month + if [ $? -gt 0 ]; then + ARCH_TRAVIS_ARCH_ISO="$(date +%Y.%m -d "-1 month").01" + archive="archlinux-bootstrap-$ARCH_TRAVIS_ARCH_ISO-x86_64.tar.gz" + as_normal "curl -O $ARCH_TRAVIS_MIRROR/iso/$ARCH_TRAVIS_ARCH_ISO/$archive" + fi + fi + + # extract root fs + as_root "tar xf $archive" + + # remove archive if ARCH_TRAVIS_CLEAN_CHROOT is set + if [ -n "$ARCH_TRAVIS_CLEAN_CHROOT" ]; then + as_root "rm $archive" + fi + + if [ "$ARCH_TRAVIS_CHROOT" != "$default_root" ]; then + as_root "mv $default_root $ARCH_TRAVIS_CHROOT" + fi + + # don't care for signed packages + as_root "sed -i 's|SigLevel = Required DatabaseOptional|SigLevel = Never|' $ARCH_TRAVIS_CHROOT/etc/pacman.conf" + + # enable multilib + as_root "sed -i 's|#\[multilib\]|\[multilib\]\nInclude = /etc/pacman.d/mirrorlist|' $ARCH_TRAVIS_CHROOT/etc/pacman.conf" + + # add mirror + as_root "echo $mirror_entry >> $ARCH_TRAVIS_CHROOT/etc/pacman.d/mirrorlist" + + # add nameserver to resolv.conf + as_root "echo nameserver 8.8.8.8 >> $ARCH_TRAVIS_CHROOT/etc/resolv.conf" + + sudo mount $ARCH_TRAVIS_CHROOT $ARCH_TRAVIS_CHROOT --bind + sudo mount --bind /proc $ARCH_TRAVIS_CHROOT/proc + sudo mount --bind /sys $ARCH_TRAVIS_CHROOT/sys + sudo mount --bind /dev $ARCH_TRAVIS_CHROOT/dev + sudo mount --bind /dev/pts $ARCH_TRAVIS_CHROOT/dev/pts + sudo mount --bind /dev/shm $ARCH_TRAVIS_CHROOT/dev/shm + sudo mount --bind /run $ARCH_TRAVIS_CHROOT/run + + # update packages + chroot_as_root "pacman -Syy" + chroot_as_root "pacman -Syu ${default_packages[*]} --noconfirm" + + # use LANG=en_US.UTF-8 as expected in travis environments + as_root "sed -i 's|#en_US.UTF-8|en_US.UTF-8|' $ARCH_TRAVIS_CHROOT/etc/locale.gen" + chroot_as_root "locale-gen" + + # setup non-root user + chroot_as_root "useradd -u $user_uid -m -s /bin/bash $user" + + # disable password for sudo users + as_root "echo \"$user ALL=(ALL) NOPASSWD: ALL\" >> $ARCH_TRAVIS_CHROOT/etc/sudoers.d/$user" + + # Add build dir + chroot_as_root "mkdir $user_build_dir && chown $user $user_build_dir" + + # bind $TRAVIS_BUILD_DIR to chroot build dir + sudo mount --bind $TRAVIS_BUILD_DIR $ARCH_TRAVIS_CHROOT$user_build_dir + + # add custom repos + add_repositories + + # setup pacaur for AUR packages + setup_pacaur +} + +# add custom repositories to pacman.conf +add_repositories() { + if [ ${#CONFIG_REPOS[@]} -gt 0 ]; then + for r in "${CONFIG_REPOS[@]}"; do + local splitarr=(${r//=/ }) + ((repo_line+=1)) + as_root "sed -i '${repo_line}i[${splitarr[0]}]' $ARCH_TRAVIS_CHROOT/etc/pacman.conf" + ((repo_line+=1)) + as_root "sed -i '${repo_line}iServer = ${splitarr[1]}\n' $ARCH_TRAVIS_CHROOT/etc/pacman.conf" + ((repo_line+=1)) + done + + # update repos + chroot_as_root "pacman -Syy" + fi +} + +# a wrapper which can be used to eventually add fakeroot support. +sudo_wrapper() { + sudo "$@" +} + +# run command as normal user +as_normal() { + local str="$@" + run /bin/bash -c "$str" +} + +# run command as root +as_root() { + local str="$@" + run sudo_wrapper /bin/bash -c "$str" +} + +# run command in chroot as root +chroot_as_root() { + local str="$@" + run sudo_wrapper chroot $ARCH_TRAVIS_CHROOT /bin/bash -c "$str" +} + +# run command in chroot as normal user +chroot_as_normal() { + local str="$@" + run sudo_wrapper chroot --userspec=$user:$user $ARCH_TRAVIS_CHROOT /bin/bash \ + -c "export HOME=$user_home USER=$user TRAVIS_BUILD_DIR=$user_build_dir && cd $user_build_dir && $str" +} + +# run command +run() { + "$@" + local ret=$? + + if [ $ret -gt 0 ]; then + takedown_chroot + exit $ret + fi +} + +# run build script +run_build_script() { + local cmd="$@" + echo "$ $cmd" + sudo_wrapper chroot --userspec=$user:$user $ARCH_TRAVIS_CHROOT /bin/bash -c "export HOME=$user_home USER=$user TRAVIS_BUILD_DIR=$user_build_dir && cd $user_build_dir && $cmd" + local ret=$? + + if [ $ret -gt 0 ]; then + takedown_chroot + exit $ret + fi +} + +# setup pacaur +setup_pacaur() { + local cowerarchive="cower.tar.gz" + local aururl="https://aur.archlinux.org/cgit/aur.git/snapshot/" + # install cower + as_normal "curl -O $aururl/$cowerarchive" + as_normal "tar xf $cowerarchive" + chroot_as_normal "cd cower && makepkg -is --skippgpcheck --noconfirm" + as_root "rm -r cower" + as_normal "rm $cowerarchive" + # install pacaur + chroot_as_normal "cower -dd pacaur" + chroot_as_normal "cd pacaur && makepkg -is --noconfirm" + chroot_as_normal "rm -rf pacaur" +} + +# install package through pacaur +_pacaur() { + local pacaur="pacaur -S $@ --noconfirm --noedit" + chroot_as_normal "$pacaur" +} + +# takedown chroot +# unmounts anything mounted in the chroot setup +takedown_chroot() { + sudo umount $ARCH_TRAVIS_CHROOT/{run,dev/shm,dev/pts,dev,sys,proc} + sudo umount $ARCH_TRAVIS_CHROOT$user_build_dir + sudo umount $ARCH_TRAVIS_CHROOT + + if [ -n "$ARCH_TRAVIS_CLEAN_CHROOT" ]; then + as_root "rm -rf $ARCH_TRAVIS_CHROOT" + fi +} + +# read value from .travis.yml +travis_yml() { + ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' .travis.yml $@ +} + +read_config() { + old_ifs=$IFS + IFS=$'\n' + CONFIG_BUILD_SCRIPTS=($(travis_yml arch script)) + CONFIG_PACKAGES=($(travis_yml arch packages)) + CONFIG_REPOS=($(travis_yml arch repos)) + IFS=$old_ifs +} + +# run build scripts defined in .travis.yml +build_scripts() { + if [ ${#CONFIG_BUILD_SCRIPTS[@]} -gt 0 ]; then + for script in "${CONFIG_BUILD_SCRIPTS[@]}"; do + run_build_script $script + done + else + echo "No build scripts defined" + takedown_chroot + exit 1 + fi +} + +# install packages defined in .travis.yml +install_packages() { + for package in "${CONFIG_PACKAGES[@]}"; do + _pacaur $package + done +} + +# install custom compiler if CC != gcc +install_c_compiler() { + if [ "$TRAVIS_CC" != "gcc" ]; then + _pacaur "$TRAVIS_CC" + fi +} + +arch_msg() { + lightblue='\033[1;34m' + reset='\e[0m' + echo -e "${lightblue}$@${reset}" +} + +# read .travis.yml +read_config + +echo "travis_fold:start:arch_travis" +setup_chroot + +install_packages + +if [ -n "$CC" ]; then + install_c_compiler + + # restore CC + CC=$TRAVIS_CC +fi +echo "travis_fold:end:arch_travis" +echo "" + +arch_msg "Running travis build" +build_scripts + +takedown_chroot + +# vim:set ts=2 sw=2 et: diff --git a/.travis/build.sh b/.travis/build.sh new file mode 100755 index 0000000000..62635d9701 --- /dev/null +++ b/.travis/build.sh @@ -0,0 +1,191 @@ +#!/bin/bash +# Installs libs and compiles tdesktop + +run() { + info_msg "Build version: ${BUILD_VERSION}" + + downloadLibs + prepare + build + check +} + +# set colors +RCol='\e[0m' # Text Reset + +# Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds +Bla='\e[0;30m'; BBla='\e[1;30m'; UBla='\e[4;30m'; IBla='\e[0;90m'; BIBla='\e[1;90m'; On_Bla='\e[40m'; On_IBla='\e[0;100m'; +Red='\e[0;31m'; BRed='\e[1;31m'; URed='\e[4;31m'; IRed='\e[0;91m'; BIRed='\e[1;91m'; On_Red='\e[41m'; On_IRed='\e[0;101m'; +Gre='\e[0;32m'; BGre='\e[1;32m'; UGre='\e[4;32m'; IGre='\e[0;92m'; BIGre='\e[1;92m'; On_Gre='\e[42m'; On_IGre='\e[0;102m'; +Yel='\e[0;33m'; BYel='\e[1;33m'; UYel='\e[4;33m'; IYel='\e[0;93m'; BIYel='\e[1;93m'; On_Yel='\e[43m'; On_IYel='\e[0;103m'; +Blu='\e[0;34m'; BBlu='\e[1;34m'; UBlu='\e[4;34m'; IBlu='\e[0;94m'; BIBlu='\e[1;94m'; On_Blu='\e[44m'; On_IBlu='\e[0;104m'; +Pur='\e[0;35m'; BPur='\e[1;35m'; UPur='\e[4;35m'; IPur='\e[0;95m'; BIPur='\e[1;95m'; On_Pur='\e[45m'; On_IPur='\e[0;105m'; +Cya='\e[0;36m'; BCya='\e[1;36m'; UCya='\e[4;36m'; ICya='\e[0;96m'; BICya='\e[1;96m'; On_Cya='\e[46m'; On_ICya='\e[0;106m'; +Whi='\e[0;37m'; BWhi='\e[1;37m'; UWhi='\e[4;37m'; IWhi='\e[0;97m'; BIWhi='\e[1;97m'; On_Whi='\e[47m'; On_IWhi='\e[0;107m'; + +# Set variables +_qtver=5.5.1 +srcdir=${PWD} + +downloadLibs() { + travis_fold_start "download_libs" + # Move telegram project to subfolder + mkdir tdesktop + mv -f Telegram tdesktop + + # Download libraries + info_msg "QT-Version: ${_qtver}, SRC-Dir: ${srcdir}" + + echo -e "\nDownload and extract qt" + qt_file=qt-everywhere-opensource-src-$_qtver.tar.xz + echo -e "QT-File: ${qt_file}" + + wget "http://download.qt.io/official_releases/qt/${_qtver%.*}/$_qtver/single/$qt_file" + tar xf $qt_file + rm $qt_file + + echo -e "Clone Breakpad" + git clone https://chromium.googlesource.com/breakpad/breakpad breakpad + + echo -e "\nClone Linux Syscall Support" + git clone https://chromium.googlesource.com/linux-syscall-support breakpad-lss + + echo -e "\nLets view the folder content" + ls + travis_fold_end "download_libs" +} + +prepare() { + travis_fold_start "prepare" + start_msg "Preparing the libraries..." + + cd "$srcdir/tdesktop" + + mkdir -p "$srcdir/Libraries" + + local qt_patch_file="$srcdir/tdesktop/Telegram/_qtbase_${_qtver//./_}_patch.diff" + if [ "$qt_patch_file" -nt "$srcdir/Libraries/QtStatic" ]; then + rm -rf "$srcdir/Libraries/QtStatic" + mv "$srcdir/qt-everywhere-opensource-src-$_qtver" "$srcdir/Libraries/QtStatic" + cd "$srcdir/Libraries/QtStatic/qtbase" + patch -p1 -i "$qt_patch_file" + fi + + if [ ! -h "$srcdir/Libraries/breakpad" ]; then + ln -s "$srcdir/breakpad" "$srcdir/Libraries/breakpad" + ln -s "$srcdir/breakpad-lss" "$srcdir/Libraries/breakpad/src/third_party/lss" + fi + + sed -i 's/CUSTOM_API_ID//g' "$srcdir/tdesktop/Telegram/Telegram.pro" + sed -i 's,LIBS += /usr/local/lib/libxkbcommon.a,,g' "$srcdir/tdesktop/Telegram/Telegram.pro" + sed -i 's,LIBS += /usr/local/lib/libz.a,LIBS += -lz,g' "$srcdir/tdesktop/Telegram/Telegram.pro" + + local options="" + + if [[ $BUILD_VERSION == *"no_autoupdate"* ]]; then + options+="\nDEFINES += TDESKTOP_DISABLE_AUTOUPDATE" + fi + + if [[ $BUILD_VERSION == *"no_custom_scheme"* ]]; then + options+="\nDEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" + fi + + options+='\nINCLUDEPATH += "/usr/lib/glib-2.0/include"' + options+='\nINCLUDEPATH += "/usr/lib/gtk-2.0/include"' + options+='\nINCLUDEPATH += "/usr/include/opus"' + options+='\nLIBS += -lcrypto -lssl' + + info_msg "Build options: ${options}" + + echo -e "${options}" >> "$srcdir/tdesktop/Telegram/Telegram.pro" + + success_msg "Prepare done! :)" + travis_fold_end "prepare" +} + +build() { + start_msg "Building the projects..." + + info_msg "Build patched Qt" + # Build patched Qt + cd "$srcdir/Libraries/QtStatic" + ./configure -prefix "$srcdir/qt" -release -opensource -confirm-license -qt-zlib \ + -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb \ + -qt-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests + make --silent module-qtbase module-qtimageformats + make --silent module-qtbase-install_subtargets module-qtimageformats-install_subtargets + + export PATH="$srcdir/qt/bin:$PATH" + + info_msg "Build breakpad" + # Build breakpad + cd "$srcdir/Libraries/breakpad" + ./configure + make --silent + + info_msg "Build MetaStyle" + # Build MetaStyle + mkdir -p "$srcdir/tdesktop/Linux/DebugIntermediateStyle" + cd "$srcdir/tdesktop/Linux/DebugIntermediateStyle" + qmake CONFIG+=debug "../../Telegram/MetaStyle.pro" + make --silent + + info_msg "Build MetaLang" + # Build MetaLang + mkdir -p "$srcdir/tdesktop/Linux/DebugIntermediateLang" + cd "$srcdir/tdesktop/Linux/DebugIntermediateLang" + qmake CONFIG+=debug "../../Telegram/MetaLang.pro" + make --silent + + info_msg "Build Telegram Desktop" + # Build Telegram Desktop + mkdir -p "$srcdir/tdesktop/Linux/ReleaseIntermediate" + cd "$srcdir/tdesktop/Linux/ReleaseIntermediate" + + qmake CONFIG+=release "../../Telegram/Telegram.pro" + local pattern="^PRE_TARGETDEPS +=" + grep "$pattern" "$srcdir/tdesktop/Telegram/Telegram.pro" | sed "s/$pattern//g" | xargs make + + qmake CONFIG+=release "../../Telegram/Telegram.pro" + make +} + +check() { + local filePath="$srcdir/tdesktop/Linux/Release/Telegram" + if test -f "$filePath"; then + success_msg "Build successful done! :)" + + local size; + size=$(stat -c %s "$filePath") + success_msg "File size of ${filePath}: ${size} Bytes" + else + error_msg "Build error, output file does not exist" + exit 1 + fi +} + +start_msg() { + echo -e "\n${Gre}$*${RCol}" +} + +info_msg() { + echo -e "\n${Cya}$*${RCol}" +} + +error_msg() { + echo -e "\n${BRed}$*${RCol}" +} + +success_msg() { + echo -e "\n${BGre}$*${RCol}" +} + +travis_fold_start() { + echo "travis_fold:start:$*" +} + +travis_fold_end() { + echo "travis_fold:end:$*" +} + +run From 6e441312cb4755f3763174799b8f77ab107c87c6 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Thu, 17 Mar 2016 22:21:46 +0100 Subject: [PATCH 217/316] Remove duplicated information Signed-off-by: Christoph Auer --- doc/building-xcode.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/building-xcode.md b/doc/building-xcode.md index a88516bc02..c638310682 100644 --- a/doc/building-xcode.md +++ b/doc/building-xcode.md @@ -90,10 +90,6 @@ In Terminal go to **/Users/user/TBuild/Libraries/xz-5.0.5** and there run: make sudo make install -####zlib 1.2.8 - -Using the system lib - ####libexif 0.6.20 #####Get the source code From baf1e31b76136ab96a0e15a45776403547650d58 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 18 Mar 2016 13:18:30 +0300 Subject: [PATCH 218/316] 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 833054800d..72d9397c23 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 487e2d5378..cfe7664f34 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 a90b299a7b..0b7aa9d19c 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 5a4823d1ce..02b8e4f5ef 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 63b8df37c3..e26e44f528 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 26bcf391de..d0f2737d23 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 eda1211031..9da1f933a5 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 63c7713793..0622dca277 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 846ae6e762..5eb4d1c4e5 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 0b8b34fb82..ecbdfcb6ad 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 b7bfc4ab0b..ab7c346962 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 118ba1c92d..4eba35bfe4 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 fb337c85b3..5c02a99e4b 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 fc1734194c..8536033040 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 c28c5fba1a..95dc8911b6 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 898ac1cee8..82304ce547 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 a21faec32c..330d39d240 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 ce45404dde..ed5ef5585b 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 23616afcdd..d8630ccc02 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 aad3a11f0e..ab36c4734b 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 219/316] 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 e26e44f528..f928fe630d 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 d0f2737d23..37139dfa35 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 5eb4d1c4e5..df3f9790da 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 e029752e1c..d8697decb7 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 ecbdfcb6ad..dfede8936e 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 1ee9fc014b..cc94d93a3a 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 5c02a99e4b..5681ca6854 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 9adbd6b08a..70c9a75588 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 8cc7e86793ece8f423c87b69430fea09828e22b2 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 18 Mar 2016 21:06:16 +0100 Subject: [PATCH 220/316] Add build status badge to readme Signed-off-by: Christoph Auer --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4f9b406f71..f4edaa4795 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This is the complete source code and the build instructions for the alpha version of the official desktop client for the [Telegram][telegram] messenger, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol. +[![Build Status](https://travis-ci.org/telegramdesktop/tdesktop.svg?branch=master)](https://travis-ci.org/telegramdesktop/tdesktop) + The source code is published under GPLv3 with OpenSSL exception, the license is available [here][license]. ## Supported systems From 2ef06a0baacf789a0930bd8816ad3e3eacd2547e Mon Sep 17 00:00:00 2001 From: Soltan Tekeev Date: Fri, 18 Mar 2016 22:13:12 +0300 Subject: [PATCH 221/316] Add "Copy name" option (Requested in #1783) Also add lng_profile_copy_fullname to lang.strings Signed-off-by: Soltan Tekeev (github: stek29) --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/profilewidget.cpp | 10 +++++++++- Telegram/SourceFiles/profilewidget.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 9039db9024..8552a51da7 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# shared link|# shared links} »"; "lng_profile_shared_links_header" = "Shared links overview"; "lng_profile_copy_phone" = "Copy phone number"; +"lng_profile_copy_fullname" = "Copy name"; "lng_channel_add_admins" = "New administrator"; "lng_channel_add_members" = "Add members"; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index c28c5fba1a..b74ff68905 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1503,10 +1503,13 @@ void ProfileInner::contextMenuEvent(QContextMenuEvent *e) { _menu->deleteLater(); _menu = 0; } - if (!_phoneText.isEmpty() || (_peerUser && !_peerUser->username.isEmpty())) { + if (!_phoneText.isEmpty() || _peerUser) { QRect info(_left + st::profilePhotoSize + st::profilePhoneLeft, st::profilePadding.top(), _width - st::profilePhotoSize - st::profilePhoneLeft, st::profilePhotoSize); if (info.contains(mapFromGlobal(e->globalPos()))) { _menu = new PopupMenu(); + if (_peerUser) { + _menu->addAction(lang(lng_profile_copy_fullname), this, SLOT(onCopyFullName()))->setEnabled(true); + } if (!_phoneText.isEmpty()) { _menu->addAction(lang(lng_profile_copy_phone), this, SLOT(onCopyPhone()))->setEnabled(true); } @@ -1526,6 +1529,11 @@ void ProfileInner::onMenuDestroy(QObject *obj) { } } +void ProfileInner::onCopyFullName() { + if (!_peerUser) return; + QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName)); +} + void ProfileInner::onCopyPhone() { QApplication::clipboard()->setText(_phoneText); } diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 23b6fcd029..0587884ff1 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -109,6 +109,7 @@ public slots: void onMediaLinks(); void onMenuDestroy(QObject *obj); + void onCopyFullName(); void onCopyPhone(); void onCopyUsername(); From 2ef8c4444534c32100c9e2c02860da74c1fb9c24 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 19 Mar 2016 19:55:15 +0300 Subject: [PATCH 222/316] 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 4632b36f19..720e37ccc2 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 61e44eef0b..39956672a9 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 aeaaf5c87b..36ea5d7912 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 610f6a26a0..23809f40c3 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 1f69aaaa43..3e0a37e565 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 6393fc3dd5..48a5834ccf 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 c70c7caf0d..8a39799e0f 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 9de6652530..3e379aae00 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 b0815abb21..c90e4c0b47 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 cfe7664f34..f3a202ccc8 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 b9632b4f8e..fd0d70e0ab 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 356fd4b60f..fc2c9a5138 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 0b7aa9d19c..15c6d61b4c 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 02b8e4f5ef..a2fe08399d 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 bacf6149c1..f4d18ae301 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 f928fe630d..378d807f94 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 37139dfa35..09f71b91f5 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 df3f9790da..3567190604 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 d8697decb7..3797526976 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 dfede8936e..0ebf050ae5 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 cc94d93a3a..c9b38f4851 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 810f3fb532..f915ab3a71 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 4ce85fa758..498d43831b 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 4eba35bfe4..d0959f05ea 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 5681ca6854..c420db743b 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 58561a2085..88ee43f4f5 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 de413ceae1..a802e721db 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 689665b81b..b3cd87f1a8 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 470bc0db34..e741844831 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 8ac08b94bd..d0513848b8 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 48bd7fd52d..38b810a2a8 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 3e2647d17a..05c26b8e3f 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 0cb0c3bff5..854894f708 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 2efc246a11..14c165cd87 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 db65f23781..7c487353cb 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 67013cf181..4e5bea4989 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 c98fe4a55d..8e7b0321b4 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 93524bba88..18b069258e 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 330d39d240..8b87d1c53c 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 ed5ef5585b..9be7d77c19 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 d8630ccc02..5b41f375e6 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 70c9a75588..9c590eca58 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 ab36c4734b..b14e63cefb 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 223/316] 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 3567190604..85188c2839 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 3797526976..da98d29553 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 224/316] 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 2050bfcbf3..4108f7ad27 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 39956672a9..776cd91c87 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 36ea5d7912..43ddf5f61e 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 23809f40c3..3189c73f8e 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 48a5834ccf..25f11dc58c 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 8a39799e0f..0d4178a5d1 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 27b2ce7ff4..aa5ebd7675 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 13786841f4..247db630fc 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 85188c2839..ad6c2ead0b 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 d0959f05ea..0bcdb8be83 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 5a1e5d5200..aaad6db26d 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 c420db743b..5fc4200ac1 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 a802e721db..433d9c2aeb 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 e741844831..9903cfd54d 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 d0513848b8..113cd63c15 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 05c26b8e3f..b87938ab9c 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 311fbebf8e..54a6740f6d 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 f64ac4d456..c3097b57c4 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 7c487353cb..199ec12e7f 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 4e5bea4989..c75c846985 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 82304ce547..72adf52224 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 8b87d1c53c..6eb6232708 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 d2ed56902d..667921ba44 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 9c590eca58..b630a481ec 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 99397eaaab..e3c7032b1e 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 225/316] 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 aaad6db26d..d4ba079b2e 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 7003daa426..f0128a173a 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 0000000000..4a2aa5a69e --- /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 0000000000..0f149ad290 --- /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 15192dbd93..0bd01d56d8 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 e3c7032b1e..c3b16f57ea 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 a0da01041d..b1fff4cc41 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 961347559a..ad99832894 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 226/316] 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 d4ba079b2e..612eebff15 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 b630a481ec..4ec1d299cc 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 c3b16f57ea..f6d50ce38d 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 227/316] 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 913465e84b..87e01f6a3e 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 b606613d0a..50684f6611 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 000c239bdb..da7e31e602 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 b79c0f7adb..85096528f9 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 72adf52224..ae9f029a44 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 0f149ad290..75238b7895 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 53a464500f..987153bf23 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 22bc151150..da667bb396 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 b14e63cefb..ff088c2696 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 29b8566f9b..cecad8cf73 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 228/316] 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 1e45af88d0..f1a2190408 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 e52f185726..d627e86837 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 ad6c2ead0b..d205c11849 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 da98d29553..cec01a29d3 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 0ebf050ae5..4e886df4c2 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 c9b38f4851..ab5647a9c9 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 5fc4200ac1..690bf327b4 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 b87938ab9c..c8a3f2b327 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 9be7d77c19..3f7022ac7a 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); From 1919501d1e1829c3deaa03738462d4c1039cc6e9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 21 Mar 2016 21:41:39 +0300 Subject: [PATCH 229/316] Qt compiled with force-debug-info, some langs improved, some override specifiers added --- Telegram/Resources/lang.strings | 6 +++--- Telegram/SourceFiles/intro/introcode.h | 6 +++--- Telegram/SourceFiles/intro/intropwdcheck.h | 4 ++-- Telegram/SourceFiles/intro/introsignup.h | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 4 ---- doc/building-msvc.md | 2 +- doc/building-qtcreator.md | 2 +- doc/building-xcode-old.md | 2 +- doc/building-xcode.md | 2 +- 9 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 9039db9024..f567608f2e 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -678,9 +678,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "Are you sure you want to report spam in this group?"; "lng_report_spam_sure_channel" = "Are you sure you want to report spam in this channel?"; "lng_report_spam_ok" = "Report"; -"lng_cant_send_to_not_contact" = "Sorry, you can only send messages to\nmutual contacts at the moment. {more_info}"; -"lng_cant_invite_not_contact" = "Sorry, you can only add mutual contacts\nto groups at the moment. {more_info}"; -"lng_cant_invite_not_contact_channel" = "Sorry, you can only add mutual contacts\nto channels at the moment. {more_info}"; +"lng_cant_send_to_not_contact" = "Sorry, you can only send messages to\nmutual contacts at the moment.\n{more_info}"; +"lng_cant_invite_not_contact" = "Sorry, you can only add mutual contacts\nto groups at the moment.\n{more_info}"; +"lng_cant_invite_not_contact_channel" = "Sorry, you can only add mutual contacts\nto channels at the moment.\n{more_info}"; "lng_cant_more_info" = "More info »"; "lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings."; "lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; diff --git a/Telegram/SourceFiles/intro/introcode.h b/Telegram/SourceFiles/intro/introcode.h index 682f60105e..8b88ab303e 100644 --- a/Telegram/SourceFiles/intro/introcode.h +++ b/Telegram/SourceFiles/intro/introcode.h @@ -49,12 +49,12 @@ public: IntroCode(IntroWidget *parent); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; void step_error(float64 ms, bool timer); - bool hasBack() const { + bool hasBack() const override { return true; } void activate() override; diff --git a/Telegram/SourceFiles/intro/intropwdcheck.h b/Telegram/SourceFiles/intro/intropwdcheck.h index 9814a5743a..43e4b3953c 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.h +++ b/Telegram/SourceFiles/intro/intropwdcheck.h @@ -32,8 +32,8 @@ public: IntroPwdCheck(IntroWidget *parent); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; void step_error(float64 ms, bool timer); diff --git a/Telegram/SourceFiles/intro/introsignup.h b/Telegram/SourceFiles/intro/introsignup.h index cd166b8a5e..c7be7d7fe4 100644 --- a/Telegram/SourceFiles/intro/introsignup.h +++ b/Telegram/SourceFiles/intro/introsignup.h @@ -32,10 +32,10 @@ public: IntroSignup(IntroWidget *parent); - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mousePressEvent(QMouseEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; void step_error(float64 ms, bool timer); void step_photo(float64 ms, bool timer); diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 0596a0e839..710e4fea7d 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -284,8 +284,6 @@ 071AD86E1C5E8536008C9E90 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = ThirdParty/minizip/zip.h; sourceTree = SOURCE_ROOT; }; 071AD8D11C5E8E6D008C9E90 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = ThirdParty/minizip/zip.c; sourceTree = SOURCE_ROOT; }; 071AD8F71C5E99D6008C9E90 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = ThirdParty/minizip/ioapi.c; sourceTree = SOURCE_ROOT; }; - 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Breakpad.framework; path = Users/antanubis/TBuild/Libraries/breakpad/Breakpad.framework; sourceTree = ""; }; - 071AD90B1C5EA37D008C9E90 /* Breakpad.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Breakpad.framework; path = "Users/antanubis/Library/Developer/Xcode/DerivedData/Breakpad-ffxagkgqghkohhawycvgjexmnjhs/Build/Products/Debug/Breakpad.framework"; sourceTree = ""; }; 072E117A1A56EB9400A87ACC /* lang_pt_BR.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = lang_pt_BR.strings; path = SourceFiles/langs/lang_pt_BR.strings; sourceTree = SOURCE_ROOT; }; 0732E4A7199E262300D50FE7 /* overviewwidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = overviewwidget.cpp; path = SourceFiles/overviewwidget.cpp; sourceTree = SOURCE_ROOT; }; 0732E4A8199E262300D50FE7 /* overviewwidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = overviewwidget.h; path = SourceFiles/overviewwidget.h; sourceTree = SOURCE_ROOT; }; @@ -1256,8 +1254,6 @@ AF39DD055C3EF8226FBE929D /* Frameworks */ = { isa = PBXGroup; children = ( - 071AD90B1C5EA37D008C9E90 /* Breakpad.framework */, - 071AD9091C5EA2A5008C9E90 /* Breakpad.framework */, 0752F8741C2C89F40026D0BC /* VideoToolbox.framework */, 0752F8721C2C89220026D0BC /* VideoDecodeAcceleration.framework */, 07CAACD71AEA64F00058E508 /* AudioUnit.framework */, diff --git a/doc/building-msvc.md b/doc/building-msvc.md index 644839a307..a0f1140f01 100644 --- a/doc/building-msvc.md +++ b/doc/building-msvc.md @@ -178,7 +178,7 @@ If you already have Windows SDKs then find the library folder and correct it at #####Building library - configure -debug-and-release -opensource -confirm-license -static -I "D:\TBuild\Libraries\openssl\Release\include" -L "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib" -l Gdi32 -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="D:\TBuild\Libraries\openssl_debug\Debug\lib\ssleay32.lib D:\TBuild\Libraries\openssl_debug\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="D:\TBuild\Libraries\openssl\Release\lib\ssleay32.lib D:\TBuild\Libraries\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015 + configure -debug-and-release -force-debug-info -opensource -confirm-license -static -I "D:\TBuild\Libraries\openssl\Release\include" -L "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib" -l Gdi32 -no-opengl -openssl-linked OPENSSL_LIBS_DEBUG="D:\TBuild\Libraries\openssl_debug\Debug\lib\ssleay32.lib D:\TBuild\Libraries\openssl_debug\Debug\lib\libeay32.lib" OPENSSL_LIBS_RELEASE="D:\TBuild\Libraries\openssl\Release\lib\ssleay32.lib D:\TBuild\Libraries\openssl\Release\lib\libeay32.lib" -mp -nomake examples -nomake tests -platform win32-msvc2015 nmake nmake install diff --git a/doc/building-qtcreator.md b/doc/building-qtcreator.md index 28184888b9..30b93ab9c1 100644 --- a/doc/building-qtcreator.md +++ b/doc/building-qtcreator.md @@ -147,7 +147,7 @@ Install some packages for Qt (see **/home/user/TBuild/Libraries/QtStatic/qtbase/ In Terminal go to **/home/user/TBuild/Libraries/QtStatic** and there run - OPENSSL_LIBS='/usr/local/ssl/lib/libssl.a /usr/local/ssl/lib/libcrypto.a' ./configure -release -opensource -confirm-license -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon-x11 -no-opengl -static -openssl-linked -nomake examples -nomake tests + OPENSSL_LIBS='/usr/local/ssl/lib/libssl.a /usr/local/ssl/lib/libcrypto.a' ./configure -release -force-debug-info -opensource -confirm-license -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-xkbcommon-x11 -no-opengl -static -openssl-linked -nomake examples -nomake tests make -j4 sudo make -j4 install diff --git a/doc/building-xcode-old.md b/doc/building-xcode-old.md index a42f03f1f5..332fa34471 100644 --- a/doc/building-xcode-old.md +++ b/doc/building-xcode-old.md @@ -183,7 +183,7 @@ From **/Users/user/TBuild/Libraries/QtStatic/qtimageformats**, run: Go to **/Users/user/TBuild/Libraries/QtStatic** and run: - ./configure -debug-and-release -opensource -confirm-license -static -opengl desktop -nomake examples -nomake tests -platform macx-g++ + ./configure -debug-and-release -force-debug-info -opensource -confirm-license -static -opengl desktop -nomake examples -nomake tests -platform macx-g++ make -j4 sudo make -j4 install diff --git a/doc/building-xcode.md b/doc/building-xcode.md index e520697818..e470f1f06b 100644 --- a/doc/building-xcode.md +++ b/doc/building-xcode.md @@ -219,7 +219,7 @@ From **/Users/user/TBuild/Libraries/QtStatic/qtbase**, run: Go to **/Users/user/TBuild/Libraries/QtStatic** and run: - ./configure -debug-and-release -opensource -confirm-license -static -opengl desktop -no-openssl -securetransport -nomake examples -nomake tests -platform macx-clang + ./configure -debug-and-release -force-debug-info -opensource -confirm-license -static -opengl desktop -no-openssl -securetransport -nomake examples -nomake tests -platform macx-clang make -j4 sudo make -j4 install From fd7a30f1436ce0651e8106677eaf902fa39f6e60 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 21 Mar 2016 21:57:03 +0300 Subject: [PATCH 230/316] override specifiers added, retina bug in image circle fixed --- Telegram/SourceFiles/gui/images.cpp | 1 + Telegram/SourceFiles/history.h | 296 +++++++++---------- Telegram/SourceFiles/localstorage.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpConnection.h | 4 +- Telegram/SourceFiles/pspecific_mac.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 4 + Telegram/SourceFiles/structs.h | 1 + 7 files changed, 158 insertions(+), 152 deletions(-) diff --git a/Telegram/SourceFiles/gui/images.cpp b/Telegram/SourceFiles/gui/images.cpp index 9da1f933a5..de9dbeee63 100644 --- a/Telegram/SourceFiles/gui/images.cpp +++ b/Telegram/SourceFiles/gui/images.cpp @@ -416,6 +416,7 @@ const QPixmap &circleMask(int width, int height) { p.setPen(Qt::NoPen); p.drawEllipse(0, 0, width, height); } + mask.setDevicePixelRatio(cRetinaFactor()); i = masks.insert(key, QPixmap::fromImage(mask)); } return i.value(); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index cec01a29d3..a6c8c8fdee 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1710,58 +1710,58 @@ public: HistoryPhoto(PeerData *chat, const MTPDphoto &photo, int32 width = 0); HistoryPhoto(const HistoryPhoto &other); void init(); - HistoryMediaType type() const { + HistoryMediaType type() const override { return MediaTypePhoto; } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistoryPhoto(*this); } - void initDimensions(const HistoryItem *parent); - int32 resize(int32 width, const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; + int32 resize(int32 width, const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; PhotoData *photo() const { return _data; } - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) override; void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - bool hasReplyPreview() const { + bool hasReplyPreview() const override { return !_data->thumb->isNull(); } - ImagePtr replyPreview(); + ImagePtr replyPreview() override; - QString getCaption() const { + QString getCaption() const override { return _caption.original(); } - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } - bool customInfoLayout() const { + bool customInfoLayout() const override { return _caption.isEmpty(); } - bool hideFromName() const { + bool hideFromName() const override { return true; } protected: - float64 dataProgress() const { + float64 dataProgress() const override { return _data->progress(); } - bool dataFinished() const { + bool dataFinished() const override { return !_data->loading() && !_data->uploading(); } - bool dataLoaded() const { + bool dataLoaded() const override { return _data->loaded(); } @@ -1777,60 +1777,60 @@ public: HistoryVideo(DocumentData *document, const QString &caption, const HistoryItem *parent); HistoryVideo(const HistoryVideo &other); - HistoryMediaType type() const { + HistoryMediaType type() const override { return MediaTypeVideo; } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistoryVideo(*this); } - void initDimensions(const HistoryItem *parent); - int32 resize(int32 width, const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; + int32 resize(int32 width, const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; - DocumentData *getDocument() { + DocumentData *getDocument() override { return _data; } - bool uploading() const { + bool uploading() const override { return _data->uploading(); } void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - bool hasReplyPreview() const { + bool hasReplyPreview() const override { return !_data->thumb->isNull(); } - ImagePtr replyPreview(); + ImagePtr replyPreview() override; - QString getCaption() const { + QString getCaption() const override { return _caption.original(); } - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } - bool customInfoLayout() const { + bool customInfoLayout() const override { return _caption.isEmpty(); } - bool hideFromName() const { + bool hideFromName() const override { return true; } protected: - float64 dataProgress() const { + float64 dataProgress() const override { return _data->progress(); } - bool dataFinished() const { + bool dataFinished() const override { return !_data->loading() && !_data->uploading(); } - bool dataLoaded() const { + bool dataLoaded() const override { return _data->loaded(); } @@ -1888,56 +1888,56 @@ public: HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent); HistoryDocument(const HistoryDocument &other); - HistoryMediaType type() const { + HistoryMediaType type() const override { return _data->voice() ? MediaTypeVoiceFile : (_data->song() ? MediaTypeMusicFile : MediaTypeFile); } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistoryDocument(*this); } - void initDimensions(const HistoryItem *parent); - int32 resize(int32 width, const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; + int32 resize(int32 width, const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; - bool uploading() const { + bool uploading() const override { return _data->uploading(); } - DocumentData *getDocument() { + DocumentData *getDocument() override { return _data; } void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) override; - bool hasReplyPreview() const { + bool hasReplyPreview() const override { return !_data->thumb->isNull(); } - ImagePtr replyPreview(); + ImagePtr replyPreview() override; - QString getCaption() const { + QString getCaption() const override { if (const HistoryDocumentCaptioned *captioned = Get()) { return captioned->_caption.original(); } return QString(); } - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return true; } - bool customInfoLayout() const { + bool customInfoLayout() const override { return false; } - QMargins bubbleMargins() const { + QMargins bubbleMargins() const override { return Get() ? QMargins(st::msgFileThumbPadding.left(), st::msgFileThumbPadding.top(), st::msgFileThumbPadding.left(), st::msgFileThumbPadding.bottom()) : st::msgPadding; } - bool hideForwardedFrom() const { + bool hideForwardedFrom() const override { return _data->song(); } @@ -1945,13 +1945,13 @@ public: protected: - float64 dataProgress() const { + float64 dataProgress() const override { return _data->progress(); } - bool dataFinished() const { + bool dataFinished() const override { return !_data->loading() && !_data->uploading(); } - bool dataLoaded() const { + bool dataLoaded() const override { return _data->loaded(); } @@ -1971,30 +1971,30 @@ public: HistoryGif(DocumentData *document, const QString &caption, const HistoryItem *parent); HistoryGif(const HistoryGif &other); - HistoryMediaType type() const { + HistoryMediaType type() const override { return MediaTypeGif; } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistoryGif(*this); } - void initDimensions(const HistoryItem *parent); - int32 resize(int32 width, const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; + int32 resize(int32 width, const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; - bool uploading() const { + bool uploading() const override { return _data->uploading(); } - DocumentData *getDocument() { + DocumentData *getDocument() override { return _data; } - ClipReader *getClipReader() { + ClipReader *getClipReader() override { return gif(); } @@ -2004,23 +2004,23 @@ public: void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) override; - bool hasReplyPreview() const { + bool hasReplyPreview() const override { return !_data->thumb->isNull(); } - ImagePtr replyPreview(); + ImagePtr replyPreview() override; - QString getCaption() const { + QString getCaption() const override { return _caption.original(); } - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); } - bool customInfoLayout() const { + bool customInfoLayout() const override { return _caption.isEmpty(); } - bool hideFromName() const { + bool hideFromName() const override { return true; } @@ -2028,9 +2028,9 @@ public: protected: - float64 dataProgress() const; - bool dataFinished() const; - bool dataLoaded() const; + float64 dataProgress() const override; + bool dataFinished() const override; + bool dataLoaded() const override; private: @@ -2056,35 +2056,35 @@ class HistorySticker : public HistoryMedia { public: HistorySticker(DocumentData *document); - HistoryMediaType type() const { + HistoryMediaType type() const override { return MediaTypeSticker; } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistorySticker(*this); } - void initDimensions(const HistoryItem *parent); - int32 resize(int32 width, const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; + int32 resize(int32 width, const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; - DocumentData *getDocument() { + DocumentData *getDocument() override { return _data; } void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) override; - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return false; } - bool customInfoLayout() const { + bool customInfoLayout() const override { return true; } @@ -2120,30 +2120,30 @@ class HistoryContact : public HistoryMedia { public: HistoryContact(int32 userId, const QString &first, const QString &last, const QString &phone); - HistoryMediaType type() const { + HistoryMediaType type() const override { return MediaTypeContact; } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistoryContact(_userId, _fname, _lname, _phone); } - void initDimensions(const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - void updateFrom(const MTPMessageMedia &media, HistoryItem *parent); + void updateFrom(const MTPMessageMedia &media, HistoryItem *parent) override; - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return true; } - bool customInfoLayout() const { + bool customInfoLayout() const override { return false; } @@ -2176,32 +2176,32 @@ public: HistoryWebPage(WebPageData *data); HistoryWebPage(const HistoryWebPage &other); - HistoryMediaType type() const { + HistoryMediaType type() const override { return MediaTypeWebPage; } - HistoryMedia *clone() const { + HistoryMedia *clone() const override { return new HistoryWebPage(*this); } - void initDimensions(const HistoryItem *parent); - int32 resize(int32 width, const HistoryItem *parent); + void initDimensions(const HistoryItem *parent) override; + int32 resize(int32 width, const HistoryItem *parent) override; - void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const; + void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const override; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const override; - const QString inDialogsText() const; - const QString inHistoryText() const; + const QString inDialogsText() const override; + const QString inHistoryText() const override; - void linkOver(HistoryItem *parent, const TextLinkPtr &lnk); - void linkOut(HistoryItem *parent, const TextLinkPtr &lnk); + void linkOver(HistoryItem *parent, const TextLinkPtr &lnk) override; + void linkOut(HistoryItem *parent, const TextLinkPtr &lnk) override; - bool isDisplayed() const { + bool isDisplayed() const override { return !_data->pendingTill; } - DocumentData *getDocument() { + DocumentData *getDocument() override { return _attach ? _attach->getDocument() : 0; } - ClipReader *getClipReader() { + ClipReader *getClipReader() override { return _attach ? _attach->getClipReader() : 0; } bool playInline(HistoryItem *item, bool autoplay) override { @@ -2214,19 +2214,19 @@ public: void attachToItem(HistoryItem *item) override; void detachFromItem(HistoryItem *item) override; - bool hasReplyPreview() const { + bool hasReplyPreview() const override { return (_data->photo && !_data->photo->thumb->isNull()) || (_data->doc && !_data->doc->thumb->isNull()); } - ImagePtr replyPreview(); + ImagePtr replyPreview() override; WebPageData *webpage() { return _data; } - bool needsBubble(const HistoryItem *parent) const { + bool needsBubble(const HistoryItem *parent) const override { return true; } - bool customInfoLayout() const { + bool customInfoLayout() const override { return false; } @@ -2374,7 +2374,7 @@ public: void initMediaFromDocument(DocumentData *doc, const QString &caption); void fromNameUpdated(int32 width) const; - virtual UserData *viaBot() const { + virtual UserData *viaBot() const override { if (const HistoryMessageVia *via = Get()) { return via->_bot; } @@ -2390,7 +2390,7 @@ public: bool drawBubble() const { return _media ? (!emptyText() || _media->needsBubble(this)) : true; } - bool hasBubble() const { + bool hasBubble() const override { return drawBubble(); } bool displayFromName() const { @@ -2403,35 +2403,35 @@ public: return _media && _media->uploading(); } - void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const; - void setViewsCount(int32 count); - void setId(MsgId newId); + void drawInfo(Painter &p, int32 right, int32 bottom, int32 width, bool selected, InfoDisplayType type) const override; + void setViewsCount(int32 count) override; + void setId(MsgId newId) override; void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const override; virtual void drawMessageText(Painter &p, QRect trect, uint32 selection) const; - void destroy(); + void destroy() override; - bool hasPoint(int32 x, int32 y) const; - bool pointInTime(int32 right, int32 bottom, int32 x, int32 y, InfoDisplayType type) const; + bool hasPoint(int32 x, int32 y) const override; + bool pointInTime(int32 right, int32 bottom, int32 x, int32 y, InfoDisplayType type) const override; - void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const; + void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const override; virtual void getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const; - void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const; - uint32 adjustSelection(uint16 from, uint16 to, TextSelectType type) const { + void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const override; + uint32 adjustSelection(uint16 from, uint16 to, TextSelectType type) const override { return _text.adjustSelection(from, to, type); } - void linkOver(const TextLinkPtr &lnk) { + void linkOver(const TextLinkPtr &lnk) override { if (_media) _media->linkOver(this, lnk); } - void linkOut(const TextLinkPtr &lnk) { + void linkOut(const TextLinkPtr &lnk) override { if (_media) _media->linkOut(this, lnk); } - void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const; - QString notificationHeader() const; - QString notificationText() const; + void drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const override; + QString notificationHeader() const override; + QString notificationText() const override; void updateMedia(const MTPMessageMedia *media, bool edited = false) override { if (!edited && media && _media && _media->type() != MediaTypeWebPage) { @@ -2441,19 +2441,19 @@ public: } setPendingInitDimensions(); } - int32 addToOverview(AddToOverviewMethod method); + int32 addToOverview(AddToOverviewMethod method) override; void eraseFromOverview(); - QString selectedText(uint32 selection) const; - QString inDialogsText() const; - HistoryMedia *getMedia(bool inOverview = false) const; + QString selectedText(uint32 selection) const override; + QString inDialogsText() const override; + HistoryMedia *getMedia(bool inOverview = false) const override; void setMedia(const MTPMessageMedia *media); - void setText(const QString &text, const EntitiesInText &entities); - QString originalText() const; - EntitiesInText originalEntities() const; - bool textHasLinks(); + void setText(const QString &text, const EntitiesInText &entities) override; + QString originalText() const override; + EntitiesInText originalEntities() const override; + bool textHasLinks() override; - int32 infoWidth() const { + int32 infoWidth() const override { int32 result = _timeWidth; if (const HistoryMessageViews *views = Get()) { result += st::msgDateViewsSpace + views->_viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth(); @@ -2465,7 +2465,7 @@ public: } return result; } - int32 timeLeft() const { + int32 timeLeft() const override { int32 result = 0; if (const HistoryMessageViews *views = Get()) { result += st::msgDateViewsSpace + views->_viewsWidth + st::msgDateCheckSpace + st::msgViewsImg.pxWidth(); @@ -2474,21 +2474,21 @@ public: } return result; } - int32 timeWidth() const { + int32 timeWidth() const override { return _timeWidth; } - int32 viewsCount() const { + int32 viewsCount() const override { if (const HistoryMessageViews *views = Get()) { return views->_views; } return HistoryItem::viewsCount(); } - HistoryMessage *toHistoryMessage() { // dynamic_cast optimize + HistoryMessage *toHistoryMessage() override { // dynamic_cast optimize return this; } - const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize + const HistoryMessage *toHistoryMessage() const override { // dynamic_cast optimize return this; } diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 0bcdb8be83..3dc3abe2e8 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -3641,7 +3641,7 @@ namespace Local { flags = flagsData; } else { // flagsData was haveLeft - flags = (flagsData == 1 ? MTPDchat::Flags(MTPDchat::Flag::f_left) : 0); + flags = (flagsData == 1) ? MTPDchat::Flags(MTPDchat::Flag::f_left) : MTPDchat::Flags(0); } if (!wasLoaded) { chat->updateName(name, QString(), QString()); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index 113cd63c15..e63bc3f13e 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -207,7 +207,7 @@ public slots: protected: - void socketPacket(const char *packet, uint32 length); + void socketPacket(const char *packet, uint32 length) override; private: @@ -269,7 +269,7 @@ public slots: protected: - void socketPacket(const char *packet, uint32 length); + void socketPacket(const char *packet, uint32 length) override; private: diff --git a/Telegram/SourceFiles/pspecific_mac.cpp b/Telegram/SourceFiles/pspecific_mac.cpp index f674e84e65..531c59561e 100644 --- a/Telegram/SourceFiles/pspecific_mac.cpp +++ b/Telegram/SourceFiles/pspecific_mac.cpp @@ -502,7 +502,7 @@ 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(); - QPixmap pix = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->history()->peer->photo->pix(st::notifyMacPhotoSize) : QPixmap(); + QPixmap pix = (!App::passcoded() && cNotifyView() <= dbinvShowName) ? item->history()->peer->genUserpic(st::notifyMacPhotoSize) : QPixmap(); QString msg = (!App::passcoded() && cNotifyView() <= dbinvShowPreview) ? (fwdCount < 2 ? item->notificationText() : lng_forward_messages(lt_count, fwdCount)) : lang(lng_notification_preview); _private.showNotify(item->history()->peer->id, item->id, pix, title, subtitle, msg, !App::passcoded() && (cNotifyView() <= dbinvShowPreview)); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 3f7022ac7a..0426f86201 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -187,6 +187,10 @@ void PeerData::saveUserpic(const QString &path) const { currentUserpic()->pixCircled().save(path, "PNG"); } +QPixmap PeerData::genUserpic(int size) const { + return currentUserpic()->pixCircled(size, size); +} + const Text &BotCommand::descriptionText() const { if (_descriptionText.isEmpty() && !_description.isEmpty()) { _descriptionText.setText(st::mentionFont, _description, _textNameOptions); diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 5b41f375e6..d0f9ba7054 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -286,6 +286,7 @@ public: } StorageKey userpicUniqueKey() const; void saveUserpic(const QString &path) const; + QPixmap genUserpic(int size) const; PhotoId photoId; StorageImageLocation photoLoc; From f662067a68ebb9da60d844082bc0beef567935c6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 22 Mar 2016 12:51:20 +0300 Subject: [PATCH 231/316] fixed history block index bug --- Telegram/SourceFiles/gui/animation.h | 2 +- Telegram/SourceFiles/history.cpp | 102 ++++++++++++++------------- Telegram/SourceFiles/history.h | 10 ++- Telegram/SourceFiles/types.h | 10 +-- 4 files changed, 67 insertions(+), 57 deletions(-) diff --git a/Telegram/SourceFiles/gui/animation.h b/Telegram/SourceFiles/gui/animation.h index d5d8253d2d..cb61a09e0d 100644 --- a/Telegram/SourceFiles/gui/animation.h +++ b/Telegram/SourceFiles/gui/animation.h @@ -208,7 +208,7 @@ class AnimationCreator { public: AnimationCreator(AnimationImplementation *ptr) : _ptr(ptr) {} AnimationCreator(const AnimationCreator &other) : _ptr(other.create()) {} - AnimationImplementation *create() const { return exchange(_ptr); } + AnimationImplementation *create() const { return getPointerAndReset(_ptr); } ~AnimationCreator() { deleteAndMark(_ptr); } private: AnimationCreator &operator=(const AnimationCreator &other); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index d205c11849..3b1f4e4bcb 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -572,15 +572,9 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { if (onlyImportant()) { if (newLoaded) { - HistoryBlock *block = blocks.isEmpty() ? nullptr : blocks.back(); - HistoryItem *prev = nullptr; - if (block) { - prev = block->items.back(); - } else { - block = new HistoryBlock(this); - block->setIndexInHistory(blocks.size()); - blocks.push_back(block); - } + HistoryBlock *block = blocks.isEmpty() ? addNewLastBlock() : blocks.back(); + HistoryItem *prev = block->items.isEmpty() ? nullptr : block->items.back(); + prev = addMessageGroupAfterPrevToBlock(d, prev, block); if (block->items.isEmpty()) { blocks.pop_back(); @@ -643,12 +637,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } // adding new item to new block - 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); - } + HistoryBlock *block = addNewFirstBlock(); _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); addItemAfterPrevToBlock(_joinedMessage, nullptr, block); @@ -827,9 +816,7 @@ 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); + HistoryBlock *block = addNewLastBlock(); int32 willAddToBlock = qMin(int32(MessagesPerPage), count - i); block->items.reserve(willAddToBlock); @@ -1560,11 +1547,7 @@ HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) { t_assert(adding != nullptr); t_assert(adding->detached()); - if (blocks.isEmpty()) { - blocks.push_back(new HistoryBlock(this)); - blocks.back()->setIndexInHistory(blocks.size()); - } - HistoryBlock *block = blocks.back(); + HistoryBlock *block = blocks.isEmpty() ? addNewLastBlock() : blocks.back(); adding->attachToBlock(block, block->items.size()); block->items.push_back(adding); @@ -1726,13 +1709,8 @@ void History::addOlderSlice(const QVector &slice, const QVectorconstData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; - HistoryItem *last = nullptr; - 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); - } + HistoryItem *prev = nullptr; + HistoryBlock *block = addNewFirstBlock(); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -1745,16 +1723,16 @@ void History::addOlderSlice(const QVector &slice, const QVectorc_messageGroup()); if (group.vmin_id.v >= adding->id) break; - last = addMessageGroupAfterPrevToBlock(group, last, block); + prev = addMessageGroupAfterPrevToBlock(group, prev, block); } - last = addItemAfterPrevToBlock(adding, last, block); + prev = addItemAfterPrevToBlock(adding, prev, block); } for (; groupsIt != groupsEnd; ++groupsIt) { if (groupsIt->type() != mtpc_messageGroup) continue; const MTPDmessageGroup &group(groupsIt->c_messageGroup()); - last = addMessageGroupAfterPrevToBlock(group, last, block); + prev = addMessageGroupAfterPrevToBlock(group, prev, block); } if (block->items.isEmpty()) { @@ -1839,17 +1817,26 @@ void History::addOlderSlice(const QVector &slice, const QVector 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(); + // some checks if there was some message history already + if (block && blocks.size() > 1) { + HistoryItem *last = block->items.back(); // .. item, item, item, last ], [ first, item, item .. + HistoryItem *first = blocks.at(1)->items.front(); - // last->destroy() could've destroyed this new block - // so we can't rely on this pointer any more - block = nullptr; + // we've added a new front block, so previous item for + // the old first item of a first block was changed + first->previousItemChanged(); + + // we've added a new front block, now we check if both + // last message of the first block and first message of + // the second block are groups, if they are - unite them + if (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()) { @@ -1872,9 +1859,7 @@ void History::addNewerSlice(const QVector &slice, const QVectoritems.back(); - HistoryBlock *block = new HistoryBlock(this); - block->setIndexInHistory(blocks.size()); - blocks.push_back(block); + HistoryBlock *block = addNewLastBlock(); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -2205,6 +2190,23 @@ HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, return newItem; } +HistoryBlock *History::addNewLastBlock() { + HistoryBlock *result = new HistoryBlock(this); + result->setIndexInHistory(blocks.size()); + blocks.push_back(result); + return result; +} + +HistoryBlock *History::addNewFirstBlock() { + HistoryBlock *result = new HistoryBlock(this); + result->setIndexInHistory(0); + blocks.push_front(result); + for (int i = 1, l = blocks.size(); i < l; ++i) { + blocks.at(i)->setIndexInHistory(i); + } + return result; +} + void History::clearNotifications() { notifies.clear(); } @@ -6605,8 +6607,12 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m 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, marginTop()); + int photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + int phototop = marginTop(); +// if (history()->scrollTopItem == this) { +// phototop = qMax(qMin(history()->scrollTopOffset, _height - marginBottom() - int(st::msgPhotoSize)), phototop); +// } + author()->paintUserpic(p, st::msgPhotoSize, photoleft, phototop); } if (bubble) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index a6c8c8fdee..bbd4b78e0a 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -220,6 +220,9 @@ class History { public: History(const PeerId &peerId); + History(const History &) = delete; + History &operator=(const History &) = delete; + ChannelId channelId() const { return peerToChannel(peer->id); } @@ -503,9 +506,10 @@ private: HistoryItem *addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem *prev); HistoryItem *addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, int32 itemIndex); - History(const History &) = delete; - History &operator=(const History &) = delete; -}; + HistoryBlock *addNewLastBlock(); + HistoryBlock *addNewFirstBlock(); + + }; class HistoryGroup; class HistoryCollapse; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 4ec1d299cc..5ecc19c167 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -27,8 +27,8 @@ void deleteAndMark(T *&link) { } template -T *exchange(T *&ptr) { - T *result = 0; +T *getPointerAndReset(T *&ptr) { + T *result = nullptr; qSwap(result, ptr); return result; } @@ -792,7 +792,7 @@ class FunctionCreator { public: FunctionCreator(FunctionImplementation *ptr) : _ptr(ptr) {} FunctionCreator(const FunctionCreator &other) : _ptr(other.create()) {} - FunctionImplementation *create() const { return exchange(_ptr); } + FunctionImplementation *create() const { return getPointerAndReset(_ptr); } ~FunctionCreator() { destroyImplementation(_ptr); } private: FunctionCreator &operator=(const FunctionCreator &other); @@ -861,7 +861,7 @@ class Function1Creator { public: Function1Creator(Function1Implementation *ptr) : _ptr(ptr) {} Function1Creator(const Function1Creator &other) : _ptr(other.create()) {} - Function1Implementation *create() const { return exchange(_ptr); } + Function1Implementation *create() const { return getPointerAndReset(_ptr); } ~Function1Creator() { destroyImplementation(_ptr); } private: Function1Creator &operator=(const Function1Creator &other); @@ -930,7 +930,7 @@ class Function2Creator { public: Function2Creator(Function2Implementation *ptr) : _ptr(ptr) {} Function2Creator(const Function2Creator &other) : _ptr(other.create()) {} - Function2Implementation *create() const { return exchange(_ptr); } + Function2Implementation *create() const { return getPointerAndReset(_ptr); } ~Function2Creator() { destroyImplementation(_ptr); } private: Function2Creator &operator=(const Function2Creator &other); From 5c9836418fb0a7b2dd765cedbcf2234f9ad1d9d7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 22 Mar 2016 18:23:34 +0300 Subject: [PATCH 232/316] version 9034001 beta --- Telegram/Resources/style.txt | 4 +- Telegram/SourceFiles/app.h | 3 +- Telegram/SourceFiles/config.h | 4 +- Telegram/SourceFiles/history.cpp | 140 ++++++++++++------------- Telegram/SourceFiles/history.h | 13 ++- Telegram/SourceFiles/historywidget.cpp | 59 ++++++----- Telegram/SourceFiles/historywidget.h | 2 + Telegram/SourceFiles/mainwidget.cpp | 4 +- Telegram/Telegram.rc | 8 +- Telegram/Version | 4 +- 10 files changed, 124 insertions(+), 117 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index f1a2190408..d8e2e8cbd8 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1049,7 +1049,7 @@ msgServiceNameFont: semiboldFont; msgServicePhotoWidth: 100px; msgDateFont: font(13px); msgMinWidth: 190px; -msgPhotoSize: 35px; +msgPhotoSize: 33px; msgPhotoSkip: 40px; msgPadding: margins(13px, 7px, 13px, 8px); msgMargin: margins(13px, 6px, 53px, 2px); @@ -1089,7 +1089,7 @@ msgServiceBg: #89a0b47f; msgServiceSelectBg: #bbc8d4a2; msgServiceColor: #FFF; msgServicePadding: margins(12px, 3px, 12px, 4px); -msgServiceMargin: margins(10px, 7px, 80px, 7px); +msgServiceMargin: margins(10px, 9px, 80px, 5px); msgColor: #000; msgDateColor: #000; diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 43ddf5f61e..77bd4e5b66 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -145,10 +145,11 @@ namespace App { History *historyLoaded(const PeerId &peer); HistoryItem *histItemById(ChannelId channelId, MsgId itemId); inline History *history(const PeerData *peer) { + t_assert(peer != nullptr); return history(peer->id); } inline History *historyLoaded(const PeerData *peer) { - return historyLoaded(peer->id); + return peer ? historyLoaded(peer->id) : nullptr; } inline HistoryItem *histItemById(const ChannelData *channel, MsgId itemId) { return histItemById(channel ? peerToChannel(channel->id) : 0, itemId); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index d627e86837..d8fdc4e3a2 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -22,8 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9034; static const wchar_t *AppVersionStr = L"0.9.34"; -static const bool DevVersion = true; -//#define BETA_VERSION (9030002ULL) // just comment this line to build public version +static const bool DevVersion = false; +#define BETA_VERSION (9034001ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 3b1f4e4bcb..38406e37fa 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -489,7 +489,7 @@ void ChannelHistory::insertCollapseItem(MsgId wasMinId) { if (_onlyImportant || isMegagroup()) return; bool insertAfter = false; - for (int32 blockIndex = 1, blocksCount = blocks.size(); blockIndex < blocksCount; ++blockIndex) { // skip first date block + for (int32 blockIndex = 0, blocksCount = blocks.size(); blockIndex < blocksCount; ++blockIndex) { HistoryBlock *block = blocks.at(blockIndex); for (int32 itemIndex = 0, itemsCount = block->items.size(); itemIndex < itemsCount; ++itemIndex) { HistoryItem *item = block->items.at(itemIndex); @@ -572,7 +572,7 @@ void ChannelHistory::addNewGroup(const MTPMessageGroup &group) { if (onlyImportant()) { if (newLoaded) { - HistoryBlock *block = blocks.isEmpty() ? addNewLastBlock() : blocks.back(); + HistoryBlock *block = blocks.isEmpty() ? pushBackNewBlock() : blocks.back(); HistoryItem *prev = block->items.isEmpty() ? nullptr : block->items.back(); prev = addMessageGroupAfterPrevToBlock(d, prev, block); @@ -609,7 +609,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { return _joinedMessage; } - for (int32 blockIndex = blocks.size(); blockIndex > 1;) { + for (int32 blockIndex = blocks.size(); blockIndex > 0;) { HistoryBlock *block = blocks.at(--blockIndex); for (int32 itemIndex = block->items.size(); itemIndex > 0;) { HistoryItem *item = block->items.at(--itemIndex); @@ -637,10 +637,10 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) { } // adding new item to new block - HistoryBlock *block = addNewFirstBlock(); + HistoryBlock *block = pushFrontNewBlock(); _joinedMessage = HistoryJoined::create(this, inviteDate, inviter, flags); - addItemAfterPrevToBlock(_joinedMessage, nullptr, block); + addItemToBlock(_joinedMessage, block); t_assert(blocks.size() > 1); blocks.at(1)->items.front()->previousItemChanged(); @@ -665,9 +665,9 @@ void ChannelHistory::checkJoinedMessage(bool createUnread) { QDateTime inviteDate = peer->asChannel()->inviteDate; QDateTime firstDate, lastDate; - for (int32 blockIndex = 1, blocksCount = blocks.size(); blockIndex < blocksCount; ++blockIndex) { + for (int blockIndex = 0, blocksCount = blocks.size(); blockIndex < blocksCount; ++blockIndex) { HistoryBlock *block = blocks.at(blockIndex); - int32 itemIndex = 0, itemsCount = block->items.size(); + int itemIndex = 0, itemsCount = block->items.size(); for (; itemIndex < itemsCount; ++itemIndex) { HistoryItem *item = block->items.at(itemIndex); HistoryItemType type = item->type(); @@ -678,9 +678,9 @@ void ChannelHistory::checkJoinedMessage(bool createUnread) { } if (itemIndex < itemsCount) break; } - for (int32 blockIndex = blocks.size(); blockIndex > 1;) { + for (int blockIndex = blocks.size(); blockIndex > 0;) { HistoryBlock *block = blocks.at(--blockIndex); - int32 itemIndex = block->items.size(); + int itemIndex = block->items.size(); for (; itemIndex > 0;) { HistoryItem *item = block->items.at(--itemIndex); HistoryItemType type = item->type(); @@ -706,9 +706,9 @@ void ChannelHistory::checkJoinedMessage(bool createUnread) { void ChannelHistory::checkMaxReadMessageDate() { if (_maxReadMessageDate.isValid()) return; - for (int32 blockIndex = blocks.size(); blockIndex > 0;) { + for (int blockIndex = blocks.size(); blockIndex > 0;) { HistoryBlock *block = blocks.at(--blockIndex); - for (int32 itemIndex = block->items.size(); itemIndex > 0;) { + for (int itemIndex = block->items.size(); itemIndex > 0;) { HistoryItem *item = block->items.at(--itemIndex); if ((item->isImportant() || isMegagroup()) && !item->unread()) { _maxReadMessageDate = item->date; @@ -753,8 +753,15 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp if (!isImportant && onlyImportant()) { HistoryItem *item = addToHistory(msg), *prev = isEmpty() ? nullptr : blocks.back()->items.back(); - addMessageGroupAfterPrev(item, prev); - return item; + + if (prev && prev->type() == HistoryItemGroup) { + static_cast(prev)->uniteWith(item); + return prev; + } + + QDateTime date = prev ? prev->date : item->date; + HistoryBlock *block = prev ? prev->block() : pushBackNewBlock(); + return addItemToBlock(HistoryGroup::create(this, item, date), block); } // when we are receiving channel dialog rows we get one important and one not important @@ -795,7 +802,7 @@ void ChannelHistory::switchMode() { OtherList savedList; if (!blocks.isEmpty()) { - savedList.reserve(((blocks.size() - 2) * MessagesPerPage + blocks.back()->items.size()) * (onlyImportant() ? 2 : 1)); + savedList.reserve(((blocks.size() - 1) * MessagesPerPage + blocks.back()->items.size()) * (onlyImportant() ? 2 : 1)); for_const (const HistoryBlock *block, blocks) { for_const (HistoryItem *item, block->items) { HistoryItemType itemType = item->type(); @@ -811,17 +818,16 @@ void ChannelHistory::switchMode() { newLoaded = _otherNewLoaded; oldLoaded = _otherOldLoaded; - if (int32 count = _otherList.size()) { - blocks.reserve(qCeil(count / float64(MessagesPerPage)) + 1); + if (int count = _otherList.size()) { + blocks.reserve(qCeil(count / float64(MessagesPerPage))); - HistoryItem *prev = 0; - for (int32 i = 0; i < count;) { - HistoryBlock *block = addNewLastBlock(); + for (int i = 0; i < count;) { + HistoryBlock *block = pushBackNewBlock(); - int32 willAddToBlock = qMin(int32(MessagesPerPage), count - i); + int willAddToBlock = qMin(int(MessagesPerPage), count - i); block->items.reserve(willAddToBlock); - for (int32 till = i + willAddToBlock; i < till; ++i) { - prev = addItemAfterPrevToBlock(_otherList.at(i), prev, block); + for (int till = i + willAddToBlock; i < till; ++i) { + addItemToBlock(_otherList.at(i), block); } t_assert(!block->items.isEmpty()); @@ -883,11 +889,11 @@ HistoryGroup *ChannelHistory::findGroup(MsgId msgId) const { // find message gro } HistoryBlock *ChannelHistory::findGroupBlock(MsgId msgId) const { // find block with message group using binary search - if (isEmpty()) return 0; + if (isEmpty()) return nullptr; - int32 blockIndex = 0; - if (blocks.size() > 1) for (int32 minBlock = 0, maxBlock = blocks.size();;) { - for (int32 startCheckBlock = (minBlock + maxBlock) / 2, checkBlock = startCheckBlock;;) { + int blockIndex = 0; + if (blocks.size() > 1) for (int minBlock = 0, maxBlock = blocks.size();;) { + for (int startCheckBlock = (minBlock + maxBlock) / 2, checkBlock = startCheckBlock;;) { HistoryBlock *block = blocks.at(checkBlock); auto i = block->items.cbegin(), e = block->items.cend(); for (; i != e; ++i) { // out msgs could be a mess in monotonic ids @@ -952,8 +958,8 @@ HistoryGroup *ChannelHistory::findGroupInOther(MsgId msgId) const { // find mess HistoryItem *ChannelHistory::findPrevItem(HistoryItem *item) const { if (item->detached()) return nullptr; - int32 itemIndex = item->indexInBlock(); - int32 blockIndex = item->block()->indexInHistory(); + int itemIndex = item->indexInBlock(); + int blockIndex = item->block()->indexInHistory(); for (++blockIndex, ++itemIndex; blockIndex > 0;) { --blockIndex; HistoryBlock *block = blocks.at(blockIndex); @@ -1547,7 +1553,7 @@ HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) { t_assert(adding != nullptr); t_assert(adding->detached()); - HistoryBlock *block = blocks.isEmpty() ? addNewLastBlock() : blocks.back(); + HistoryBlock *block = blocks.isEmpty() ? pushBackNewBlock() : blocks.back(); adding->attachToBlock(block, block->items.size()); block->items.push_back(adding); @@ -1665,7 +1671,7 @@ void History::newItemAdded(HistoryItem *item) { } } -HistoryItem *History::addItemAfterPrevToBlock(HistoryItem *item, HistoryItem *prev, HistoryBlock *block) { +HistoryItem *History::addItemToBlock(HistoryItem *item, HistoryBlock *block) { item->attachToBlock(block, block->items.size()); block->items.push_back(item); item->previousItemChanged(); @@ -1677,22 +1683,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(HistoryGroup::create(this, group, prev ? prev->date : date(group.vdate)), prev, block); -} - -HistoryItem *History::addMessageGroupAfterPrev(HistoryItem *newItem, HistoryItem *prev) { - if (prev && prev->type() == HistoryItemGroup) { - static_cast(prev)->uniteWith(newItem); - return prev; - } - - QDateTime date = prev ? prev->date : newItem->date; - HistoryBlock *block = prev ? prev->block() : 0; - if (!block) { - block = new HistoryBlock(this); - blocks.push_back(block); - } - return addItemAfterPrevToBlock(HistoryGroup::create(this, newItem, date), prev, block); + return addItemToBlock(HistoryGroup::create(this, group, prev ? prev->date : date(group.vdate)), block); } void History::addOlderSlice(const QVector &slice, const QVector *collapsed) { @@ -1710,7 +1701,7 @@ void History::addOlderSlice(const QVector &slice, const QVectorconstData() : 0, *groupsIt = groupsBegin, *groupsEnd = (isChannel() && collapsed) ? (groupsBegin + collapsed->size()) : 0; HistoryItem *prev = nullptr; - HistoryBlock *block = addNewFirstBlock(); + HistoryBlock *block = pushFrontNewBlock(); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -1726,7 +1717,7 @@ void History::addOlderSlice(const QVector &slice, const QVectortype() != mtpc_messageGroup) continue; @@ -1859,7 +1850,7 @@ void History::addNewerSlice(const QVector &slice, const QVectoritems.back(); - HistoryBlock *block = addNewLastBlock(); + HistoryBlock *block = pushBackNewBlock(); block->items.reserve(slice.size() + (collapsed ? collapsed->size() : 0)); for (auto i = slice.cend(), e = slice.cbegin(); i != e;) { @@ -1875,7 +1866,7 @@ void History::addNewerSlice(const QVector &slice, const QVectortype() != mtpc_messageGroup) continue; @@ -1904,11 +1895,9 @@ void History::addNewerSlice(const QVector &slice, const QVectoritems.size(); ++j) { - mask |= b->items[j]->addToOverview(AddToOverviewBack); + for_const (HistoryBlock *block, blocks) { + for_const (HistoryItem *item, block->items) { + mask |= item->addToOverview(AddToOverviewBack); } } for (int32 t = 0; t < OverviewCount; ++t) { @@ -1919,8 +1908,8 @@ void History::addNewerSlice(const QVector &slice, const QVectorcheckJoinedMessage(); } -int32 History::countUnread(MsgId upTo) { - int32 result = 0; +int History::countUnread(MsgId upTo) { + int result = 0; for (auto i = blocks.cend(), e = blocks.cbegin(); i != e;) { --i; for (auto j = (*i)->items.cend(), en = (*i)->items.cbegin(); j != en;) { @@ -1994,21 +1983,23 @@ MsgId History::outboxRead(HistoryItem *wasRead) { } HistoryItem *History::lastImportantMessage() const { - if (isEmpty()) return 0; - bool channel = isChannel(); - for (int32 blockIndex = blocks.size(); blockIndex > 0;) { + if (isEmpty()) { + return nullptr; + } + bool importantOnly = isChannel() && !isMegagroup(); + for (int blockIndex = blocks.size(); blockIndex > 0;) { HistoryBlock *block = blocks.at(--blockIndex); - for (int32 itemIndex = block->items.size(); itemIndex > 0;) { + for (int itemIndex = block->items.size(); itemIndex > 0;) { HistoryItem *item = block->items.at(--itemIndex); - if ((channel && !isMegagroup()) ? item->isImportant() : (item->type() == HistoryItemMsg)) { + if (importantOnly ? item->isImportant() : (item->type() == HistoryItemMsg)) { return item; } } } - return 0; + return nullptr; } -void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { +void History::setUnreadCount(int newUnreadCount, bool psUpdate) { if (unreadCount != newUnreadCount) { if (newUnreadCount == 1) { if (loadedAtBottom()) showFrom = lastImportantMessage(); @@ -2051,9 +2042,9 @@ void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) { } } -void History::getNextShowFrom(HistoryBlock *block, int32 i) { +void History::getNextShowFrom(HistoryBlock *block, int i) { if (i >= 0) { - int32 l = block->items.size(); + int l = block->items.size(); for (++i; i < l; ++i) { if (block->items.at(i)->type() == HistoryItemMsg) { showFrom = block->items.at(i); @@ -2062,7 +2053,7 @@ void History::getNextShowFrom(HistoryBlock *block, int32 i) { } } - for (int32 j = block->indexInHistory() + 1, s = blocks.size(); j < s; ++j) { + for (int j = block->indexInHistory() + 1, s = blocks.size(); j < s; ++j) { block = blocks.at(j); for_const (HistoryItem *item, block->items) { if (item->type() == HistoryItemMsg) { @@ -2190,14 +2181,14 @@ HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex, return newItem; } -HistoryBlock *History::addNewLastBlock() { +HistoryBlock *History::pushBackNewBlock() { HistoryBlock *result = new HistoryBlock(this); result->setIndexInHistory(blocks.size()); blocks.push_back(result); return result; } -HistoryBlock *History::addNewFirstBlock() { +HistoryBlock *History::pushFrontNewBlock() { HistoryBlock *result = new HistoryBlock(this); result->setIndexInHistory(0); blocks.push_front(result); @@ -2641,8 +2632,8 @@ void HistoryBlock::removeItem(HistoryItem *item) { history->getNextScrollTopItem(this, itemIndex); } - int32 myIndex = history->blocks.indexOf(this); - if (myIndex >= 0) { // fix message groups and date items + int myIndex = indexInHistory(); + if (myIndex >= 0) { // fix message groups if (item->isImportant()) { // unite message groups around this important message HistoryGroup *nextGroup = 0, *prevGroup = 0; HistoryCollapse *nextCollapse = 0; @@ -6588,7 +6579,6 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m unreadbar->paint(p, 0, _history->width); p.translate(0, -dateh); } - int skiph = dateh + unreadbarh; uint64 animms = App::main() ? App::main()->animActiveTimeStart(this) : 0; if (animms > 0 && animms <= ms) { @@ -6596,6 +6586,8 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m if (animms > st::activeFadeInDuration + st::activeFadeOutDuration) { App::main()->stopAnimActive(); } else { + int skiph = marginTop() - marginBottom(); + float64 dt = (animms > st::activeFadeInDuration) ? (1 - (animms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (animms / float64(st::activeFadeInDuration)); float64 o = p.opacity(); p.setOpacity(o * dt); @@ -7651,11 +7643,13 @@ void HistoryServiceMessage::draw(Painter &p, const QRect &r, uint32 selection, u if (animms > st::activeFadeInDuration + st::activeFadeOutDuration) { App::main()->stopAnimActive(); } else { + int skiph = st::msgServiceMargin.top() - st::msgServiceMargin.bottom(); + textstyleSet(&st::inTextStyle); 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); } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index bbd4b78e0a..99eb6b22cb 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -258,7 +258,7 @@ public: void newItemAdded(HistoryItem *item); void unregTyping(UserData *from); - int32 countUnread(MsgId upTo); + int countUnread(MsgId upTo); void updateShowFrom(); MsgId inboxRead(MsgId upTo); MsgId inboxRead(HistoryItem *wasRead); @@ -267,9 +267,9 @@ public: HistoryItem *lastImportantMessage() const; - void setUnreadCount(int32 newUnreadCount, bool psUpdate = true); + void setUnreadCount(int newUnreadCount, bool psUpdate = true); void setMute(bool newMute); - void getNextShowFrom(HistoryBlock *block, int32 i); + void getNextShowFrom(HistoryBlock *block, int i); void addUnreadBar(); void destroyUnreadBar(); void clearNotifications(); @@ -500,14 +500,13 @@ private: 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 *addItemToBlock(HistoryItem *item, HistoryBlock *block); 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); - HistoryBlock *addNewLastBlock(); - HistoryBlock *addNewFirstBlock(); + HistoryBlock *pushBackNewBlock(); + HistoryBlock *pushFrontNewBlock(); }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 4e886df4c2..28980fec1d 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1359,6 +1359,8 @@ HistoryItem *HistoryInner::atTopImportantMsg(int32 top, int32 height, int32 &bot } void HistoryInner::visibleAreaUpdated(int top, int bottom) { + _visibleAreaTop = top; + // if history has pending resize events we should not update scrollTopItem if (_history->hasPendingResizedItems()) { return; @@ -1469,59 +1471,59 @@ void HistoryInner::adjustCurrent(int32 y, History *history) const { _curBlock = history->blocks.size() - 1; _curItem = 0; } - while (history->blocks[_curBlock]->y > y && _curBlock > 0) { + while (history->blocks.at(_curBlock)->y > y && _curBlock > 0) { --_curBlock; _curItem = 0; } - while (history->blocks[_curBlock]->y + history->blocks[_curBlock]->height <= y && _curBlock + 1 < history->blocks.size()) { + while (history->blocks.at(_curBlock)->y + history->blocks.at(_curBlock)->height <= y && _curBlock + 1 < history->blocks.size()) { ++_curBlock; _curItem = 0; } - HistoryBlock *block = history->blocks[_curBlock]; + HistoryBlock *block = history->blocks.at(_curBlock); if (_curItem >= block->items.size()) { _curItem = block->items.size() - 1; } - int32 by = block->y; - while (block->items[_curItem]->y + by > y && _curItem > 0) { + int by = block->y; + while (block->items.at(_curItem)->y + by > y && _curItem > 0) { --_curItem; } - while (block->items[_curItem]->y + block->items[_curItem]->height() + by <= y && _curItem + 1 < block->items.size()) { + while (block->items.at(_curItem)->y + block->items.at(_curItem)->height() + by <= y && _curItem + 1 < block->items.size()) { ++_curItem; } } HistoryItem *HistoryInner::prevItem(HistoryItem *item) { - if (!item) return 0; + if (!item || item->detached()) return nullptr; + HistoryBlock *block = item->block(); - int32 blockIndex = item->history()->blocks.indexOf(block), itemIndex = block->items.indexOf(item); - if (blockIndex < 0 || itemIndex < 0) return 0; + int blockIndex = block->indexInHistory(), itemIndex = item->indexInBlock(); if (itemIndex > 0) { - return block->items[itemIndex - 1]; + return block->items.at(itemIndex - 1); } if (blockIndex > 0) { - return item->history()->blocks[blockIndex - 1]->items.back(); + return item->history()->blocks.at(blockIndex - 1)->items.back(); } if (item->history() == _history && _migrated && _history->loadedAtTop() && !_migrated->isEmpty() && _migrated->loadedAtBottom()) { return _migrated->blocks.back()->items.back(); } - return 0; + return nullptr; } HistoryItem *HistoryInner::nextItem(HistoryItem *item) { - if (!item) return 0; + if (!item || item->detached()) return nullptr; + HistoryBlock *block = item->block(); - int32 blockIndex = item->history()->blocks.indexOf(block), itemIndex = block->items.indexOf(item); - if (blockIndex < 0 || itemIndex < 0) return 0; + int blockIndex = block->indexInHistory(), itemIndex = item->indexInBlock(); if (itemIndex + 1 < block->items.size()) { - return block->items[itemIndex + 1]; + return block->items.at(itemIndex + 1); } if (blockIndex + 1 < item->history()->blocks.size()) { - return item->history()->blocks[blockIndex + 1]->items.front(); + return item->history()->blocks.at(blockIndex + 1)->items.front(); } if (item->history() == _migrated && _history && _migrated->loadedAtBottom() && _history->loadedAtTop() && !_history->isEmpty()) { return _history->blocks.front()->items.front(); } - return 0; + return nullptr; } bool HistoryInner::canCopySelected() const { @@ -1877,8 +1879,8 @@ void HistoryInner::applyDragSelection(SelectedItems *toItems) const { toItems->clear(); } if (_dragSelecting) { - int32 fromblock = _dragSelFrom->history()->blocks.indexOf(_dragSelFrom->block()), fromitem = _dragSelFrom->block()->items.indexOf(_dragSelFrom); - int32 toblock = _dragSelTo->history()->blocks.indexOf(_dragSelTo->block()), toitem = _dragSelTo->block()->items.indexOf(_dragSelTo); + int32 fromblock = _dragSelFrom->block()->indexInHistory(), fromitem = _dragSelFrom->indexInBlock(); + int32 toblock = _dragSelTo->block()->indexInHistory(), toitem = _dragSelTo->indexInBlock(); if (_migrated) { if (_dragSelFrom->history() == _migrated) { if (_dragSelTo->history() == _migrated) { @@ -3571,6 +3573,9 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re if (_history) { if (_peer->id == peerId && !reload) { _history->forgetScrollState(); + if (_migrated) { + _migrated->forgetScrollState(); + } bool wasOnlyImportant = _history->isChannel() ? _history->asChannelHistory()->onlyImportant() : true; @@ -3715,6 +3720,9 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re } } else { _history->forgetScrollState(); + if (_migrated) { + _migrated->forgetScrollState(); + } } _list = new HistoryInner(this, &_scroll, _history); @@ -3726,7 +3734,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _updateHistoryItems.stop(); pinnedMsgVisibilityUpdated(); - if (_history->scrollTopItem || _history->isReadyFor(_showAtMsgId, _fixedInScrollMsgId, _fixedInScrollMsgTop)) { + if (_history->scrollTopItem || (_migrated && _migrated->scrollTopItem) || _history->isReadyFor(_showAtMsgId, _fixedInScrollMsgId, _fixedInScrollMsgTop)) { _fixedInScrollMsgId = 0; _fixedInScrollMsgTop = 0; historyLoaded(); @@ -4191,6 +4199,9 @@ void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) { void HistoryWidget::historyToDown(History *history) { history->forgetScrollState(); + if (History *migrated = App::historyLoaded(history->peer->migrateFrom())) { + migrated->forgetScrollState(); + } if (history == _history) { _scroll.scrollToY(_scroll.scrollTopMax()); } @@ -6406,7 +6417,7 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh } int32 toY = ScrollMax; - if (initial && _history->scrollTopItem) { + if (initial && (_history->scrollTopItem || (_migrated && _migrated->scrollTopItem))) { toY = _list->historyScrollTop(); } else if (initial && _migrated && _showAtMsgId < 0 && -_showAtMsgId < ServerMaxMsgId) { HistoryItem *item = App::histItemById(0, -_showAtMsgId); @@ -7059,8 +7070,8 @@ void HistoryWidget::onReplyToMessage() { if (!to || to->id <= 0 || !_canSendMessages) return; if (to->history() == _migrated) { - if (to->isGroupMigrate() && _history->blocks.size() > 1 && _history->blocks.at(1)->items.front()->isGroupMigrate() && _history != _migrated) { - App::contextItem(_history->blocks.at(1)->items.front()); + if (to->isGroupMigrate() && !_history->isEmpty() && _history->blocks.front()->items.front()->isGroupMigrate() && _history != _migrated) { + App::contextItem(_history->blocks.front()->items.front()); onReplyToMessage(); App::contextItem(to); } else { diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index ab5647a9c9..7c7ba35b91 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -197,6 +197,8 @@ private: PopupMenu *_menu; + int _visibleAreaTop = 0; + }; class MessageField : public FlatTextarea { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 690bf327b4..b1c5fcf602 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1682,9 +1682,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/Telegram.rc b/Telegram/Telegram.rc index 561c9685c3..debef465de 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,34,0 - PRODUCTVERSION 0,9,34,0 + FILEVERSION 0,9,34,1 + PRODUCTVERSION 0,9,34,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.34.0" + VALUE "FileVersion", "0.9.34.1" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.34.0" + VALUE "ProductVersion", "0.9.34.1" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index e08da93b46..106da55f5b 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -2,5 +2,5 @@ AppVersion 9034 AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.34 AppVersionStr 0.9.34 -DevChannel 1 -BetaVersion 0 9030002 +DevChannel 0 +BetaVersion 9034001 From ee946025d64648bf55e66b621d14b35dec61b96e Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 22 Mar 2016 19:10:47 +0300 Subject: [PATCH 233/316] fixed mtproto scheme gen code, 9034001 beta --- Telegram/SourceFiles/mtproto/generate.py | 3 +- Telegram/SourceFiles/mtproto/mtpScheme.h | 256 ----------------------- Telegram/Telegram.vcxproj | 6 + 3 files changed, 8 insertions(+), 257 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index 433d9c2aeb..240129331e 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -598,7 +598,8 @@ for restype in typesList: if (len(prms) > len(trivialConditions)): dataTexts += dataText; # add data class - friendDecl += '\tfriend class MTP::internal::TypeCreator;\n'; + if (not friendDecl): + 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 creatorProxyText += '\t\t\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n'; diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 199ec12e7f..9cc878cb7c 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -1545,7 +1545,6 @@ private: explicit MTPserver_DH_Params(MTPDserver_DH_params_fail *_data); explicit MTPserver_DH_Params(MTPDserver_DH_params_ok *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -1671,8 +1670,6 @@ private: explicit MTPset_client_DH_params_answer(MTPDdh_gen_retry *_data); explicit MTPset_client_DH_params_answer(MTPDdh_gen_fail *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -1754,7 +1751,6 @@ private: explicit MTPbadMsgNotification(MTPDbad_msg_notification *_data); explicit MTPbadMsgNotification(MTPDbad_server_salt *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -1898,7 +1894,6 @@ private: explicit MTPmsgDetailedInfo(MTPDmsg_detailed_info *_data); explicit MTPmsgDetailedInfo(MTPDmsg_new_detailed_info *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -1998,8 +1993,6 @@ private: explicit MTPrpcDropAnswer(mtpTypeId type); explicit MTPrpcDropAnswer(MTPDrpc_answer_dropped *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2143,7 +2136,6 @@ private: explicit MTPdestroySessionRes(MTPDdestroy_session_ok *_data); explicit MTPdestroySessionRes(MTPDdestroy_session_none *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2230,7 +2222,6 @@ public: private: explicit MTPbool(mtpTypeId type); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2367,10 +2358,6 @@ private: explicit MTPinputPeer(MTPDinputPeerUser *_data); explicit MTPinputPeer(MTPDinputPeerChannel *_data); - 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; @@ -2408,8 +2395,6 @@ private: explicit MTPinputUser(mtpTypeId type); explicit MTPinputUser(MTPDinputUser *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2491,7 +2476,6 @@ private: explicit MTPinputFile(MTPDinputFile *_data); explicit MTPinputFile(MTPDinputFileBig *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2633,15 +2617,6 @@ private: explicit MTPinputMedia(MTPDinputMediaVenue *_data); explicit MTPinputMedia(MTPDinputMediaGifExternal *_data); - 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; @@ -2692,8 +2667,6 @@ private: explicit MTPinputChatPhoto(MTPDinputChatUploadedPhoto *_data); explicit MTPinputChatPhoto(MTPDinputChatPhoto *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2731,7 +2704,6 @@ private: explicit MTPinputGeoPoint(mtpTypeId type); explicit MTPinputGeoPoint(MTPDinputGeoPoint *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2769,7 +2741,6 @@ private: explicit MTPinputPhoto(mtpTypeId type); explicit MTPinputPhoto(MTPDinputPhoto *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2833,8 +2804,6 @@ private: explicit MTPinputFileLocation(MTPDinputEncryptedFileLocation *_data); explicit MTPinputFileLocation(MTPDinputDocumentFileLocation *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2872,7 +2841,6 @@ private: explicit MTPinputPhotoCrop(mtpTypeId type); explicit MTPinputPhotoCrop(MTPDinputPhotoCrop *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2967,8 +2935,6 @@ private: explicit MTPpeer(MTPDpeerChat *_data); explicit MTPpeer(MTPDpeerChannel *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -2993,15 +2959,6 @@ public: private: explicit MTPstorage_fileType(mtpTypeId type); - 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; @@ -3052,7 +3009,6 @@ private: explicit MTPfileLocation(MTPDfileLocationUnavailable *_data); explicit MTPfileLocation(MTPDfileLocation *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3103,7 +3059,6 @@ private: explicit MTPuser(MTPDuserEmpty *_data); explicit MTPuser(MTPDuser *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3141,7 +3096,6 @@ private: explicit MTPuserProfilePhoto(mtpTypeId type); explicit MTPuserProfilePhoto(MTPDuserProfilePhoto *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3192,11 +3146,6 @@ private: explicit MTPuserStatus(MTPDuserStatusOnline *_data); explicit MTPuserStatus(MTPDuserStatusOffline *_data); - 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; @@ -3286,10 +3235,6 @@ private: explicit MTPchat(MTPDchannel *_data); explicit MTPchat(MTPDchannelForbidden *_data); - 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; @@ -3340,7 +3285,6 @@ private: explicit MTPchatFull(MTPDchatFull *_data); explicit MTPchatFull(MTPDchannelFull *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3404,8 +3348,6 @@ private: explicit MTPchatParticipant(MTPDchatParticipantCreator *_data); explicit MTPchatParticipant(MTPDchatParticipantAdmin *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3456,7 +3398,6 @@ private: explicit MTPchatParticipants(MTPDchatParticipantsForbidden *_data); explicit MTPchatParticipants(MTPDchatParticipants *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3494,7 +3435,6 @@ private: explicit MTPchatPhoto(mtpTypeId type); explicit MTPchatPhoto(MTPDchatPhoto *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3558,8 +3498,6 @@ private: explicit MTPmessage(MTPDmessage *_data); explicit MTPmessage(MTPDmessageService *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3662,13 +3600,6 @@ private: explicit MTPmessageMedia(MTPDmessageMediaWebPage *_data); explicit MTPmessageMedia(MTPDmessageMediaVenue *_data); - 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; @@ -3810,17 +3741,6 @@ private: explicit MTPmessageAction(MTPDmessageActionChatMigrateTo *_data); explicit MTPmessageAction(MTPDmessageActionChannelMigrateFrom *_data); - 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; @@ -3871,7 +3791,6 @@ private: explicit MTPdialog(MTPDdialog *_data); explicit MTPdialog(MTPDdialogChannel *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3922,7 +3841,6 @@ private: explicit MTPphoto(MTPDphotoEmpty *_data); explicit MTPphoto(MTPDphoto *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -3986,8 +3904,6 @@ private: explicit MTPphotoSize(MTPDphotoSize *_data); explicit MTPphotoSize(MTPDphotoCachedSize *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4025,7 +3941,6 @@ private: explicit MTPgeoPoint(mtpTypeId type); explicit MTPgeoPoint(MTPDgeoPoint *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4187,9 +4102,6 @@ private: explicit MTPinputNotifyPeer(mtpTypeId type); explicit MTPinputNotifyPeer(MTPDinputNotifyPeer *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4214,7 +4126,6 @@ public: private: explicit MTPinputPeerNotifyEvents(mtpTypeId type); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4270,7 +4181,6 @@ public: private: explicit MTPpeerNotifyEvents(mtpTypeId type); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4308,7 +4218,6 @@ private: explicit MTPpeerNotifySettings(mtpTypeId type); explicit MTPpeerNotifySettings(MTPDpeerNotifySettings *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4390,7 +4299,6 @@ private: explicit MTPwallPaper(MTPDwallPaper *_data); explicit MTPwallPaper(MTPDwallPaperSolid *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4428,9 +4336,6 @@ private: explicit MTPreportReason(mtpTypeId type); explicit MTPreportReason(MTPDinputReportReasonOther *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4654,7 +4559,6 @@ private: explicit MTPcontacts_contacts(mtpTypeId type); explicit MTPcontacts_contacts(MTPDcontacts_contacts *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4736,7 +4640,6 @@ private: explicit MTPcontacts_blocked(MTPDcontacts_blocked *_data); explicit MTPcontacts_blocked(MTPDcontacts_blockedSlice *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4787,7 +4690,6 @@ private: explicit MTPmessages_dialogs(MTPDmessages_dialogs *_data); explicit MTPmessages_dialogs(MTPDmessages_dialogsSlice *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4851,8 +4753,6 @@ private: explicit MTPmessages_messages(MTPDmessages_messagesSlice *_data); explicit MTPmessages_messages(MTPDmessages_channelMessages *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -4970,15 +4870,6 @@ public: private: explicit MTPmessagesFilter(mtpTypeId type); - 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; @@ -5562,50 +5453,6 @@ private: explicit MTPupdate(MTPDupdateEditChannelMessage *_data); explicit MTPupdate(MTPDupdateChannelPinnedMessage *_data); - 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; @@ -5700,8 +5547,6 @@ private: explicit MTPupdates_difference(MTPDupdates_difference *_data); explicit MTPupdates_difference(MTPDupdates_differenceSlice *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -5804,12 +5649,6 @@ private: explicit MTPupdates(MTPDupdates *_data); explicit MTPupdates(MTPDupdateShortSentMessage *_data); - 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; @@ -5860,7 +5699,6 @@ private: explicit MTPphotos_photos(MTPDphotos_photos *_data); explicit MTPphotos_photos(MTPDphotos_photosSlice *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6053,7 +5891,6 @@ private: explicit MTPhelp_appUpdate(mtpTypeId type); explicit MTPhelp_appUpdate(MTPDhelp_appUpdate *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6174,10 +6011,6 @@ private: explicit MTPencryptedChat(MTPDencryptedChat *_data); explicit MTPencryptedChat(MTPDencryptedChatDiscarded *_data); - 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; @@ -6246,7 +6079,6 @@ private: explicit MTPencryptedFile(mtpTypeId type); explicit MTPencryptedFile(MTPDencryptedFile *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6310,9 +6142,6 @@ private: explicit MTPinputEncryptedFile(MTPDinputEncryptedFile *_data); explicit MTPinputEncryptedFile(MTPDinputEncryptedFileBigUploaded *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6363,7 +6192,6 @@ private: explicit MTPencryptedMessage(MTPDencryptedMessage *_data); explicit MTPencryptedMessage(MTPDencryptedMessageService *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6414,7 +6242,6 @@ private: explicit MTPmessages_dhConfig(MTPDmessages_dhConfigNotModified *_data); explicit MTPmessages_dhConfig(MTPDmessages_dhConfig *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6465,7 +6292,6 @@ private: explicit MTPmessages_sentEncryptedMessage(MTPDmessages_sentEncryptedMessage *_data); explicit MTPmessages_sentEncryptedMessage(MTPDmessages_sentEncryptedFile *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6503,7 +6329,6 @@ private: explicit MTPinputDocument(mtpTypeId type); explicit MTPinputDocument(MTPDinputDocument *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6554,7 +6379,6 @@ private: explicit MTPdocument(MTPDdocumentEmpty *_data); explicit MTPdocument(MTPDdocument *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6623,9 +6447,6 @@ private: explicit MTPnotifyPeer(mtpTypeId type); explicit MTPnotifyPeer(MTPDnotifyPeer *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6702,15 +6523,6 @@ private: explicit MTPsendMessageAction(MTPDsendMessageUploadPhotoAction *_data); explicit MTPsendMessageAction(MTPDsendMessageUploadDocumentAction *_data); - 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; @@ -6766,7 +6578,6 @@ public: private: explicit MTPinputPrivacyKey(mtpTypeId type); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6791,7 +6602,6 @@ public: private: explicit MTPprivacyKey(mtpTypeId type); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -6842,11 +6652,6 @@ private: explicit MTPinputPrivacyRule(MTPDinputPrivacyValueAllowUsers *_data); explicit MTPinputPrivacyRule(MTPDinputPrivacyValueDisallowUsers *_data); - 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; @@ -6897,11 +6702,6 @@ private: explicit MTPprivacyRule(MTPDprivacyValueAllowUsers *_data); explicit MTPprivacyRule(MTPDprivacyValueDisallowUsers *_data); - 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; @@ -7053,11 +6853,6 @@ private: explicit MTPdocumentAttribute(MTPDdocumentAttributeAudio *_data); explicit MTPdocumentAttribute(MTPDdocumentAttributeFilename *_data); - 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; @@ -7095,7 +6890,6 @@ private: explicit MTPmessages_stickers(mtpTypeId type); explicit MTPmessages_stickers(MTPDmessages_stickers *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7164,7 +6958,6 @@ private: explicit MTPmessages_allStickers(mtpTypeId type); explicit MTPmessages_allStickers(MTPDmessages_allStickers *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7251,9 +7044,6 @@ public: private: explicit MTPcontactLink(mtpTypeId type); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7317,8 +7107,6 @@ private: explicit MTPwebPage(MTPDwebPagePending *_data); explicit MTPwebPage(MTPDwebPage *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7431,7 +7219,6 @@ private: explicit MTPaccount_password(MTPDaccount_noPassword *_data); explicit MTPaccount_password(MTPDaccount_password *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7593,7 +7380,6 @@ private: explicit MTPexportedChatInvite(mtpTypeId type); explicit MTPexportedChatInvite(MTPDchatInviteExported *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7644,7 +7430,6 @@ private: explicit MTPchatInvite(MTPDchatInviteAlready *_data); explicit MTPchatInvite(MTPDchatInvite *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7695,8 +7480,6 @@ private: explicit MTPinputStickerSet(MTPDinputStickerSetID *_data); explicit MTPinputStickerSet(MTPDinputStickerSetShortName *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7946,8 +7729,6 @@ private: explicit MTPreplyMarkup(MTPDreplyKeyboardForceReply *_data); explicit MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -7985,7 +7766,6 @@ private: explicit MTPhelp_appChangelog(mtpTypeId type); explicit MTPhelp_appChangelog(MTPDhelp_appChangelog *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8153,16 +7933,6 @@ private: explicit MTPmessageEntity(MTPDmessageEntityPre *_data); explicit MTPmessageEntity(MTPDmessageEntityTextUrl *_data); - 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; @@ -8200,7 +7970,6 @@ private: explicit MTPinputChannel(mtpTypeId type); explicit MTPinputChannel(MTPDinputChannel *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8357,8 +8126,6 @@ private: explicit MTPupdates_channelDifference(MTPDupdates_channelDifferenceTooLong *_data); explicit MTPupdates_channelDifference(MTPDupdates_channelDifference *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8396,8 +8163,6 @@ private: explicit MTPchannelMessagesFilter(mtpTypeId type); explicit MTPchannelMessagesFilter(MTPDchannelMessagesFilter *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8500,11 +8265,6 @@ private: explicit MTPchannelParticipant(MTPDchannelParticipantKicked *_data); explicit MTPchannelParticipant(MTPDchannelParticipantCreator *_data); - 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; @@ -8529,9 +8289,6 @@ public: private: explicit MTPchannelParticipantsFilter(mtpTypeId type); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8556,8 +8313,6 @@ public: private: explicit MTPchannelParticipantRole(mtpTypeId type); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8701,7 +8456,6 @@ private: explicit MTPfoundGif(MTPDfoundGif *_data); explicit MTPfoundGif(MTPDfoundGifCached *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8770,7 +8524,6 @@ private: explicit MTPmessages_savedGifs(mtpTypeId type); explicit MTPmessages_savedGifs(MTPDmessages_savedGifs *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8821,7 +8574,6 @@ private: explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageMediaAuto *_data); explicit MTPinputBotInlineMessage(MTPDinputBotInlineMessageText *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8903,7 +8655,6 @@ private: explicit MTPbotInlineMessage(MTPDbotInlineMessageMediaAuto *_data); explicit MTPbotInlineMessage(MTPDbotInlineMessageText *_data); - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -8967,8 +8718,6 @@ private: explicit MTPbotInlineResult(MTPDbotInlineMediaResultPhoto *_data); explicit MTPbotInlineResult(MTPDbotInlineResult *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -9117,8 +8866,6 @@ public: private: explicit MTPauth_codeType(mtpTypeId type); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; @@ -9195,9 +8942,6 @@ private: explicit MTPauth_sentCodeType(MTPDauth_sentCodeTypeCall *_data); explicit MTPauth_sentCodeType(MTPDauth_sentCodeTypeFlashCall *_data); - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; - friend class MTP::internal::TypeCreator; friend class MTP::internal::TypeCreator; mtpTypeId _type; diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index f6d50ce38d..df873ef61d 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -640,6 +640,7 @@ true true + true true @@ -928,6 +929,7 @@ true true + true true @@ -1057,6 +1059,8 @@ true + true + true @@ -1092,6 +1096,8 @@ .\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 + true + true From e45de88bd654811ca6f00a94eca3421b95130e3d Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 22 Mar 2016 22:43:47 +0300 Subject: [PATCH 234/316] moving left userpics at the top of the conversation window, beta 9034002 --- Telegram/SourceFiles/config.h | 6 +- Telegram/SourceFiles/history.cpp | 86 ++++------ Telegram/SourceFiles/history.h | 25 +-- Telegram/SourceFiles/historywidget.cpp | 220 ++++++++++++++----------- Telegram/SourceFiles/historywidget.h | 205 ++++++++++++++--------- Telegram/Telegram.rc | 8 +- Telegram/Version | 2 +- 7 files changed, 305 insertions(+), 247 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index d8fdc4e3a2..b232cbb759 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9034; static const wchar_t *AppVersionStr = L"0.9.34"; static const bool DevVersion = false; -#define BETA_VERSION (9034001ULL) // just comment this line to build public version +#define BETA_VERSION (9034002ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; @@ -101,8 +101,8 @@ enum { MediaOverviewStartPerPage = 5, MediaOverviewPreloadCount = 4, - // a new message from the same sender is attached to previous within 30 seconds - AttachMessageToPreviousSecondsDelta = 30, + // a new message from the same sender is attached to previous within 15 minutes + AttachMessageToPreviousSecondsDelta = 900, AudioVoiceMsgSimultaneously = 4, AudioSongSimultaneously = 4, diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 38406e37fa..fe436909e3 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2843,7 +2843,7 @@ 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*/; + attach = !prev->isPost() && !prev->serviceMsg() && prev->from() == from() && qAbs(prev->date.secsTo(date)) < AttachMessageToPreviousSecondsDelta; } } if (attach && !(_flags & MTPDmessage_ClientFlag::f_attach_to_previous)) { @@ -2860,14 +2860,6 @@ void HistoryItem::setId(MsgId newId) { id = newId; } -bool HistoryItem::displayFromPhoto() const { - return hasFromPhoto() && !isAttachedToPrevious(); -} - -bool HistoryItem::hasFromPhoto() const { - return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !isPost(); -} - bool HistoryItem::canEdit(const QDateTime &cur) const { ChannelData *channel = _history->peer->asChannel(); int32 s = date.secsTo(cur); @@ -6039,10 +6031,7 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { 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) -, _media(0) { +, _text(st::msgMinWidth) { PeerId authorOriginalId = 0, fromOriginalId = 0; MsgId originalId = 0; if (msg.has_fwd_from() && msg.vfwd_from.type() == mtpc_messageFwdHeader) { @@ -6061,11 +6050,7 @@ HistoryMessage::HistoryMessage(History *history, const MTPDmessage &msg) : } 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) -, _textHeight(0) -, _media(nullptr) { +: HistoryItem(history, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) { UserData *fwdViaBot = fwd->viaBot(); int32 viaBotId = fwdViaBot ? peerToUser(fwdViaBot->id) : 0; int32 fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1); @@ -6079,22 +6064,14 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags fl } 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) { + : HistoryItem(history, id, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); setText(msg, entities); } 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) { +HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); initMediaFromDocument(doc, caption); @@ -6102,11 +6079,7 @@ HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) } 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) { +HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); _media = new HistoryPhoto(photo, caption, this); @@ -6598,14 +6571,11 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); - if (displayFromPhoto()) { - int photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - int phototop = marginTop(); -// if (history()->scrollTopItem == this) { -// phototop = qMax(qMin(history()->scrollTopOffset, _height - marginBottom() - int(st::msgPhotoSize)), phototop); -// } - author()->paintUserpic(p, st::msgPhotoSize, photoleft, phototop); - } + //if (displayFromPhoto()) { + // int photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + // int phototop = marginTop(); + // author()->paintUserpic(p, st::msgPhotoSize, photoleft, phototop); + //} if (bubble) { const HistoryMessageForwarded *fwd = Get(); @@ -6809,13 +6779,13 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 int left = 0, width = 0, height = _height; countPositionAndSize(left, width); - if (displayFromPhoto()) { - int32 photoleft = left + ((!isPost() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - if (x >= photoleft && x < photoleft + st::msgPhotoSize && y >= marginTop() && y < height - marginBottom()) { - lnk = author()->lnk; - return; - } - } + //if (displayFromPhoto()) { + // int32 photoleft = left + ((!isPost() && out() && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + // if (x >= photoleft && x < photoleft + st::msgPhotoSize && y >= marginTop() && y < height - marginBottom()) { + // lnk = author()->lnk; + // return; + // } + //} if (width < 1) return; if (drawBubble()) { @@ -6972,6 +6942,14 @@ QString HistoryMessage::notificationText() const { return msg; } +bool HistoryMessage::displayFromPhoto() const { + return hasFromPhoto() && !isAttachedToPrevious(); +} + +bool HistoryMessage::hasFromPhoto() const { + return (Adaptive::Wide() || (!out() && !history()->peer->isUser())) && !isPost(); +} + HistoryMessage::~HistoryMessage() { if (_media) { _media->detachFromItem(this); @@ -7224,12 +7202,12 @@ void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x if (drawBubble()) { int32 left = 0, width = 0; countPositionAndSize(left, width); - if (displayFromPhoto()) { - int32 photoleft = left + ((!isPost() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - if (x >= photoleft && x < photoleft + st::msgPhotoSize) { - return HistoryMessage::getState(lnk, state, x, y); - } - } + //if (displayFromPhoto()) { + // int32 photoleft = left + ((!isPost() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); + // if (x >= photoleft && x < photoleft + st::msgPhotoSize) { + // return HistoryMessage::getState(lnk, state, x, y); + // } + //} if (width < 1) return; int top = marginTop(); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 99eb6b22cb..5520aeccd5 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1384,6 +1384,9 @@ public: int marginBottom() const { return st::msgMargin.bottom(); } + bool isAttachedToPrevious() const { + return _flags & MTPDmessage_ClientFlag::f_attach_to_previous; + } void clipCallback(ClipReaderNotification notification); @@ -1434,14 +1437,6 @@ protected: // 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; }; @@ -2495,6 +2490,11 @@ public: return this; } + // 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; + ~HistoryMessage(); protected: @@ -2519,13 +2519,14 @@ protected: } void paintForwardedInfo(Painter &p, int32 x, int32 y, int32 w, bool selected) const; - Text _text; + Text _text = { st::msgMinWidth }; - int32 _textWidth, _textHeight; + int _textWidth = 0; + int _textHeight = 0; - HistoryMedia *_media; + HistoryMedia *_media = nullptr; QString _timeText; - int32 _timeWidth; + int _timeWidth = 0; }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 28980fec1d..61a2557c0b 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -38,41 +38,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org // flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html -HistoryInner::HistoryInner(HistoryWidget *historyWidget, ScrollArea *scroll, History *history) : TWidget(0) +HistoryInner::HistoryInner(HistoryWidget *historyWidget, ScrollArea *scroll, History *history) : TWidget(nullptr) , _peer(history->peer) -, _migrated(history->peer->migrateFrom() ? App::history(history->peer->migrateFrom()->id) : 0) +, _migrated(history->peer->migrateFrom() ? App::history(history->peer->migrateFrom()->id) : nullptr) , _history(history) -, _historyOffset(0) -, _historySkipHeight(0) -, _botInfo(history->peer->isUser() ? history->peer->asUser()->botInfo : 0) -, _botDescWidth(0) -, _botDescHeight(0) +, _botInfo(history->peer->isUser() ? history->peer->asUser()->botInfo : nullptr) , _widget(historyWidget) -, _scroll(scroll) -, _curHistory(0) -, _curBlock(0) -, _curItem(0) -, _firstLoading(false) -, _cursor(style::cur_default) -, _dragAction(NoDrag) -, _dragSelType(TextSelectLetters) -, _dragItem(0) -, _dragCursorState(HistoryDefaultCursorState) -, _dragWasInactive(false) -, _dragSelFrom(0) -, _dragSelTo(0) -, _dragSelecting(false) -, _wasSelectedText(false) -, _touchScroll(false) -, _touchSelect(false) -, _touchInProgress(false) -, _touchScrollState(TouchScrollManual) -, _touchPrevPosValid(false) -, _touchWaitingAcceleration(false) -, _touchSpeedTime(0) -, _touchAccelerationTime(0) -, _touchTime(0) -, _menu(0) { +, _scroll(scroll) { connect(App::wnd(), SIGNAL(imageLoaded()), this, SLOT(update())); _touchSelectTimer.setSingleShot(true); @@ -122,6 +94,69 @@ void HistoryInner::repaintItem(const HistoryItem *item) { } } +template +void HistoryInner::enumerateUserpicsInHistory(History *h, int htop, Method method) { + // no displayed messages in this history + if (htop < 0) return; + + // find and remember the bottom of an attached messages pack + // -1 means we didn't find an attached to previous message yet + int lowestAttachedItemBottom = -1; + + int blockIndex = h->blocks.size(); + int itemIndex = 0; + while (blockIndex > 0) { + HistoryBlock *block = h->blocks.at(--blockIndex); + itemIndex = block->items.size(); + + int blocktop = htop + block->y; + while (itemIndex > 0) { + HistoryItem *item = block->items.at(--itemIndex); + int itemtop = blocktop + item->y; + int itembottom = itemtop + item->height(); + + // skip items that are below the visible area + if (itemtop >= _visibleAreaBottom) { + continue; + } + + if (HistoryMessage *message = item->toHistoryMessage()) { + if (lowestAttachedItemBottom < 0 && message->isAttachedToPrevious()) { + lowestAttachedItemBottom = itembottom - message->marginBottom(); + } + + // draw userpic for all messages that have it and for those who are not showing it + // because of their attachment to the previous message if they are top-most visible + if (message->displayFromPhoto() || (message->hasFromPhoto() && itemtop <= _visibleAreaTop)) { + if (lowestAttachedItemBottom < 0) { + lowestAttachedItemBottom = itembottom - message->marginBottom(); + } + int userpicTop = qMin(qMax(itemtop + message->marginTop(), _visibleAreaTop + st::msgMargin.left()), lowestAttachedItemBottom - int(st::msgPhotoSize)); + + // call the template callback function that was passed + // and return if it finished everything it needed + if (!method(message, userpicTop)) { + return; + } + + // forget the found bottom of the pack, search for the next one from scratch + lowestAttachedItemBottom = -1; + } + } + + // skip all the items that are above the visible area + if (itemtop <= _visibleAreaTop) { + return; + } + } + + // skip all the rest blocks that are above the visible area + if (blocktop <= _visibleAreaTop) { + return; + } + } +} + void HistoryInner::paintEvent(QPaintEvent *e) { if (App::wnd() && App::wnd()->contentOverlapped(this, e)) return; @@ -252,6 +287,19 @@ void HistoryInner::paintEvent(QPaintEvent *e) { item = block->items[iItem]; } p.restore(); + + enumerateUserpics([&p, &r](HistoryMessage *message, int userpicTop) -> bool { + // stop the enumeration if the userpic is above the painted rect + if (userpicTop + st::msgPhotoSize <= r.top()) { + return false; + } + + // paint the userpic if it intersects the painted rect + if (userpicTop < r.top() + r.height()) { + message->from()->paintUserpicLeft(p, st::msgPhotoSize, st::msgMargin.left(), userpicTop, message->history()->width); + } + return true; + }); } } } @@ -1360,6 +1408,7 @@ HistoryItem *HistoryInner::atTopImportantMsg(int32 top, int32 height, int32 &bot void HistoryInner::visibleAreaUpdated(int top, int bottom) { _visibleAreaTop = top; + _visibleAreaBottom = bottom; // if history has pending resize events we should not update scrollTopItem if (_history->hasPendingResizedItems()) { @@ -1637,6 +1686,25 @@ void HistoryInner::onUpdateSelected() { } } else if (item) { item->getState(lnk, cursorState, m.x(), m.y()); + if (!lnk && m.x() >= st::msgMargin.left() && m.x() < st::msgMargin.left() + st::msgPhotoSize) { + if (HistoryMessage *msg = item->toHistoryMessage()) { + if (msg->hasFromPhoto()) { + enumerateUserpics([&lnk, msg, &point](HistoryMessage *message, int userpicTop) -> bool { + // stop enumeration if the userpic is above our point + if (userpicTop + st::msgPhotoSize <= point.y()) { + return false; + } + + // stop enumeration if we've found a userpic under the cursor + if (point.y() >= userpicTop && point.y() < userpicTop + st::msgPhotoSize) { + lnk = message->from()->lnk; + return false; + } + return true; + }); + } + } + } } if (lnk != textlnkOver()) { lnkChanged = true; @@ -2690,52 +2758,17 @@ QPoint SilentToggle::tooltipPos() const { } HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) -, _replyToId(0) -, _replyToNameVersion(0) -, _editMsgId(0) -, _replyEditMsg(0) , _fieldBarCancel(this, st::replyCancel) -, _pinnedBar(0) -, _saveEditMsgRequestId(0) -, _reportSpamStatus(dbiprsUnknown) -, _reportSpamSettingRequestId(ReportSpamRequestNeeded) -, _previewData(0) -, _previewRequest(0) -, _previewCancelled(false) -, _replyForwardPressed(false) -, _replyReturn(0) -, _stickersUpdateRequest(0) -, _savedGifsUpdateRequest(0) -, _peer(0) -, _clearPeer(0) -, _channel(NoChannel) -, _showAtMsgId(0) -, _fixedInScrollMsgId(0) -, _fixedInScrollMsgTop(0) -, _firstLoadRequest(0), _preloadRequest(0), _preloadDownRequest(0) -, _delayedShowAtMsgId(-1) -, _delayedShowAtRequest(0) -, _activeAnimMsgId(0) , _scroll(this, st::historyScroll, false) -, _list(0) -, _migrated(0) -, _history(0) -, _histInited(false) -, _lastScroll(0) -, _lastScrolled(0) , _toHistoryEnd(this, st::historyToEnd) , _collapseComments(this) , _attachMention(this) -, _inlineBot(0) -, _inlineBotResolveRequestId(0) , _reportSpamPanel(this) , _send(this, lang(lng_send_button), st::btnSend) , _unblock(this, lang(lng_unblock_button), st::btnUnblock) , _botStart(this, lang(lng_bot_start), st::btnSend) , _joinChannel(this, lang(lng_channel_join), st::btnSend) , _muteUnmute(this, lang(lng_channel_mute), st::btnSend) -, _unblockRequest(0) -, _reportSpamRequest(0) , _attachDocument(this, st::btnAttachDocument) , _attachPhoto(this, st::btnAttachPhoto) , _attachEmoji(this, st::btnAttachEmoji) @@ -2744,42 +2777,20 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent) , _cmdStart(this, st::btnBotCmdStart) , _broadcast(this, QString(), true, st::broadcastToggle) , _silent(this) -, _cmdStartShown(false) , _field(this, st::taMsgField, lang(lng_message_ph)) , _a_record(animation(this, &HistoryWidget::step_record)) , _a_recording(animation(this, &HistoryWidget::step_recording)) -, _recording(false) -, _inRecord(false) -, _inField(false) -, _inReplyEdit(false) -, _inPinnedMsg(false) -, a_recordingLevel(0, 0) -, _recordingSamples(0) -, a_recordOver(0, 0) -, a_recordDown(0, 0) , a_recordCancel(st::recordCancel->c, st::recordCancel->c) , _recordCancelWidth(st::recordFont->width(lang(lng_record_cancel))) -, _kbShown(false) -, _kbReplyTo(0) , _kbScroll(this, st::botKbScroll) -, _keyboard() , _attachType(this) , _emojiPan(this) -, _attachDrag(DragStateNone) , _attachDragDocument(this) , _attachDragPhoto(this) , _fileLoader(this, FileLoaderQueueStopTimeout) -, _textUpdateEventsFlags(TextUpdateEventsSaveDraft | TextUpdateEventsSendTyping) -, _serviceImageCacheSize(0) -, _confirmWithTextId(0) -, _titlePeerTextWidth(0) , _a_show(animation(this, &HistoryWidget::step_show)) -, _scrollDelta(0) -, _saveDraftStart(0) -, _saveDraftText(false) , _sideShadow(this, st::shadowColor) -, _topShadow(this, st::shadowColor) -, _inGrab(false) { +, _topShadow(this, st::shadowColor) { _scroll.setFocusPolicy(Qt::NoFocus); setAcceptDrops(true); @@ -3658,7 +3669,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _fieldBarCancel.hide(); if (_list) _list->deleteLater(); - _list = 0; + _list = nullptr; _scroll.takeWidget(); updateTopBarSelection(); @@ -3730,6 +3741,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _scroll.hide(); _scroll.setWidget(_list); _list->show(); + visibleAreaUpdated(); _updateHistoryItems.stop(); @@ -3965,9 +3977,9 @@ void HistoryWidget::updateControlsVisibility() { _pinnedBar->cancel.show(); _pinnedBar->shadow.show(); } - if (_firstLoadRequest) { + if (_firstLoadRequest && !_scroll.isHidden()) { _scroll.hide(); - } else { + } else if (!_firstLoadRequest && _scroll.isHidden()) { _scroll.show(); } if (_reportSpamStatus == dbiprsShowButton || _reportSpamStatus == dbiprsReportSent) { @@ -4578,7 +4590,10 @@ void HistoryWidget::delayedShowAt(MsgId showAtMsgId) { void HistoryWidget::onScroll() { App::checkImageCacheSize(); preloadHistoryIfNeeded(); + visibleAreaUpdated(); +} +void HistoryWidget::visibleAreaUpdated() { if (_list && !_scroll.isHidden()) { int st = _scroll.scrollTop(); _list->visibleAreaUpdated(st, st + _scroll.height()); @@ -6385,6 +6400,8 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh bool wasAtBottom = _scroll.scrollTop() + 1 > _scroll.scrollTopMax(), needResize = _scroll.width() != width() || _scroll.height() != newScrollHeight; if (needResize) { _scroll.resize(width(), newScrollHeight); + visibleAreaUpdated(); + _attachMention.setBoundings(_scroll.geometry()); _toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip); updateCollapseCommentsVisibility(); @@ -6402,13 +6419,19 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh } if ((!initial && !wasAtBottom) || (loadedDown && (!_history->showFrom || _history->unreadBar || _history->loadedAtBottom()) && (!_migrated || !_migrated->showFrom || _migrated->unreadBar || _history->loadedAtBottom()))) { - int32 addToY = 0; + int addToY = 0; if (change.type == ScrollChangeAdd) { addToY = change.value; } else if (change.type == ScrollChangeOldHistoryHeight) { addToY = _list->historyHeight() - change.value; } - _scroll.scrollToY(_list->historyScrollTop() + addToY); + int toY = _list->historyScrollTop() + addToY; + if (toY > _scroll.scrollTopMax()) toY = _scroll.scrollTopMax(); + if (_scroll.scrollTop() == toY) { + visibleAreaUpdated(); + } else { + _scroll.scrollToY(toY); + } return; } @@ -6511,7 +6534,12 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh } } else { } - _scroll.scrollToY(toY); + if (toY > _scroll.scrollTopMax()) toY = _scroll.scrollTopMax(); + if (_scroll.scrollTop() == toY) { + visibleAreaUpdated(); + } else { + _scroll.scrollToY(toY); + } } void HistoryWidget::addMessagesToFront(PeerData *peer, const QVector &messages, const QVector *collapsed) { diff --git a/Telegram/SourceFiles/historywidget.h b/Telegram/SourceFiles/historywidget.h index 7c7ba35b91..5eabc4ffb9 100644 --- a/Telegram/SourceFiles/historywidget.h +++ b/Telegram/SourceFiles/historywidget.h @@ -139,22 +139,30 @@ private: HistoryItem *nextItem(HistoryItem *item); void updateDragSelection(HistoryItem *dragSelFrom, HistoryItem *dragSelTo, bool dragSelecting, bool force = false); - PeerData *_peer; - History *_migrated, *_history; - int32 _historyOffset, _historySkipHeight; // height of first date and first sys msg + PeerData *_peer = nullptr; + History *_migrated = nullptr; + History *_history = nullptr; + int _historyOffset = 0; - BotInfo *_botInfo; - int32 _botDescWidth, _botDescHeight; + // 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) + int _historySkipHeight = 0; + + BotInfo *_botInfo = nullptr; + int _botDescWidth = 0; + int _botDescHeight = 0; QRect _botDescRect; - HistoryWidget *_widget; - ScrollArea *_scroll; - mutable History *_curHistory; - mutable int32 _curBlock, _curItem; + HistoryWidget *_widget = nullptr; + ScrollArea *_scroll = nullptr; + mutable History *_curHistory = nullptr; + mutable int _curBlock = 0; + mutable int _curItem = 0; - bool _firstLoading; + bool _firstLoading = false; - Qt::CursorShape _cursor; + style::cursor _cursor = style::cur_default; typedef QMap SelectedItems; SelectedItems _selected; void applyDragSelection(); @@ -168,36 +176,60 @@ private: PrepareSelect = 0x03, Selecting = 0x04, }; - DragAction _dragAction; - TextSelectType _dragSelType; + DragAction _dragAction = NoDrag; + TextSelectType _dragSelType = TextSelectLetters; QPoint _dragStartPos, _dragPos; - HistoryItem *_dragItem; - HistoryCursorState _dragCursorState; - uint16 _dragSymbol; - bool _dragWasInactive; + HistoryItem *_dragItem = nullptr; + HistoryCursorState _dragCursorState = HistoryDefaultCursorState; + uint16 _dragSymbol = 0; + bool _dragWasInactive = false; QPoint _trippleClickPoint; QTimer _trippleClickTimer; TextLinkPtr _contextMenuLnk; - HistoryItem *_dragSelFrom, *_dragSelTo; - bool _dragSelecting; - bool _wasSelectedText; // was some text selected in current drag action + HistoryItem *_dragSelFrom = nullptr; + HistoryItem *_dragSelTo = nullptr; + bool _dragSelecting = false; + bool _wasSelectedText = false; // was some text selected in current drag action - bool _touchScroll, _touchSelect, _touchInProgress; + // scroll by touch support (at least Windows Surface tablets) + bool _touchScroll = false; + bool _touchSelect = false; + bool _touchInProgress = false; QPoint _touchStart, _touchPrevPos, _touchPos; QTimer _touchSelectTimer; - TouchScrollState _touchScrollState; - bool _touchPrevPosValid, _touchWaitingAcceleration; + TouchScrollState _touchScrollState = TouchScrollManual; + bool _touchPrevPosValid = false; + bool _touchWaitingAcceleration = false; QPoint _touchSpeed; - uint64 _touchSpeedTime, _touchAccelerationTime, _touchTime; + uint64 _touchSpeedTime = 0; + uint64 _touchAccelerationTime = 0; + uint64 _touchTime = 0; QTimer _touchScrollTimer; - PopupMenu *_menu; + // context menu + PopupMenu *_menu = nullptr; + // save visible area coords for painting / pressing userpics int _visibleAreaTop = 0; + int _visibleAreaBottom = 0; + + // this function finds all userpics on the left that are displayed and calls template method + // for each found userpic (from the bottom to the top) in the passed history with passed top offset + // + // method has "bool (*Method)(HistoryMessage *message, int userpicTop)" signature + // if it returns false the enumeration stops immidiately + template + void enumerateUserpicsInHistory(History *h, int htop, Method method); + + template + void enumerateUserpics(Method method) { + enumerateUserpicsInHistory(_history, historyTop(), method); + enumerateUserpicsInHistory(_migrated, migratedTop(), method); + } }; @@ -721,14 +753,14 @@ public slots: private: - MsgId _replyToId; + MsgId _replyToId = 0; Text _replyToName; - int32 _replyToNameVersion; + int _replyToNameVersion = 0; void updateReplyToName(); - MsgId _editMsgId; + MsgId _editMsgId = 0; - HistoryItem *_replyEditMsg; + HistoryItem *_replyEditMsg = nullptr; Text _replyEditMsgText; IconedButton _fieldBarCancel; @@ -737,13 +769,13 @@ private: struct PinnedBar { PinnedBar(MsgId msgId, HistoryWidget *parent); - MsgId msgId; - HistoryItem *msg; + MsgId msgId = 0; + HistoryItem *msg = nullptr; Text text; IconedButton cancel; PlainShadow shadow; }; - PinnedBar *_pinnedBar; + PinnedBar *_pinnedBar = nullptr; void updatePinnedBar(bool force = false); bool pinnedMsgVisibilityUpdated(); void destroyPinnedBar(); @@ -767,32 +799,33 @@ private: // destroys _history and _migrated unread bars void destroyUnreadBar(); - mtpRequestId _saveEditMsgRequestId; + mtpRequestId _saveEditMsgRequestId = 0; void saveEditMsg(); void saveEditMsgDone(History *history, const MTPUpdates &updates, mtpRequestId req); bool saveEditMsgFail(History *history, const RPCError &error, mtpRequestId req); - DBIPeerReportSpamStatus _reportSpamStatus; - mtpRequestId _reportSpamSettingRequestId; static const mtpRequestId ReportSpamRequestNeeded = -1; + DBIPeerReportSpamStatus _reportSpamStatus = dbiprsUnknown; + mtpRequestId _reportSpamSettingRequestId = ReportSpamRequestNeeded; void updateReportSpamStatus(); void requestReportSpamSetting(); void reportSpamSettingDone(const MTPPeerSettings &result, mtpRequestId req); bool reportSpamSettingFail(const RPCError &error, mtpRequestId req); QString _previewLinks; - WebPageData *_previewData; + WebPageData *_previewData = nullptr; typedef QMap PreviewCache; PreviewCache _previewCache; - mtpRequestId _previewRequest; - Text _previewTitle, _previewDescription; + mtpRequestId _previewRequest = 0; + Text _previewTitle; + Text _previewDescription; SingleTimer _previewTimer; - bool _previewCancelled; + bool _previewCancelled = false; void gotPreview(QString links, const MTPMessageMedia &media, mtpRequestId req); - bool _replyForwardPressed; + bool _replyForwardPressed = false; - HistoryItem *_replyReturn; + HistoryItem *_replyReturn = nullptr; QList _replyReturns; bool messagesFailed(const RPCError &error, mtpRequestId requestId); @@ -824,11 +857,11 @@ private: void countHistoryShowFrom(); - mtpRequestId _stickersUpdateRequest; + mtpRequestId _stickersUpdateRequest = 0; void stickersGot(const MTPmessages_AllStickers &stickers); bool stickersFailed(const RPCError &error); - mtpRequestId _savedGifsUpdateRequest; + mtpRequestId _savedGifsUpdateRequest = 0; void savedGifsGot(const MTPmessages_SavedGifs &gifs); bool savedGifsFailed(const RPCError &error); @@ -840,39 +873,51 @@ private: void updateDragAreas(); + // when scroll position or scroll area size changed this method + // updates the boundings of the visible area in HistoryInner + void visibleAreaUpdated(); + bool readyToForward() const; bool hasBroadcastToggle() const; bool hasSilentToggle() const; - PeerData *_peer, *_clearPeer; // cache _peer in _clearPeer when showing clear history box - ChannelId _channel; - bool _canSendMessages; - MsgId _showAtMsgId, _fixedInScrollMsgId; - int32 _fixedInScrollMsgTop; + PeerData *_peer = nullptr; - mtpRequestId _firstLoadRequest, _preloadRequest, _preloadDownRequest; + // cache current _peer in _clearPeer when showing clear history box + PeerData *_clearPeer = nullptr; - MsgId _delayedShowAtMsgId; - mtpRequestId _delayedShowAtRequest; + ChannelId _channel = NoChannel; + bool _canSendMessages = false; + MsgId _showAtMsgId = ShowAtUnreadMsgId; + MsgId _fixedInScrollMsgId = 0; + int32 _fixedInScrollMsgTop = 0; - MsgId _activeAnimMsgId; + mtpRequestId _firstLoadRequest = 0; + mtpRequestId _preloadRequest = 0; + mtpRequestId _preloadDownRequest = 0; + + MsgId _delayedShowAtMsgId = -1; // wtf? + mtpRequestId _delayedShowAtRequest = 0; + + MsgId _activeAnimMsgId = 0; ScrollArea _scroll; - HistoryInner *_list; - History *_migrated, *_history; - bool _histInited; // initial updateListSize() called + HistoryInner *_list = nullptr; + History *_migrated = nullptr; + History *_history = nullptr; + bool _histInited = false; // initial updateListSize() called - int32 _lastScroll; - uint64 _lastScrolled; + int32 _lastScroll = 0; + uint64 _lastScrolled = 0; QTimer _updateHistoryItems; // gifs optimization IconedButton _toHistoryEnd; CollapseButton _collapseComments; MentionsDropdown _attachMention; - UserData *_inlineBot; + UserData *_inlineBot = nullptr; QString _inlineBotUsername; - mtpRequestId _inlineBotResolveRequestId; + mtpRequestId _inlineBotResolveRequestId = 0; void inlineBotResolveDone(const MTPcontacts_ResolvedPeer &result); bool inlineBotResolveFail(QString name, const RPCError &error); @@ -885,46 +930,52 @@ private: ReportSpamPanel _reportSpamPanel; FlatButton _send, _unblock, _botStart, _joinChannel, _muteUnmute; - mtpRequestId _unblockRequest, _reportSpamRequest; + mtpRequestId _unblockRequest = 0; + mtpRequestId _reportSpamRequest = 0; IconedButton _attachDocument, _attachPhoto; EmojiButton _attachEmoji; IconedButton _kbShow, _kbHide, _cmdStart; FlatCheckbox _broadcast; SilentToggle _silent; - bool _cmdStartShown; + bool _cmdStartShown = false; MessageField _field; Animation _a_record, _a_recording; - bool _recording, _inRecord, _inField, _inReplyEdit, _inPinnedMsg; - anim::ivalue a_recordingLevel; - int32 _recordingSamples; - anim::fvalue a_recordOver, a_recordDown; + bool _recording = false; + bool _inRecord = false; + bool _inField = false; + bool _inReplyEdit = false; + bool _inPinnedMsg = false; + anim::ivalue a_recordingLevel = { 0, 0 }; + int32 _recordingSamples = 0; + anim::fvalue a_recordOver = { 0, 0 }; + anim::fvalue a_recordDown = { 0, 0 }; anim::cvalue a_recordCancel; int32 _recordCancelWidth; bool kbWasHidden() const; - bool _kbShown; - HistoryItem *_kbReplyTo; + bool _kbShown = false; + HistoryItem *_kbReplyTo = nullptr; ScrollArea _kbScroll; BotKeyboard _keyboard; Dropdown _attachType; EmojiPan _emojiPan; - DragState _attachDrag; + DragState _attachDrag = DragStateNone; DragArea _attachDragDocument, _attachDragPhoto; int32 _selCount; // < 0 - text selected, focus list, not _field TaskQueue _fileLoader; - int32 _textUpdateEventsFlags; + int32 _textUpdateEventsFlags = (TextUpdateEventsSaveDraft | TextUpdateEventsSendTyping); - int64 _serviceImageCacheSize; + int64 _serviceImageCacheSize = 0; QString _confirmSource; - uint64 _confirmWithTextId; + uint64 _confirmWithTextId = 0; QString _titlePeerText; - int32 _titlePeerTextWidth; + int32 _titlePeerTextWidth = 0; Animation _a_show; QPixmap _cacheUnder, _cacheOver, _cacheTopBarUnder, _cacheTopBarOver; @@ -932,20 +983,20 @@ private: anim::fvalue a_shadow; QTimer _scrollTimer; - int32 _scrollDelta; + int32 _scrollDelta = 0; QTimer _animActiveTimer; - float64 _animActiveStart; + float64 _animActiveStart = 0; QMap, mtpRequestId> _sendActionRequests; QTimer _sendActionStopTimer; - uint64 _saveDraftStart; - bool _saveDraftText; + uint64 _saveDraftStart = 0; + bool _saveDraftText = false; QTimer _saveDraftTimer; PlainShadow _sideShadow, _topShadow; - bool _inGrab; + bool _inGrab = false; }; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index debef465de..8485fe9cd2 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,34,1 - PRODUCTVERSION 0,9,34,1 + FILEVERSION 0,9,34,2 + PRODUCTVERSION 0,9,34,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.34.1" + VALUE "FileVersion", "0.9.34.2" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.34.1" + VALUE "ProductVersion", "0.9.34.2" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 106da55f5b..1997f59694 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.34 AppVersionStr 0.9.34 DevChannel 0 -BetaVersion 9034001 +BetaVersion 9034002 From 82e4660ae9fb8ca4d48c2f866348ae016f8739d0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 22 Mar 2016 22:50:14 +0300 Subject: [PATCH 235/316] fixed build for clang and g++ --- Telegram/SourceFiles/history.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 5520aeccd5..b7e3e373d3 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -2519,7 +2519,7 @@ protected: } void paintForwardedInfo(Painter &p, int32 x, int32 y, int32 w, bool selected) const; - Text _text = { st::msgMinWidth }; + Text _text = { int(st::msgMinWidth) }; int _textWidth = 0; int _textHeight = 0; From 02ca81ac64be5bd55159b5d6e7b443d5ec5eacbf Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Mar 2016 14:47:32 +0300 Subject: [PATCH 236/316] optimized enumeration of userpics --- Telegram/SourceFiles/history.cpp | 20 +++++--- Telegram/SourceFiles/history.h | 8 +++- Telegram/SourceFiles/historywidget.cpp | 65 ++++++++++++++++++++------ Telegram/SourceFiles/layout.cpp | 7 +-- Telegram/SourceFiles/layout.h | 9 ++-- Telegram/Telegram.vcxproj | 1 + 6 files changed, 76 insertions(+), 34 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index fe436909e3..6e9458d94c 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -293,8 +293,8 @@ History::History(const PeerId &peerId) : width(0), height(0) if (peer->isChannel() || (peer->isUser() && peer->asUser()->botInfo)) { outboxReadBefore = INT_MAX; } - for (int32 i = 0; i < OverviewCount; ++i) { - overviewCountData[i] = -1; // not loaded yet + for (auto &countData : overviewCountData) { + countData = -1; // not loaded yet } } @@ -309,6 +309,15 @@ void History::clearLastKeyboard() { lastKeyboardFrom = 0; } +bool History::canHaveFromPhotos() const { + if (peer->isUser() && !Adaptive::Wide()) { + return false; + } else if (isChannel() && asChannelHistory()->onlyImportant()) { + return false; + } + return true; +} + void History::setHasPendingResizedItems() { _flags |= Flag::f_has_pending_resized_items; Global::RefHandleHistoryUpdate().call(); @@ -6030,8 +6039,7 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { } 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) { + HistoryItem(history, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) { PeerId authorOriginalId = 0, fromOriginalId = 0; MsgId originalId = 0; if (msg.has_fwd_from() && msg.vfwd_from.type() == mtpc_messageFwdHeader) { @@ -7540,9 +7548,7 @@ bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptex } 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) { + HistoryItem(history, msg.vid.v, mtpCastFlags(msg.vflags.v), ::date(msg.vdate), msg.has_from_id() ? msg.vfrom_id.v : 0) { if (msg.has_reply_to_msg_id()) { UpdateInterfaces(HistoryServicePinned::Bit()); MsgId pinnedMsgId = Get()->msgId = msg.vreply_to_msg_id.v; diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 5520aeccd5..c10ed01fd0 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -346,6 +346,10 @@ public: bool updateTyping(uint64 ms, bool force = false); void clearLastKeyboard(); + // optimization for userpics displayed on the left + // if this returns false there is no need to even try to handle them + bool canHaveFromPhotos() const; + typedef QList Blocks; Blocks blocks; @@ -2717,8 +2721,8 @@ protected: bool updatePinned(bool force = false); bool updatePinnedText(const QString *pfrom = nullptr, QString *ptext = nullptr); - Text _text; - HistoryMedia *_media; + Text _text = { int(st::msgMinWidth) }; + HistoryMedia *_media = nullptr; int32 _textWidth, _textHeight; }; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 61a2557c0b..8ff4d8d759 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -94,32 +94,53 @@ void HistoryInner::repaintItem(const HistoryItem *item) { } } +namespace { + // helper binary search for an item in a list that is not completely below the given bottom of the visible area + // is applied once for blocks list in a history and once for items list in the found block + template + int binarySearchBlocksOrItems(const T &list, int bottom) { + int start = 0, end = list.size(); + while (end - start > 1) { + int middle = (start + end) / 2; + if (list.at(middle)->y >= bottom) { + end = middle; + } else { + start = middle; + } + } + return start; + } +} + template void HistoryInner::enumerateUserpicsInHistory(History *h, int htop, Method method) { // no displayed messages in this history - if (htop < 0) return; + if (htop < 0 || h->isEmpty() || !h->canHaveFromPhotos() || _visibleAreaBottom <= htop) { + return; + } // find and remember the bottom of an attached messages pack // -1 means we didn't find an attached to previous message yet int lowestAttachedItemBottom = -1; - int blockIndex = h->blocks.size(); - int itemIndex = 0; - while (blockIndex > 0) { - HistoryBlock *block = h->blocks.at(--blockIndex); - itemIndex = block->items.size(); + // binary search for blockIndex of the first block that is not completely below the visible area + int blockIndex = binarySearchBlocksOrItems(h->blocks, _visibleAreaBottom - htop); - int blocktop = htop + block->y; - while (itemIndex > 0) { - HistoryItem *item = block->items.at(--itemIndex); + // binary search for itemIndex of the first item that is not completely below the visible area + HistoryBlock *block = h->blocks.at(blockIndex); + int blocktop = htop + block->y; + int itemIndex = binarySearchBlocksOrItems(block->items, _visibleAreaBottom - blocktop); + + while (true) { + while (itemIndex >= 0) { + HistoryItem *item = block->items.at(itemIndex--); int itemtop = blocktop + item->y; int itembottom = itemtop + item->height(); - // skip items that are below the visible area - if (itemtop >= _visibleAreaBottom) { - continue; - } + // binary search should've skipped all the items that are below the visible area + t_assert(itemtop < _visibleAreaBottom); + // skip all service messages if (HistoryMessage *message = item->toHistoryMessage()) { if (lowestAttachedItemBottom < 0 && message->isAttachedToPrevious()) { lowestAttachedItemBottom = itembottom - message->marginBottom(); @@ -131,15 +152,21 @@ void HistoryInner::enumerateUserpicsInHistory(History *h, int htop, Method metho if (lowestAttachedItemBottom < 0) { lowestAttachedItemBottom = itembottom - message->marginBottom(); } - int userpicTop = qMin(qMax(itemtop + message->marginTop(), _visibleAreaTop + st::msgMargin.left()), lowestAttachedItemBottom - int(st::msgPhotoSize)); + // attach userpic to the top of the visible area with the same margin as it is from the left side + int userpicTop = qMax(itemtop + message->marginTop(), _visibleAreaTop + st::msgMargin.left()); + + // do not let the userpic go below the attached messages pack bottom line + userpicTop = qMin(userpicTop, lowestAttachedItemBottom - int(st::msgPhotoSize)); // call the template callback function that was passed // and return if it finished everything it needed if (!method(message, userpicTop)) { return; } + } - // forget the found bottom of the pack, search for the next one from scratch + // forget the found bottom of the pack, search for the next one from scratch + if (!message->isAttachedToPrevious()) { lowestAttachedItemBottom = -1; } } @@ -154,6 +181,14 @@ void HistoryInner::enumerateUserpicsInHistory(History *h, int htop, Method metho if (blocktop <= _visibleAreaTop) { return; } + + if (--blockIndex < 0) { + return; + } else { + block = h->blocks.at(blockIndex); + blocktop = htop + block->y; + itemIndex = block->items.size() - 1; + } } } diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index ab7c346962..87998c2fc5 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -1066,12 +1066,7 @@ namespace { } } -LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent) : LayoutMediaItem(OverviewItemInfo::Bit(), parent) -, _titlew(0) -, _page(0) -, _pixw(0) -, _pixh(0) -, _text(st::msgMinWidth) { +LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent) : LayoutMediaItem(OverviewItemInfo::Bit(), parent) { QString text = _parent->originalText(); EntitiesInText entities = _parent->originalEntities(); diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index 9cd6241278..d52d1e3eb5 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -440,10 +440,11 @@ private: TextLinkPtr _photol; QString _title, _letter; - int32 _titlew; - WebPageData *_page; - int32 _pixw, _pixh; - Text _text; + int _titlew = 0; + WebPageData *_page = nullptr; + int _pixw = 0; + int _pixh = 0; + Text _text = { int(st::msgMinWidth) }; struct Link { Link() : width(0) { diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index df873ef61d..529a6b36af 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -89,6 +89,7 @@ LIBCMT $(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib + /ignore:4099 %(AdditionalOptions) From 2ead44d9c01c97827ade7ed57ce812a35b635fb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Mar 2016 15:28:40 +0300 Subject: [PATCH 237/316] fixed scrolling issues when switching between conversations --- Telegram/SourceFiles/historywidget.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 8ff4d8d759..d31bdb3833 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -3776,7 +3776,6 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re _scroll.hide(); _scroll.setWidget(_list); _list->show(); - visibleAreaUpdated(); _updateHistoryItems.stop(); @@ -6411,11 +6410,11 @@ MsgId HistoryWidget::replyToId() const { void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change) { if (!_history || (initial && _histInited) || (!initial && !_histInited)) return; - if (_firstLoadRequest) { + if (_firstLoadRequest || _a_show.animating()) { return; // scrollTopMax etc are not working after recountHeight() } - int32 newScrollHeight = height(); + int newScrollHeight = height(); if (isBlocked() || isBotStart() || isJoinChannel() || isMuteUnmute()) { newScrollHeight -= _unblock.height(); } else { @@ -6435,7 +6434,11 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh bool wasAtBottom = _scroll.scrollTop() + 1 > _scroll.scrollTopMax(), needResize = _scroll.width() != width() || _scroll.height() != newScrollHeight; if (needResize) { _scroll.resize(width(), newScrollHeight); - visibleAreaUpdated(); + // on initial updateListSize we didn't put the _scroll.scrollTop correctly yet + // so visibleAreaUpdated() call will erase it with the new (undefined) value + if (!initial) { + visibleAreaUpdated(); + } _attachMention.setBoundings(_scroll.geometry()); _toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip); From 4a5b63bbcd784692e975f714257e8f28726f677a Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Mar 2016 16:21:26 +0300 Subject: [PATCH 238/316] restricted peers support added --- Telegram/SourceFiles/app.cpp | 29 ++++++++ Telegram/SourceFiles/facades.h | 3 + Telegram/SourceFiles/historywidget.cpp | 6 ++ Telegram/SourceFiles/mainwidget.cpp | 9 ++- Telegram/SourceFiles/structs.h | 91 +++++++++++++++----------- 5 files changed, 98 insertions(+), 40 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 776cd91c87..e87f976e3a 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -326,6 +326,25 @@ namespace App { return lng_status_lastseen_date(lt_date, dOnline.date().toString(qsl("dd.MM.yy"))); } + namespace { + // we should get a full restriction in "{fulltype}: {reason}" format and we + // need to find a "-all" tag in {fulltype}, otherwise ignore this restriction + QString extractRestrictionReason(const QString &fullRestriction) { + int fullTypeEnd = fullRestriction.indexOf(':'); + if (fullTypeEnd <= 0) { + return QString(); + } + + // {fulltype} is in "{type}-{tag}-{tag}-{tag}" format + // if we find "all" tag we return the restriction string + QStringList typeTags = fullRestriction.mid(0, fullTypeEnd).split('-').mid(1); + if (typeTags.contains(qsl("all"))) { + return fullRestriction.midRef(fullTypeEnd + 1).trimmed().toString(); + } + return QString(); + } + } + bool onlineColorUse(UserData *user, int32 now) { if (isServiceUser(user->id) || user->botInfo) { return false; @@ -388,6 +407,11 @@ namespace App { data->input = MTP_inputPeerUser(d.vid, d.vaccess_hash); data->inputUser = MTP_inputUser(d.vid, d.vaccess_hash); } + if (d.is_restricted()) { + data->setRestrictionReason(extractRestrictionReason(qs(d.vrestriction_reason))); + } else { + data->setRestrictionReason(QString()); + } } if (d.is_deleted()) { data->setPhone(QString()); @@ -593,6 +617,11 @@ namespace App { if (cdata->version < d.vversion.v) { cdata->version = d.vversion.v; } + if (d.is_restricted()) { + cdata->setRestrictionReason(extractRestrictionReason(qs(d.vrestriction_reason))); + } else { + cdata->setRestrictionReason(QString()); + } } QString uname = d.has_username() ? textOneLine(qs(d.vusername)) : QString(); cdata->setName(qs(d.vtitle), uname); diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index 09f71b91f5..ba77a20a29 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -69,6 +69,9 @@ namespace Ui { inline void showChatsList() { showPeerHistory(PeerId(0), 0); } + inline void showChatsListAsync() { + showPeerHistoryAsync(PeerId(0), 0); + } bool hideWindowNoQuit(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index d31bdb3833..8476a665c6 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -7566,6 +7566,12 @@ void HistoryWidget::peerUpdated(PeerData *data) { QTimer::singleShot(ReloadChannelMembersTimeout, App::api(), SLOT(delayedRequestParticipantsCount())); return; } + QString restriction = _peer->restrictionReason(); + if (!restriction.isEmpty()) { + Ui::showChatsList(); + Ui::showLayer(new InformBox(restriction)); + return; + } bool resize = false; if (pinnedMsgVisibilityUpdated()) { resize = true; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index b1c5fcf602..8bfcb48862 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2244,9 +2244,16 @@ void MainWidget::ctrlEnterSubmitUpdated() { void MainWidget::ui_showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool back) { if (PeerData *peer = App::peerLoaded(peerId)) { if (peer->migrateTo()) { - peerId = peer->migrateTo()->id; + peer = peer->migrateTo(); + peerId = peer->id; if (showAtMsgId > 0) showAtMsgId = -showAtMsgId; } + QString restriction = peer->restrictionReason(); + if (!restriction.isEmpty()) { + Ui::showChatsList(); + Ui::showLayer(new InformBox(restriction)); + return; + } } if (!back && (!peerId || (_stack.size() == 1 && _stack[0]->type() == HistoryStackItem && _stack[0]->peer->id == peerId))) { back = true; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index d0f9ba7054..304fb2974e 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -214,6 +214,12 @@ class UserData; class ChatData; class ChannelData; class PeerData { +protected: + + PeerData(const PeerId &id); + PeerData(const PeerData &other) = delete; + PeerData &operator=(const PeerData &other) = delete; + public: virtual ~PeerData() { @@ -295,12 +301,14 @@ public: NotifySettingsPtr notify; - PeerData(const PeerData &other) = delete; - PeerData &operator=(const PeerData &other) = delete; + // if this string is not empty we must not allow to open the + // conversation and we must show this string instead + virtual QString restrictionReason() const { + return QString(); + } protected: - PeerData(const PeerId &id); ImagePtr _userpic; ImagePtr currentUserpic() const; }; @@ -368,14 +376,7 @@ class PhotoData; class UserData : public PeerData { public: - UserData(const PeerId &id) : PeerData(id) - , access(0) - , flags(0) - , onlineTill(0) - , contact(-1) - , blocked(UserBlockUnknown) - , photosCount(-1) - , botInfo(0) { + UserData(const PeerId &id) : PeerData(id) { setName(QString(), QString(), QString(), QString()); } void setPhoto(const MTPUserProfilePhoto &photo); @@ -388,9 +389,9 @@ public: void madeAction(); // pseudo-online - uint64 access; + uint64 access = 0; - MTPDuser::Flags flags; + MTPDuser::Flags flags = { 0 }; bool isVerified() const { return flags & MTPDuser::Flag::f_verified; } @@ -406,17 +407,28 @@ public: QString phone; QString nameOrPhone; Text phoneText; - int32 onlineTill; - int32 contact; // -1 - not contact, cant add (self, empty, deleted, foreign), 0 - not contact, can add (request), 1 - contact - UserBlockedStatus blocked; + int32 onlineTill = 0; + int32 contact = -1; // -1 - not contact, cant add (self, empty, deleted, foreign), 0 - not contact, can add (request), 1 - contact + UserBlockedStatus blocked = UserBlockUnknown; typedef QList Photos; Photos photos; - int32 photosCount; // -1 not loaded, 0 all loaded + int32 photosCount = -1; // -1 not loaded, 0 all loaded QString about; - BotInfo *botInfo; + BotInfo *botInfo = nullptr; + + QString restrictionReason() const override { + return _restrictionReason; + } + void setRestrictionReason(const QString &reason) { + _restrictionReason = reason; + } + +private: + QString _restrictionReason; + }; static UserData * const InlineBotLookingUpData = SharedMemoryLocation(); @@ -600,18 +612,8 @@ class ChannelData : public PeerData { public: ChannelData(const PeerId &id) : PeerData(id) - , access(0) , inputChannel(MTP_inputChannel(MTP_int(bareId()), MTP_long(0))) - , count(1) - , adminsCount(1) - , date(0) - , version(0) - , flags(0) - , flagsFull(0) - , mgInfo(nullptr) - , isForbidden(true) - , inviter(0) - , _lastFullUpdate(0) { + , mgInfo(nullptr) { setName(QString(), QString()); } void setPhoto(const MTPChatPhoto &photo, const PhotoId &phId = UnknownPeerPhotoId); @@ -620,18 +622,19 @@ public: void updateFull(bool force = false); void fullUpdated(); - uint64 access; + uint64 access = 0; MTPinputChannel inputChannel; QString username, about; - int32 count, adminsCount; - int32 date; - int32 version; - MTPDchannel::Flags flags; - MTPDchannelFull::Flags flagsFull; - MegagroupInfo *mgInfo; + int count = 1; + int adminsCount = 1; + int32 date = 0; + int version = 0; + MTPDchannel::Flags flags = { 0 }; + MTPDchannelFull::Flags flagsFull = { 0 }; + MegagroupInfo *mgInfo = nullptr; bool lastParticipantsCountOutdated() const { if (!mgInfo || !(mgInfo->lastParticipantsStatus & MegagroupInfo::LastParticipantsCountOutdated)) { return false; @@ -685,7 +688,7 @@ public: bool addsSignature() const { return flags & MTPDchannel::Flag::f_signatures; } - bool isForbidden; + bool isForbidden = true; bool isVerified() const { return flags & MTPDchannel::Flag::f_verified; } @@ -696,7 +699,7 @@ public: // ImagePtr photoFull; QString invitationUrl; - int32 inviter; // > 0 - user who invited me to channel, < 0 - not in channel + int32 inviter = 0; // > 0 - user who invited me to channel, < 0 - not in channel QDateTime inviteDate; void ptsInit(int32 pts) { @@ -732,12 +735,22 @@ public: return _ptsWaiter.setWaitingForShortPoll(this, ms); } + QString restrictionReason() const override { + return _restrictionReason; + } + void setRestrictionReason(const QString &reason) { + _restrictionReason = reason; + } + ~ChannelData(); private: PtsWaiter _ptsWaiter; - uint64 _lastFullUpdate; + uint64 _lastFullUpdate = 0; + + QString _restrictionReason; + }; inline UserData *PeerData::asUser() { From 034adfab2b3a5a7e5f39c2f94bc3616de535c401 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Mar 2016 19:50:40 +0300 Subject: [PATCH 239/316] Delete button for large channels is hidden now (server doesn't allow to delete large channels any more). Error message added in a case when the current user (not admin) tries to add to a supergroup a user who was kicked by admin (and blacklisted by this action). --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/mainwidget.cpp | 18 ++++++++++++++++-- Telegram/SourceFiles/mainwidget.h | 1 + Telegram/SourceFiles/profilewidget.cpp | 20 +++++++++++++------- Telegram/SourceFiles/profilewidget.h | 1 + 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index f567608f2e..9b89f7ad09 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -682,6 +682,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Sorry, you can only add mutual contacts\nto groups at the moment.\n{more_info}"; "lng_cant_invite_not_contact_channel" = "Sorry, you can only add mutual contacts\nto channels at the moment.\n{more_info}"; "lng_cant_more_info" = "More info »"; +"lng_cant_invite_banned" = "Sorry, only admin can add this user."; "lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings."; "lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8bfcb48862..a4a98df022 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1147,7 +1147,9 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { if (mtpIsFlood(error)) return false; QString text = lang(lng_failed_add_participant); - if (error.type() == "USER_LEFT_CHAT") { // trying to return banned user to his group + if (error.type() == "USER_LEFT_CHAT") { // trying to return a user who has left + } else if (error.type() == "USER_KICKED") { // trying to return a user who was kicked by admin + text = lang(lng_cant_invite_banned); } else if (error.type() == "USER_PRIVACY_RESTRICTED") { text = lang(lng_cant_invite_privacy); } else if (error.type() == "USER_NOT_MUTUAL_CONTACT") { // trying to return user who does not have me in contacts @@ -1166,8 +1168,10 @@ bool MainWidget::addParticipantsFail(ChannelData *channel, const RPCError &error QString text = lang(lng_failed_add_participant); if (error.type() == "USER_LEFT_CHAT") { // trying to return banned user to his group + } else if (error.type() == "USER_KICKED") { // trying to return a user who was kicked by admin + text = lang(lng_cant_invite_banned); } else if (error.type() == "USER_PRIVACY_RESTRICTED") { - text = lang(lng_cant_invite_privacy_channel); + text = lang(channel->isMegagroup() ? lng_cant_invite_privacy : lng_cant_invite_privacy_channel); } else if (error.type() == "USER_NOT_MUTUAL_CONTACT") { // trying to return user who does not have me in contacts text = lang(channel->isMegagroup() ? lng_failed_add_not_mutual : lng_failed_add_not_mutual_channel); } else if (error.type() == "PEER_FLOOD") { @@ -2595,6 +2599,16 @@ void MainWidget::sentUpdatesReceived(uint64 randomId, const MTPUpdates &result) App::emitPeerUpdated(); } +bool MainWidget::deleteChannelFailed(const RPCError &error) { + if (mtpIsFlood(error)) return false; + + //if (error.type() == qstr("CHANNEL_TOO_LARGE")) { + // Ui::showLayer(new InformBox(lang(lng_cant_delete_channel))); + //} + + return true; +} + void MainWidget::inviteToChannelDone(ChannelData *channel, const MTPUpdates &updates) { sentUpdatesReceived(updates); QTimer::singleShot(ReloadChannelMembersTimeout, this, SLOT(onActiveChannelUpdateFull())); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 88ee43f4f5..67c2398f00 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -251,6 +251,7 @@ public: void sentUpdatesReceived(const MTPUpdates &updates) { return sentUpdatesReceived(0, updates); } + bool deleteChannelFailed(const RPCError &error); void inviteToChannelDone(ChannelData *channel, const MTPUpdates &updates); void historyToDown(History *hist); void dialogsToUp(); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 95dc8911b6..bf5f9bb2eb 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -364,7 +364,7 @@ void ProfileInner::onDeleteChannelSure() { if (_peerChannel->migrateFrom()) { App::main()->deleteConversation(_peerChannel->migrateFrom()); } - MTP::send(MTPchannels_DeleteChannel(_peerChannel->inputChannel), App::main()->rpcDone(&MainWidget::sentUpdatesReceived)); + MTP::send(MTPchannels_DeleteChannel(_peerChannel->inputChannel), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::deleteChannelFailed)); } } void ProfileInner::onBlockUser() { @@ -978,7 +978,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { } if (_peerUser && peerToUser(_peerUser->id) != MTP::authedId()) { top += st::setSectionSkip + _blockUser.height(); - } else if (_peerChannel && _amCreator) { + } else if (canDeleteChannel()) { top += (_peerChannel->isMegagroup() ? 0 : (st::setSectionSkip - st::setLittleSkip)) + _deleteChannel.height(); } @@ -1115,8 +1115,10 @@ void ProfileInner::updateSelected() { } int32 participantsTop = 0; - if (_peerChannel && _amCreator) { + if (canDeleteChannel()) { participantsTop = _deleteChannel.y() + _deleteChannel.height(); + } else if (_peerChannel && _amCreator) { + participantsTop = _searchInPeer.y() + _searchInPeer.height(); } else { participantsTop = _deleteConversation.y() + _deleteConversation.height(); } @@ -1365,6 +1367,10 @@ bool ProfileInner::migrateFail(const RPCError &error) { return true; } +bool ProfileInner::canDeleteChannel() const { + return _peerChannel && _amCreator && (_peerChannel->count <= 1000); +} + void ProfileInner::resizeEvent(QResizeEvent *e) { _width = qMin(width() - st::profilePadding.left() - st::profilePadding.right(), int(st::profileMaxWidth)); _left = (width() - _width) / 2; @@ -1482,7 +1488,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { if (_peerUser && peerToUser(_peerUser->id) != MTP::authedId()) { top += st::setSectionSkip; _blockUser.move(_left, top); top += _blockUser.height(); - } else if (_peerChannel && _amCreator) { + } else if (canDeleteChannel()) { top += (_peerChannel->isMegagroup() ? 0 : (st::setSectionSkip - st::setLittleSkip)); _deleteChannel.move(_left, top); top += _deleteChannel.height(); } @@ -1602,9 +1608,9 @@ int32 ProfileInner::countMinHeight() { h += st::profileHeaderSkip; } } else if (_peerChannel) { - if (_amCreator) { + if (canDeleteChannel()) { h = _deleteChannel.y() + _deleteChannel.height() + st::profileHeaderSkip; - } else if (_peerChannel->amIn()) { + } else if (_peerChannel->amIn() && !_amCreator) { h = _deleteConversation.y() + _deleteConversation.height() + st::profileHeaderSkip; } else { h = _searchInPeer.y() + _searchInPeer.height() + st::profileHeaderSkip; @@ -1755,7 +1761,7 @@ void ProfileInner::showAll() { _addParticipant.hide(); } _blockUser.hide(); - if (_amCreator) { + if (canDeleteChannel()) { _deleteChannel.show(); } else { _deleteChannel.hide(); diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 23b6fcd029..24b6364f22 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -191,6 +191,7 @@ private: UserBlockedStatus _wasBlocked; mtpRequestId _blockRequest; LinkButton _blockUser, _deleteChannel; + bool canDeleteChannel() const; // participants int32 _pHeight; From 68ed885568f71171f193645580f28a2a90184831 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Mar 2016 21:12:07 +0300 Subject: [PATCH 240/316] Moved mtproto/mtpPublicRSA.h to mtproto/rsa_public_key module, rewritten and refactored, removed openssl headers from stdafx.h Xcode project file does not contain mtproto/rsa_public_key.cpp yet --- Telegram/SourceFiles/autoupdater.cpp | 9 +- Telegram/SourceFiles/config.h | 4 +- Telegram/SourceFiles/localstorage.cpp | 3 + Telegram/SourceFiles/mtproto/mtpAuthKey.cpp | 2 + .../SourceFiles/mtproto/mtpConnection.cpp | 528 +++++++++--------- Telegram/SourceFiles/mtproto/mtpConnection.h | 1 - Telegram/SourceFiles/mtproto/mtpPublicRSA.h | 85 --- .../SourceFiles/mtproto/rsa_public_key.cpp | 84 +++ Telegram/SourceFiles/mtproto/rsa_public_key.h | 48 ++ Telegram/SourceFiles/stdafx.h | 10 - Telegram/SourceFiles/types.cpp | 5 + Telegram/SourceFiles/types.h | 4 + Telegram/Telegram.pro | 3 +- Telegram/Telegram.vcxproj | 3 +- Telegram/Telegram.vcxproj.filters | 9 +- Telegram/Telegram.xcodeproj/project.pbxproj | 4 +- Telegram/Telegram.xcodeproj/qt_preprocess.mak | 6 +- 17 files changed, 437 insertions(+), 371 deletions(-) delete mode 100644 Telegram/SourceFiles/mtproto/mtpPublicRSA.h create mode 100644 Telegram/SourceFiles/mtproto/rsa_public_key.cpp create mode 100644 Telegram/SourceFiles/mtproto/rsa_public_key.h diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index 7471dde590..e008a39d5f 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -20,9 +20,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" + +#include "autoupdater.h" + +#include +#include +#include +#include + #include "application.h" #include "pspecific.h" -#include "autoupdater.h" #ifndef TDESKTOP_DISABLE_AUTOUPDATE diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index b232cbb759..4f0a5668a0 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -200,7 +200,7 @@ inline const char *cGUIDStr() { return gGuidStr; } -inline const char **cPublicRSAKeys(uint32 &cnt) { +inline const char **cPublicRSAKeys(int &keysCount) { static const char *(keys[]) = {"\ -----BEGIN RSA PUBLIC KEY-----\n\ MIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\n\ @@ -210,7 +210,7 @@ Efzk2DWgkBluml8OREmvfraX3bkHZJTKX4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+\n\ 8hdlLmAjbCVfaigxX0CDqWeR1yFL9kwd9P0NsZRPsmoqVwMbMu7mStFai6aIhc3n\n\ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB\n\ -----END RSA PUBLIC KEY-----"}; - cnt = sizeof(keys) / sizeof(const char*); + keysCount = arraysize(keys); return keys; } diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 3dc3abe2e8..8c4bdcb1e8 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -19,8 +19,11 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" + #include "localstorage.h" +#include + #include "mainwidget.h" #include "window.h" #include "lang.h" diff --git a/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp b/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp index 7e2470e7ac..8af05ae132 100644 --- a/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp +++ b/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp @@ -20,6 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" +#include + void aesEncrypt(const void *src, void *dst, uint32 len, void *key, void *iv) { uchar aes_key[32], aes_iv[32]; memcpy(aes_key, key, 32); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 9903cfd54d..98337156e1 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -20,261 +20,272 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" +#include "mtproto/mtpConnection.h" + +#include +#include +#include +#include +#include #include -namespace { - bool parsePQ(const std::string &pqStr, std::string &pStr, std::string &qStr) { - if (pqStr.length() > 8) return false; // more than 64 bit pq +#include "mtproto/rsa_public_key.h" - uint64 pq = 0, p, q; - const uchar *pqChars = (const uchar*)&pqStr[0]; - for (uint32 i = 0, l = pqStr.length(); i < l; ++i) { - pq <<= 8; - pq |= (uint64)pqChars[i]; - } - uint64 pqSqrt = (uint64)sqrtl((long double)pq), ySqr, y; - while (pqSqrt * pqSqrt > pq) --pqSqrt; - while (pqSqrt * pqSqrt < pq) ++pqSqrt; - for (ySqr = pqSqrt * pqSqrt - pq; ; ++pqSqrt, ySqr = pqSqrt * pqSqrt - pq) { - y = (uint64)sqrtl((long double)ySqr); - while (y * y > ySqr) --y; - while (y * y < ySqr) ++y; - if (!ySqr || y + pqSqrt >= pq) return false; - if (y * y == ySqr) { - p = pqSqrt + y; - q = (pqSqrt > y) ? (pqSqrt - y) : (y - pqSqrt); - break; - } - } - if (p > q) swap(p, q); +using std::string; - pStr.resize(4); - uchar *pChars = (uchar*)&pStr[0]; - for (uint32 i = 0; i < 4; ++i) { - *(pChars + 3 - i) = (uchar)(p & 0xFF); - p >>= 8; +namespace MTP { +namespace internal { + +bool parsePQ(const string &pqStr, string &pStr, string &qStr) { + if (pqStr.length() > 8) return false; // more than 64 bit pq + + uint64 pq = 0, p, q; + const uchar *pqChars = (const uchar*)&pqStr[0]; + for (uint32 i = 0, l = pqStr.length(); i < l; ++i) { + pq <<= 8; + pq |= (uint64)pqChars[i]; + } + uint64 pqSqrt = (uint64)sqrtl((long double)pq), ySqr, y; + while (pqSqrt * pqSqrt > pq) --pqSqrt; + while (pqSqrt * pqSqrt < pq) ++pqSqrt; + for (ySqr = pqSqrt * pqSqrt - pq; ; ++pqSqrt, ySqr = pqSqrt * pqSqrt - pq) { + y = (uint64)sqrtl((long double)ySqr); + while (y * y > ySqr) --y; + while (y * y < ySqr) ++y; + if (!ySqr || y + pqSqrt >= pq) return false; + if (y * y == ySqr) { + p = pqSqrt + y; + q = (pqSqrt > y) ? (pqSqrt - y) : (y - pqSqrt); + break; + } + } + if (p > q) swap(p, q); + + pStr.resize(4); + uchar *pChars = (uchar*)&pStr[0]; + for (uint32 i = 0; i < 4; ++i) { + *(pChars + 3 - i) = (uchar)(p & 0xFF); + p >>= 8; + } + + qStr.resize(4); + uchar *qChars = (uchar*)&qStr[0]; + for (uint32 i = 0; i < 4; ++i) { + *(qChars + 3 - i) = (uchar)(q & 0xFF); + q >>= 8; + } + + return true; +} + +class BigNumCounter { +public: + bool count(const void *power, const void *modul, uint32 g, void *gResult, const void *g_a, void *g_aResult) { + DEBUG_LOG(("BigNum Info: counting g_b = g ^ b % dh_prime and auth_key = g_a ^ b % dh_prime")); + uint32 g_be = qToBigEndian(g); + if ( + !BN_bin2bn((const uchar*)power, 64 * sizeof(uint32), &bnPower) || + !BN_bin2bn((const uchar*)modul, 64 * sizeof(uint32), &bnModul) || + !BN_bin2bn((const uchar*)&g_be, sizeof(uint32), &bn_g) || + !BN_bin2bn((const uchar*)g_a, 64 * sizeof(uint32), &bn_g_a) + ) { + ERR_load_crypto_strings(); + LOG(("BigNum Error: BN_bin2bn failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); + DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); + return false; } - qStr.resize(4); - uchar *qChars = (uchar*)&qStr[0]; - for (uint32 i = 0; i < 4; ++i) { - *(qChars + 3 - i) = (uchar)(q & 0xFF); - q >>= 8; + if (!BN_mod_exp(&bnResult, &bn_g, &bnPower, &bnModul, ctx)) { + ERR_load_crypto_strings(); + LOG(("BigNum Error: BN_mod_exp failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); + DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); + return false; + } + + uint32 resultLen = BN_num_bytes(&bnResult); + if (resultLen != 64 * sizeof(uint32)) { + DEBUG_LOG(("BigNum Error: bad gResult len (%1)").arg(resultLen)); + return false; + } + resultLen = BN_bn2bin(&bnResult, (uchar*)gResult); + if (resultLen != 64 * sizeof(uint32)) { + DEBUG_LOG(("BigNum Error: bad gResult export len (%1)").arg(resultLen)); + return false; + } + + BN_add_word(&bnResult, 1); // check g_b < dh_prime - 1 + if (BN_cmp(&bnResult, &bnModul) >= 0) { + DEBUG_LOG(("BigNum Error: bad g_b >= dh_prime - 1")); + return false; + } + + if (!BN_mod_exp(&bnResult, &bn_g_a, &bnPower, &bnModul, ctx)) { + ERR_load_crypto_strings(); + LOG(("BigNum Error: BN_mod_exp failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); + DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); + return false; + } + + resultLen = BN_num_bytes(&bnResult); + if (resultLen != 64 * sizeof(uint32)) { + DEBUG_LOG(("BigNum Error: bad g_aResult len (%1)").arg(resultLen)); + return false; + } + resultLen = BN_bn2bin(&bnResult, (uchar*)g_aResult); + if (resultLen != 64 * sizeof(uint32)) { + DEBUG_LOG(("BigNum Error: bad g_aResult export len (%1)").arg(resultLen)); + return false; + } + + BN_add_word(&bn_g_a, 1); // check g_a < dh_prime - 1 + if (BN_cmp(&bn_g_a, &bnModul) >= 0) { + DEBUG_LOG(("BigNum Error: bad g_a >= dh_prime - 1")); + return false; } return true; } - class _BigNumCounter { - public: - bool count(const void *power, const void *modul, uint32 g, void *gResult, const void *g_a, void *g_aResult) { - DEBUG_LOG(("BigNum Info: counting g_b = g ^ b % dh_prime and auth_key = g_a ^ b % dh_prime")); - uint32 g_be = qToBigEndian(g); - if ( - !BN_bin2bn((const uchar*)power, 64 * sizeof(uint32), &bnPower) || - !BN_bin2bn((const uchar*)modul, 64 * sizeof(uint32), &bnModul) || - !BN_bin2bn((const uchar*)&g_be, sizeof(uint32), &bn_g) || - !BN_bin2bn((const uchar*)g_a, 64 * sizeof(uint32), &bn_g_a) - ) { - ERR_load_crypto_strings(); - LOG(("BigNum Error: BN_bin2bn failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); - return false; - } - - if (!BN_mod_exp(&bnResult, &bn_g, &bnPower, &bnModul, ctx)) { - ERR_load_crypto_strings(); - LOG(("BigNum Error: BN_mod_exp failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); - return false; - } - - uint32 resultLen = BN_num_bytes(&bnResult); - if (resultLen != 64 * sizeof(uint32)) { - DEBUG_LOG(("BigNum Error: bad gResult len (%1)").arg(resultLen)); - return false; - } - resultLen = BN_bn2bin(&bnResult, (uchar*)gResult); - if (resultLen != 64 * sizeof(uint32)) { - DEBUG_LOG(("BigNum Error: bad gResult export len (%1)").arg(resultLen)); - return false; - } - - BN_add_word(&bnResult, 1); // check g_b < dh_prime - 1 - if (BN_cmp(&bnResult, &bnModul) >= 0) { - DEBUG_LOG(("BigNum Error: bad g_b >= dh_prime - 1")); - return false; - } - - if (!BN_mod_exp(&bnResult, &bn_g_a, &bnPower, &bnModul, ctx)) { - ERR_load_crypto_strings(); - LOG(("BigNum Error: BN_mod_exp failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum Error: base %1, power %2, modul %3").arg(Logs::mb(&g_be, sizeof(uint32)).str()).arg(Logs::mb(power, 64 * sizeof(uint32)).str()).arg(Logs::mb(modul, 64 * sizeof(uint32)).str())); - return false; - } - - resultLen = BN_num_bytes(&bnResult); - if (resultLen != 64 * sizeof(uint32)) { - DEBUG_LOG(("BigNum Error: bad g_aResult len (%1)").arg(resultLen)); - return false; - } - resultLen = BN_bn2bin(&bnResult, (uchar*)g_aResult); - if (resultLen != 64 * sizeof(uint32)) { - DEBUG_LOG(("BigNum Error: bad g_aResult export len (%1)").arg(resultLen)); - return false; - } - - BN_add_word(&bn_g_a, 1); // check g_a < dh_prime - 1 - if (BN_cmp(&bn_g_a, &bnModul) >= 0) { - DEBUG_LOG(("BigNum Error: bad g_a >= dh_prime - 1")); - return false; - } - - return true; - } - - _BigNumCounter() : ctx(BN_CTX_new()) { - BN_init(&bnPower); - BN_init(&bnModul); - BN_init(&bn_g); - BN_init(&bn_g_a); - BN_init(&bnResult); - } - ~_BigNumCounter() { - BN_CTX_free(ctx); - BN_clear_free(&bnPower); - BN_clear_free(&bnModul); - BN_clear_free(&bn_g); - BN_clear_free(&bn_g_a); - BN_clear_free(&bnResult); - } - - private: - BIGNUM bnPower, bnModul, bn_g, bn_g_a, bnResult; - BN_CTX *ctx; - }; - - // Miller-Rabin primality test - class _BigNumPrimeTest { - public: - - bool isPrimeAndGood(const void *pData, uint32 iterCount, int32 g) { - if (!memcmp(pData, "\xC7\x1C\xAE\xB9\xC6\xB1\xC9\x04\x8E\x6C\x52\x2F\x70\xF1\x3F\x73\x98\x0D\x40\x23\x8E\x3E\x21\xC1\x49\x34\xD0\x37\x56\x3D\x93\x0F\x48\x19\x8A\x0A\xA7\xC1\x40\x58\x22\x94\x93\xD2\x25\x30\xF4\xDB\xFA\x33\x6F\x6E\x0A\xC9\x25\x13\x95\x43\xAE\xD4\x4C\xCE\x7C\x37\x20\xFD\x51\xF6\x94\x58\x70\x5A\xC6\x8C\xD4\xFE\x6B\x6B\x13\xAB\xDC\x97\x46\x51\x29\x69\x32\x84\x54\xF1\x8F\xAF\x8C\x59\x5F\x64\x24\x77\xFE\x96\xBB\x2A\x94\x1D\x5B\xCD\x1D\x4A\xC8\xCC\x49\x88\x07\x08\xFA\x9B\x37\x8E\x3C\x4F\x3A\x90\x60\xBE\xE6\x7C\xF9\xA4\xA4\xA6\x95\x81\x10\x51\x90\x7E\x16\x27\x53\xB5\x6B\x0F\x6B\x41\x0D\xBA\x74\xD8\xA8\x4B\x2A\x14\xB3\x14\x4E\x0E\xF1\x28\x47\x54\xFD\x17\xED\x95\x0D\x59\x65\xB4\xB9\xDD\x46\x58\x2D\xB1\x17\x8D\x16\x9C\x6B\xC4\x65\xB0\xD6\xFF\x9C\xA3\x92\x8F\xEF\x5B\x9A\xE4\xE4\x18\xFC\x15\xE8\x3E\xBE\xA0\xF8\x7F\xA9\xFF\x5E\xED\x70\x05\x0D\xED\x28\x49\xF4\x7B\xF9\x59\xD9\x56\x85\x0C\xE9\x29\x85\x1F\x0D\x81\x15\xF6\x35\xB1\x05\xEE\x2E\x4E\x15\xD0\x4B\x24\x54\xBF\x6F\x4F\xAD\xF0\x34\xB1\x04\x03\x11\x9C\xD8\xE3\xB9\x2F\xCC\x5B", 256)) { - if (g == 3 || g == 4 || g == 5 || g == 7) { - return true; - } - } - if ( - !BN_bin2bn((const uchar*)pData, 64 * sizeof(uint32), &bnPrime) - ) { - ERR_load_crypto_strings(); - LOG(("BigNum PT Error: BN_bin2bn failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); - DEBUG_LOG(("BigNum PT Error: prime %1").arg(Logs::mb(pData, 64 * sizeof(uint32)).str())); - return false; - } - - int32 numBits = BN_num_bits(&bnPrime); - if (numBits != 2048) { - LOG(("BigNum PT Error: BN_bin2bn failed, bad dh_prime num bits: %1").arg(numBits)); - return false; - } - - if (BN_is_prime_ex(&bnPrime, MTPMillerRabinIterCount, ctx, NULL) == 0) { - return false; - } - - switch (g) { - case 2: { - int32 mod8 = BN_mod_word(&bnPrime, 8); - if (mod8 != 7) { - LOG(("BigNum PT Error: bad g value: %1, mod8: %2").arg(g).arg(mod8)); - return false; - } - } break; - case 3: { - int32 mod3 = BN_mod_word(&bnPrime, 3); - if (mod3 != 2) { - LOG(("BigNum PT Error: bad g value: %1, mod3: %2").arg(g).arg(mod3)); - return false; - } - } break; - case 4: break; - case 5: { - int32 mod5 = BN_mod_word(&bnPrime, 5); - if (mod5 != 1 && mod5 != 4) { - LOG(("BigNum PT Error: bad g value: %1, mod5: %2").arg(g).arg(mod5)); - return false; - } - } break; - case 6: { - int32 mod24 = BN_mod_word(&bnPrime, 24); - if (mod24 != 19 && mod24 != 23) { - LOG(("BigNum PT Error: bad g value: %1, mod24: %2").arg(g).arg(mod24)); - return false; - } - } break; - case 7: { - int32 mod7 = BN_mod_word(&bnPrime, 7); - if (mod7 != 3 && mod7 != 5 && mod7 != 6) { - LOG(("BigNum PT Error: bad g value: %1, mod7: %2").arg(g).arg(mod7)); - return false; - } - } break; - default: - LOG(("BigNum PT Error: bad g value: %1").arg(g)); - return false; - break; - } - - BN_sub_word(&bnPrime, 1); // (p - 1) / 2 - BN_div_word(&bnPrime, 2); - - if (BN_is_prime_ex(&bnPrime, MTPMillerRabinIterCount, ctx, NULL) == 0) { - return false; - } - - return true; - } - - _BigNumPrimeTest() : ctx(BN_CTX_new()) { - BN_init(&bnPrime); - } - ~_BigNumPrimeTest() { - BN_CTX_free(ctx); - BN_clear_free(&bnPrime); - } - - private: - BIGNUM bnPrime; - BN_CTX *ctx; - }; - - typedef QMap PublicRSAKeys; - PublicRSAKeys gPublicRSA; - - bool gConfigInited = false; - void initRSAConfig() { - if (gConfigInited) return; - gConfigInited = true; - - DEBUG_LOG(("MTP Info: MTP config init")); - - // read all public keys - uint32 keysCnt; - const char **keys = cPublicRSAKeys(keysCnt); - for (uint32 i = 0; i < keysCnt; ++i) { - mtpPublicRSA key(keys[i]); - if (key.key()) { - gPublicRSA.insert(key.fingerPrint(), key); - } else { - LOG(("MTP Error: could not read this public RSA key:")); - LOG((keys[i])); - } - } - DEBUG_LOG(("MTP Info: read %1 public RSA keys").arg(gPublicRSA.size())); + BigNumCounter() : ctx(BN_CTX_new()) { + BN_init(&bnPower); + BN_init(&bnModul); + BN_init(&bn_g); + BN_init(&bn_g_a); + BN_init(&bnResult); } + ~BigNumCounter() { + BN_CTX_free(ctx); + BN_clear_free(&bnPower); + BN_clear_free(&bnModul); + BN_clear_free(&bn_g); + BN_clear_free(&bn_g_a); + BN_clear_free(&bnResult); + } + +private: + BIGNUM bnPower, bnModul, bn_g, bn_g_a, bnResult; + BN_CTX *ctx; +}; + +// Miller-Rabin primality test +class BigNumPrimeTest { +public: + + bool isPrimeAndGood(const void *pData, uint32 iterCount, int32 g) { + if (!memcmp(pData, "\xC7\x1C\xAE\xB9\xC6\xB1\xC9\x04\x8E\x6C\x52\x2F\x70\xF1\x3F\x73\x98\x0D\x40\x23\x8E\x3E\x21\xC1\x49\x34\xD0\x37\x56\x3D\x93\x0F\x48\x19\x8A\x0A\xA7\xC1\x40\x58\x22\x94\x93\xD2\x25\x30\xF4\xDB\xFA\x33\x6F\x6E\x0A\xC9\x25\x13\x95\x43\xAE\xD4\x4C\xCE\x7C\x37\x20\xFD\x51\xF6\x94\x58\x70\x5A\xC6\x8C\xD4\xFE\x6B\x6B\x13\xAB\xDC\x97\x46\x51\x29\x69\x32\x84\x54\xF1\x8F\xAF\x8C\x59\x5F\x64\x24\x77\xFE\x96\xBB\x2A\x94\x1D\x5B\xCD\x1D\x4A\xC8\xCC\x49\x88\x07\x08\xFA\x9B\x37\x8E\x3C\x4F\x3A\x90\x60\xBE\xE6\x7C\xF9\xA4\xA4\xA6\x95\x81\x10\x51\x90\x7E\x16\x27\x53\xB5\x6B\x0F\x6B\x41\x0D\xBA\x74\xD8\xA8\x4B\x2A\x14\xB3\x14\x4E\x0E\xF1\x28\x47\x54\xFD\x17\xED\x95\x0D\x59\x65\xB4\xB9\xDD\x46\x58\x2D\xB1\x17\x8D\x16\x9C\x6B\xC4\x65\xB0\xD6\xFF\x9C\xA3\x92\x8F\xEF\x5B\x9A\xE4\xE4\x18\xFC\x15\xE8\x3E\xBE\xA0\xF8\x7F\xA9\xFF\x5E\xED\x70\x05\x0D\xED\x28\x49\xF4\x7B\xF9\x59\xD9\x56\x85\x0C\xE9\x29\x85\x1F\x0D\x81\x15\xF6\x35\xB1\x05\xEE\x2E\x4E\x15\xD0\x4B\x24\x54\xBF\x6F\x4F\xAD\xF0\x34\xB1\x04\x03\x11\x9C\xD8\xE3\xB9\x2F\xCC\x5B", 256)) { + if (g == 3 || g == 4 || g == 5 || g == 7) { + return true; + } + } + if ( + !BN_bin2bn((const uchar*)pData, 64 * sizeof(uint32), &bnPrime) + ) { + ERR_load_crypto_strings(); + LOG(("BigNum PT Error: BN_bin2bn failed, error: %1").arg(ERR_error_string(ERR_get_error(), 0))); + DEBUG_LOG(("BigNum PT Error: prime %1").arg(Logs::mb(pData, 64 * sizeof(uint32)).str())); + return false; + } + + int32 numBits = BN_num_bits(&bnPrime); + if (numBits != 2048) { + LOG(("BigNum PT Error: BN_bin2bn failed, bad dh_prime num bits: %1").arg(numBits)); + return false; + } + + if (BN_is_prime_ex(&bnPrime, MTPMillerRabinIterCount, ctx, NULL) == 0) { + return false; + } + + switch (g) { + case 2: { + int32 mod8 = BN_mod_word(&bnPrime, 8); + if (mod8 != 7) { + LOG(("BigNum PT Error: bad g value: %1, mod8: %2").arg(g).arg(mod8)); + return false; + } + } break; + case 3: { + int32 mod3 = BN_mod_word(&bnPrime, 3); + if (mod3 != 2) { + LOG(("BigNum PT Error: bad g value: %1, mod3: %2").arg(g).arg(mod3)); + return false; + } + } break; + case 4: break; + case 5: { + int32 mod5 = BN_mod_word(&bnPrime, 5); + if (mod5 != 1 && mod5 != 4) { + LOG(("BigNum PT Error: bad g value: %1, mod5: %2").arg(g).arg(mod5)); + return false; + } + } break; + case 6: { + int32 mod24 = BN_mod_word(&bnPrime, 24); + if (mod24 != 19 && mod24 != 23) { + LOG(("BigNum PT Error: bad g value: %1, mod24: %2").arg(g).arg(mod24)); + return false; + } + } break; + case 7: { + int32 mod7 = BN_mod_word(&bnPrime, 7); + if (mod7 != 3 && mod7 != 5 && mod7 != 6) { + LOG(("BigNum PT Error: bad g value: %1, mod7: %2").arg(g).arg(mod7)); + return false; + } + } break; + default: + LOG(("BigNum PT Error: bad g value: %1").arg(g)); + return false; + break; + } + + BN_sub_word(&bnPrime, 1); // (p - 1) / 2 + BN_div_word(&bnPrime, 2); + + if (BN_is_prime_ex(&bnPrime, MTPMillerRabinIterCount, ctx, NULL) == 0) { + return false; + } + + return true; + } + + BigNumPrimeTest() : ctx(BN_CTX_new()) { + BN_init(&bnPrime); + } + ~BigNumPrimeTest() { + BN_CTX_free(ctx); + BN_clear_free(&bnPrime); + } + +private: + BIGNUM bnPrime; + BN_CTX *ctx; +}; + +typedef QMap RSAPublicKeys; +RSAPublicKeys InitRSAPublicKeys() { + DEBUG_LOG(("MTP Info: RSA public keys list creation")); + + RSAPublicKeys result; + + int keysCount; + const char **keys = cPublicRSAKeys(keysCount); + for (int i = 0; i < keysCount; ++i) { + RSAPublicKey key(keys[i]); + if (key.isValid()) { + result.insert(key.getFingerPrint(), key); + } else { + LOG(("MTP Error: could not read this public RSA key:")); + LOG((keys[i])); + } + } + DEBUG_LOG(("MTP Info: read %1 public RSA keys").arg(result.size())); + return result; } +} // namespace internal +} // namespace MTP + uint32 MTPThreadIdIncrement = 0; MTPThread::MTPThread() : QThread(0) @@ -294,8 +305,6 @@ MTProtoConnection::MTProtoConnection() : thread(nullptr), data(nullptr) { int32 MTProtoConnection::start(MTPSessionData *sessionData, int32 dc) { t_assert(thread == nullptr && data == nullptr); - initRSAConfig(); - thread = new MTPThread(); data = new MTProtoConnectionPrivate(thread, this, sessionData, dc); @@ -3330,22 +3339,22 @@ void MTProtoConnectionPrivate::pqAnswered() { return restart(); } - mtpPublicRSA *rsaKey = 0; + static MTP::internal::RSAPublicKeys RSAKeys = MTP::internal::InitRSAPublicKeys(); + const MTP::internal::RSAPublicKey *rsaKey = nullptr; const QVector &fingerPrints(res_pq.c_resPQ().vserver_public_key_fingerprints.c_vector().v); - for (uint32 i = 0, l = fingerPrints.size(); i < l; ++i) { - uint64 print(fingerPrints[i].v); - PublicRSAKeys::iterator rsaIndex = gPublicRSA.find(print); - if (rsaIndex != gPublicRSA.end()) { - rsaKey = &rsaIndex.value(); + for (const MTPlong &fingerPrint : fingerPrints) { + auto it = RSAKeys.constFind(fingerPrint.v); + if (it != RSAKeys.cend()) { + rsaKey = &it.value(); break; } } if (!rsaKey) { QStringList suggested, my; - for (uint32 i = 0, l = fingerPrints.size(); i < l; ++i) { - suggested.push_back(QString("%1").arg(fingerPrints[i].v)); + for (const MTPlong &fingerPrint : fingerPrints) { + suggested.push_back(QString("%1").arg(fingerPrint.v)); } - for (PublicRSAKeys::const_iterator i = gPublicRSA.cbegin(), e = gPublicRSA.cend(); i != e; ++i) { + for (auto i = RSAKeys.cbegin(), e = RSAKeys.cend(); i != e; ++i) { my.push_back(QString("%1").arg(i.key())); } LOG(("AuthKey Error: could not choose public RSA key, suggested fingerprints: %1, my fingerprints: %2").arg(suggested.join(", ")).arg(my.join(", "))); @@ -3363,7 +3372,7 @@ void MTProtoConnectionPrivate::pqAnswered() { const string &pq(res_pq_data.vpq.c_string().v); string &p(p_q_inner_data.vp._string().v), &q(p_q_inner_data.vq._string().v); - if (!parsePQ(pq, p, q)) { + if (!MTP::internal::parsePQ(pq, p, q)) { LOG(("AuthKey Error: could not factor pq!")); DEBUG_LOG(("AuthKey Error: problematic pq: %1").arg(Logs::mb(&pq[0], pq.length()).str())); return restart(); @@ -3375,7 +3384,7 @@ void MTProtoConnectionPrivate::pqAnswered() { MTPReq_DH_params req_DH_params; req_DH_params.vnonce = authKeyData->nonce; req_DH_params.vserver_nonce = authKeyData->server_nonce; - req_DH_params.vpublic_key_fingerprint = MTP_long(rsaKey->fingerPrint()); + req_DH_params.vpublic_key_fingerprint = MTP_long(rsaKey->getFingerPrint()); req_DH_params.vp = p_q_inner_data.vp; req_DH_params.vq = p_q_inner_data.vq; @@ -3403,14 +3412,9 @@ void MTProtoConnectionPrivate::pqAnswered() { memset_rand(&encBuffer[encSize], (65 - encSize) * sizeof(mtpPrime)); } - dhEncString.resize(256); - int32 res = RSA_public_encrypt(256, ((const uchar*)&encBuffer[0]) + 3, (uchar*)&dhEncString[0], rsaKey->key(), RSA_NO_PADDING); - if (res != 256) { - ERR_load_crypto_strings(); - LOG(("RSA Error: RSA_public_encrypt failed, key fp: %1, result: %2, error: %3").arg(rsaKey->fingerPrint()).arg(res).arg(ERR_error_string(ERR_get_error(), 0))); + if (!rsaKey->encrypt(reinterpret_cast(&encBuffer[0]) + 3, dhEncString)) { return restart(); } - connect(_conn, SIGNAL(receivedData()), this, SLOT(dhParamsAnswered())); DEBUG_LOG(("AuthKey Info: sending Req_DH_params..")); @@ -3498,7 +3502,7 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { } // check that dhPrime and (dhPrime - 1) / 2 are really prime using openssl BIGNUM methods - _BigNumPrimeTest bnPrimeTest; + MTP::internal::BigNumPrimeTest bnPrimeTest; if (!bnPrimeTest.isPrimeAndGood(&dhPrime[0], MTPMillerRabinIterCount, dh_inner_data.vg.v)) { LOG(("AuthKey Error: bad dh_prime primality!").arg(dhPrime.length()).arg(g_a.length())); DEBUG_LOG(("AuthKey Error: dh_prime %1").arg(Logs::mb(&dhPrime[0], dhPrime.length()).str())); @@ -3556,7 +3560,7 @@ void MTProtoConnectionPrivate::dhClientParamsSend() { memset_rand(b, sizeof(b)); // count g_b and auth_key using openssl BIGNUM methods - _BigNumCounter bnCounter; + MTP::internal::BigNumCounter bnCounter; if (!bnCounter.count(b, authKeyStrings->dh_prime.constData(), authKeyData->g, g_b, authKeyStrings->g_a.constData(), authKeyData->auth_key)) { return dhClientParamsSend(); } diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index e63bc3f13e..03592e29d4 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -21,7 +21,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #pragma once #include "mtproto/mtpCoreTypes.h" -#include "mtproto/mtpPublicRSA.h" #include "mtproto/mtpAuthKey.h" inline bool mtpRequestData::isSentContainer(const mtpRequest &request) { // "request-like" wrap for msgIds vector diff --git a/Telegram/SourceFiles/mtproto/mtpPublicRSA.h b/Telegram/SourceFiles/mtproto/mtpPublicRSA.h deleted file mode 100644 index 0827ebfac5..0000000000 --- a/Telegram/SourceFiles/mtproto/mtpPublicRSA.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -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 - -class mtpPublicRSA { -public: - mtpPublicRSA(const char *key) : data(new mtpPublicRSAInner(PEM_read_bio_RSAPublicKey(BIO_new_mem_buf(const_cast(key), -1), 0, 0, 0), 0)) { - if (!data->prsa) return; - - int32 nBytes = BN_num_bytes(data->prsa->n); - int32 eBytes = BN_num_bytes(data->prsa->e); - string nStr(nBytes, 0), eStr(eBytes, 0); - BN_bn2bin(data->prsa->n, (uchar*)&nStr[0]); - BN_bn2bin(data->prsa->e, (uchar*)&eStr[0]); - - mtpBuffer tmp; - MTP_string(nStr).write(tmp); - MTP_string(eStr).write(tmp); - - uchar sha1Buffer[20]; - data->fp = *(uint64*)(hashSha1(&tmp[0], tmp.size() * sizeof(mtpPrime), sha1Buffer) + 3); - } - - mtpPublicRSA(const mtpPublicRSA &v) : data(v.data) { - ++data->cnt; - } - - mtpPublicRSA &operator=(const mtpPublicRSA &v) { - if (data != v.data) { - destroy(); - data = v.data; - ++data->cnt; - } - return *this; - } - - uint64 fingerPrint() const { - return data->fp; - } - - RSA *key() { - return data->prsa; - } - - ~mtpPublicRSA() { - destroy(); - } - -private: - void destroy() { - if (!--data->cnt) { - delete data; - } - } - - struct mtpPublicRSAInner { - mtpPublicRSAInner(RSA *_prsa, uint64 _fp) : prsa(_prsa), cnt(1), fp(_fp) { - } - ~mtpPublicRSAInner() { - RSA_free(prsa); - } - RSA *prsa; - uint32 cnt; - uint64 fp; - }; - mtpPublicRSAInner *data; -}; diff --git a/Telegram/SourceFiles/mtproto/rsa_public_key.cpp b/Telegram/SourceFiles/mtproto/rsa_public_key.cpp new file mode 100644 index 0000000000..7d9e196c84 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/rsa_public_key.cpp @@ -0,0 +1,84 @@ +/* +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 "mtproto/rsa_public_key.h" + +#include +#include +#include +#include + +using std::string; + +namespace MTP { +namespace internal { + +struct RSAPublicKey::Impl { + Impl(const char *key) : rsa(PEM_read_bio_RSAPublicKey(BIO_new_mem_buf(const_cast(key), -1), 0, 0, 0)) { + } + ~Impl() { + RSA_free(rsa); + } + RSA *rsa; + uint64 fp = 0; +}; + +RSAPublicKey::RSAPublicKey(const char *key) : impl_(new Impl(key)) { + if (!impl_->rsa) return; + + int nBytes = BN_num_bytes(impl_->rsa->n); + int eBytes = BN_num_bytes(impl_->rsa->e); + string nStr(nBytes, 0), eStr(eBytes, 0); + BN_bn2bin(impl_->rsa->n, (uchar*)&nStr[0]); + BN_bn2bin(impl_->rsa->e, (uchar*)&eStr[0]); + + mtpBuffer tmp; + MTP_string(nStr).write(tmp); + MTP_string(eStr).write(tmp); + + uchar sha1Buffer[20]; + impl_->fp = *(uint64*)(hashSha1(&tmp[0], tmp.size() * sizeof(mtpPrime), sha1Buffer) + 3); +} + +uint64 RSAPublicKey::getFingerPrint() const { + return impl_->fp; +} + +bool RSAPublicKey::isValid() const { + return impl_->rsa != nullptr; +} + +bool RSAPublicKey::encrypt(const void *data, string &result) const { + t_assert(isValid()); + + result.resize(256); + int res = RSA_public_encrypt(256, reinterpret_cast(data), reinterpret_cast(&result[0]), impl_->rsa, RSA_NO_PADDING); + if (res != 256) { + ERR_load_crypto_strings(); + LOG(("RSA Error: RSA_public_encrypt failed, key fp: %1, result: %2, error: %3").arg(getFingerPrint()).arg(res).arg(ERR_error_string(ERR_get_error(), 0))); + return false; + } + return true; +} + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/rsa_public_key.h b/Telegram/SourceFiles/mtproto/rsa_public_key.h new file mode 100644 index 0000000000..b59deec79e --- /dev/null +++ b/Telegram/SourceFiles/mtproto/rsa_public_key.h @@ -0,0 +1,48 @@ +/* +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 + +namespace MTP { +namespace internal { + +// this class holds an RSA public key and can encrypt fixed-size messages with it +class RSAPublicKey final { +public: + + // key in RSAPublicKey "-----BEGIN RSA PUBLIC KEY----- ..." format + RSAPublicKey(const char *key); + + bool isValid() const; + uint64 getFingerPrint() const; + + // data has exactly 256 chars to be encrypted + bool encrypt(const void *data, string &result) const; + +private: + + struct Impl; + typedef QSharedPointer ImplPtr; + ImplPtr impl_; + +}; + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index da667bb396..56a4b736eb 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -36,16 +36,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include #include diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 231b9bdf39..f851dc2314 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -20,6 +20,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" +#include "types.h" + +#include +#include + #include "application.h" uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 5ecc19c167..6f9a055853 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -46,6 +46,10 @@ public: }; +// thanks Chromium see https://blogs.msdn.microsoft.com/the1/2004/05/07/how-would-you-get-the-count-of-an-array-in-c-2/ +template char(&ArraySizeHelper(T(&array)[N]))[N]; +#define arraysize(array) (sizeof(ArraySizeHelper(array))) + #define qsl(s) QStringLiteral(s) #define qstr(s) QLatin1String(s, sizeof(s) - 1) diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 0bd01d56d8..4aff21ad14 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -120,6 +120,7 @@ SOURCES += \ ./SourceFiles/mtproto/mtpCoreTypes.cpp \ ./SourceFiles/mtproto/mtpDC.cpp \ ./SourceFiles/mtproto/mtpFileLoader.cpp \ + ./SourceFiles/mtproto/rsa_public_key.cpp \ ./SourceFiles/mtproto/mtpRPC.cpp \ ./SourceFiles/mtproto/mtpScheme.cpp \ ./SourceFiles/mtproto/mtpSession.cpp \ @@ -212,7 +213,7 @@ HEADERS += \ ./SourceFiles/mtproto/mtpCoreTypes.h \ ./SourceFiles/mtproto/mtpDC.h \ ./SourceFiles/mtproto/mtpFileLoader.h \ - ./SourceFiles/mtproto/mtpPublicRSA.h \ + ./SourceFiles/mtproto/rsa_public_key.h \ ./SourceFiles/mtproto/mtpRPC.h \ ./SourceFiles/mtproto/mtpScheme.h \ ./SourceFiles/mtproto/mtpSession.h \ diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 529a6b36af..28bad599a1 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -1043,6 +1043,7 @@ + @@ -1924,7 +1925,7 @@ $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) - + Moc%27ing mtpSession.h... diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index b1fff4cc41..05d327c33a 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -921,6 +921,9 @@ Generated Files\Release + + mtproto + @@ -938,9 +941,6 @@ Source Files - - mtproto - Generated Files @@ -1022,6 +1022,9 @@ intro + + mtproto + diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 710e4fea7d..96b42f2345 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -577,7 +577,7 @@ A022AF919D1977534CA66BB8 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_widgets.pri"; sourceTree = ""; }; A1479F94376F9732B57C69DB /* moc_animation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_animation.cpp; path = GeneratedFiles/Debug/moc_animation.cpp; sourceTree = ""; }; A1A67BEAA744704B29168D39 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; - A3622760CEC6D6827A25E710 /* mtpPublicRSA.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpPublicRSA.h; path = SourceFiles/mtproto/mtpPublicRSA.h; sourceTree = ""; }; + A3622760CEC6D6827A25E710 /* rsa_public_key.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = rsa_public_key.h; path = SourceFiles/mtproto/rsa_public_key.h; sourceTree = ""; }; A37C7E516201B0264A4CDA38 /* moc_introwidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_introwidget.cpp; path = GeneratedFiles/Debug/moc_introwidget.cpp; sourceTree = ""; }; A4D8AC60897F435C1C3B9D02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_generic.pri"; sourceTree = ""; }; A59F74CD76FDC2B4B9910E18 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_scripttools_private.pri"; sourceTree = ""; }; @@ -830,7 +830,7 @@ 27E7471A4EC90E84353AA16F /* mtpCoreTypes.h */, B3D42654F18B1FE49512C404 /* mtpDC.h */, 96ACDDE3DCB798B97F9EA2F4 /* mtpFileLoader.h */, - A3622760CEC6D6827A25E710 /* mtpPublicRSA.h */, + A3622760CEC6D6827A25E710 /* rsa_public_key.h */, FB61F72601D91BF3AC730D20 /* mtpRPC.h */, 7DBFC0B5EAF874BA10E3D603 /* mtpScheme.h */, 4D1099F2D3696E8A0E17D37D /* mtpSession.h */, diff --git a/Telegram/Telegram.xcodeproj/qt_preprocess.mak b/Telegram/Telegram.xcodeproj/qt_preprocess.mak index ad99832894..4f7753467d 100644 --- a/Telegram/Telegram.xcodeproj/qt_preprocess.mak +++ b/Telegram/Telegram.xcodeproj/qt_preprocess.mak @@ -299,7 +299,7 @@ GeneratedFiles/Debug/moc_mtp.cpp: SourceFiles/mtproto/mtpSession.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ SourceFiles/logs.h \ SourceFiles/mtproto/mtpScheme.h \ - SourceFiles/mtproto/mtpPublicRSA.h \ + SourceFiles/mtproto/rsa_public_key.h \ SourceFiles/mtproto/mtpAuthKey.h \ SourceFiles/mtproto/mtpDC.h \ SourceFiles/mtproto/mtpRPC.h \ @@ -313,7 +313,7 @@ GeneratedFiles/Debug/moc_mtpConnection.cpp: SourceFiles/mtproto/mtpCoreTypes.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ SourceFiles/logs.h \ SourceFiles/mtproto/mtpScheme.h \ - SourceFiles/mtproto/mtpPublicRSA.h \ + SourceFiles/mtproto/rsa_public_key.h \ SourceFiles/mtproto/mtpAuthKey.h \ SourceFiles/mtproto/mtpConnection.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/mtproto/mtpConnection.h -o GeneratedFiles/Debug/moc_mtpConnection.cpp @@ -330,7 +330,7 @@ GeneratedFiles/Debug/moc_mtpSession.cpp: SourceFiles/mtproto/mtpConnection.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ SourceFiles/logs.h \ SourceFiles/mtproto/mtpScheme.h \ - SourceFiles/mtproto/mtpPublicRSA.h \ + SourceFiles/mtproto/rsa_public_key.h \ SourceFiles/mtproto/mtpAuthKey.h \ SourceFiles/mtproto/mtpDC.h \ SourceFiles/mtproto/mtpRPC.h \ From 26e291884141e1f1cf56000e02c17d1ec0dfcbb0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Mar 2016 21:43:12 +0300 Subject: [PATCH 241/316] Modules renamed in mtproto folder, Xcode build should not work yet --- .../mtproto/{mtpAuthKey.cpp => auth_key.cpp} | 2 + .../mtproto/{mtpAuthKey.h => auth_key.h} | 0 .../{mtpConnection.cpp => connection.cpp} | 2 +- .../mtproto/{mtpConnection.h => connection.h} | 4 +- .../{mtpCoreTypes.cpp => core_types.cpp} | 3 +- .../mtproto/{mtpCoreTypes.h => core_types.h} | 3 +- .../mtproto/{mtpDC.cpp => dcenter.cpp} | 5 +- .../mtproto/{mtpDC.h => dcenter.h} | 0 .../mtproto/{mtp.cpp => facade.cpp} | 3 +- .../SourceFiles/mtproto/{mtp.h => facade.h} | 28 +- .../{mtpFileLoader.cpp => file_download.cpp} | 3 + .../{mtpFileLoader.h => file_download.h} | 0 Telegram/SourceFiles/mtproto/generate.py | 22 +- Telegram/SourceFiles/mtproto/mtpSessionImpl.h | 45 - .../mtproto/{mtpRPC.cpp => rpc_sender.cpp} | 3 +- .../mtproto/{mtpRPC.h => rpc_sender.h} | 0 .../{mtpScheme.cpp => scheme_auto.cpp} | 3 +- .../mtproto/{mtpScheme.h => scheme_auto.h} | 2540 +++++++++-------- .../mtproto/{mtpSession.cpp => session.cpp} | 3 +- .../mtproto/{mtpSession.h => session.h} | 6 +- Telegram/SourceFiles/stdafx.h | 2 +- Telegram/Telegram.pro | 37 +- Telegram/Telegram.vcxproj | 247 +- Telegram/Telegram.vcxproj.filters | 201 +- Telegram/Telegram.xcodeproj/project.pbxproj | 150 +- Telegram/Telegram.xcodeproj/qt_preprocess.mak | 63 +- 26 files changed, 1679 insertions(+), 1696 deletions(-) rename Telegram/SourceFiles/mtproto/{mtpAuthKey.cpp => auth_key.cpp} (98%) rename Telegram/SourceFiles/mtproto/{mtpAuthKey.h => auth_key.h} (100%) rename Telegram/SourceFiles/mtproto/{mtpConnection.cpp => connection.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtpConnection.h => connection.h} (99%) rename Telegram/SourceFiles/mtproto/{mtpCoreTypes.cpp => core_types.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtpCoreTypes.h => core_types.h} (99%) rename Telegram/SourceFiles/mtproto/{mtpDC.cpp => dcenter.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtpDC.h => dcenter.h} (100%) rename Telegram/SourceFiles/mtproto/{mtp.cpp => facade.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtp.h => facade.h} (83%) rename Telegram/SourceFiles/mtproto/{mtpFileLoader.cpp => file_download.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtpFileLoader.h => file_download.h} (100%) delete mode 100644 Telegram/SourceFiles/mtproto/mtpSessionImpl.h rename Telegram/SourceFiles/mtproto/{mtpRPC.cpp => rpc_sender.cpp} (97%) rename Telegram/SourceFiles/mtproto/{mtpRPC.h => rpc_sender.h} (100%) rename Telegram/SourceFiles/mtproto/{mtpScheme.cpp => scheme_auto.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtpScheme.h => scheme_auto.h} (93%) rename Telegram/SourceFiles/mtproto/{mtpSession.cpp => session.cpp} (99%) rename Telegram/SourceFiles/mtproto/{mtpSession.h => session.h} (98%) diff --git a/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp b/Telegram/SourceFiles/mtproto/auth_key.cpp similarity index 98% rename from Telegram/SourceFiles/mtproto/mtpAuthKey.cpp rename to Telegram/SourceFiles/mtproto/auth_key.cpp index 8af05ae132..29f297f6b6 100644 --- a/Telegram/SourceFiles/mtproto/mtpAuthKey.cpp +++ b/Telegram/SourceFiles/mtproto/auth_key.cpp @@ -20,6 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" +#include "mtproto/auth_key.h" + #include void aesEncrypt(const void *src, void *dst, uint32 len, void *key, void *iv) { diff --git a/Telegram/SourceFiles/mtproto/mtpAuthKey.h b/Telegram/SourceFiles/mtproto/auth_key.h similarity index 100% rename from Telegram/SourceFiles/mtproto/mtpAuthKey.h rename to Telegram/SourceFiles/mtproto/auth_key.h diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpConnection.cpp rename to Telegram/SourceFiles/mtproto/connection.cpp index 98337156e1..ab307b48a0 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "mtproto/mtpConnection.h" +#include "mtproto/connection.h" #include #include diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/connection.h similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpConnection.h rename to Telegram/SourceFiles/mtproto/connection.h index 03592e29d4..7a556b83ec 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/connection.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -#include "mtproto/mtpCoreTypes.h" -#include "mtproto/mtpAuthKey.h" +#include "mtproto/core_types.h" +#include "mtproto/auth_key.h" inline bool mtpRequestData::isSentContainer(const mtpRequest &request) { // "request-like" wrap for msgIds vector if (request->size() < 9) return false; diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp b/Telegram/SourceFiles/mtproto/core_types.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp rename to Telegram/SourceFiles/mtproto/core_types.cpp index 38b810a2a8..a45dc6e16f 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.cpp +++ b/Telegram/SourceFiles/mtproto/core_types.cpp @@ -19,7 +19,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "mtpCoreTypes.h" + +#include "mtproto/core_types.h" #include "lang.h" diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/core_types.h similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpCoreTypes.h rename to Telegram/SourceFiles/mtproto/core_types.h index c8a3f2b327..040d59567b 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/core_types.h @@ -21,7 +21,6 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #pragma once #include "types.h" -#include #undef min #undef max @@ -986,7 +985,7 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end) { return QString::fromUtf8(to.p, to.size); } -#include "mtpScheme.h" +#include "mtproto/scheme_auto.h" inline MTPbool MTP_bool(bool v) { return v ? MTP_boolTrue() : MTP_boolFalse(); diff --git a/Telegram/SourceFiles/mtproto/mtpDC.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpDC.cpp rename to Telegram/SourceFiles/mtproto/dcenter.cpp index 854894f708..470e0e2282 100644 --- a/Telegram/SourceFiles/mtproto/mtpDC.cpp +++ b/Telegram/SourceFiles/mtproto/dcenter.cpp @@ -19,9 +19,10 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "mtpDC.h" -#include "mtp.h" +#include "mtproto/dcenter.h" + +#include "mtproto/facade.h" #include "localstorage.h" namespace { diff --git a/Telegram/SourceFiles/mtproto/mtpDC.h b/Telegram/SourceFiles/mtproto/dcenter.h similarity index 100% rename from Telegram/SourceFiles/mtproto/mtpDC.h rename to Telegram/SourceFiles/mtproto/dcenter.h diff --git a/Telegram/SourceFiles/mtproto/mtp.cpp b/Telegram/SourceFiles/mtproto/facade.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtp.cpp rename to Telegram/SourceFiles/mtproto/facade.cpp index 86493e5224..c63e6834bc 100644 --- a/Telegram/SourceFiles/mtproto/mtp.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -19,7 +19,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "mtp.h" + +#include "mtproto/facade.h" #include "localstorage.h" diff --git a/Telegram/SourceFiles/mtproto/mtp.h b/Telegram/SourceFiles/mtproto/facade.h similarity index 83% rename from Telegram/SourceFiles/mtproto/mtp.h rename to Telegram/SourceFiles/mtproto/facade.h index b3cd87f1a8..88d5863beb 100644 --- a/Telegram/SourceFiles/mtproto/mtp.h +++ b/Telegram/SourceFiles/mtproto/facade.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -#include "mtproto/mtpSession.h" -#include "mtproto/mtpFileLoader.h" +#include "mtproto/session.h" +#include "mtproto/file_download.h" namespace _mtp_internal { MTProtoSession *getSession(int32 dc); // 0 - current set dc @@ -171,4 +171,26 @@ namespace MTP { }; -#include "mtproto/mtpSessionImpl.h" +template +mtpRequestId MTProtoSession::send(const TRequest &request, RPCResponseHandler callbacks, uint64 msCanWait, bool needsLayer, bool toMainDC, mtpRequestId after) { + mtpRequestId requestId = 0; + try { + uint32 requestSize = request.innerLength() >> 2; + mtpRequest reqSerialized(mtpRequestData::prepare(requestSize)); + request.write(*reqSerialized); + + DEBUG_LOG(("MTP Info: adding request to toSendMap, msCanWait %1").arg(msCanWait)); + + reqSerialized->msDate = getms(true); // > 0 - can send without container + reqSerialized->needsLayer = needsLayer; + if (after) reqSerialized->after = _mtp_internal::getRequest(after); + requestId = _mtp_internal::storeRequest(reqSerialized, callbacks); + + sendPrepared(reqSerialized, msCanWait); + } catch (Exception &e) { + requestId = 0; + _mtp_internal::rpcErrorOccured(requestId, callbacks, rpcClientError("NO_REQUEST_ID", QString("send() failed to queue request, exception: %1").arg(e.what()))); + } + if (requestId) _mtp_internal::registerRequest(requestId, toMainDC ? -getDcWithShift() : getDcWithShift()); + return requestId; +} diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp b/Telegram/SourceFiles/mtproto/file_download.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpFileLoader.cpp rename to Telegram/SourceFiles/mtproto/file_download.cpp index 54a6740f6d..c40e20e98f 100644 --- a/Telegram/SourceFiles/mtproto/mtpFileLoader.cpp +++ b/Telegram/SourceFiles/mtproto/file_download.cpp @@ -19,6 +19,9 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" + +#include "mtproto/file_download.h" + #include "mainwidget.h" #include "window.h" diff --git a/Telegram/SourceFiles/mtproto/mtpFileLoader.h b/Telegram/SourceFiles/mtproto/file_download.h similarity index 100% rename from Telegram/SourceFiles/mtproto/mtpFileLoader.h rename to Telegram/SourceFiles/mtproto/file_download.h diff --git a/Telegram/SourceFiles/mtproto/generate.py b/Telegram/SourceFiles/mtproto/generate.py index 240129331e..b5edcf7a78 100644 --- a/Telegram/SourceFiles/mtproto/generate.py +++ b/Telegram/SourceFiles/mtproto/generate.py @@ -63,7 +63,7 @@ textSerializeInit = ''; textSerializeMethods = ''; forwards = ''; forwTypedefs = ''; -out = open('mtpScheme.h', 'w') +out = open('scheme_auto.h', 'w') out.write('/*\n'); out.write('Created from \'/SourceFiles/mtproto/scheme.tl\' by \'/SourceFiles/mtproto/generate.py\' script\n\n'); out.write('WARNING! All changes made in this file will be lost!\n\n'); @@ -86,7 +86,7 @@ out.write('\n'); out.write('Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n'); out.write('Copyright (c) 2014 John Preston, https://desktop.telegram.org\n'); out.write('*/\n'); -out.write('#pragma once\n\n#include "mtpCoreTypes.h"\n'); +out.write('#pragma once\n\n#include "mtproto/core_types.h"\n'); with open('scheme.tl') as f: for line in f: nocomment = re.match(r'^(.*?)//', line) @@ -600,15 +600,15 @@ for restype in typesList: if (not friendDecl): friendDecl += '\tfriend class MTP::internal::TypeCreator;\n'; - creatorProxyText += '\t\tinline static MTP' + restype + ' new_' + name + '(' + ', '.join(creatorParams) + ') {\n'; + creatorProxyText += '\tinline static MTP' + restype + ' new_' + name + '(' + ', '.join(creatorParams) + ') {\n'; if (len(prms) > len(trivialConditions)): # creator with params - creatorProxyText += '\t\t\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n'; + creatorProxyText += '\t\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n'; else: if (withType): # creator by type - creatorProxyText += '\t\t\treturn MTP' + restype + '(mtpc_' + name + ');\n'; + creatorProxyText += '\t\treturn MTP' + restype + '(mtpc_' + name + ');\n'; else: # single creator - creatorProxyText += '\t\t\treturn MTP' + restype + '();\n'; - creatorProxyText += '\t\t}\n'; + creatorProxyText += '\t\treturn MTP' + restype + '();\n'; + creatorProxyText += '\t}\n'; if (len(conditionsList)): creatorsText += 'Q_DECLARE_OPERATORS_FOR_FLAGS(MTPD' + name + '::Flags)\n'; creatorsText += 'inline MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ') {\n'; @@ -853,18 +853,18 @@ 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// Creator proxy class declaration\nnamespace MTP {\nnamespace internal {\n\nclass TypeCreator;\n\n} // namespace internal\n} // namespace MTP\n'); out.write('\n// Type id constants\nenum {\n' + ',\n'.join(enums) + '\n};\n'); out.write('\n// Type forward declarations\n' + forwards); out.write('\n// Boxed types definitions\n' + forwTypedefs); 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// Creator proxy class definition\nnamespace MTP {\nnamespace internal {\n\nclass TypeCreator {\npublic:\n' + creatorProxyText + '\t};\n\n} // namespace internal\n} // namespace MTP\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'); -outCpp = open('mtpScheme.cpp', 'w'); +outCpp = open('scheme_auto.cpp', 'w'); outCpp.write('/*\n'); outCpp.write('Created from \'/SourceFiles/mtproto/scheme.tl\' by \'/SourceFiles/mtproto/generate.py\' script\n\n'); outCpp.write('WARNING! All changes made in this file will be lost!\n\n'); @@ -884,7 +884,7 @@ outCpp.write('\n'); outCpp.write('Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n'); outCpp.write('Copyright (c) 2014 John Preston, https://desktop.telegram.org\n'); outCpp.write('*/\n'); -outCpp.write('#include "stdafx.h"\n#include "mtpScheme.h"\n\n'); +outCpp.write('#include "stdafx.h"\n\n#include "mtproto/scheme_auto.h"\n\n'); outCpp.write('typedef QVector Types;\ntypedef QVector StagesFlags;\n\n'); outCpp.write(textSerializeMethods); outCpp.write('namespace {\n'); diff --git a/Telegram/SourceFiles/mtproto/mtpSessionImpl.h b/Telegram/SourceFiles/mtproto/mtpSessionImpl.h deleted file mode 100644 index 465a2f7f81..0000000000 --- a/Telegram/SourceFiles/mtproto/mtpSessionImpl.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 - -template -mtpRequestId MTProtoSession::send(const TRequest &request, RPCResponseHandler callbacks, uint64 msCanWait, bool needsLayer, bool toMainDC, mtpRequestId after) { - mtpRequestId requestId = 0; - try { - uint32 requestSize = request.innerLength() >> 2; - mtpRequest reqSerialized(mtpRequestData::prepare(requestSize)); - request.write(*reqSerialized); - - DEBUG_LOG(("MTP Info: adding request to toSendMap, msCanWait %1").arg(msCanWait)); - - reqSerialized->msDate = getms(true); // > 0 - can send without container - reqSerialized->needsLayer = needsLayer; - if (after) reqSerialized->after = _mtp_internal::getRequest(after); - requestId = _mtp_internal::storeRequest(reqSerialized, callbacks); - - sendPrepared(reqSerialized, msCanWait); - } catch (Exception &e) { - requestId = 0; - _mtp_internal::rpcErrorOccured(requestId, callbacks, rpcClientError("NO_REQUEST_ID", QString("send() failed to queue request, exception: %1").arg(e.what()))); - } - if (requestId) _mtp_internal::registerRequest(requestId, toMainDC ? -getDcWithShift() : getDcWithShift()); - return requestId; -} diff --git a/Telegram/SourceFiles/mtproto/mtpRPC.cpp b/Telegram/SourceFiles/mtproto/rpc_sender.cpp similarity index 97% rename from Telegram/SourceFiles/mtproto/mtpRPC.cpp rename to Telegram/SourceFiles/mtproto/rpc_sender.cpp index c0c861750b..7cf9339a9d 100644 --- a/Telegram/SourceFiles/mtproto/mtpRPC.cpp +++ b/Telegram/SourceFiles/mtproto/rpc_sender.cpp @@ -19,7 +19,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "mtproto/mtpRPC.h" + +#include "mtproto/rpc_sender.h" RPCOwnedDoneHandler::RPCOwnedDoneHandler(RPCSender *owner) : _owner(owner) { _owner->_rpcRegHandler(this); diff --git a/Telegram/SourceFiles/mtproto/mtpRPC.h b/Telegram/SourceFiles/mtproto/rpc_sender.h similarity index 100% rename from Telegram/SourceFiles/mtproto/mtpRPC.h rename to Telegram/SourceFiles/mtproto/rpc_sender.h diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/scheme_auto.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpScheme.cpp rename to Telegram/SourceFiles/mtproto/scheme_auto.cpp index 14c165cd87..272945bd83 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/scheme_auto.cpp @@ -20,7 +20,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "mtpScheme.h" + +#include "mtproto/scheme_auto.h" typedef QVector Types; typedef QVector StagesFlags; diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/scheme_auto.h similarity index 93% rename from Telegram/SourceFiles/mtproto/mtpScheme.h rename to Telegram/SourceFiles/mtproto/scheme_auto.h index 9cc878cb7c..69f6e33118 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/scheme_auto.h @@ -24,14 +24,16 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -#include "mtpCoreTypes.h" +#include "mtproto/core_types.h" // Creator proxy class declaration namespace MTP { namespace internal { - class TypeCreator; -} -} + +class TypeCreator; + +} // namespace internal +} // namespace MTP // Type id constants enum { @@ -20875,1271 +20877,1273 @@ public: // 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)); - } + +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)); + } }; -} -} + +} // namespace internal +} // namespace MTP // Inline methods definition diff --git a/Telegram/SourceFiles/mtproto/mtpSession.cpp b/Telegram/SourceFiles/mtproto/session.cpp similarity index 99% rename from Telegram/SourceFiles/mtproto/mtpSession.cpp rename to Telegram/SourceFiles/mtproto/session.cpp index a6d6d918cf..8409549b08 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.cpp +++ b/Telegram/SourceFiles/mtproto/session.cpp @@ -19,7 +19,8 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include + +#include "mtproto/session.h" void MTPSessionData::clear() { RPCCallbackClears clearCallbacks; diff --git a/Telegram/SourceFiles/mtproto/mtpSession.h b/Telegram/SourceFiles/mtproto/session.h similarity index 98% rename from Telegram/SourceFiles/mtproto/mtpSession.h rename to Telegram/SourceFiles/mtproto/session.h index a635372f12..e1fd43cbd7 100644 --- a/Telegram/SourceFiles/mtproto/mtpSession.h +++ b/Telegram/SourceFiles/mtproto/session.h @@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -#include "mtpConnection.h" -#include "mtpDC.h" -#include "mtpRPC.h" +#include "mtproto/connection.h" +#include "mtproto/dcenter.h" +#include "mtproto/rpc_sender.h" class MTProtoSession; diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 56a4b736eb..458defe4c7 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -65,7 +65,7 @@ extern "C" { #include "types.h" #include "config.h" -#include "mtproto/mtp.h" +#include "mtproto/facade.h" #include "gui/style_core.h" #include "gui/twidget.h" diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 4aff21ad14..b6242d3ed0 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -114,16 +114,16 @@ SOURCES += \ ./SourceFiles/title.cpp \ ./SourceFiles/types.cpp \ ./SourceFiles/window.cpp \ - ./SourceFiles/mtproto/mtp.cpp \ - ./SourceFiles/mtproto/mtpAuthKey.cpp \ - ./SourceFiles/mtproto/mtpConnection.cpp \ - ./SourceFiles/mtproto/mtpCoreTypes.cpp \ - ./SourceFiles/mtproto/mtpDC.cpp \ - ./SourceFiles/mtproto/mtpFileLoader.cpp \ + ./SourceFiles/mtproto/facade.cpp \ + ./SourceFiles/mtproto/auth_key.cpp \ + ./SourceFiles/mtproto/connection.cpp \ + ./SourceFiles/mtproto/core_types.cpp \ + ./SourceFiles/mtproto/dcenter.cpp \ + ./SourceFiles/mtproto/file_download.cpp \ ./SourceFiles/mtproto/rsa_public_key.cpp \ - ./SourceFiles/mtproto/mtpRPC.cpp \ - ./SourceFiles/mtproto/mtpScheme.cpp \ - ./SourceFiles/mtproto/mtpSession.cpp \ + ./SourceFiles/mtproto/rpc_sender.cpp \ + ./SourceFiles/mtproto/scheme_auto.cpp \ + ./SourceFiles/mtproto/session.cpp \ ./SourceFiles/gui/animation.cpp \ ./SourceFiles/gui/boxshadow.cpp \ ./SourceFiles/gui/button.cpp \ @@ -206,17 +206,16 @@ HEADERS += \ ./SourceFiles/title.h \ ./SourceFiles/types.h \ ./SourceFiles/window.h \ - ./SourceFiles/mtproto/mtpSessionImpl.h \ - ./SourceFiles/mtproto/mtp.h \ - ./SourceFiles/mtproto/mtpAuthKey.h \ - ./SourceFiles/mtproto/mtpConnection.h \ - ./SourceFiles/mtproto/mtpCoreTypes.h \ - ./SourceFiles/mtproto/mtpDC.h \ - ./SourceFiles/mtproto/mtpFileLoader.h \ + ./SourceFiles/mtproto/facade.h \ + ./SourceFiles/mtproto/auth_key.h \ + ./SourceFiles/mtproto/connection.h \ + ./SourceFiles/mtproto/core_types.h \ + ./SourceFiles/mtproto/dcenter.h \ + ./SourceFiles/mtproto/file_download.h \ ./SourceFiles/mtproto/rsa_public_key.h \ - ./SourceFiles/mtproto/mtpRPC.h \ - ./SourceFiles/mtproto/mtpScheme.h \ - ./SourceFiles/mtproto/mtpSession.h \ + ./SourceFiles/mtproto/rpc_sender.h \ + ./SourceFiles/mtproto/scheme_auto.h \ + ./SourceFiles/mtproto/session.h \ ./SourceFiles/pspecific.h \ ./SourceFiles/gui/animation.h \ ./SourceFiles/gui/boxshadow.h \ diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 28bad599a1..7f203989fd 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -205,6 +205,10 @@ true true + + true + true + true true @@ -217,6 +221,10 @@ true true + + true + true + true true @@ -233,10 +241,18 @@ true true + + true + true + true true + + true + true + true true @@ -309,26 +325,6 @@ true true - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - true true @@ -384,6 +380,10 @@ true true + + true + true + true true @@ -468,6 +468,10 @@ true true + + true + true + true true @@ -480,6 +484,10 @@ true true + + true + true + true true @@ -496,10 +504,18 @@ true true + + true + true + true true + + true + true + true true @@ -572,26 +588,6 @@ true true - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - true true @@ -647,6 +643,10 @@ true true + + true + true + true true @@ -757,6 +757,10 @@ true true + + true + true + true true @@ -769,6 +773,10 @@ true true + + true + true + true true @@ -785,10 +793,18 @@ true true + + true + true + true true + + true + true + true true @@ -861,26 +877,6 @@ true true - - true - true - - - true - true - - - true - true - - - true - true - - - true - true - true true @@ -936,6 +932,10 @@ true true + + true + true + true true @@ -1034,15 +1034,15 @@ - - - - - - - - - + + + + + + + + + @@ -1838,19 +1838,19 @@ - - Moc%27ing mtpConnection.h... + + Moc%27ing connection.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" - Moc%27ing mtpConnection.h... - Moc%27ing mtpConnection.h... + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection.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" + Moc%27ing connection.h... + Moc%27ing connection.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/mtproto/mtpConnection.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/mtproto/mtpConnection.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/mtproto/connection.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/mtproto/connection.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) Moc%27ing mainwidget.h... @@ -1866,19 +1866,19 @@ $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) - - Moc%27ing mtp.h... + + Moc%27ing facade.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" - Moc%27ing mtp.h... - Moc%27ing mtp.h... + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/facade.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" + Moc%27ing facade.h... + Moc%27ing facade.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/mtproto/mtp.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/mtproto/mtp.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/mtproto/facade.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/mtproto/facade.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) $(QTDIR)\bin\moc.exe;%(FullPath) @@ -1894,52 +1894,52 @@ .\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/mediaview.h" - - - Moc%27ing mtpFileLoader.h... + + + Moc%27ing file_download.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" - Moc%27ing mtpFileLoader.h... - Moc%27ing mtpFileLoader.h... + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/file_download.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" + Moc%27ing file_download.h... + Moc%27ing file_download.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/mtproto/mtpFileLoader.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/mtproto/mtpFileLoader.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/mtproto/file_download.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/mtproto/file_download.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) - - - - Moc%27ing mtpDC.h... + + + + Moc%27ing dcenter.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" - Moc%27ing mtpDC.h... - Moc%27ing mtpDC.h... + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/dcenter.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" + Moc%27ing dcenter.h... + Moc%27ing dcenter.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/mtproto/mtpDC.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/mtproto/mtpDC.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/mtproto/dcenter.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/mtproto/dcenter.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) - - - Moc%27ing mtpSession.h... + + + Moc%27ing session.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" - Moc%27ing mtpSession.h... - Moc%27ing mtpSession.h... + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/session.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" + Moc%27ing session.h... + Moc%27ing session.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/mtproto/mtpSession.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/mtproto/mtpSession.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/mtproto/session.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/mtproto/session.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) Moc%27ing settingswidget.h... @@ -1983,7 +1983,6 @@ $(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) Moc%27ing overviewwidget.h... diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index 05d327c33a..b4b09d1c0b 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -63,15 +63,6 @@ Source Files - - mtproto - - - mtproto - - - mtproto - Source Files @@ -102,9 +93,6 @@ gui - - mtproto - Source Files @@ -117,9 +105,6 @@ Source Files - - mtproto - Source Files @@ -138,9 +123,6 @@ gui - - mtproto - Source Files @@ -309,51 +291,6 @@ Generated Files\Release - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - - - Generated Files\Deploy - - - Generated Files\Debug - - - Generated Files\Release - Generated Files\Deploy @@ -624,12 +561,6 @@ Generated Files\Release - - mtproto - - - mtproto - boxes @@ -861,9 +792,6 @@ Source Files - - mtproto - Source Files @@ -924,20 +852,83 @@ mtproto + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + mtproto + + + mtproto + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + mtproto + + + mtproto + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + mtproto + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + mtproto + + + mtproto + + + mtproto + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + mtproto + Source Files - - mtproto - - - mtproto - - - mtproto - Source Files @@ -953,9 +944,6 @@ Source Files - - mtproto - Source Files @@ -986,9 +974,6 @@ Source Files - - mtproto - Generated Files @@ -1025,17 +1010,20 @@ mtproto + + mtproto + + + mtproto + + + mtproto + + + mtproto + - - mtproto - - - mtproto - - - mtproto - Source Files @@ -1075,18 +1063,12 @@ gui - - mtproto - Source Files Source Files - - mtproto - gui @@ -1252,6 +1234,21 @@ Source Files + + mtproto + + + mtproto + + + mtproto + + + mtproto + + + mtproto + diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 96b42f2345..b330ff9307 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -37,12 +37,12 @@ 0250AB6761AC71A2E3155EEA /* moc_introphone.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 1B4A65B84270FF2FED008EB6 /* moc_introphone.cpp */; settings = {ATTRIBUTES = (); }; }; 02F93BF511880983D3C57B84 /* dialogswidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = E466873F01ABA1E55E914489 /* dialogswidget.cpp */; settings = {ATTRIBUTES = (); }; }; 03270F718426CFE84729079E /* flattextarea.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 5C7FD422BBEDA858D7237AE9 /* flattextarea.cpp */; settings = {ATTRIBUTES = (); }; }; - 06EABCC49D2EEE4076322BE7 /* moc_mtp.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 924D4939FD169BB4B8AEB1C9 /* moc_mtp.cpp */; settings = {ATTRIBUTES = (); }; }; + 06EABCC49D2EEE4076322BE7 /* moc_facade.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 924D4939FD169BB4B8AEB1C9 /* moc_facade.cpp */; settings = {ATTRIBUTES = (); }; }; 07080BCF1A43588C00741A51 /* lang_auto.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07080BCD1A43588C00741A51 /* lang_auto.cpp */; }; 07080BD21A436A5000741A51 /* lang.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07080BD01A436A5000741A51 /* lang.cpp */; }; 0710C9FE1B0B9376001B4272 /* stickersetbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0710C9FC1B0B9376001B4272 /* stickersetbox.cpp */; }; 0710CA051B0B9404001B4272 /* moc_stickersetbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0710CA041B0B9404001B4272 /* moc_stickersetbox.cpp */; }; - 07129D6A1C16D230002DC495 /* mtpAuthKey.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D691C16D230002DC495 /* mtpAuthKey.cpp */; }; + 07129D6A1C16D230002DC495 /* auth_key.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D691C16D230002DC495 /* auth_key.cpp */; }; 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07129D6C1C16D245002DC495 /* facades.cpp */; }; 071AD8D21C5E8E6D008C9E90 /* zip.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8D11C5E8E6D008C9E90 /* zip.c */; }; 071AD8F81C5E99D6008C9E90 /* ioapi.c in Compile Sources */ = {isa = PBXBuildFile; fileRef = 071AD8F71C5E99D6008C9E90 /* ioapi.c */; }; @@ -83,8 +83,8 @@ 07D703BB19B88FB900C4EED2 /* moc_audio.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D703BA19B88FB900C4EED2 /* moc_audio.cpp */; }; 07D7954A1B5544B200DE9598 /* qtpcre in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 07D795491B5544B200DE9598 /* qtpcre */; }; 07D7EABA1A597DD000838BA2 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 07D7EABC1A597DD000838BA2 /* Localizable.strings */; }; - 07D8509419F5C97E00623D75 /* mtpCoreTypes.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D8509219F5C97E00623D75 /* mtpCoreTypes.cpp */; }; - 07D8509519F5C97E00623D75 /* mtpScheme.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D8509319F5C97E00623D75 /* mtpScheme.cpp */; }; + 07D8509419F5C97E00623D75 /* core_types.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D8509219F5C97E00623D75 /* core_types.cpp */; }; + 07D8509519F5C97E00623D75 /* scheme_auto.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D8509319F5C97E00623D75 /* scheme_auto.cpp */; }; 07D8509919F8320900623D75 /* usernamebox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D8509719F8320900623D75 /* usernamebox.cpp */; }; 07D8510819F8340A00623D75 /* moc_usernamebox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07D8510719F8340A00623D75 /* moc_usernamebox.cpp */; }; 07DB67471AD07C4F00A51329 /* structs.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07DB67451AD07C4F00A51329 /* structs.cpp */; }; @@ -98,7 +98,7 @@ 07DE92AA1AA4928200A18F6F /* moc_autolockbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07DE92A91AA4928200A18F6F /* moc_autolockbox.cpp */; }; 07DE92AD1AA4928B00A18F6F /* moc_passcodebox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07DE92AB1AA4928B00A18F6F /* moc_passcodebox.cpp */; }; 07DE92AE1AA4928B00A18F6F /* moc_passcodewidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07DE92AC1AA4928B00A18F6F /* moc_passcodewidget.cpp */; }; - 0CB7DE9A54CC9BF86FB7B5CA /* mtp.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6D50D70712776D7ED3B00E5C /* mtp.cpp */; settings = {ATTRIBUTES = (); }; }; + 0CB7DE9A54CC9BF86FB7B5CA /* facade.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6D50D70712776D7ED3B00E5C /* facade.cpp */; settings = {ATTRIBUTES = (); }; }; 0F7872E39EA570249D420912 /* moc_introwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = A37C7E516201B0264A4CDA38 /* moc_introwidget.cpp */; settings = {ATTRIBUTES = (); }; }; 113AA97DEE7847C7D2DCFF71 /* logs.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 974DB34EEB8F83B91614C0B0 /* logs.cpp */; settings = {ATTRIBUTES = (); }; }; 1299DDAE203A7EDFED9F5D6B /* main.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 5271C394C1E7646D117CE67E /* main.cpp */; settings = {ATTRIBUTES = (); }; }; @@ -110,7 +110,7 @@ 1DF53374E3B6A31661548D08 /* historywidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = A83D2C19F756D3371E5999A8 /* historywidget.cpp */; settings = {ATTRIBUTES = (); }; }; 26A81090DC8B5BCF7278FDFF /* qrc_telegram.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = D6FF6676816C4E374D374060 /* qrc_telegram.cpp */; settings = {ATTRIBUTES = (); }; }; 298BFAB73BF182297584F96F /* contactsbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8C800AAC9549E6E9E7046BED /* contactsbox.cpp */; settings = {ATTRIBUTES = (); }; }; - 2A500B102B7CE80F3EB6E13E /* moc_mtpFileLoader.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 5591A965D1DC024FBDB40151 /* moc_mtpFileLoader.cpp */; settings = {ATTRIBUTES = (); }; }; + 2A500B102B7CE80F3EB6E13E /* moc_file_download.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 5591A965D1DC024FBDB40151 /* moc_file_download.cpp */; settings = {ATTRIBUTES = (); }; }; 2EF5D0AC9A18F9FE9B8A1ACA /* moc_introsignup.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 58A7114F60E7D09E73283983 /* moc_introsignup.cpp */; settings = {ATTRIBUTES = (); }; }; 328FD74542F6E2C873EE4D4B /* ApplicationServices.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = DFD7912080BC557230093752 /* ApplicationServices.framework */; }; 352349751855EF76DECA4D60 /* moc_historywidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 2C99425D7670941EAF07B453 /* moc_historywidget.cpp */; settings = {ATTRIBUTES = (); }; }; @@ -163,19 +163,19 @@ 8D33FE22B9BBADC7FA46C15B /* qtharfbuzzng in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D6193B79CECC9DD0142D1200 /* qtharfbuzzng */; }; 8E26A0653012B8E8C3E865EC /* application.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = C20F9DD8C7B031B8E20D5653 /* application.cpp */; settings = {ATTRIBUTES = (); }; }; 8F65F0D95B1F0CEB859F2FB3 /* boxshadow.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 08A7682548FB7E671FF03822 /* boxshadow.cpp */; settings = {ATTRIBUTES = (); }; }; - 8F6F5D7F82036331E8C6DAE6 /* moc_mtpConnection.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = B714EA71A09A832FAA846A0A /* moc_mtpConnection.cpp */; settings = {ATTRIBUTES = (); }; }; + 8F6F5D7F82036331E8C6DAE6 /* moc_connection.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = B714EA71A09A832FAA846A0A /* moc_connection.cpp */; settings = {ATTRIBUTES = (); }; }; 90085DF442550A0845D5AF37 /* style_core.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 420A06A32B66D250142B4B6D /* style_core.cpp */; settings = {ATTRIBUTES = (); }; }; 9357E7B12AD6D88B157ACA05 /* introcode.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = A0090709DE1B155085362C36 /* introcode.cpp */; settings = {ATTRIBUTES = (); }; }; 9809A3AF1946D51ACB41D716 /* moc_photocropbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = AF61D864B8C444ADD4E1B391 /* moc_photocropbox.cpp */; settings = {ATTRIBUTES = (); }; }; 98E4F55DB5D8E64AB9F08C83 /* moc_localimageloader.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 1D7899ACAA9F973CADFA34C1 /* moc_localimageloader.cpp */; settings = {ATTRIBUTES = (); }; }; - 99F0A9B2AFE5ABDCBFC04510 /* mtpRPC.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 89F92B278CA31C393E245056 /* mtpRPC.cpp */; settings = {ATTRIBUTES = (); }; }; + 99F0A9B2AFE5ABDCBFC04510 /* rpc_sender.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 89F92B278CA31C393E245056 /* rpc_sender.cpp */; settings = {ATTRIBUTES = (); }; }; 9A0D5DDC7816FC2538EB6A96 /* moc_window.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6B46A0EE3C3B9D3B5A24946E /* moc_window.cpp */; settings = {ATTRIBUTES = (); }; }; - 9A523F51135FD4E2464673A6 /* moc_mtpSession.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 63AF8520023B4EA40306CB03 /* moc_mtpSession.cpp */; settings = {ATTRIBUTES = (); }; }; + 9A523F51135FD4E2464673A6 /* moc_session.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 63AF8520023B4EA40306CB03 /* moc_session.cpp */; settings = {ATTRIBUTES = (); }; }; 9D294F23E02CFDF22C288382 /* moc_emojibox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0C0DC15EB416789673526AA5 /* moc_emojibox.cpp */; settings = {ATTRIBUTES = (); }; }; 9F33AC0693BC81B27D8F518D /* Qt5Gui in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 04391BE7A8B9D811E255100A /* Qt5Gui */; }; A0A6B97F7DBEC81004EC9461 /* confirmbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6610564B876E47D289A596DB /* confirmbox.cpp */; settings = {ATTRIBUTES = (); }; }; A24E4B5B683764E07683ECEC /* moc_mainwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 3A220FD1AE5AD9FE3DC073A4 /* moc_mainwidget.cpp */; settings = {ATTRIBUTES = (); }; }; - A297B1E3CE33CC501DFEDB6E /* mtpSession.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0FBED3C6654EA3753EB39831 /* mtpSession.cpp */; settings = {ATTRIBUTES = (); }; }; + A297B1E3CE33CC501DFEDB6E /* session.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0FBED3C6654EA3753EB39831 /* session.cpp */; settings = {ATTRIBUTES = (); }; }; A3F8F2284013928A02AE5C38 /* qwbmp in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 8CF51323544B886B8F4A2232 /* qwbmp */; }; A469EC9C4C367E0B773A9BB7 /* moc_settingswidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 93AFE74928551FC3D7E8390B /* moc_settingswidget.cpp */; settings = {ATTRIBUTES = (); }; }; A9563D9C9FD0D76FAAF1CA96 /* qdds in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = D3D1BE0BEA3AEE0551AD39AC /* qdds */; }; @@ -184,10 +184,10 @@ B0B88EFE444C0DE673389418 /* moc_flatbutton.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = C9FFCCE4FCB845744636795F /* moc_flatbutton.cpp */; settings = {ATTRIBUTES = (); }; }; B2F5B08BFFBBE7E37D3863BB /* moc_button.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 46292F489228B60010794CE4 /* moc_button.cpp */; settings = {ATTRIBUTES = (); }; }; B460F624007324313696BE86 /* QuartzCore.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 7EC00404ACD5AB0E97726B0E /* QuartzCore.framework */; }; - B6346B66B0A2228A91D8A5D9 /* mtpDC.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 315C7FACB4A9E18AA95486CA /* mtpDC.cpp */; settings = {ATTRIBUTES = (); }; }; - B780F9E21269259B90A1F32A /* moc_mtpDC.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 2C540BAEABD7F9B5FA11008E /* moc_mtpDC.cpp */; settings = {ATTRIBUTES = (); }; }; + B6346B66B0A2228A91D8A5D9 /* dcenter.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 315C7FACB4A9E18AA95486CA /* dcenter.cpp */; settings = {ATTRIBUTES = (); }; }; + B780F9E21269259B90A1F32A /* moc_dcenter.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 2C540BAEABD7F9B5FA11008E /* moc_dcenter.cpp */; settings = {ATTRIBUTES = (); }; }; B78304F135DEF1F7A68393A6 /* CoreMedia.framework in Link Binary With Libraries */ = {isa = PBXBuildFile; fileRef = 547CCADBD1CC5050167EF948 /* CoreMedia.framework */; }; - B8CA3E1E11A7E0E7DF9E1CDE /* mtpFileLoader.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 01D6341DC31FE5997F7BB159 /* mtpFileLoader.cpp */; settings = {ATTRIBUTES = (); }; }; + B8CA3E1E11A7E0E7DF9E1CDE /* file_download.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 01D6341DC31FE5997F7BB159 /* file_download.cpp */; settings = {ATTRIBUTES = (); }; }; B8DA82DA1B195A933A0805E7 /* sysbuttons.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6B90F69947805586A6FAE80E /* sysbuttons.cpp */; settings = {ATTRIBUTES = (); }; }; B91D13BCC3963CB9C12D24A4 /* flatcheckbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = AF4585F593B1C9D0D4FD061C /* flatcheckbox.cpp */; settings = {ATTRIBUTES = (); }; }; B99CCE43EEFCD3E18F6D16D1 /* settingswidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8CCCACE96535180FEB557712 /* settingswidget.cpp */; settings = {ATTRIBUTES = (); }; }; @@ -211,7 +211,7 @@ D846C6F212B438DC2FD5FF71 /* moc_dialogswidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 3B3ED09AB00290D78CF1181B /* moc_dialogswidget.cpp */; settings = {ATTRIBUTES = (); }; }; D87463318C8E5211C8C8670A /* stdafx.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 5A5431331A13AA7B07414240 /* stdafx.cpp */; settings = {ATTRIBUTES = (); }; }; DE6A34CA3A5561888FA01AF1 /* flatlabel.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 763ED3C6815ED6C89E352652 /* flatlabel.cpp */; settings = {ATTRIBUTES = (); }; }; - DF259E9677CC63AF8754032B /* mtpConnection.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = B8D9AFA42E8633154A9817A2 /* mtpConnection.cpp */; settings = {ATTRIBUTES = (); }; }; + DF259E9677CC63AF8754032B /* connection.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = B8D9AFA42E8633154A9817A2 /* connection.cpp */; settings = {ATTRIBUTES = (); }; }; DF36EA42D67ED39E58CB7DF9 /* settings.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 8A28F7789408AA839F48A5F2 /* settings.cpp */; settings = {ATTRIBUTES = (); }; }; E3194392BD6D0726F75FA72E /* mainwidget.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 047DAFB0A7DE92C63033A43C /* mainwidget.cpp */; settings = {ATTRIBUTES = (); }; }; E3D7A5CA24541D5DB69D6606 /* images.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 6A510365F9F6367ECB0DB065 /* images.cpp */; settings = {ATTRIBUTES = (); }; }; @@ -260,7 +260,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 01D6341DC31FE5997F7BB159 /* mtpFileLoader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mtpFileLoader.cpp; path = SourceFiles/mtproto/mtpFileLoader.cpp; sourceTree = ""; }; + 01D6341DC31FE5997F7BB159 /* file_download.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = file_download.cpp; path = SourceFiles/mtproto/file_download.cpp; sourceTree = ""; }; 032C1BF3E727B450A4851D48 /* emojibox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = emojibox.h; path = SourceFiles/boxes/emojibox.h; sourceTree = ""; }; 04391BE7A8B9D811E255100A /* Qt5Gui */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = Qt5Gui; path = "/usr/local/Qt-5.5.1/lib/libQt5Gui$(QT_LIBRARY_SUFFIX).a"; sourceTree = ""; }; 047DAFB0A7DE92C63033A43C /* mainwidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mainwidget.cpp; path = SourceFiles/mainwidget.cpp; sourceTree = ""; }; @@ -276,7 +276,7 @@ 0710C9FC1B0B9376001B4272 /* stickersetbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stickersetbox.cpp; path = SourceFiles/boxes/stickersetbox.cpp; sourceTree = SOURCE_ROOT; }; 0710C9FD1B0B9376001B4272 /* stickersetbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stickersetbox.h; path = SourceFiles/boxes/stickersetbox.h; sourceTree = SOURCE_ROOT; }; 0710CA041B0B9404001B4272 /* moc_stickersetbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_stickersetbox.cpp; path = GeneratedFiles/Debug/moc_stickersetbox.cpp; sourceTree = SOURCE_ROOT; }; - 07129D691C16D230002DC495 /* mtpAuthKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mtpAuthKey.cpp; path = SourceFiles/mtproto/mtpAuthKey.cpp; sourceTree = SOURCE_ROOT; }; + 07129D691C16D230002DC495 /* auth_key.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = auth_key.cpp; path = SourceFiles/mtproto/auth_key.cpp; sourceTree = SOURCE_ROOT; }; 07129D6C1C16D245002DC495 /* facades.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = facades.cpp; path = SourceFiles/facades.cpp; sourceTree = SOURCE_ROOT; }; 07129D6D1C16D245002DC495 /* facades.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = facades.h; path = SourceFiles/facades.h; sourceTree = SOURCE_ROOT; }; 071AD86B1C5E8536008C9E90 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = ThirdParty/minizip/crypt.h; sourceTree = SOURCE_ROOT; }; @@ -349,8 +349,8 @@ 07D7EABF1A597DD400838BA2 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; 07D7EAC01A597DD500838BA2 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; 07D7EAC11A597DD600838BA2 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; - 07D8509219F5C97E00623D75 /* mtpCoreTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mtpCoreTypes.cpp; path = SourceFiles/mtproto/mtpCoreTypes.cpp; sourceTree = SOURCE_ROOT; }; - 07D8509319F5C97E00623D75 /* mtpScheme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mtpScheme.cpp; path = SourceFiles/mtproto/mtpScheme.cpp; sourceTree = SOURCE_ROOT; }; + 07D8509219F5C97E00623D75 /* core_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = core_types.cpp; path = SourceFiles/mtproto/core_types.cpp; sourceTree = SOURCE_ROOT; }; + 07D8509319F5C97E00623D75 /* scheme_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = scheme_auto.cpp; path = SourceFiles/mtproto/scheme_auto.cpp; sourceTree = SOURCE_ROOT; }; 07D8509719F8320900623D75 /* usernamebox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = usernamebox.cpp; path = SourceFiles/boxes/usernamebox.cpp; sourceTree = SOURCE_ROOT; }; 07D8509819F8320900623D75 /* usernamebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = usernamebox.h; path = SourceFiles/boxes/usernamebox.h; sourceTree = SOURCE_ROOT; }; 07D8510719F8340A00623D75 /* moc_usernamebox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_usernamebox.cpp; path = GeneratedFiles/Debug/moc_usernamebox.cpp; sourceTree = SOURCE_ROOT; }; @@ -382,7 +382,7 @@ 0CAA815FFFEDCD84808E11F5 /* logs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = logs.h; path = SourceFiles/logs.h; sourceTree = ""; }; 0ECF1EB9BF3786A16731F685 /* emojibox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = emojibox.cpp; path = SourceFiles/boxes/emojibox.cpp; sourceTree = ""; }; 0F8FFD87AEBAC448568570DC /* images.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = images.h; path = SourceFiles/gui/images.h; sourceTree = ""; }; - 0FBED3C6654EA3753EB39831 /* mtpSession.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mtpSession.cpp; path = SourceFiles/mtproto/mtpSession.cpp; sourceTree = ""; }; + 0FBED3C6654EA3753EB39831 /* session.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = session.cpp; path = SourceFiles/mtproto/session.cpp; sourceTree = ""; }; 0FC38EE7F29EF895925A2C49 /* style_core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = style_core.h; path = SourceFiles/gui/style_core.h; sourceTree = ""; }; 1080B6D395843B8F76A2E45E /* moc_title.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_title.cpp; path = GeneratedFiles/Debug/moc_title.cpp; sourceTree = ""; }; 111BBEE3D1432C3B517FD539 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdds.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qdds.pri"; sourceTree = ""; }; @@ -416,11 +416,11 @@ 25CA12A22B83B0B038C5B5DE /* langloaderplain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = langloaderplain.h; path = SourceFiles/langloaderplain.h; sourceTree = ""; }; 26083D8E535AFF927591E1A5 /* moc_contactsbox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_contactsbox.cpp; path = GeneratedFiles/Debug/moc_contactsbox.cpp; sourceTree = ""; }; 26B83A58EE268598E703875D /* history.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = history.cpp; path = SourceFiles/history.cpp; sourceTree = ""; }; - 27E7471A4EC90E84353AA16F /* mtpCoreTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpCoreTypes.h; path = SourceFiles/mtproto/mtpCoreTypes.h; sourceTree = ""; }; + 27E7471A4EC90E84353AA16F /* core_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = core_types.h; path = SourceFiles/mtproto/core_types.h; sourceTree = ""; }; 28BD0D10214709D95B161E24 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_multimediawidgets.pri"; sourceTree = ""; }; 293C8DEEE270847AC20E70F9 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_network.pri"; sourceTree = ""; }; 2BB2A1BB8DB0993F78F4E3C7 /* title.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = title.cpp; path = SourceFiles/title.cpp; sourceTree = ""; }; - 2C540BAEABD7F9B5FA11008E /* moc_mtpDC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_mtpDC.cpp; path = GeneratedFiles/Debug/moc_mtpDC.cpp; sourceTree = ""; }; + 2C540BAEABD7F9B5FA11008E /* moc_dcenter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_dcenter.cpp; path = GeneratedFiles/Debug/moc_dcenter.cpp; sourceTree = ""; }; 2C99425D7670941EAF07B453 /* moc_historywidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_historywidget.cpp; path = GeneratedFiles/Debug/moc_historywidget.cpp; sourceTree = ""; }; 2E48BB382B895A5ACD79AF9F /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_bluetooth_private.pri"; sourceTree = ""; }; 2E6D9B1D2743D24E31B0B284 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns.pri"; sourceTree = ""; }; @@ -428,7 +428,7 @@ 301BB513F2F5D447B3BF22DF /* window.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = window.h; path = SourceFiles/window.h; sourceTree = ""; }; 311004331A04F3D69C98643C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_serialport_private.pri"; sourceTree = ""; }; 31120EDB269DFF13E1D49847 /* qicns */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qicns; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqicns$(QT_LIBRARY_SUFFIX).a"; sourceTree = ""; }; - 315C7FACB4A9E18AA95486CA /* mtpDC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mtpDC.cpp; path = SourceFiles/mtproto/mtpDC.cpp; sourceTree = ""; }; + 315C7FACB4A9E18AA95486CA /* dcenter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = dcenter.cpp; path = SourceFiles/mtproto/dcenter.cpp; sourceTree = ""; }; 33F165B1DB8CBF182C56FAB5 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_macextras_private.pri"; sourceTree = ""; }; 346287C9E754E7C458153F03 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwbmp.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwbmp.pri"; sourceTree = ""; }; 34E1DF19219C52D7DB20224A /* flatlabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = flatlabel.h; path = SourceFiles/gui/flatlabel.h; sourceTree = ""; }; @@ -455,7 +455,7 @@ 48003469151B9DDE82E851FB /* moc_profilewidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_profilewidget.cpp; path = GeneratedFiles/Debug/moc_profilewidget.cpp; sourceTree = ""; }; 4AF15B5A0A43EB62D6DAF211 /* libexif.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexif.a; path = "../../Libraries/libexif-0.6.20/libexif/.libs/libexif.a"; sourceTree = ""; }; 4C6C71914B1926119120DACD /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_enginio_private.pri"; sourceTree = ""; }; - 4D1099F2D3696E8A0E17D37D /* mtpSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpSession.h; path = SourceFiles/mtproto/mtpSession.h; sourceTree = ""; }; + 4D1099F2D3696E8A0E17D37D /* session.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = session.h; path = SourceFiles/mtproto/session.h; sourceTree = ""; }; 4D504A849F15EB58E53A4E5F /* title.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = title.h; path = SourceFiles/title.h; sourceTree = ""; }; 4D55B83DFDFE3D492CDBD27A /* button.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = button.cpp; path = SourceFiles/gui/button.cpp; sourceTree = ""; }; 4D765E1B1EA6C757220C63E7 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; @@ -466,7 +466,7 @@ 51355181C0E6689B0B764543 /* connectionbox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = connectionbox.cpp; path = SourceFiles/boxes/connectionbox.cpp; sourceTree = ""; }; 5271C394C1E7646D117CE67E /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = SourceFiles/main.cpp; sourceTree = ""; }; 547CCADBD1CC5050167EF948 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = /System/Library/Frameworks/CoreMedia.framework; sourceTree = ""; }; - 5591A965D1DC024FBDB40151 /* moc_mtpFileLoader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_mtpFileLoader.cpp; path = GeneratedFiles/Debug/moc_mtpFileLoader.cpp; sourceTree = ""; }; + 5591A965D1DC024FBDB40151 /* moc_file_download.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_file_download.cpp; path = GeneratedFiles/Debug/moc_file_download.cpp; sourceTree = ""; }; 5597304BEC94BFB9EAAEBC4B /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_openglextensions_private.pri"; sourceTree = ""; }; 55A654A2EE8554FF062742B8 /* moc_twidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_twidget.cpp; path = GeneratedFiles/Debug/moc_twidget.cpp; sourceTree = ""; }; 55B4A93DD455EED91C899A8E /* dialogswidget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dialogswidget.h; path = SourceFiles/dialogswidget.h; sourceTree = ""; }; @@ -485,7 +485,7 @@ 6102C69805B6398AF6FA5BEB /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml_private.pri"; sourceTree = ""; }; 61C679D8B4B332026BD34200 /* introphone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = introphone.cpp; path = SourceFiles/intro/introphone.cpp; sourceTree = ""; }; 62807F13DBD204D0716143AD /* Telegram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Telegram.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 63AF8520023B4EA40306CB03 /* moc_mtpSession.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_mtpSession.cpp; path = GeneratedFiles/Debug/moc_mtpSession.cpp; sourceTree = ""; }; + 63AF8520023B4EA40306CB03 /* moc_session.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_session.cpp; path = GeneratedFiles/Debug/moc_session.cpp; sourceTree = ""; }; 63E722139886C87BC82DBDF5 /* /usr/local/Qt-5.5.1/mkspecs/macx-clang/qmake.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/macx-clang/qmake.conf"; sourceTree = ""; }; 6532A0DC7EFE446967682E83 /* moc_downloadpathbox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_downloadpathbox.cpp; path = GeneratedFiles/Debug/moc_downloadpathbox.cpp; sourceTree = ""; }; 6610564B876E47D289A596DB /* confirmbox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = confirmbox.cpp; path = SourceFiles/boxes/confirmbox.cpp; sourceTree = ""; }; @@ -498,7 +498,7 @@ 6B90F69947805586A6FAE80E /* sysbuttons.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = sysbuttons.cpp; path = SourceFiles/sysbuttons.cpp; sourceTree = ""; }; 6C08BFC27C4C303A3A5181DB /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_printsupport.pri"; sourceTree = ""; }; 6C86B6E6AB1857B735B720D6 /* layerwidget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = layerwidget.h; path = SourceFiles/layerwidget.h; sourceTree = ""; }; - 6D50D70712776D7ED3B00E5C /* mtp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mtp.cpp; path = SourceFiles/mtproto/mtp.cpp; sourceTree = ""; }; + 6D50D70712776D7ED3B00E5C /* facade.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = facade.cpp; path = SourceFiles/mtproto/facade.cpp; sourceTree = ""; }; 6E1859D714E4471E053D90C9 /* scrollarea.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = scrollarea.cpp; path = SourceFiles/gui/scrollarea.cpp; sourceTree = ""; }; 6E67D23B15FC4B628DB2E0B2 /* /usr/local/Qt-5.5.1/mkspecs/qdevice.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/qdevice.pri"; sourceTree = ""; }; 6E8FD0ED1B60D43929944CD2 /* text.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = text.h; path = SourceFiles/gui/text.h; sourceTree = ""; }; @@ -506,7 +506,7 @@ 723F90793B2C195E2CCB2233 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 73737DC91E390C4AB18FB595 /* pspecific_mac_p.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = pspecific_mac_p.mm; path = SourceFiles/pspecific_mac_p.mm; sourceTree = ""; }; 74772222DA764BE4623EAC5D /* moc_pspecific_mac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_pspecific_mac.cpp; path = GeneratedFiles/Debug/moc_pspecific_mac.cpp; sourceTree = ""; }; - 748F1BCCBEEB3675768960FB /* mtpAuthKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpAuthKey.h; path = SourceFiles/mtproto/mtpAuthKey.h; sourceTree = ""; }; + 748F1BCCBEEB3675768960FB /* auth_key.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = auth_key.h; path = SourceFiles/mtproto/auth_key.h; sourceTree = ""; }; 74C1C232DFAA71028A0412CA /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmultimedia_m3u.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmultimedia_m3u.pri"; sourceTree = ""; }; 763ED3C6815ED6C89E352652 /* flatlabel.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = flatlabel.cpp; path = SourceFiles/gui/flatlabel.cpp; sourceTree = ""; }; 77FF486B1F9BCD55A8A3F35D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent.pri"; sourceTree = ""; }; @@ -516,7 +516,7 @@ 7CDE9D7CB2C729BC3612372B /* addcontactbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = addcontactbox.h; path = SourceFiles/boxes/addcontactbox.h; sourceTree = ""; }; 7D075A915E8739C1B6BC5F43 /* types.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = types.cpp; path = SourceFiles/types.cpp; sourceTree = ""; }; 7D28E9003CE64D8A7F2E292E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_concurrent_private.pri"; sourceTree = ""; }; - 7DBFC0B5EAF874BA10E3D603 /* mtpScheme.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpScheme.h; path = SourceFiles/mtproto/mtpScheme.h; sourceTree = ""; }; + 7DBFC0B5EAF874BA10E3D603 /* scheme_auto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = scheme_auto.h; path = SourceFiles/mtproto/scheme_auto.h; sourceTree = ""; }; 7DE30A90667C03C4F91A2A91 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_sql.pri"; sourceTree = ""; }; 7EC00404ACD5AB0E97726B0E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; 7ECCC1F9442988B4F2707CC1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_core.pri"; sourceTree = ""; }; @@ -532,11 +532,11 @@ 87A4C1983FD641360BF80A02 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblewidgets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtaccessiblewidgets.pri"; sourceTree = ""; }; 87EEF25EE25CF21572D1438C /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets_private.pri"; sourceTree = ""; }; 8849E60AEC7DB97A475C17EA /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_testlib_private.pri"; sourceTree = ""; }; - 8880067F9BFD46108777E134 /* mtp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtp.h; path = SourceFiles/mtproto/mtp.h; sourceTree = ""; }; + 8880067F9BFD46108777E134 /* facade.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = facade.h; path = SourceFiles/mtproto/facade.h; sourceTree = ""; }; 8918F4B71ED5FC138AFD3F70 /* moc_scrollarea.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_scrollarea.cpp; path = GeneratedFiles/Debug/moc_scrollarea.cpp; sourceTree = ""; }; 892D36BEF797BA4AF48D378A /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_dummy.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtsensors_dummy.pri"; sourceTree = ""; }; 89863CCAF1D29037AE95755D /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_declarative_private.pri"; sourceTree = ""; }; - 89F92B278CA31C393E245056 /* mtpRPC.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mtpRPC.cpp; path = SourceFiles/mtproto/mtpRPC.cpp; sourceTree = ""; }; + 89F92B278CA31C393E245056 /* rpc_sender.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = rpc_sender.cpp; path = SourceFiles/mtproto/rpc_sender.cpp; sourceTree = ""; }; 8A04A4A3625204D12A1207F6 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc.pri"; sourceTree = ""; }; 8A28F7789408AA839F48A5F2 /* settings.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = settings.cpp; path = SourceFiles/settings.cpp; sourceTree = ""; }; 8A9D926C08392F7A9BC83B0C /* fileuploader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = fileuploader.h; path = SourceFiles/fileuploader.h; sourceTree = ""; }; @@ -555,11 +555,11 @@ 8F500B5166907B6D9A7C3E3D /* qico */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qico; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqico$(QT_LIBRARY_SUFFIX).a"; sourceTree = ""; }; 8F572030CE9AB8CC5F672201 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_platformsupport_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_platformsupport_private.pri"; sourceTree = ""; }; 8F97C9CAE38CA3AFAC0B3953 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_websockets.pri"; sourceTree = ""; }; - 924D4939FD169BB4B8AEB1C9 /* moc_mtp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_mtp.cpp; path = GeneratedFiles/Debug/moc_mtp.cpp; sourceTree = ""; }; + 924D4939FD169BB4B8AEB1C9 /* moc_facade.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_facade.cpp; path = GeneratedFiles/Debug/moc_facade.cpp; sourceTree = ""; }; 93AFE74928551FC3D7E8390B /* moc_settingswidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_settingswidget.cpp; path = GeneratedFiles/Debug/moc_settingswidget.cpp; sourceTree = ""; }; 946BEA667170DC1A7A8F9DB0 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmng.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmng.pri"; sourceTree = ""; }; - 963123025C466CB8DD9CF4AF /* mtpConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpConnection.h; path = SourceFiles/mtproto/mtpConnection.h; sourceTree = ""; }; - 96ACDDE3DCB798B97F9EA2F4 /* mtpFileLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpFileLoader.h; path = SourceFiles/mtproto/mtpFileLoader.h; sourceTree = ""; }; + 963123025C466CB8DD9CF4AF /* connection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = connection.h; path = SourceFiles/mtproto/connection.h; sourceTree = ""; }; + 96ACDDE3DCB798B97F9EA2F4 /* file_download.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = file_download.h; path = SourceFiles/mtproto/file_download.h; sourceTree = ""; }; 9742F24EE18EA44D52824F1E /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 974DB34EEB8F83B91614C0B0 /* logs.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = logs.cpp; path = SourceFiles/logs.cpp; sourceTree = ""; }; 99B8D38F7F5858601230911E /* style_auto.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = style_auto.cpp; path = GeneratedFiles/style_auto.cpp; sourceTree = ""; }; @@ -607,15 +607,15 @@ B26239063A068F800A2C95F4 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwebp.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qwebp.pri"; sourceTree = ""; }; B3062303CE8F4EB9325CB3DC /* emoji_config.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = emoji_config.cpp; path = SourceFiles/gui/emoji_config.cpp; sourceTree = ""; }; B382B645B34234E451AE5D94 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_qml.pri"; sourceTree = ""; }; - B3D42654F18B1FE49512C404 /* mtpDC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpDC.h; path = SourceFiles/mtproto/mtpDC.h; sourceTree = ""; }; + B3D42654F18B1FE49512C404 /* dcenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dcenter.h; path = SourceFiles/mtproto/dcenter.h; sourceTree = ""; }; B518DA4EE7376002AFC71FD5 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_uitools_private.pri"; sourceTree = ""; }; B51B01657BFE9EAEF5590561 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_nfc_private.pri"; sourceTree = ""; }; B678DA730B4ECE863AD631AE /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qminimal.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qminimal.pri"; sourceTree = ""; }; - B714EA71A09A832FAA846A0A /* moc_mtpConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_mtpConnection.cpp; path = GeneratedFiles/Debug/moc_mtpConnection.cpp; sourceTree = ""; }; + B714EA71A09A832FAA846A0A /* moc_connection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_connection.cpp; path = GeneratedFiles/Debug/moc_connection.cpp; sourceTree = ""; }; B8525798C5AA7D7C6D68E1B3 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_qtquick2.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_qtquick2.pri"; sourceTree = ""; }; B88236FC554B694F618D848C /* moc_sysbuttons.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = moc_sysbuttons.cpp; path = GeneratedFiles/Debug/moc_sysbuttons.cpp; sourceTree = ""; }; B8C1F6C965A7A14FBA8D4518 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmedia_audioengine.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtmedia_audioengine.pri"; sourceTree = ""; }; - B8D9AFA42E8633154A9817A2 /* mtpConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mtpConnection.cpp; path = SourceFiles/mtproto/mtpConnection.cpp; sourceTree = ""; }; + B8D9AFA42E8633154A9817A2 /* connection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = connection.cpp; path = SourceFiles/mtproto/connection.cpp; sourceTree = ""; }; B97D4DB97FE881648644211A /* downloadpathbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = downloadpathbox.h; path = SourceFiles/boxes/downloadpathbox.h; sourceTree = ""; }; BB1602EA641643DE565005B1 /* twidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = twidget.cpp; path = SourceFiles/gui/twidget.cpp; sourceTree = ""; }; BD22EFEFCC02644B1883CE19 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtiff.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qtiff.pri"; sourceTree = ""; }; @@ -681,7 +681,6 @@ EB1F99FD112917157F3C3F6E /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qicns.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qicns.pri"; sourceTree = ""; }; EB29AC635054C09EFA749AE1 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qmldbg_tcp.pri"; sourceTree = ""; }; EBD39B69F368CEEAC360A16D /* /usr/local/Qt-5.5.1/mkspecs/common/mac.conf */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/common/mac.conf"; sourceTree = ""; }; - EC4D4A7398CAAD47386D9CA0 /* mtpSessionImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpSessionImpl.h; path = SourceFiles/mtproto/mtpSessionImpl.h; sourceTree = ""; }; EE03BC5CA4628A6D6BEB0122 /* qcorewlanbearer */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qcorewlanbearer; path = "/usr/local/Qt-5.5.1/plugins/bearer/libqcorewlanbearer$(QT_LIBRARY_SUFFIX).a"; sourceTree = ""; }; EF1AD6A66D0C28A6A15E2C30 /* introphone.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = introphone.h; path = SourceFiles/intro/introphone.h; sourceTree = ""; }; F0681BC551FC8A2B132FC646 /* qjp2 */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = qjp2; path = "/usr/local/Qt-5.5.1/plugins/imageformats/libqjp2$(QT_LIBRARY_SUFFIX).a"; sourceTree = ""; }; @@ -697,7 +696,7 @@ F80095A026AF9453E9C2B8BD /* settingswidget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = settingswidget.h; path = SourceFiles/settingswidget.h; sourceTree = ""; }; F83F87F8A60C9DF666911D42 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvg.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_plugin_qsvg.pri"; sourceTree = ""; }; F9BEAA743A908603687DA204 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns_private.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_xmlpatterns_private.pri"; sourceTree = ""; }; - FB61F72601D91BF3AC730D20 /* mtpRPC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mtpRPC.h; path = SourceFiles/mtproto/mtpRPC.h; sourceTree = ""; }; + FB61F72601D91BF3AC730D20 /* rpc_sender.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = rpc_sender.h; path = SourceFiles/mtproto/rpc_sender.h; sourceTree = ""; }; FCC237CA5AD60B9BA4447615 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; FD944B80F033DFE737D401A2 /* /usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help.pri */ = {isa = PBXFileReference; lastKnownFileType = text; path = "/usr/local/Qt-5.5.1/mkspecs/modules/qt_lib_help.pri"; sourceTree = ""; }; FE8FD20832B4C226E345CFBA /* mainwidget.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = mainwidget.h; path = SourceFiles/mainwidget.h; sourceTree = ""; }; @@ -814,26 +813,25 @@ 1A6AA22F4A758C4B5F5138FB /* mtproto */ = { isa = PBXGroup; children = ( - 6D50D70712776D7ED3B00E5C /* mtp.cpp */, - 07129D691C16D230002DC495 /* mtpAuthKey.cpp */, - B8D9AFA42E8633154A9817A2 /* mtpConnection.cpp */, - 07D8509219F5C97E00623D75 /* mtpCoreTypes.cpp */, - 315C7FACB4A9E18AA95486CA /* mtpDC.cpp */, - 01D6341DC31FE5997F7BB159 /* mtpFileLoader.cpp */, - 89F92B278CA31C393E245056 /* mtpRPC.cpp */, - 07D8509319F5C97E00623D75 /* mtpScheme.cpp */, - 0FBED3C6654EA3753EB39831 /* mtpSession.cpp */, - EC4D4A7398CAAD47386D9CA0 /* mtpSessionImpl.h */, - 8880067F9BFD46108777E134 /* mtp.h */, - 748F1BCCBEEB3675768960FB /* mtpAuthKey.h */, - 963123025C466CB8DD9CF4AF /* mtpConnection.h */, - 27E7471A4EC90E84353AA16F /* mtpCoreTypes.h */, - B3D42654F18B1FE49512C404 /* mtpDC.h */, - 96ACDDE3DCB798B97F9EA2F4 /* mtpFileLoader.h */, + 6D50D70712776D7ED3B00E5C /* facade.cpp */, + 07129D691C16D230002DC495 /* auth_key.cpp */, + B8D9AFA42E8633154A9817A2 /* connection.cpp */, + 07D8509219F5C97E00623D75 /* core_types.cpp */, + 315C7FACB4A9E18AA95486CA /* dcenter.cpp */, + 01D6341DC31FE5997F7BB159 /* file_download.cpp */, + 89F92B278CA31C393E245056 /* rpc_sender.cpp */, + 07D8509319F5C97E00623D75 /* scheme_auto.cpp */, + 0FBED3C6654EA3753EB39831 /* session.cpp */, + 8880067F9BFD46108777E134 /* facade.h */, + 748F1BCCBEEB3675768960FB /* auth_key.h */, + 963123025C466CB8DD9CF4AF /* connection.h */, + 27E7471A4EC90E84353AA16F /* core_types.h */, + B3D42654F18B1FE49512C404 /* dcenter.h */, + 96ACDDE3DCB798B97F9EA2F4 /* file_download.h */, A3622760CEC6D6827A25E710 /* rsa_public_key.h */, - FB61F72601D91BF3AC730D20 /* mtpRPC.h */, - 7DBFC0B5EAF874BA10E3D603 /* mtpScheme.h */, - 4D1099F2D3696E8A0E17D37D /* mtpSession.h */, + FB61F72601D91BF3AC730D20 /* rpc_sender.h */, + 7DBFC0B5EAF874BA10E3D603 /* scheme_auto.h */, + 4D1099F2D3696E8A0E17D37D /* session.h */, ); name = mtproto; sourceTree = ""; @@ -1177,11 +1175,11 @@ B88236FC554B694F618D848C /* moc_sysbuttons.cpp */, 1080B6D395843B8F76A2E45E /* moc_title.cpp */, 6B46A0EE3C3B9D3B5A24946E /* moc_window.cpp */, - 924D4939FD169BB4B8AEB1C9 /* moc_mtp.cpp */, - B714EA71A09A832FAA846A0A /* moc_mtpConnection.cpp */, - 2C540BAEABD7F9B5FA11008E /* moc_mtpDC.cpp */, - 5591A965D1DC024FBDB40151 /* moc_mtpFileLoader.cpp */, - 63AF8520023B4EA40306CB03 /* moc_mtpSession.cpp */, + 924D4939FD169BB4B8AEB1C9 /* moc_facade.cpp */, + B714EA71A09A832FAA846A0A /* moc_connection.cpp */, + 2C540BAEABD7F9B5FA11008E /* moc_dcenter.cpp */, + 5591A965D1DC024FBDB40151 /* moc_file_download.cpp */, + 63AF8520023B4EA40306CB03 /* moc_session.cpp */, A1479F94376F9732B57C69DB /* moc_animation.cpp */, 46292F489228B60010794CE4 /* moc_button.cpp */, 9D9F4744B2F9FF22569D4535 /* moc_countryinput.cpp */, @@ -1552,16 +1550,16 @@ 5CE57D44510AB2A11886AB52 /* title.cpp in Compile Sources */, 4078D5D614EB3ECF7F1848C7 /* types.cpp in Compile Sources */, 68FFEB7CA30BF0149161B809 /* window.cpp in Compile Sources */, - 0CB7DE9A54CC9BF86FB7B5CA /* mtp.cpp in Compile Sources */, - DF259E9677CC63AF8754032B /* mtpConnection.cpp in Compile Sources */, + 0CB7DE9A54CC9BF86FB7B5CA /* facade.cpp in Compile Sources */, + DF259E9677CC63AF8754032B /* connection.cpp in Compile Sources */, 074FCB9119D36E60004C6EB2 /* moc_popupmenu.cpp in Compile Sources */, - B6346B66B0A2228A91D8A5D9 /* mtpDC.cpp in Compile Sources */, + B6346B66B0A2228A91D8A5D9 /* dcenter.cpp in Compile Sources */, 0755AEDF1AD12A80004D738A /* moc_sessionsbox.cpp in Compile Sources */, 07129D6E1C16D245002DC495 /* facades.cpp in Compile Sources */, - B8CA3E1E11A7E0E7DF9E1CDE /* mtpFileLoader.cpp in Compile Sources */, + B8CA3E1E11A7E0E7DF9E1CDE /* file_download.cpp in Compile Sources */, 0755AEDD1AD12A80004D738A /* moc_abstractbox.cpp in Compile Sources */, - 99F0A9B2AFE5ABDCBFC04510 /* mtpRPC.cpp in Compile Sources */, - A297B1E3CE33CC501DFEDB6E /* mtpSession.cpp in Compile Sources */, + 99F0A9B2AFE5ABDCBFC04510 /* rpc_sender.cpp in Compile Sources */, + A297B1E3CE33CC501DFEDB6E /* session.cpp in Compile Sources */, D1FC601FC2F9F3E33F3A14E9 /* animation.cpp in Compile Sources */, 8F65F0D95B1F0CEB859F2FB3 /* boxshadow.cpp in Compile Sources */, D7EF8F129FCCE9AB3F3F081F /* button.cpp in Compile Sources */, @@ -1578,7 +1576,7 @@ 03270F718426CFE84729079E /* flattextarea.cpp in Compile Sources */, E3D7A5CA24541D5DB69D6606 /* images.cpp in Compile Sources */, ADE99904299B99EB6135E8D9 /* scrollarea.cpp in Compile Sources */, - 07129D6A1C16D230002DC495 /* mtpAuthKey.cpp in Compile Sources */, + 07129D6A1C16D230002DC495 /* auth_key.cpp in Compile Sources */, 90085DF442550A0845D5AF37 /* style_core.cpp in Compile Sources */, 074FCB8E19D36851004C6EB2 /* popupmenu.cpp in Compile Sources */, 3AA6E7264581F82856FB37F7 /* text.cpp in Compile Sources */, @@ -1626,18 +1624,18 @@ E97B3CFAB59B49BACFFC5F7C /* moc_title.cpp in Compile Sources */, 07D8510819F8340A00623D75 /* moc_usernamebox.cpp in Compile Sources */, 9A0D5DDC7816FC2538EB6A96 /* moc_window.cpp in Compile Sources */, - 06EABCC49D2EEE4076322BE7 /* moc_mtp.cpp in Compile Sources */, + 06EABCC49D2EEE4076322BE7 /* moc_facade.cpp in Compile Sources */, 0755AEDE1AD12A80004D738A /* moc_intropwdcheck.cpp in Compile Sources */, 07DE92AA1AA4928200A18F6F /* moc_autolockbox.cpp in Compile Sources */, 07B604351B46A20900CA29FE /* moc_playerwidget.cpp in Compile Sources */, - 8F6F5D7F82036331E8C6DAE6 /* moc_mtpConnection.cpp in Compile Sources */, - B780F9E21269259B90A1F32A /* moc_mtpDC.cpp in Compile Sources */, + 8F6F5D7F82036331E8C6DAE6 /* moc_connection.cpp in Compile Sources */, + B780F9E21269259B90A1F32A /* moc_dcenter.cpp in Compile Sources */, 07080BCF1A43588C00741A51 /* lang_auto.cpp in Compile Sources */, 07539B1D1A1416AF00083EFC /* moc_history.cpp in Compile Sources */, - 2A500B102B7CE80F3EB6E13E /* moc_mtpFileLoader.cpp in Compile Sources */, + 2A500B102B7CE80F3EB6E13E /* moc_file_download.cpp in Compile Sources */, 07A6933519927B160099CB9F /* moc_mediaview.cpp in Compile Sources */, 07A69332199277BA0099CB9F /* mediaview.cpp in Compile Sources */, - 9A523F51135FD4E2464673A6 /* moc_mtpSession.cpp in Compile Sources */, + 9A523F51135FD4E2464673A6 /* moc_session.cpp in Compile Sources */, C329997D36D34D568CE16C9A /* moc_animation.cpp in Compile Sources */, B2F5B08BFFBBE7E37D3863BB /* moc_button.cpp in Compile Sources */, 6A8BC88AB464B92706EFE6FF /* moc_countryinput.cpp in Compile Sources */, @@ -1673,9 +1671,9 @@ AC6C131416AEC557C854BA70 /* moc_photosendbox.cpp in Compile Sources */, 0F7872E39EA570249D420912 /* moc_introwidget.cpp in Compile Sources */, 4F27F5F76AA3F78C8CA27339 /* moc_introcode.cpp in Compile Sources */, - 07D8509519F5C97E00623D75 /* mtpScheme.cpp in Compile Sources */, + 07D8509519F5C97E00623D75 /* scheme_auto.cpp in Compile Sources */, 0250AB6761AC71A2E3155EEA /* moc_introphone.cpp in Compile Sources */, - 07D8509419F5C97E00623D75 /* mtpCoreTypes.cpp in Compile Sources */, + 07D8509419F5C97E00623D75 /* core_types.cpp in Compile Sources */, 2EF5D0AC9A18F9FE9B8A1ACA /* moc_introsignup.cpp in Compile Sources */, 8C4BA0DB55E2C40DE5F5E990 /* moc_pspecific_mac.cpp in Compile Sources */, 07DE92AE1AA4928B00A18F6F /* moc_passcodewidget.cpp in Compile Sources */, diff --git a/Telegram/Telegram.xcodeproj/qt_preprocess.mak b/Telegram/Telegram.xcodeproj/qt_preprocess.mak index 4f7753467d..e8b4df3758 100644 --- a/Telegram/Telegram.xcodeproj/qt_preprocess.mak +++ b/Telegram/Telegram.xcodeproj/qt_preprocess.mak @@ -37,8 +37,8 @@ compilers: GeneratedFiles/qrc_telegram.cpp GeneratedFiles/qrc_telegram_emojis.cp GeneratedFiles/Debug/moc_passcodewidget.cpp\ GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp\ GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp\ - GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp\ - GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp\ + GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp\ + GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp\ GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp\ GeneratedFiles/Debug/moc_popupmenu.cpp\ GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp\ @@ -99,9 +99,9 @@ GeneratedFiles/qrc_telegram_mac.cpp: SourceFiles/telegram_mac.qrc \ SourceFiles/art/osxtray.png /usr/local/Qt-5.5.1/bin/rcc -name telegram_mac SourceFiles/telegram_mac.qrc -o GeneratedFiles/qrc_telegram_mac.cpp -compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp +compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp compiler_moc_header_clean: - -$(DEL_FILE) GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_mtp.cpp GeneratedFiles/Debug/moc_mtpConnection.cpp GeneratedFiles/Debug/moc_mtpDC.cpp GeneratedFiles/Debug/moc_mtpFileLoader.cpp GeneratedFiles/Debug/moc_mtpSession.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamedbox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp + -$(DEL_FILE) GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamedbox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp GeneratedFiles/Debug/moc_apiwrap.cpp: SourceFiles/types.h \ SourceFiles/logs.h \ SourceFiles/apiwrap.h @@ -292,50 +292,49 @@ GeneratedFiles/Debug/moc_window.cpp: SourceFiles/title.h \ SourceFiles/window.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/window.h -o GeneratedFiles/Debug/moc_window.cpp -GeneratedFiles/Debug/moc_mtp.cpp: SourceFiles/mtproto/mtpSession.h \ - SourceFiles/mtproto/mtpConnection.h \ - SourceFiles/mtproto/mtpCoreTypes.h \ +GeneratedFiles/Debug/moc_facade.cpp: SourceFiles/mtproto/session.h \ + SourceFiles/mtproto/connection.h \ + SourceFiles/mtproto/core_types.h \ SourceFiles/types.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ SourceFiles/logs.h \ - SourceFiles/mtproto/mtpScheme.h \ + SourceFiles/mtproto/scheme_auto.h \ SourceFiles/mtproto/rsa_public_key.h \ - SourceFiles/mtproto/mtpAuthKey.h \ - SourceFiles/mtproto/mtpDC.h \ - SourceFiles/mtproto/mtpRPC.h \ - SourceFiles/mtproto/mtpFileLoader.h \ - SourceFiles/mtproto/mtpSessionImpl.h \ - SourceFiles/mtproto/mtp.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/mtproto/mtp.h -o GeneratedFiles/Debug/moc_mtp.cpp + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/dcenter.h \ + SourceFiles/mtproto/rpc_sender.h \ + SourceFiles/mtproto/file_download.h \ + SourceFiles/mtproto/facade.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/mtproto/facade.h -o GeneratedFiles/Debug/moc_facade.cpp -GeneratedFiles/Debug/moc_mtpConnection.cpp: SourceFiles/mtproto/mtpCoreTypes.h \ +GeneratedFiles/Debug/moc_connection.cpp: SourceFiles/mtproto/core_types.h \ SourceFiles/types.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ SourceFiles/logs.h \ - SourceFiles/mtproto/mtpScheme.h \ + SourceFiles/mtproto/scheme_auto.h \ SourceFiles/mtproto/rsa_public_key.h \ - SourceFiles/mtproto/mtpAuthKey.h \ - SourceFiles/mtproto/mtpConnection.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/mtproto/mtpConnection.h -o GeneratedFiles/Debug/moc_mtpConnection.cpp + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/connection.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/mtproto/connection.h -o GeneratedFiles/Debug/moc_connection.cpp -GeneratedFiles/Debug/moc_mtpDC.cpp: SourceFiles/mtproto/mtpDC.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/mtproto/mtpDC.h -o GeneratedFiles/Debug/moc_mtpDC.cpp +GeneratedFiles/Debug/moc_dcenter.cpp: SourceFiles/mtproto/dcenter.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/mtproto/dcenter.h -o GeneratedFiles/Debug/moc_dcenter.cpp -GeneratedFiles/Debug/moc_mtpFileLoader.cpp: SourceFiles/mtproto/mtpFileLoader.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/mtproto/mtpFileLoader.h -o GeneratedFiles/Debug/moc_mtpFileLoader.cpp +GeneratedFiles/Debug/moc_file_download.cpp: SourceFiles/mtproto/file_download.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/mtproto/file_download.h -o GeneratedFiles/Debug/moc_file_download.cpp -GeneratedFiles/Debug/moc_mtpSession.cpp: SourceFiles/mtproto/mtpConnection.h \ - SourceFiles/mtproto/mtpCoreTypes.h \ +GeneratedFiles/Debug/moc_session.cpp: SourceFiles/mtproto/connection.h \ + SourceFiles/mtproto/core_types.h \ SourceFiles/types.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ SourceFiles/logs.h \ - SourceFiles/mtproto/mtpScheme.h \ + SourceFiles/mtproto/scheme_auto.h \ SourceFiles/mtproto/rsa_public_key.h \ - SourceFiles/mtproto/mtpAuthKey.h \ - SourceFiles/mtproto/mtpDC.h \ - SourceFiles/mtproto/mtpRPC.h \ - SourceFiles/mtproto/mtpSession.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/mtproto/mtpSession.h -o GeneratedFiles/Debug/moc_mtpSession.cpp + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/dcenter.h \ + SourceFiles/mtproto/rpc_sender.h \ + SourceFiles/mtproto/session.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/mtproto/session.h -o GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp: SourceFiles/types.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ From d9ef8217e576f1698f5c709677b7a28fab266ab9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 11:57:11 +0300 Subject: [PATCH 242/316] moved MTProtoSession and MTProtoConnection to MTP::internal:: namespace --- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/fileuploader.cpp | 10 +- Telegram/SourceFiles/localstorage.cpp | 12 +- Telegram/SourceFiles/logs.cpp | 2 +- Telegram/SourceFiles/mtproto/connection.cpp | 713 +++++++------ Telegram/SourceFiles/mtproto/connection.h | 104 +- Telegram/SourceFiles/mtproto/core_types.h | 60 +- Telegram/SourceFiles/mtproto/dcenter.cpp | 12 +- Telegram/SourceFiles/mtproto/facade.cpp | 999 +++++++++--------- Telegram/SourceFiles/mtproto/facade.h | 356 ++++--- .../SourceFiles/mtproto/file_download.cpp | 10 +- Telegram/SourceFiles/mtproto/session.cpp | 102 +- Telegram/SourceFiles/mtproto/session.h | 40 +- Telegram/SourceFiles/stdafx.h | 3 + Telegram/SourceFiles/window.cpp | 2 +- 15 files changed, 1247 insertions(+), 1180 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 3189c73f8e..e3a454a112 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -910,7 +910,7 @@ void AppClass::killDownloadSessions() { for (QMap::iterator i = killDownloadSessionTimes.begin(); i != killDownloadSessionTimes.end(); ) { if (i.value() <= ms) { for (int j = 0; j < MTPDownloadSessionsCount; ++j) { - MTP::stopSession(MTP::dld(j) + i.key()); + MTP::stopSession(MTP::dldDcId(i.key(), j)); } i = killDownloadSessionTimes.erase(i); } else { diff --git a/Telegram/SourceFiles/fileuploader.cpp b/Telegram/SourceFiles/fileuploader.cpp index a9388ad85c..e16bdc98dd 100644 --- a/Telegram/SourceFiles/fileuploader.cpp +++ b/Telegram/SourceFiles/fileuploader.cpp @@ -103,7 +103,7 @@ void FileUploader::currentFailed() { void FileUploader::killSessions() { for (int i = 0; i < MTPUploadSessionsCount; ++i) { - MTP::stopSession(MTP::upl(i)); + MTP::stopSession(MTP::uplDcId(i)); } } @@ -187,9 +187,9 @@ void FileUploader::sendNext() { } mtpRequestId requestId; if (i->docSize > UseBigFilesFrom) { - requestId = MTP::send(MTPupload_SaveBigFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_int(i->docPartsCount), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl(todc)); + requestId = MTP::send(MTPupload_SaveBigFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_int(i->docPartsCount), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::uplDcId(todc)); } else { - requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl(todc)); + requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(i->id()), MTP_int(i->docSentParts), MTP_string(toSend)), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::uplDcId(todc)); } docRequestsSent.insert(requestId, i->docSentParts); dcMap.insert(requestId, todc); @@ -200,7 +200,7 @@ void FileUploader::sendNext() { } else { UploadFileParts::iterator part = parts.begin(); - mtpRequestId requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(partsOfId), MTP_int(part.key()), MTP_string(part.value())), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::upl(todc)); + mtpRequestId requestId = MTP::send(MTPupload_SaveFilePart(MTP_long(partsOfId), MTP_int(part.key()), MTP_string(part.value())), rpcDone(&FileUploader::partLoaded), rpcFail(&FileUploader::partFailed), MTP::uplDcId(todc)); requestsSent.insert(requestId, part.value()); dcMap.insert(requestId, todc); sentSize += part.value().size(); @@ -246,7 +246,7 @@ void FileUploader::clear() { dcMap.clear(); sentSize = 0; for (int32 i = 0; i < MTPUploadSessionsCount; ++i) { - MTP::stopSession(MTP::upl(i)); + MTP::stopSession(MTP::uplDcId(i)); sentSizes[i] = 0; } killSessionsTimer.stop(); diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 8c4bdcb1e8..102e5a9c00 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -886,7 +886,7 @@ namespace { stream >> dcIdWithShift >> flags >> ip >> port; if (!_checkStreamStatus(stream)) return false; - if (_dcOpts) _dcOpts->insert(dcIdWithShift, MTP::DcOption(dcIdWithShift % _mtp_internal::dcShift, MTPDdcOption::Flags(flags), ip.toUtf8().constData(), port)); + if (_dcOpts) _dcOpts->insert(dcIdWithShift, MTP::DcOption(MTP::bareDcId(dcIdWithShift), MTPDdcOption::Flags(flags), ip.toUtf8().constData(), port)); } break; case dbiChatSizeMax: { @@ -931,7 +931,7 @@ namespace { if (!_checkStreamStatus(stream)) return false; DEBUG_LOG(("MTP Info: key found, dc %1, key: %2").arg(dcId).arg(Logs::mb(key, 256).str())); - dcId = dcId % _mtp_internal::dcShift; + dcId = MTP::bareDcId(dcId); mtpAuthKeyPtr keyPtr(new mtpAuthKey()); keyPtr->setKey(key); keyPtr->setDC(dcId); @@ -2142,7 +2142,7 @@ namespace Local { const BuiltInDc *bdcs = builtInDcs(); for (int i = 0, l = builtInDcsCount(); i < l; ++i) { MTPDdcOption::Flags flags = 0; - int idWithShift = bdcs[i].id + (flags * _mtp_internal::dcShift); + MTP::ShiftedDcId idWithShift = MTP::shiftDcId(bdcs[i].id, flags); 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)); } @@ -2150,7 +2150,7 @@ namespace Local { const BuiltInDc *bdcsipv6 = builtInDcsIPv6(); for (int i = 0, l = builtInDcsCountIPv6(); i < l; ++i) { MTPDdcOption::Flags flags = MTPDdcOption::Flag::f_ipv6; - int idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift); + MTP::ShiftedDcId idWithShift = MTP::shiftDcId(bdcsipv6[i].id, flags); 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)); } @@ -2189,7 +2189,7 @@ namespace Local { const BuiltInDc *bdcs = builtInDcs(); for (int i = 0, l = builtInDcsCount(); i < l; ++i) { MTPDdcOption::Flags flags = 0; - int idWithShift = bdcs[i].id + (flags * _mtp_internal::dcShift); + MTP::ShiftedDcId idWithShift = MTP::shiftDcId(bdcs[i].id, flags); 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)); } @@ -2197,7 +2197,7 @@ namespace Local { const BuiltInDc *bdcsipv6 = builtInDcsIPv6(); for (int i = 0, l = builtInDcsCountIPv6(); i < l; ++i) { MTPDdcOption::Flags flags = MTPDdcOption::Flag::f_ipv6; - int idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift); + MTP::ShiftedDcId idWithShift = MTP::shiftDcId(bdcsipv6[i].id, flags); 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)); } diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 612eebff15..371c8e20b5 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -83,7 +83,7 @@ QString _logsEntryStart() { QDateTime tm(QDateTime::currentDateTime()); QThread *thread = QThread::currentThread(); - MTPThread *mtpThread = qobject_cast(thread); + MTP::internal::Thread *mtpThread = qobject_cast(thread); uint threadId = mtpThread ? mtpThread->getThreadId() : 0; return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, QChar('0'))).arg(++index, 7, 10, QChar('0')); diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index ab307b48a0..a5cb1d6bfd 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -36,6 +36,8 @@ using std::string; namespace MTP { namespace internal { +namespace { + bool parsePQ(const string &pqStr, string &pStr, string &qStr) { if (pqStr.length() > 8) return false; // more than 64 bit pq @@ -262,7 +264,7 @@ private: BN_CTX *ctx; }; -typedef QMap RSAPublicKeys; +typedef QMap RSAPublicKeys; RSAPublicKeys InitRSAPublicKeys() { DEBUG_LOG(("MTP Info: RSA public keys list creation")); @@ -283,30 +285,29 @@ RSAPublicKeys InitRSAPublicKeys() { return result; } -} // namespace internal -} // namespace MTP +} // namespace -uint32 MTPThreadIdIncrement = 0; +uint32 ThreadIdIncrement = 0; -MTPThread::MTPThread() : QThread(0) -, _threadId(++MTPThreadIdIncrement) { +Thread::Thread() : QThread(nullptr) +, _threadId(++ThreadIdIncrement) { } -uint32 MTPThread::getThreadId() const { +uint32 Thread::getThreadId() const { return _threadId; } -MTPThread::~MTPThread() { +Thread::~Thread() { } -MTProtoConnection::MTProtoConnection() : thread(nullptr), data(nullptr) { +Connection::Connection() : thread(nullptr), data(nullptr) { } -int32 MTProtoConnection::start(MTPSessionData *sessionData, int32 dc) { +int32 Connection::start(SessionData *sessionData, int32 dc) { t_assert(thread == nullptr && data == nullptr); - thread = new MTPThread(); - data = new MTProtoConnectionPrivate(thread, this, sessionData, dc); + thread = new Thread(); + data = new ConnectionPrivate(thread, this, sessionData, dc); dc = data->getDC(); if (!dc) { @@ -321,15 +322,15 @@ int32 MTProtoConnection::start(MTPSessionData *sessionData, int32 dc) { return dc; } -void MTProtoConnection::kill() { +void Connection::kill() { t_assert(data != nullptr && thread != nullptr); data->stop(); data = nullptr; // will be deleted in thread::finished signal thread->quit(); - _mtp_internal::queueQuittingConnection(this); + queueQuittingConnection(this); } -void MTProtoConnection::waitTillFinish() { +void Connection::waitTillFinish() { t_assert(data == nullptr && thread != nullptr); DEBUG_LOG(("Waiting for connectionThread to finish")); @@ -338,224 +339,229 @@ void MTProtoConnection::waitTillFinish() { thread = nullptr; } -int32 MTProtoConnection::state() const { +int32 Connection::state() const { t_assert(data != nullptr && thread != nullptr); return data->getState(); } -QString MTProtoConnection::transport() const { +QString Connection::transport() const { t_assert(data != nullptr && thread != nullptr); return data->transport(); } -MTProtoConnection::~MTProtoConnection() { +Connection::~Connection() { t_assert(data == nullptr && thread == nullptr); } namespace { - mtpBuffer _handleHttpResponse(QNetworkReply *reply) { - QByteArray response = reply->readAll(); - TCP_LOG(("HTTP Info: read %1 bytes").arg(response.size())); - if (response.isEmpty()) return mtpBuffer(); +mtpBuffer _handleHttpResponse(QNetworkReply *reply) { + QByteArray response = reply->readAll(); + TCP_LOG(("HTTP Info: read %1 bytes").arg(response.size())); - if (response.size() & 0x03 || response.size() < 8) { - LOG(("HTTP Error: bad response size %1").arg(response.size())); - return mtpBuffer(1, -500); - } + if (response.isEmpty()) return mtpBuffer(); - mtpBuffer data(response.size() >> 2); - memcpy(data.data(), response.constData(), response.size()); - - return data; + if (response.size() & 0x03 || response.size() < 8) { + LOG(("HTTP Error: bad response size %1").arg(response.size())); + return mtpBuffer(1, -500); } - bool _handleHttpError(QNetworkReply *reply) { // returnes "maybe bad key" - bool mayBeBadKey = false; - - QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); - if (statusCode.isValid()) { - int status = statusCode.toInt(); - mayBeBadKey = (status == 410); - if (status == 429) { - LOG(("Protocol Error: 429 flood code returned!")); - } - } - - switch (reply->error()) { - case QNetworkReply::ConnectionRefusedError: LOG(("HTTP Error: connection refused - %1").arg(reply->errorString())); break; - case QNetworkReply::RemoteHostClosedError: LOG(("HTTP Error: remote host closed - %1").arg(reply->errorString())); break; - case QNetworkReply::HostNotFoundError: LOG(("HTTP Error: host not found - %2").arg(reply->error()).arg(reply->errorString())); break; - case QNetworkReply::TimeoutError: LOG(("HTTP Error: timeout - %2").arg(reply->error()).arg(reply->errorString())); break; - case QNetworkReply::OperationCanceledError: LOG(("HTTP Error: cancelled - %2").arg(reply->error()).arg(reply->errorString())); break; - case QNetworkReply::SslHandshakeFailedError: - case QNetworkReply::TemporaryNetworkFailureError: - case QNetworkReply::NetworkSessionFailedError: - case QNetworkReply::BackgroundRequestNotAllowedError: - case QNetworkReply::UnknownNetworkError: LOG(("HTTP Error: network error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - - // proxy errors (101-199): - case QNetworkReply::ProxyConnectionRefusedError: - case QNetworkReply::ProxyConnectionClosedError: - case QNetworkReply::ProxyNotFoundError: - case QNetworkReply::ProxyTimeoutError: - case QNetworkReply::ProxyAuthenticationRequiredError: - case QNetworkReply::UnknownProxyError:LOG(("HTTP Error: proxy error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - - // content errors (201-299): - case QNetworkReply::ContentAccessDenied: - case QNetworkReply::ContentOperationNotPermittedError: - case QNetworkReply::ContentNotFoundError: - case QNetworkReply::AuthenticationRequiredError: - case QNetworkReply::ContentReSendError: - case QNetworkReply::UnknownContentError: LOG(("HTTP Error: content error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - - // protocol errors - case QNetworkReply::ProtocolUnknownError: - case QNetworkReply::ProtocolInvalidOperationError: - case QNetworkReply::ProtocolFailure: LOG(("HTTP Error: protocol error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - }; - TCP_LOG(("HTTP Error %1, restarting! - %2").arg(reply->error()).arg(reply->errorString())); - - return mayBeBadKey; - } - - uint32 _tcpPacketSize(const char *packet) { // must have at least 4 bytes readable - uint32 result = (packet[0] > 0) ? packet[0] : 0; - if (result == 0x7f) { - const uchar *bytes = reinterpret_cast(packet); - result = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); - return (result << 2) + 4; - } - return (result << 2) + 1; - } - - mtpBuffer _handleTcpResponse(const char *packet, uint32 length) { - if (length < 5 || length > MTPPacketSizeMax) { - LOG(("TCP Error: bad packet size %1").arg(length)); - return mtpBuffer(1, -500); - } - int32 size = packet[0], len = length - 1; - if (size == 0x7f) { - const uchar *bytes = reinterpret_cast(packet); - size = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); - len -= 3; - } - if (size * int32(sizeof(mtpPrime)) != len) { - LOG(("TCP Error: bad packet header")); - TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); - return mtpBuffer(1, -500); - } - const mtpPrime *packetdata = reinterpret_cast(packet + (length - len)); - TCP_LOG(("TCP Info: packet received, size = %1").arg(size * sizeof(mtpPrime))); - if (size == 1) { - if (*packetdata == -429) { - LOG(("Protocol Error: -429 flood code returned!")); - } else { - LOG(("TCP Error: error packet received, code = %1").arg(*packetdata)); - } - return mtpBuffer(1, *packetdata); - } - - mtpBuffer data(size); - memcpy(data.data(), packetdata, size * sizeof(mtpPrime)); - - return data; - } - - void _handleTcpError(QAbstractSocket::SocketError e, QTcpSocket &sock) { - switch (e) { - case QAbstractSocket::ConnectionRefusedError: - LOG(("TCP Error: socket connection refused - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::RemoteHostClosedError: - TCP_LOG(("TCP Info: remote host closed socket connection - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::HostNotFoundError: - LOG(("TCP Error: host not found - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::SocketTimeoutError: - LOG(("TCP Error: socket timeout - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::NetworkError: - LOG(("TCP Error: network - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::ProxyAuthenticationRequiredError: - case QAbstractSocket::ProxyConnectionRefusedError: - case QAbstractSocket::ProxyConnectionClosedError: - case QAbstractSocket::ProxyConnectionTimeoutError: - case QAbstractSocket::ProxyNotFoundError: - case QAbstractSocket::ProxyProtocolError: - LOG(("TCP Error: proxy (%1) - %2").arg(e).arg(sock.errorString())); - break; - - default: - LOG(("TCP Error: other (%1) - %2").arg(e).arg(sock.errorString())); - break; - } - - TCP_LOG(("TCP Error %1, restarting! - %2").arg(e).arg(sock.errorString())); - } - - mtpBuffer _preparePQFake(const MTPint128 &nonce) { - MTPReq_pq req_pq(nonce); - mtpBuffer buffer; - uint32 requestSize = req_pq.innerLength() >> 2; - - buffer.resize(0); - buffer.reserve(8 + requestSize); - buffer.push_back(0); // tcp packet len - buffer.push_back(0); // tcp packet num - buffer.push_back(0); - buffer.push_back(0); - buffer.push_back(0); - buffer.push_back(unixtime()); - buffer.push_back(requestSize * 4); - req_pq.write(buffer); - buffer.push_back(0); // tcp crc32 hash - - return buffer; - } - - MTPResPQ _readPQFakeReply(const mtpBuffer &buffer) { - const mtpPrime *answer(buffer.constData()); - uint32 len = buffer.size(); - if (len < 5) { - LOG(("Fake PQ Error: bad request answer, len = %1").arg(len * sizeof(mtpPrime))); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); - throw Exception("bad pq reply"); - } - if (answer[0] != 0 || answer[1] != 0 || (((uint32)answer[2]) & 0x03) != 1/* || (unixtime() - answer[3] > 300) || (answer[3] - unixtime() > 60)*/) { // didnt sync time yet - LOG(("Fake PQ Error: bad request answer start (%1 %2 %3)").arg(answer[0]).arg(answer[1]).arg(answer[2])); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); - throw Exception("bad pq reply"); - } - uint32 answerLen = (uint32)answer[4]; - if (answerLen != (len - 5) * sizeof(mtpPrime)) { - LOG(("Fake PQ Error: bad request answer %1 <> %2").arg(answerLen).arg((len - 5) * sizeof(mtpPrime))); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); - throw Exception("bad pq reply"); - } - const mtpPrime *from(answer + 5), *end(from + len - 5); - MTPResPQ response; - response.read(from, end); - return response; - } + mtpBuffer data(response.size() >> 2); + memcpy(data.data(), response.constData(), response.size()); + return data; } -MTPabstractTcpConnection::MTPabstractTcpConnection() : -packetNum(0), packetRead(0), packetLeft(0), readingToShort(true), currentPos((char*)shortBuffer) { +bool _handleHttpError(QNetworkReply *reply) { // returnes "maybe bad key" + bool mayBeBadKey = false; + + QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); + if (statusCode.isValid()) { + int status = statusCode.toInt(); + mayBeBadKey = (status == 410); + if (status == 429) { + LOG(("Protocol Error: 429 flood code returned!")); + } + } + + switch (reply->error()) { + case QNetworkReply::ConnectionRefusedError: LOG(("HTTP Error: connection refused - %1").arg(reply->errorString())); break; + case QNetworkReply::RemoteHostClosedError: LOG(("HTTP Error: remote host closed - %1").arg(reply->errorString())); break; + case QNetworkReply::HostNotFoundError: LOG(("HTTP Error: host not found - %2").arg(reply->error()).arg(reply->errorString())); break; + case QNetworkReply::TimeoutError: LOG(("HTTP Error: timeout - %2").arg(reply->error()).arg(reply->errorString())); break; + case QNetworkReply::OperationCanceledError: LOG(("HTTP Error: cancelled - %2").arg(reply->error()).arg(reply->errorString())); break; + case QNetworkReply::SslHandshakeFailedError: + case QNetworkReply::TemporaryNetworkFailureError: + case QNetworkReply::NetworkSessionFailedError: + case QNetworkReply::BackgroundRequestNotAllowedError: + case QNetworkReply::UnknownNetworkError: LOG(("HTTP Error: network error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + + // proxy errors (101-199): + case QNetworkReply::ProxyConnectionRefusedError: + case QNetworkReply::ProxyConnectionClosedError: + case QNetworkReply::ProxyNotFoundError: + case QNetworkReply::ProxyTimeoutError: + case QNetworkReply::ProxyAuthenticationRequiredError: + case QNetworkReply::UnknownProxyError:LOG(("HTTP Error: proxy error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + + // content errors (201-299): + case QNetworkReply::ContentAccessDenied: + case QNetworkReply::ContentOperationNotPermittedError: + case QNetworkReply::ContentNotFoundError: + case QNetworkReply::AuthenticationRequiredError: + case QNetworkReply::ContentReSendError: + case QNetworkReply::UnknownContentError: LOG(("HTTP Error: content error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + + // protocol errors + case QNetworkReply::ProtocolUnknownError: + case QNetworkReply::ProtocolInvalidOperationError: + case QNetworkReply::ProtocolFailure: LOG(("HTTP Error: protocol error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + }; + TCP_LOG(("HTTP Error %1, restarting! - %2").arg(reply->error()).arg(reply->errorString())); + + return mayBeBadKey; } -void MTPabstractTcpConnection::socketRead() { +uint32 _tcpPacketSize(const char *packet) { // must have at least 4 bytes readable + uint32 result = (packet[0] > 0) ? packet[0] : 0; + if (result == 0x7f) { + const uchar *bytes = reinterpret_cast(packet); + result = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); + return (result << 2) + 4; + } + return (result << 2) + 1; +} + +mtpBuffer _handleTcpResponse(const char *packet, uint32 length) { + if (length < 5 || length > MTPPacketSizeMax) { + LOG(("TCP Error: bad packet size %1").arg(length)); + return mtpBuffer(1, -500); + } + int32 size = packet[0], len = length - 1; + if (size == 0x7f) { + const uchar *bytes = reinterpret_cast(packet); + size = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); + len -= 3; + } + if (size * int32(sizeof(mtpPrime)) != len) { + LOG(("TCP Error: bad packet header")); + TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); + return mtpBuffer(1, -500); + } + const mtpPrime *packetdata = reinterpret_cast(packet + (length - len)); + TCP_LOG(("TCP Info: packet received, size = %1").arg(size * sizeof(mtpPrime))); + if (size == 1) { + if (*packetdata == -429) { + LOG(("Protocol Error: -429 flood code returned!")); + } else { + LOG(("TCP Error: error packet received, code = %1").arg(*packetdata)); + } + return mtpBuffer(1, *packetdata); + } + + mtpBuffer data(size); + memcpy(data.data(), packetdata, size * sizeof(mtpPrime)); + + return data; +} + +void _handleTcpError(QAbstractSocket::SocketError e, QTcpSocket &sock) { + switch (e) { + case QAbstractSocket::ConnectionRefusedError: + LOG(("TCP Error: socket connection refused - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::RemoteHostClosedError: + TCP_LOG(("TCP Info: remote host closed socket connection - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::HostNotFoundError: + LOG(("TCP Error: host not found - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::SocketTimeoutError: + LOG(("TCP Error: socket timeout - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::NetworkError: + LOG(("TCP Error: network - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::ProxyAuthenticationRequiredError: + case QAbstractSocket::ProxyConnectionRefusedError: + case QAbstractSocket::ProxyConnectionClosedError: + case QAbstractSocket::ProxyConnectionTimeoutError: + case QAbstractSocket::ProxyNotFoundError: + case QAbstractSocket::ProxyProtocolError: + LOG(("TCP Error: proxy (%1) - %2").arg(e).arg(sock.errorString())); + break; + + default: + LOG(("TCP Error: other (%1) - %2").arg(e).arg(sock.errorString())); + break; + } + + TCP_LOG(("TCP Error %1, restarting! - %2").arg(e).arg(sock.errorString())); +} + +mtpBuffer _preparePQFake(const MTPint128 &nonce) { + MTPReq_pq req_pq(nonce); + mtpBuffer buffer; + uint32 requestSize = req_pq.innerLength() >> 2; + + buffer.resize(0); + buffer.reserve(8 + requestSize); + buffer.push_back(0); // tcp packet len + buffer.push_back(0); // tcp packet num + buffer.push_back(0); + buffer.push_back(0); + buffer.push_back(0); + buffer.push_back(unixtime()); + buffer.push_back(requestSize * 4); + req_pq.write(buffer); + buffer.push_back(0); // tcp crc32 hash + + return buffer; +} + +MTPResPQ _readPQFakeReply(const mtpBuffer &buffer) { + const mtpPrime *answer(buffer.constData()); + uint32 len = buffer.size(); + if (len < 5) { + LOG(("Fake PQ Error: bad request answer, len = %1").arg(len * sizeof(mtpPrime))); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); + throw Exception("bad pq reply"); + } + if (answer[0] != 0 || answer[1] != 0 || (((uint32)answer[2]) & 0x03) != 1/* || (unixtime() - answer[3] > 300) || (answer[3] - unixtime() > 60)*/) { // didnt sync time yet + LOG(("Fake PQ Error: bad request answer start (%1 %2 %3)").arg(answer[0]).arg(answer[1]).arg(answer[2])); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); + throw Exception("bad pq reply"); + } + uint32 answerLen = (uint32)answer[4]; + if (answerLen != (len - 5) * sizeof(mtpPrime)) { + LOG(("Fake PQ Error: bad request answer %1 <> %2").arg(answerLen).arg((len - 5) * sizeof(mtpPrime))); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); + throw Exception("bad pq reply"); + } + const mtpPrime *from(answer + 5), *end(from + len - 5); + MTPResPQ response; + response.read(from, end); + return response; +} + +} // namespace + +AbstractTcpConnection::AbstractTcpConnection() + : packetNum(0) + , packetRead(0) + , packetLeft(0) + , readingToShort(true) + , currentPos((char*)shortBuffer) { +} + +void AbstractTcpConnection::socketRead() { if (sock.state() != QAbstractSocket::ConnectedState) { LOG(("MTP error: socket not connected in socketRead(), state: %1").arg(sock.state())); emit error(); @@ -640,7 +646,7 @@ void MTPabstractTcpConnection::socketRead() { } while (sock.state() == QAbstractSocket::ConnectedState && sock.bytesAvailable()); } -MTPautoConnection::MTPautoConnection(QThread *thread) : MTPabstractTcpConnection() +AutoConnection::AutoConnection(QThread *thread) : AbstractTcpConnection() , status(WaitingBoth) , tcpNonce(MTP::nonce()) , httpNonce(MTP::nonce()) @@ -671,7 +677,7 @@ MTPautoConnection::MTPautoConnection(QThread *thread) : MTPabstractTcpConnection connect(&sock, SIGNAL(disconnected()), this, SLOT(onSocketDisconnected())); } -void MTPautoConnection::onHttpStart() { +void AutoConnection::onHttpStart() { if (status == HttpReady) { DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); status = UsingHttp; @@ -680,7 +686,7 @@ void MTPautoConnection::onHttpStart() { } } -void MTPautoConnection::onSocketConnected() { +void AutoConnection::onSocketConnected() { if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { mtpBuffer buffer(_preparePQFake(tcpNonce)); @@ -695,7 +701,7 @@ void MTPautoConnection::onSocketConnected() { } } -void MTPautoConnection::onTcpTimeoutTimer() { +void AutoConnection::onTcpTimeoutTimer() { if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { if (_tcpTimeout < MTPMaxReceiveDelay) _tcpTimeout *= 2; _tcpTimeout = -_tcpTimeout; @@ -709,7 +715,7 @@ void MTPautoConnection::onTcpTimeoutTimer() { } } -void MTPautoConnection::onSocketDisconnected() { +void AutoConnection::onSocketDisconnected() { if (_tcpTimeout < 0) { _tcpTimeout = -_tcpTimeout; if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { @@ -728,7 +734,7 @@ void MTPautoConnection::onSocketDisconnected() { } } -void MTPautoConnection::sendData(mtpBuffer &buffer) { +void AutoConnection::sendData(mtpBuffer &buffer) { if (status == FinishedWork) return; if (buffer.size() < 3) { @@ -750,7 +756,7 @@ uint32 FourCharsToUInt(char ch1, char ch2, char ch3, char ch4) { return *reinterpret_cast(ch); } -void MTPautoConnection::tcpSend(mtpBuffer &buffer) { +void AutoConnection::tcpSend(mtpBuffer &buffer) { if (!packetNum) { char nonce[64]; uint32 *first = reinterpret_cast(nonce), *second = first + 1; @@ -782,7 +788,7 @@ void MTPautoConnection::tcpSend(mtpBuffer &buffer) { } } -void MTPautoConnection::httpSend(mtpBuffer &buffer) { +void AutoConnection::httpSend(mtpBuffer &buffer) { int32 requestSize = (buffer.size() - 3) * sizeof(mtpPrime); QNetworkRequest request(address); @@ -793,7 +799,7 @@ void MTPautoConnection::httpSend(mtpBuffer &buffer) { requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); } -void MTPautoConnection::disconnectFromServer() { +void AutoConnection::disconnectFromServer() { if (status == FinishedWork) return; status = FinishedWork; @@ -814,7 +820,7 @@ void MTPautoConnection::disconnectFromServer() { httpStartTimer.stop(); } -void MTPautoConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { +void AutoConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { _addrTcp = addr; _portTcp = port; _flagsTcp = flags; @@ -823,7 +829,7 @@ void MTPautoConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption sock.connectToHost(QHostAddress(_addrTcp), _portTcp); } -void MTPautoConnection::connectHttp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { +void AutoConnection::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*))); @@ -839,11 +845,11 @@ void MTPautoConnection::connectHttp(const QString &addr, int32 port, MTPDdcOptio httpSend(buffer); } -bool MTPautoConnection::isConnected() const { +bool AutoConnection::isConnected() const { return (status == UsingTcp) || (status == UsingHttp); } -void MTPautoConnection::requestFinished(QNetworkReply *reply) { +void AutoConnection::requestFinished(QNetworkReply *reply) { if (status == FinishedWork) return; reply->deleteLater(); @@ -904,7 +910,7 @@ void MTPautoConnection::requestFinished(QNetworkReply *reply) { } } -void MTPautoConnection::socketPacket(const char *packet, uint32 length) { +void AutoConnection::socketPacket(const char *packet, uint32 length) { if (status == FinishedWork) return; mtpBuffer data = _handleTcpResponse(packet, length); @@ -953,19 +959,19 @@ void MTPautoConnection::socketPacket(const char *packet, uint32 length) { } } -bool MTPautoConnection::usingHttpWait() { +bool AutoConnection::usingHttpWait() { return (status == UsingHttp); } -bool MTPautoConnection::needHttpWait() { +bool AutoConnection::needHttpWait() { return (status == UsingHttp) ? requests.isEmpty() : false; } -int32 MTPautoConnection::debugState() const { +int32 AutoConnection::debugState() const { return (status == UsingHttp) ? -1 : (UsingTcp ? sock.state() : -777); } -QString MTPautoConnection::transport() const { +QString AutoConnection::transport() const { if (status == UsingTcp) { return qsl("TCP"); } else if (status == UsingHttp) { @@ -975,7 +981,7 @@ QString MTPautoConnection::transport() const { } } -void MTPautoConnection::socketError(QAbstractSocket::SocketError e) { +void AutoConnection::socketError(QAbstractSocket::SocketError e) { if (status == FinishedWork) return; _handleTcpError(e, sock); @@ -992,8 +998,11 @@ void MTPautoConnection::socketError(QAbstractSocket::SocketError e) { } } -MTPtcpConnection::MTPtcpConnection(QThread *thread) : status(WaitingTcp), -tcpNonce(MTP::nonce()), _tcpTimeout(MTPMinReceiveDelay), _flags(0) { +TCPConnection::TCPConnection(QThread *thread) + : status(WaitingTcp) + , tcpNonce(MTP::nonce()) + , _tcpTimeout(MTPMinReceiveDelay) + , _flags(0) { moveToThread(thread); tcpTimeoutTimer.moveToThread(thread); @@ -1007,7 +1016,7 @@ tcpNonce(MTP::nonce()), _tcpTimeout(MTPMinReceiveDelay), _flags(0) { connect(&sock, SIGNAL(disconnected()), this, SLOT(onSocketDisconnected())); } -void MTPtcpConnection::onSocketConnected() { +void TCPConnection::onSocketConnected() { if (status == WaitingTcp) { mtpBuffer buffer(_preparePQFake(tcpNonce)); @@ -1020,7 +1029,7 @@ void MTPtcpConnection::onSocketConnected() { } } -void MTPtcpConnection::onTcpTimeoutTimer() { +void TCPConnection::onTcpTimeoutTimer() { if (status == WaitingTcp) { if (_tcpTimeout < MTPMaxReceiveDelay) _tcpTimeout *= 2; _tcpTimeout = -_tcpTimeout; @@ -1034,7 +1043,7 @@ void MTPtcpConnection::onTcpTimeoutTimer() { } } -void MTPtcpConnection::onSocketDisconnected() { +void TCPConnection::onSocketDisconnected() { if (_tcpTimeout < 0) { _tcpTimeout = -_tcpTimeout; if (status == WaitingTcp) { @@ -1047,7 +1056,7 @@ void MTPtcpConnection::onSocketDisconnected() { } } -void MTPtcpConnection::sendData(mtpBuffer &buffer) { +void TCPConnection::sendData(mtpBuffer &buffer) { if (status == FinishedWork) return; if (buffer.size() < 3) { @@ -1088,7 +1097,7 @@ void MTPtcpConnection::sendData(mtpBuffer &buffer) { } } -void MTPtcpConnection::disconnectFromServer() { +void TCPConnection::disconnectFromServer() { if (status == FinishedWork) return; status = FinishedWork; @@ -1096,7 +1105,7 @@ void MTPtcpConnection::disconnectFromServer() { sock.close(); } -void MTPtcpConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { +void TCPConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { _addr = addr; _port = port; _flags = flags; @@ -1105,7 +1114,7 @@ void MTPtcpConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption: sock.connectToHost(QHostAddress(_addr), _port); } -void MTPtcpConnection::socketPacket(const char *packet, uint32 length) { +void TCPConnection::socketPacket(const char *packet, uint32 length) { if (status == FinishedWork) return; mtpBuffer data = _handleTcpResponse(packet, length); @@ -1132,32 +1141,35 @@ void MTPtcpConnection::socketPacket(const char *packet, uint32 length) { } } -bool MTPtcpConnection::isConnected() const { +bool TCPConnection::isConnected() const { return (status == UsingTcp); } -int32 MTPtcpConnection::debugState() const { +int32 TCPConnection::debugState() const { return sock.state(); } -QString MTPtcpConnection::transport() const { +QString TCPConnection::transport() const { return isConnected() ? qsl("TCP") : QString(); } -void MTPtcpConnection::socketError(QAbstractSocket::SocketError e) { +void TCPConnection::socketError(QAbstractSocket::SocketError e) { if (status == FinishedWork) return; _handleTcpError(e, sock); emit error(); } -MTPhttpConnection::MTPhttpConnection(QThread *thread) : status(WaitingHttp), httpNonce(MTP::nonce()), _flags(0) { +HTTPConnection::HTTPConnection(QThread *thread) + : status(WaitingHttp) + , httpNonce(MTP::nonce()) + , _flags(0) { moveToThread(thread); manager.moveToThread(thread); App::setProxySettings(manager); } -void MTPhttpConnection::sendData(mtpBuffer &buffer) { +void HTTPConnection::sendData(mtpBuffer &buffer) { if (status == FinishedWork) return; if (buffer.size() < 3) { @@ -1177,7 +1189,7 @@ void MTPhttpConnection::sendData(mtpBuffer &buffer) { requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); } -void MTPhttpConnection::disconnectFromServer() { +void HTTPConnection::disconnectFromServer() { if (status == FinishedWork) return; status = FinishedWork; @@ -1193,7 +1205,7 @@ void MTPhttpConnection::disconnectFromServer() { address = QUrl(); } -void MTPhttpConnection::connectHttp(const QString &addr, int32 p, MTPDdcOption::Flags flags) { +void HTTPConnection::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*))); @@ -1207,11 +1219,11 @@ void MTPhttpConnection::connectHttp(const QString &addr, int32 p, MTPDdcOption:: sendData(buffer); } -bool MTPhttpConnection::isConnected() const { +bool HTTPConnection::isConnected() const { return (status == UsingHttp); } -void MTPhttpConnection::requestFinished(QNetworkReply *reply) { +void HTTPConnection::requestFinished(QNetworkReply *reply) { if (status == FinishedWork) return; reply->deleteLater(); @@ -1251,19 +1263,19 @@ void MTPhttpConnection::requestFinished(QNetworkReply *reply) { } } -bool MTPhttpConnection::usingHttpWait() { +bool HTTPConnection::usingHttpWait() { return true; } -bool MTPhttpConnection::needHttpWait() { +bool HTTPConnection::needHttpWait() { return requests.isEmpty(); } -int32 MTPhttpConnection::debugState() const { +int32 HTTPConnection::debugState() const { return -1; } -QString MTPhttpConnection::transport() const { +QString HTTPConnection::transport() const { if (status == UsingHttp) { return qsl("HTTP"); } else { @@ -1271,16 +1283,16 @@ QString MTPhttpConnection::transport() const { } } -void MTProtoConnectionPrivate::createConn(bool createIPv4, bool createIPv6) { +void ConnectionPrivate::createConn(bool createIPv4, bool createIPv6) { destroyConn(); if (createIPv4) { QWriteLocker lock(&stateConnMutex); if (cConnectionType() == dbictAuto) { - _conn4 = new MTPautoConnection(thread()); + _conn4 = new AutoConnection(thread()); } else if (cConnectionType() == dbictTcpProxy) { - _conn4 = new MTPtcpConnection(thread()); + _conn4 = new TCPConnection(thread()); } else { - _conn4 = new MTPhttpConnection(thread()); + _conn4 = new HTTPConnection(thread()); } connect(_conn4, SIGNAL(error(bool)), this, SLOT(onError4(bool))); connect(_conn4, SIGNAL(receivedSome()), this, SLOT(onReceivedSome())); @@ -1288,11 +1300,11 @@ void MTProtoConnectionPrivate::createConn(bool createIPv4, bool createIPv6) { if (createIPv6) { QWriteLocker lock(&stateConnMutex); if (cConnectionType() == dbictAuto) { - _conn6 = new MTPautoConnection(thread()); + _conn6 = new AutoConnection(thread()); } else if (cConnectionType() == dbictTcpProxy) { - _conn6 = new MTPtcpConnection(thread()); + _conn6 = new TCPConnection(thread()); } else { - _conn6 = new MTPhttpConnection(thread()); + _conn6 = new HTTPConnection(thread()); } connect(_conn6, SIGNAL(error(bool)), this, SLOT(onError6(bool))); connect(_conn6, SIGNAL(receivedSome()), this, SLOT(onReceivedSome())); @@ -1305,19 +1317,19 @@ void MTProtoConnectionPrivate::createConn(bool createIPv4, bool createIPv6) { oldConnectionTimer.start(MTPConnectionOldTimeout); } -void MTProtoConnectionPrivate::destroyConn(MTPabstractConnection **conn) { +void ConnectionPrivate::destroyConn(AbstractConnection **conn) { if (conn) { - MTPabstractConnection *toDisconnect = nullptr; + AbstractConnection *toDisconnect = nullptr; { QWriteLocker lock(&stateConnMutex); if (*conn) { toDisconnect = *conn; - disconnect(*conn, SIGNAL(connected()), 0, 0); - disconnect(*conn, SIGNAL(disconnected()), 0, 0); - disconnect(*conn, SIGNAL(error(bool)), 0, 0); - disconnect(*conn, SIGNAL(receivedData()), 0, 0); - disconnect(*conn, SIGNAL(receivedSome()), 0, 0); + disconnect(*conn, SIGNAL(connected()), nullptr, nullptr); + disconnect(*conn, SIGNAL(disconnected()), nullptr, nullptr); + disconnect(*conn, SIGNAL(error(bool)), nullptr, nullptr); + disconnect(*conn, SIGNAL(receivedData()), nullptr, nullptr); + disconnect(*conn, SIGNAL(receivedSome()), nullptr, nullptr); *conn = nullptr; } } @@ -1332,8 +1344,8 @@ void MTProtoConnectionPrivate::destroyConn(MTPabstractConnection **conn) { } } -MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConnection *owner, MTPSessionData *data, uint32 _dc) : QObject(0) -, _state(MTProtoConnection::Disconnected) +ConnectionPrivate::ConnectionPrivate(QThread *thread, Connection *owner, SessionData *data, uint32 _dc) : QObject(nullptr) +, _state(DisconnectedState) , _needSessionReset(false) , dc(_dc) , _owner(owner) @@ -1379,7 +1391,7 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne connect(thread, SIGNAL(started()), this, SLOT(socketStart())); connect(thread, SIGNAL(finished()), this, SLOT(doFinish())); - connect(this, SIGNAL(finished(MTProtoConnection*)), _mtp_internal::globalSlotCarrier(), SLOT(connectionFinished(MTProtoConnection*)), Qt::QueuedConnection); + connect(this, SIGNAL(finished(MTProtoConnection*)), globalSlotCarrier(), SLOT(connectionFinished(MTProtoConnection*)), Qt::QueuedConnection); connect(&retryTimer, SIGNAL(timeout()), this, SLOT(retryByTimer())); connect(&_waitForConnectedTimer, SIGNAL(timeout()), this, SLOT(onWaitConnectedFailed())); @@ -1412,15 +1424,15 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne connect(this, SIGNAL(resendAllAsync()), sessionData->owner(), SLOT(resendAll())); } -void MTProtoConnectionPrivate::onConfigLoaded() { +void ConnectionPrivate::onConfigLoaded() { socketStart(true); } -int32 MTProtoConnectionPrivate::getDC() const { +int32 ConnectionPrivate::getDC() const { return dc; } -int32 MTProtoConnectionPrivate::getState() const { +int32 ConnectionPrivate::getState() const { QReadLocker lock(&stateConnMutex); int32 result = _state; if (_state < 0) { @@ -1434,7 +1446,7 @@ int32 MTProtoConnectionPrivate::getState() const { return result; } -QString MTProtoConnectionPrivate::transport() const { +QString ConnectionPrivate::transport() const { QReadLocker lock(&stateConnMutex); if ((!_conn4 && !_conn6) || (_conn4 && _conn6) || (_state < 0)) { return QString(); @@ -1444,8 +1456,8 @@ QString MTProtoConnectionPrivate::transport() const { return result; } -bool MTProtoConnectionPrivate::setState(int32 state, int32 ifState) { - if (ifState != MTProtoConnection::UpdateAlways) { +bool ConnectionPrivate::setState(int32 state, int32 ifState) { + if (ifState != Connection::UpdateAlways) { QReadLocker lock(&stateConnMutex); if (_state != ifState) return false; } @@ -1461,7 +1473,7 @@ bool MTProtoConnectionPrivate::setState(int32 state, int32 ifState) { return true; } -void MTProtoConnectionPrivate::resetSession() { // recreate all msg_id and msg_seqno +void ConnectionPrivate::resetSession() { // recreate all msg_id and msg_seqno _needSessionReset = false; QWriteLocker locker1(sessionData->haveSentMutex()); @@ -1581,7 +1593,7 @@ void MTProtoConnectionPrivate::resetSession() { // recreate all msg_id and msg_s emit sessionResetDone(); } -mtpMsgId MTProtoConnectionPrivate::prepareToSend(mtpRequest &request, mtpMsgId currentLastId) { +mtpMsgId ConnectionPrivate::prepareToSend(mtpRequest &request, mtpMsgId currentLastId) { if (request->size() < 9) return 0; mtpMsgId msgId = *(mtpMsgId*)(request->constData() + 4); if (msgId) { // resending this request @@ -1598,7 +1610,7 @@ mtpMsgId MTProtoConnectionPrivate::prepareToSend(mtpRequest &request, mtpMsgId c return msgId; } -mtpMsgId MTProtoConnectionPrivate::replaceMsgId(mtpRequest &request, mtpMsgId newId) { +mtpMsgId ConnectionPrivate::replaceMsgId(mtpRequest &request, mtpMsgId newId) { if (request->size() < 9) return 0; mtpMsgId oldMsgId = *(mtpMsgId*)(request->constData() + 4); @@ -1661,7 +1673,7 @@ mtpMsgId MTProtoConnectionPrivate::replaceMsgId(mtpRequest &request, mtpMsgId ne return newId; } -mtpMsgId MTProtoConnectionPrivate::placeToContainer(mtpRequest &toSendRequest, mtpMsgId &bigMsgId, mtpMsgId *&haveSentArr, mtpRequest &req) { +mtpMsgId ConnectionPrivate::placeToContainer(mtpRequest &toSendRequest, mtpMsgId &bigMsgId, mtpMsgId *&haveSentArr, mtpRequest &req) { mtpMsgId msgId = prepareToSend(req, bigMsgId); if (msgId > bigMsgId) msgId = replaceMsgId(req, bigMsgId); if (msgId >= bigMsgId) bigMsgId = msgid(); @@ -1674,7 +1686,7 @@ mtpMsgId MTProtoConnectionPrivate::placeToContainer(mtpRequest &toSendRequest, m return msgId; } -void MTProtoConnectionPrivate::tryToSend() { +void ConnectionPrivate::tryToSend() { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData || !_conn) { return; @@ -1682,15 +1694,15 @@ void MTProtoConnectionPrivate::tryToSend() { bool needsLayer = !sessionData->layerWasInited(); int32 state = getState(); - bool prependOnly = (state != MTProtoConnection::Connected); + bool prependOnly = (state != ConnectedState); mtpRequest pingRequest; - if (dc < _mtp_internal::dcShift) { // main session + if (dc == bareDcId(dc)) { // main session if (!prependOnly && !_pingIdToSend && !_pingId && _pingSendAt <= getms(true)) { _pingIdToSend = MTP::nonce(); } } if (_pingIdToSend) { - if (prependOnly || dc >= _mtp_internal::dcShift) { + if (prependOnly || dc != bareDcId(dc)) { MTPPing ping(MTPping(MTP_long(_pingIdToSend))); uint32 pingSize = ping.innerLength() >> 2; // copy from MTProtoSession::send pingRequest = mtpRequestData::prepare(pingSize); @@ -1708,7 +1720,7 @@ void MTProtoConnectionPrivate::tryToSend() { _pingSendAt = pingRequest->msDate + (MTPPingSendAfterAuto * 1000ULL); pingRequest->requestId = 0; // dont add to haveSent / wereAcked maps - if (dc < _mtp_internal::dcShift && !prependOnly) { // main session + if (dc == bareDcId(dc) && !prependOnly) { // main session _pingSender.start(MTPPingSendAfter * 1000); } @@ -1834,7 +1846,7 @@ void MTProtoConnectionPrivate::tryToSend() { mtpRequest wrappedRequest(mtpRequestData::prepare(toSendSize, toSendSize + 3)); // cons + msg_id wrappedRequest->resize(4); memcpy(wrappedRequest->data(), toSendRequest->constData(), 4 * sizeof(mtpPrime)); - _mtp_internal::wrapInvokeAfter(wrappedRequest, toSendRequest, haveSent); + wrapInvokeAfter(wrappedRequest, toSendRequest, haveSent); toSendRequest = wrappedRequest; } if (needsLayer) { @@ -1912,7 +1924,7 @@ void MTProtoConnectionPrivate::tryToSend() { req->msDate = mtpRequestData::isStateRequest(req) ? 0 : getms(true); int32 reqNeedsLayer = (needsLayer && req->needsLayer) ? toSendRequest->size() : 0; if (req->after) { - _mtp_internal::wrapInvokeAfter(toSendRequest, req, haveSent, reqNeedsLayer ? initSizeInInts : 0); + wrapInvokeAfter(toSendRequest, req, haveSent, reqNeedsLayer ? initSizeInInts : 0); if (reqNeedsLayer) { memcpy(toSendRequest->data() + reqNeedsLayer + 4, initSerialized.constData(), initSize); *(toSendRequest->data() + reqNeedsLayer + 3) += initSize; @@ -1959,7 +1971,7 @@ void MTProtoConnectionPrivate::tryToSend() { sendRequest(toSendRequest, needAnyResponse, lockFinished); } -void MTProtoConnectionPrivate::retryByTimer() { +void ConnectionPrivate::retryByTimer() { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData) return; @@ -1982,18 +1994,18 @@ void MTProtoConnectionPrivate::retryByTimer() { socketStart(); } -void MTProtoConnectionPrivate::restartNow() { +void ConnectionPrivate::restartNow() { retryTimeout = 1; retryTimer.stop(); restart(); } -void MTProtoConnectionPrivate::socketStart(bool afterConfig) { +void ConnectionPrivate::socketStart(bool afterConfig) { if (_finished) { DEBUG_LOG(("MTP Error: socketStart() called for finished connection!")); return; } - bool isDldDc = (dc >= MTP::dldStart) && (dc < MTP::dldEnd); + bool isDldDc = isDldDcId(dc); if (isDldDc) { // using media_only addresses only if key for this dc is already created QReadLocker lockFinished(&sessionDataMutex); if (sessionData) { @@ -2003,7 +2015,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { } } - int32 baseDc = (dc % _mtp_internal::dcShift); + int32 bareDc = bareDcId(dc); static const int IPv4address = 0, IPv6address = 1; static const int TcpProtocol = 0, HttpProtocol = 1; @@ -2046,7 +2058,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { int32 mask = shifts[address][protocol][shift]; if (mask < 0) continue; - auto index = options.constFind(baseDc + _mtp_internal::dcShift * mask); + auto index = options.constFind(shiftDcId(bareDc, mask)); if (index != options.cend()) { ip[address][protocol] = index->ip; flags[address][protocol] = index->flags; @@ -2077,7 +2089,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { retryTimer.stop(); _waitForConnectedTimer.stop(); - setState(MTProtoConnection::Connecting); + setState(ConnectingState); _pingId = _pingMsgId = _pingIdToSend = _pingSendAt = 0; _pingSender.stop(); @@ -2099,7 +2111,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { } } -void MTProtoConnectionPrivate::restart(bool mayBeBadKey) { +void ConnectionPrivate::restart(bool mayBeBadKey) { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData) return; @@ -2136,7 +2148,7 @@ void MTProtoConnectionPrivate::restart(bool mayBeBadKey) { setState(-retryTimeout); } -void MTProtoConnectionPrivate::onSentSome(uint64 size) { +void ConnectionPrivate::onSentSome(uint64 size) { if (!_waitForReceivedTimer.isActive()) { uint64 remain = _waitForReceived; if (!oldConnection) { @@ -2146,9 +2158,9 @@ void MTProtoConnectionPrivate::onSentSome(uint64 size) { DEBUG_LOG(("Checking connect for request with size %1 bytes, delay will be %2").arg(size).arg(remain)); } } - if (dc >= MTP::uplStart && dc < MTP::uplEnd) { + if (isUplDcId(dc)) { remain *= MTPUploadSessionsCount; - } else if (dc >= MTP::dldStart && dc < MTP::dldEnd) { + } else if (isDldDcId(dc)) { remain *= MTPDownloadSessionsCount; } _waitForReceivedTimer.start(remain); @@ -2156,7 +2168,7 @@ void MTProtoConnectionPrivate::onSentSome(uint64 size) { if (!firstSentAt) firstSentAt = getms(true); } -void MTProtoConnectionPrivate::onReceivedSome() { +void ConnectionPrivate::onReceivedSome() { if (oldConnection) { oldConnection = false; DEBUG_LOG(("This connection marked as not old!")); @@ -2172,13 +2184,13 @@ void MTProtoConnectionPrivate::onReceivedSome() { } } -void MTProtoConnectionPrivate::onOldConnection() { +void ConnectionPrivate::onOldConnection() { oldConnection = true; _waitForReceived = MTPMinReceiveDelay; DEBUG_LOG(("This connection marked as old! _waitForReceived now %1ms").arg(_waitForReceived)); } -void MTProtoConnectionPrivate::onPingSender() { +void ConnectionPrivate::onPingSender() { if (_pingId) { if (_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto - 1) * 1000ULL < getms(true)) { LOG(("Could not send ping for MTPPingSendAfter seconds, restarting..")); @@ -2191,7 +2203,7 @@ void MTProtoConnectionPrivate::onPingSender() { } } -void MTProtoConnectionPrivate::onPingSendForce() { +void ConnectionPrivate::onPingSendForce() { if (!_pingId) { _pingSendAt = 0; DEBUG_LOG(("Will send ping!")); @@ -2199,7 +2211,7 @@ void MTProtoConnectionPrivate::onPingSendForce() { } } -void MTProtoConnectionPrivate::onWaitReceivedFailed() { +void ConnectionPrivate::onWaitReceivedFailed() { if (cConnectionType() != dbictAuto && cConnectionType() != dbictTcpProxy) { return; } @@ -2216,7 +2228,7 @@ void MTProtoConnectionPrivate::onWaitReceivedFailed() { QTimer::singleShot(0, this, SLOT(socketStart())); } -void MTProtoConnectionPrivate::onWaitConnectedFailed() { +void ConnectionPrivate::onWaitConnectedFailed() { DEBUG_LOG(("MTP Info: can't connect in %1ms").arg(_waitForConnected)); if (_waitForConnected < MTPMaxConnectDelay) _waitForConnected *= 2; @@ -2227,7 +2239,7 @@ void MTProtoConnectionPrivate::onWaitConnectedFailed() { QTimer::singleShot(0, this, SLOT(socketStart())); } -void MTProtoConnectionPrivate::onWaitIPv4Failed() { +void ConnectionPrivate::onWaitIPv4Failed() { _conn = _conn6; destroyConn(&_conn4); @@ -2240,7 +2252,7 @@ void MTProtoConnectionPrivate::onWaitIPv4Failed() { } } -void MTProtoConnectionPrivate::doDisconnect() { +void ConnectionPrivate::doDisconnect() { destroyConn(); { @@ -2252,18 +2264,18 @@ void MTProtoConnectionPrivate::doDisconnect() { clearAuthKeyData(); - setState(MTProtoConnection::Disconnected); + setState(DisconnectedState); restarted = false; } -void MTProtoConnectionPrivate::doFinish() { +void ConnectionPrivate::doFinish() { doDisconnect(); _finished = true; emit finished(_owner); deleteLater(); } -void MTProtoConnectionPrivate::handleReceived() { +void ConnectionPrivate::handleReceived() { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData) return; @@ -2364,12 +2376,12 @@ void MTProtoConnectionPrivate::handleReceived() { badTime = true; } - bool wasConnected = (getState() == MTProtoConnection::Connected); + bool wasConnected = (getState() == ConnectedState); if (serverSalt != mySalt) { if (!badTime) { DEBUG_LOG(("MTP Info: other salt received.. received: %1, my salt: %2, updating..").arg(serverSalt).arg(mySalt)); sessionData->setSalt(serverSalt); - if (setState(MTProtoConnection::Connected, MTProtoConnection::Connecting)) { // only connected + if (setState(ConnectedState, ConnectingState)) { // only connected if (restarted) { emit resendAllAsync(); restarted = false; @@ -2441,7 +2453,7 @@ void MTProtoConnectionPrivate::handleReceived() { } if (!wasConnected) { - if (getState() == MTProtoConnection::Connected) { + if (getState() == ConnectedState) { emit needToSendAsync(); } } @@ -2451,7 +2463,7 @@ void MTProtoConnectionPrivate::handleReceived() { } } -int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime *end, uint64 msgId, int32 serverTime, uint64 serverSalt, bool badTime) { +int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime *end, uint64 msgId, int32 serverTime, uint64 serverSalt, bool badTime) { mtpTypeId cons = *from; try { @@ -2603,7 +2615,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt mtpRequestId requestId = wasSent(resendId); if (requestId) { LOG(("Message Error: bad message notification received, msgId %1, error_code %2, fatal: clearing callbacks").arg(data.vbad_msg_id.v).arg(errorCode)); - _mtp_internal::clearCallbacksDelayed(RPCCallbackClears(1, RPCCallbackClear(requestId, -errorCode))); + clearCallbacksDelayed(RPCCallbackClears(1, RPCCallbackClear(requestId, -errorCode))); } else { DEBUG_LOG(("Message Error: such message was not sent recently %1").arg(resendId)); } @@ -2628,7 +2640,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt sessionData->setSalt(serverSalt); unixtimeSet(serverTime); - if (setState(MTProtoConnection::Connected, MTProtoConnection::Connecting)) { // maybe only connected + if (setState(ConnectedState, ConnectingState)) { // maybe only connected if (restarted) { emit resendAllAsync(); restarted = false; @@ -2979,7 +2991,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt return 1; } -mtpBuffer MTProtoConnectionPrivate::ungzip(const mtpPrime *from, const mtpPrime *end) const { +mtpBuffer ConnectionPrivate::ungzip(const mtpPrime *from, const mtpPrime *end) const { MTPstring packed(from, end); // read packed string as serialized mtp string type uint32 packedLen = packed.c_string().v.size(), unpackedChunk = packedLen, unpackedLen = 0; @@ -3026,7 +3038,7 @@ mtpBuffer MTProtoConnectionPrivate::ungzip(const mtpPrime *from, const mtpPrime return result; } -bool MTProtoConnectionPrivate::requestsFixTimeSalt(const QVector &ids, int32 serverTime, uint64 serverSalt) { +bool ConnectionPrivate::requestsFixTimeSalt(const QVector &ids, int32 serverTime, uint64 serverSalt) { uint32 idsCount = ids.size(); for (uint32 i = 0; i < idsCount; ++i) { @@ -3039,7 +3051,7 @@ bool MTProtoConnectionPrivate::requestsFixTimeSalt(const QVector &ids, return false; } -void MTProtoConnectionPrivate::requestsAcked(const QVector &ids, bool byResponse) { +void ConnectionPrivate::requestsAcked(const QVector &ids, bool byResponse) { uint32 idsCount = ids.size(); DEBUG_LOG(("Message Info: requests acked, ids %1").arg(Logs::vector(ids))); @@ -3071,7 +3083,7 @@ void MTProtoConnectionPrivate::requestsAcked(const QVector &ids, bool b mtpRequestId reqId = req.value()->requestId; bool moveToAcked = byResponse; if (!moveToAcked) { // ignore ACK, if we need a response (if we have a handler) - moveToAcked = !_mtp_internal::hasCallbacks(reqId); + moveToAcked = !hasCallbacks(reqId); } if (moveToAcked) { wereAcked.insert(msgId, reqId); @@ -3089,7 +3101,7 @@ void MTProtoConnectionPrivate::requestsAcked(const QVector &ids, bool b mtpRequestId reqId = reqIt.value(); bool moveToAcked = byResponse; if (!moveToAcked) { // ignore ACK, if we need a response (if we have a handler) - moveToAcked = !_mtp_internal::hasCallbacks(reqId); + moveToAcked = !hasCallbacks(reqId); } if (moveToAcked) { QWriteLocker locker4(sessionData->toSendMutex()); @@ -3130,7 +3142,7 @@ void MTProtoConnectionPrivate::requestsAcked(const QVector &ids, bool b } if (clearedAcked.size()) { - _mtp_internal::clearCallbacksDelayed(clearedAcked); + clearCallbacksDelayed(clearedAcked); } if (toAckMore.size()) { @@ -3138,7 +3150,7 @@ void MTProtoConnectionPrivate::requestsAcked(const QVector &ids, bool b } } -void MTProtoConnectionPrivate::handleMsgsStates(const QVector &ids, const string &states, QVector &acked) { +void ConnectionPrivate::handleMsgsStates(const QVector &ids, const string &states, QVector &acked) { uint32 idsCount = ids.size(); if (!idsCount) { DEBUG_LOG(("Message Info: void ids vector in handleMsgsStates()")); @@ -3182,12 +3194,12 @@ void MTProtoConnectionPrivate::handleMsgsStates(const QVector &ids, con } } -void MTProtoConnectionPrivate::resend(quint64 msgId, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { +void ConnectionPrivate::resend(quint64 msgId, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { if (msgId == _pingMsgId) return; emit resendAsync(msgId, msCanWait, forceContainer, sendMsgStateInfo); } -void MTProtoConnectionPrivate::resendMany(QVector msgIds, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { +void ConnectionPrivate::resendMany(QVector msgIds, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { for (int32 i = 0, l = msgIds.size(); i < l; ++i) { if (msgIds.at(i) == _pingMsgId) { msgIds.remove(i); @@ -3197,7 +3209,7 @@ void MTProtoConnectionPrivate::resendMany(QVector msgIds, quint64 msCan emit resendManyAsync(msgIds, msCanWait, forceContainer, sendMsgStateInfo); } -void MTProtoConnectionPrivate::onConnected4() { +void ConnectionPrivate::onConnected4() { _waitForConnected = MTPMinConnectDelay; _waitForConnectedTimer.stop(); @@ -3223,7 +3235,7 @@ void MTProtoConnectionPrivate::onConnected4() { updateAuthKey(); } -void MTProtoConnectionPrivate::onConnected6() { +void ConnectionPrivate::onConnected6() { _waitForConnected = MTPMinConnectDelay; _waitForConnectedTimer.stop(); @@ -3243,7 +3255,7 @@ void MTProtoConnectionPrivate::onConnected6() { _waitForIPv4Timer.start(MTPIPv4ConnectionWaitTimeout); } -void MTProtoConnectionPrivate::onDisconnected4() { +void ConnectionPrivate::onDisconnected4() { if (_conn && _conn == _conn6) return; // disconnected the unused if (_conn || !_conn6) { @@ -3254,7 +3266,7 @@ void MTProtoConnectionPrivate::onDisconnected4() { } } -void MTProtoConnectionPrivate::onDisconnected6() { +void ConnectionPrivate::onDisconnected6() { if (_conn && _conn == _conn4) return; // disconnected the unused if (_conn || !_conn4) { @@ -3265,7 +3277,7 @@ void MTProtoConnectionPrivate::onDisconnected6() { } } -void MTProtoConnectionPrivate::updateAuthKey() { +void ConnectionPrivate::updateAuthKey() { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData || !_conn) return; @@ -3302,8 +3314,8 @@ void MTProtoConnectionPrivate::updateAuthKey() { return authKeyCreated(); } - authKeyData = new MTProtoConnectionPrivate::AuthKeyCreateData(); - authKeyStrings = new MTProtoConnectionPrivate::AuthKeyCreateStrings(); + authKeyData = new ConnectionPrivate::AuthKeyCreateData(); + authKeyStrings = new ConnectionPrivate::AuthKeyCreateStrings(); authKeyData->req_num = 0; authKeyData->nonce = MTP::nonce(); @@ -3317,13 +3329,13 @@ void MTProtoConnectionPrivate::updateAuthKey() { sendRequestNotSecure(req_pq); } -void MTProtoConnectionPrivate::clearMessages() { +void ConnectionPrivate::clearMessages() { if (keyId && keyId != mtpAuthKey::RecreateKeyId && _conn) { _conn->received().clear(); } } -void MTProtoConnectionPrivate::pqAnswered() { +void ConnectionPrivate::pqAnswered() { disconnect(_conn, SIGNAL(receivedData()), this, SLOT(pqAnswered())); DEBUG_LOG(("AuthKey Info: receiving Req_pq answer..")); @@ -3421,7 +3433,7 @@ void MTProtoConnectionPrivate::pqAnswered() { sendRequestNotSecure(req_DH_params); } -void MTProtoConnectionPrivate::dhParamsAnswered() { +void ConnectionPrivate::dhParamsAnswered() { disconnect(_conn, SIGNAL(receivedData()), this, SLOT(dhParamsAnswered())); DEBUG_LOG(("AuthKey Info: receiving Req_DH_params answer..")); @@ -3542,7 +3554,7 @@ void MTProtoConnectionPrivate::dhParamsAnswered() { return restart(); } -void MTProtoConnectionPrivate::dhClientParamsSend() { +void ConnectionPrivate::dhClientParamsSend() { if (++authKeyData->retries > 5) { LOG(("AuthKey Error: could not create auth_key for %1 retries").arg(authKeyData->retries - 1)); return restart(); @@ -3603,7 +3615,7 @@ void MTProtoConnectionPrivate::dhClientParamsSend() { sendRequestNotSecure(req_client_DH_params); } -void MTProtoConnectionPrivate::dhClientParamsAnswered() { +void ConnectionPrivate::dhClientParamsAnswered() { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData) return; @@ -3648,7 +3660,7 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { mtpAuthKeyPtr authKey(new mtpAuthKey()); authKey->setKey(authKeyData->auth_key); - authKey->setDC(dc % _mtp_internal::dcShift); + authKey->setDC(bareDcId(dc)); DEBUG_LOG(("AuthKey Info: auth key gen succeed, id: %1, server salt: %2, auth key: %3").arg(authKey->keyId()).arg(serverSalt).arg(Logs::mb(authKeyData->auth_key, 256).str())); @@ -3723,13 +3735,13 @@ void MTProtoConnectionPrivate::dhClientParamsAnswered() { return restart(); } -void MTProtoConnectionPrivate::authKeyCreated() { +void ConnectionPrivate::authKeyCreated() { clearAuthKeyData(); connect(_conn, SIGNAL(receivedData()), this, SLOT(handleReceived())); if (sessionData->getSalt()) { // else receive salt in bad_server_salt first, then try to send all the requests - setState(MTProtoConnection::Connected); + setState(ConnectedState); if (restarted) { emit resendAllAsync(); restarted = false; @@ -3741,7 +3753,7 @@ void MTProtoConnectionPrivate::authKeyCreated() { emit needToSendAsync(); } -void MTProtoConnectionPrivate::clearAuthKeyData() { +void ConnectionPrivate::clearAuthKeyData() { if (authKeyData) { #ifdef Q_OS_WIN SecureZeroMemory(authKeyData, sizeof(AuthKeyCreateData)); @@ -3759,7 +3771,7 @@ void MTProtoConnectionPrivate::clearAuthKeyData() { } } -void MTProtoConnectionPrivate::onError4(bool mayBeBadKey) { +void ConnectionPrivate::onError4(bool mayBeBadKey) { if (_conn && _conn == _conn6) return; // error in the unused if (_conn || !_conn6) { @@ -3773,7 +3785,7 @@ void MTProtoConnectionPrivate::onError4(bool mayBeBadKey) { } } -void MTProtoConnectionPrivate::onError6(bool mayBeBadKey) { +void ConnectionPrivate::onError6(bool mayBeBadKey) { if (_conn && _conn == _conn4) return; // error in the unused if (_conn || !_conn4) { @@ -3787,11 +3799,11 @@ void MTProtoConnectionPrivate::onError6(bool mayBeBadKey) { } } -void MTProtoConnectionPrivate::onReadyData() { +void ConnectionPrivate::onReadyData() { } template -void MTProtoConnectionPrivate::sendRequestNotSecure(const TRequest &request) { +void ConnectionPrivate::sendRequestNotSecure(const TRequest &request) { try { mtpBuffer buffer; uint32 requestSize = request.innerLength() >> 2; @@ -3821,7 +3833,7 @@ void MTProtoConnectionPrivate::sendRequestNotSecure(const TRequest &request) { } template -bool MTProtoConnectionPrivate::readResponseNotSecure(TResponse &response) { +bool ConnectionPrivate::readResponseNotSecure(TResponse &response) { onReceivedSome(); try { @@ -3858,7 +3870,7 @@ bool MTProtoConnectionPrivate::readResponseNotSecure(TResponse &response) { return true; } -bool MTProtoConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResponse, QReadLocker &lockFinished) { +bool ConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResponse, QReadLocker &lockFinished) { uint32 fullSize = request->size(); if (fullSize < 9) return false; @@ -3915,7 +3927,7 @@ bool MTProtoConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResp return true; } -mtpRequestId MTProtoConnectionPrivate::wasSent(mtpMsgId msgId) const { +mtpRequestId ConnectionPrivate::wasSent(mtpMsgId msgId) const { if (msgId == _pingMsgId) return mtpRequestId(0xFFFFFFFF); { QReadLocker locker(sessionData->haveSentMutex()); @@ -3938,24 +3950,24 @@ mtpRequestId MTProtoConnectionPrivate::wasSent(mtpMsgId msgId) const { return 0; } -void MTProtoConnectionPrivate::lockKey() { +void ConnectionPrivate::lockKey() { unlockKey(); sessionData->keyMutex()->lockForWrite(); myKeyLock = true; } -void MTProtoConnectionPrivate::unlockKey() { +void ConnectionPrivate::unlockKey() { if (myKeyLock) { myKeyLock = false; sessionData->keyMutex()->unlock(); } } -MTProtoConnectionPrivate::~MTProtoConnectionPrivate() { +ConnectionPrivate::~ConnectionPrivate() { t_assert(_finished && _conn == nullptr && _conn4 == nullptr && _conn6 == nullptr); } -void MTProtoConnectionPrivate::stop() { +void ConnectionPrivate::stop() { QWriteLocker lockFinished(&sessionDataMutex); if (sessionData) { if (myKeyLock) { @@ -3966,3 +3978,6 @@ void MTProtoConnectionPrivate::stop() { sessionData = nullptr; } } + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection.h b/Telegram/SourceFiles/mtproto/connection.h index 7a556b83ec..25cc61f281 100644 --- a/Telegram/SourceFiles/mtproto/connection.h +++ b/Telegram/SourceFiles/mtproto/connection.h @@ -23,50 +23,26 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/core_types.h" #include "mtproto/auth_key.h" -inline bool mtpRequestData::isSentContainer(const mtpRequest &request) { // "request-like" wrap for msgIds vector - if (request->size() < 9) return false; - return (!request->msDate && !(*request)[6]); // msDate = 0, seqNo = 0 -} -inline bool mtpRequestData::isStateRequest(const mtpRequest &request) { - if (request->size() < 9) return false; - return (mtpTypeId((*request)[8]) == mtpc_msgs_state_req); -} -inline bool mtpRequestData::needAck(const mtpRequest &request) { - if (request->size() < 9) return false; - return mtpRequestData::needAckByType((*request)[8]); -} -inline bool mtpRequestData::needAckByType(mtpTypeId type) { - switch (type) { - case mtpc_msg_container: - case mtpc_msgs_ack: - case mtpc_http_wait: - case mtpc_bad_msg_notification: - case mtpc_msgs_all_info: - case mtpc_msgs_state_info: - case mtpc_msg_detailed_info: - case mtpc_msg_new_detailed_info: - return false; - } - return true; -} +namespace MTP { +namespace internal { -class MTProtoConnectionPrivate; -class MTPSessionData; +class ConnectionPrivate; +class SessionData; -class MTPThread : public QThread { +class Thread : public QThread { Q_OBJECT public: - MTPThread(); + Thread(); uint32 getThreadId() const; - ~MTPThread(); + ~Thread(); private: uint32 _threadId; }; -class MTProtoConnection { +class Connection { public: enum ConnectionType { @@ -74,19 +50,13 @@ public: HttpConnection }; - MTProtoConnection(); - int32 start(MTPSessionData *data, int32 dc = 0); // return dc + Connection(); + int32 start(SessionData *data, int32 dc = 0); // return dc void kill(); void waitTillFinish(); - ~MTProtoConnection(); + ~Connection(); - enum { - Disconnected = 0, - Connecting = 1, - Connected = 2, - - UpdateAlways = 666 - }; + static const int UpdateAlways = 666; int32 state() const; QString transport() const; @@ -94,18 +64,22 @@ public: private: QThread *thread; - MTProtoConnectionPrivate *data; + ConnectionPrivate *data; }; -class MTPabstractConnection : public QObject { +class AbstractConnection : public QObject { Q_OBJECT typedef QList BuffersQueue; public: - MTPabstractConnection() : _sentEncrypted(false) { + AbstractConnection() : _sentEncrypted(false) { + } + AbstractConnection(const AbstractConnection &other) = delete; + AbstractConnection &operator=(const AbstractConnection &other) = delete; + virtual ~AbstractConnection() = 0{ } void setSentEncrypted() { @@ -149,12 +123,14 @@ protected: }; -class MTPabstractTcpConnection : public MTPabstractConnection { +class AbstractTcpConnection : public AbstractConnection { Q_OBJECT public: - MTPabstractTcpConnection(); + AbstractTcpConnection(); + virtual ~AbstractTcpConnection() = 0 { + } public slots: @@ -174,12 +150,12 @@ protected: }; -class MTPautoConnection : public MTPabstractTcpConnection { +class AutoConnection : public AbstractTcpConnection { Q_OBJECT public: - MTPautoConnection(QThread *thread); + AutoConnection(QThread *thread); void sendData(mtpBuffer &buffer) override; void disconnectFromServer() override; @@ -239,12 +215,12 @@ private: }; -class MTPtcpConnection : public MTPabstractTcpConnection { +class TCPConnection : public AbstractTcpConnection { Q_OBJECT public: - MTPtcpConnection(QThread *thread); + TCPConnection(QThread *thread); void sendData(mtpBuffer &buffer) override; void disconnectFromServer() override; @@ -287,12 +263,12 @@ private: }; -class MTPhttpConnection : public MTPabstractConnection { +class HTTPConnection : public AbstractConnection { Q_OBJECT public: - MTPhttpConnection(QThread *thread); + HTTPConnection(QThread *thread); void sendData(mtpBuffer &buffer) override; void disconnectFromServer() override; @@ -330,13 +306,13 @@ private: }; -class MTProtoConnectionPrivate : public QObject { +class ConnectionPrivate : public QObject { Q_OBJECT public: - MTProtoConnectionPrivate(QThread *thread, MTProtoConnection *owner, MTPSessionData *data, uint32 dc); - ~MTProtoConnectionPrivate(); + ConnectionPrivate(QThread *thread, Connection *owner, SessionData *data, uint32 dc); + ~ConnectionPrivate(); void stop(); @@ -361,7 +337,7 @@ signals: void resendManyAsync(QVector msgIds, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo); void resendAllAsync(); - void finished(MTProtoConnection *connection); + void finished(Connection *connection); public slots: @@ -412,7 +388,7 @@ private: void doDisconnect(); void createConn(bool createIPv4, bool createIPv6); - void destroyConn(MTPabstractConnection **conn = 0); // 0 - destory all + void destroyConn(AbstractConnection **conn = 0); // 0 - destory all mtpMsgId placeToContainer(mtpRequest &toSendRequest, mtpMsgId &bigMsgId, mtpMsgId *&haveSentArr, mtpRequest &req); mtpMsgId prepareToSend(mtpRequest &request, mtpMsgId currentLastId); @@ -427,7 +403,7 @@ private: void clearMessages(); - bool setState(int32 state, int32 ifState = MTProtoConnection::UpdateAlways); + bool setState(int32 state, int32 ifState = Connection::UpdateAlways); mutable QReadWriteLock stateConnMutex; int32 _state; @@ -435,8 +411,8 @@ private: void resetSession(); uint32 dc; - MTProtoConnection *_owner; - MTPabstractConnection *_conn, *_conn4, *_conn6; + Connection *_owner; + AbstractConnection *_conn, *_conn4, *_conn6; SingleTimer retryTimer; // exp retry timer int retryTimeout; @@ -475,7 +451,8 @@ private: uint64 keyId; QReadWriteLock sessionDataMutex; - MTPSessionData *sessionData; + SessionData *sessionData; + bool myKeyLock; void lockKey(); void unlockKey(); @@ -523,3 +500,6 @@ private: void clearAuthKeyData(); }; + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/core_types.h b/Telegram/SourceFiles/mtproto/core_types.h index 040d59567b..592f6ad858 100644 --- a/Telegram/SourceFiles/mtproto/core_types.h +++ b/Telegram/SourceFiles/mtproto/core_types.h @@ -22,35 +22,16 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "types.h" -#undef min -#undef max +namespace MTP { -//#define DEBUG_MTPPRIME +// type DcId represents actual data center id, while in most cases +// we use some shifted ids, like DcId() + X * DCShift +typedef int32 DcId; +typedef int32 ShiftedDcId; + +} -#ifdef DEBUG_MTPPRIME -class mtpPrime { // for debug visualization, not like int32 :( in default constructor -public: - explicit mtpPrime() : _v(0) { - } - mtpPrime(int32 v) : _v(v) { - } - mtpPrime &operator=(int32 v) { - _v = v; - return (*this); - } - operator int32&() { - return _v; - } - operator const int32 &() const { - return _v; - } -private: - int32 _v; -}; -#else typedef int32 mtpPrime; -#endif - typedef int32 mtpRequestId; typedef uint64 mtpMsgId; typedef uint64 mtpPingId; @@ -1072,3 +1053,30 @@ extern const MTPVector MTPnullEntities; extern const MTPMessageFwdHeader MTPnullFwdHeader; QString stickerSetTitle(const MTPDstickerSet &s); + +inline bool mtpRequestData::isSentContainer(const mtpRequest &request) { // "request-like" wrap for msgIds vector + if (request->size() < 9) return false; + return (!request->msDate && !(*request)[6]); // msDate = 0, seqNo = 0 +} +inline bool mtpRequestData::isStateRequest(const mtpRequest &request) { + if (request->size() < 9) return false; + return (mtpTypeId((*request)[8]) == mtpc_msgs_state_req); +} +inline bool mtpRequestData::needAck(const mtpRequest &request) { + if (request->size() < 9) return false; + return mtpRequestData::needAckByType((*request)[8]); +} +inline bool mtpRequestData::needAckByType(mtpTypeId type) { + switch (type) { + case mtpc_msg_container: + case mtpc_msgs_ack: + case mtpc_http_wait: + case mtpc_bad_msg_notification: + case mtpc_msgs_all_info: + case mtpc_msgs_state_info: + case mtpc_msg_detailed_info: + case mtpc_msg_new_detailed_info: + return false; + } + return true; +} diff --git a/Telegram/SourceFiles/mtproto/dcenter.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp index 470e0e2282..577c37bd81 100644 --- a/Telegram/SourceFiles/mtproto/dcenter.cpp +++ b/Telegram/SourceFiles/mtproto/dcenter.cpp @@ -82,7 +82,7 @@ void mtpLogoutOtherDCs() { } for (int32 i = 0, cnt = dcs.size(); i != cnt; ++i) { if (dcs[i] != MTP::maindc()) { - logoutGuestMap.insert(MTP::lgt + dcs[i], MTP::send(MTPauth_LogOut(), rpcDone(&logoutDone), rpcFail(&logoutDone), MTP::lgt + dcs[i])); + logoutGuestMap.insert(MTP::lgtDcId(dcs[i]), MTP::send(MTPauth_LogOut(), rpcDone(&logoutDone), rpcFail(&logoutDone), MTP::lgtDcId(dcs[i]))); } } } @@ -193,7 +193,7 @@ void mtpUpdateDcOptions(const QVector &options) { } 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); + int32 id = optData.vid.v, idWithShift = MTP::shiftDcId(id, optData.vflags.v); if (already.constFind(idWithShift) == already.cend()) { already.insert(idWithShift); auto a = opts.constFind(idWithShift); @@ -243,7 +243,7 @@ void MTProtoConfigLoader::done() { _enumRequest = 0; } if (_enumCurrent) { - MTP::killSession(MTP::cfg + _enumCurrent); + MTP::killSession(MTP::cfgDcId(_enumCurrent)); _enumCurrent = 0; } emit loaded(); @@ -257,14 +257,14 @@ void MTProtoConfigLoader::enumDC() { if (!_enumCurrent) { _enumCurrent = mainDC; } else { - MTP::killSession(MTP::cfg + _enumCurrent); + MTP::killSession(MTP::cfgDcId(_enumCurrent)); } OrderedSet dcs; { QReadLocker lock(mtpDcOptionsMutex()); const MTP::DcOptions &options(Global::DcOptions()); for (auto i = options.cbegin(), e = options.cend(); i != e; ++i) { - dcs.insert(i.key() % _mtp_internal::dcShift); + dcs.insert(MTP::bareDcId(i.key())); } } OrderedSet::const_iterator i = dcs.constFind(_enumCurrent); @@ -273,7 +273,7 @@ void MTProtoConfigLoader::enumDC() { } else { _enumCurrent = i.key(); } - _enumRequest = MTP::send(MTPhelp_GetConfig(), rpcDone(configLoaded), rpcFail(configFailed), MTP::cfg + _enumCurrent); + _enumRequest = MTP::send(MTPhelp_GetConfig(), rpcDone(configLoaded), rpcFail(configFailed), MTP::cfgDcId(_enumCurrent)); _enumDCTimer.start(MTPEnumDCTimeout); } diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index c63e6834bc..bb98d37f07 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -24,10 +24,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" +namespace MTP { + namespace { - typedef QMap Sessions; + + typedef QMap Sessions; Sessions sessions; - MTProtoSession *mainSession; + internal::Session *mainSession; typedef QMap RequestsByDC; // holds dcWithShift for request to this dc or -dc for request to main dc RequestsByDC requestsByDC; @@ -62,7 +65,7 @@ namespace { typedef QMap AuthWaiters; // holds request ids waiting for auth import to specific dc AuthWaiters authWaiters; - typedef OrderedSet MTPQuittingConnections; + typedef OrderedSet MTPQuittingConnections; MTPQuittingConnections quittingConnections; QMutex toClearLock; @@ -71,7 +74,7 @@ namespace { RPCResponseHandler globalHandler; MTPStateChangedHandler stateChangedHandler = 0; MTPSessionResetHandler sessionResetHandler = 0; - _mtp_internal::GlobalSlotCarrier *_globalSlotCarrier = 0; + internal::GlobalSlotCarrier *_globalSlotCarrier = 0; void importDone(const MTPauth_Authorization &result, mtpRequestId req) { QMutexLocker locker1(&requestByDCLock); @@ -79,11 +82,11 @@ namespace { RequestsByDC::iterator i = requestsByDC.find(req); if (i == requestsByDC.end()) { LOG(("MTP Error: auth import request not found in requestsByDC, requestId: %1").arg(req)); - RPCError error(rpcClientError("AUTH_IMPORT_FAIL", QString("did not find import request in requestsByDC, request %1").arg(req))); - if (globalHandler.onFail && MTP::authedId()) (*globalHandler.onFail)(req, error); // auth failed in main dc + RPCError error(internal::rpcClientError("AUTH_IMPORT_FAIL", QString("did not find import request in requestsByDC, request %1").arg(req))); + if (globalHandler.onFail && authedId()) (*globalHandler.onFail)(req, error); // auth failed in main dc return; } - int32 newdc = i.value() % _mtp_internal::dcShift; + DcId newdc = bareDcId(i.value()); DEBUG_LOG(("MTP Info: auth import to dc %1 succeeded").arg(newdc)); @@ -105,16 +108,15 @@ namespace { continue; } if (k.value() < 0) { - MTP::setdc(newdc); + setdc(newdc); k.value() = -newdc; } else { - int32 shift = k.value() - (k.value() % _mtp_internal::dcShift); - dcWithShift += shift; + dcWithShift += getDcIdShift(k.value()); k.value() = dcWithShift; } DEBUG_LOG(("MTP Info: resending request %1 to dc %2 after import auth").arg(requestId).arg(k.value())); } - if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift)) { + if (internal::Session *session = internal::getSession(dcWithShift)) { session->sendPrepared(j.value()); } } @@ -125,7 +127,7 @@ namespace { bool importFail(const RPCError &error, mtpRequestId req) { if (mtpIsFlood(error)) return false; - if (globalHandler.onFail && MTP::authedId()) (*globalHandler.onFail)(req, error); // auth import failed + if (globalHandler.onFail && authedId()) (*globalHandler.onFail)(req, error); // auth import failed return true; } @@ -133,13 +135,13 @@ namespace { AuthExportRequests::const_iterator i = authExportRequests.constFind(req); if (i == authExportRequests.cend()) { LOG(("MTP Error: auth export request target dcWithShift not found, requestId: %1").arg(req)); - RPCError error(rpcClientError("AUTH_IMPORT_FAIL", QString("did not find target dcWithShift, request %1").arg(req))); - if (globalHandler.onFail && MTP::authedId()) (*globalHandler.onFail)(req, error); // auth failed in main dc + RPCError error(internal::rpcClientError("AUTH_IMPORT_FAIL", QString("did not find target dcWithShift, request %1").arg(req))); + if (globalHandler.onFail && authedId()) (*globalHandler.onFail)(req, error); // auth failed in main dc return; } const MTPDauth_exportedAuthorization &data(result.c_auth_exportedAuthorization()); - MTP::send(MTPauth_ImportAuthorization(data.vid, data.vbytes), rpcDone(importDone), rpcFail(importFail), i.value()); + send(MTPauth_ImportAuthorization(data.vid, data.vbytes), rpcDone(importDone), rpcFail(importFail), i.value()); authExportRequests.remove(req); } @@ -148,9 +150,9 @@ namespace { AuthExportRequests::const_iterator i = authExportRequests.constFind(req); if (i != authExportRequests.cend()) { - authWaiters[i.value() % _mtp_internal::dcShift].clear(); + authWaiters[bareDcId(i.value())].clear(); } - if (globalHandler.onFail && MTP::authedId()) (*globalHandler.onFail)(req, error); // auth failed in main dc + if (globalHandler.onFail && authedId()) (*globalHandler.onFail)(req, error); // auth failed in main dc return true; } @@ -179,11 +181,11 @@ namespace { DEBUG_LOG(("MTP Info: changing request %1 from dcWithShift%2 to dc%3").arg(requestId).arg(dcWithShift).arg(newdcWithShift)); if (dcWithShift < 0) { // newdc shift = 0 - if (false && MTP::authedId() && !authExportRequests.contains(requestId)) { // migrate not supported at this moment + if (false && authedId() && !authExportRequests.contains(requestId)) { // migrate not supported at this moment DEBUG_LOG(("MTP Info: importing auth to dc %1").arg(newdcWithShift)); DCAuthWaiters &waiters(authWaiters[newdcWithShift]); if (!waiters.size()) { - authExportRequests.insert(MTP::send(MTPauth_ExportAuthorization(MTP_int(newdcWithShift)), rpcDone(exportDone), rpcFail(exportFail)), newdcWithShift); + authExportRequests.insert(send(MTPauth_ExportAuthorization(MTP_int(newdcWithShift)), rpcDone(exportDone), rpcFail(exportFail)), newdcWithShift); } waiters.push_back(requestId); return true; @@ -191,8 +193,7 @@ namespace { MTP::setdc(newdcWithShift); } } else { - int32 shift = dcWithShift - (dcWithShift % _mtp_internal::dcShift); - newdcWithShift += shift; + newdcWithShift += MTP::getDcIdShift(dcWithShift); } mtpRequest req; @@ -205,8 +206,8 @@ namespace { } req = i.value(); } - if (MTProtoSession *session = _mtp_internal::getSession(newdcWithShift)) { - _mtp_internal::registerRequest(requestId, (dcWithShift < 0) ? -newdcWithShift : newdcWithShift); + if (internal::Session *session = internal::getSession(newdcWithShift)) { + internal::registerRequest(requestId, (dcWithShift < 0) ? -newdcWithShift : newdcWithShift); session->sendPrepared(req); } return true; @@ -247,8 +248,8 @@ namespace { LOG(("MTP Error: unauthorized request without dc info, requestId %1").arg(requestId)); } } - int32 newdc = abs(dcWithShift) % _mtp_internal::dcShift; - if (!newdc || newdc == mtpMainDC() || !MTP::authedId()) { + int32 newdc = bareDcId(qAbs(dcWithShift)); + if (!newdc || newdc == mtpMainDC() || !authedId()) { if (!badGuestDC && globalHandler.onFail) (*globalHandler.onFail)(requestId, error); // auth failed in main dc return false; } @@ -256,7 +257,7 @@ namespace { DEBUG_LOG(("MTP Info: importing auth to dcWithShift %1").arg(dcWithShift)); DCAuthWaiters &waiters(authWaiters[newdc]); if (!waiters.size()) { - authExportRequests.insert(MTP::send(MTPauth_ExportAuthorization(MTP_int(newdc)), rpcDone(exportDone), rpcFail(exportFail)), abs(dcWithShift)); + authExportRequests.insert(send(MTPauth_ExportAuthorization(MTP_int(newdc)), rpcDone(exportDone), rpcFail(exportFail)), abs(dcWithShift)); } waiters.push_back(requestId); if (badGuestDC) badGuestDCRequests.insert(requestId); @@ -284,7 +285,7 @@ namespace { } if (!dcWithShift) return false; - if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { + if (internal::Session *session = internal::getSession(qAbs(dcWithShift))) { req->needsLayer = true; session->sendPrepared(req); } @@ -322,12 +323,12 @@ namespace { if (!dcWithShift) return false; if (!req->after) { - if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { + if (internal::Session *session = internal::getSession(qAbs(dcWithShift))) { req->needsLayer = true; session->sendPrepared(req); } } else { - int32 newdc = abs(dcWithShift) % _mtp_internal::dcShift; + int32 newdc = bareDcId(qAbs(dcWithShift)); DCAuthWaiters &waiters(authWaiters[newdc]); if (waiters.indexOf(req->after->requestId) >= 0) { if (waiters.indexOf(requestId) < 0) { @@ -360,553 +361,547 @@ namespace { bool _paused = false; +} // namespace + +namespace internal { + +Session *getSession(ShiftedDcId shiftedDcId) { + if (!_started) return nullptr; + if (!shiftedDcId) return mainSession; + if (!bareDcId(shiftedDcId)) { + shiftedDcId += bareDcId(mainSession->getDcWithShift()); + } + + Sessions::const_iterator i = sessions.constFind(shiftedDcId); + if (i == sessions.cend()) { + i = sessions.insert(shiftedDcId, new Session(shiftedDcId)); + } + return i.value(); } -namespace _mtp_internal { - MTProtoSession *getSession(int32 dcWithShift) { - if (!_started) return 0; - if (!dcWithShift) return mainSession; - if (!(dcWithShift % _mtp_internal::dcShift)) { - dcWithShift += (mainSession->getDcWithShift() % _mtp_internal::dcShift); - } - - Sessions::const_iterator i = sessions.constFind(dcWithShift); - if (i == sessions.cend()) { - i = sessions.insert(dcWithShift, new MTProtoSession(dcWithShift)); - } - return i.value(); - } - - bool paused() { - return _paused; - } - - void registerRequest(mtpRequestId requestId, int32 dcWithShift) { - { - QMutexLocker locker(&requestByDCLock); - requestsByDC.insert(requestId, dcWithShift); - } - _mtp_internal::performDelayedClear(); // need to do it somewhere.. - } - - void unregisterRequest(mtpRequestId requestId) { - requestsDelays.remove(requestId); - - { - QWriteLocker locker(&requestMapLock); - requestMap.remove(requestId); - } +bool paused() { + return _paused; +} +void registerRequest(mtpRequestId requestId, int32 dcWithShift) { + { QMutexLocker locker(&requestByDCLock); - requestsByDC.remove(requestId); + requestsByDC.insert(requestId, dcWithShift); + } + internal::performDelayedClear(); // need to do it somewhere.. +} + +void unregisterRequest(mtpRequestId requestId) { + requestsDelays.remove(requestId); + + { + QWriteLocker locker(&requestMapLock); + requestMap.remove(requestId); } - mtpRequestId storeRequest(mtpRequest &request, const RPCResponseHandler &parser) { - mtpRequestId res = reqid(); - request->requestId = res; - if (parser.onDone || parser.onFail) { - QMutexLocker locker(&parserMapLock); - parserMap.insert(res, parser); - } - { - QWriteLocker locker(&requestMapLock); - requestMap.insert(res, request); - } - return res; - } + QMutexLocker locker(&requestByDCLock); + requestsByDC.remove(requestId); +} - mtpRequest getRequest(mtpRequestId reqId) { - static mtpRequest zero; - mtpRequest req; - { - QReadLocker locker(&requestMapLock); - RequestMap::const_iterator i = requestMap.constFind(reqId); - req = (i == requestMap.cend()) ? zero : i.value(); - } - return req; +mtpRequestId storeRequest(mtpRequest &request, const RPCResponseHandler &parser) { + mtpRequestId res = reqid(); + request->requestId = res; + if (parser.onDone || parser.onFail) { + QMutexLocker locker(&parserMapLock); + parserMap.insert(res, parser); } + { + QWriteLocker locker(&requestMapLock); + requestMap.insert(res, request); + } + return res; +} - void wrapInvokeAfter(mtpRequest &to, const mtpRequest &from, const mtpRequestMap &haveSent, int32 skipBeforeRequest) { - mtpMsgId afterId(*(mtpMsgId*)(from->after->data() + 4)); - mtpRequestMap::const_iterator i = afterId ? haveSent.constFind(afterId) : haveSent.cend(); - int32 size = to->size(), lenInInts = (from.innerLength() >> 2), headlen = 4, fulllen = headlen + lenInInts; - if (i == haveSent.constEnd()) { // no invoke after or such msg was not sent or was completed recently - to->resize(size + fulllen + skipBeforeRequest); - if (skipBeforeRequest) { - memcpy(to->data() + size, from->constData() + 4, headlen * sizeof(mtpPrime)); - memcpy(to->data() + size + headlen + skipBeforeRequest, from->constData() + 4 + headlen, lenInInts * sizeof(mtpPrime)); - } else { - memcpy(to->data() + size, from->constData() + 4, fulllen * sizeof(mtpPrime)); - } - } else { - to->resize(size + fulllen + skipBeforeRequest + 3); +mtpRequest getRequest(mtpRequestId reqId) { + static mtpRequest zero; + mtpRequest req; + { + QReadLocker locker(&requestMapLock); + RequestMap::const_iterator i = requestMap.constFind(reqId); + req = (i == requestMap.cend()) ? zero : i.value(); + } + return req; +} + +void wrapInvokeAfter(mtpRequest &to, const mtpRequest &from, const mtpRequestMap &haveSent, int32 skipBeforeRequest) { + mtpMsgId afterId(*(mtpMsgId*)(from->after->data() + 4)); + mtpRequestMap::const_iterator i = afterId ? haveSent.constFind(afterId) : haveSent.cend(); + int32 size = to->size(), lenInInts = (from.innerLength() >> 2), headlen = 4, fulllen = headlen + lenInInts; + if (i == haveSent.constEnd()) { // no invoke after or such msg was not sent or was completed recently + to->resize(size + fulllen + skipBeforeRequest); + if (skipBeforeRequest) { memcpy(to->data() + size, from->constData() + 4, headlen * sizeof(mtpPrime)); - (*to)[size + 3] += 3 * sizeof(mtpPrime); - *((mtpTypeId*)&((*to)[size + headlen + skipBeforeRequest])) = mtpc_invokeAfterMsg; - memcpy(to->data() + size + headlen + skipBeforeRequest + 1, &afterId, 2 * sizeof(mtpPrime)); - memcpy(to->data() + size + headlen + skipBeforeRequest + 3, from->constData() + 4 + headlen, lenInInts * sizeof(mtpPrime)); - if (size + 3 != 7) (*to)[7] += 3 * sizeof(mtpPrime); - } - } - - void clearCallbacks(mtpRequestId requestId, int32 errorCode) { - RPCResponseHandler h; - bool found = false; - { - QMutexLocker locker(&parserMapLock); - ParserMap::iterator i = parserMap.find(requestId); - if (i != parserMap.end()) { - h = i.value(); - found = true; - - parserMap.erase(i); - } - } - if (errorCode && found) { - rpcErrorOccured(requestId, h, rpcClientError("CLEAR_CALLBACK", QString("did not handle request %1, error code %2").arg(requestId).arg(errorCode))); - } - } - - void clearCallbacksDelayed(const RPCCallbackClears &requestIds) { - uint32 idsCount = requestIds.size(); - if (!idsCount) return; - - if (cDebug()) { - QString idsStr = QString("%1").arg(requestIds[0].requestId); - for (uint32 i = 1; i < idsCount; ++i) { - idsStr += QString(", %1").arg(requestIds[i].requestId); - } - DEBUG_LOG(("RPC Info: clear callbacks delayed, msgIds: %1").arg(idsStr)); - } - - QMutexLocker lock(&toClearLock); - uint32 toClearNow = toClear.size(); - if (toClearNow) { - toClear.resize(toClearNow + idsCount); - memcpy(toClear.data() + toClearNow, requestIds.constData(), idsCount * sizeof(RPCCallbackClear)); + memcpy(to->data() + size + headlen + skipBeforeRequest, from->constData() + 4 + headlen, lenInInts * sizeof(mtpPrime)); } else { - toClear = requestIds; + memcpy(to->data() + size, from->constData() + 4, fulllen * sizeof(mtpPrime)); + } + } else { + to->resize(size + fulllen + skipBeforeRequest + 3); + memcpy(to->data() + size, from->constData() + 4, headlen * sizeof(mtpPrime)); + (*to)[size + 3] += 3 * sizeof(mtpPrime); + *((mtpTypeId*)&((*to)[size + headlen + skipBeforeRequest])) = mtpc_invokeAfterMsg; + memcpy(to->data() + size + headlen + skipBeforeRequest + 1, &afterId, 2 * sizeof(mtpPrime)); + memcpy(to->data() + size + headlen + skipBeforeRequest + 3, from->constData() + 4 + headlen, lenInInts * sizeof(mtpPrime)); + if (size + 3 != 7) (*to)[7] += 3 * sizeof(mtpPrime); + } +} + +void clearCallbacks(mtpRequestId requestId, int32 errorCode) { + RPCResponseHandler h; + bool found = false; + { + QMutexLocker locker(&parserMapLock); + ParserMap::iterator i = parserMap.find(requestId); + if (i != parserMap.end()) { + h = i.value(); + found = true; + + parserMap.erase(i); } } + if (errorCode && found) { + rpcErrorOccured(requestId, h, rpcClientError("CLEAR_CALLBACK", QString("did not handle request %1, error code %2").arg(requestId).arg(errorCode))); + } +} - void performDelayedClear() { - QMutexLocker lock(&toClearLock); - if (!toClear.isEmpty()) { - for (RPCCallbackClears::iterator i = toClear.begin(), e = toClear.end(); i != e; ++i) { - if (cDebug()) { - QMutexLocker locker(&parserMapLock); - if (parserMap.find(i->requestId) != parserMap.end()) { - DEBUG_LOG(("RPC Info: clearing delayed callback %1, error code %2").arg(i->requestId).arg(i->errorCode)); - } - } - clearCallbacks(i->requestId, i->errorCode); - _mtp_internal::unregisterRequest(i->requestId); - } - toClear.clear(); +void clearCallbacksDelayed(const RPCCallbackClears &requestIds) { + uint32 idsCount = requestIds.size(); + if (!idsCount) return; + + if (cDebug()) { + QString idsStr = QString("%1").arg(requestIds[0].requestId); + for (uint32 i = 1; i < idsCount; ++i) { + idsStr += QString(", %1").arg(requestIds[i].requestId); } + DEBUG_LOG(("RPC Info: clear callbacks delayed, msgIds: %1").arg(idsStr)); } - void execCallback(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) { - RPCResponseHandler h; - { - QMutexLocker locker(&parserMapLock); - ParserMap::iterator i = parserMap.find(requestId); - if (i != parserMap.cend()) { - h = i.value(); - parserMap.erase(i); + QMutexLocker lock(&toClearLock); + uint32 toClearNow = toClear.size(); + if (toClearNow) { + toClear.resize(toClearNow + idsCount); + memcpy(toClear.data() + toClearNow, requestIds.constData(), idsCount * sizeof(RPCCallbackClear)); + } else { + toClear = requestIds; + } +} - DEBUG_LOG(("RPC Info: found parser for request %1, trying to parse response..").arg(requestId)); - } - } - if (h.onDone || h.onFail) { - try { - if (from >= end) throw mtpErrorInsufficient(); - - if (*from == mtpc_rpc_error) { - RPCError err(MTPRpcError(from, end)); - DEBUG_LOG(("RPC Info: error received, code %1, type %2, description: %3").arg(err.code()).arg(err.type()).arg(err.description())); - if (!rpcErrorOccured(requestId, h, err)) { - QMutexLocker locker(&parserMapLock); - parserMap.insert(requestId, h); - return; - } - } else { - if (h.onDone) { -// t_assert(App::app() != 0); - (*h.onDone)(requestId, from, end); - } +void performDelayedClear() { + QMutexLocker lock(&toClearLock); + if (!toClear.isEmpty()) { + for (RPCCallbackClears::iterator i = toClear.begin(), e = toClear.end(); i != e; ++i) { + if (cDebug()) { + QMutexLocker locker(&parserMapLock); + if (parserMap.find(i->requestId) != parserMap.end()) { + DEBUG_LOG(("RPC Info: clearing delayed callback %1, error code %2").arg(i->requestId).arg(i->errorCode)); } - } catch (Exception &e) { - if (!rpcErrorOccured(requestId, h, rpcClientError("RESPONSE_PARSE_FAILED", QString("exception text: ") + e.what()))) { + } + clearCallbacks(i->requestId, i->errorCode); + internal::unregisterRequest(i->requestId); + } + toClear.clear(); + } +} + +void execCallback(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) { + RPCResponseHandler h; + { + QMutexLocker locker(&parserMapLock); + ParserMap::iterator i = parserMap.find(requestId); + if (i != parserMap.cend()) { + h = i.value(); + parserMap.erase(i); + + DEBUG_LOG(("RPC Info: found parser for request %1, trying to parse response..").arg(requestId)); + } + } + if (h.onDone || h.onFail) { + try { + if (from >= end) throw mtpErrorInsufficient(); + + if (*from == mtpc_rpc_error) { + RPCError err(MTPRpcError(from, end)); + DEBUG_LOG(("RPC Info: error received, code %1, type %2, description: %3").arg(err.code()).arg(err.type()).arg(err.description())); + if (!rpcErrorOccured(requestId, h, err)) { QMutexLocker locker(&parserMapLock); parserMap.insert(requestId, h); return; } - } - } else { - DEBUG_LOG(("RPC Info: parser not found for %1").arg(requestId)); - } - unregisterRequest(requestId); - } - - bool hasCallbacks(mtpRequestId requestId) { - QMutexLocker locker(&parserMapLock); - ParserMap::iterator i = parserMap.find(requestId); - return (i != parserMap.cend()); - } - - void globalCallback(const mtpPrime *from, const mtpPrime *end) { - if (globalHandler.onDone) (*globalHandler.onDone)(0, from, end); // some updates were received - } - - void onStateChange(int32 dcWithShift, int32 state) { - if (stateChangedHandler) stateChangedHandler(dcWithShift, state); - } - - void onSessionReset(int32 dcWithShift) { - if (sessionResetHandler) sessionResetHandler(dcWithShift); - } - - bool rpcErrorOccured(mtpRequestId requestId, const RPCFailHandlerPtr &onFail, const RPCError &err) { // return true if need to clean request data - if (mtpIsFlood(err)) { - if (onFail && (*onFail)(requestId, err)) return true; - } - - if (onErrorDefault(requestId, err)) { - return false; - } - LOG(("RPC Error: request %1 got fail with code %2, error %3%4").arg(requestId).arg(err.code()).arg(err.type()).arg(err.description().isEmpty() ? QString() : QString(": %1").arg(err.description()))); - onFail && (*onFail)(requestId, err); - return true; - } - - GlobalSlotCarrier::GlobalSlotCarrier() { - connect(&_timer, SIGNAL(timeout()), this, SLOT(checkDelayed())); - } - - void GlobalSlotCarrier::checkDelayed() { - uint64 now = getms(true); - while (!delayedRequests.isEmpty() && now >= delayedRequests.front().second) { - mtpRequestId requestId = delayedRequests.front().first; - delayedRequests.pop_front(); - - int32 dcWithShift = 0; - { - QMutexLocker locker(&requestByDCLock); - RequestsByDC::const_iterator i = requestsByDC.constFind(requestId); - if (i != requestsByDC.cend()) { - dcWithShift = i.value(); - } else { - LOG(("MTP Error: could not find request dc for delayed resend, requestId %1").arg(requestId)); - continue; + } else { + if (h.onDone) { +// t_assert(App::app() != 0); + (*h.onDone)(requestId, from, end); } } - - mtpRequest req; - { - QReadLocker locker(&requestMapLock); - RequestMap::const_iterator j = requestMap.constFind(requestId); - if (j == requestMap.cend()) { - DEBUG_LOG(("MTP Error: could not find request %1").arg(requestId)); - continue; - } - req = j.value(); + } catch (Exception &e) { + if (!rpcErrorOccured(requestId, h, rpcClientError("RESPONSE_PARSE_FAILED", QString("exception text: ") + e.what()))) { + QMutexLocker locker(&parserMapLock); + parserMap.insert(requestId, h); + return; } - if (MTProtoSession *session = _mtp_internal::getSession(dcWithShift < 0 ? (-dcWithShift) : dcWithShift)) { - session->sendPrepared(req); + } + } else { + DEBUG_LOG(("RPC Info: parser not found for %1").arg(requestId)); + } + unregisterRequest(requestId); +} + +bool hasCallbacks(mtpRequestId requestId) { + QMutexLocker locker(&parserMapLock); + ParserMap::iterator i = parserMap.find(requestId); + return (i != parserMap.cend()); +} + +void globalCallback(const mtpPrime *from, const mtpPrime *end) { + if (globalHandler.onDone) (*globalHandler.onDone)(0, from, end); // some updates were received +} + +void onStateChange(int32 dcWithShift, int32 state) { + if (stateChangedHandler) stateChangedHandler(dcWithShift, state); +} + +void onSessionReset(int32 dcWithShift) { + if (sessionResetHandler) sessionResetHandler(dcWithShift); +} + +bool rpcErrorOccured(mtpRequestId requestId, const RPCFailHandlerPtr &onFail, const RPCError &err) { // return true if need to clean request data + if (mtpIsFlood(err)) { + if (onFail && (*onFail)(requestId, err)) return true; + } + + if (onErrorDefault(requestId, err)) { + return false; + } + LOG(("RPC Error: request %1 got fail with code %2, error %3%4").arg(requestId).arg(err.code()).arg(err.type()).arg(err.description().isEmpty() ? QString() : QString(": %1").arg(err.description()))); + onFail && (*onFail)(requestId, err); + return true; +} + +GlobalSlotCarrier::GlobalSlotCarrier() { + connect(&_timer, SIGNAL(timeout()), this, SLOT(checkDelayed())); +} + +void GlobalSlotCarrier::checkDelayed() { + uint64 now = getms(true); + while (!delayedRequests.isEmpty() && now >= delayedRequests.front().second) { + mtpRequestId requestId = delayedRequests.front().first; + delayedRequests.pop_front(); + + int32 dcWithShift = 0; + { + QMutexLocker locker(&requestByDCLock); + RequestsByDC::const_iterator i = requestsByDC.constFind(requestId); + if (i != requestsByDC.cend()) { + dcWithShift = i.value(); + } else { + LOG(("MTP Error: could not find request dc for delayed resend, requestId %1").arg(requestId)); + continue; } } - if (!delayedRequests.isEmpty()) { - _timer.start(delayedRequests.front().second - now); + mtpRequest req; + { + QReadLocker locker(&requestMapLock); + RequestMap::const_iterator j = requestMap.constFind(requestId); + if (j == requestMap.cend()) { + DEBUG_LOG(("MTP Error: could not find request %1").arg(requestId)); + continue; + } + req = j.value(); + } + if (Session *session = getSession(qAbs(dcWithShift))) { + session->sendPrepared(req); } } - void GlobalSlotCarrier::connectionFinished(MTProtoConnection *connection) { - MTPQuittingConnections::iterator i = quittingConnections.find(connection); - if (i != quittingConnections.cend()) { - quittingConnections.erase(i); - } + if (!delayedRequests.isEmpty()) { + _timer.start(delayedRequests.front().second - now); + } +} - connection->waitTillFinish(); - delete connection; +void GlobalSlotCarrier::connectionFinished(Connection *connection) { + MTPQuittingConnections::iterator i = quittingConnections.find(connection); + if (i != quittingConnections.cend()) { + quittingConnections.erase(i); } - GlobalSlotCarrier *globalSlotCarrier() { - return _globalSlotCarrier; + connection->waitTillFinish(); + delete connection; +} + +GlobalSlotCarrier *globalSlotCarrier() { + return _globalSlotCarrier; +} + +void queueQuittingConnection(Connection *connection) { + quittingConnections.insert(connection); +} + +} // namespace internal + +void start() { + if (started()) return; + + unixtimeInit(); + + MTProtoDCMap &dcs(mtpDCMap()); + + _globalSlotCarrier = new internal::GlobalSlotCarrier(); + + mainSession = new internal::Session(mtpMainDC()); + sessions.insert(mainSession->getDcWithShift(), mainSession); + + _started = true; + + if (mtpNeedConfig()) { + mtpConfigLoader()->load(); } +} - void queueQuittingConnection(MTProtoConnection *connection) { - quittingConnections.insert(connection); +bool started() { + return _started; +} + +void restart() { + if (!_started) return; + + for (auto i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { + i.value()->restart(); } +} -}; +void restart(int32 dcMask) { + if (!_started) return; -namespace MTP { - - const uint32 cfg = 1 * _mtp_internal::dcShift; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum - const uint32 lgt = 2 * _mtp_internal::dcShift; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum - const uint32 dldStart = dld(0), dldEnd = dld(MTPDownloadSessionsCount - 1) + _mtp_internal::dcShift; - const uint32 uplStart = upl(0), uplEnd = upl(MTPUploadSessionsCount - 1) + _mtp_internal::dcShift; - - void start() { - if (started()) return; - - unixtimeInit(); - - MTProtoDCMap &dcs(mtpDCMap()); - - _globalSlotCarrier = new _mtp_internal::GlobalSlotCarrier(); - - mainSession = new MTProtoSession(mtpMainDC()); - sessions.insert(mainSession->getDcWithShift(), mainSession); - - _started = true; - - if (mtpNeedConfig()) { - mtpConfigLoader()->load(); - } - } - - bool started() { - return _started; - } - - void restart() { - if (!_started) return; - - for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { + dcMask = bareDcId(dcMask); + for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { + if (bareDcId(i.value()->getDcWithShift()) == dcMask) { i.value()->restart(); } } +} - void restart(int32 dcMask) { - if (!_started) return; +void pause() { + if (!_started) return; + _paused = true; +} - dcMask %= _mtp_internal::dcShift; - for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { - if ((i.value()->getDcWithShift() % int(_mtp_internal::dcShift)) == dcMask) { - i.value()->restart(); +void unpause() { + if (!_started) return; + _paused = false; + for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { + i.value()->unpaused(); + } +} + +void configure(int32 dc, int32 user) { + if (_started) return; + mtpSetDC(dc); + mtpAuthed(user); +} + +void setdc(int32 dc, bool fromZeroOnly) { + if (!dc || !_started) return; + mtpSetDC(dc, fromZeroOnly); + int32 oldMainDc = mainSession->getDcWithShift(); + if (maindc() != oldMainDc) { + killSession(oldMainDc); + } + Local::writeMtpData(); +} + +int32 maindc() { + return mtpMainDC(); +} + +int32 dcstate(int32 dc) { + if (!_started) return 0; + + if (!dc) return mainSession->getState(); + if (!bareDcId(dc)) { + dc += bareDcId(mainSession->getDcWithShift()); + } + + Sessions::const_iterator i = sessions.constFind(dc); + if (i != sessions.cend()) return i.value()->getState(); + + return DisconnectedState; +} + +QString dctransport(int32 dc) { + if (!_started) return QString(); + + if (!dc) return mainSession->transport(); + if (!bareDcId(dc)) { + dc += bareDcId(mainSession->getDcWithShift()); + } + + Sessions::const_iterator i = sessions.constFind(dc); + if (i != sessions.cend()) return i.value()->transport(); + + return QString(); +} + +void ping() { + if (internal::Session *session = internal::getSession(0)) { + session->ping(); + } +} + +void cancel(mtpRequestId requestId) { + if (!_started) return; + + mtpMsgId msgId = 0; + requestsDelays.remove(requestId); + { + QWriteLocker locker(&requestMapLock); + RequestMap::iterator i = requestMap.find(requestId); + if (i != requestMap.end()) { + msgId = *(mtpMsgId*)(i.value()->constData() + 4); + requestMap.erase(i); + } + } + { + QMutexLocker locker(&requestByDCLock); + RequestsByDC::iterator i = requestsByDC.find(requestId); + if (i != requestsByDC.end()) { + if (internal::Session *session = internal::getSession(qAbs(i.value()))) { + session->cancel(requestId, msgId); } + requestsByDC.erase(i); } } + internal::clearCallbacks(requestId); +} - void pause() { - if (!_started) return; - _paused = true; - } +void killSession(int32 dc) { + Sessions::iterator i = sessions.find(dc); + if (i != sessions.cend()) { + bool wasMain = (i.value() == mainSession); - void unpause() { - if (!_started) return; - _paused = false; - for (Sessions::const_iterator i = sessions.cbegin(), e = sessions.cend(); i != e; ++i) { - i.value()->unpaused(); - } - } + i.value()->kill(); + i.value()->deleteLater(); + sessions.erase(i); - void configure(int32 dc, int32 user) { - if (_started) return; - mtpSetDC(dc); - mtpAuthed(user); - } - - void setdc(int32 dc, bool fromZeroOnly) { - if (!dc || !_started) return; - mtpSetDC(dc, fromZeroOnly); - int32 oldMainDc = mainSession->getDcWithShift(); - if (maindc() != oldMainDc) { - killSession(oldMainDc); - } - Local::writeMtpData(); - } - - int32 maindc() { - return mtpMainDC(); - } - - int32 dcstate(int32 dc) { - if (!_started) return 0; - - if (!dc) return mainSession->getState(); - if (!(dc % _mtp_internal::dcShift)) { - dc += (mainSession->getDcWithShift() % _mtp_internal::dcShift); - } - - Sessions::const_iterator i = sessions.constFind(dc); - if (i != sessions.cend()) return i.value()->getState(); - - return MTProtoConnection::Disconnected; - } - - QString dctransport(int32 dc) { - if (!_started) return QString(); - - if (!dc) return mainSession->transport(); - if (!(dc % _mtp_internal::dcShift)) { - dc += (mainSession->getDcWithShift() % _mtp_internal::dcShift); - } - - Sessions::const_iterator i = sessions.constFind(dc); - if (i != sessions.cend()) return i.value()->transport(); - - return QString(); - } - - void ping() { - if (MTProtoSession *session = _mtp_internal::getSession(0)) { - session->ping(); - } - } - - void cancel(mtpRequestId requestId) { - if (!_started) return; - - mtpMsgId msgId = 0; - requestsDelays.remove(requestId); - { - QWriteLocker locker(&requestMapLock); - RequestMap::iterator i = requestMap.find(requestId); - if (i != requestMap.end()) { - msgId = *(mtpMsgId*)(i.value()->constData() + 4); - requestMap.erase(i); + if (wasMain) { + mainSession = new internal::Session(mtpMainDC()); + int32 newdc = mainSession->getDcWithShift(); + i = sessions.find(newdc); + if (i != sessions.cend()) { + i.value()->kill(); + i.value()->deleteLater(); + sessions.erase(i); } + sessions.insert(newdc, mainSession); } - { - QMutexLocker locker(&requestByDCLock); - RequestsByDC::iterator i = requestsByDC.find(requestId); - if (i != requestsByDC.end()) { - if (MTProtoSession *session = _mtp_internal::getSession(abs(i.value()))) { - session->cancel(requestId, msgId); - } - requestsByDC.erase(i); + } +} + +void stopSession(int32 dc) { + Sessions::iterator i = sessions.find(dc); + if (i != sessions.end()) { + if (i.value() != mainSession) { // don't stop main session + i.value()->stop(); + } + } +} + +int32 state(mtpRequestId requestId) { + if (requestId > 0) { + QMutexLocker locker(&requestByDCLock); + RequestsByDC::iterator i = requestsByDC.find(requestId); + if (i != requestsByDC.end()) { + if (internal::Session *session = internal::getSession(qAbs(i.value()))) { + return session->requestState(requestId); } + return MTP::RequestConnecting; } - _mtp_internal::clearCallbacks(requestId); + return MTP::RequestSent; } - - void killSession(int32 dc) { - Sessions::iterator i = sessions.find(dc); - if (i != sessions.cend()) { - bool wasMain = (i.value() == mainSession); - - i.value()->kill(); - i.value()->deleteLater(); - sessions.erase(i); - - if (wasMain) { - mainSession = new MTProtoSession(mtpMainDC()); - int32 newdc = mainSession->getDcWithShift(); - i = sessions.find(newdc); - if (i != sessions.cend()) { - i.value()->kill(); - i.value()->deleteLater(); - sessions.erase(i); - } - sessions.insert(newdc, mainSession); - } - } + if (internal::Session *session = internal::getSession(-requestId)) { + return session->requestState(0); } + return MTP::RequestConnecting; +} - void stopSession(int32 dc) { - Sessions::iterator i = sessions.find(dc); - if (i != sessions.end()) { - if (i.value() != mainSession) { // don't stop main session - i.value()->stop(); - } - } +void finish() { + for (Sessions::iterator i = sessions.begin(), e = sessions.end(); i != e; ++i) { + i.value()->kill(); + delete i.value(); } + sessions.clear(); + mainSession = nullptr; - int32 state(mtpRequestId requestId) { - if (requestId > 0) { - QMutexLocker locker(&requestByDCLock); - RequestsByDC::iterator i = requestsByDC.find(requestId); - if (i != requestsByDC.end()) { - if (MTProtoSession *session = _mtp_internal::getSession(abs(i.value()))) { - return session->requestState(requestId); - } - return MTP::RequestConnecting; - } - return MTP::RequestSent; - } - if (MTProtoSession *session = _mtp_internal::getSession(-requestId)) { - return session->requestState(0); - } - return MTP::RequestConnecting; + for (MTPQuittingConnections::const_iterator i = quittingConnections.cbegin(), e = quittingConnections.cend(); i != e; ++i) { + i.key()->waitTillFinish(); + delete i.key(); } + quittingConnections.clear(); - void finish() { - for (Sessions::iterator i = sessions.begin(), e = sessions.end(); i != e; ++i) { - i.value()->kill(); - delete i.value(); - } - sessions.clear(); - mainSession = nullptr; + delete _globalSlotCarrier; + _globalSlotCarrier = nullptr; - for (MTPQuittingConnections::const_iterator i = quittingConnections.cbegin(), e = quittingConnections.cend(); i != e; ++i) { - i.key()->waitTillFinish(); - delete i.key(); - } - quittingConnections.clear(); + mtpDestroyConfigLoader(); - delete _globalSlotCarrier; - _globalSlotCarrier = nullptr; + _started = false; +} - mtpDestroyConfigLoader(); +void authed(int32 uid) { + mtpAuthed(uid); +} - _started = false; - } +int32 authedId() { + return mtpAuthed(); +} - void authed(int32 uid) { - mtpAuthed(uid); - } +void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail) { + mtpRequestId req = MTP::send(MTPauth_LogOut(), onDone, onFail); + mtpLogoutOtherDCs(); +} - int32 authedId() { - return mtpAuthed(); - } +void setGlobalDoneHandler(RPCDoneHandlerPtr handler) { + globalHandler.onDone = handler; +} - void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail) { - mtpRequestId req = MTP::send(MTPauth_LogOut(), onDone, onFail); - mtpLogoutOtherDCs(); - } +void setGlobalFailHandler(RPCFailHandlerPtr handler) { + globalHandler.onFail = handler; +} - void setGlobalDoneHandler(RPCDoneHandlerPtr handler) { - globalHandler.onDone = handler; - } +void setStateChangedHandler(MTPStateChangedHandler handler) { + stateChangedHandler = handler; +} - void setGlobalFailHandler(RPCFailHandlerPtr handler) { - globalHandler.onFail = handler; - } +void setSessionResetHandler(MTPSessionResetHandler handler) { + sessionResetHandler = handler; +} - void setStateChangedHandler(MTPStateChangedHandler handler) { - stateChangedHandler = handler; - } +void clearGlobalHandlers() { + setGlobalDoneHandler(RPCDoneHandlerPtr()); + setGlobalFailHandler(RPCFailHandlerPtr()); + setStateChangedHandler(0); + setSessionResetHandler(0); +} - void setSessionResetHandler(MTPSessionResetHandler handler) { - sessionResetHandler = handler; - } +void updateDcOptions(const QVector &options) { + mtpUpdateDcOptions(options); + Local::writeSettings(); +} - void clearGlobalHandlers() { - setGlobalDoneHandler(RPCDoneHandlerPtr()); - setGlobalFailHandler(RPCFailHandlerPtr()); - setStateChangedHandler(0); - setSessionResetHandler(0); - } +mtpKeysMap getKeys() { + return mtpGetKeys(); +} - void updateDcOptions(const QVector &options) { - mtpUpdateDcOptions(options); - Local::writeSettings(); - } +void setKey(int32 dc, mtpAuthKeyPtr key) { + return mtpSetKey(dc, key); +} - mtpKeysMap getKeys() { - return mtpGetKeys(); - } +QReadWriteLock *dcOptionsMutex() { + return mtpDcOptionsMutex(); +} - void setKey(int32 dc, mtpAuthKeyPtr key) { - return mtpSetKey(dc, key); - } - - QReadWriteLock *dcOptionsMutex() { - return mtpDcOptionsMutex(); - } - -}; +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/facade.h b/Telegram/SourceFiles/mtproto/facade.h index 88d5863beb..912fee118d 100644 --- a/Telegram/SourceFiles/mtproto/facade.h +++ b/Telegram/SourceFiles/mtproto/facade.h @@ -20,177 +20,227 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once +#include "mtproto/core_types.h" #include "mtproto/session.h" #include "mtproto/file_download.h" -namespace _mtp_internal { - MTProtoSession *getSession(int32 dc); // 0 - current set dc - - bool paused(); - - void registerRequest(mtpRequestId requestId, int32 dc); - void unregisterRequest(mtpRequestId requestId); - - static const uint32 dcShift = 10000; - - mtpRequestId storeRequest(mtpRequest &request, const RPCResponseHandler &parser); - mtpRequest getRequest(mtpRequestId req); - void wrapInvokeAfter(mtpRequest &to, const mtpRequest &from, const mtpRequestMap &haveSent, int32 skipBeforeRequest = 0); - void clearCallbacks(mtpRequestId requestId, int32 errorCode = RPCError::NoError); // 0 - do not toggle onError callback - void clearCallbacksDelayed(const RPCCallbackClears &requestIds); - void performDelayedClear(); - void execCallback(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end); - bool hasCallbacks(mtpRequestId requestId); - void globalCallback(const mtpPrime *from, const mtpPrime *end); - void onStateChange(int32 dcWithShift, int32 state); - void onSessionReset(int32 dcWithShift); - bool rpcErrorOccured(mtpRequestId requestId, const RPCFailHandlerPtr &onFail, const RPCError &err); // return true if need to clean request data - inline bool rpcErrorOccured(mtpRequestId requestId, const RPCResponseHandler &handler, const RPCError &err) { - return rpcErrorOccured(requestId, handler.onFail, err); - } - - // used for: - // - resending requests by timer which were postponed by flood delay - // - destroying MTProtoConnections whose thread has finished - class GlobalSlotCarrier : public QObject { - Q_OBJECT - - public: - - GlobalSlotCarrier(); - - public slots: - - void checkDelayed(); - void connectionFinished(MTProtoConnection *connection); - - private: - - SingleTimer _timer; - }; - - GlobalSlotCarrier *globalSlotCarrier(); - void queueQuittingConnection(MTProtoConnection *connection); -}; - namespace MTP { - extern const uint32 cfg; // send(MTPhelp_GetConfig(), MTP::cfg + dc) - for dc enum - extern const uint32 lgt; // send(MTPauth_LogOut(), MTP::lgt + dc) - for logout of guest dcs enum - inline uint32 dld(int32 index) { // send(req, callbacks, MTP::dld(i) + dc) - for download - t_assert(index >= 0 && index < MTPDownloadSessionsCount); - return (0x10 + index) * _mtp_internal::dcShift; - }; - inline uint32 upl(int32 index) { // send(req, callbacks, MTP::upl(i) + dc) - for upload - t_assert(index >= 0 && index < MTPUploadSessionsCount); - return (0x20 + index) * _mtp_internal::dcShift; - }; - extern const uint32 dldStart, dldEnd; // dc >= dldStart && dc < dldEnd => dc in dld - extern const uint32 uplStart, uplEnd; // dc >= uplStart && dc < uplEnd => dc in upl +namespace internal { - void start(); - bool started(); - void restart(); - void restart(int32 dcMask); +Session *getSession(ShiftedDcId shiftedDcId); // 0 - current set dc - void pause(); - void unpause(); +bool paused(); - void configure(int32 dc, int32 user); +void registerRequest(mtpRequestId requestId, int32 dc); +void unregisterRequest(mtpRequestId requestId); - void setdc(int32 dc, bool fromZeroOnly = false); - int32 maindc(); +mtpRequestId storeRequest(mtpRequest &request, const RPCResponseHandler &parser); +mtpRequest getRequest(mtpRequestId req); +void wrapInvokeAfter(mtpRequest &to, const mtpRequest &from, const mtpRequestMap &haveSent, int32 skipBeforeRequest = 0); +void clearCallbacks(mtpRequestId requestId, int32 errorCode = RPCError::NoError); // 0 - do not toggle onError callback +void clearCallbacksDelayed(const RPCCallbackClears &requestIds); +void performDelayedClear(); +void execCallback(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end); +bool hasCallbacks(mtpRequestId requestId); +void globalCallback(const mtpPrime *from, const mtpPrime *end); +void onStateChange(int32 dcWithShift, int32 state); +void onSessionReset(int32 dcWithShift); +bool rpcErrorOccured(mtpRequestId requestId, const RPCFailHandlerPtr &onFail, const RPCError &err); // return true if need to clean request data +inline bool rpcErrorOccured(mtpRequestId requestId, const RPCResponseHandler &handler, const RPCError &err) { + return rpcErrorOccured(requestId, handler.onFail, err); +} - int32 dcstate(int32 dc = 0); - QString dctransport(int32 dc = 0); +// used for: +// - resending requests by timer which were postponed by flood delay +// - destroying MTProtoConnections whose thread has finished +class GlobalSlotCarrier : public QObject { + Q_OBJECT - template - inline mtpRequestId send(const TRequest &request, RPCResponseHandler callbacks = RPCResponseHandler(), int32 dc = 0, uint64 msCanWait = 0, mtpRequestId after = 0) { - if (MTProtoSession *session = _mtp_internal::getSession(dc)) { - return session->send(request, callbacks, msCanWait, true, !dc, after); - } - return 0; - } - template - inline mtpRequestId send(const TRequest &request, RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail = RPCFailHandlerPtr(), int32 dc = 0, uint64 msCanWait = 0, mtpRequestId after = 0) { - return send(request, RPCResponseHandler(onDone, onFail), dc, msCanWait, after); - } - inline void sendAnything(int32 dc = 0, uint64 msCanWait = 0) { - if (MTProtoSession *session = _mtp_internal::getSession(dc)) { - return session->sendAnything(msCanWait); - } - } - void ping(); - void cancel(mtpRequestId req); - void killSession(int32 dc); - void stopSession(int32 dc); +public: - enum { - RequestSent = 0, - RequestConnecting = 1, - RequestSending = 2 - }; - int32 state(mtpRequestId req); // < 0 means waiting for such count of ms + GlobalSlotCarrier(); - void finish(); +public slots: - void authed(int32 uid); - int32 authedId(); - void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail); + void checkDelayed(); + void connectionFinished(Connection *connection); - void setGlobalDoneHandler(RPCDoneHandlerPtr handler); - void setGlobalFailHandler(RPCFailHandlerPtr handler); - void setStateChangedHandler(MTPStateChangedHandler handler); - void setSessionResetHandler(MTPSessionResetHandler handler); - void clearGlobalHandlers(); - - void updateDcOptions(const QVector &options); - - template - T nonce() { - T result; - memset_rand(&result, sizeof(T)); - return result; - } - - mtpKeysMap getKeys(); - void setKey(int32 dc, mtpAuthKeyPtr key); - - 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; +private: + SingleTimer _timer; }; -template -mtpRequestId MTProtoSession::send(const TRequest &request, RPCResponseHandler callbacks, uint64 msCanWait, bool needsLayer, bool toMainDC, mtpRequestId after) { - mtpRequestId requestId = 0; - try { - uint32 requestSize = request.innerLength() >> 2; - mtpRequest reqSerialized(mtpRequestData::prepare(requestSize)); - request.write(*reqSerialized); +GlobalSlotCarrier *globalSlotCarrier(); +void queueQuittingConnection(Connection *connection); - DEBUG_LOG(("MTP Info: adding request to toSendMap, msCanWait %1").arg(msCanWait)); +} // namespace internal - reqSerialized->msDate = getms(true); // > 0 - can send without container - reqSerialized->needsLayer = needsLayer; - if (after) reqSerialized->after = _mtp_internal::getRequest(after); - requestId = _mtp_internal::storeRequest(reqSerialized, callbacks); - - sendPrepared(reqSerialized, msCanWait); - } catch (Exception &e) { - requestId = 0; - _mtp_internal::rpcErrorOccured(requestId, callbacks, rpcClientError("NO_REQUEST_ID", QString("send() failed to queue request, exception: %1").arg(e.what()))); - } - if (requestId) _mtp_internal::registerRequest(requestId, toMainDC ? -getDcWithShift() : getDcWithShift()); - return requestId; +constexpr ShiftedDcId DCShift = 10000; +constexpr DcId bareDcId(ShiftedDcId shiftedDcId) { + return (shiftedDcId % DCShift); } +constexpr ShiftedDcId shiftDcId(DcId dcId, int value) { + return dcId + DCShift * value; +} +constexpr int getDcIdShift(ShiftedDcId shiftedDcId) { + return (shiftedDcId - bareDcId(shiftedDcId)) / DCShift; +} + +// send(MTPhelp_GetConfig(), MTP::cfgDcId(dc)) - for dc enumeration +constexpr ShiftedDcId cfgDcId(DcId dcId) { + return shiftDcId(dcId, 0x01); +} + +// send(MTPauth_LogOut(), MTP::lgtDcId(dc)) - for logout of guest dcs enumeration +constexpr ShiftedDcId lgtDcId(DcId dcId) { + return shiftDcId(dcId, 0x02); +} + +namespace internal { + constexpr ShiftedDcId downloadDcId(DcId dcId, int index) { + static_assert(MTPDownloadSessionsCount < 0x10, "Too large MTPDownloadSessionsCount!"); + return shiftDcId(dcId, 0x10 + index); + }; +} + +// send(req, callbacks, MTP::dldDcId(dc, index)) - for download shifted dc id +inline ShiftedDcId dldDcId(DcId dcId, int index) { + t_assert(index >= 0 && index < MTPDownloadSessionsCount); + return internal::downloadDcId(dcId, index); +} +constexpr bool isDldDcId(ShiftedDcId shiftedDcId) { + return (shiftedDcId >= internal::downloadDcId(0, 0)) && (shiftedDcId < internal::downloadDcId(0, MTPDownloadSessionsCount - 1) + DCShift); +} + +namespace internal { + constexpr ShiftedDcId uploadDcId(DcId dcId, int index) { + static_assert(MTPUploadSessionsCount < 0x10, "Too large MTPUploadSessionsCount!"); + return shiftDcId(dcId, 0x20 + index); + }; +} + +// send(req, callbacks, MTP::uplDcId(index)) - for upload shifted dc id +// uploading always to the main dc so bareDcId == 0 +inline ShiftedDcId uplDcId(DcId dcId) { + return internal::uploadDcId(dcId, 0); +}; +constexpr bool isUplDcId(ShiftedDcId shiftedDcId) { + return (shiftedDcId >= internal::uploadDcId(0, 0)) && (shiftedDcId < internal::uploadDcId(0, MTPUploadSessionsCount - 1) + DCShift); +} + +void start(); +bool started(); +void restart(); +void restart(int32 dcMask); + +void pause(); +void unpause(); + +void configure(int32 dc, int32 user); + +void setdc(int32 dc, bool fromZeroOnly = false); +int32 maindc(); + +enum { + DisconnectedState = 0, + ConnectingState = 1, + ConnectedState = 2, +}; +int32 dcstate(int32 dc = 0); +QString dctransport(int32 dc = 0); + +template +inline mtpRequestId send(const TRequest &request, RPCResponseHandler callbacks = RPCResponseHandler(), int32 dc = 0, uint64 msCanWait = 0, mtpRequestId after = 0) { + if (internal::Session *session = internal::getSession(dc)) { + return session->send(request, callbacks, msCanWait, true, !dc, after); + } + return 0; +} +template +inline mtpRequestId send(const TRequest &request, RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail = RPCFailHandlerPtr(), int32 dc = 0, uint64 msCanWait = 0, mtpRequestId after = 0) { + return send(request, RPCResponseHandler(onDone, onFail), dc, msCanWait, after); +} +inline void sendAnything(int32 dc = 0, uint64 msCanWait = 0) { + if (internal::Session *session = internal::getSession(dc)) { + return session->sendAnything(msCanWait); + } +} +void ping(); +void cancel(mtpRequestId req); +void killSession(int32 dc); +void stopSession(int32 dc); + +enum { + RequestSent = 0, + RequestConnecting = 1, + RequestSending = 2 +}; +int32 state(mtpRequestId req); // < 0 means waiting for such count of ms + +void finish(); + +void authed(int32 uid); +int32 authedId(); +void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail); + +void setGlobalDoneHandler(RPCDoneHandlerPtr handler); +void setGlobalFailHandler(RPCFailHandlerPtr handler); +void setStateChangedHandler(MTPStateChangedHandler handler); +void setSessionResetHandler(MTPSessionResetHandler handler); +void clearGlobalHandlers(); + +void updateDcOptions(const QVector &options); + +template +T nonce() { + T result; + memset_rand(&result, sizeof(T)); + return result; +} + +mtpKeysMap getKeys(); +void setKey(int32 dc, mtpAuthKeyPtr key); + +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; + +namespace internal { + + template + mtpRequestId Session::send(const TRequest &request, RPCResponseHandler callbacks, uint64 msCanWait, bool needsLayer, bool toMainDC, mtpRequestId after) { + mtpRequestId requestId = 0; + try { + uint32 requestSize = request.innerLength() >> 2; + mtpRequest reqSerialized(mtpRequestData::prepare(requestSize)); + request.write(*reqSerialized); + + DEBUG_LOG(("MTP Info: adding request to toSendMap, msCanWait %1").arg(msCanWait)); + + reqSerialized->msDate = getms(true); // > 0 - can send without container + reqSerialized->needsLayer = needsLayer; + if (after) reqSerialized->after = MTP::internal::getRequest(after); + requestId = MTP::internal::storeRequest(reqSerialized, callbacks); + + sendPrepared(reqSerialized, msCanWait); + } catch (Exception &e) { + requestId = 0; + MTP::internal::rpcErrorOccured(requestId, callbacks, rpcClientError("NO_REQUEST_ID", QString("send() failed to queue request, exception: %1").arg(e.what()))); + } + if (requestId) MTP::internal::registerRequest(requestId, toMainDC ? -getDcWithShift() : getDcWithShift()); + return requestId; + } + +} // namespace internal + +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/file_download.cpp b/Telegram/SourceFiles/mtproto/file_download.cpp index c40e20e98f..aa8251de43 100644 --- a/Telegram/SourceFiles/mtproto/file_download.cpp +++ b/Telegram/SourceFiles/mtproto/file_download.cpp @@ -352,9 +352,9 @@ mtpFileLoader::mtpFileLoader(const StorageImageLocation *location, int32 size, L , _location(location) , _id(0) , _access(0) { - LoaderQueues::iterator i = queues.find(MTP::dld(0) + _dc); + LoaderQueues::iterator i = queues.find(MTP::dldDcId(_dc, 0)); if (i == queues.cend()) { - i = queues.insert(MTP::dld(0) + _dc, FileLoaderQueue(MaxFileQueries)); + i = queues.insert(MTP::dldDcId(_dc, 0), FileLoaderQueue(MaxFileQueries)); } _queue = &i.value(); } @@ -368,9 +368,9 @@ mtpFileLoader::mtpFileLoader(int32 dc, const uint64 &id, const uint64 &access, L , _location(0) , _id(id) , _access(access) { - LoaderQueues::iterator i = queues.find(MTP::dld(0) + _dc); + LoaderQueues::iterator i = queues.find(MTP::dldDcId(_dc, 0)); if (i == queues.cend()) { - i = queues.insert(MTP::dld(0) + _dc, FileLoaderQueue(MaxFileQueries)); + i = queues.insert(MTP::dldDcId(_dc, 0), FileLoaderQueue(MaxFileQueries)); } _queue = &i.value(); } @@ -432,7 +432,7 @@ bool mtpFileLoader::loadPart() { App::app()->killDownloadSessionsStop(_dc); - mtpRequestId reqId = MTP::send(MTPupload_GetFile(MTPupload_getFile(loc, MTP_int(offset), MTP_int(limit))), rpcDone(&mtpFileLoader::partLoaded, offset), rpcFail(&mtpFileLoader::partFailed), MTP::dld(dcIndex) + _dc, 50); + mtpRequestId reqId = MTP::send(MTPupload_GetFile(MTPupload_getFile(loc, MTP_int(offset), MTP_int(limit))), rpcDone(&mtpFileLoader::partLoaded, offset), rpcFail(&mtpFileLoader::partFailed), MTP::dldDcId(_dc, dcIndex), 50); ++_queue->queries; dr.v[dcIndex] += limit; diff --git a/Telegram/SourceFiles/mtproto/session.cpp b/Telegram/SourceFiles/mtproto/session.cpp index 8409549b08..9c4ad9c735 100644 --- a/Telegram/SourceFiles/mtproto/session.cpp +++ b/Telegram/SourceFiles/mtproto/session.cpp @@ -22,7 +22,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/session.h" -void MTPSessionData::clear() { +namespace MTP { +namespace internal { + +void SessionData::clear() { RPCCallbackClears clearCallbacks; { QReadLocker locker1(haveSentMutex()), locker2(toResendMutex()), locker3(haveReceivedMutex()), locker4(wereAckedMutex()); @@ -63,11 +66,11 @@ void MTPSessionData::clear() { QWriteLocker locker(receivedIdsMutex()); receivedIds.clear(); } - _mtp_internal::clearCallbacksDelayed(clearCallbacks); + clearCallbacksDelayed(clearCallbacks); } -MTProtoSession::MTProtoSession(int32 dcenter) : QObject() +Session::Session(int32 dcenter) : QObject() , _connection(0) , _killed(false) , _needToReceive(false) @@ -95,7 +98,7 @@ MTProtoSession::MTProtoSession(int32 dcenter) : QObject() MTProtoDCMap &dcs(mtpDCMap()); - _connection = new MTProtoConnection(); + _connection = new Connection(); dcWithShift = _connection->start(&data, dcenter); if (!dcWithShift) { delete _connection; @@ -105,11 +108,11 @@ MTProtoSession::MTProtoSession(int32 dcenter) : QObject() } if (!dc) { dcenter = dcWithShift; - int32 dcId = dcWithShift % _mtp_internal::dcShift; + int32 dcId = bareDcId(dcWithShift); MTProtoDCMap::const_iterator dcIndex = dcs.constFind(dcId); if (dcIndex == dcs.cend()) { dc = MTProtoDCPtr(new MTProtoDC(dcId, mtpAuthKeyPtr())); - dcs.insert(dcWithShift % _mtp_internal::dcShift, dc); + dcs.insert(dcId, dc); } else { dc = dcIndex.value(); } @@ -124,7 +127,7 @@ MTProtoSession::MTProtoSession(int32 dcenter) : QObject() } } -void MTProtoSession::restart() { +void Session::restart() { if (_killed) { DEBUG_LOG(("Session Error: can't restart a killed session")); return; @@ -132,7 +135,7 @@ void MTProtoSession::restart() { emit needToRestart(); } -void MTProtoSession::stop() { +void Session::stop() { if (_killed) { DEBUG_LOG(("Session Error: can't kill a killed session")); return; @@ -144,20 +147,20 @@ void MTProtoSession::stop() { } } -void MTProtoSession::kill() { +void Session::kill() { stop(); _killed = true; DEBUG_LOG(("Session Info: marked session dcWithShift %1 as killed").arg(dcWithShift)); } -void MTProtoSession::unpaused() { +void Session::unpaused() { if (_needToReceive) { _needToReceive = false; QTimer::singleShot(0, this, SLOT(tryToReceive())); } } -void MTProtoSession::sendAnything(quint64 msCanWait) { +void Session::sendAnything(quint64 msCanWait) { if (_killed) { DEBUG_LOG(("Session Error: can't send anything in a killed session")); return; @@ -187,7 +190,7 @@ void MTProtoSession::sendAnything(quint64 msCanWait) { } } -void MTProtoSession::needToResumeAndSend() { +void Session::needToResumeAndSend() { if (_killed) { DEBUG_LOG(("Session Info: can't resume a killed session")); return; @@ -196,7 +199,7 @@ void MTProtoSession::needToResumeAndSend() { DEBUG_LOG(("Session Info: resuming session dcWithShift %1").arg(dcWithShift)); MTProtoDCMap &dcs(mtpDCMap()); - _connection = new MTProtoConnection(); + _connection = new Connection(); if (!_connection->start(&data, dcWithShift)) { delete _connection; _connection = 0; @@ -213,11 +216,11 @@ void MTProtoSession::needToResumeAndSend() { } } -void MTProtoSession::sendPong(quint64 msgId, quint64 pingId) { +void Session::sendPong(quint64 msgId, quint64 pingId) { send(MTP_pong(MTP_long(msgId), MTP_long(pingId))); } -void MTProtoSession::sendMsgsStateInfo(quint64 msgId, QByteArray data) { +void Session::sendMsgsStateInfo(quint64 msgId, QByteArray data) { MTPMsgsStateInfo req(MTP_msgs_state_info(MTP_long(msgId), MTPstring())); string &info(req._msgs_state_info().vinfo._string().v); info.resize(data.size()); @@ -227,7 +230,7 @@ void MTProtoSession::sendMsgsStateInfo(quint64 msgId, QByteArray data) { send(req); } -void MTProtoSession::checkRequestsByTimer() { +void Session::checkRequestsByTimer() { QVector resendingIds; QVector removingIds; // remove very old (10 minutes) containers and resend requests QVector stateRequestIds; @@ -288,19 +291,19 @@ void MTProtoSession::checkRequestsByTimer() { } } } - _mtp_internal::clearCallbacksDelayed(clearCallbacks); + clearCallbacksDelayed(clearCallbacks); } } -void MTProtoSession::onConnectionStateChange(qint32 newState) { - _mtp_internal::onStateChange(dcWithShift, newState); +void Session::onConnectionStateChange(qint32 newState) { + onStateChange(dcWithShift, newState); } -void MTProtoSession::onResetDone() { - _mtp_internal::onSessionReset(dcWithShift); +void Session::onResetDone() { + onSessionReset(dcWithShift); } -void MTProtoSession::cancel(mtpRequestId requestId, mtpMsgId msgId) { +void Session::cancel(mtpRequestId requestId, mtpMsgId msgId) { if (requestId) { QWriteLocker locker(data.toSendMutex()); data.toSendMap().remove(requestId); @@ -311,20 +314,20 @@ void MTProtoSession::cancel(mtpRequestId requestId, mtpMsgId msgId) { } } -void MTProtoSession::ping() { +void Session::ping() { _ping = true; sendAnything(0); } -int32 MTProtoSession::requestState(mtpRequestId requestId) const { +int32 Session::requestState(mtpRequestId requestId) const { int32 result = MTP::RequestSent; bool connected = false; if (_connection) { int32 s = _connection->state(); - if (s == MTProtoConnection::Connected) { + if (s == ConnectedState) { connected = true; - } else if (s == MTProtoConnection::Connecting || s == MTProtoConnection::Disconnected) { + } else if (s == ConnectingState || s == DisconnectedState) { if (result < 0 || result == MTP::RequestSent) { result = MTP::RequestConnecting; } @@ -349,14 +352,14 @@ int32 MTProtoSession::requestState(mtpRequestId requestId) const { } } -int32 MTProtoSession::getState() const { +int32 Session::getState() const { int32 result = -86400000; if (_connection) { int32 s = _connection->state(); - if (s == MTProtoConnection::Connected) { + if (s == ConnectedState) { return s; - } else if (s == MTProtoConnection::Connecting || s == MTProtoConnection::Disconnected) { + } else if (s == ConnectingState || s == DisconnectedState) { if (result < 0) { return s; } @@ -367,16 +370,16 @@ int32 MTProtoSession::getState() const { } } if (result == -86400000) { - result = MTProtoConnection::Disconnected; + result = DisconnectedState; } return result; } -QString MTProtoSession::transport() const { +QString Session::transport() const { return _connection ? _connection->transport() : QString(); } -mtpRequestId MTProtoSession::resend(quint64 msgId, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { +mtpRequestId Session::resend(quint64 msgId, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { mtpRequest request; { QWriteLocker locker(data.haveSentMutex()); @@ -416,13 +419,13 @@ mtpRequestId MTProtoSession::resend(quint64 msgId, quint64 msCanWait, bool force } } -void MTProtoSession::resendMany(QVector msgIds, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { +void Session::resendMany(QVector msgIds, quint64 msCanWait, bool forceContainer, bool sendMsgStateInfo) { for (int32 i = 0, l = msgIds.size(); i < l; ++i) { resend(msgIds.at(i), msCanWait, forceContainer, sendMsgStateInfo); } } -void MTProtoSession::resendAll() { +void Session::resendAll() { QVector toResend; { QReadLocker locker(data.haveSentMutex()); @@ -437,7 +440,7 @@ void MTProtoSession::resendAll() { } } -void MTProtoSession::sendPrepared(const mtpRequest &request, uint64 msCanWait, bool newRequest) { // returns true, if emit of needToSend() is needed +void Session::sendPrepared(const mtpRequest &request, uint64 msCanWait, bool newRequest) { // returns true, if emit of needToSend() is needed { QWriteLocker locker(data.toSendMutex()); data.toSendMap().insert(request->requestId, request); @@ -453,33 +456,33 @@ void MTProtoSession::sendPrepared(const mtpRequest &request, uint64 msCanWait, b sendAnything(msCanWait); } -QReadWriteLock *MTProtoSession::keyMutex() const { +QReadWriteLock *Session::keyMutex() const { return dc->keyMutex(); } -void MTProtoSession::authKeyCreatedForDC() { +void Session::authKeyCreatedForDC() { DEBUG_LOG(("AuthKey Info: MTProtoSession::authKeyCreatedForDC slot, emitting authKeyCreated(), dcWithShift %1").arg(dcWithShift)); data.setKey(dc->getKey()); emit authKeyCreated(); } -void MTProtoSession::notifyKeyCreated(const mtpAuthKeyPtr &key) { +void Session::notifyKeyCreated(const mtpAuthKeyPtr &key) { DEBUG_LOG(("AuthKey Info: MTProtoSession::keyCreated(), setting, dcWithShift %1").arg(dcWithShift)); dc->setKey(key); } -void MTProtoSession::layerWasInitedForDC(bool wasInited) { +void Session::layerWasInitedForDC(bool wasInited) { DEBUG_LOG(("MTP Info: MTProtoSession::layerWasInitedForDC slot, dcWithShift %1").arg(dcWithShift)); data.setLayerWasInited(wasInited); } -void MTProtoSession::notifyLayerInited(bool wasInited) { +void Session::notifyLayerInited(bool wasInited) { DEBUG_LOG(("MTP Info: emitting MTProtoDC::layerWasInited(%1), dcWithShift %2").arg(Logs::b(wasInited)).arg(dcWithShift)); dc->setConnectionInited(wasInited); emit dc->layerWasInited(wasInited); } -void MTProtoSession::destroyKey() { +void Session::destroyKey() { if (!dc) return; if (data.getKey()) { @@ -491,16 +494,16 @@ void MTProtoSession::destroyKey() { } } -int32 MTProtoSession::getDcWithShift() const { +int32 Session::getDcWithShift() const { return dcWithShift; } -void MTProtoSession::tryToReceive() { +void Session::tryToReceive() { if (_killed) { DEBUG_LOG(("Session Error: can't receive in a killed session")); return; } - if (_mtp_internal::paused()) { + if (paused()) { _needToReceive = true; return; } @@ -519,20 +522,23 @@ void MTProtoSession::tryToReceive() { responses.erase(i); } if (requestId <= 0) { - if (dcWithShift < int(_mtp_internal::dcShift)) { // call globalCallback only in main session - _mtp_internal::globalCallback(response.constData(), response.constData() + response.size()); + if (dcWithShift == bareDcId(dcWithShift)) { // call globalCallback only in main session + globalCallback(response.constData(), response.constData() + response.size()); } } else { - _mtp_internal::execCallback(requestId, response.constData(), response.constData() + response.size()); + execCallback(requestId, response.constData(), response.constData() + response.size()); } ++cnt; } } -MTProtoSession::~MTProtoSession() { +Session::~Session() { t_assert(_connection == 0); } MTPrpcError rpcClientError(const QString &type, const QString &description) { return MTP_rpc_error(MTP_int(0), MTP_string(("CLIENT_" + type + (description.length() ? (": " + description) : "")).toUtf8().constData())); } + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/session.h b/Telegram/SourceFiles/mtproto/session.h index e1fd43cbd7..49285f6069 100644 --- a/Telegram/SourceFiles/mtproto/session.h +++ b/Telegram/SourceFiles/mtproto/session.h @@ -24,15 +24,22 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/dcenter.h" #include "mtproto/rpc_sender.h" -class MTProtoSession; +namespace MTP { +namespace internal { -class MTPSessionData { +class Session; + +class SessionData { public: - MTPSessionData(MTProtoSession *creator) - : _session(0), _salt(0) - , _messagesSent(0), _fakeRequestId(-2000000000) - , _owner(creator), _keyChecked(false), _layerInited(false) { + SessionData(Session *creator) + : _session(0) + , _salt(0) + , _messagesSent(0) + , _fakeRequestId(-2000000000) + , _owner(creator) + , _keyChecked(false) + , _layerInited(false) { } void setSession(uint64 session) { @@ -170,10 +177,10 @@ public: return _fakeRequestId; } - MTProtoSession *owner() { + Session *owner() { return _owner; } - const MTProtoSession *owner() const { + const Session *owner() const { return _owner; } @@ -192,7 +199,7 @@ private: uint32 _messagesSent; mtpRequestId _fakeRequestId; - MTProtoSession *_owner; + Session *_owner; mtpAuthKeyPtr _authKey; bool _keyChecked, _layerInited; @@ -217,12 +224,12 @@ private: }; -class MTProtoSession : public QObject { +class Session : public QObject { Q_OBJECT public: - MTProtoSession(int32 dcenter); + Session(int32 dcenter); void restart(); void stop(); @@ -231,7 +238,7 @@ public: void unpaused(); int32 getDcWithShift() const; - ~MTProtoSession(); + ~Session(); QReadWriteLock *keyMutex() const; void notifyKeyCreated(const mtpAuthKeyPtr &key); @@ -278,12 +285,12 @@ public slots: private: - MTProtoConnection *_connection; + Connection *_connection; bool _killed; bool _needToReceive; - MTPSessionData data; + SessionData data; int32 dcWithShift; MTProtoDCPtr dc; @@ -297,8 +304,11 @@ private: }; -inline QReadWriteLock *MTPSessionData::keyMutex() const { +inline QReadWriteLock *SessionData::keyMutex() const { return _owner->keyMutex(); } MTPrpcError rpcClientError(const QString &type, const QString &description = QString()); + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index 458defe4c7..e88e760af9 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -18,6 +18,9 @@ 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 */ + +#define NOMINMAX // no min() and max() macro declarations + #ifdef TDESKTOP_WINRT #include diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index ff088c2696..8d7cbbad40 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -765,7 +765,7 @@ void Window::mtpStateChanged(int32 dc, int32 state) { void Window::updateTitleStatus() { int32 state = MTP::dcstate(); - if (state == MTProtoConnection::Connecting || state == MTProtoConnection::Disconnected || (state < 0 && state > -600)) { + if (state == MTP::ConnectingState || state == MTP::DisconnectedState || (state < 0 && state > -600)) { if (main || getms() > 5000 || _connecting) { showConnecting(lang(lng_connecting)); } From ddd63d73b7b3dfd1bbdccf3a7f929f892d6d5d97 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 13:12:18 +0300 Subject: [PATCH 243/316] MTP::nonce -> rand_value, fixed first_name and last_name reading from minimal users --- Telegram/SourceFiles/app.cpp | 8 ++++++-- Telegram/SourceFiles/application.cpp | 2 +- Telegram/SourceFiles/autoupdater.cpp | 2 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 4 ++-- Telegram/SourceFiles/boxes/contactsbox.cpp | 2 +- Telegram/SourceFiles/gui/animation.cpp | 2 +- Telegram/SourceFiles/historywidget.cpp | 20 ++++++++++---------- Telegram/SourceFiles/localimageloader.cpp | 14 +++++++------- Telegram/SourceFiles/localimageloader.h | 8 ++++---- Telegram/SourceFiles/localstorage.cpp | 2 +- Telegram/SourceFiles/mainwidget.cpp | 4 ++-- Telegram/SourceFiles/mtproto/connection.cpp | 18 +++++++++--------- Telegram/SourceFiles/mtproto/facade.h | 7 ------- Telegram/SourceFiles/mtproto/session.h | 3 +-- Telegram/SourceFiles/pspecific_win.cpp | 2 +- Telegram/SourceFiles/pspecific_winrt.cpp | 2 +- Telegram/SourceFiles/types.h | 8 +++++--- 17 files changed, 53 insertions(+), 55 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index e87f976e3a..df9c75bdec 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -420,9 +420,13 @@ namespace App { data->access = UserNoAccess; status = &emptyStatus; } else { + // apply first_name and last_name from minimal user only if we don't have + // local values for first name and last name already, otherwise skip + bool noLocalName = data->firstName.isEmpty() && data->lastName.isEmpty(); + QString fname = (!minimal || noLocalName) ? (d.has_first_name() ? textOneLine(qs(d.vfirst_name)) : QString()) : data->firstName; + QString lname = (!minimal || noLocalName) ? (d.has_last_name() ? textOneLine(qs(d.vlast_name)) : QString()) : data->lastName; + QString phone = minimal ? data->phone : (d.has_phone() ? qs(d.vphone) : QString()); - QString fname = d.has_first_name() ? textOneLine(qs(d.vfirst_name)) : QString(); - QString lname = d.has_last_name() ? textOneLine(qs(d.vlast_name)) : QString(); QString uname = minimal ? data->username : (d.has_username() ? textOneLine(qs(d.vusername)) : QString()); bool phoneChanged = (data->phone != phone); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index e3a454a112..28530ed5fd 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1004,7 +1004,7 @@ void AppClass::uploadProfilePhoto(const QImage &tosend, const PeerId &peerId) { QBuffer jpegBuffer(&jpeg); full.save(&jpegBuffer, "JPG", 87); - PhotoId id = MTP::nonce(); + PhotoId id = rand_value(); MTPPhoto photo(MTP_photo(MTP_long(id), MTP_long(0), MTP_int(unixtime()), MTP_vector(photoSizes))); diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index e008a39d5f..0734becdfb 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -58,7 +58,7 @@ void UpdateChecker::initOutput() { fileName = m.captured(1).replace(QRegularExpression(qsl("[^a-zA-Z0-9_\\-]")), QString()); } if (fileName.isEmpty()) { - fileName = qsl("tupdate-%1").arg(MTP::nonce() % 1000000); + fileName = qsl("tupdate-%1").arg(rand_value() % 1000000); } QString dirStr = cWorkingDir() + qsl("tupdates/"); fileName = dirStr + fileName; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 0d4178a5d1..5f3457ca73 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -188,11 +188,11 @@ void AddContactBox::onSave() { } _sentName = firstName; if (_user) { - _contactId = MTP::nonce(); + _contactId = rand_value(); QVector v(1, MTP_inputPhoneContact(MTP_long(_contactId), MTP_string(_user->phone), MTP_string(firstName), MTP_string(lastName))); _addRequest = MTP::send(MTPcontacts_ImportContacts(MTP_vector(v), MTP_bool(false)), rpcDone(&AddContactBox::onSaveUserDone), rpcFail(&AddContactBox::onSaveUserFail)); } else { - _contactId = MTP::nonce(); + _contactId = rand_value(); QVector v(1, MTP_inputPhoneContact(MTP_long(_contactId), MTP_string(phone), MTP_string(firstName), MTP_string(lastName))); _addRequest = MTP::send(MTPcontacts_ImportContacts(MTP_vector(v), MTP_bool(false)), rpcDone(&AddContactBox::onImportDone)); } diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 72d9397c23..803cd32e0d 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -224,7 +224,7 @@ void ContactsInner::onPeerNameChanged(PeerData *peer, const PeerData::Names &old void ContactsInner::onAddBot() { if (_bot->botInfo && !_bot->botInfo->startGroupToken.isEmpty()) { - MTP::send(MTPmessages_StartBot(_bot->inputUser, _addToPeer->input, MTP_long(MTP::nonce()), MTP_string(_bot->botInfo->startGroupToken)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _bot)); + MTP::send(MTPmessages_StartBot(_bot->inputUser, _addToPeer->input, MTP_long(rand_value()), MTP_string(_bot->botInfo->startGroupToken)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _bot)); } else { App::main()->addParticipants(_addToPeer, QVector(1, _bot)); } diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index 1e9af9fe20..6628f6ef27 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -245,7 +245,7 @@ ClipReader::ClipReader(const FileLocation &location, const QByteArray &data, Cal _clipManagers.push_back(new ClipReadManager(_clipThreads.back())); _clipThreads.back()->start(); } else { - _threadIndex = int32(MTP::nonce() % _clipThreads.size()); + _threadIndex = int32(rand_value() % _clipThreads.size()); int32 loadLevel = 0x7FFFFFFF; for (int32 i = 0, l = _clipThreads.size(); i < l; ++i) { int32 level = _clipManagers.at(i)->loadLevel(); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 8476a665c6..174b2506db 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -4836,7 +4836,7 @@ void HistoryWidget::onBotStart() { if (token.isEmpty()) { sendBotCommand(qsl("/start"), 0); } else { - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); MTP::send(MTPmessages_StartBot(_peer->asUser()->inputUser, MTP_inputPeerEmpty(), MTP_long(randomId), MTP_string(token)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _peer->asUser())); _peer->asUser()->botInfo->startToken = QString(); @@ -4897,7 +4897,7 @@ void HistoryWidget::onShareContact(const PeerId &peer, UserData *contact) { void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const QString &fname, const QString &lname, MsgId replyTo, int32 userId) { History *h = App::history(peer); - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); FullMsgId newId(peerToChannel(peer), clientMsgId()); App::main()->readServerHistory(h, false); @@ -5993,7 +5993,7 @@ void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, bool silent, const M if (!MTP::authedId()) return; HistoryItem *item = App::histItemById(newId); if (item) { - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); App::historyRegRandom(randomId, newId); History *hist = item->history(); MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; @@ -6045,7 +6045,7 @@ void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, bool silent, cons if (item) { DocumentData *document = item->getMedia() ? item->getMedia()->getDocument() : 0; if (document) { - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); App::historyRegRandom(randomId, newId); History *hist = item->history(); MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; @@ -6074,7 +6074,7 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, bool silent, if (item) { DocumentData *document = item->getMedia() ? item->getMedia()->getDocument() : 0; if (document) { - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); App::historyRegRandom(randomId, newId); History *hist = item->history(); MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; @@ -6799,7 +6799,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { App::main()->readServerHistory(_history, false); fastShowAtEnd(_history); - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); FullMsgId newId(_channel, clientMsgId()); bool lastKeyboardUsed = lastForceReplyReplied(); @@ -6854,7 +6854,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { tw = th = 0; thumbSize = MTP_photoSizeEmpty(MTP_string("")); } - uint64 docId = MTP::nonce(); + uint64 docId = rand_value(); QVector attributes(1, MTP_documentAttributeFilename(MTP_string((result->content_type == qstr("video/mp4") ? "animation.gif.mp4" : "animation.gif")))); attributes.push_back(MTP_documentAttributeAnimated()); attributes.push_back(MTP_documentAttributeVideo(MTP_int(result->duration), MTP_int(result->width), MTP_int(result->height))); @@ -6878,7 +6878,7 @@ void HistoryWidget::onInlineResultSend(InlineResult *result, UserData *bot) { photoSizes.push_back(MTP_photoSize(MTP_string("x"), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(result->width), MTP_int(result->height), MTP_int(0))); - uint64 photoId = MTP::nonce(); + uint64 photoId = rand_value(); 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)); @@ -7020,7 +7020,7 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti App::main()->readServerHistory(_history, false); fastShowAtEnd(_history); - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); FullMsgId newId(_channel, clientMsgId()); bool lastKeyboardUsed = lastForceReplyReplied(); @@ -7076,7 +7076,7 @@ void HistoryWidget::sendExistingPhoto(PhotoData *photo, const QString &caption) App::main()->readServerHistory(_history, false); fastShowAtEnd(_history); - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); FullMsgId newId(_channel, clientMsgId()); bool lastKeyboardUsed = lastForceReplyReplied(); diff --git a/Telegram/SourceFiles/localimageloader.cpp b/Telegram/SourceFiles/localimageloader.cpp index 498d43831b..7ae676ce2c 100644 --- a/Telegram/SourceFiles/localimageloader.cpp +++ b/Telegram/SourceFiles/localimageloader.cpp @@ -171,7 +171,7 @@ void TaskQueueWorker::onTaskAdded() { _inTaskAdded = false; } -FileLoadTask::FileLoadTask(const QString &filepath, PrepareMediaType type, const FileLoadTo &to, FileLoadForceConfirmType confirm) : _id(MTP::nonce()) +FileLoadTask::FileLoadTask(const QString &filepath, PrepareMediaType type, const FileLoadTo &to, FileLoadForceConfirmType confirm) : _id(rand_value()) , _to(to) , _filepath(filepath) , _duration(0) @@ -180,7 +180,7 @@ FileLoadTask::FileLoadTask(const QString &filepath, PrepareMediaType type, const , _result(0) { } -FileLoadTask::FileLoadTask(const QByteArray &content, PrepareMediaType type, const FileLoadTo &to) : _id(MTP::nonce()) +FileLoadTask::FileLoadTask(const QByteArray &content, PrepareMediaType type, const FileLoadTo &to) : _id(rand_value()) , _to(to) , _content(content) , _duration(0) @@ -189,7 +189,7 @@ FileLoadTask::FileLoadTask(const QByteArray &content, PrepareMediaType type, con , _result(0) { } -FileLoadTask::FileLoadTask(const QImage &image, PrepareMediaType type, const FileLoadTo &to, FileLoadForceConfirmType confirm, const QString &originalText) : _id(MTP::nonce()) +FileLoadTask::FileLoadTask(const QImage &image, PrepareMediaType type, const FileLoadTo &to, FileLoadForceConfirmType confirm, const QString &originalText) : _id(rand_value()) , _to(to) , _image(image) , _duration(0) @@ -199,7 +199,7 @@ FileLoadTask::FileLoadTask(const QImage &image, PrepareMediaType type, const Fil , _result(0) { } -FileLoadTask::FileLoadTask(const QByteArray &voice, int32 duration, const VoiceWaveform &waveform, const FileLoadTo &to) : _id(MTP::nonce()) +FileLoadTask::FileLoadTask(const QByteArray &voice, int32 duration, const VoiceWaveform &waveform, const FileLoadTo &to) : _id(rand_value()) , _to(to) , _content(voice) , _duration(duration) @@ -323,7 +323,7 @@ void FileLoadTask::process() { thumb = full; thumbSize = MTP_photoSize(MTP_string(""), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(full.width()), MTP_int(full.height()), MTP_int(0)); - thumbId = MTP::nonce(); + thumbId = rand_value(); } } } @@ -350,7 +350,7 @@ void FileLoadTask::process() { thumb = full; thumbSize = MTP_photoSize(MTP_string(""), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(full.width()), MTP_int(full.height()), MTP_int(0)); - thumbId = MTP::nonce(); + thumbId = rand_value(); if (filename.endsWith(qstr(".mp4"), Qt::CaseInsensitive)) { filemime = qstr("video/mp4"); @@ -406,7 +406,7 @@ void FileLoadTask::process() { thumb = full; thumbSize = MTP_photoSize(MTP_string(""), MTP_fileLocationUnavailable(MTP_long(0), MTP_int(0), MTP_long(0)), MTP_int(full.width()), MTP_int(full.height()), MTP_int(0)); - thumbId = MTP::nonce(); + thumbId = rand_value(); } } diff --git a/Telegram/SourceFiles/localimageloader.h b/Telegram/SourceFiles/localimageloader.h index 6e6b5a0ee6..49266a7a86 100644 --- a/Telegram/SourceFiles/localimageloader.h +++ b/Telegram/SourceFiles/localimageloader.h @@ -29,13 +29,13 @@ enum PrepareMediaType { }; struct ToPrepareMedia { - ToPrepareMedia(const QString &file, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(MTP::nonce()), file(file), peer(peer), type(t), duration(0), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { + ToPrepareMedia(const QString &file, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(rand_value()), file(file), peer(peer), type(t), duration(0), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { } - ToPrepareMedia(const QImage &img, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(MTP::nonce()), img(img), peer(peer), type(t), duration(0), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { + ToPrepareMedia(const QImage &img, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(rand_value()), img(img), peer(peer), type(t), duration(0), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { } - ToPrepareMedia(const QByteArray &data, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(MTP::nonce()), data(data), peer(peer), type(t), duration(0), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { + ToPrepareMedia(const QByteArray &data, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(rand_value()), data(data), peer(peer), type(t), duration(0), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { } - ToPrepareMedia(const QByteArray &data, int32 duration, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(MTP::nonce()), data(data), peer(peer), type(t), duration(duration), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { + ToPrepareMedia(const QByteArray &data, int32 duration, const PeerId &peer, PrepareMediaType t, bool broadcast, bool ctrlShiftEnter, MsgId replyTo) : id(rand_value()), data(data), peer(peer), type(t), duration(duration), ctrlShiftEnter(ctrlShiftEnter), replyTo(replyTo) { } PhotoId id; QString file; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 102e5a9c00..b75e867618 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -113,7 +113,7 @@ namespace { path.reserve(base.size() + 0x11); path += base; do { - result = MTP::nonce(); + result = rand_value(); path.resize(base.size()); path += toFilePart(result); } while (!result || keyAlreadyUsed(path, options)); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index a4a98df022..1833b42969 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -637,7 +637,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast, bool silent) { ids.reserve(_toForward.size()); randomIds.reserve(_toForward.size()); for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); if (genClientSideMessage) { FullMsgId newId(peerToChannel(hist->peer->id), clientMsgId()); HistoryMessage *msg = static_cast(_toForward.cbegin().value()); @@ -1366,7 +1366,7 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo, if (replyTo < 0) replyTo = history.replyToId(); while (textSplit(sendingText, sendingEntities, leftText, leftEntities, MaxMessageSize)) { FullMsgId newId(peerToChannel(hist->peer->id), clientMsgId()); - uint64 randomId = MTP::nonce(); + uint64 randomId = rand_value(); trimTextWithEntities(sendingText, sendingEntities); diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index a5cb1d6bfd..c999179bb3 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -648,8 +648,8 @@ void AbstractTcpConnection::socketRead() { AutoConnection::AutoConnection(QThread *thread) : AbstractTcpConnection() , status(WaitingBoth) -, tcpNonce(MTP::nonce()) -, httpNonce(MTP::nonce()) +, tcpNonce(rand_value()) +, httpNonce(rand_value()) , _flagsTcp(0) , _flagsHttp(0) , _tcpTimeout(MTPMinReceiveDelay) { @@ -1000,7 +1000,7 @@ void AutoConnection::socketError(QAbstractSocket::SocketError e) { TCPConnection::TCPConnection(QThread *thread) : status(WaitingTcp) - , tcpNonce(MTP::nonce()) + , tcpNonce(rand_value()) , _tcpTimeout(MTPMinReceiveDelay) , _flags(0) { moveToThread(thread); @@ -1162,7 +1162,7 @@ void TCPConnection::socketError(QAbstractSocket::SocketError e) { HTTPConnection::HTTPConnection(QThread *thread) : status(WaitingHttp) - , httpNonce(MTP::nonce()) + , httpNonce(rand_value()) , _flags(0) { moveToThread(thread); manager.moveToThread(thread); @@ -1541,7 +1541,7 @@ void ConnectionPrivate::resetSession() { // recreate all msg_id and msg_seqno } } - uint64 session = MTP::nonce(); + uint64 session = rand_value(); DEBUG_LOG(("MTP Info: creating new session after bad_msg_notification, setting random server_session %1").arg(session)); sessionData->setSession(session); @@ -1698,7 +1698,7 @@ void ConnectionPrivate::tryToSend() { mtpRequest pingRequest; if (dc == bareDcId(dc)) { // main session if (!prependOnly && !_pingIdToSend && !_pingId && _pingSendAt <= getms(true)) { - _pingIdToSend = MTP::nonce(); + _pingIdToSend = rand_value(); } } if (_pingIdToSend) { @@ -3317,7 +3317,7 @@ void ConnectionPrivate::updateAuthKey() { authKeyData = new ConnectionPrivate::AuthKeyCreateData(); authKeyStrings = new ConnectionPrivate::AuthKeyCreateStrings(); authKeyData->req_num = 0; - authKeyData->nonce = MTP::nonce(); + authKeyData->nonce = rand_value(); MTPReq_pq req_pq; req_pq.vnonce = authKeyData->nonce; @@ -3390,7 +3390,7 @@ void ConnectionPrivate::pqAnswered() { return restart(); } - authKeyData->new_nonce = MTP::nonce(); + authKeyData->new_nonce = rand_value(); p_q_inner_data.vnew_nonce = authKeyData->new_nonce; MTPReq_DH_params req_DH_params; @@ -3748,7 +3748,7 @@ void ConnectionPrivate::authKeyCreated() { } } - _pingIdToSend = MTP::nonce(); // get server_salt + _pingIdToSend = rand_value(); // get server_salt emit needToSendAsync(); } diff --git a/Telegram/SourceFiles/mtproto/facade.h b/Telegram/SourceFiles/mtproto/facade.h index 912fee118d..05990fde24 100644 --- a/Telegram/SourceFiles/mtproto/facade.h +++ b/Telegram/SourceFiles/mtproto/facade.h @@ -192,13 +192,6 @@ void clearGlobalHandlers(); void updateDcOptions(const QVector &options); -template -T nonce() { - T result; - memset_rand(&result, sizeof(T)); - return result; -} - mtpKeysMap getKeys(); void setKey(int32 dc, mtpAuthKeyPtr key); diff --git a/Telegram/SourceFiles/mtproto/session.h b/Telegram/SourceFiles/mtproto/session.h index 49285f6069..39a15acc53 100644 --- a/Telegram/SourceFiles/mtproto/session.h +++ b/Telegram/SourceFiles/mtproto/session.h @@ -78,8 +78,7 @@ public: } void setKey(const mtpAuthKeyPtr &key) { if (_authKey != key) { - uint64 session; - memsetrnd(session); + uint64 session = rand_value(); _authKey = key; DEBUG_LOG(("MTP Info: new auth key set in SessionData, id %1, setting random server_session %2").arg(key ? key->keyId() : 0).arg(session)); diff --git a/Telegram/SourceFiles/pspecific_win.cpp b/Telegram/SourceFiles/pspecific_win.cpp index 4a2aa5a69e..4153318b7e 100644 --- a/Telegram/SourceFiles/pspecific_win.cpp +++ b/Telegram/SourceFiles/pspecific_win.cpp @@ -3241,7 +3241,7 @@ QString toastImage(const StorageKey &key, PeerData *peer) { } else { v.until = 0; } - v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(MTP::nonce(), 16) + qsl(".png"); + v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(rand_value(), 16) + qsl(".png"); if (key.first || key.second) { peer->saveUserpic(v.path); } else { diff --git a/Telegram/SourceFiles/pspecific_winrt.cpp b/Telegram/SourceFiles/pspecific_winrt.cpp index ae9f029a44..49d8ef081b 100644 --- a/Telegram/SourceFiles/pspecific_winrt.cpp +++ b/Telegram/SourceFiles/pspecific_winrt.cpp @@ -2655,7 +2655,7 @@ void psWriteDump() { // } else { // v.until = 0; // } -// v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(MTP::nonce(), 16) + qsl(".png"); +// v.path = cWorkingDir() + qsl("tdata/temp/") + QString::number(rand_value(), 16) + qsl(".png"); // if (key.first || key.second) { // peer->saveUserpic(v.path); // } else { diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 6f9a055853..fd6ea24381 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -239,11 +239,13 @@ inline char *hashMd5Hex(const void *data, uint32 len, void *dest) { // dest = pt return hashMd5Hex(HashMd5(data, len).result(), dest); } +// good random (using openssl implementation) void memset_rand(void *data, uint32 len); - template -inline void memsetrnd(T &value) { - memset_rand(&value, sizeof(value)); +T rand_value() { + T result; + memset_rand(&result, sizeof(result)); + return result; } inline void memset_rand_bad(void *data, uint32 len) { From ad53185645381ab12915d0ecfd6684ce6c2fc3d6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 13:55:42 +0300 Subject: [PATCH 244/316] moved connection implementations from connection module to separate modules, Xcode and QtCreator projects need fixing --- Telegram/SourceFiles/mtproto/connection.cpp | 944 +------------------- Telegram/SourceFiles/mtproto/connection.h | 239 +---- Telegram/Telegram.vcxproj | 264 ++++-- Telegram/Telegram.vcxproj.filters | 102 ++- 4 files changed, 274 insertions(+), 1275 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index c999179bb3..c04dcaba35 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -355,957 +355,17 @@ Connection::~Connection() { t_assert(data == nullptr && thread == nullptr); } -namespace { - -mtpBuffer _handleHttpResponse(QNetworkReply *reply) { - QByteArray response = reply->readAll(); - TCP_LOG(("HTTP Info: read %1 bytes").arg(response.size())); - - if (response.isEmpty()) return mtpBuffer(); - - if (response.size() & 0x03 || response.size() < 8) { - LOG(("HTTP Error: bad response size %1").arg(response.size())); - return mtpBuffer(1, -500); - } - - mtpBuffer data(response.size() >> 2); - memcpy(data.data(), response.constData(), response.size()); - - return data; -} - -bool _handleHttpError(QNetworkReply *reply) { // returnes "maybe bad key" - bool mayBeBadKey = false; - - QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); - if (statusCode.isValid()) { - int status = statusCode.toInt(); - mayBeBadKey = (status == 410); - if (status == 429) { - LOG(("Protocol Error: 429 flood code returned!")); - } - } - - switch (reply->error()) { - case QNetworkReply::ConnectionRefusedError: LOG(("HTTP Error: connection refused - %1").arg(reply->errorString())); break; - case QNetworkReply::RemoteHostClosedError: LOG(("HTTP Error: remote host closed - %1").arg(reply->errorString())); break; - case QNetworkReply::HostNotFoundError: LOG(("HTTP Error: host not found - %2").arg(reply->error()).arg(reply->errorString())); break; - case QNetworkReply::TimeoutError: LOG(("HTTP Error: timeout - %2").arg(reply->error()).arg(reply->errorString())); break; - case QNetworkReply::OperationCanceledError: LOG(("HTTP Error: cancelled - %2").arg(reply->error()).arg(reply->errorString())); break; - case QNetworkReply::SslHandshakeFailedError: - case QNetworkReply::TemporaryNetworkFailureError: - case QNetworkReply::NetworkSessionFailedError: - case QNetworkReply::BackgroundRequestNotAllowedError: - case QNetworkReply::UnknownNetworkError: LOG(("HTTP Error: network error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - - // proxy errors (101-199): - case QNetworkReply::ProxyConnectionRefusedError: - case QNetworkReply::ProxyConnectionClosedError: - case QNetworkReply::ProxyNotFoundError: - case QNetworkReply::ProxyTimeoutError: - case QNetworkReply::ProxyAuthenticationRequiredError: - case QNetworkReply::UnknownProxyError:LOG(("HTTP Error: proxy error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - - // content errors (201-299): - case QNetworkReply::ContentAccessDenied: - case QNetworkReply::ContentOperationNotPermittedError: - case QNetworkReply::ContentNotFoundError: - case QNetworkReply::AuthenticationRequiredError: - case QNetworkReply::ContentReSendError: - case QNetworkReply::UnknownContentError: LOG(("HTTP Error: content error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - - // protocol errors - case QNetworkReply::ProtocolUnknownError: - case QNetworkReply::ProtocolInvalidOperationError: - case QNetworkReply::ProtocolFailure: LOG(("HTTP Error: protocol error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; - }; - TCP_LOG(("HTTP Error %1, restarting! - %2").arg(reply->error()).arg(reply->errorString())); - - return mayBeBadKey; -} - -uint32 _tcpPacketSize(const char *packet) { // must have at least 4 bytes readable - uint32 result = (packet[0] > 0) ? packet[0] : 0; - if (result == 0x7f) { - const uchar *bytes = reinterpret_cast(packet); - result = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); - return (result << 2) + 4; - } - return (result << 2) + 1; -} - -mtpBuffer _handleTcpResponse(const char *packet, uint32 length) { - if (length < 5 || length > MTPPacketSizeMax) { - LOG(("TCP Error: bad packet size %1").arg(length)); - return mtpBuffer(1, -500); - } - int32 size = packet[0], len = length - 1; - if (size == 0x7f) { - const uchar *bytes = reinterpret_cast(packet); - size = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); - len -= 3; - } - if (size * int32(sizeof(mtpPrime)) != len) { - LOG(("TCP Error: bad packet header")); - TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); - return mtpBuffer(1, -500); - } - const mtpPrime *packetdata = reinterpret_cast(packet + (length - len)); - TCP_LOG(("TCP Info: packet received, size = %1").arg(size * sizeof(mtpPrime))); - if (size == 1) { - if (*packetdata == -429) { - LOG(("Protocol Error: -429 flood code returned!")); - } else { - LOG(("TCP Error: error packet received, code = %1").arg(*packetdata)); - } - return mtpBuffer(1, *packetdata); - } - - mtpBuffer data(size); - memcpy(data.data(), packetdata, size * sizeof(mtpPrime)); - - return data; -} - -void _handleTcpError(QAbstractSocket::SocketError e, QTcpSocket &sock) { - switch (e) { - case QAbstractSocket::ConnectionRefusedError: - LOG(("TCP Error: socket connection refused - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::RemoteHostClosedError: - TCP_LOG(("TCP Info: remote host closed socket connection - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::HostNotFoundError: - LOG(("TCP Error: host not found - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::SocketTimeoutError: - LOG(("TCP Error: socket timeout - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::NetworkError: - LOG(("TCP Error: network - %1").arg(sock.errorString())); - break; - - case QAbstractSocket::ProxyAuthenticationRequiredError: - case QAbstractSocket::ProxyConnectionRefusedError: - case QAbstractSocket::ProxyConnectionClosedError: - case QAbstractSocket::ProxyConnectionTimeoutError: - case QAbstractSocket::ProxyNotFoundError: - case QAbstractSocket::ProxyProtocolError: - LOG(("TCP Error: proxy (%1) - %2").arg(e).arg(sock.errorString())); - break; - - default: - LOG(("TCP Error: other (%1) - %2").arg(e).arg(sock.errorString())); - break; - } - - TCP_LOG(("TCP Error %1, restarting! - %2").arg(e).arg(sock.errorString())); -} - -mtpBuffer _preparePQFake(const MTPint128 &nonce) { - MTPReq_pq req_pq(nonce); - mtpBuffer buffer; - uint32 requestSize = req_pq.innerLength() >> 2; - - buffer.resize(0); - buffer.reserve(8 + requestSize); - buffer.push_back(0); // tcp packet len - buffer.push_back(0); // tcp packet num - buffer.push_back(0); - buffer.push_back(0); - buffer.push_back(0); - buffer.push_back(unixtime()); - buffer.push_back(requestSize * 4); - req_pq.write(buffer); - buffer.push_back(0); // tcp crc32 hash - - return buffer; -} - -MTPResPQ _readPQFakeReply(const mtpBuffer &buffer) { - const mtpPrime *answer(buffer.constData()); - uint32 len = buffer.size(); - if (len < 5) { - LOG(("Fake PQ Error: bad request answer, len = %1").arg(len * sizeof(mtpPrime))); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); - throw Exception("bad pq reply"); - } - if (answer[0] != 0 || answer[1] != 0 || (((uint32)answer[2]) & 0x03) != 1/* || (unixtime() - answer[3] > 300) || (answer[3] - unixtime() > 60)*/) { // didnt sync time yet - LOG(("Fake PQ Error: bad request answer start (%1 %2 %3)").arg(answer[0]).arg(answer[1]).arg(answer[2])); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); - throw Exception("bad pq reply"); - } - uint32 answerLen = (uint32)answer[4]; - if (answerLen != (len - 5) * sizeof(mtpPrime)) { - LOG(("Fake PQ Error: bad request answer %1 <> %2").arg(answerLen).arg((len - 5) * sizeof(mtpPrime))); - DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); - throw Exception("bad pq reply"); - } - const mtpPrime *from(answer + 5), *end(from + len - 5); - MTPResPQ response; - response.read(from, end); - return response; -} - -} // namespace - -AbstractTcpConnection::AbstractTcpConnection() - : packetNum(0) - , packetRead(0) - , packetLeft(0) - , readingToShort(true) - , currentPos((char*)shortBuffer) { -} - -void AbstractTcpConnection::socketRead() { - if (sock.state() != QAbstractSocket::ConnectedState) { - LOG(("MTP error: socket not connected in socketRead(), state: %1").arg(sock.state())); - emit error(); - return; - } - - do { - uint32 toRead = packetLeft ? packetLeft : (readingToShort ? (MTPShortBufferSize * sizeof(mtpPrime)-packetRead) : 4); - if (readingToShort) { - if (currentPos + toRead > ((char*)shortBuffer) + MTPShortBufferSize * sizeof(mtpPrime)) { - longBuffer.resize(((packetRead + toRead) >> 2) + 1); - memcpy(&longBuffer[0], shortBuffer, packetRead); - currentPos = ((char*)&longBuffer[0]) + packetRead; - readingToShort = false; - } - } else { - if (longBuffer.size() * sizeof(mtpPrime) < packetRead + toRead) { - longBuffer.resize(((packetRead + toRead) >> 2) + 1); - currentPos = ((char*)&longBuffer[0]) + packetRead; - } - } - int32 bytes = (int32)sock.read(currentPos, toRead); - if (bytes > 0) { - TCP_LOG(("TCP Info: read %1 bytes").arg(bytes)); - - packetRead += bytes; - currentPos += bytes; - if (packetLeft) { - packetLeft -= bytes; - if (!packetLeft) { - socketPacket(currentPos - packetRead, packetRead); - currentPos = (char*)shortBuffer; - packetRead = packetLeft = 0; - readingToShort = true; - longBuffer.clear(); - } else { - TCP_LOG(("TCP Info: not enough %1 for packet! read %2").arg(packetLeft).arg(packetRead)); - emit receivedSome(); - } - } else { - bool move = false; - while (packetRead >= 4) { - uint32 packetSize = _tcpPacketSize(currentPos - packetRead); - if (packetSize < 5 || packetSize > MTPPacketSizeMax) { - LOG(("TCP Error: packet size = %1").arg(packetSize)); - emit error(); - return; - } - if (packetRead >= packetSize) { - socketPacket(currentPos - packetRead, packetSize); - packetRead -= packetSize; - packetLeft = 0; - move = true; - } else { - packetLeft = packetSize - packetRead; - TCP_LOG(("TCP Info: not enough %1 for packet! size %2 read %3").arg(packetLeft).arg(packetSize).arg(packetRead)); - emit receivedSome(); - break; - } - } - if (move) { - if (!packetRead) { - currentPos = (char*)shortBuffer; - readingToShort = true; - longBuffer.clear(); - } else if (!readingToShort && packetRead < MTPShortBufferSize * sizeof(mtpPrime)) { - memcpy(shortBuffer, currentPos - packetRead, packetRead); - currentPos = (char*)shortBuffer + packetRead; - readingToShort = true; - longBuffer.clear(); - } - } - } - } else if (bytes < 0) { - LOG(("TCP Error: socket read return -1")); - emit error(); - return; - } else { - TCP_LOG(("TCP Info: no bytes read, but bytes available was true..")); - break; - } - } while (sock.state() == QAbstractSocket::ConnectedState && sock.bytesAvailable()); -} - -AutoConnection::AutoConnection(QThread *thread) : AbstractTcpConnection() -, status(WaitingBoth) -, tcpNonce(rand_value()) -, httpNonce(rand_value()) -, _flagsTcp(0) -, _flagsHttp(0) -, _tcpTimeout(MTPMinReceiveDelay) { - moveToThread(thread); - - manager.moveToThread(thread); -#ifndef TDESKTOP_DISABLE_NETWORK_PROXY - manager.setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy)); -#endif - - httpStartTimer.moveToThread(thread); - httpStartTimer.setSingleShot(true); - connect(&httpStartTimer, SIGNAL(timeout()), this, SLOT(onHttpStart())); - - tcpTimeoutTimer.moveToThread(thread); - tcpTimeoutTimer.setSingleShot(true); - 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())); -} - -void AutoConnection::onHttpStart() { - if (status == HttpReady) { - DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingHttp; - sock.disconnectFromHost(); - emit connected(); - } -} - -void AutoConnection::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::f_ipv6) ? "IPv6" : "IPv4")); - - if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout; - tcpTimeoutTimer.start(_tcpTimeout); - - tcpSend(buffer); - } else if (status == WaitingHttp || status == UsingHttp) { - sock.disconnectFromHost(); - } -} - -void AutoConnection::onTcpTimeoutTimer() { - if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { - if (_tcpTimeout < MTPMaxReceiveDelay) _tcpTimeout *= 2; - _tcpTimeout = -_tcpTimeout; - - QAbstractSocket::SocketState state = sock.state(); - if (state == QAbstractSocket::ConnectedState || state == QAbstractSocket::ConnectingState || state == QAbstractSocket::HostLookupState) { - sock.disconnectFromHost(); - } else if (state != QAbstractSocket::ClosingState) { - sock.connectToHost(QHostAddress(_addrTcp), _portTcp); - } - } -} - -void AutoConnection::onSocketDisconnected() { - if (_tcpTimeout < 0) { - _tcpTimeout = -_tcpTimeout; - if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { - sock.connectToHost(QHostAddress(_addrTcp), _portTcp); - return; - } - } - if (status == WaitingBoth) { - status = WaitingHttp; - } 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingHttp; - emit connected(); - } -} - -void AutoConnection::sendData(mtpBuffer &buffer) { - if (status == FinishedWork) return; - - if (buffer.size() < 3) { - LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); - emit error(); - return; - } - - if (status == UsingTcp) { - tcpSend(buffer); - } else { - httpSend(buffer); - } -} - -uint32 FourCharsToUInt(char ch1, char ch2, char ch3, char ch4) { - char ch[4] = { ch1, ch2, ch3, ch4 }; - return *reinterpret_cast(ch); -} - -void AutoConnection::tcpSend(mtpBuffer &buffer) { - if (!packetNum) { - char nonce[64]; - uint32 *first = reinterpret_cast(nonce), *second = first + 1; - uint32 g1 = FourCharsToUInt('P', 'O', 'S', 'T'), g2 = FourCharsToUInt('G', 'E', 'T', ' '), g3 = FourCharsToUInt('H', 'E', 'A', 'D'); - uint32 first1 = 0x44414548U, first2 = 0x54534f50U, first3 = 0x20544547U, first4 = 0x20544547U, first5 = 0xeeeeeeeeU; - uint32 second1 = 0; - do { - memset_rand(nonce, sizeof(nonce)); - } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || *reinterpret_cast(nonce) == 0xef); - sock.write(nonce, sizeof(nonce)); - } - ++packetNum; - - uint32 size = buffer.size() - 3, len = size * 4; - char *data = reinterpret_cast(&buffer[0]); - if (size < 0x7f) { - data[7] = char(size); - TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 1)); - - sock.write(data + 7, len + 1); - } else { - data[4] = 0x7f; - reinterpret_cast(data)[5] = uchar(size & 0xFF); - reinterpret_cast(data)[6] = uchar((size >> 8) & 0xFF); - reinterpret_cast(data)[7] = uchar((size >> 16) & 0xFF); - TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 4)); - - sock.write(data + 4, len + 4); - } -} - -void AutoConnection::httpSend(mtpBuffer &buffer) { - int32 requestSize = (buffer.size() - 3) * sizeof(mtpPrime); - - QNetworkRequest request(address); - request.setHeader(QNetworkRequest::ContentLengthHeader, QVariant(requestSize)); - request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(qsl("application/x-www-form-urlencoded"))); - - TCP_LOG(("HTTP Info: sending %1 len request").arg(requestSize)); - requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); -} - -void AutoConnection::disconnectFromServer() { - if (status == FinishedWork) return; - status = FinishedWork; - - Requests copy = requests; - requests.clear(); - for (Requests::const_iterator i = copy.cbegin(), e = copy.cend(); i != e; ++i) { - (*i)->abort(); - (*i)->deleteLater(); - } - - disconnect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); - - address = QUrl(); - - disconnect(&sock, SIGNAL(readyRead()), 0, 0); - sock.close(); - - httpStartTimer.stop(); -} - -void AutoConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { - _addrTcp = addr; - _portTcp = port; - _flagsTcp = flags; - - connect(&sock, SIGNAL(readyRead()), this, SLOT(socketRead())); - sock.connectToHost(QHostAddress(_addrTcp), _portTcp); -} - -void AutoConnection::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*))); - - _addrHttp = addr; - _portHttp = port; - _flagsHttp = flags; - - mtpBuffer buffer(_preparePQFake(httpNonce)); - - DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); - - httpSend(buffer); -} - -bool AutoConnection::isConnected() const { - return (status == UsingTcp) || (status == UsingHttp); -} - -void AutoConnection::requestFinished(QNetworkReply *reply) { - if (status == FinishedWork) return; - - reply->deleteLater(); - if (reply->error() == QNetworkReply::NoError) { - requests.remove(reply); - - mtpBuffer data = _handleHttpResponse(reply); - if (data.size() == 1) { - if (status == WaitingBoth) { - status = WaitingTcp; - } else { - emit error(); - } - } else if (!data.isEmpty()) { - if (status == UsingHttp) { - receivedQueue.push_back(data); - emit receivedData(); - } else if (status == WaitingBoth || status == WaitingHttp) { - try { - MTPResPQ res_pq = _readPQFakeReply(data); - const MTPDresPQ &res_pq_data(res_pq.c_resPQ()); - if (res_pq_data.vnonce == httpNonce) { - if (status == WaitingBoth) { - status = HttpReady; - httpStartTimer.start(MTPTcpConnectionWaitTimeout); - } else { - 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(); - } - } - } catch (Exception &e) { - DEBUG_LOG(("Connection Error: exception in parsing HTTP fake pq-responce, %1").arg(e.what())); - if (status == WaitingBoth) { - status = WaitingTcp; - } else { - emit error(); - } - } - } else if (status == UsingTcp) { - DEBUG_LOG(("Connection Info: already using tcp, ignoring http response")); - } - } - } else { - if (!requests.remove(reply)) { - return; - } - - bool mayBeBadKey = _handleHttpError(reply) && _sentEncrypted; - if (status == WaitingBoth) { - status = WaitingTcp; - } else if (status == WaitingHttp || status == UsingHttp) { - emit error(mayBeBadKey); - } else { - LOG(("Strange Http Error: status %1").arg(status)); - } - } -} - -void AutoConnection::socketPacket(const char *packet, uint32 length) { - if (status == FinishedWork) return; - - mtpBuffer data = _handleTcpResponse(packet, length); - if (data.size() == 1) { - if (status == WaitingBoth) { - 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingHttp; - sock.disconnectFromHost(); - emit connected(); - } else if (status == WaitingTcp || status == UsingTcp) { - bool mayBeBadKey = (data[0] == -410) && _sentEncrypted; - emit error(mayBeBadKey); - } else { - LOG(("Strange Tcp Error; status %1").arg(status)); - } - } else if (status == UsingTcp) { - receivedQueue.push_back(data); - emit receivedData(); - } else if (status == WaitingBoth || status == WaitingTcp || status == HttpReady) { - tcpTimeoutTimer.stop(); - try { - 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingTcp; - emit connected(); - } - } catch (Exception &e) { - DEBUG_LOG(("Connection Error: exception in parsing TCP fake pq-responce, %1").arg(e.what())); - if (status == WaitingBoth) { - 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingHttp; - sock.disconnectFromHost(); - emit connected(); - } else { - emit error(); - } - } - } -} - -bool AutoConnection::usingHttpWait() { - return (status == UsingHttp); -} - -bool AutoConnection::needHttpWait() { - return (status == UsingHttp) ? requests.isEmpty() : false; -} - -int32 AutoConnection::debugState() const { - return (status == UsingHttp) ? -1 : (UsingTcp ? sock.state() : -777); -} - -QString AutoConnection::transport() const { - if (status == UsingTcp) { - return qsl("TCP"); - } else if (status == UsingHttp) { - return qsl("HTTP"); - } else { - return QString(); - } -} - -void AutoConnection::socketError(QAbstractSocket::SocketError e) { - if (status == FinishedWork) return; - - _handleTcpError(e, sock); - 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingHttp; - emit connected(); - } else if (status == WaitingTcp || status == UsingTcp) { - emit error(); - } else { - LOG(("Strange Tcp Error: status %1").arg(status)); - } -} - -TCPConnection::TCPConnection(QThread *thread) - : status(WaitingTcp) - , tcpNonce(rand_value()) - , _tcpTimeout(MTPMinReceiveDelay) - , _flags(0) { - moveToThread(thread); - - tcpTimeoutTimer.moveToThread(thread); - tcpTimeoutTimer.setSingleShot(true); - connect(&tcpTimeoutTimer, SIGNAL(timeout()), this, SLOT(onTcpTimeoutTimer())); - - sock.moveToThread(thread); - App::setProxySettings(sock); - 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())); -} - -void TCPConnection::onSocketConnected() { - if (status == WaitingTcp) { - mtpBuffer buffer(_preparePQFake(tcpNonce)); - - 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); - - sendData(buffer); - } -} - -void TCPConnection::onTcpTimeoutTimer() { - if (status == WaitingTcp) { - if (_tcpTimeout < MTPMaxReceiveDelay) _tcpTimeout *= 2; - _tcpTimeout = -_tcpTimeout; - - QAbstractSocket::SocketState state = sock.state(); - if (state == QAbstractSocket::ConnectedState || state == QAbstractSocket::ConnectingState || state == QAbstractSocket::HostLookupState) { - sock.disconnectFromHost(); - } else if (state != QAbstractSocket::ClosingState) { - sock.connectToHost(QHostAddress(_addr), _port); - } - } -} - -void TCPConnection::onSocketDisconnected() { - if (_tcpTimeout < 0) { - _tcpTimeout = -_tcpTimeout; - if (status == WaitingTcp) { - sock.connectToHost(QHostAddress(_addr), _port); - return; - } - } - if (status == WaitingTcp || status == UsingTcp) { - emit disconnected(); - } -} - -void TCPConnection::sendData(mtpBuffer &buffer) { - if (status == FinishedWork) return; - - if (buffer.size() < 3) { - LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); - emit error(); - return; - } - - if (!packetNum) { - char nonce[64]; - uint32 *first = reinterpret_cast(nonce), *second = first + 1; - uint32 g1 = FourCharsToUInt('P', 'O', 'S', 'T'), g2 = FourCharsToUInt('G', 'E', 'T', ' '), g3 = FourCharsToUInt('H', 'E', 'A', 'D'); - uint32 first1 = 0x44414548U, first2 = 0x54534f50U, first3 = 0x20544547U, first4 = 0x20544547U, first5 = 0xeeeeeeeeU; - uint32 second1 = 0; - do { - memset_rand(nonce, sizeof(nonce)); - } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || *reinterpret_cast(nonce) == 0xef); - sock.write(nonce, sizeof(nonce)); - } - ++packetNum; - - uint32 size = buffer.size() - 3, len = size * 4; - char *data = reinterpret_cast(&buffer[0]); - if (size < 0x7f) { - data[7] = char(size); - TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 1)); - - sock.write(data + 7, len + 1); - } else { - data[4] = 0x7f; - reinterpret_cast(data)[5] = uchar(size & 0xFF); - reinterpret_cast(data)[6] = uchar((size >> 8) & 0xFF); - reinterpret_cast(data)[7] = uchar((size >> 16) & 0xFF); - TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 4)); - - sock.write(data + 4, len + 4); - } -} - -void TCPConnection::disconnectFromServer() { - if (status == FinishedWork) return; - status = FinishedWork; - - disconnect(&sock, SIGNAL(readyRead()), 0, 0); - sock.close(); -} - -void TCPConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { - _addr = addr; - _port = port; - _flags = flags; - - connect(&sock, SIGNAL(readyRead()), this, SLOT(socketRead())); - sock.connectToHost(QHostAddress(_addr), _port); -} - -void TCPConnection::socketPacket(const char *packet, uint32 length) { - if (status == FinishedWork) return; - - mtpBuffer data = _handleTcpResponse(packet, length); - if (data.size() == 1) { - bool mayBeBadKey = (data[0] == -410) && _sentEncrypted; - emit error(mayBeBadKey); - } else if (status == UsingTcp) { - receivedQueue.push_back(data); - emit receivedData(); - } else if (status == WaitingTcp) { - tcpTimeoutTimer.stop(); - try { - 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingTcp; - emit connected(); - } - } catch (Exception &e) { - DEBUG_LOG(("Connection Error: exception in parsing TCP fake pq-responce, %1").arg(e.what())); - emit error(); - } - } -} - -bool TCPConnection::isConnected() const { - return (status == UsingTcp); -} - -int32 TCPConnection::debugState() const { - return sock.state(); -} - -QString TCPConnection::transport() const { - return isConnected() ? qsl("TCP") : QString(); -} - -void TCPConnection::socketError(QAbstractSocket::SocketError e) { - if (status == FinishedWork) return; - - _handleTcpError(e, sock); - emit error(); -} - -HTTPConnection::HTTPConnection(QThread *thread) - : status(WaitingHttp) - , httpNonce(rand_value()) - , _flags(0) { - moveToThread(thread); - manager.moveToThread(thread); - App::setProxySettings(manager); -} - -void HTTPConnection::sendData(mtpBuffer &buffer) { - if (status == FinishedWork) return; - - if (buffer.size() < 3) { - LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); - TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); - emit error(); - return; - } - - int32 requestSize = (buffer.size() - 3) * sizeof(mtpPrime); - - QNetworkRequest request(address); - request.setHeader(QNetworkRequest::ContentLengthHeader, QVariant(requestSize)); - request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(qsl("application/x-www-form-urlencoded"))); - - TCP_LOG(("HTTP Info: sending %1 len request %2").arg(requestSize).arg(Logs::mb(&buffer[2], requestSize).str())); - requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); -} - -void HTTPConnection::disconnectFromServer() { - if (status == FinishedWork) return; - status = FinishedWork; - - Requests copy = requests; - requests.clear(); - for (Requests::const_iterator i = copy.cbegin(), e = copy.cend(); i != e; ++i) { - (*i)->abort(); - (*i)->deleteLater(); - } - - disconnect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); - - address = QUrl(); -} - -void HTTPConnection::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*))); - - _flags = flags; - - mtpBuffer buffer(_preparePQFake(httpNonce)); - - DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((flags & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); - - sendData(buffer); -} - -bool HTTPConnection::isConnected() const { - return (status == UsingHttp); -} - -void HTTPConnection::requestFinished(QNetworkReply *reply) { - if (status == FinishedWork) return; - - reply->deleteLater(); - if (reply->error() == QNetworkReply::NoError) { - requests.remove(reply); - - mtpBuffer data = _handleHttpResponse(reply); - if (data.size() == 1) { - emit error(); - } else if (!data.isEmpty()) { - if (status == UsingHttp) { - receivedQueue.push_back(data); - emit receivedData(); - } else { - try { - 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::f_ipv6) ? "IPv6" : "IPv4")); - status = UsingHttp; - emit connected(); - } - } catch (Exception &e) { - DEBUG_LOG(("Connection Error: exception in parsing HTTP fake pq-responce, %1").arg(e.what())); - emit error(); - } - } - } - } else { - if (!requests.remove(reply)) { - return; - } - - bool mayBeBadKey = _handleHttpError(reply) && _sentEncrypted; - - emit error(mayBeBadKey); - } -} - -bool HTTPConnection::usingHttpWait() { - return true; -} - -bool HTTPConnection::needHttpWait() { - return requests.isEmpty(); -} - -int32 HTTPConnection::debugState() const { - return -1; -} - -QString HTTPConnection::transport() const { - if (status == UsingHttp) { - return qsl("HTTP"); - } else { - return QString(); - } -} - void ConnectionPrivate::createConn(bool createIPv4, bool createIPv6) { destroyConn(); if (createIPv4) { QWriteLocker lock(&stateConnMutex); - if (cConnectionType() == dbictAuto) { - _conn4 = new AutoConnection(thread()); - } else if (cConnectionType() == dbictTcpProxy) { - _conn4 = new TCPConnection(thread()); - } else { - _conn4 = new HTTPConnection(thread()); - } + _conn4 = AbstractConnection::create(thread()); connect(_conn4, SIGNAL(error(bool)), this, SLOT(onError4(bool))); connect(_conn4, SIGNAL(receivedSome()), this, SLOT(onReceivedSome())); } if (createIPv6) { QWriteLocker lock(&stateConnMutex); - if (cConnectionType() == dbictAuto) { - _conn6 = new AutoConnection(thread()); - } else if (cConnectionType() == dbictTcpProxy) { - _conn6 = new TCPConnection(thread()); - } else { - _conn6 = new HTTPConnection(thread()); - } + _conn6 = AbstractConnection::create(thread()); connect(_conn6, SIGNAL(error(bool)), this, SLOT(onError6(bool))); connect(_conn6, SIGNAL(receivedSome()), this, SLOT(onReceivedSome())); } diff --git a/Telegram/SourceFiles/mtproto/connection.h b/Telegram/SourceFiles/mtproto/connection.h index 25cc61f281..96e25c4a90 100644 --- a/Telegram/SourceFiles/mtproto/connection.h +++ b/Telegram/SourceFiles/mtproto/connection.h @@ -22,6 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/core_types.h" #include "mtproto/auth_key.h" +#include "mtproto/connection_abstract.h" namespace MTP { namespace internal { @@ -68,244 +69,6 @@ private: }; -class AbstractConnection : public QObject { - Q_OBJECT - - typedef QList BuffersQueue; - -public: - - AbstractConnection() : _sentEncrypted(false) { - } - AbstractConnection(const AbstractConnection &other) = delete; - AbstractConnection &operator=(const AbstractConnection &other) = delete; - virtual ~AbstractConnection() = 0{ - } - - void setSentEncrypted() { - _sentEncrypted = true; - } - - 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, 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; - } - virtual bool needHttpWait() { - return false; - } - - virtual int32 debugState() const = 0; - - virtual QString transport() const = 0; - - BuffersQueue &received() { - return receivedQueue; - } - -signals: - - void receivedData(); - void receivedSome(); // to stop restart timer - - void error(bool mayBeBadKey = false); - - void connected(); - void disconnected(); - -protected: - - BuffersQueue receivedQueue; // list of received packets, not processed yet - bool _sentEncrypted; - -}; - -class AbstractTcpConnection : public AbstractConnection { - Q_OBJECT - -public: - - AbstractTcpConnection(); - virtual ~AbstractTcpConnection() = 0 { - } - -public slots: - - void socketRead(); - -protected: - - QTcpSocket sock; - uint32 packetNum; // sent packet number - - uint32 packetRead, packetLeft; // reading from socket - bool readingToShort; - char *currentPos; - mtpBuffer longBuffer; - mtpPrime shortBuffer[MTPShortBufferSize]; - virtual void socketPacket(const char *packet, uint32 length) = 0; - -}; - -class AutoConnection : public AbstractTcpConnection { - Q_OBJECT - -public: - - AutoConnection(QThread *thread); - - 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 override; - - QString transport() const override; - -public slots: - - void socketError(QAbstractSocket::SocketError e); - void requestFinished(QNetworkReply *reply); - - void onSocketConnected(); - void onSocketDisconnected(); - void onHttpStart(); - - void onTcpTimeoutTimer(); - -protected: - - void socketPacket(const char *packet, uint32 length) override; - -private: - - void tcpSend(mtpBuffer &buffer); - void httpSend(mtpBuffer &buffer); - enum Status { - WaitingBoth = 0, - WaitingHttp, - WaitingTcp, - HttpReady, - UsingHttp, - UsingTcp, - FinishedWork - }; - Status status; - MTPint128 tcpNonce, httpNonce; - QTimer httpStartTimer; - - QNetworkAccessManager manager; - QUrl address; - - typedef QSet Requests; - Requests requests; - - QString _addrTcp, _addrHttp; - int32 _portTcp, _portHttp; - MTPDdcOption::Flags _flagsTcp, _flagsHttp; - int32 _tcpTimeout; - QTimer tcpTimeoutTimer; - -}; - -class TCPConnection : public AbstractTcpConnection { - Q_OBJECT - -public: - - TCPConnection(QThread *thread); - - 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 override; - - int32 debugState() const override; - - QString transport() const override; - -public slots: - - void socketError(QAbstractSocket::SocketError e); - - void onSocketConnected(); - void onSocketDisconnected(); - - void onTcpTimeoutTimer(); - -protected: - - void socketPacket(const char *packet, uint32 length) override; - -private: - - enum Status { - WaitingTcp = 0, - UsingTcp, - FinishedWork - }; - Status status; - MTPint128 tcpNonce; - - QString _addr; - int32 _port, _tcpTimeout; - MTPDdcOption::Flags _flags; - QTimer tcpTimeoutTimer; - -}; - -class HTTPConnection : public AbstractConnection { - Q_OBJECT - -public: - - HTTPConnection(QThread *thread); - - 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, MTPDdcOption::Flags flags) override; - bool isConnected() const override; - bool usingHttpWait() override; - bool needHttpWait() override; - - int32 debugState() const override; - - QString transport() const override; - -public slots: - - void requestFinished(QNetworkReply *reply); - -private: - - enum Status { - WaitingHttp = 0, - UsingHttp, - FinishedWork - }; - Status status; - MTPint128 httpNonce; - MTPDdcOption::Flags _flags; - - QNetworkAccessManager manager; - QUrl address; - - typedef QSet Requests; - Requests requests; - -}; - class ConnectionPrivate : public QObject { Q_OBJECT diff --git a/Telegram/Telegram.vcxproj b/Telegram/Telegram.vcxproj index 7f203989fd..8b18f8ada2 100644 --- a/Telegram/Telegram.vcxproj +++ b/Telegram/Telegram.vcxproj @@ -213,6 +213,22 @@ true true + + true + true + + + true + true + + + true + true + + + true + true + true true @@ -476,6 +492,22 @@ true true + + true + true + + + true + true + + + true + true + + + true + true + true true @@ -765,6 +797,22 @@ true true + + true + true + + + true + true + + + true + true + + + true + true + true true @@ -1034,16 +1082,20 @@ - + + + + + + - @@ -1101,6 +1153,137 @@ true true + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing connection_http.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_http.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 connection_http.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_http.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) + Moc%27ing connection_http.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_http.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) + Moc%27ing connection_tcp.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_tcp.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 connection_tcp.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_tcp.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) + Moc%27ing connection_tcp.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_tcp.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) + Moc%27ing connection.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection.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 connection.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection.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) + Moc%27ing connection.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection.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) + Moc%27ing connection_abstract.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_abstract.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 connection_abstract.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_abstract.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) + Moc%27ing connection_abstract.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_abstract.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) + Moc%27ing connection_auto.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_auto.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 connection_auto.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_auto.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) + Moc%27ing connection_auto.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection_auto.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) + Moc%27ing dcenter.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/dcenter.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 dcenter.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/dcenter.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) + Moc%27ing dcenter.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/dcenter.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) + Moc%27ing facade.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/facade.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 facade.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/facade.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) + Moc%27ing facade.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/facade.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) + Moc%27ing file_download.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/file_download.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 file_download.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/file_download.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) + Moc%27ing file_download.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/file_download.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) + Moc%27ing session.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/session.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 session.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/session.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) + Moc%27ing session.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/session.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" + @@ -1838,20 +2021,6 @@ - - Moc%27ing connection.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection.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" - Moc%27ing connection.h... - Moc%27ing connection.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/connection.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/mtproto/connection.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) - Moc%27ing mainwidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -1866,20 +2035,6 @@ $(QTDIR)\bin\moc.exe;%(FullPath) $(QTDIR)\bin\moc.exe;%(FullPath) - - Moc%27ing facade.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/facade.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" - Moc%27ing facade.h... - Moc%27ing facade.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/facade.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/mtproto/facade.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) - $(QTDIR)\bin\moc.exe;%(FullPath) Moc%27ing mediaview.h... @@ -1894,53 +2049,6 @@ .\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/mediaview.h" - - - Moc%27ing file_download.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/file_download.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" - Moc%27ing file_download.h... - Moc%27ing file_download.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/file_download.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/mtproto/file_download.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) - - - - - Moc%27ing dcenter.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/dcenter.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" - Moc%27ing dcenter.h... - Moc%27ing dcenter.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/dcenter.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/mtproto/dcenter.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) - - - - - Moc%27ing session.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/session.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" - Moc%27ing session.h... - Moc%27ing session.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../SourceFiles/mtproto/session.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/mtproto/session.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) - Moc%27ing settingswidget.h... .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp @@ -2178,6 +2286,8 @@ + + true true diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index b4b09d1c0b..86d65c3fb9 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -849,24 +849,33 @@ Generated Files\Release - - mtproto - - + Generated Files\Deploy - + + mtproto + + Generated Files\Debug - + Generated Files\Release - + + Generated Files\Deploy + + + mtproto + + mtproto mtproto + + mtproto + Generated Files\Deploy @@ -876,10 +885,10 @@ Generated Files\Release - + mtproto - + mtproto @@ -891,7 +900,19 @@ Generated Files\Release - + + mtproto + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + mtproto @@ -903,15 +924,18 @@ Generated Files\Release - - mtproto - mtproto + + mtproto + mtproto + + mtproto + Generated Files\Deploy @@ -921,9 +945,33 @@ Generated Files\Release - + mtproto + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Debug + + + Generated Files\Release + + + Generated Files\Deploy + + + Generated Files\Debug + + + Generated Files\Release + @@ -1007,9 +1055,6 @@ intro - - mtproto - mtproto @@ -1019,6 +1064,9 @@ mtproto + + mtproto + mtproto @@ -1234,7 +1282,10 @@ Source Files - + + mtproto + + mtproto @@ -1243,12 +1294,21 @@ mtproto + + mtproto + mtproto mtproto + + mtproto + + + mtproto + @@ -1287,6 +1347,12 @@ Version + + mtproto + + + mtproto + From 7c99f947eb6f05f8dc318edd1f0f27e9c988fcc3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 15:57:10 +0300 Subject: [PATCH 245/316] added connection implementations to git, protocol improved --- Telegram/SourceFiles/audio.cpp | 13 +- Telegram/SourceFiles/autoupdater.cpp | 6 + Telegram/SourceFiles/gui/animation.cpp | 7 + Telegram/SourceFiles/localstorage.cpp | 28 +- Telegram/SourceFiles/mtproto/auth_key.cpp | 22 +- Telegram/SourceFiles/mtproto/auth_key.h | 48 ++- Telegram/SourceFiles/mtproto/connection.cpp | 37 +- .../mtproto/connection_abstract.cpp | 87 ++++ .../SourceFiles/mtproto/connection_abstract.h | 92 ++++ .../SourceFiles/mtproto/connection_auto.cpp | 344 +++++++++++++++ .../SourceFiles/mtproto/connection_auto.h | 94 +++++ .../SourceFiles/mtproto/connection_http.cpp | 218 ++++++++++ .../SourceFiles/mtproto/connection_http.h | 76 ++++ .../SourceFiles/mtproto/connection_tcp.cpp | 395 ++++++++++++++++++ Telegram/SourceFiles/mtproto/connection_tcp.h | 119 ++++++ Telegram/SourceFiles/mtproto/core_types.cpp | 2 + Telegram/SourceFiles/mtproto/dcenter.cpp | 99 ++--- Telegram/SourceFiles/mtproto/dcenter.h | 51 ++- Telegram/SourceFiles/mtproto/facade.cpp | 40 +- Telegram/SourceFiles/mtproto/facade.h | 4 +- Telegram/SourceFiles/mtproto/session.cpp | 14 +- Telegram/SourceFiles/mtproto/session.h | 10 +- Telegram/SourceFiles/pspecific_linux.cpp | 8 +- Telegram/SourceFiles/pspecific_win.h | 2 + Telegram/SourceFiles/stdafx.h | 38 +- Telegram/SourceFiles/types.cpp | 5 + Telegram/SourceFiles/window.cpp | 13 +- 27 files changed, 1663 insertions(+), 209 deletions(-) create mode 100644 Telegram/SourceFiles/mtproto/connection_abstract.cpp create mode 100644 Telegram/SourceFiles/mtproto/connection_abstract.h create mode 100644 Telegram/SourceFiles/mtproto/connection_auto.cpp create mode 100644 Telegram/SourceFiles/mtproto/connection_auto.h create mode 100644 Telegram/SourceFiles/mtproto/connection_http.cpp create mode 100644 Telegram/SourceFiles/mtproto/connection_http.h create mode 100644 Telegram/SourceFiles/mtproto/connection_tcp.cpp create mode 100644 Telegram/SourceFiles/mtproto/connection_tcp.h diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 25f11dc58c..139c617d61 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -19,6 +19,7 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" + #include "audio.h" #include @@ -27,10 +28,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #define AL_ALEXT_PROTOTYPES #include -#ifdef Q_OS_MAC - extern "C" { +#include +#include +#include +#include +#ifdef Q_OS_MAC #include #undef iconv_open @@ -46,10 +50,9 @@ size_t iconv (iconv_t cd, char* * inbuf, size_t *inbytesleft, char* * outbuf, s int iconv_close (iconv_t cd) { return libiconv_close(cd); } +#endif // Q_OS_MAC -} - -#endif +} // extern "C" namespace { ALCdevice *audioDevice = 0; diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index 0734becdfb..d82574cb91 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -28,6 +28,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include +#ifdef Q_OS_WIN // use Lzma SDK for win +#include +#else // Q_OS_WIN +#include +#endif // else of Q_OS_WIN + #include "application.h" #include "pspecific.h" diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index 6628f6ef27..047a3346b3 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -22,6 +22,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "animation.h" +extern "C" { +#include +#include +#include +#include +} + #include "mainwidget.h" #include "window.h" diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index b75e867618..359b3b521d 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -160,8 +160,8 @@ namespace { QByteArray _settingsSalt, _passKeySalt, _passKeyEncrypted; - mtpAuthKey _oldKey, _settingsKey, _passKey, _localKey; - void createLocalKey(const QByteArray &pass, QByteArray *salt, mtpAuthKey *result) { + MTP::AuthKey _oldKey, _settingsKey, _passKey, _localKey; + void createLocalKey(const QByteArray &pass, QByteArray *salt, MTP::AuthKey *result) { uchar key[LocalEncryptKeySize] = { 0 }; int32 iterCount = pass.size() ? LocalEncryptIterCount : LocalEncryptNoPwdIterCount; // dont slow down for no password QByteArray newSalt; @@ -282,7 +282,7 @@ namespace { return true; } - static QByteArray prepareEncrypted(EncryptedDescriptor &data, const mtpAuthKey &key = _localKey) { + static QByteArray prepareEncrypted(EncryptedDescriptor &data, const MTP::AuthKey &key = _localKey) { data.finish(); QByteArray &toEncrypt(data.data); @@ -296,11 +296,11 @@ namespace { *(uint32*)toEncrypt.data() = size; QByteArray encrypted(0x10 + fullSize, Qt::Uninitialized); // 128bit of sha1 - key128, sizeof(data), data hashSha1(toEncrypt.constData(), toEncrypt.size(), encrypted.data()); - aesEncryptLocal(toEncrypt.constData(), encrypted.data() + 0x10, fullSize, &key, encrypted.constData()); + MTP::aesEncryptLocal(toEncrypt.constData(), encrypted.data() + 0x10, fullSize, &key, encrypted.constData()); return encrypted; } - bool writeEncrypted(EncryptedDescriptor &data, const mtpAuthKey &key = _localKey) { + bool writeEncrypted(EncryptedDescriptor &data, const MTP::AuthKey &key = _localKey) { return writeData(prepareEncrypted(data, key)); } void finish() { @@ -468,7 +468,7 @@ namespace { return false; } - bool decryptLocal(EncryptedDescriptor &result, const QByteArray &encrypted, const mtpAuthKey &key = _localKey) { + bool decryptLocal(EncryptedDescriptor &result, const QByteArray &encrypted, const MTP::AuthKey &key = _localKey) { if (encrypted.size() <= 16 || (encrypted.size() & 0x0F)) { LOG(("App Error: bad encrypted part size: %1").arg(encrypted.size())); return false; @@ -504,7 +504,7 @@ namespace { return true; } - bool readEncryptedFile(FileReadDescriptor &result, const QString &name, int options = UserPath | SafePath, const mtpAuthKey &key = _localKey) { + bool readEncryptedFile(FileReadDescriptor &result, const QString &name, int options = UserPath | SafePath, const MTP::AuthKey &key = _localKey) { if (!readFile(result, name, options)) { return false; } @@ -534,7 +534,7 @@ namespace { return true; } - bool readEncryptedFile(FileReadDescriptor &result, const FileKey &fkey, int options = UserPath | SafePath, const mtpAuthKey &key = _localKey) { + bool readEncryptedFile(FileReadDescriptor &result, const FileKey &fkey, int options = UserPath | SafePath, const MTP::AuthKey &key = _localKey) { return readEncryptedFile(result, toFilePart(fkey), options, key); } @@ -932,7 +932,7 @@ namespace { DEBUG_LOG(("MTP Info: key found, dc %1, key: %2").arg(dcId).arg(Logs::mb(key, 256).str())); dcId = MTP::bareDcId(dcId); - mtpAuthKeyPtr keyPtr(new mtpAuthKey()); + MTP::AuthKeyPtr keyPtr(new MTP::AuthKey()); keyPtr->setKey(key); keyPtr->setDC(dcId); @@ -1668,16 +1668,16 @@ namespace { return; } - mtpKeysMap keys = MTP::getKeys(); + MTP::AuthKeysMap keys = MTP::getKeys(); quint32 size = sizeof(quint32) + sizeof(qint32) + sizeof(quint32); size += keys.size() * (sizeof(quint32) + sizeof(quint32) + 256); EncryptedDescriptor data(size); data.stream << quint32(dbiUser) << qint32(MTP::authedId()) << quint32(MTP::maindc()); - for (mtpKeysMap::const_iterator i = keys.cbegin(), e = keys.cend(); i != e; ++i) { - data.stream << quint32(dbiKey) << quint32((*i)->getDC()); - (*i)->write(data.stream); + for_const (const MTP::AuthKeyPtr &key, keys) { + data.stream << quint32(dbiKey) << quint32(key->getDC()); + key->write(data.stream); } mtp.writeEncrypted(data, _localKey); @@ -2291,7 +2291,7 @@ namespace Local { } bool checkPasscode(const QByteArray &passcode) { - mtpAuthKey tmp; + MTP::AuthKey tmp; createLocalKey(passcode, &_passKeySalt, &tmp); return (tmp == _passKey); } diff --git a/Telegram/SourceFiles/mtproto/auth_key.cpp b/Telegram/SourceFiles/mtproto/auth_key.cpp index 29f297f6b6..cd0f3497bc 100644 --- a/Telegram/SourceFiles/mtproto/auth_key.cpp +++ b/Telegram/SourceFiles/mtproto/auth_key.cpp @@ -24,22 +24,36 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include -void aesEncrypt(const void *src, void *dst, uint32 len, void *key, void *iv) { +namespace MTP { + +void aesIgeEncrypt(const void *src, void *dst, uint32 len, const void *key, const void *iv) { uchar aes_key[32], aes_iv[32]; memcpy(aes_key, key, 32); memcpy(aes_iv, iv, 32); AES_KEY aes; AES_set_encrypt_key(aes_key, 256, &aes); - AES_ige_encrypt((const uchar*)src, (uchar*)dst, len, &aes, aes_iv, AES_ENCRYPT); + AES_ige_encrypt(static_cast(src), static_cast(dst), len, &aes, aes_iv, AES_ENCRYPT); } -void aesDecrypt(const void *src, void *dst, uint32 len, void *key, void *iv) { +void aesIgeDecrypt(const void *src, void *dst, uint32 len, const void *key, const void *iv) { uchar aes_key[32], aes_iv[32]; memcpy(aes_key, key, 32); memcpy(aes_iv, iv, 32); AES_KEY aes; AES_set_decrypt_key(aes_key, 256, &aes); - AES_ige_encrypt((const uchar*)src, (uchar*)dst, len, &aes, aes_iv, AES_DECRYPT); + AES_ige_encrypt(static_cast(src), static_cast(dst), len, &aes, aes_iv, AES_DECRYPT); } + +void aesCtrEncrypt(void *data, uint32 len, const void *key, CTRState *state) { + AES_KEY aes; + AES_set_encrypt_key(static_cast(key), 256, &aes); + + static_assert(CTRState::IvecSize == AES_BLOCK_SIZE, "Wrong size of ctr ivec!"); + static_assert(CTRState::EcountSize == AES_BLOCK_SIZE, "Wrong size of ctr ecount!"); + + AES_ctr128_encrypt(static_cast(data), static_cast(data), len, &aes, state->ivec, state->ecount, &state->num); +} + +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/auth_key.h b/Telegram/SourceFiles/mtproto/auth_key.h index 9bd994461e..d2c720c7ef 100644 --- a/Telegram/SourceFiles/mtproto/auth_key.h +++ b/Telegram/SourceFiles/mtproto/auth_key.h @@ -20,10 +20,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -class mtpAuthKey { +namespace MTP { + +class AuthKey { public: - mtpAuthKey() : _isset(false), _dc(0) { + AuthKey() : _isset(false), _dc(0) { } bool created() const { @@ -94,7 +96,7 @@ public: static const uint64 RecreateKeyId = 0xFFFFFFFFFFFFFFFFL; - friend bool operator==(const mtpAuthKey &a, const mtpAuthKey &b); + friend bool operator==(const AuthKey &a, const AuthKey &b); private: @@ -105,40 +107,54 @@ private: }; -inline bool operator==(const mtpAuthKey &a, const mtpAuthKey &b) { +inline bool operator==(const AuthKey &a, const AuthKey &b) { return !memcmp(a._key, b._key, 256); } -typedef QSharedPointer mtpAuthKeyPtr; -typedef QVector mtpKeysMap; +typedef QSharedPointer AuthKeyPtr; +typedef QVector AuthKeysMap; -void aesEncrypt(const void *src, void *dst, uint32 len, void *key, void *iv); -void aesDecrypt(const void *src, void *dst, uint32 len, void *key, void *iv); +void aesIgeEncrypt(const void *src, void *dst, uint32 len, const void *key, const void *iv); +void aesIgeDecrypt(const void *src, void *dst, uint32 len, const void *key, const void *iv); -inline void aesEncrypt(const void *src, void *dst, uint32 len, const mtpAuthKeyPtr &authKey, const MTPint128 &msgKey) { +inline void aesIgeEncrypt(const void *src, void *dst, uint32 len, const AuthKeyPtr &authKey, const MTPint128 &msgKey) { MTPint256 aesKey, aesIV; authKey->prepareAES(msgKey, aesKey, aesIV); - return aesEncrypt(src, dst, len, &aesKey, &aesIV); + return aesIgeEncrypt(src, dst, len, static_cast(&aesKey), static_cast(&aesIV)); } -inline void aesEncryptLocal(const void *src, void *dst, uint32 len, const mtpAuthKey *authKey, const void *key128) { +inline void aesEncryptLocal(const void *src, void *dst, uint32 len, const AuthKey *authKey, const void *key128) { MTPint256 aesKey, aesIV; authKey->prepareAES(*(const MTPint128*)key128, aesKey, aesIV, false); - return aesEncrypt(src, dst, len, &aesKey, &aesIV); + return aesIgeEncrypt(src, dst, len, static_cast(&aesKey), static_cast(&aesIV)); } -inline void aesDecrypt(const void *src, void *dst, uint32 len, const mtpAuthKeyPtr &authKey, const MTPint128 &msgKey) { +inline void aesIgeDecrypt(const void *src, void *dst, uint32 len, const AuthKeyPtr &authKey, const MTPint128 &msgKey) { MTPint256 aesKey, aesIV; authKey->prepareAES(msgKey, aesKey, aesIV, false); - return aesDecrypt(src, dst, len, &aesKey, &aesIV); + return aesIgeDecrypt(src, dst, len, static_cast(&aesKey), static_cast(&aesIV)); } -inline void aesDecryptLocal(const void *src, void *dst, uint32 len, const mtpAuthKey *authKey, const void *key128) { +inline void aesDecryptLocal(const void *src, void *dst, uint32 len, const AuthKey *authKey, const void *key128) { MTPint256 aesKey, aesIV; authKey->prepareAES(*(const MTPint128*)key128, aesKey, aesIV, false); - return aesDecrypt(src, dst, len, &aesKey, &aesIV); + return aesIgeDecrypt(src, dst, len, static_cast(&aesKey), static_cast(&aesIV)); } + +// ctr used inplace, encrypt the data and leave it at the same place +struct CTRState { + static constexpr int KeySize = 32; + static constexpr int IvecSize = 16; + static constexpr int EcountSize = 16; + + uchar ivec[IvecSize] = { 0 }; + uint32 num = 0; + uchar ecount[EcountSize] = { 0 }; +}; +void aesCtrEncrypt(void *data, uint32 len, const void *key, CTRState *state); + +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index c04dcaba35..1a84f8e28a 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -28,6 +28,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include #include +#include "zlib.h" #include "mtproto/rsa_public_key.h" @@ -438,7 +439,7 @@ ConnectionPrivate::ConnectionPrivate(QThread *thread, Connection *owner, Session moveToThread(thread); if (!dc) { - QReadLocker lock(mtpDcOptionsMutex()); + QReadLocker lock(dcOptionsMutex()); const MTP::DcOptions &options(Global::DcOptions()); if (options.isEmpty()) { LOG(("MTP Error: connect failed, no DCs")); @@ -1042,7 +1043,7 @@ void ConnectionPrivate::retryByTimer() { } else if (retryTimeout < 64000) { retryTimeout *= 2; } - if (keyId == mtpAuthKey::RecreateKeyId) { + if (keyId == AuthKey::RecreateKeyId) { if (sessionData->getKey()) { unlockKey(); @@ -1083,7 +1084,7 @@ void ConnectionPrivate::socketStart(bool afterConfig) { string ip[2][2]; uint32 port[2][2] = { { 0 } }; { - QReadLocker lock(mtpDcOptionsMutex()); + QReadLocker lock(dcOptionsMutex()); const MTP::DcOptions &options(Global::DcOptions()); int32 shifts[2][2][4] = { { // IPv4 @@ -1138,8 +1139,8 @@ void ConnectionPrivate::socketStart(bool afterConfig) { } if (noIPv4) DEBUG_LOG(("MTP Info: DC %1 options for IPv4 over HTTP not found, waiting for config").arg(dc)); if (cTryIPv6() && noIPv6) DEBUG_LOG(("MTP Info: DC %1 options for IPv6 over HTTP not found, waiting for config").arg(dc)); - connect(mtpConfigLoader(), SIGNAL(loaded()), this, SLOT(onConfigLoaded())); - mtpConfigLoader()->load(); + connect(configLoader(), SIGNAL(loaded()), this, SLOT(onConfigLoaded())); + configLoader()->load(); return; } @@ -1180,12 +1181,12 @@ void ConnectionPrivate::restart(bool mayBeBadKey) { _waitForReceivedTimer.stop(); _waitForConnectedTimer.stop(); - mtpAuthKeyPtr key(sessionData->getKey()); + AuthKeyPtr key(sessionData->getKey()); if (key) { if (!sessionData->isCheckedKey()) { if (mayBeBadKey) { clearMessages(); - keyId = mtpAuthKey::RecreateKeyId; + keyId = AuthKey::RecreateKeyId; // retryTimeout = 1; // no ddos please LOG(("MTP Info: key may be bad and was not checked - but won't be destroyed, no log outs because of bad server right now..")); } @@ -1351,7 +1352,7 @@ void ConnectionPrivate::handleReceived() { return restart(); } - mtpAuthKeyPtr key(sessionData->getKey()); + AuthKeyPtr key(sessionData->getKey()); if (!key || key->keyId() != keyId) { DEBUG_LOG(("MTP Error: auth_key id for dc %1 changed").arg(dc)); @@ -1383,7 +1384,7 @@ void ConnectionPrivate::handleReceived() { const mtpPrime *from(msg), *end; MTPint128 msgKey(*(MTPint128*)(encrypted + 2)); - aesDecrypt(encrypted + 6, data, dataBuffer.size(), key, msgKey); + aesIgeDecrypt(encrypted + 6, data, dataBuffer.size(), key, msgKey); uint64 serverSalt = *(uint64*)&data[0], session = *(uint64*)&data[2], msgId = *(uint64*)&data[4]; uint32 seqNo = *(uint32*)&data[6], msgLen = *(uint32*)&data[7]; @@ -2351,7 +2352,7 @@ void ConnectionPrivate::updateAuthKey() { keyId = newKeyId; return; // some other connection is getting key } - const mtpAuthKeyPtr &key(sessionData->getKey()); + const AuthKeyPtr &key(sessionData->getKey()); newKeyId = key ? key->keyId() : 0; } if (keyId != newKeyId) { @@ -2366,7 +2367,7 @@ void ConnectionPrivate::updateAuthKey() { DEBUG_LOG(("AuthKey Info: No key in updateAuthKey(), will be creating auth_key")); lockKey(); - const mtpAuthKeyPtr &key(sessionData->getKey()); + const AuthKeyPtr &key(sessionData->getKey()); if (key) { if (keyId != key->keyId()) clearMessages(); keyId = key->keyId(); @@ -2390,7 +2391,7 @@ void ConnectionPrivate::updateAuthKey() { } void ConnectionPrivate::clearMessages() { - if (keyId && keyId != mtpAuthKey::RecreateKeyId && _conn) { + if (keyId && keyId != AuthKey::RecreateKeyId && _conn) { _conn->received().clear(); } } @@ -2543,7 +2544,7 @@ void ConnectionPrivate::dhParamsAnswered() { memcpy(authKeyData->aesIV + 8, sha1nn, 20); memcpy(authKeyData->aesIV + 28, &authKeyData->new_nonce, 4); - aesDecrypt(&encDHStr[0], &decBuffer[0], encDHLen, authKeyData->aesKey, authKeyData->aesIV); + aesIgeDecrypt(&encDHStr[0], &decBuffer[0], encDHLen, authKeyData->aesKey, authKeyData->aesIV); const mtpPrime *from(&decBuffer[5]), *to(from), *end(from + (encDHBufLen - 5)); MTPServer_DH_inner_data dh_inner(to, end); @@ -2667,7 +2668,7 @@ void ConnectionPrivate::dhClientParamsSend() { sdhEncString.resize(encFullSize * 4); - aesEncrypt(&encBuffer[0], &sdhEncString[0], encFullSize * sizeof(mtpPrime), authKeyData->aesKey, authKeyData->aesIV); + aesIgeEncrypt(&encBuffer[0], &sdhEncString[0], encFullSize * sizeof(mtpPrime), authKeyData->aesKey, authKeyData->aesIV); connect(_conn, SIGNAL(receivedData()), this, SLOT(dhClientParamsAnswered())); @@ -2718,7 +2719,7 @@ void ConnectionPrivate::dhClientParamsAnswered() { uint64 salt1 = authKeyData->new_nonce.l.l, salt2 = authKeyData->server_nonce.l, serverSalt = salt1 ^ salt2; sessionData->setSalt(serverSalt); - mtpAuthKeyPtr authKey(new mtpAuthKey()); + AuthKeyPtr authKey(new AuthKey()); authKey->setKey(authKeyData->auth_key); authKey->setDC(bareDcId(dc)); @@ -2946,7 +2947,7 @@ bool ConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResponse, Q return false; } - mtpAuthKeyPtr key(sessionData->getKey()); + AuthKeyPtr key(sessionData->getKey()); if (!key || key->keyId() != keyId) { DEBUG_LOG(("MTP Error: auth_key id for dc %1 changed").arg(dc)); @@ -2973,7 +2974,7 @@ bool ConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResponse, Q *((uint64*)&result[2]) = keyId; *((MTPint128*)&result[4]) = msgKey; - aesEncrypt(request->constData(), &result[8], fullSize * sizeof(mtpPrime), key, msgKey); + aesIgeEncrypt(request->constData(), &result[8], fullSize * sizeof(mtpPrime), key, msgKey); DEBUG_LOG(("MTP Info: sending request, size: %1, num: %2, time: %3").arg(fullSize + 6).arg((*request)[4]).arg((*request)[5])); @@ -3031,7 +3032,7 @@ void ConnectionPrivate::stop() { QWriteLocker lockFinished(&sessionDataMutex); if (sessionData) { if (myKeyLock) { - sessionData->owner()->notifyKeyCreated(mtpAuthKeyPtr()); // release key lock, let someone else create it + sessionData->owner()->notifyKeyCreated(AuthKeyPtr()); // release key lock, let someone else create it sessionData->keyMutex()->unlock(); myKeyLock = false; } diff --git a/Telegram/SourceFiles/mtproto/connection_abstract.cpp b/Telegram/SourceFiles/mtproto/connection_abstract.cpp new file mode 100644 index 0000000000..6d5f3c4339 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_abstract.cpp @@ -0,0 +1,87 @@ +/* +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 "mtproto/connection_abstract.h" + +#include "mtproto/connection_tcp.h" +#include "mtproto/connection_http.h" +#include "mtproto/connection_auto.h" + +namespace MTP { +namespace internal { + +mtpBuffer AbstractConnection::preparePQFake(const MTPint128 &nonce) { + MTPReq_pq req_pq(nonce); + mtpBuffer buffer; + uint32 requestSize = req_pq.innerLength() >> 2; + + buffer.resize(0); + buffer.reserve(8 + requestSize); + buffer.push_back(0); // tcp packet len + buffer.push_back(0); // tcp packet num + buffer.push_back(0); + buffer.push_back(0); + buffer.push_back(0); + buffer.push_back(unixtime()); + buffer.push_back(requestSize * 4); + req_pq.write(buffer); + buffer.push_back(0); // tcp crc32 hash + + return buffer; +} + +MTPResPQ AbstractConnection::readPQFakeReply(const mtpBuffer &buffer) { + const mtpPrime *answer(buffer.constData()); + uint32 len = buffer.size(); + if (len < 5) { + LOG(("Fake PQ Error: bad request answer, len = %1").arg(len * sizeof(mtpPrime))); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); + throw Exception("bad pq reply"); + } + if (answer[0] != 0 || answer[1] != 0 || (((uint32)answer[2]) & 0x03) != 1/* || (unixtime() - answer[3] > 300) || (answer[3] - unixtime() > 60)*/) { // didnt sync time yet + LOG(("Fake PQ Error: bad request answer start (%1 %2 %3)").arg(answer[0]).arg(answer[1]).arg(answer[2])); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); + throw Exception("bad pq reply"); + } + uint32 answerLen = (uint32)answer[4]; + if (answerLen != (len - 5) * sizeof(mtpPrime)) { + LOG(("Fake PQ Error: bad request answer %1 <> %2").arg(answerLen).arg((len - 5) * sizeof(mtpPrime))); + DEBUG_LOG(("Fake PQ Error: answer bytes %1").arg(Logs::mb(answer, len * sizeof(mtpPrime)).str())); + throw Exception("bad pq reply"); + } + const mtpPrime *from(answer + 5), *end(from + len - 5); + MTPResPQ response; + response.read(from, end); + return response; +} + +AbstractConnection *AbstractConnection::create(QThread *thread) { + if (cConnectionType() == dbictHttpProxy) { + return new HTTPConnection(thread); + } else if (cConnectionType() == dbictTcpProxy) { + return new TCPConnection(thread); + } + return new AutoConnection(thread); +} + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_abstract.h b/Telegram/SourceFiles/mtproto/connection_abstract.h new file mode 100644 index 0000000000..3fa7c7195f --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_abstract.h @@ -0,0 +1,92 @@ +/* +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 + +#include "mtproto/core_types.h" + +namespace MTP { +namespace internal { + +class AbstractConnection : public QObject { + Q_OBJECT + +public: + + AbstractConnection(QThread *thread) : _sentEncrypted(false) { + moveToThread(thread); + } + AbstractConnection(const AbstractConnection &other) = delete; + AbstractConnection &operator=(const AbstractConnection &other) = delete; + virtual ~AbstractConnection() = 0 { + } + + // virtual constructor + static AbstractConnection *create(QThread *thread); + + void setSentEncrypted() { + _sentEncrypted = true; + } + + 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, 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; + } + virtual bool needHttpWait() { + return false; + } + + virtual int32 debugState() const = 0; + + virtual QString transport() const = 0; + + typedef QList BuffersQueue; + BuffersQueue &received() { + return receivedQueue; + } + +signals: + + void receivedData(); + void receivedSome(); // to stop restart timer + + void error(bool mayBeBadKey = false); + + void connected(); + void disconnected(); + +protected: + + BuffersQueue receivedQueue; // list of received packets, not processed yet + bool _sentEncrypted; + + // first we always send fake MTPReq_pq to see if connection works at all + // we send them simultaneously through TCP/HTTP/IPv4/IPv6 to choose the working one + static mtpBuffer preparePQFake(const MTPint128 &nonce); + static MTPResPQ readPQFakeReply(const mtpBuffer &buffer); + +}; + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_auto.cpp b/Telegram/SourceFiles/mtproto/connection_auto.cpp new file mode 100644 index 0000000000..3723f495c3 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_auto.cpp @@ -0,0 +1,344 @@ +/* +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 "mtproto/connection_auto.h" + +#include "mtproto/connection_http.h" + +namespace MTP { +namespace internal { + +AutoConnection::AutoConnection(QThread *thread) : AbstractTCPConnection(thread) +, status(WaitingBoth) +, tcpNonce(rand_value()) +, httpNonce(rand_value()) +, _flagsTcp(0) +, _flagsHttp(0) +, _tcpTimeout(MTPMinReceiveDelay) { + manager.moveToThread(thread); +#ifndef TDESKTOP_DISABLE_NETWORK_PROXY + manager.setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy)); +#endif + + httpStartTimer.moveToThread(thread); + httpStartTimer.setSingleShot(true); + connect(&httpStartTimer, SIGNAL(timeout()), this, SLOT(onHttpStart())); + + tcpTimeoutTimer.moveToThread(thread); + tcpTimeoutTimer.setSingleShot(true); + 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())); +} + +void AutoConnection::onHttpStart() { + if (status == HttpReady) { + DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingHttp; + sock.disconnectFromHost(); + emit connected(); + } +} + +void AutoConnection::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::f_ipv6) ? "IPv6" : "IPv4")); + + if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout; + tcpTimeoutTimer.start(_tcpTimeout); + + tcpSend(buffer); + } else if (status == WaitingHttp || status == UsingHttp) { + sock.disconnectFromHost(); + } +} + +void AutoConnection::onTcpTimeoutTimer() { + if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { + if (_tcpTimeout < MTPMaxReceiveDelay) _tcpTimeout *= 2; + _tcpTimeout = -_tcpTimeout; + + QAbstractSocket::SocketState state = sock.state(); + if (state == QAbstractSocket::ConnectedState || state == QAbstractSocket::ConnectingState || state == QAbstractSocket::HostLookupState) { + sock.disconnectFromHost(); + } else if (state != QAbstractSocket::ClosingState) { + sock.connectToHost(QHostAddress(_addrTcp), _portTcp); + } + } +} + +void AutoConnection::onSocketDisconnected() { + if (_tcpTimeout < 0) { + _tcpTimeout = -_tcpTimeout; + if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) { + sock.connectToHost(QHostAddress(_addrTcp), _portTcp); + return; + } + } + if (status == WaitingBoth) { + status = WaitingHttp; + } 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingHttp; + emit connected(); + } +} + +void AutoConnection::sendData(mtpBuffer &buffer) { + if (status == FinishedWork) return; + + if (buffer.size() < 3) { + LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); + TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); + emit error(); + return; + } + + if (status == UsingTcp) { + tcpSend(buffer); + } else { + httpSend(buffer); + } +} + +void AutoConnection::httpSend(mtpBuffer &buffer) { + int32 requestSize = (buffer.size() - 3) * sizeof(mtpPrime); + + QNetworkRequest request(address); + request.setHeader(QNetworkRequest::ContentLengthHeader, QVariant(requestSize)); + request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(qsl("application/x-www-form-urlencoded"))); + + TCP_LOG(("HTTP Info: sending %1 len request").arg(requestSize)); + requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); +} + +void AutoConnection::disconnectFromServer() { + if (status == FinishedWork) return; + status = FinishedWork; + + Requests copy = requests; + requests.clear(); + for (Requests::const_iterator i = copy.cbegin(), e = copy.cend(); i != e; ++i) { + (*i)->abort(); + (*i)->deleteLater(); + } + + disconnect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); + + address = QUrl(); + + disconnect(&sock, SIGNAL(readyRead()), 0, 0); + sock.close(); + + httpStartTimer.stop(); +} + +void AutoConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { + _addrTcp = addr; + _portTcp = port; + _flagsTcp = flags; + + connect(&sock, SIGNAL(readyRead()), this, SLOT(socketRead())); + sock.connectToHost(QHostAddress(_addrTcp), _portTcp); +} + +void AutoConnection::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*))); + + _addrHttp = addr; + _portHttp = port; + _flagsHttp = flags; + + mtpBuffer buffer(preparePQFake(httpNonce)); + + DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((_flagsHttp & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); + + httpSend(buffer); +} + +bool AutoConnection::isConnected() const { + return (status == UsingTcp) || (status == UsingHttp); +} + +void AutoConnection::requestFinished(QNetworkReply *reply) { + if (status == FinishedWork) return; + + reply->deleteLater(); + if (reply->error() == QNetworkReply::NoError) { + requests.remove(reply); + + mtpBuffer data = HTTPConnection::handleResponse(reply); + if (data.size() == 1) { + if (status == WaitingBoth) { + status = WaitingTcp; + } else { + emit error(); + } + } else if (!data.isEmpty()) { + if (status == UsingHttp) { + receivedQueue.push_back(data); + emit receivedData(); + } else if (status == WaitingBoth || status == WaitingHttp) { + try { + MTPResPQ res_pq = readPQFakeReply(data); + const MTPDresPQ &res_pq_data(res_pq.c_resPQ()); + if (res_pq_data.vnonce == httpNonce) { + if (status == WaitingBoth) { + status = HttpReady; + httpStartTimer.start(MTPTcpConnectionWaitTimeout); + } else { + 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(); + } + } + } catch (Exception &e) { + DEBUG_LOG(("Connection Error: exception in parsing HTTP fake pq-responce, %1").arg(e.what())); + if (status == WaitingBoth) { + status = WaitingTcp; + } else { + emit error(); + } + } + } else if (status == UsingTcp) { + DEBUG_LOG(("Connection Info: already using tcp, ignoring http response")); + } + } + } else { + if (!requests.remove(reply)) { + return; + } + + bool mayBeBadKey = HTTPConnection::handleError(reply) && _sentEncrypted; + if (status == WaitingBoth) { + status = WaitingTcp; + } else if (status == WaitingHttp || status == UsingHttp) { + emit error(mayBeBadKey); + } else { + LOG(("Strange Http Error: status %1").arg(status)); + } + } +} + +void AutoConnection::socketPacket(const char *packet, uint32 length) { + if (status == FinishedWork) return; + + mtpBuffer data = TCPConnection::handleResponse(packet, length); + if (data.size() == 1) { + if (status == WaitingBoth) { + 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingHttp; + sock.disconnectFromHost(); + emit connected(); + } else if (status == WaitingTcp || status == UsingTcp) { + bool mayBeBadKey = (data[0] == -410) && _sentEncrypted; + emit error(mayBeBadKey); + } else { + LOG(("Strange Tcp Error; status %1").arg(status)); + } + } else if (status == UsingTcp) { + receivedQueue.push_back(data); + emit receivedData(); + } else if (status == WaitingBoth || status == WaitingTcp || status == HttpReady) { + tcpTimeoutTimer.stop(); + try { + 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingTcp; + emit connected(); + } + } catch (Exception &e) { + DEBUG_LOG(("Connection Error: exception in parsing TCP fake pq-responce, %1").arg(e.what())); + if (status == WaitingBoth) { + 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingHttp; + sock.disconnectFromHost(); + emit connected(); + } else { + emit error(); + } + } + } +} + +bool AutoConnection::usingHttpWait() { + return (status == UsingHttp); +} + +bool AutoConnection::needHttpWait() { + return (status == UsingHttp) ? requests.isEmpty() : false; +} + +int32 AutoConnection::debugState() const { + return (status == UsingHttp) ? -1 : (UsingTcp ? sock.state() : -777); +} + +QString AutoConnection::transport() const { + if (status == UsingTcp) { + return qsl("TCP"); + } else if (status == UsingHttp) { + return qsl("HTTP"); + } else { + return QString(); + } +} + +void AutoConnection::socketError(QAbstractSocket::SocketError e) { + if (status == FinishedWork) return; + + TCPConnection::handleError(e, sock); + 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingHttp; + emit connected(); + } else if (status == WaitingTcp || status == UsingTcp) { + emit error(); + } else { + LOG(("Strange Tcp Error: status %1").arg(status)); + } +} + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_auto.h b/Telegram/SourceFiles/mtproto/connection_auto.h new file mode 100644 index 0000000000..60a5b9b442 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_auto.h @@ -0,0 +1,94 @@ +/* +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 + +#include "mtproto/core_types.h" +#include "mtproto/connection_tcp.h" + +namespace MTP { +namespace internal { + +class AutoConnection : public AbstractTCPConnection { + Q_OBJECT + +public: + + AutoConnection(QThread *thread); + + 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 override; + + QString transport() const override; + +public slots: + + void socketError(QAbstractSocket::SocketError e); + void requestFinished(QNetworkReply *reply); + + void onSocketConnected(); + void onSocketDisconnected(); + void onHttpStart(); + + void onTcpTimeoutTimer(); + +protected: + + void socketPacket(const char *packet, uint32 length) override; + +private: + + void httpSend(mtpBuffer &buffer); + enum Status { + WaitingBoth = 0, + WaitingHttp, + WaitingTcp, + HttpReady, + UsingHttp, + UsingTcp, + FinishedWork + }; + Status status; + MTPint128 tcpNonce, httpNonce; + QTimer httpStartTimer; + + QNetworkAccessManager manager; + QUrl address; + + typedef QSet Requests; + Requests requests; + + QString _addrTcp, _addrHttp; + int32 _portTcp, _portHttp; + MTPDdcOption::Flags _flagsTcp, _flagsHttp; + int32 _tcpTimeout; + QTimer tcpTimeoutTimer; + +}; + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_http.cpp b/Telegram/SourceFiles/mtproto/connection_http.cpp new file mode 100644 index 0000000000..39f26e1314 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_http.cpp @@ -0,0 +1,218 @@ +/* +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 "mtproto/connection_http.h" + +namespace MTP { +namespace internal { + +mtpBuffer HTTPConnection::handleResponse(QNetworkReply *reply) { + QByteArray response = reply->readAll(); + TCP_LOG(("HTTP Info: read %1 bytes").arg(response.size())); + + if (response.isEmpty()) return mtpBuffer(); + + if (response.size() & 0x03 || response.size() < 8) { + LOG(("HTTP Error: bad response size %1").arg(response.size())); + return mtpBuffer(1, -500); + } + + mtpBuffer data(response.size() >> 2); + memcpy(data.data(), response.constData(), response.size()); + + return data; +} + +bool HTTPConnection::handleError(QNetworkReply *reply) { // returnes "maybe bad key" + bool mayBeBadKey = false; + + QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); + if (statusCode.isValid()) { + int status = statusCode.toInt(); + mayBeBadKey = (status == 410); + if (status == 429) { + LOG(("Protocol Error: 429 flood code returned!")); + } + } + + switch (reply->error()) { + case QNetworkReply::ConnectionRefusedError: LOG(("HTTP Error: connection refused - %1").arg(reply->errorString())); break; + case QNetworkReply::RemoteHostClosedError: LOG(("HTTP Error: remote host closed - %1").arg(reply->errorString())); break; + case QNetworkReply::HostNotFoundError: LOG(("HTTP Error: host not found - %2").arg(reply->error()).arg(reply->errorString())); break; + case QNetworkReply::TimeoutError: LOG(("HTTP Error: timeout - %2").arg(reply->error()).arg(reply->errorString())); break; + case QNetworkReply::OperationCanceledError: LOG(("HTTP Error: cancelled - %2").arg(reply->error()).arg(reply->errorString())); break; + case QNetworkReply::SslHandshakeFailedError: + case QNetworkReply::TemporaryNetworkFailureError: + case QNetworkReply::NetworkSessionFailedError: + case QNetworkReply::BackgroundRequestNotAllowedError: + case QNetworkReply::UnknownNetworkError: LOG(("HTTP Error: network error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + + // proxy errors (101-199): + case QNetworkReply::ProxyConnectionRefusedError: + case QNetworkReply::ProxyConnectionClosedError: + case QNetworkReply::ProxyNotFoundError: + case QNetworkReply::ProxyTimeoutError: + case QNetworkReply::ProxyAuthenticationRequiredError: + case QNetworkReply::UnknownProxyError:LOG(("HTTP Error: proxy error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + + // content errors (201-299): + case QNetworkReply::ContentAccessDenied: + case QNetworkReply::ContentOperationNotPermittedError: + case QNetworkReply::ContentNotFoundError: + case QNetworkReply::AuthenticationRequiredError: + case QNetworkReply::ContentReSendError: + case QNetworkReply::UnknownContentError: LOG(("HTTP Error: content error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + + // protocol errors + case QNetworkReply::ProtocolUnknownError: + case QNetworkReply::ProtocolInvalidOperationError: + case QNetworkReply::ProtocolFailure: LOG(("HTTP Error: protocol error %1 - %2").arg(reply->error()).arg(reply->errorString())); break; + }; + TCP_LOG(("HTTP Error %1, restarting! - %2").arg(reply->error()).arg(reply->errorString())); + + return mayBeBadKey; +} + +HTTPConnection::HTTPConnection(QThread *thread) : AbstractConnection(thread) +, status(WaitingHttp) +, httpNonce(rand_value()) +, _flags(0) { + manager.moveToThread(thread); + App::setProxySettings(manager); +} + +void HTTPConnection::sendData(mtpBuffer &buffer) { + if (status == FinishedWork) return; + + if (buffer.size() < 3) { + LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); + TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); + emit error(); + return; + } + + int32 requestSize = (buffer.size() - 3) * sizeof(mtpPrime); + + QNetworkRequest request(address); + request.setHeader(QNetworkRequest::ContentLengthHeader, QVariant(requestSize)); + request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(qsl("application/x-www-form-urlencoded"))); + + TCP_LOG(("HTTP Info: sending %1 len request %2").arg(requestSize).arg(Logs::mb(&buffer[2], requestSize).str())); + requests.insert(manager.post(request, QByteArray((const char*)(&buffer[2]), requestSize))); +} + +void HTTPConnection::disconnectFromServer() { + if (status == FinishedWork) return; + status = FinishedWork; + + Requests copy = requests; + requests.clear(); + for (Requests::const_iterator i = copy.cbegin(), e = copy.cend(); i != e; ++i) { + (*i)->abort(); + (*i)->deleteLater(); + } + + disconnect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); + + address = QUrl(); +} + +void HTTPConnection::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*))); + + _flags = flags; + + mtpBuffer buffer(preparePQFake(httpNonce)); + + DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((flags & MTPDdcOption::Flag::f_ipv6) ? "IPv6" : "IPv4")); + + sendData(buffer); +} + +bool HTTPConnection::isConnected() const { + return (status == UsingHttp); +} + +void HTTPConnection::requestFinished(QNetworkReply *reply) { + if (status == FinishedWork) return; + + reply->deleteLater(); + if (reply->error() == QNetworkReply::NoError) { + requests.remove(reply); + + mtpBuffer data = handleResponse(reply); + if (data.size() == 1) { + emit error(); + } else if (!data.isEmpty()) { + if (status == UsingHttp) { + receivedQueue.push_back(data); + emit receivedData(); + } else { + try { + 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingHttp; + emit connected(); + } + } catch (Exception &e) { + DEBUG_LOG(("Connection Error: exception in parsing HTTP fake pq-responce, %1").arg(e.what())); + emit error(); + } + } + } + } else { + if (!requests.remove(reply)) { + return; + } + + bool mayBeBadKey = handleError(reply) && _sentEncrypted; + + emit error(mayBeBadKey); + } +} + +bool HTTPConnection::usingHttpWait() { + return true; +} + +bool HTTPConnection::needHttpWait() { + return requests.isEmpty(); +} + +int32 HTTPConnection::debugState() const { + return -1; +} + +QString HTTPConnection::transport() const { + if (status == UsingHttp) { + return qsl("HTTP"); + } else { + return QString(); + } +} + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_http.h b/Telegram/SourceFiles/mtproto/connection_http.h new file mode 100644 index 0000000000..54f3af11df --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_http.h @@ -0,0 +1,76 @@ +/* +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 + +#include "mtproto/core_types.h" +#include "mtproto/connection_abstract.h" + +namespace MTP { +namespace internal { + +class HTTPConnection : public AbstractConnection { + Q_OBJECT + +public: + + HTTPConnection(QThread *thread); + + 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, MTPDdcOption::Flags flags) override; + bool isConnected() const override; + bool usingHttpWait() override; + bool needHttpWait() override; + + int32 debugState() const override; + + QString transport() const override; + + public slots: + + void requestFinished(QNetworkReply *reply); + + static mtpBuffer handleResponse(QNetworkReply *reply); + static bool handleError(QNetworkReply *reply); // returnes "maybe bad key" + +private: + + enum Status { + WaitingHttp = 0, + UsingHttp, + FinishedWork + }; + Status status; + MTPint128 httpNonce; + MTPDdcOption::Flags _flags; + + QNetworkAccessManager manager; + QUrl address; + + typedef QSet Requests; + Requests requests; + +}; + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.cpp b/Telegram/SourceFiles/mtproto/connection_tcp.cpp new file mode 100644 index 0000000000..8f18e45490 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_tcp.cpp @@ -0,0 +1,395 @@ +/* +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 "mtproto/connection_tcp.h" + +#include + +namespace MTP { +namespace internal { + +namespace { + +uint32 tcpPacketSize(const char *packet) { // must have at least 4 bytes readable + uint32 result = (packet[0] > 0) ? packet[0] : 0; + if (result == 0x7f) { + const uchar *bytes = reinterpret_cast(packet); + result = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); + return (result << 2) + 4; + } + return (result << 2) + 1; +} + +} // namespace + +AbstractTCPConnection::AbstractTCPConnection(QThread *thread) : AbstractConnection(thread) +, packetNum(0) +, packetRead(0) +, packetLeft(0) +, readingToShort(true) +, currentPos((char*)shortBuffer) { +} + +void AbstractTCPConnection::socketRead() { + if (sock.state() != QAbstractSocket::ConnectedState) { + LOG(("MTP error: socket not connected in socketRead(), state: %1").arg(sock.state())); + emit error(); + return; + } + + do { + uint32 toRead = packetLeft ? packetLeft : (readingToShort ? (MTPShortBufferSize * sizeof(mtpPrime) - packetRead) : 4); + if (readingToShort) { + if (currentPos + toRead > ((char*)shortBuffer) + MTPShortBufferSize * sizeof(mtpPrime)) { + longBuffer.resize(((packetRead + toRead) >> 2) + 1); + memcpy(&longBuffer[0], shortBuffer, packetRead); + currentPos = ((char*)&longBuffer[0]) + packetRead; + readingToShort = false; + } + } else { + if (longBuffer.size() * sizeof(mtpPrime) < packetRead + toRead) { + longBuffer.resize(((packetRead + toRead) >> 2) + 1); + currentPos = ((char*)&longBuffer[0]) + packetRead; + } + } + int32 bytes = (int32)sock.read(currentPos, toRead); + if (bytes > 0) { + aesCtrEncrypt(currentPos, bytes, _receiveKey, &_receiveState); + TCP_LOG(("TCP Info: read %1 bytes").arg(bytes)); + + packetRead += bytes; + currentPos += bytes; + if (packetLeft) { + packetLeft -= bytes; + if (!packetLeft) { + socketPacket(currentPos - packetRead, packetRead); + currentPos = (char*)shortBuffer; + packetRead = packetLeft = 0; + readingToShort = true; + longBuffer.clear(); + } else { + TCP_LOG(("TCP Info: not enough %1 for packet! read %2").arg(packetLeft).arg(packetRead)); + emit receivedSome(); + } + } else { + bool move = false; + while (packetRead >= 4) { + uint32 packetSize = tcpPacketSize(currentPos - packetRead); + if (packetSize < 5 || packetSize > MTPPacketSizeMax) { + LOG(("TCP Error: packet size = %1").arg(packetSize)); + emit error(); + return; + } + if (packetRead >= packetSize) { + socketPacket(currentPos - packetRead, packetSize); + packetRead -= packetSize; + packetLeft = 0; + move = true; + } else { + packetLeft = packetSize - packetRead; + TCP_LOG(("TCP Info: not enough %1 for packet! size %2 read %3").arg(packetLeft).arg(packetSize).arg(packetRead)); + emit receivedSome(); + break; + } + } + if (move) { + if (!packetRead) { + currentPos = (char*)shortBuffer; + readingToShort = true; + longBuffer.clear(); + } else if (!readingToShort && packetRead < MTPShortBufferSize * sizeof(mtpPrime)) { + memcpy(shortBuffer, currentPos - packetRead, packetRead); + currentPos = (char*)shortBuffer + packetRead; + readingToShort = true; + longBuffer.clear(); + } + } + } + } else if (bytes < 0) { + LOG(("TCP Error: socket read return -1")); + emit error(); + return; + } else { + TCP_LOG(("TCP Info: no bytes read, but bytes available was true..")); + break; + } + } while (sock.state() == QAbstractSocket::ConnectedState && sock.bytesAvailable()); +} + +mtpBuffer AbstractTCPConnection::handleResponse(const char *packet, uint32 length) { + if (length < 5 || length > MTPPacketSizeMax) { + LOG(("TCP Error: bad packet size %1").arg(length)); + return mtpBuffer(1, -500); + } + int32 size = packet[0], len = length - 1; + if (size == 0x7f) { + const uchar *bytes = reinterpret_cast(packet); + size = (((uint32(bytes[3]) << 8) | uint32(bytes[2])) << 8) | uint32(bytes[1]); + len -= 3; + } + if (size * int32(sizeof(mtpPrime)) != len) { + LOG(("TCP Error: bad packet header")); + TCP_LOG(("TCP Error: bad packet header, packet: %1").arg(Logs::mb(packet, length).str())); + return mtpBuffer(1, -500); + } + const mtpPrime *packetdata = reinterpret_cast(packet + (length - len)); + TCP_LOG(("TCP Info: packet received, size = %1").arg(size * sizeof(mtpPrime))); + if (size == 1) { + if (*packetdata == -429) { + LOG(("Protocol Error: -429 flood code returned!")); + } else { + LOG(("TCP Error: error packet received, code = %1").arg(*packetdata)); + } + return mtpBuffer(1, *packetdata); + } + + mtpBuffer data(size); + memcpy(data.data(), packetdata, size * sizeof(mtpPrime)); + + return data; +} + +void AbstractTCPConnection::handleError(QAbstractSocket::SocketError e, QTcpSocket &sock) { + switch (e) { + case QAbstractSocket::ConnectionRefusedError: + LOG(("TCP Error: socket connection refused - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::RemoteHostClosedError: + TCP_LOG(("TCP Info: remote host closed socket connection - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::HostNotFoundError: + LOG(("TCP Error: host not found - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::SocketTimeoutError: + LOG(("TCP Error: socket timeout - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::NetworkError: + LOG(("TCP Error: network - %1").arg(sock.errorString())); + break; + + case QAbstractSocket::ProxyAuthenticationRequiredError: + case QAbstractSocket::ProxyConnectionRefusedError: + case QAbstractSocket::ProxyConnectionClosedError: + case QAbstractSocket::ProxyConnectionTimeoutError: + case QAbstractSocket::ProxyNotFoundError: + case QAbstractSocket::ProxyProtocolError: + LOG(("TCP Error: proxy (%1) - %2").arg(e).arg(sock.errorString())); + break; + + default: + LOG(("TCP Error: other (%1) - %2").arg(e).arg(sock.errorString())); + break; + } + + TCP_LOG(("TCP Error %1, restarting! - %2").arg(e).arg(sock.errorString())); +} + +TCPConnection::TCPConnection(QThread *thread) : AbstractTCPConnection(thread) +, status(WaitingTcp) +, tcpNonce(rand_value()) +, _tcpTimeout(MTPMinReceiveDelay) +, _flags(0) { + tcpTimeoutTimer.moveToThread(thread); + tcpTimeoutTimer.setSingleShot(true); + connect(&tcpTimeoutTimer, SIGNAL(timeout()), this, SLOT(onTcpTimeoutTimer())); + + sock.moveToThread(thread); + App::setProxySettings(sock); + 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())); +} + +void TCPConnection::onSocketConnected() { + if (status == WaitingTcp) { + mtpBuffer buffer(preparePQFake(tcpNonce)); + + 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); + + sendData(buffer); + } +} + +void TCPConnection::onTcpTimeoutTimer() { + if (status == WaitingTcp) { + if (_tcpTimeout < MTPMaxReceiveDelay) _tcpTimeout *= 2; + _tcpTimeout = -_tcpTimeout; + + QAbstractSocket::SocketState state = sock.state(); + if (state == QAbstractSocket::ConnectedState || state == QAbstractSocket::ConnectingState || state == QAbstractSocket::HostLookupState) { + sock.disconnectFromHost(); + } else if (state != QAbstractSocket::ClosingState) { + sock.connectToHost(QHostAddress(_addr), _port); + } + } +} + +void TCPConnection::onSocketDisconnected() { + if (_tcpTimeout < 0) { + _tcpTimeout = -_tcpTimeout; + if (status == WaitingTcp) { + sock.connectToHost(QHostAddress(_addr), _port); + return; + } + } + if (status == WaitingTcp || status == UsingTcp) { + emit disconnected(); + } +} + +void TCPConnection::sendData(mtpBuffer &buffer) { + if (status == FinishedWork) return; + + if (buffer.size() < 3) { + LOG(("TCP Error: writing bad packet, len = %1").arg(buffer.size() * sizeof(mtpPrime))); + TCP_LOG(("TCP Error: bad packet %1").arg(Logs::mb(&buffer[0], buffer.size() * sizeof(mtpPrime)).str())); + emit error(); + return; + } + + tcpSend(buffer); +} + +void AbstractTCPConnection::tcpSend(mtpBuffer &buffer) { + if (!packetNum) { + // prepare random part + char nonce[64]; + uint32 *first = reinterpret_cast(nonce), *second = first + 1; + uint32 first1 = 0x44414548U, first2 = 0x54534f50U, first3 = 0x20544547U, first4 = 0x20544547U, first5 = 0xeeeeeeeeU; + uint32 second1 = 0; + do { + memset_rand(nonce, sizeof(nonce)); + } while (*first == first1 || *first == first2 || *first == first3 || *first == first4 || *first == first5 || *second == second1 || *reinterpret_cast(nonce) == 0xef); + //sock.write(nonce, 64); + + // prepare encryption key/iv + memcpy(_sendKey, nonce + 8, CTRState::KeySize); + memcpy(_sendState.ivec, nonce + 8 + CTRState::KeySize, CTRState::IvecSize); + + // prepare decryption key/iv + char reversed[48]; + memcpy(reversed, nonce + 8, sizeof(reversed)); + std::reverse(reversed, reversed + arraysize(reversed)); + memcpy(_receiveKey, reversed, CTRState::KeySize); + memcpy(_receiveState.ivec, reversed + CTRState::KeySize, CTRState::IvecSize); + + // write protocol identifier + *reinterpret_cast(nonce + 56) = 0xefefefefU; + + sock.write(nonce, 56); + aesCtrEncrypt(nonce, 64, _sendKey, &_sendState); + sock.write(nonce + 56, 8); + } + ++packetNum; + + uint32 size = buffer.size() - 3, len = size * 4; + char *data = reinterpret_cast(&buffer[0]); + if (size < 0x7f) { + data[7] = char(size); + TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 1)); + + aesCtrEncrypt(data + 7, len + 1, _sendKey, &_sendState); + sock.write(data + 7, len + 1); + } else { + data[4] = 0x7f; + reinterpret_cast(data)[5] = uchar(size & 0xFF); + reinterpret_cast(data)[6] = uchar((size >> 8) & 0xFF); + reinterpret_cast(data)[7] = uchar((size >> 16) & 0xFF); + TCP_LOG(("TCP Info: write %1 packet %2").arg(packetNum).arg(len + 4)); + + aesCtrEncrypt(data + 4, len + 4, _sendKey, &_sendState); + sock.write(data + 4, len + 4); + } +} + +void TCPConnection::disconnectFromServer() { + if (status == FinishedWork) return; + status = FinishedWork; + + disconnect(&sock, SIGNAL(readyRead()), 0, 0); + sock.close(); +} + +void TCPConnection::connectTcp(const QString &addr, int32 port, MTPDdcOption::Flags flags) { + _addr = addr; + _port = port; + _flags = flags; + + connect(&sock, SIGNAL(readyRead()), this, SLOT(socketRead())); + sock.connectToHost(QHostAddress(_addr), _port); +} + +void TCPConnection::socketPacket(const char *packet, uint32 length) { + if (status == FinishedWork) return; + + mtpBuffer data = handleResponse(packet, length); + if (data.size() == 1) { + bool mayBeBadKey = (data[0] == -410) && _sentEncrypted; + emit error(mayBeBadKey); + } else if (status == UsingTcp) { + receivedQueue.push_back(data); + emit receivedData(); + } else if (status == WaitingTcp) { + tcpTimeoutTimer.stop(); + try { + 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::f_ipv6) ? "IPv6" : "IPv4")); + status = UsingTcp; + emit connected(); + } + } catch (Exception &e) { + DEBUG_LOG(("Connection Error: exception in parsing TCP fake pq-responce, %1").arg(e.what())); + emit error(); + } + } +} + +bool TCPConnection::isConnected() const { + return (status == UsingTcp); +} + +int32 TCPConnection::debugState() const { + return sock.state(); +} + +QString TCPConnection::transport() const { + return isConnected() ? qsl("TCP") : QString(); +} + +void TCPConnection::socketError(QAbstractSocket::SocketError e) { + if (status == FinishedWork) return; + + handleError(e, sock); + emit error(); +} + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.h b/Telegram/SourceFiles/mtproto/connection_tcp.h new file mode 100644 index 0000000000..17ac5ca0a4 --- /dev/null +++ b/Telegram/SourceFiles/mtproto/connection_tcp.h @@ -0,0 +1,119 @@ +/* +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 + +#include "mtproto/core_types.h" +#include "mtproto/auth_key.h" +#include "mtproto/connection_abstract.h" + +namespace MTP { +namespace internal { + +class AbstractTCPConnection : public AbstractConnection { + Q_OBJECT + +public: + + AbstractTCPConnection(QThread *thread); + virtual ~AbstractTCPConnection() = 0 { + } + +public slots: + + void socketRead(); + +protected: + + QTcpSocket sock; + uint32 packetNum; // sent packet number + + uint32 packetRead, packetLeft; // reading from socket + bool readingToShort; + char *currentPos; + mtpBuffer longBuffer; + mtpPrime shortBuffer[MTPShortBufferSize]; + virtual void socketPacket(const char *packet, uint32 length) = 0; + + static mtpBuffer handleResponse(const char *packet, uint32 length); + static void handleError(QAbstractSocket::SocketError e, QTcpSocket &sock); + static uint32 fourCharsToUInt(char ch1, char ch2, char ch3, char ch4) { + char ch[4] = { ch1, ch2, ch3, ch4 }; + return *reinterpret_cast(ch); + } + + void tcpSend(mtpBuffer &buffer); + uchar _sendKey[CTRState::KeySize]; + CTRState _sendState; + uchar _receiveKey[CTRState::KeySize]; + CTRState _receiveState; + +}; + +class TCPConnection : public AbstractTCPConnection { + Q_OBJECT + +public: + + TCPConnection(QThread *thread); + + 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 override; + + int32 debugState() const override; + + QString transport() const override; + +public slots: + + void socketError(QAbstractSocket::SocketError e); + + void onSocketConnected(); + void onSocketDisconnected(); + + void onTcpTimeoutTimer(); + +protected: + + void socketPacket(const char *packet, uint32 length) override; + +private: + + enum Status { + WaitingTcp = 0, + UsingTcp, + FinishedWork + }; + Status status; + MTPint128 tcpNonce; + + QString _addr; + int32 _port, _tcpTimeout; + MTPDdcOption::Flags _flags; + QTimer tcpTimeoutTimer; + +}; + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/core_types.cpp b/Telegram/SourceFiles/mtproto/core_types.cpp index a45dc6e16f..1e401eefcd 100644 --- a/Telegram/SourceFiles/mtproto/core_types.cpp +++ b/Telegram/SourceFiles/mtproto/core_types.cpp @@ -22,6 +22,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/core_types.h" +#include "zlib.h" + #include "lang.h" QString mtpWrapNumber(float64 number) { diff --git a/Telegram/SourceFiles/mtproto/dcenter.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp index 577c37bd81..62e6bdaf73 100644 --- a/Telegram/SourceFiles/mtproto/dcenter.cpp +++ b/Telegram/SourceFiles/mtproto/dcenter.cpp @@ -25,39 +25,41 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "mtproto/facade.h" #include "localstorage.h" -namespace { +namespace MTP { +namespace internal { - MTProtoDCMap gDCs; +namespace { + DcenterMap gDCs; bool configLoadedOnce = false; bool mainDCChanged = false; - int32 mainDC = 2; + int32 _mainDC = 2; int32 userId = 0; - typedef QMap _KeysMapForWrite; + typedef QMap _KeysMapForWrite; _KeysMapForWrite _keysMapForWrite; QMutex _keysMapForWriteMutex; -} +} // namespace -int32 mtpAuthed() { +int32 authed() { return userId; } -void mtpAuthed(int32 uid) { +void authed(int32 uid) { if (userId != uid) { userId = uid; } } -MTProtoDCMap &mtpDCMap() { +DcenterMap &DCMap() { return gDCs; } -bool mtpNeedConfig() { +bool configNeeded() { return !configLoadedOnce; } -int32 mtpMainDC() { - return mainDC; +int32 mainDC() { + return _mainDC; } namespace { @@ -74,7 +76,7 @@ namespace { } } -void mtpLogoutOtherDCs() { +void logoutOtherDCs() { QList dcs; { QMutexLocker lock(&_keysMapForWriteMutex); @@ -87,15 +89,15 @@ void mtpLogoutOtherDCs() { } } -void mtpSetDC(int32 dc, bool firstOnly) { +void setDC(int32 dc, bool firstOnly) { if (!dc || (firstOnly && mainDCChanged)) return; mainDCChanged = true; - if (dc != mainDC) { - mainDC = dc; + if (dc != _mainDC) { + _mainDC = dc; } } -MTProtoDC::MTProtoDC(int32 id, const mtpAuthKeyPtr &key) : _id(id), _key(key), _connectionInited(false) { +Dcenter::Dcenter(int32 id, const AuthKeyPtr &key) : _id(id), _key(key), _connectionInited(false) { connect(this, SIGNAL(authKeyCreated()), this, SLOT(authKeyWrite()), Qt::QueuedConnection); QMutexLocker lock(&_keysMapForWriteMutex); @@ -106,14 +108,14 @@ MTProtoDC::MTProtoDC(int32 id, const mtpAuthKeyPtr &key) : _id(id), _key(key), _ } } -void MTProtoDC::authKeyWrite() { +void Dcenter::authKeyWrite() { DEBUG_LOG(("AuthKey Info: MTProtoDC::authKeyWrite() slot, dc %1").arg(_id)); if (_key) { Local::writeMtpData(); } } -void MTProtoDC::setKey(const mtpAuthKeyPtr &key) { +void Dcenter::setKey(const AuthKeyPtr &key) { DEBUG_LOG(("AuthKey Info: MTProtoDC::setKey(%1), emitting authKeyCreated, dc %2").arg(key ? key->keyId() : 0).arg(_id)); _key = key; _connectionInited = false; @@ -127,23 +129,23 @@ void MTProtoDC::setKey(const mtpAuthKeyPtr &key) { } } -QReadWriteLock *MTProtoDC::keyMutex() const { +QReadWriteLock *Dcenter::keyMutex() const { return &keyLock; } -const mtpAuthKeyPtr &MTProtoDC::getKey() const { +const AuthKeyPtr &Dcenter::getKey() const { return _key; } -void MTProtoDC::destroyKey() { - setKey(mtpAuthKeyPtr()); +void Dcenter::destroyKey() { + setKey(AuthKeyPtr()); QMutexLocker lock(&_keysMapForWriteMutex); _keysMapForWrite.remove(_id); } namespace { - MTProtoConfigLoader *configLoader = 0; + ConfigLoader *_configLoader = nullptr; bool loadingConfig = false; void configLoaded(const MTPConfig &result) { loadingConfig = false; @@ -152,7 +154,7 @@ namespace { DEBUG_LOG(("MTP Info: got config, chat_size_max: %1, date: %2, test_mode: %3, this_dc: %4, dc_options.length: %5").arg(data.vchat_size_max.v).arg(data.vdate.v).arg(mtpIsTrue(data.vtest_mode)).arg(data.vthis_dc.v).arg(data.vdc_options.c_vector().v.size())); - mtpUpdateDcOptions(data.vdc_options.c_vector().v); + updateDcOptions(data.vdc_options.c_vector().v); Global::SetChatSizeMax(data.vchat_size_max.v); Global::SetMegagroupSizeMax(data.vmegagroup_size_max.v); @@ -172,7 +174,7 @@ namespace { configLoadedOnce = true; Local::writeSettings(); - mtpConfigLoader()->done(); + configLoader()->done(); } bool configFailed(const RPCError &error) { if (mtpIsFlood(error)) return false; @@ -183,12 +185,12 @@ namespace { } }; -void mtpUpdateDcOptions(const QVector &options) { +void updateDcOptions(const QVector &options) { QSet already, restart; { MTP::DcOptions opts; { - QReadLocker lock(mtpDcOptionsMutex()); + QReadLocker lock(dcOptionsMutex()); opts = Global::DcOptions(); } for (QVector::const_iterator i = options.cbegin(), e = options.cend(); i != e; ++i) { @@ -206,7 +208,7 @@ void mtpUpdateDcOptions(const QVector &options) { } } { - QWriteLocker lock(mtpDcOptionsMutex()); + QWriteLocker lock(dcOptionsMutex()); Global::SetDcOptions(opts); } } @@ -219,15 +221,15 @@ namespace { QReadWriteLock _dcOptionsMutex; } -QReadWriteLock *mtpDcOptionsMutex() { +QReadWriteLock *dcOptionsMutex() { return &_dcOptionsMutex; } -MTProtoConfigLoader::MTProtoConfigLoader() : _enumCurrent(0), _enumRequest(0) { +ConfigLoader::ConfigLoader() : _enumCurrent(0), _enumRequest(0) { connect(&_enumDCTimer, SIGNAL(timeout()), this, SLOT(enumDC())); } -void MTProtoConfigLoader::load() { +void ConfigLoader::load() { if (loadingConfig) return; loadingConfig = true; @@ -236,7 +238,7 @@ void MTProtoConfigLoader::load() { _enumDCTimer.start(MTPEnumDCTimeout); } -void MTProtoConfigLoader::done() { +void ConfigLoader::done() { _enumDCTimer.stop(); if (_enumRequest) { MTP::cancel(_enumRequest); @@ -249,19 +251,19 @@ void MTProtoConfigLoader::done() { emit loaded(); } -void MTProtoConfigLoader::enumDC() { +void ConfigLoader::enumDC() { if (!loadingConfig) return; if (_enumRequest) MTP::cancel(_enumRequest); if (!_enumCurrent) { - _enumCurrent = mainDC; + _enumCurrent = _mainDC; } else { MTP::killSession(MTP::cfgDcId(_enumCurrent)); } OrderedSet dcs; { - QReadLocker lock(mtpDcOptionsMutex()); + QReadLocker lock(dcOptionsMutex()); const MTP::DcOptions &options(Global::DcOptions()); for (auto i = options.cbegin(), e = options.cend(); i != e; ++i) { dcs.insert(MTP::bareDcId(i.key())); @@ -278,26 +280,29 @@ void MTProtoConfigLoader::enumDC() { _enumDCTimer.start(MTPEnumDCTimeout); } -MTProtoConfigLoader *mtpConfigLoader() { - if (!configLoader) configLoader = new MTProtoConfigLoader(); - return configLoader; +ConfigLoader *configLoader() { + if (!_configLoader) _configLoader = new ConfigLoader(); + return _configLoader; } -void mtpDestroyConfigLoader() { - delete configLoader; - configLoader = 0; +void destroyConfigLoader() { + delete _configLoader; + _configLoader = nullptr; } -mtpKeysMap mtpGetKeys() { - mtpKeysMap result; +AuthKeysMap getAuthKeys() { + AuthKeysMap result; QMutexLocker lock(&_keysMapForWriteMutex); - for (_KeysMapForWrite::const_iterator i = _keysMapForWrite.cbegin(), e = _keysMapForWrite.cend(); i != e; ++i) { - result.push_back(i.value()); + for_const (const AuthKeyPtr &key, _keysMapForWrite) { + result.push_back(key); } return result; } -void mtpSetKey(int32 dcId, mtpAuthKeyPtr key) { - MTProtoDCPtr dc(new MTProtoDC(dcId, key)); +void setAuthKey(int32 dcId, AuthKeyPtr key) { + DcenterPtr dc(new Dcenter(dcId, key)); gDCs.insert(dcId, dc); } + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/dcenter.h b/Telegram/SourceFiles/mtproto/dcenter.h index bc8a6e7877..4f47c63d33 100644 --- a/Telegram/SourceFiles/mtproto/dcenter.h +++ b/Telegram/SourceFiles/mtproto/dcenter.h @@ -20,16 +20,19 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -class MTProtoDC : public QObject { +namespace MTP { +namespace internal { + +class Dcenter : public QObject { Q_OBJECT public: - MTProtoDC(int32 id, const mtpAuthKeyPtr &key); + Dcenter(int32 id, const AuthKeyPtr &key); QReadWriteLock *keyMutex() const; - const mtpAuthKeyPtr &getKey() const; - void setKey(const mtpAuthKeyPtr &key); + const AuthKeyPtr &getKey() const; + void setKey(const AuthKeyPtr &key); void destroyKey(); bool connectionInited() const { @@ -56,19 +59,19 @@ private: mutable QReadWriteLock keyLock; mutable QMutex initLock; int32 _id; - mtpAuthKeyPtr _key; + AuthKeyPtr _key; bool _connectionInited; }; -typedef QSharedPointer MTProtoDCPtr; -typedef QMap MTProtoDCMap; +typedef QSharedPointer DcenterPtr; +typedef QMap DcenterMap; -class MTProtoConfigLoader : public QObject { +class ConfigLoader : public QObject { Q_OBJECT public: - MTProtoConfigLoader(); + ConfigLoader(); void load(); void done(); @@ -88,21 +91,23 @@ private: }; -MTProtoConfigLoader *mtpConfigLoader(); -void mtpDestroyConfigLoader(); +ConfigLoader *configLoader(); +void destroyConfigLoader(); -MTProtoDCMap &mtpDCMap(); -bool mtpNeedConfig(); -int32 mtpMainDC(); -void mtpLogoutOtherDCs(); -void mtpSetDC(int32 dc, bool firstOnly = false); -uint32 mtpMaxChatSize(); +DcenterMap &DCMap(); +bool configNeeded(); +int32 mainDC(); +void logoutOtherDCs(); +void setDC(int32 dc, bool firstOnly = false); -int32 mtpAuthed(); -void mtpAuthed(int32 uid); +int32 authed(); +void authed(int32 uid); -mtpKeysMap mtpGetKeys(); -void mtpSetKey(int32 dc, mtpAuthKeyPtr key); +AuthKeysMap getAuthKeys(); +void setAuthKey(int32 dc, AuthKeyPtr key); -void mtpUpdateDcOptions(const QVector &options); -QReadWriteLock *mtpDcOptionsMutex(); +void updateDcOptions(const QVector &options); +QReadWriteLock *dcOptionsMutex(); + +} // namespace internal +} // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index bb98d37f07..f7cff78a77 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -249,7 +249,7 @@ namespace { } } int32 newdc = bareDcId(qAbs(dcWithShift)); - if (!newdc || newdc == mtpMainDC() || !authedId()) { + if (!newdc || newdc == internal::mainDC() || !authedId()) { if (!badGuestDC && globalHandler.onFail) (*globalHandler.onFail)(requestId, error); // auth failed in main dc return false; } @@ -649,17 +649,17 @@ void start() { unixtimeInit(); - MTProtoDCMap &dcs(mtpDCMap()); + internal::DcenterMap &dcs(internal::DCMap()); _globalSlotCarrier = new internal::GlobalSlotCarrier(); - mainSession = new internal::Session(mtpMainDC()); + mainSession = new internal::Session(internal::mainDC()); sessions.insert(mainSession->getDcWithShift(), mainSession); _started = true; - if (mtpNeedConfig()) { - mtpConfigLoader()->load(); + if (internal::configNeeded()) { + internal::configLoader()->load(); } } @@ -701,13 +701,13 @@ void unpause() { void configure(int32 dc, int32 user) { if (_started) return; - mtpSetDC(dc); - mtpAuthed(user); + internal::setDC(dc); + internal::authed(user); } void setdc(int32 dc, bool fromZeroOnly) { if (!dc || !_started) return; - mtpSetDC(dc, fromZeroOnly); + internal::setDC(dc, fromZeroOnly); int32 oldMainDc = mainSession->getDcWithShift(); if (maindc() != oldMainDc) { killSession(oldMainDc); @@ -716,7 +716,7 @@ void setdc(int32 dc, bool fromZeroOnly) { } int32 maindc() { - return mtpMainDC(); + return internal::mainDC(); } int32 dcstate(int32 dc) { @@ -789,7 +789,7 @@ void killSession(int32 dc) { sessions.erase(i); if (wasMain) { - mainSession = new internal::Session(mtpMainDC()); + mainSession = new internal::Session(internal::mainDC()); int32 newdc = mainSession->getDcWithShift(); i = sessions.find(newdc); if (i != sessions.cend()) { @@ -846,22 +846,22 @@ void finish() { delete _globalSlotCarrier; _globalSlotCarrier = nullptr; - mtpDestroyConfigLoader(); + internal::destroyConfigLoader(); _started = false; } void authed(int32 uid) { - mtpAuthed(uid); + internal::authed(uid); } int32 authedId() { - return mtpAuthed(); + return internal::authed(); } void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail) { mtpRequestId req = MTP::send(MTPauth_LogOut(), onDone, onFail); - mtpLogoutOtherDCs(); + internal::logoutOtherDCs(); } void setGlobalDoneHandler(RPCDoneHandlerPtr handler) { @@ -888,20 +888,20 @@ void clearGlobalHandlers() { } void updateDcOptions(const QVector &options) { - mtpUpdateDcOptions(options); + internal::updateDcOptions(options); Local::writeSettings(); } -mtpKeysMap getKeys() { - return mtpGetKeys(); +AuthKeysMap getKeys() { + return internal::getAuthKeys(); } -void setKey(int32 dc, mtpAuthKeyPtr key) { - return mtpSetKey(dc, key); +void setKey(int32 dc, AuthKeyPtr key) { + return internal::setAuthKey(dc, key); } QReadWriteLock *dcOptionsMutex() { - return mtpDcOptionsMutex(); + return internal::dcOptionsMutex(); } } // namespace MTP diff --git a/Telegram/SourceFiles/mtproto/facade.h b/Telegram/SourceFiles/mtproto/facade.h index 05990fde24..2c58d4d3fa 100644 --- a/Telegram/SourceFiles/mtproto/facade.h +++ b/Telegram/SourceFiles/mtproto/facade.h @@ -192,8 +192,8 @@ void clearGlobalHandlers(); void updateDcOptions(const QVector &options); -mtpKeysMap getKeys(); -void setKey(int32 dc, mtpAuthKeyPtr key); +AuthKeysMap getKeys(); +void setKey(int32 dc, AuthKeyPtr key); QReadWriteLock *dcOptionsMutex(); diff --git a/Telegram/SourceFiles/mtproto/session.cpp b/Telegram/SourceFiles/mtproto/session.cpp index 9c4ad9c735..76c9de9cd8 100644 --- a/Telegram/SourceFiles/mtproto/session.cpp +++ b/Telegram/SourceFiles/mtproto/session.cpp @@ -96,7 +96,7 @@ Session::Session(int32 dcenter) : QObject() connect(&sender, SIGNAL(timeout()), this, SLOT(needToResumeAndSend())); - MTProtoDCMap &dcs(mtpDCMap()); + DcenterMap &dcs(DCMap()); _connection = new Connection(); dcWithShift = _connection->start(&data, dcenter); @@ -109,16 +109,16 @@ Session::Session(int32 dcenter) : QObject() if (!dc) { dcenter = dcWithShift; int32 dcId = bareDcId(dcWithShift); - MTProtoDCMap::const_iterator dcIndex = dcs.constFind(dcId); + auto dcIndex = dcs.constFind(dcId); if (dcIndex == dcs.cend()) { - dc = MTProtoDCPtr(new MTProtoDC(dcId, mtpAuthKeyPtr())); + dc = DcenterPtr(new Dcenter(dcId, AuthKeyPtr())); dcs.insert(dcId, dc); } else { dc = dcIndex.value(); } ReadLockerAttempt lock(keyMutex()); - data.setKey(lock ? dc->getKey() : mtpAuthKeyPtr(0)); + data.setKey(lock ? dc->getKey() : AuthKeyPtr()); if (lock && dc->connectionInited()) { data.setLayerWasInited(true); } @@ -197,7 +197,7 @@ void Session::needToResumeAndSend() { } if (!_connection) { DEBUG_LOG(("Session Info: resuming session dcWithShift %1").arg(dcWithShift)); - MTProtoDCMap &dcs(mtpDCMap()); + DcenterMap &dcs(DCMap()); _connection = new Connection(); if (!_connection->start(&data, dcWithShift)) { @@ -466,7 +466,7 @@ void Session::authKeyCreatedForDC() { emit authKeyCreated(); } -void Session::notifyKeyCreated(const mtpAuthKeyPtr &key) { +void Session::notifyKeyCreated(const AuthKeyPtr &key) { DEBUG_LOG(("AuthKey Info: MTProtoSession::keyCreated(), setting, dcWithShift %1").arg(dcWithShift)); dc->setKey(key); } @@ -490,7 +490,7 @@ void Session::destroyKey() { if (data.getKey() == dc->getKey()) { dc->destroyKey(); } - data.setKey(mtpAuthKeyPtr(0)); + data.setKey(AuthKeyPtr()); } } diff --git a/Telegram/SourceFiles/mtproto/session.h b/Telegram/SourceFiles/mtproto/session.h index 39a15acc53..f46694e3a2 100644 --- a/Telegram/SourceFiles/mtproto/session.h +++ b/Telegram/SourceFiles/mtproto/session.h @@ -73,10 +73,10 @@ public: return _salt; } - const mtpAuthKeyPtr &getKey() const { + const AuthKeyPtr &getKey() const { return _authKey; } - void setKey(const mtpAuthKeyPtr &key) { + void setKey(const AuthKeyPtr &key) { if (_authKey != key) { uint64 session = rand_value(); _authKey = key; @@ -200,7 +200,7 @@ private: Session *_owner; - mtpAuthKeyPtr _authKey; + AuthKeyPtr _authKey; bool _keyChecked, _layerInited; mtpPreRequestMap toSend; // map of request_id -> request, that is waiting to be sent @@ -240,7 +240,7 @@ public: ~Session(); QReadWriteLock *keyMutex() const; - void notifyKeyCreated(const mtpAuthKeyPtr &key); + void notifyKeyCreated(const AuthKeyPtr &key); void destroyKey(); void notifyLayerInited(bool wasInited); @@ -292,7 +292,7 @@ private: SessionData data; int32 dcWithShift; - MTProtoDCPtr dc; + DcenterPtr dc; uint64 msSendCall, msWait; diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 2134e97dd1..9e00f902d4 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -33,12 +33,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include -#undef signals extern "C" { - #include - #include -} +#undef signals +#include +#include #define signals public +} // extern "C" #include diff --git a/Telegram/SourceFiles/pspecific_win.h b/Telegram/SourceFiles/pspecific_win.h index 0f149ad290..e6303f27fc 100644 --- a/Telegram/SourceFiles/pspecific_win.h +++ b/Telegram/SourceFiles/pspecific_win.h @@ -21,6 +21,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once +#include + inline QString psServerPrefix() { return qsl("Global\\"); } diff --git a/Telegram/SourceFiles/stdafx.h b/Telegram/SourceFiles/stdafx.h index e88e760af9..12885f4688 100644 --- a/Telegram/SourceFiles/stdafx.h +++ b/Telegram/SourceFiles/stdafx.h @@ -20,51 +20,15 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #define NOMINMAX // no min() and max() macro declarations - -#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 - #include #include #include -#ifdef Q_OS_WIN // use Lzma SDK for win -#include -#else // Q_OS_WIN -#include -#endif // else of Q_OS_WIN - -extern "C" { - -#endif - -#include "zip.h" - -#include -#include -#include -#include -#include - -#ifdef __cplusplus - -} - #include "types.h" #include "config.h" @@ -85,4 +49,4 @@ extern "C" { #include "app.h" -#endif +#endif // __cplusplus diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index f851dc2314..523b02897b 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -25,6 +25,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include #include +extern "C" { +#include +#include +} + #include "application.h" uint64 _SharedMemoryLocation[4] = { 0x00, 0x01, 0x02, 0x03 }; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 8d7cbbad40..4e7c413feb 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -19,14 +19,15 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" -#include "style.h" -#include "lang.h" - -#include "shortcuts.h" #include "window.h" -#include "application.h" +#include "zip.h" + +#include "style.h" +#include "lang.h" +#include "shortcuts.h" +#include "application.h" #include "pspecific.h" #include "title.h" #include "passcodewidget.h" @@ -37,9 +38,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "boxes/confirmbox.h" #include "boxes/contactsbox.h" #include "boxes/addcontactbox.h" - #include "autoupdater.h" - #include "mediaview.h" #include "localstorage.h" From ef69973e6dc4dd298c5a14616393b0687e94a915 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 16:27:34 +0300 Subject: [PATCH 246/316] fixed build for Xcode --- Telegram/SourceFiles/history.cpp | 10 +-- Telegram/SourceFiles/history.h | 8 ++- Telegram/SourceFiles/logs.cpp | 4 ++ Telegram/SourceFiles/mtproto/connection.h | 2 +- .../mtproto/connection_abstract.cpp | 3 + .../SourceFiles/mtproto/connection_abstract.h | 3 +- .../SourceFiles/mtproto/connection_tcp.cpp | 3 + Telegram/SourceFiles/mtproto/connection_tcp.h | 3 +- Telegram/SourceFiles/mtproto/core_types.h | 2 +- Telegram/Telegram.xcodeproj/project.pbxproj | 72 ++++++++++++++++--- Telegram/Telegram.xcodeproj/qt_preprocess.mak | 56 ++++++++++++++- 11 files changed, 141 insertions(+), 25 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 6e9458d94c..97db8a4163 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -2447,9 +2447,10 @@ void History::clearOnDestroy() { } QPair History::adjustByPosInChatsList(DialogsIndexed &indexed) { - int32 movedFrom = _chatListLinks[0]->pos * st::dlgHeight; + DialogRow *lnk = mainChatListLink(); + int32 movedFrom = lnk->pos * st::dlgHeight; indexed.adjustByPos(_chatListLinks); - int32 movedTo = _chatListLinks[0]->pos * st::dlgHeight; + int32 movedTo = lnk->pos * st::dlgHeight; return qMakePair(movedFrom, movedTo); } @@ -2461,8 +2462,7 @@ DialogRow *History::addToChatList(DialogsIndexed &indexed) { if (App::wnd()) App::wnd()->updateCounter(); } } - t_assert(!_chatListLinks.isEmpty()); - return _chatListLinks[0]; + return mainChatListLink(); } void History::removeFromChatList(DialogsIndexed &indexed) { @@ -2493,7 +2493,7 @@ void History::addChatListEntryByLetter(QChar letter, DialogRow *row) { void History::updateChatListEntry() const { if (MainWidget *m = App::main()) { if (inChatList()) { - m->dlgUpdated(_chatListLinks[0]); + m->dlgUpdated(mainChatListLink()); } } } diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index c04763f06b..1a8c9626d9 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -293,8 +293,7 @@ public: return !_chatListLinks.isEmpty(); } int32 posInChatList() const { - t_assert(inChatList()); - return _chatListLinks[0]->pos; + return mainChatListLink()->pos; } DialogRow *addToChatList(DialogsIndexed &indexed); void removeFromChatList(DialogsIndexed &indexed); @@ -488,6 +487,11 @@ private: Flags _flags; ChatListLinksMap _chatListLinks; + DialogRow *mainChatListLink() const { + auto it = _chatListLinks.constFind(0); + t_assert(it != _chatListLinks.cend()); + return it.value(); + } uint64 _sortKeyInChatList; // like ((unixtime) << 32) | (incremented counter) typedef QMap MediaOverviewIds; diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 371c8e20b5..68fa217d0a 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -19,6 +19,9 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #include "stdafx.h" + +#include "logs.h" + #include #include "pspecific.h" @@ -34,6 +37,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #elif defined Q_OS_MAC // Q_OS_WIN +#include #ifdef MAC_USE_BREAKPAD #include "client/mac/handler/exception_handler.h" #else // MAC_USE_BREAKPAD diff --git a/Telegram/SourceFiles/mtproto/connection.h b/Telegram/SourceFiles/mtproto/connection.h index 96e25c4a90..dea2c3df3a 100644 --- a/Telegram/SourceFiles/mtproto/connection.h +++ b/Telegram/SourceFiles/mtproto/connection.h @@ -173,7 +173,7 @@ private: bool _needSessionReset; void resetSession(); - uint32 dc; + ShiftedDcId dc; Connection *_owner; AbstractConnection *_conn, *_conn4, *_conn6; diff --git a/Telegram/SourceFiles/mtproto/connection_abstract.cpp b/Telegram/SourceFiles/mtproto/connection_abstract.cpp index 6d5f3c4339..1e6d96fc3a 100644 --- a/Telegram/SourceFiles/mtproto/connection_abstract.cpp +++ b/Telegram/SourceFiles/mtproto/connection_abstract.cpp @@ -29,6 +29,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org namespace MTP { namespace internal { +AbstractConnection::~AbstractConnection() { +} + mtpBuffer AbstractConnection::preparePQFake(const MTPint128 &nonce) { MTPReq_pq req_pq(nonce); mtpBuffer buffer; diff --git a/Telegram/SourceFiles/mtproto/connection_abstract.h b/Telegram/SourceFiles/mtproto/connection_abstract.h index 3fa7c7195f..1547e10767 100644 --- a/Telegram/SourceFiles/mtproto/connection_abstract.h +++ b/Telegram/SourceFiles/mtproto/connection_abstract.h @@ -35,8 +35,7 @@ public: } AbstractConnection(const AbstractConnection &other) = delete; AbstractConnection &operator=(const AbstractConnection &other) = delete; - virtual ~AbstractConnection() = 0 { - } + virtual ~AbstractConnection() = 0; // virtual constructor static AbstractConnection *create(QThread *thread); diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.cpp b/Telegram/SourceFiles/mtproto/connection_tcp.cpp index 8f18e45490..e80f271505 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.cpp +++ b/Telegram/SourceFiles/mtproto/connection_tcp.cpp @@ -49,6 +49,9 @@ AbstractTCPConnection::AbstractTCPConnection(QThread *thread) : AbstractConnecti , currentPos((char*)shortBuffer) { } +AbstractTCPConnection::~AbstractTCPConnection() { +} + void AbstractTCPConnection::socketRead() { if (sock.state() != QAbstractSocket::ConnectedState) { LOG(("MTP error: socket not connected in socketRead(), state: %1").arg(sock.state())); diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.h b/Telegram/SourceFiles/mtproto/connection_tcp.h index 17ac5ca0a4..d87d911ab3 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.h +++ b/Telegram/SourceFiles/mtproto/connection_tcp.h @@ -33,8 +33,7 @@ class AbstractTCPConnection : public AbstractConnection { public: AbstractTCPConnection(QThread *thread); - virtual ~AbstractTCPConnection() = 0 { - } + virtual ~AbstractTCPConnection() = 0; public slots: diff --git a/Telegram/SourceFiles/mtproto/core_types.h b/Telegram/SourceFiles/mtproto/core_types.h index 592f6ad858..136698bd82 100644 --- a/Telegram/SourceFiles/mtproto/core_types.h +++ b/Telegram/SourceFiles/mtproto/core_types.h @@ -945,7 +945,7 @@ struct MTPStringLogger { char *b = new char[newsize]; memcpy(b, p, size); alloced = newsize; - delete p; + delete[] p; p = b; } char *p; diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index b330ff9307..e0040cea41 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -64,6 +64,17 @@ 075FEBEC1C82336D0003ECA3 /* shortcuts.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 075FEBEA1C82336D0003ECA3 /* shortcuts.cpp */; }; 0764D55A1ABAD6F900FBFEED /* apiwrap.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0764D5581ABAD6F900FBFEED /* apiwrap.cpp */; }; 0764D55D1ABAD71B00FBFEED /* moc_apiwrap.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 0764D55C1ABAD71B00FBFEED /* moc_apiwrap.cpp */; }; + 077A4AF71CA41C38002188D2 /* connection_abstract.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AEC1CA41C38002188D2 /* connection_abstract.cpp */; }; + 077A4AF81CA41C38002188D2 /* connection_auto.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AEE1CA41C38002188D2 /* connection_auto.cpp */; }; + 077A4AF91CA41C38002188D2 /* connection_http.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AF01CA41C38002188D2 /* connection_http.cpp */; }; + 077A4AFA1CA41C38002188D2 /* connection_tcp.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AF21CA41C38002188D2 /* connection_tcp.cpp */; }; + 077A4AFB1CA41C38002188D2 /* generate.py in Resources */ = {isa = PBXBuildFile; fileRef = 077A4AF41CA41C38002188D2 /* generate.py */; }; + 077A4AFC1CA41C38002188D2 /* rsa_public_key.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AF51CA41C38002188D2 /* rsa_public_key.cpp */; }; + 077A4AFD1CA41C38002188D2 /* scheme.tl in Resources */ = {isa = PBXBuildFile; fileRef = 077A4AF61CA41C38002188D2 /* scheme.tl */; }; + 077A4B031CA41EE2002188D2 /* moc_connection_abstract.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4AFF1CA41EE2002188D2 /* moc_connection_abstract.cpp */; }; + 077A4B041CA41EE2002188D2 /* moc_connection_auto.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4B001CA41EE2002188D2 /* moc_connection_auto.cpp */; }; + 077A4B051CA41EE2002188D2 /* moc_connection_http.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4B011CA41EE2002188D2 /* moc_connection_http.cpp */; }; + 077A4B061CA41EE2002188D2 /* moc_connection_tcp.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 077A4B021CA41EE2002188D2 /* moc_connection_tcp.cpp */; }; 078A2FCA1A811C5900CCC7A0 /* moc_backgroundbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 078A2FC91A811C5900CCC7A0 /* moc_backgroundbox.cpp */; }; 078A2FCD1A811CA600CCC7A0 /* backgroundbox.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 078A2FCB1A811CA600CCC7A0 /* backgroundbox.cpp */; }; 07A69332199277BA0099CB9F /* mediaview.cpp in Compile Sources */ = {isa = PBXBuildFile; fileRef = 07A69330199277BA0099CB9F /* mediaview.cpp */; }; @@ -312,6 +323,21 @@ 0764D5591ABAD6F900FBFEED /* apiwrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = apiwrap.h; path = SourceFiles/apiwrap.h; sourceTree = SOURCE_ROOT; }; 0764D55C1ABAD71B00FBFEED /* moc_apiwrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_apiwrap.cpp; path = GeneratedFiles/Debug/moc_apiwrap.cpp; sourceTree = SOURCE_ROOT; }; 0771C4C94B623FC34BF62983 /* introwidget.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = introwidget.cpp; path = SourceFiles/intro/introwidget.cpp; sourceTree = ""; }; + 077A4AEC1CA41C38002188D2 /* connection_abstract.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = connection_abstract.cpp; path = SourceFiles/mtproto/connection_abstract.cpp; sourceTree = SOURCE_ROOT; }; + 077A4AED1CA41C38002188D2 /* connection_abstract.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = connection_abstract.h; path = SourceFiles/mtproto/connection_abstract.h; sourceTree = SOURCE_ROOT; }; + 077A4AEE1CA41C38002188D2 /* connection_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = connection_auto.cpp; path = SourceFiles/mtproto/connection_auto.cpp; sourceTree = SOURCE_ROOT; }; + 077A4AEF1CA41C38002188D2 /* connection_auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = connection_auto.h; path = SourceFiles/mtproto/connection_auto.h; sourceTree = SOURCE_ROOT; }; + 077A4AF01CA41C38002188D2 /* connection_http.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = connection_http.cpp; path = SourceFiles/mtproto/connection_http.cpp; sourceTree = SOURCE_ROOT; }; + 077A4AF11CA41C38002188D2 /* connection_http.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = connection_http.h; path = SourceFiles/mtproto/connection_http.h; sourceTree = SOURCE_ROOT; }; + 077A4AF21CA41C38002188D2 /* connection_tcp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = connection_tcp.cpp; path = SourceFiles/mtproto/connection_tcp.cpp; sourceTree = SOURCE_ROOT; }; + 077A4AF31CA41C38002188D2 /* connection_tcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = connection_tcp.h; path = SourceFiles/mtproto/connection_tcp.h; sourceTree = SOURCE_ROOT; }; + 077A4AF41CA41C38002188D2 /* generate.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = generate.py; path = SourceFiles/mtproto/generate.py; sourceTree = SOURCE_ROOT; }; + 077A4AF51CA41C38002188D2 /* rsa_public_key.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rsa_public_key.cpp; path = SourceFiles/mtproto/rsa_public_key.cpp; sourceTree = SOURCE_ROOT; }; + 077A4AF61CA41C38002188D2 /* scheme.tl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = scheme.tl; path = SourceFiles/mtproto/scheme.tl; sourceTree = SOURCE_ROOT; }; + 077A4AFF1CA41EE2002188D2 /* moc_connection_abstract.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_connection_abstract.cpp; path = GeneratedFiles/Debug/moc_connection_abstract.cpp; sourceTree = SOURCE_ROOT; }; + 077A4B001CA41EE2002188D2 /* moc_connection_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_connection_auto.cpp; path = GeneratedFiles/Debug/moc_connection_auto.cpp; sourceTree = SOURCE_ROOT; }; + 077A4B011CA41EE2002188D2 /* moc_connection_http.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_connection_http.cpp; path = GeneratedFiles/Debug/moc_connection_http.cpp; sourceTree = SOURCE_ROOT; }; + 077A4B021CA41EE2002188D2 /* moc_connection_tcp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_connection_tcp.cpp; path = GeneratedFiles/Debug/moc_connection_tcp.cpp; sourceTree = SOURCE_ROOT; }; 078A2FC91A811C5900CCC7A0 /* moc_backgroundbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_backgroundbox.cpp; path = GeneratedFiles/Debug/moc_backgroundbox.cpp; sourceTree = SOURCE_ROOT; }; 078A2FCB1A811CA600CCC7A0 /* backgroundbox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = backgroundbox.cpp; path = SourceFiles/boxes/backgroundbox.cpp; sourceTree = SOURCE_ROOT; }; 078A2FCC1A811CA600CCC7A0 /* backgroundbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = backgroundbox.h; path = SourceFiles/boxes/backgroundbox.h; sourceTree = SOURCE_ROOT; }; @@ -813,25 +839,36 @@ 1A6AA22F4A758C4B5F5138FB /* mtproto */ = { isa = PBXGroup; children = ( - 6D50D70712776D7ED3B00E5C /* facade.cpp */, 07129D691C16D230002DC495 /* auth_key.cpp */, - B8D9AFA42E8633154A9817A2 /* connection.cpp */, - 07D8509219F5C97E00623D75 /* core_types.cpp */, - 315C7FACB4A9E18AA95486CA /* dcenter.cpp */, - 01D6341DC31FE5997F7BB159 /* file_download.cpp */, - 89F92B278CA31C393E245056 /* rpc_sender.cpp */, - 07D8509319F5C97E00623D75 /* scheme_auto.cpp */, - 0FBED3C6654EA3753EB39831 /* session.cpp */, - 8880067F9BFD46108777E134 /* facade.h */, 748F1BCCBEEB3675768960FB /* auth_key.h */, + B8D9AFA42E8633154A9817A2 /* connection.cpp */, 963123025C466CB8DD9CF4AF /* connection.h */, + 077A4AEC1CA41C38002188D2 /* connection_abstract.cpp */, + 077A4AED1CA41C38002188D2 /* connection_abstract.h */, + 077A4AEE1CA41C38002188D2 /* connection_auto.cpp */, + 077A4AEF1CA41C38002188D2 /* connection_auto.h */, + 077A4AF01CA41C38002188D2 /* connection_http.cpp */, + 077A4AF11CA41C38002188D2 /* connection_http.h */, + 077A4AF21CA41C38002188D2 /* connection_tcp.cpp */, + 077A4AF31CA41C38002188D2 /* connection_tcp.h */, + 07D8509219F5C97E00623D75 /* core_types.cpp */, 27E7471A4EC90E84353AA16F /* core_types.h */, + 315C7FACB4A9E18AA95486CA /* dcenter.cpp */, B3D42654F18B1FE49512C404 /* dcenter.h */, + 6D50D70712776D7ED3B00E5C /* facade.cpp */, + 8880067F9BFD46108777E134 /* facade.h */, + 01D6341DC31FE5997F7BB159 /* file_download.cpp */, 96ACDDE3DCB798B97F9EA2F4 /* file_download.h */, - A3622760CEC6D6827A25E710 /* rsa_public_key.h */, + 89F92B278CA31C393E245056 /* rpc_sender.cpp */, FB61F72601D91BF3AC730D20 /* rpc_sender.h */, + 077A4AF51CA41C38002188D2 /* rsa_public_key.cpp */, + A3622760CEC6D6827A25E710 /* rsa_public_key.h */, + 07D8509319F5C97E00623D75 /* scheme_auto.cpp */, 7DBFC0B5EAF874BA10E3D603 /* scheme_auto.h */, + 0FBED3C6654EA3753EB39831 /* session.cpp */, 4D1099F2D3696E8A0E17D37D /* session.h */, + 077A4AF41CA41C38002188D2 /* generate.py */, + 077A4AF61CA41C38002188D2 /* scheme.tl */, ); name = mtproto; sourceTree = ""; @@ -1142,6 +1179,10 @@ 801973D3334D0FCA849CF485 /* Debug */ = { isa = PBXGroup; children = ( + 077A4AFF1CA41EE2002188D2 /* moc_connection_abstract.cpp */, + 077A4B001CA41EE2002188D2 /* moc_connection_auto.cpp */, + 077A4B011CA41EE2002188D2 /* moc_connection_http.cpp */, + 077A4B021CA41EE2002188D2 /* moc_connection_tcp.cpp */, 07B604341B46A20900CA29FE /* moc_playerwidget.cpp */, 07C759711B1F7E2800662169 /* moc_autoupdater.cpp */, 0710CA041B0B9404001B4272 /* moc_stickersetbox.cpp */, @@ -1427,9 +1468,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 077A4AFB1CA41C38002188D2 /* generate.py in Resources */, 0749CE69194D723400345D61 /* Images.xcassets in Resources */, 07AF95FA1AFD03C80060B057 /* telegram_mac.qrc in Resources */, 07D7EABA1A597DD000838BA2 /* Localizable.strings in Resources */, + 077A4AFD1CA41C38002188D2 /* scheme.tl in Resources */, 07AF95F91AFD03C80060B057 /* telegram_emojis.qrc in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1536,6 +1579,7 @@ 6E4DB0CBEF415196AFD4149F /* fileuploader.cpp in Compile Sources */, 700925F3B2C6163D38140CEA /* history.cpp in Compile Sources */, 0732E4A9199E262300D50FE7 /* overviewwidget.cpp in Compile Sources */, + 077A4B041CA41EE2002188D2 /* moc_connection_auto.cpp in Compile Sources */, 1DF53374E3B6A31661548D08 /* historywidget.cpp in Compile Sources */, 078A2FCD1A811CA600CCC7A0 /* backgroundbox.cpp in Compile Sources */, 37A3C6C782A0E4BC7B09536B /* langloaderplain.cpp in Compile Sources */, @@ -1545,9 +1589,11 @@ 113AA97DEE7847C7D2DCFF71 /* logs.cpp in Compile Sources */, E3194392BD6D0726F75FA72E /* mainwidget.cpp in Compile Sources */, DF36EA42D67ED39E58CB7DF9 /* settings.cpp in Compile Sources */, + 077A4B031CA41EE2002188D2 /* moc_connection_abstract.cpp in Compile Sources */, B99CCE43EEFCD3E18F6D16D1 /* settingswidget.cpp in Compile Sources */, B8DA82DA1B195A933A0805E7 /* sysbuttons.cpp in Compile Sources */, 5CE57D44510AB2A11886AB52 /* title.cpp in Compile Sources */, + 077A4AF81CA41C38002188D2 /* connection_auto.cpp in Compile Sources */, 4078D5D614EB3ECF7F1848C7 /* types.cpp in Compile Sources */, 68FFEB7CA30BF0149161B809 /* window.cpp in Compile Sources */, 0CB7DE9A54CC9BF86FB7B5CA /* facade.cpp in Compile Sources */, @@ -1580,6 +1626,7 @@ 90085DF442550A0845D5AF37 /* style_core.cpp in Compile Sources */, 074FCB8E19D36851004C6EB2 /* popupmenu.cpp in Compile Sources */, 3AA6E7264581F82856FB37F7 /* text.cpp in Compile Sources */, + 077A4B061CA41EE2002188D2 /* moc_connection_tcp.cpp in Compile Sources */, FCE6518C548DF7BC82228A4A /* twidget.cpp in Compile Sources */, 071AD8D21C5E8E6D008C9E90 /* zip.c in Compile Sources */, E9F1CE7F9B18C7C85A50E62D /* style_auto.cpp in Compile Sources */, @@ -1608,9 +1655,11 @@ C1F9D5CA8AF3AD8EBC9D7310 /* moc_application.cpp in Compile Sources */, D846C6F212B438DC2FD5FF71 /* moc_dialogswidget.cpp in Compile Sources */, 6C79FBC5CFA36AC3EA6ABBD4 /* moc_dropdown.cpp in Compile Sources */, + 077A4AFA1CA41C38002188D2 /* connection_tcp.cpp in Compile Sources */, 822C2860FBFAF3EAE42C5A3F /* moc_fileuploader.cpp in Compile Sources */, 352349751855EF76DECA4D60 /* moc_historywidget.cpp in Compile Sources */, 4B0036C794BEA27AF9419768 /* moc_layerwidget.cpp in Compile Sources */, + 077A4AF71CA41C38002188D2 /* connection_abstract.cpp in Compile Sources */, C14E6C902F6435B3149ECD64 /* moc_profilewidget.cpp in Compile Sources */, 071AD8F81C5E99D6008C9E90 /* ioapi.c in Compile Sources */, 074756191A1372C600CA07F7 /* moc_types.cpp in Compile Sources */, @@ -1632,6 +1681,7 @@ B780F9E21269259B90A1F32A /* moc_dcenter.cpp in Compile Sources */, 07080BCF1A43588C00741A51 /* lang_auto.cpp in Compile Sources */, 07539B1D1A1416AF00083EFC /* moc_history.cpp in Compile Sources */, + 077A4AFC1CA41C38002188D2 /* rsa_public_key.cpp in Compile Sources */, 2A500B102B7CE80F3EB6E13E /* moc_file_download.cpp in Compile Sources */, 07A6933519927B160099CB9F /* moc_mediaview.cpp in Compile Sources */, 07A69332199277BA0099CB9F /* mediaview.cpp in Compile Sources */, @@ -1653,6 +1703,7 @@ 07DB674D1AD07C9200A51329 /* abstractbox.cpp in Compile Sources */, 3F6EB1F5B98E704960FEA686 /* moc_scrollarea.cpp in Compile Sources */, 60CB4898955209B665E7B07D /* moc_twidget.cpp in Compile Sources */, + 077A4B051CA41EE2002188D2 /* moc_connection_http.cpp in Compile Sources */, 7062978F12EEA525893A5E6F /* moc_aboutbox.cpp in Compile Sources */, E8B28580819B882A5964561A /* moc_addcontactbox.cpp in Compile Sources */, 07B604321B46A0EC00CA29FE /* playerwidget.cpp in Compile Sources */, @@ -1661,6 +1712,7 @@ ED2557A57C6782721DC494AF /* moc_connectionbox.cpp in Compile Sources */, 5FC914F652D1B16FDA8F0634 /* moc_contactsbox.cpp in Compile Sources */, 074968D01A44D14C00394F46 /* languagebox.cpp in Compile Sources */, + 077A4AF91CA41C38002188D2 /* connection_http.cpp in Compile Sources */, 07BE85121A20961F008ACB9F /* moc_localstorage.cpp in Compile Sources */, 07AF95F41AFD03B90060B057 /* qrc_telegram_emojis.cpp in Compile Sources */, 07C759721B1F7E2800662169 /* moc_autoupdater.cpp in Compile Sources */, diff --git a/Telegram/Telegram.xcodeproj/qt_preprocess.mak b/Telegram/Telegram.xcodeproj/qt_preprocess.mak index e8b4df3758..0da30a8dae 100644 --- a/Telegram/Telegram.xcodeproj/qt_preprocess.mak +++ b/Telegram/Telegram.xcodeproj/qt_preprocess.mak @@ -38,6 +38,10 @@ compilers: GeneratedFiles/qrc_telegram.cpp GeneratedFiles/qrc_telegram_emojis.cp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp\ GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp\ GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp\ + GeneratedFiles/Debug/moc_connection_abstract.cpp\ + GeneratedFiles/Debug/moc_connection_auto.cpp\ + GeneratedFiles/Debug/moc_connection_http.cpp\ + GeneratedFiles/Debug/moc_connection_tcp.cpp\ GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp\ GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp\ GeneratedFiles/Debug/moc_popupmenu.cpp\ @@ -99,9 +103,9 @@ GeneratedFiles/qrc_telegram_mac.cpp: SourceFiles/telegram_mac.qrc \ SourceFiles/art/osxtray.png /usr/local/Qt-5.5.1/bin/rcc -name telegram_mac SourceFiles/telegram_mac.qrc -o GeneratedFiles/qrc_telegram_mac.cpp -compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp +compiler_moc_header_make_all: GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp GeneratedFiles/Debug/moc_connection_abstract.cpp GeneratedFiles/Debug/moc_connection_auto.cpp GeneratedFiles/Debug/moc_connection_http.cpp GeneratedFiles/Debug/moc_connection_tcp.cpp GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamebox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp compiler_moc_header_clean: - -$(DEL_FILE) GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamedbox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp + -$(DEL_FILE) GeneratedFiles/Debug/moc_apiwrap.cpp GeneratedFiles/Debug/moc_application.cpp GeneratedFiles/Debug/moc_audio.cpp GeneratedFiles/Debug/moc_autoupdater.cpp GeneratedFiles/Debug/moc_dialogswidget.cpp GeneratedFiles/Debug/moc_dropdown.cpp GeneratedFiles/Debug/moc_fileuploader.cpp GeneratedFiles/Debug/moc_history.cpp GeneratedFiles/Debug/moc_historywidget.cpp GeneratedFiles/Debug/moc_layerwidget.cpp GeneratedFiles/Debug/moc_mediaview.cpp GeneratedFiles/Debug/moc_overviewwidget.cpp GeneratedFiles/Debug/moc_playerwidget.cpp GeneratedFiles/Debug/moc_profilewidget.cpp GeneratedFiles/Debug/moc_passcodewidget.cpp GeneratedFiles/Debug/moc_localimageloader.cpp GeneratedFiles/Debug/moc_localstorage.cpp GeneratedFiles/Debug/moc_mainwidget.cpp GeneratedFiles/Debug/moc_settingswidget.cpp GeneratedFiles/Debug/moc_sysbuttons.cpp GeneratedFiles/Debug/moc_title.cpp GeneratedFiles/Debug/moc_types.cpp GeneratedFiles/Debug/moc_window.cpp GeneratedFiles/Debug/moc_facade.cpp GeneratedFiles/Debug/moc_connection.cpp GeneratedFiles/Debug/moc_connection_abstract.cpp GeneratedFiles/Debug/moc_connection_auto.cpp GeneratedFiles/Debug/moc_connection_http.cpp GeneratedFiles/Debug/moc_connection_tcp.cpp GeneratedFiles/Debug/moc_dcenter.cpp GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp GeneratedFiles/Debug/moc_animation.cpp GeneratedFiles/Debug/moc_button.cpp GeneratedFiles/Debug/moc_popupmenu.cpp GeneratedFiles/Debug/moc_countryinput.cpp GeneratedFiles/Debug/moc_flatbutton.cpp GeneratedFiles/Debug/moc_flatcheckbox.cpp GeneratedFiles/Debug/moc_flatinput.cpp GeneratedFiles/Debug/moc_flatlabel.cpp GeneratedFiles/Debug/moc_flattextarea.cpp GeneratedFiles/Debug/moc_scrollarea.cpp GeneratedFiles/Debug/moc_twidget.cpp GeneratedFiles/Debug/moc_aboutbox.cpp GeneratedFiles/Debug/moc_abstractbox.cpp GeneratedFiles/Debug/moc_addcontactbox.cpp GeneratedFiles/Debug/moc_autolockbox.cpp GeneratedFiles/Debug/moc_backgroundbox.cpp GeneratedFiles/Debug/moc_confirmbox.cpp GeneratedFiles/Debug/moc_connectionbox.cpp GeneratedFiles/Debug/moc_contactsbox.cpp GeneratedFiles/Debug/moc_downloadpathbox.cpp GeneratedFiles/Debug/moc_emojibox.cpp GeneratedFiles/Debug/moc_languagebox.cpp GeneratedFiles/Debug/moc_passcodebox.cpp GeneratedFiles/Debug/moc_photocropbox.cpp GeneratedFiles/Debug/moc_photosendbox.cpp GeneratedFiles/Debug/moc_sessionsbox.cpp GeneratedFiles/Debug/moc_stickersetbox.cpp GeneratedFiles/Debug/moc_usernamedbox.cpp GeneratedFiles/Debug/moc_introwidget.cpp GeneratedFiles/Debug/moc_introcode.cpp GeneratedFiles/Debug/moc_introphone.cpp GeneratedFiles/Debug/moc_intropwdcheck.cpp GeneratedFiles/Debug/moc_introsignup.cpp GeneratedFiles/Debug/moc_pspecific_mac.cpp GeneratedFiles/Debug/moc_apiwrap.cpp: SourceFiles/types.h \ SourceFiles/logs.h \ SourceFiles/apiwrap.h @@ -294,6 +298,10 @@ GeneratedFiles/Debug/moc_window.cpp: SourceFiles/title.h \ GeneratedFiles/Debug/moc_facade.cpp: SourceFiles/mtproto/session.h \ SourceFiles/mtproto/connection.h \ + SourceFiles/mtproto/connection_abstract.h \ + SourceFiles/mtproto/connection_auto.h \ + SourceFiles/mtproto/connection_http.h \ + SourceFiles/mtproto/connection_tcp.h \ SourceFiles/mtproto/core_types.h \ SourceFiles/types.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ @@ -317,6 +325,46 @@ GeneratedFiles/Debug/moc_connection.cpp: SourceFiles/mtproto/core_types.h \ SourceFiles/mtproto/connection.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/mtproto/connection.h -o GeneratedFiles/Debug/moc_connection.cpp +GeneratedFiles/Debug/moc_connection_abstract.cpp: SourceFiles/mtproto/core_types.h \ + SourceFiles/types.h \ + ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ + SourceFiles/logs.h \ + SourceFiles/mtproto/scheme_auto.h \ + SourceFiles/mtproto/rsa_public_key.h \ + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/connection_abstract.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/mtproto/connection_abstract.h -o GeneratedFiles/Debug/moc_connection_abstract.cpp + +GeneratedFiles/Debug/moc_connection_auto.cpp: SourceFiles/mtproto/core_types.h \ + SourceFiles/types.h \ + ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ + SourceFiles/logs.h \ + SourceFiles/mtproto/scheme_auto.h \ + SourceFiles/mtproto/rsa_public_key.h \ + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/connection_auto.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/mtproto/connection_auto.h -o GeneratedFiles/Debug/moc_connection_auto.cpp + +GeneratedFiles/Debug/moc_connection_http.cpp: SourceFiles/mtproto/core_types.h \ + SourceFiles/types.h \ + ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ + SourceFiles/logs.h \ + SourceFiles/mtproto/scheme_auto.h \ + SourceFiles/mtproto/rsa_public_key.h \ + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/connection_http.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/mtproto/connection_http.h -o GeneratedFiles/Debug/moc_connection_http.cpp + +GeneratedFiles/Debug/moc_connection_tcp.cpp: SourceFiles/mtproto/core_types.h \ + SourceFiles/types.h \ + ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ + SourceFiles/logs.h \ + SourceFiles/mtproto/scheme_auto.h \ + SourceFiles/mtproto/rsa_public_key.h \ + SourceFiles/mtproto/auth_key.h \ + SourceFiles/mtproto/connection_tcp.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/mtproto/connection_tcp.h -o GeneratedFiles/Debug/moc_connection_tcp.cpp + GeneratedFiles/Debug/moc_dcenter.cpp: SourceFiles/mtproto/dcenter.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/mtproto/dcenter.h -o GeneratedFiles/Debug/moc_dcenter.cpp @@ -324,6 +372,10 @@ GeneratedFiles/Debug/moc_file_download.cpp: SourceFiles/mtproto/file_download.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/mtproto/file_download.h -o GeneratedFiles/Debug/moc_file_download.cpp GeneratedFiles/Debug/moc_session.cpp: SourceFiles/mtproto/connection.h \ + SourceFiles/mtproto/connection_abstract.h \ + SourceFiles/mtproto/connection_auto.h \ + SourceFiles/mtproto/connection_http.h \ + SourceFiles/mtproto/connection_tcp.h \ SourceFiles/mtproto/core_types.h \ SourceFiles/types.h \ ../../Libraries/QtStatic/qtbase/include/QtCore/QReadWriteLock \ From 605f5305e445f482d328d37fda984fcc8720a1e1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 18:07:13 +0300 Subject: [PATCH 247/316] Changed all .. to ... in phrases --- README.md | 2 +- Telegram/SourceFiles/_other/genlang.cpp | 4 +- Telegram/SourceFiles/application.cpp | 32 +++++------ Telegram/SourceFiles/autoupdater.cpp | 2 +- Telegram/SourceFiles/boxes/languagebox.cpp | 2 +- Telegram/SourceFiles/gui/text.cpp | 2 +- Telegram/SourceFiles/history.cpp | 14 ++--- Telegram/SourceFiles/localstorage.cpp | 26 ++++----- Telegram/SourceFiles/main.cpp | 4 +- Telegram/SourceFiles/mtproto/auth_key.h | 4 +- Telegram/SourceFiles/mtproto/connection.cpp | 56 +++++++++---------- .../SourceFiles/mtproto/connection_tcp.cpp | 2 +- Telegram/SourceFiles/mtproto/core_types.cpp | 2 +- Telegram/SourceFiles/mtproto/facade.cpp | 4 +- Telegram/SourceFiles/profilewidget.cpp | 2 +- Telegram/SourceFiles/pspecific_linux.cpp | 4 +- Telegram/SourceFiles/pspecific_win.cpp | 8 +-- Telegram/SourceFiles/pspecific_winrt.cpp | 8 +-- Telegram/SourceFiles/types.cpp | 2 +- Telegram/SourceFiles/window.cpp | 8 +-- 20 files changed, 94 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index 4f9b406f71..6229b0d784 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is * ### MetaLang - Creates from languagepack file `Resources/lang.txt` language constants code and language file parse code: + Creates from languagepack file `Resources/lang.strings` language constants code and language file parse code: * GeneratedFiles/lang.h * GeneratedFiles/lang.cpp diff --git a/Telegram/SourceFiles/_other/genlang.cpp b/Telegram/SourceFiles/_other/genlang.cpp index 4108f7ad27..614f81de5b 100644 --- a/Telegram/SourceFiles/_other/genlang.cpp +++ b/Telegram/SourceFiles/_other/genlang.cpp @@ -391,7 +391,7 @@ bool genLang(const QString &lang_in, const QString &lang_out) { th.setCodec("ISO 8859-1"); th << "\ /*\n\ -Created from \'/Resources/lang.txt\' by \'/MetaLang\' project\n\ +Created from \'/Resources/lang.strings\' by \'/MetaLang\' project\n\ \n\ WARNING! All changes made in this file will be lost!\n\ \n\ @@ -475,7 +475,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ tcpp << "\ /*\n\ -Created from \'/Resources/lang.txt\' by \'/MetaLang\' project\n\ +Created from \'/Resources/lang.strings\' by \'/MetaLang\' project\n\ \n\ WARNING! All changes made in this file will be lost!\n\ \n\ diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 28530ed5fd..d66874dbf7 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -120,16 +120,16 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #endif if (cManyInstance()) { - LOG(("Many instance allowed, starting..")); + LOG(("Many instance allowed, starting...")); singleInstanceChecked(); } else { - LOG(("Connecting local socket to %1..").arg(_localServerName)); + LOG(("Connecting local socket to %1...").arg(_localServerName)); _localSocket.connectToServer(_localServerName); } } void Application::socketConnected() { - LOG(("Socket connected, this is not the first application instance, sending show command..")); + LOG(("Socket connected, this is not the first application instance, sending show command...")); _secondInstance = true; QString commands; @@ -154,7 +154,7 @@ void Application::socketWritten(qint64/* bytes*/) { if (_localSocket.bytesToWrite()) { return; } - LOG(("Show command written, waiting response..")); + LOG(("Show command written, waiting response...")); } void Application::socketReading() { @@ -166,7 +166,7 @@ void Application::socketReading() { if (QRegularExpression("RES:(\\d+);").match(_localSocketReadData).hasMatch()) { uint64 pid = _localSocketReadData.mid(4, _localSocketReadData.length() - 5).toULongLong(); psActivateProcess(pid); - LOG(("Show command response received, pid = %1, activating and quitting..").arg(pid)); + LOG(("Show command response received, pid = %1, activating and quitting...").arg(pid)); return App::quit(); } } @@ -175,14 +175,14 @@ void Application::socketError(QLocalSocket::LocalSocketError e) { if (App::quitting()) return; if (_secondInstance) { - LOG(("Could not write show command, error %1, quitting..").arg(e)); + LOG(("Could not write show command, error %1, quitting...").arg(e)); return App::quit(); } if (e == QLocalSocket::ServerNotFoundError) { - LOG(("This is the only instance of Telegram, starting server and app..")); + LOG(("This is the only instance of Telegram, starting server and app...")); } else { - LOG(("Socket connect error %1, starting server and app..").arg(e)); + LOG(("Socket connect error %1, starting server and app...").arg(e)); } _localSocket.close(); @@ -196,7 +196,7 @@ void Application::socketError(QLocalSocket::LocalSocketError e) { #ifndef TDESKTOP_DISABLE_AUTOUPDATE if (!cNoStartUpdate() && checkReadyUpdate()) { cSetRestartingUpdate(true); - DEBUG_LOG(("Application Info: installing update instead of starting app..")); + DEBUG_LOG(("Application Info: installing update instead of starting app...")); return App::quit(); } #endif @@ -235,7 +235,7 @@ void Application::singleInstanceChecked() { void Application::socketDisconnected() { if (_secondInstance) { - DEBUG_LOG(("Application Error: socket disconnected before command response received, quitting..")); + DEBUG_LOG(("Application Error: socket disconnected before command response received, quitting...")); return App::quit(); } } @@ -704,7 +704,7 @@ AppClass::AppClass() : QObject() anim::startManager(); historyInit(); - DEBUG_LOG(("Application Info: inited..")); + DEBUG_LOG(("Application Info: inited...")); application()->installNativeEventFilter(psNativeEventFilter()); @@ -714,7 +714,7 @@ AppClass::AppClass() : QObject() connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions())); - DEBUG_LOG(("Application Info: starting app..")); + DEBUG_LOG(("Application Info: starting app...")); QMimeDatabase().mimeTypeForName(qsl("text/plain")); // create mime database @@ -724,7 +724,7 @@ AppClass::AppClass() : QObject() Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); - DEBUG_LOG(("Application Info: window created..")); + DEBUG_LOG(("Application Info: window created...")); Shortcuts::start(); @@ -734,16 +734,16 @@ AppClass::AppClass() : QObject() Local::ReadMapState state = Local::readMap(QByteArray()); if (state == Local::ReadMapPassNeeded) { cSetHasPasscode(true); - DEBUG_LOG(("Application Info: passcode nneded..")); + DEBUG_LOG(("Application Info: passcode needed...")); } else { - DEBUG_LOG(("Application Info: local map read..")); + DEBUG_LOG(("Application Info: local map read...")); MTP::start(); } MTP::setStateChangedHandler(mtpStateChanged); MTP::setSessionResetHandler(mtpSessionReset); - DEBUG_LOG(("Application Info: MTP started..")); + DEBUG_LOG(("Application Info: MTP started...")); DEBUG_LOG(("Application Info: showing.")); if (state == Local::ReadMapPassNeeded) { diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index d82574cb91..6c46f60c18 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -569,7 +569,7 @@ bool checkReadyUpdate() { } #elif defined Q_OS_MAC QDir().mkpath(QFileInfo(curUpdater).absolutePath()); - DEBUG_LOG(("Update Info: moving %1 to %2..").arg(updater.absoluteFilePath()).arg(curUpdater)); + DEBUG_LOG(("Update Info: moving %1 to %2...").arg(updater.absoluteFilePath()).arg(curUpdater)); if (!objc_moveFile(updater.absoluteFilePath(), curUpdater)) { UpdateChecker::clearAll(); return false; diff --git a/Telegram/SourceFiles/boxes/languagebox.cpp b/Telegram/SourceFiles/boxes/languagebox.cpp index 115123b91c..f6e7daf2fb 100644 --- a/Telegram/SourceFiles/boxes/languagebox.cpp +++ b/Telegram/SourceFiles/boxes/languagebox.cpp @@ -88,7 +88,7 @@ void LanguageBox::mousePressEvent(QMouseEvent *e) { return; } else if (!loader.warnings().isEmpty()) { QString warn = loader.warnings(); - if (warn.size() > 256) warn = warn.mid(0, 254) + qsl(".."); + if (warn.size() > 256) warn = warn.mid(0, 253) + qsl("..."); Ui::showLayer(new InformBox(qsl("Lang \"") + LanguageCodes[i] + qsl("\" warnings :(\n\nWarnings: ") + warn)); return; } diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index da7e31e602..30eab680e6 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -3471,7 +3471,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi if (length) { style::font blockFont = font; if (!flags && lnkIndex) { - // should use textStyle lnkFlags somehow.. not supported + // should use textStyle lnkFlags somehow... not supported } if ((flags & TextBlockFPre) || (flags & TextBlockFCode)) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 6e9458d94c..f6194d5249 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1819,7 +1819,7 @@ void History::addOlderSlice(const QVector &slice, const QVector 1) { - HistoryItem *last = block->items.back(); // .. item, item, item, last ], [ first, item, item .. + HistoryItem *last = block->items.back(); // ... item, item, item, last ], [ first, item, item ... HistoryItem *first = blocks.at(1)->items.front(); // we've added a new front block, so previous item for @@ -6946,7 +6946,7 @@ QString HistoryMessage::notificationHeader() const { QString HistoryMessage::notificationText() const { QString msg(inDialogsText()); - if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl(".."); + if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl("..."); return msg; } @@ -7513,7 +7513,7 @@ bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptex } } if (!limit && cutat + 5 < size) { - original = original.mid(0, cutat) + qstr(".."); + original = original.mid(0, cutat) + qstr("..."); } text = lng_action_pinned_message(lt_from, from, lt_text, textcmdLink(2, original)); } else { @@ -7796,7 +7796,7 @@ void HistoryServiceMessage::drawInDialog(Painter &p, const QRect &r, bool act, c QString HistoryServiceMessage::notificationText() const { QString msg = _text.original(); - if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl(".."); + if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl("..."); return msg; } @@ -7817,7 +7817,7 @@ HistoryServiceMessage::~HistoryServiceMessage() { } 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)*/) + : 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) @@ -7825,7 +7825,7 @@ HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, cons } 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)*/) + : 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) @@ -7891,7 +7891,7 @@ bool HistoryGroup::decrementCount() { } void HistoryGroup::updateText() { - setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 .. %2)").arg(_minId).arg(_maxId)*/); + setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 ... %2)").arg(_minId).arg(_maxId)*/); } HistoryCollapse::HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date) diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 359b3b521d..16fed59d54 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -1370,7 +1370,7 @@ namespace { bool result = false; QFile file(cWorkingDir() + qsl("tdata/config")); if (file.open(QIODevice::ReadOnly)) { - LOG(("App Info: reading old config..")); + LOG(("App Info: reading old config...")); QDataStream stream(&file); stream.setVersion(QDataStream::Qt_5_1); @@ -1450,7 +1450,7 @@ namespace { QBuffer decryptedStream(&decrypted); decryptedStream.open(QIODevice::ReadOnly); decryptedStream.seek(4); // skip size - LOG(("App Info: reading encrypted old user config..")); + LOG(("App Info: reading encrypted old user config...")); _readOldUserSettingsFields(&decryptedStream, version); } else if (!_readSetting(blockId, stream, version)) { @@ -1463,7 +1463,7 @@ namespace { bool result = false; QFile file(cWorkingDir() + cDataFile() + (cTestMode() ? qsl("_test") : QString()) + qsl("_config")); if (file.open(QIODevice::ReadOnly)) { - LOG(("App Info: reading old user config..")); + LOG(("App Info: reading old user config...")); qint32 version = 0; MTP::DcOptions dcOpts; @@ -1537,7 +1537,7 @@ namespace { QBuffer decryptedStream(&decrypted); decryptedStream.open(QIODevice::ReadOnly); decryptedStream.seek(4); // skip size - LOG(("App Info: reading encrypted old keys..")); + LOG(("App Info: reading encrypted old keys...")); _readOldMtpDataFields(&decryptedStream, version); } else if (!_readSetting(blockId, stream, version)) { @@ -1550,7 +1550,7 @@ namespace { bool result = false; QFile file(cWorkingDir() + cDataFile() + (cTestMode() ? qsl("_test") : QString())); if (file.open(QIODevice::ReadOnly)) { - LOG(("App Info: reading old keys..")); + LOG(("App Info: reading old keys...")); qint32 version = 0; MTP::DcOptions dcOpts; @@ -1647,7 +1647,7 @@ namespace { return _writeUserSettings(); } - LOG(("App Info: reading encrypted user settings..")); + LOG(("App Info: reading encrypted user settings...")); while (!userSettings.stream.atEnd()) { quint32 blockId; userSettings.stream >> blockId; @@ -1693,7 +1693,7 @@ namespace { return; } - LOG(("App Info: reading encrypted mtp data..")); + LOG(("App Info: reading encrypted mtp data...")); while (!mtp.stream.atEnd()) { quint32 blockId; mtp.stream >> blockId; @@ -1719,7 +1719,7 @@ namespace { if (!readFile(mapData, qsl("map"))) { return Local::ReadMapFailed; } - LOG(("App Info: reading map..")); + LOG(("App Info: reading map...")); QByteArray salt, keyEncrypted, mapEncrypted; mapData.stream >> salt >> keyEncrypted >> mapEncrypted; @@ -1735,7 +1735,7 @@ namespace { EncryptedDescriptor keyData, map; if (!decryptLocal(keyData, keyEncrypted, _passKey)) { - LOG(("App Info: could not decrypt pass-protected key from map file, maybe bad password..")); + LOG(("App Info: could not decrypt pass-protected key from map file, maybe bad password...")); return Local::ReadMapPassNeeded; } uchar key[LocalEncryptKeySize] = { 0 }; @@ -1752,7 +1752,7 @@ namespace { LOG(("App Error: could not decrypt map.")); return Local::ReadMapFailed; } - LOG(("App Info: reading encrypted map..")); + LOG(("App Info: reading encrypted map...")); DraftsMap draftsMap, draftCursorsMap; DraftsNotReadMap draftsNotReadMap; @@ -2101,7 +2101,7 @@ namespace Local { _readOldMtpData(false); // needed further in _readMtpData return writeSettings(); } - LOG(("App Info: reading settings..")); + LOG(("App Info: reading settings...")); QByteArray salt, settingsEncrypted; settingsData.stream >> salt >> settingsEncrypted; @@ -2117,7 +2117,7 @@ namespace Local { EncryptedDescriptor settings; if (!decryptLocal(settings, settingsEncrypted, _settingsKey)) { - LOG(("App Error: could not decrypt settings from settings file, maybe bad passcode..")); + LOG(("App Error: could not decrypt settings from settings file, maybe bad passcode...")); return writeSettings(); } MTP::DcOptions dcOpts; @@ -2126,7 +2126,7 @@ namespace Local { dcOpts = Global::DcOptions(); } _dcOpts = &dcOpts; - LOG(("App Info: reading encrypted settings..")); + LOG(("App Info: reading encrypted settings...")); while (!settings.stream.atEnd()) { quint32 blockId; settings.stream >> blockId; diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 85096528f9..e0300abb6b 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -62,12 +62,12 @@ int main(int argc, char *argv[]) { #ifndef TDESKTOP_DISABLE_AUTOUPDATE if (cRestartingUpdate()) { - DEBUG_LOG(("Application Info: executing updater to install update..")); + DEBUG_LOG(("Application Info: executing updater to install update...")); psExecUpdater(); } else #endif if (cRestarting()) { - DEBUG_LOG(("Application Info: executing Telegram, because of restart..")); + DEBUG_LOG(("Application Info: executing Telegram, because of restart...")); psExecTelegram(); } diff --git a/Telegram/SourceFiles/mtproto/auth_key.h b/Telegram/SourceFiles/mtproto/auth_key.h index d2c720c7ef..935eee4236 100644 --- a/Telegram/SourceFiles/mtproto/auth_key.h +++ b/Telegram/SourceFiles/mtproto/auth_key.h @@ -54,7 +54,7 @@ public: } void prepareAES(const MTPint128 &msgKey, MTPint256 &aesKey, MTPint256 &aesIV, bool send = true) const { - if (!_isset) throw mtpErrorKeyNotReady(QString("prepareAES(.., %1)").arg(Logs::b(send))); + if (!_isset) throw mtpErrorKeyNotReady(QString("prepareAES(..., %1)").arg(Logs::b(send))); uint32 x = send ? 0 : 8; @@ -90,7 +90,7 @@ public: } void write(QDataStream &to) const { - if (!_isset) throw mtpErrorKeyNotReady("write(..)"); + if (!_isset) throw mtpErrorKeyNotReady("write(...)"); to.writeRawData(_key, 256); } diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index 1a84f8e28a..9a2c9fa4d8 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -447,7 +447,7 @@ ConnectionPrivate::ConnectionPrivate(QThread *thread, Connection *owner, Session return; } dc = options.cbegin().value().id; - DEBUG_LOG(("MTP Info: searching for any DC, %1 selected..").arg(dc)); + DEBUG_LOG(("MTP Info: searching for any DC, %1 selected...").arg(dc)); } connect(thread, SIGNAL(started()), this, SLOT(socketStart())); @@ -1154,8 +1154,8 @@ void ConnectionPrivate::socketStart(bool afterConfig) { _pingId = _pingMsgId = _pingIdToSend = _pingSendAt = 0; _pingSender.stop(); - if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %3:%4 (http)..").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); - if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%3]:%4 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %3:%4 (http)...").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%3]:%4 (http)...").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); _waitForConnectedTimer.start(_waitForConnected); if (auto conn = _conn4) { @@ -1188,7 +1188,7 @@ void ConnectionPrivate::restart(bool mayBeBadKey) { clearMessages(); keyId = AuthKey::RecreateKeyId; // retryTimeout = 1; // no ddos please - LOG(("MTP Info: key may be bad and was not checked - but won't be destroyed, no log outs because of bad server right now..")); + LOG(("MTP Info: key may be bad and was not checked - but won't be destroyed, no log outs because of bad server right now...")); } } else { sessionData->setCheckedKey(false); @@ -1254,7 +1254,7 @@ void ConnectionPrivate::onOldConnection() { void ConnectionPrivate::onPingSender() { if (_pingId) { if (_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto - 1) * 1000ULL < getms(true)) { - LOG(("Could not send ping for MTPPingSendAfter seconds, restarting..")); + LOG(("Could not send ping for MTPPingSendAfter seconds, restarting...")); return restart(); } else { _pingSender.start(_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto) * 1000ULL - getms(true)); @@ -1440,7 +1440,7 @@ void ConnectionPrivate::handleReceived() { bool wasConnected = (getState() == ConnectedState); if (serverSalt != mySalt) { if (!badTime) { - DEBUG_LOG(("MTP Info: other salt received.. received: %1, my salt: %2, updating..").arg(serverSalt).arg(mySalt)); + DEBUG_LOG(("MTP Info: other salt received... received: %1, my salt: %2, updating...").arg(serverSalt).arg(mySalt)); sessionData->setSalt(serverSalt); if (setState(ConnectedState, ConnectingState)) { // only connected if (restarted) { @@ -1449,7 +1449,7 @@ void ConnectionPrivate::handleReceived() { } } } else { - DEBUG_LOG(("MTP Info: other salt received.. received: %1, my salt: %2").arg(serverSalt).arg(mySalt)); + DEBUG_LOG(("MTP Info: other salt received... received: %1, my salt: %2").arg(serverSalt).arg(mySalt)); } } else { serverSalt = 0; // dont pass to handle method, so not to lock in setSalt() @@ -1659,7 +1659,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (serverSalt) sessionData->setSalt(serverSalt); unixtimeSet(serverTime, true); - DEBUG_LOG(("Message Info: unixtime updated, now %1, resending in container..").arg(serverTime)); + DEBUG_LOG(("Message Info: unixtime updated, now %1, resending in container...").arg(serverTime)); resend(resendId, 0, true); } else { // must create new session, because msg_id and msg_seqno are inconsistent @@ -1710,13 +1710,13 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime badTime = false; - DEBUG_LOG(("Message Info: unixtime updated, now %1, server_salt updated, now %2, resending..").arg(serverTime).arg(serverSalt)); + DEBUG_LOG(("Message Info: unixtime updated, now %1, server_salt updated, now %2, resending...").arg(serverTime).arg(serverSalt)); resend(resendId); } return 1; case mtpc_msgs_state_req: { if (badTime) { - DEBUG_LOG(("Message Info: skipping with bad time..")); + DEBUG_LOG(("Message Info: skipping with bad time...")); return 0; } MTPMsgsStateReq msg(from, end); @@ -1818,7 +1818,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime case mtpc_msgs_all_info: { if (badTime) { - DEBUG_LOG(("Message Info: skipping with bad time..")); + DEBUG_LOG(("Message Info: skipping with bad time...")); return 0; } @@ -1862,14 +1862,14 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (received) { ackRequestData.push_back(resMsgId); } else { - DEBUG_LOG(("Message Info: answer message %1 was not received, requesting..").arg(resMsgId.v)); + DEBUG_LOG(("Message Info: answer message %1 was not received, requesting...").arg(resMsgId.v)); resendRequestData.push_back(resMsgId); } } return 1; case mtpc_msg_new_detailed_info: { if (badTime) { - DEBUG_LOG(("Message Info: skipping msg_new_detailed_info with bad time..")); + DEBUG_LOG(("Message Info: skipping msg_new_detailed_info with bad time...")); return 0; } MTPMsgDetailedInfo msg(from, end); @@ -1887,7 +1887,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (received) { ackRequestData.push_back(resMsgId); } else { - DEBUG_LOG(("Message Info: answer message %1 was not received, requesting..").arg(resMsgId.v)); + DEBUG_LOG(("Message Info: answer message %1 was not received, requesting...").arg(resMsgId.v)); resendRequestData.push_back(resMsgId); } } return 1; @@ -1914,7 +1914,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime MTPlong reqMsgId(++from, end); mtpTypeId typeId = from[0]; - DEBUG_LOG(("RPC Info: response received for %1, queueing..").arg(reqMsgId.v)); + DEBUG_LOG(("RPC Info: response received for %1, queueing...").arg(reqMsgId.v)); QVector ids(1, reqMsgId); if (badTime) { @@ -1995,7 +1995,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (badTime) return 0; MTPPing msg(from, end); - DEBUG_LOG(("Message Info: ping received, ping_id: %1, sending pong..").arg(msg.vping_id.v)); + DEBUG_LOG(("Message Info: ping received, ping_id: %1, sending pong...").arg(msg.vping_id.v)); emit sendPongAsync(msgId, msg.vping_id.v); } return 1; @@ -2012,7 +2012,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (data.vping_id.v == _pingId) { _pingId = 0; } else { - DEBUG_LOG(("Message Info: just pong..")); + DEBUG_LOG(("Message Info: just pong...")); } QVector ids(1, data.vmsg_id); @@ -2154,7 +2154,7 @@ void ConnectionPrivate::requestsAcked(const QVector &ids, bool byRespon } } } else { - DEBUG_LOG(("Message Info: msgId %1 was not found in recent sent, while acking requests, searching in resend..").arg(msgId)); + DEBUG_LOG(("Message Info: msgId %1 was not found in recent sent, while acking requests, searching in resend...").arg(msgId)); QWriteLocker locker3(sessionData->toResendMutex()); mtpRequestIdsMap &toResend(sessionData->toResendMap()); mtpRequestIdsMap::iterator reqIt = toResend.find(msgId); @@ -2228,7 +2228,7 @@ void ConnectionPrivate::handleMsgsStates(const QVector &ids, const stri const mtpRequestMap &haveSent(sessionData->haveSentMap()); mtpRequestMap::const_iterator haveSentEnd = haveSent.cend(); if (haveSent.find(requestMsgId) == haveSentEnd) { - DEBUG_LOG(("Message Info: state was received for msgId %1, but request is not found, looking in resent requests..").arg(requestMsgId)); + DEBUG_LOG(("Message Info: state was received for msgId %1, but request is not found, looking in resent requests...").arg(requestMsgId)); QWriteLocker locker2(sessionData->toResendMutex()); mtpRequestIdsMap &toResend(sessionData->toResendMap()); mtpRequestIdsMap::iterator reqIt = toResend.find(requestMsgId); @@ -2385,7 +2385,7 @@ void ConnectionPrivate::updateAuthKey() { connect(_conn, SIGNAL(receivedData()), this, SLOT(pqAnswered())); - DEBUG_LOG(("AuthKey Info: sending Req_pq..")); + DEBUG_LOG(("AuthKey Info: sending Req_pq...")); lockFinished.unlock(); sendRequestNotSecure(req_pq); } @@ -2398,7 +2398,7 @@ void ConnectionPrivate::clearMessages() { void ConnectionPrivate::pqAnswered() { disconnect(_conn, SIGNAL(receivedData()), this, SLOT(pqAnswered())); - DEBUG_LOG(("AuthKey Info: receiving Req_pq answer..")); + DEBUG_LOG(("AuthKey Info: receiving Req_pq answer...")); MTPReq_pq::ResponseType res_pq; if (!readResponseNotSecure(res_pq)) { @@ -2490,13 +2490,13 @@ void ConnectionPrivate::pqAnswered() { } connect(_conn, SIGNAL(receivedData()), this, SLOT(dhParamsAnswered())); - DEBUG_LOG(("AuthKey Info: sending Req_DH_params..")); + DEBUG_LOG(("AuthKey Info: sending Req_DH_params...")); sendRequestNotSecure(req_DH_params); } void ConnectionPrivate::dhParamsAnswered() { disconnect(_conn, SIGNAL(receivedData()), this, SLOT(dhParamsAnswered())); - DEBUG_LOG(("AuthKey Info: receiving Req_DH_params answer..")); + DEBUG_LOG(("AuthKey Info: receiving Req_DH_params answer...")); MTPReq_DH_params::ResponseType res_DH_params; if (!readResponseNotSecure(res_DH_params)) { @@ -2672,7 +2672,7 @@ void ConnectionPrivate::dhClientParamsSend() { connect(_conn, SIGNAL(receivedData()), this, SLOT(dhClientParamsAnswered())); - DEBUG_LOG(("AuthKey Info: sending Req_client_DH_params..")); + DEBUG_LOG(("AuthKey Info: sending Req_client_DH_params...")); sendRequestNotSecure(req_client_DH_params); } @@ -2681,7 +2681,7 @@ void ConnectionPrivate::dhClientParamsAnswered() { if (!sessionData) return; disconnect(_conn, SIGNAL(receivedData()), this, SLOT(dhClientParamsAnswered())); - DEBUG_LOG(("AuthKey Info: receiving Req_client_DH_params answer..")); + DEBUG_LOG(("AuthKey Info: receiving Req_client_DH_params answer...")); MTPSet_client_DH_params::ResponseType res_client_DH_params; if (!readResponseNotSecure(res_client_DH_params)) { @@ -2839,7 +2839,7 @@ void ConnectionPrivate::onError4(bool mayBeBadKey) { destroyConn(); _waitForConnectedTimer.stop(); - MTP_LOG(dc, ("Restarting after error in IPv4 connection, maybe bad key: %1..").arg(Logs::b(mayBeBadKey))); + MTP_LOG(dc, ("Restarting after error in IPv4 connection, maybe bad key: %1...").arg(Logs::b(mayBeBadKey))); return restart(mayBeBadKey); } else { destroyConn(&_conn4); @@ -2853,7 +2853,7 @@ void ConnectionPrivate::onError6(bool mayBeBadKey) { destroyConn(); _waitForConnectedTimer.stop(); - MTP_LOG(dc, ("Restarting after error in IPv6 connection, maybe bad key: %1..").arg(Logs::b(mayBeBadKey))); + MTP_LOG(dc, ("Restarting after error in IPv6 connection, maybe bad key: %1...").arg(Logs::b(mayBeBadKey))); return restart(mayBeBadKey); } else { destroyConn(&_conn6); @@ -2940,7 +2940,7 @@ bool ConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResponse, Q ReadLockerAttempt lock(sessionData->keyMutex()); if (!lock) { - DEBUG_LOG(("MTP Info: could not lock key for read in sendBuffer(), dc %1, restarting..").arg(dc)); + DEBUG_LOG(("MTP Info: could not lock key for read in sendBuffer(), dc %1, restarting...").arg(dc)); lockFinished.unlock(); restart(); diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.cpp b/Telegram/SourceFiles/mtproto/connection_tcp.cpp index 8f18e45490..b02c63f56e 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.cpp +++ b/Telegram/SourceFiles/mtproto/connection_tcp.cpp @@ -129,7 +129,7 @@ void AbstractTCPConnection::socketRead() { emit error(); return; } else { - TCP_LOG(("TCP Info: no bytes read, but bytes available was true..")); + TCP_LOG(("TCP Info: no bytes read, but bytes available was true...")); break; } } while (sock.state() == QAbstractSocket::ConnectedState && sock.bytesAvailable()); diff --git a/Telegram/SourceFiles/mtproto/core_types.cpp b/Telegram/SourceFiles/mtproto/core_types.cpp index 1e401eefcd..f438c4e6eb 100644 --- a/Telegram/SourceFiles/mtproto/core_types.cpp +++ b/Telegram/SourceFiles/mtproto/core_types.cpp @@ -66,7 +66,7 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP } else if (strUtf8.size() < 64) { to.add(Logs::mb(strUtf8.constData(), strUtf8.size()).str()).add(" [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); } else { - to.add(Logs::mb(strUtf8.constData(), 16).str()).add(".. [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); + to.add(Logs::mb(strUtf8.constData(), 16).str()).add("... [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); } } break; diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index f7cff78a77..eb3b23f2f7 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -388,7 +388,7 @@ void registerRequest(mtpRequestId requestId, int32 dcWithShift) { QMutexLocker locker(&requestByDCLock); requestsByDC.insert(requestId, dcWithShift); } - internal::performDelayedClear(); // need to do it somewhere.. + internal::performDelayedClear(); // need to do it somewhere... } void unregisterRequest(mtpRequestId requestId) { @@ -517,7 +517,7 @@ void execCallback(mtpRequestId requestId, const mtpPrime *from, const mtpPrime * h = i.value(); parserMap.erase(i); - DEBUG_LOG(("RPC Info: found parser for request %1, trying to parse response..").arg(requestId)); + DEBUG_LOG(("RPC Info: found parser for request %1, trying to parse response...").arg(requestId)); } } if (h.onDone || h.onFail) { diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 56be26e3bb..1aaaf2898a 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1537,7 +1537,7 @@ void ProfileInner::onMenuDestroy(QObject *obj) { void ProfileInner::onCopyFullName() { if (!_peerUser) return; - QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName)); + QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName).trimmed()); } void ProfileInner::onCopyPhone() { diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 9e00f902d4..e3af2b9dea 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -347,7 +347,7 @@ namespace { } bool loadLibrary(QLibrary &lib, const char *name, int version) { - DEBUG_LOG(("Loading '%1' with version %2..").arg(QLatin1String(name)).arg(version)); + DEBUG_LOG(("Loading '%1' with version %2...").arg(QLatin1String(name)).arg(version)); lib.setFileNameAndVersion(QLatin1String(name), version); if (lib.load()) { DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); @@ -443,7 +443,7 @@ namespace { } if (!useGtkBase && lib_gtk.isLoaded()) { - LOG(("Could not load appindicator, trying to load gtk..")); + LOG(("Could not load appindicator, trying to load gtk...")); setupGtkBase(lib_gtk); } if (!useGtkBase) { diff --git a/Telegram/SourceFiles/pspecific_win.cpp b/Telegram/SourceFiles/pspecific_win.cpp index 4153318b7e..26665b0d5b 100644 --- a/Telegram/SourceFiles/pspecific_win.cpp +++ b/Telegram/SourceFiles/pspecific_win.cpp @@ -2197,7 +2197,7 @@ namespace { } bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { - DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); + 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) { @@ -2236,7 +2236,7 @@ namespace { void RegisterCustomScheme() { #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME - DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); + DEBUG_LOG(("App Info: Checking custom scheme 'tg'...")); HKEY rkey; QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); @@ -3385,7 +3385,7 @@ void CheckPinnedAppUserModelId() { BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); CloseHandle(srcfile); if (!srcres) return; - LOG(("Checking..")); + LOG(("Checking...")); WIN32_FIND_DATA findData; HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); if (findHandle == INVALID_HANDLE_VALUE) { @@ -3431,7 +3431,7 @@ void CheckPinnedAppUserModelId() { PROPVARIANT appIdPropVar; hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); if (!SUCCEEDED(hr)) return; - LOG(("Reading..")); + LOG(("Reading...")); WCHAR already[MAX_PATH]; hr = propVariantToString(appIdPropVar, already, MAX_PATH); if (SUCCEEDED(hr)) { diff --git a/Telegram/SourceFiles/pspecific_winrt.cpp b/Telegram/SourceFiles/pspecific_winrt.cpp index 49d8ef081b..ee96c9ae55 100644 --- a/Telegram/SourceFiles/pspecific_winrt.cpp +++ b/Telegram/SourceFiles/pspecific_winrt.cpp @@ -2210,7 +2210,7 @@ namespace { //} //bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { - // DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); + // 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) { @@ -2249,7 +2249,7 @@ namespace { void RegisterCustomScheme() { #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME - DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); + DEBUG_LOG(("App Info: Checking custom scheme 'tg'...")); //HKEY rkey; //QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); @@ -2799,7 +2799,7 @@ void CheckPinnedAppUserModelId() { //BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); //CloseHandle(srcfile); //if (!srcres) return; - //LOG(("Checking..")); + //LOG(("Checking...")); //WIN32_FIND_DATA findData; //HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); //if (findHandle == INVALID_HANDLE_VALUE) { @@ -2845,7 +2845,7 @@ void CheckPinnedAppUserModelId() { // PROPVARIANT appIdPropVar; // hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); // if (!SUCCEEDED(hr)) return; - // LOG(("Reading..")); + // LOG(("Reading...")); // WCHAR already[MAX_PATH]; // hr = propVariantToString(appIdPropVar, already, MAX_PATH); // if (SUCCEEDED(hr)) { diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 523b02897b..6f0b408d91 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -290,7 +290,7 @@ namespace ThirdParty { uchar sha256Buffer[32]; RAND_seed(hashSha256(buf, 16, sha256Buffer), 32); if (!RAND_status()) { - LOG(("MTP Error: Could not init OpenSSL rand, RAND_status() is 0..")); + LOG(("MTP Error: Could not init OpenSSL rand, RAND_status() is 0...")); } } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 4e7c413feb..4c155538de 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2348,7 +2348,7 @@ void LastCrashedWindow::onSendReport() { connect(_checkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); connect(_checkReply, SIGNAL(finished()), this, SLOT(onCheckingFinished())); - _pleaseSendReport.setText(qsl("Sending crash report..")); + _pleaseSendReport.setText(qsl("Sending crash report...")); _sendingState = SendingProgress; _reportShown = false; updateControls(); @@ -2816,7 +2816,7 @@ void LastCrashedWindow::setUpdatingState(UpdatingState state, bool force) { } break; case UpdatingCheck: - _updating.setText(qsl("Checking for updates..")); + _updating.setText(qsl("Checking for updates...")); break; case UpdatingFail: _updating.setText(qsl("Update check failed :(")); @@ -2923,9 +2923,9 @@ void LastCrashedWindow::onSendingProgress(qint64 uploaded, qint64 total) { _sendingState = SendingUploading; if (total < 0) { - _pleaseSendReport.setText(qsl("Sending crash report %1 KB..").arg(uploaded / 1024)); + _pleaseSendReport.setText(qsl("Sending crash report %1 KB...").arg(uploaded / 1024)); } else { - _pleaseSendReport.setText(qsl("Sending crash report %1 / %2 KB..").arg(uploaded / 1024).arg(total / 1024)); + _pleaseSendReport.setText(qsl("Sending crash report %1 / %2 KB...").arg(uploaded / 1024).arg(total / 1024)); } updateControls(); } From 978e86a8bab2fe3c99eeecb8b69e862a308c543e Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 18:31:11 +0300 Subject: [PATCH 248/316] bubble enlarged for signed thumbed files, error string display added for group/channel create error --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/boxes/addcontactbox.cpp | 3 +++ Telegram/SourceFiles/boxes/contactsbox.cpp | 13 ++++++++++++- Telegram/SourceFiles/history.cpp | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 691b3b20b0..942d925826 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -686,6 +686,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_banned" = "Sorry, only admin can add this user."; "lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings."; "lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; +"lng_cant_do_this" = "Sorry, this action is unavailable."; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message..."; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 5f3457ca73..b3e1c85c77 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -540,6 +540,9 @@ bool GroupInfoBox::creationFail(const RPCError &error) { _title.setFocus(); _title.showError(); return true; + } else if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this))); + return true; } return false; } diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 803cd32e0d..9c8e490986 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -284,6 +284,8 @@ bool ContactsInner::addAdminFail(const RPCError &error, mtpRequestId req) { Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers); } else if (error.type() == "ADMINS_TOO_MUCH") { Ui::showLayer(new InformBox(lang(lng_channel_admins_too_much)), KeepOtherLayers); + } else if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this)), KeepOtherLayers); } else { emit adminAdded(); } @@ -1718,7 +1720,13 @@ bool ContactsBox::editAdminFail(const RPCError &error) { if (mtpIsFlood(error)) return true; --_saveRequestId; _inner.chat()->invalidateParticipants(); - if (!_saveRequestId) onClose(); + if (!_saveRequestId) { + if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this))); + return true; + } + onClose(); + } return false; } @@ -1765,6 +1773,9 @@ bool ContactsBox::creationFail(const RPCError &error) { } else if (error.type() == "PEER_FLOOD") { Ui::showLayer(new InformBox(lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq?_hash=can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info)))), KeepOtherLayers); return true; + } else if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this))); + return true; } return false; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f6194d5249..a2f4454c87 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3902,6 +3902,9 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) { if (thumbed) { _minh = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); + if (!captioned && parent->Is()) { + _minh += st::msgDateFont->height - st::msgDateDelta.y(); + } } else { _minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); } From 6710ef3e2f16c99790e3c3fee49cdf9f0346289b Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 19:27:38 +0300 Subject: [PATCH 249/316] fixed admin badge display in groups --- Telegram/SourceFiles/app.cpp | 1 - Telegram/SourceFiles/profilewidget.cpp | 2 +- Telegram/SourceFiles/structs.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index df9c75bdec..e9d2bbe5c9 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -891,7 +891,6 @@ namespace App { } } else { chat->flags &= ~MTPDchat::Flag::f_admins_enabled; - chat->flags &= ~MTPDchat::Flag::f_admin; } if (emitPeerUpdated) { App::main()->peerUpdated(chat); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 1aaaf2898a..a3036db889 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1034,7 +1034,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { data->online = App::onlineText(user, l_time); } if (_peerChat) { - data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->admins.constFind(user) != _peerChat->admins.cend()); + data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->adminsEnabled() && (_peerChat->admins.constFind(user) != _peerChat->admins.cend())); } else if (_peerChannel) { data->admin = (_peerChannel->mgInfo->lastAdmins.constFind(user) != _peerChannel->mgInfo->lastAdmins.cend()); } else { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 304fb2974e..4896a0cea9 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -491,7 +491,7 @@ public: return flags & MTPDchat::Flag::f_creator; } bool amAdmin() const { - return flags & MTPDchat::Flag::f_admin; + return (flags & MTPDchat::Flag::f_admin) && adminsEnabled(); } bool isDeactivated() const { return flags & MTPDchat::Flag::f_deactivated; From b86d8638bcd6d4501d3b7613cf263950b8725bb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 20:30:31 +0300 Subject: [PATCH 250/316] Fixed not loaded messages with bot keyboard display Fixed saved gifs row layout Removed information about channel members count / left to invite in invite-to-channel box (channels have no participants limit) --- Telegram/SourceFiles/boxes/contactsbox.cpp | 6 ++++-- Telegram/SourceFiles/dropdown.cpp | 23 ++++++++++++++++------ Telegram/SourceFiles/historywidget.cpp | 1 + 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 9c8e490986..0d23989d5d 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -785,7 +785,9 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) { data->check = true; _checkedContacts.insert(peer, true); ++_selCount; - } else if ((!_channel || !_channel->isMegagroup()) && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) { + } else if (_channel && !_channel->isMegagroup()) { + Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers); + } else if (!_channel && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) { Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers); } if (cnt != _selCount) emit chosenChanged(); @@ -1551,7 +1553,7 @@ void ContactsBox::paintEvent(QPaintEvent *e) { paintTitle(p, lang(lng_channel_admins)); } else if (_inner.chat() || _inner.creating() != CreatingGroupNone) { QString title(lang(addingAdmin ? lng_channel_add_admin : lng_profile_add_participant)); - QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax())); + QString additional((addingAdmin || (_inner.channel() && !_inner.channel()->isMegagroup())) ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax())); paintTitle(p, title, additional); } else if (_inner.bot()) { paintTitle(p, lang(lng_bot_choose_group)); diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index a2fe08399d..44d9d2653c 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1828,15 +1828,26 @@ StickerPanInner::InlineRow &StickerPanInner::layoutInlineRow(InlineRow &row, int int32 count = row.items.size(); t_assert(count <= SavedGifsMaxPerRow); + // enumerate items in the order of growing maxWidth() + // for that sort item indices by maxWidth() + int indices[SavedGifsMaxPerRow]; + for (int i = 0; i < count; ++i) { + indices[i] = i; + } + std::sort(indices, indices + count, [&row](int a, int b) -> bool { + return row.items.at(a)->maxWidth() < row.items.at(b)->maxWidth(); + }); + row.height = 0; - int32 availw = width() - st::inlineResultsLeft - st::inlineResultsSkip * (count - 1); - for (int32 i = 0; i < count; ++i) { - int32 w = sumWidth ? (row.items.at(i)->maxWidth() * availw / sumWidth) : row.items.at(i)->maxWidth(); - int32 actualw = qMax(w, int32(st::inlineResultsMinWidth)); - row.height = qMax(row.height, row.items.at(i)->resizeGetHeight(actualw)); + int availw = width() - st::inlineResultsLeft - st::inlineResultsSkip * (count - 1); + for (int i = 0; i < count; ++i) { + int index = indices[i]; + int w = sumWidth ? (row.items.at(index)->maxWidth() * availw / sumWidth) : row.items.at(index)->maxWidth(); + int actualw = qMax(w, int(st::inlineResultsMinWidth)); + row.height = qMax(row.height, row.items.at(index)->resizeGetHeight(actualw)); if (sumWidth) { availw -= actualw; - sumWidth -= row.items.at(i)->maxWidth(); + sumWidth -= row.items.at(index)->maxWidth(); } } return row; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 174b2506db..ab66e46394 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -8021,6 +8021,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) { drawPinnedBar(p); } if (_scroll.isHidden()) { + p.setClipRect(_scroll.geometry()); QPoint dogPos((width() - st::msgDogImg.pxWidth()) / 2, ((height() - _field.height() - 2 * st::sendPadding - st::msgDogImg.pxHeight()) * 4) / 9); p.drawPixmap(dogPos, *cChatDogImage()); } From 2876916258675141cdc9e56164110cffb6fbe7ed Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 20:56:12 +0300 Subject: [PATCH 251/316] beta 9034003 version --- Telegram/SourceFiles/config.h | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Version | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 4f0a5668a0..758dee9075 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9034; static const wchar_t *AppVersionStr = L"0.9.34"; static const bool DevVersion = false; -#define BETA_VERSION (9034002ULL) // just comment this line to build public version +#define BETA_VERSION (9034003ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 8485fe9cd2..cd7485bd72 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,34,2 - PRODUCTVERSION 0,9,34,2 + FILEVERSION 0,9,34,3 + PRODUCTVERSION 0,9,34,3 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.34.2" + VALUE "FileVersion", "0.9.34.3" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.34.2" + VALUE "ProductVersion", "0.9.34.3" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 1997f59694..9c03708041 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.34 AppVersionStr 0.9.34 DevChannel 0 -BetaVersion 9034002 +BetaVersion 9034003 From 55e8612f27e39171343b73e2202736d03042bf6d Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 21:12:30 +0300 Subject: [PATCH 252/316] fixed QtCreator build --- Telegram/SourceFiles/mtproto/connection_auto.cpp | 4 ++-- Telegram/Telegram.pro | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/connection_auto.cpp b/Telegram/SourceFiles/mtproto/connection_auto.cpp index 3723f495c3..74aa09baf9 100644 --- a/Telegram/SourceFiles/mtproto/connection_auto.cpp +++ b/Telegram/SourceFiles/mtproto/connection_auto.cpp @@ -255,7 +255,7 @@ void AutoConnection::requestFinished(QNetworkReply *reply) { void AutoConnection::socketPacket(const char *packet, uint32 length) { if (status == FinishedWork) return; - mtpBuffer data = TCPConnection::handleResponse(packet, length); + mtpBuffer data = AbstractTCPConnection::handleResponse(packet, length); if (data.size() == 1) { if (status == WaitingBoth) { status = WaitingHttp; @@ -326,7 +326,7 @@ QString AutoConnection::transport() const { void AutoConnection::socketError(QAbstractSocket::SocketError e) { if (status == FinishedWork) return; - TCPConnection::handleError(e, sock); + AbstractTCPConnection::handleError(e, sock); if (status == WaitingBoth) { status = WaitingHttp; } else if (status == HttpReady) { diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index b6242d3ed0..775839e3e8 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -117,6 +117,10 @@ SOURCES += \ ./SourceFiles/mtproto/facade.cpp \ ./SourceFiles/mtproto/auth_key.cpp \ ./SourceFiles/mtproto/connection.cpp \ + ./SourceFiles/mtproto/connection_abstract.cpp \ + ./SourceFiles/mtproto/connection_auto.cpp \ + ./SourceFiles/mtproto/connection_http.cpp \ + ./SourceFiles/mtproto/connection_tcp.cpp \ ./SourceFiles/mtproto/core_types.cpp \ ./SourceFiles/mtproto/dcenter.cpp \ ./SourceFiles/mtproto/file_download.cpp \ @@ -209,6 +213,10 @@ HEADERS += \ ./SourceFiles/mtproto/facade.h \ ./SourceFiles/mtproto/auth_key.h \ ./SourceFiles/mtproto/connection.h \ + ./SourceFiles/mtproto/connection_abstract.h \ + ./SourceFiles/mtproto/connection_auto.h \ + ./SourceFiles/mtproto/connection_http.h \ + ./SourceFiles/mtproto/connection_tcp.h \ ./SourceFiles/mtproto/core_types.h \ ./SourceFiles/mtproto/dcenter.h \ ./SourceFiles/mtproto/file_download.h \ From 0b6dea311b890431a6ce227c7bef5a89b5d08cb4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 23:34:47 +0300 Subject: [PATCH 253/316] scheme for new bot keyboards --- Telegram/SourceFiles/app.cpp | 16 ++ Telegram/SourceFiles/mtproto/scheme.tl | 6 +- Telegram/SourceFiles/mtproto/scheme_auto.cpp | 60 ++++- Telegram/SourceFiles/mtproto/scheme_auto.h | 252 +++++++++++++++++-- 4 files changed, 314 insertions(+), 20 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index e9d2bbe5c9..5c1e17c62b 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2450,6 +2450,22 @@ namespace App { case mtpc_keyboardButton: { btns.push_back(qs(b.at(j).c_keyboardButton().vtext)); } break; + + case mtpc_keyboardButtonCallback: { + + } break; + + case mtpc_keyboardButtonRequestGeoLocation: { + + } break; + + case mtpc_keyboardButtonRequestPhone: { + + } break; + + case mtpc_keyboardButtonUrl: { + + } break; } } if (!btns.isEmpty()) commands.push_back(btns); diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index e01da730da..120ad0b7f1 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -557,12 +557,16 @@ botCommand#c27ac8c7 command:string description:string = BotCommand; botInfo#98e81d3a user_id:int description:string commands:Vector = BotInfo; keyboardButton#a2fa4880 text:string = KeyboardButton; +keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton; +keyboardButtonCallback#2aae4183 text:string = KeyboardButton; +keyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton; +keyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton; keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow; replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup; replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup; -replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector = ReplyMarkup; +replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true inline:flags.3?true rows:Vector = ReplyMarkup; help.appChangelogEmpty#af7e0394 = help.AppChangelog; help.appChangelog#4668e6bd text:string = help.AppChangelog; diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.cpp b/Telegram/SourceFiles/mtproto/scheme_auto.cpp index 272945bd83..1fe0a87a4f 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.cpp +++ b/Telegram/SourceFiles/mtproto/scheme_auto.cpp @@ -4391,6 +4391,59 @@ void _serialize_keyboardButton(MTPStringLogger &to, int32 stage, int32 lev, Type } } +void _serialize_keyboardButtonUrl(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ keyboardButtonUrl"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" url: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_keyboardButtonCallback(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ keyboardButtonCallback"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_keyboardButtonRequestPhone(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ keyboardButtonRequestPhone"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + +void _serialize_keyboardButtonRequestGeoLocation(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) { + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ keyboardButtonRequestGeoLocation"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" text: "); ++stages.back(); types.push_back(mtpc_string+0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } +} + void _serialize_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); @@ -4451,7 +4504,8 @@ void _serialize_replyKeyboardMarkup(MTPStringLogger &to, int32 stage, int32 lev, 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; + case 4: to.add(" inline: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::Flag::f_inline) { to.add("YES [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break; + case 5: 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; } } @@ -8097,6 +8151,10 @@ namespace { _serializers.insert(mtpc_botCommand, _serialize_botCommand); _serializers.insert(mtpc_botInfo, _serialize_botInfo); _serializers.insert(mtpc_keyboardButton, _serialize_keyboardButton); + _serializers.insert(mtpc_keyboardButtonUrl, _serialize_keyboardButtonUrl); + _serializers.insert(mtpc_keyboardButtonCallback, _serialize_keyboardButtonCallback); + _serializers.insert(mtpc_keyboardButtonRequestPhone, _serialize_keyboardButtonRequestPhone); + _serializers.insert(mtpc_keyboardButtonRequestGeoLocation, _serialize_keyboardButtonRequestGeoLocation); _serializers.insert(mtpc_keyboardButtonRow, _serialize_keyboardButtonRow); _serializers.insert(mtpc_replyKeyboardHide, _serialize_replyKeyboardHide); _serializers.insert(mtpc_replyKeyboardForceReply, _serialize_replyKeyboardForceReply); diff --git a/Telegram/SourceFiles/mtproto/scheme_auto.h b/Telegram/SourceFiles/mtproto/scheme_auto.h index 69f6e33118..00a5ab2a6e 100644 --- a/Telegram/SourceFiles/mtproto/scheme_auto.h +++ b/Telegram/SourceFiles/mtproto/scheme_auto.h @@ -398,6 +398,10 @@ enum { mtpc_botCommand = 0xc27ac8c7, mtpc_botInfo = 0x98e81d3a, mtpc_keyboardButton = 0xa2fa4880, + mtpc_keyboardButtonUrl = 0x258aff05, + mtpc_keyboardButtonCallback = 0x2aae4183, + mtpc_keyboardButtonRequestPhone = 0xb16a6c29, + mtpc_keyboardButtonRequestGeoLocation = 0xfc796b3f, mtpc_keyboardButtonRow = 0x77608b83, mtpc_replyKeyboardHide = 0xa03e5b85, mtpc_replyKeyboardForceReply = 0xf4108aa0, @@ -1160,6 +1164,10 @@ class MTPDbotInfo; class MTPkeyboardButton; class MTPDkeyboardButton; +class MTPDkeyboardButtonUrl; +class MTPDkeyboardButtonCallback; +class MTPDkeyboardButtonRequestPhone; +class MTPDkeyboardButtonRequestGeoLocation; class MTPkeyboardButtonRow; class MTPDkeyboardButtonRow; @@ -7614,32 +7622,90 @@ typedef MTPBoxed MTPBotInfo; class MTPkeyboardButton : private mtpDataOwner { public: - MTPkeyboardButton(); - MTPkeyboardButton(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_keyboardButton) : mtpDataOwner(0) { + MTPkeyboardButton() : mtpDataOwner(0), _type(0) { + } + MTPkeyboardButton(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { read(from, end, cons); } MTPDkeyboardButton &_keyboardButton() { if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButton) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButton); split(); return *(MTPDkeyboardButton*)data; } const MTPDkeyboardButton &c_keyboardButton() const { if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButton) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButton); return *(const MTPDkeyboardButton*)data; } + MTPDkeyboardButtonUrl &_keyboardButtonUrl() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonUrl) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonUrl); + split(); + return *(MTPDkeyboardButtonUrl*)data; + } + const MTPDkeyboardButtonUrl &c_keyboardButtonUrl() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonUrl) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonUrl); + return *(const MTPDkeyboardButtonUrl*)data; + } + + MTPDkeyboardButtonCallback &_keyboardButtonCallback() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonCallback) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonCallback); + split(); + return *(MTPDkeyboardButtonCallback*)data; + } + const MTPDkeyboardButtonCallback &c_keyboardButtonCallback() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonCallback) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonCallback); + return *(const MTPDkeyboardButtonCallback*)data; + } + + MTPDkeyboardButtonRequestPhone &_keyboardButtonRequestPhone() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonRequestPhone) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonRequestPhone); + split(); + return *(MTPDkeyboardButtonRequestPhone*)data; + } + const MTPDkeyboardButtonRequestPhone &c_keyboardButtonRequestPhone() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonRequestPhone) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonRequestPhone); + return *(const MTPDkeyboardButtonRequestPhone*)data; + } + + MTPDkeyboardButtonRequestGeoLocation &_keyboardButtonRequestGeoLocation() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonRequestGeoLocation) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonRequestGeoLocation); + split(); + return *(MTPDkeyboardButtonRequestGeoLocation*)data; + } + const MTPDkeyboardButtonRequestGeoLocation &c_keyboardButtonRequestGeoLocation() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_keyboardButtonRequestGeoLocation) throw mtpErrorWrongTypeId(_type, mtpc_keyboardButtonRequestGeoLocation); + return *(const MTPDkeyboardButtonRequestGeoLocation*)data; + } + uint32 innerLength() const; mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_keyboardButton); + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); void write(mtpBuffer &to) const; typedef void ResponseType; private: + explicit MTPkeyboardButton(mtpTypeId type); explicit MTPkeyboardButton(MTPDkeyboardButton *_data); + explicit MTPkeyboardButton(MTPDkeyboardButtonUrl *_data); + explicit MTPkeyboardButton(MTPDkeyboardButtonCallback *_data); + explicit MTPkeyboardButton(MTPDkeyboardButtonRequestPhone *_data); + explicit MTPkeyboardButton(MTPDkeyboardButtonRequestGeoLocation *_data); friend class MTP::internal::TypeCreator; + + mtpTypeId _type; }; typedef MTPBoxed MTPKeyboardButton; @@ -12503,6 +12569,47 @@ public: MTPstring vtext; }; +class MTPDkeyboardButtonUrl : public mtpDataImpl { +public: + MTPDkeyboardButtonUrl() { + } + MTPDkeyboardButtonUrl(const MTPstring &_text, const MTPstring &_url) : vtext(_text), vurl(_url) { + } + + MTPstring vtext; + MTPstring vurl; +}; + +class MTPDkeyboardButtonCallback : public mtpDataImpl { +public: + MTPDkeyboardButtonCallback() { + } + MTPDkeyboardButtonCallback(const MTPstring &_text) : vtext(_text) { + } + + MTPstring vtext; +}; + +class MTPDkeyboardButtonRequestPhone : public mtpDataImpl { +public: + MTPDkeyboardButtonRequestPhone() { + } + MTPDkeyboardButtonRequestPhone(const MTPstring &_text) : vtext(_text) { + } + + MTPstring vtext; +}; + +class MTPDkeyboardButtonRequestGeoLocation : public mtpDataImpl { +public: + MTPDkeyboardButtonRequestGeoLocation() { + } + MTPDkeyboardButtonRequestGeoLocation(const MTPstring &_text) : vtext(_text) { + } + + MTPstring vtext; +}; + class MTPDkeyboardButtonRow : public mtpDataImpl { public: MTPDkeyboardButtonRow() { @@ -12561,8 +12668,9 @@ public: f_resize = (1 << 0), f_single_use = (1 << 1), f_selective = (1 << 2), + f_inline = (1 << 3), - MAX_FIELD = (1 << 2), + MAX_FIELD = (1 << 3), }; Q_DECLARE_FLAGS(Flags, Flag); friend inline Flags operator~(Flag v) { return QFlag(~static_cast(v)); } @@ -12570,6 +12678,7 @@ public: 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; } + bool is_inline() const { return vflags.v & Flag::f_inline; } MTPDreplyKeyboardMarkup() { } @@ -21936,6 +22045,18 @@ public: inline static MTPkeyboardButton new_keyboardButton(const MTPstring &_text) { return MTPkeyboardButton(new MTPDkeyboardButton(_text)); } + inline static MTPkeyboardButton new_keyboardButtonUrl(const MTPstring &_text, const MTPstring &_url) { + return MTPkeyboardButton(new MTPDkeyboardButtonUrl(_text, _url)); + } + inline static MTPkeyboardButton new_keyboardButtonCallback(const MTPstring &_text) { + return MTPkeyboardButton(new MTPDkeyboardButtonCallback(_text)); + } + inline static MTPkeyboardButton new_keyboardButtonRequestPhone(const MTPstring &_text) { + return MTPkeyboardButton(new MTPDkeyboardButtonRequestPhone(_text)); + } + inline static MTPkeyboardButton new_keyboardButtonRequestGeoLocation(const MTPstring &_text) { + return MTPkeyboardButton(new MTPDkeyboardButtonRequestGeoLocation(_text)); + } inline static MTPkeyboardButtonRow new_keyboardButtonRow(const MTPVector &_buttons) { return MTPkeyboardButtonRow(new MTPDkeyboardButtonRow(_buttons)); } @@ -30840,32 +30961,127 @@ inline MTPbotInfo MTP_botInfo(MTPint _user_id, const MTPstring &_description, co return MTP::internal::TypeCreator::new_botInfo(_user_id, _description, _commands); } -inline MTPkeyboardButton::MTPkeyboardButton() : mtpDataOwner(new MTPDkeyboardButton()) { -} - inline uint32 MTPkeyboardButton::innerLength() const { - const MTPDkeyboardButton &v(c_keyboardButton()); - return v.vtext.innerLength(); + switch (_type) { + case mtpc_keyboardButton: { + const MTPDkeyboardButton &v(c_keyboardButton()); + return v.vtext.innerLength(); + } + case mtpc_keyboardButtonUrl: { + const MTPDkeyboardButtonUrl &v(c_keyboardButtonUrl()); + return v.vtext.innerLength() + v.vurl.innerLength(); + } + case mtpc_keyboardButtonCallback: { + const MTPDkeyboardButtonCallback &v(c_keyboardButtonCallback()); + return v.vtext.innerLength(); + } + case mtpc_keyboardButtonRequestPhone: { + const MTPDkeyboardButtonRequestPhone &v(c_keyboardButtonRequestPhone()); + return v.vtext.innerLength(); + } + case mtpc_keyboardButtonRequestGeoLocation: { + const MTPDkeyboardButtonRequestGeoLocation &v(c_keyboardButtonRequestGeoLocation()); + return v.vtext.innerLength(); + } + } + return 0; } inline mtpTypeId MTPkeyboardButton::type() const { - return mtpc_keyboardButton; + if (!_type) throw mtpErrorUninitialized(); + return _type; } inline void MTPkeyboardButton::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_keyboardButton) throw mtpErrorUnexpected(cons, "MTPkeyboardButton"); - - if (!data) setData(new MTPDkeyboardButton()); - MTPDkeyboardButton &v(_keyboardButton()); - v.vtext.read(from, end); + if (cons != _type) setData(0); + switch (cons) { + case mtpc_keyboardButton: _type = cons; { + if (!data) setData(new MTPDkeyboardButton()); + MTPDkeyboardButton &v(_keyboardButton()); + v.vtext.read(from, end); + } break; + case mtpc_keyboardButtonUrl: _type = cons; { + if (!data) setData(new MTPDkeyboardButtonUrl()); + MTPDkeyboardButtonUrl &v(_keyboardButtonUrl()); + v.vtext.read(from, end); + v.vurl.read(from, end); + } break; + case mtpc_keyboardButtonCallback: _type = cons; { + if (!data) setData(new MTPDkeyboardButtonCallback()); + MTPDkeyboardButtonCallback &v(_keyboardButtonCallback()); + v.vtext.read(from, end); + } break; + case mtpc_keyboardButtonRequestPhone: _type = cons; { + if (!data) setData(new MTPDkeyboardButtonRequestPhone()); + MTPDkeyboardButtonRequestPhone &v(_keyboardButtonRequestPhone()); + v.vtext.read(from, end); + } break; + case mtpc_keyboardButtonRequestGeoLocation: _type = cons; { + if (!data) setData(new MTPDkeyboardButtonRequestGeoLocation()); + MTPDkeyboardButtonRequestGeoLocation &v(_keyboardButtonRequestGeoLocation()); + v.vtext.read(from, end); + } break; + default: throw mtpErrorUnexpected(cons, "MTPkeyboardButton"); + } } inline void MTPkeyboardButton::write(mtpBuffer &to) const { - const MTPDkeyboardButton &v(c_keyboardButton()); - v.vtext.write(to); + switch (_type) { + case mtpc_keyboardButton: { + const MTPDkeyboardButton &v(c_keyboardButton()); + v.vtext.write(to); + } break; + case mtpc_keyboardButtonUrl: { + const MTPDkeyboardButtonUrl &v(c_keyboardButtonUrl()); + v.vtext.write(to); + v.vurl.write(to); + } break; + case mtpc_keyboardButtonCallback: { + const MTPDkeyboardButtonCallback &v(c_keyboardButtonCallback()); + v.vtext.write(to); + } break; + case mtpc_keyboardButtonRequestPhone: { + const MTPDkeyboardButtonRequestPhone &v(c_keyboardButtonRequestPhone()); + v.vtext.write(to); + } break; + case mtpc_keyboardButtonRequestGeoLocation: { + const MTPDkeyboardButtonRequestGeoLocation &v(c_keyboardButtonRequestGeoLocation()); + v.vtext.write(to); + } break; + } } -inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButton *_data) : mtpDataOwner(_data) { +inline MTPkeyboardButton::MTPkeyboardButton(mtpTypeId type) : mtpDataOwner(0), _type(type) { + switch (type) { + case mtpc_keyboardButton: setData(new MTPDkeyboardButton()); break; + case mtpc_keyboardButtonUrl: setData(new MTPDkeyboardButtonUrl()); break; + case mtpc_keyboardButtonCallback: setData(new MTPDkeyboardButtonCallback()); break; + case mtpc_keyboardButtonRequestPhone: setData(new MTPDkeyboardButtonRequestPhone()); break; + case mtpc_keyboardButtonRequestGeoLocation: setData(new MTPDkeyboardButtonRequestGeoLocation()); break; + default: throw mtpErrorBadTypeId(type, "MTPkeyboardButton"); + } +} +inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButton *_data) : mtpDataOwner(_data), _type(mtpc_keyboardButton) { +} +inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButtonUrl *_data) : mtpDataOwner(_data), _type(mtpc_keyboardButtonUrl) { +} +inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButtonCallback *_data) : mtpDataOwner(_data), _type(mtpc_keyboardButtonCallback) { +} +inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButtonRequestPhone *_data) : mtpDataOwner(_data), _type(mtpc_keyboardButtonRequestPhone) { +} +inline MTPkeyboardButton::MTPkeyboardButton(MTPDkeyboardButtonRequestGeoLocation *_data) : mtpDataOwner(_data), _type(mtpc_keyboardButtonRequestGeoLocation) { } inline MTPkeyboardButton MTP_keyboardButton(const MTPstring &_text) { return MTP::internal::TypeCreator::new_keyboardButton(_text); } +inline MTPkeyboardButton MTP_keyboardButtonUrl(const MTPstring &_text, const MTPstring &_url) { + return MTP::internal::TypeCreator::new_keyboardButtonUrl(_text, _url); +} +inline MTPkeyboardButton MTP_keyboardButtonCallback(const MTPstring &_text) { + return MTP::internal::TypeCreator::new_keyboardButtonCallback(_text); +} +inline MTPkeyboardButton MTP_keyboardButtonRequestPhone(const MTPstring &_text) { + return MTP::internal::TypeCreator::new_keyboardButtonRequestPhone(_text); +} +inline MTPkeyboardButton MTP_keyboardButtonRequestGeoLocation(const MTPstring &_text) { + return MTP::internal::TypeCreator::new_keyboardButtonRequestGeoLocation(_text); +} inline MTPkeyboardButtonRow::MTPkeyboardButtonRow() : mtpDataOwner(new MTPDkeyboardButtonRow()) { } From a299c1f9e8ef1f19b69096fff7de306e28a33de4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 23:35:46 +0300 Subject: [PATCH 254/316] fixed upload of files --- Telegram/SourceFiles/mtproto/facade.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/facade.h b/Telegram/SourceFiles/mtproto/facade.h index 2c58d4d3fa..dfd5f22ad0 100644 --- a/Telegram/SourceFiles/mtproto/facade.h +++ b/Telegram/SourceFiles/mtproto/facade.h @@ -122,8 +122,9 @@ namespace internal { // send(req, callbacks, MTP::uplDcId(index)) - for upload shifted dc id // uploading always to the main dc so bareDcId == 0 -inline ShiftedDcId uplDcId(DcId dcId) { - return internal::uploadDcId(dcId, 0); +inline ShiftedDcId uplDcId(int index) { + t_assert(index >= 0 && index < MTPUploadSessionsCount); + return internal::uploadDcId(0, index); }; constexpr bool isUplDcId(ShiftedDcId shiftedDcId) { return (shiftedDcId >= internal::uploadDcId(0, 0)) && (shiftedDcId < internal::uploadDcId(0, MTPUploadSessionsCount - 1) + DCShift); From f227740e93faaa0182f21c3a6c8def6084a86f97 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Thu, 24 Mar 2016 23:56:21 +0100 Subject: [PATCH 255/316] Add new macros to travis Signed-off-by: Christoph Auer --- .travis.yml | 7 ++++--- .travis/build.sh | 12 ++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 11a9c3adbd..612e30f7ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,10 @@ language: cpp env: - BUILD_VERSION="" - - BUILD_VERSION="no_autoupdate" - - BUILD_VERSION="no_custom_scheme" - - BUILD_VERSION="no_autoupdate+no_custom_scheme" + - BUILD_VERSION="disable_autoupdate" + - BUILD_VERSION="disable_register_custom_scheme" + - BUILD_VERSION="disable_crash_reports" + - BUILD_VERSION="disable_network_proxy" arch: packages: diff --git a/.travis/build.sh b/.travis/build.sh index 62635d9701..ebbaeffc4a 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -82,14 +82,22 @@ prepare() { local options="" - if [[ $BUILD_VERSION == *"no_autoupdate"* ]]; then + if [[ $BUILD_VERSION == *"disable_autoupdate"* ]]; then options+="\nDEFINES += TDESKTOP_DISABLE_AUTOUPDATE" fi - if [[ $BUILD_VERSION == *"no_custom_scheme"* ]]; then + if [[ $BUILD_VERSION == *"disable_register_custom_scheme"* ]]; then options+="\nDEFINES += TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME" fi + if [[ $BUILD_VERSION == *"disable_crash_reports"* ]]; then + options+="\nDEFINES += TDESKTOP_DISABLE_CRASH_REPORTS" + fi + + if [[ $BUILD_VERSION == *"disable_network_proxy"* ]]; then + options+="\nDEFINES += TDESKTOP_DISABLE_NETWORK_PROXY" + fi + options+='\nINCLUDEPATH += "/usr/lib/glib-2.0/include"' options+='\nINCLUDEPATH += "/usr/lib/gtk-2.0/include"' options+='\nINCLUDEPATH += "/usr/include/opus"' From 599ede9a0b01f7b43e516f70dbd48cce684e614e Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 14:29:45 +0300 Subject: [PATCH 256/316] Beta 9034004 version: Some lang grammar fixes, all "audio" changed to "voice message" PeerData can have three loaded states (not loaded, minimal, full) Interface/Interfaces renamed to Component/Composer HistoryReply moved to a Component named HistoryMessageReply --- Telegram/Resources/lang.strings | 35 +- Telegram/SourceFiles/app.cpp | 86 +- Telegram/SourceFiles/app.h | 54 +- Telegram/SourceFiles/boxes/addcontactbox.cpp | 11 +- Telegram/SourceFiles/config.h | 2 +- Telegram/SourceFiles/gui/text.cpp | 53 +- Telegram/SourceFiles/gui/text.h | 10 +- Telegram/SourceFiles/history.cpp | 1017 ++++++++---------- Telegram/SourceFiles/history.h | 327 +++--- Telegram/SourceFiles/historywidget.cpp | 13 +- Telegram/SourceFiles/layout.cpp | 21 +- Telegram/SourceFiles/layout.h | 27 +- Telegram/SourceFiles/localstorage.cpp | 14 +- Telegram/SourceFiles/mainwidget.cpp | 16 +- Telegram/SourceFiles/overviewwidget.cpp | 5 +- Telegram/SourceFiles/structs.cpp | 18 +- Telegram/SourceFiles/structs.h | 129 ++- Telegram/SourceFiles/types.cpp | 49 +- Telegram/SourceFiles/types.h | 171 +-- Telegram/SourceFiles/window.cpp | 6 +- Telegram/Telegram.rc | 8 +- Telegram/Version | 2 +- 22 files changed, 1036 insertions(+), 1038 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 942d925826..c5b317fddd 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -663,9 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Loading...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Photo"; -"lng_in_dlg_video" = "Video"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "Contact"; -"lng_in_dlg_audio" = "Audio"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "File"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -720,28 +721,29 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_typing" = "{user} is typing"; "lng_users_typing" = "{user} and {second_user} are typing"; "lng_many_typing" = "{count:_not_used_|# is|# are} typing"; -"lng_send_action_record_video" = "recording video"; +"lng_send_action_record_video" = "recording a video"; "lng_user_action_record_video" = "{user} is recording a video"; -"lng_send_action_upload_video" = "sending video"; +"lng_send_action_upload_video" = "sending a video"; "lng_user_action_upload_video" = "{user} is sending a video"; -"lng_send_action_record_audio" = "recording audio"; -"lng_user_action_record_audio" = "{user} is recording an audio"; -"lng_send_action_upload_audio" = "sending audio"; -"lng_user_action_upload_audio" = "{user} is sending an audio"; -"lng_send_action_upload_photo" = "sending photo"; +"lng_send_action_record_audio" = "recording a voice message"; +"lng_user_action_record_audio" = "{user} is recording a voice message"; +"lng_send_action_upload_audio" = "sending a voice message"; +"lng_user_action_upload_audio" = "{user} is sending a voice message"; +"lng_send_action_upload_photo" = "sending a photo"; "lng_user_action_upload_photo" = "{user} is sending a photo"; -"lng_send_action_upload_file" = "sending file"; +"lng_send_action_upload_file" = "sending a file"; "lng_user_action_upload_file" = "{user} is sending a file"; -"lng_send_action_geo_location" = "picking location"; +"lng_send_action_geo_location" = "picking a location"; "lng_user_action_geo_location" = "{user} is picking a location"; -"lng_send_action_choose_contact" = "choosing contact"; +"lng_send_action_choose_contact" = "choosing a contact"; "lng_user_action_choose_contact" = "{user} is choosing a contact"; "lng_unread_bar" = "{count:_not_used_|# unread message|# unread messages}"; "lng_maps_point" = "Location"; "lng_save_photo" = "Save image"; -"lng_save_video" = "Save video"; -"lng_save_audio" = "Save audio"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "Save file"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -766,8 +768,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancel Download"; "lng_context_show_in_folder" = "Show in Folder"; "lng_context_show_in_finder" = "Show in Finder"; -"lng_context_save_video" = "Save Video As..."; -"lng_context_save_audio" = "Save Audio As..."; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "Pack Info"; "lng_context_pack_add" = "Add Stickers"; "lng_context_save_file" = "Save File As..."; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index e9d2bbe5c9..407ea84e96 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -478,7 +478,13 @@ namespace App { if (!data) continue; - data->loaded = true; + if (minimal) { + if (data->loadedStatus == PeerData::NotLoaded) { + data->loadedStatus = PeerData::MinimalLoaded; + } + } else if (data->loadedStatus != PeerData::FullLoaded) { + data->loadedStatus = PeerData::FullLoaded; + } if (status && !minimal) switch (status->type()) { case mtpc_userStatusEmpty: data->onlineTill = 0; break; case mtpc_userStatusRecently: @@ -655,7 +661,13 @@ namespace App { } if (!data) continue; - data->loaded = true; + if (minimal) { + if (data->loadedStatus == PeerData::NotLoaded) { + data->loadedStatus = PeerData::MinimalLoaded; + } + } else if (data->loadedStatus != PeerData::FullLoaded) { + data->loadedStatus = PeerData::FullLoaded; + } if (App::main()) { if (emitPeerUpdated) { App::main()->peerUpdated(data); @@ -1000,7 +1012,7 @@ namespace App { } void checkSavedGif(HistoryItem *item) { - if (!item->Is() && (item->out() || item->history()->peer == App::self())) { + if (!item->Has() && (item->out() || item->history()->peer == App::self())) { if (HistoryMedia *media = item->getMedia()) { if (DocumentData *doc = media->getDocument()) { if (doc->isGifv()) { @@ -1394,41 +1406,16 @@ namespace App { return 0; } - PeerData *peerLoaded(const PeerId &peer) { - PeersData::const_iterator i = peersData.constFind(peer); - return (i != peersData.cend()) ? i.value() : 0; - } - - UserData *userLoaded(const PeerId &id) { - PeerData *peer = peerLoaded(id); - return (peer && peer->loaded) ? peer->asUser() : 0; - } - ChatData *chatLoaded(const PeerId &id) { - PeerData *peer = peerLoaded(id); - return (peer && peer->loaded) ? peer->asChat() : 0; - } - ChannelData *channelLoaded(const PeerId &id) { - PeerData *peer = peerLoaded(id); - return (peer && peer->loaded) ? peer->asChannel() : 0; - } - UserData *userLoaded(int32 user_id) { - return userLoaded(peerFromUser(user_id)); - } - ChatData *chatLoaded(int32 chat_id) { - return chatLoaded(peerFromChat(chat_id)); - } - ChannelData *channelLoaded(int32 channel_id) { - return channelLoaded(peerFromChannel(channel_id)); - } - UserData *curUser() { return user(MTP::authedId()); } - PeerData *peer(const PeerId &id) { - PeersData::const_iterator i = peersData.constFind(id); + PeerData *peer(const PeerId &id, PeerData::LoadedStatus restriction) { + if (!id) return nullptr; + + auto i = peersData.constFind(id); if (i == peersData.cend()) { - PeerData *newData = 0; + PeerData *newData = nullptr; if (peerIsUser(id)) { newData = new UserData(id); } else if (peerIsChat(id)) { @@ -1436,33 +1423,26 @@ namespace App { } else if (peerIsChannel(id)) { newData = new ChannelData(id); } - if (!newData) return 0; + t_assert(newData != nullptr); newData->input = MTPinputPeer(MTP_inputPeerEmpty()); i = peersData.insert(id, newData); } + switch (restriction) { + case PeerData::MinimalLoaded: { + if (i.value()->loadedStatus == PeerData::NotLoaded) { + return nullptr; + } + } break; + case PeerData::FullLoaded: { + if (i.value()->loadedStatus != PeerData::FullLoaded) { + return nullptr; + } + } break; + } return i.value(); } - UserData *user(const PeerId &id) { - return peer(id)->asUser(); - } - ChatData *chat(const PeerId &id) { - return peer(id)->asChat(); - } - ChannelData *channel(const PeerId &id) { - return peer(id)->asChannel(); - } - UserData *user(int32 user_id) { - return user(peerFromUser(user_id)); - } - ChatData *chat(int32 chat_id) { - return chat(peerFromChat(chat_id)); - } - ChannelData *channel(int32 channel_id) { - return channel(peerFromChannel(channel_id)); - } - UserData *self() { return ::self; } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 77bd4e5b66..ebe1711e5f 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -110,21 +110,47 @@ namespace App { WebPageData *feedWebPage(const MTPDwebPagePending &webpage, WebPageData *convert = 0); WebPageData *feedWebPage(const MTPWebPage &webpage); - PeerData *peerLoaded(const PeerId &id); - UserData *userLoaded(const PeerId &id); - ChatData *chatLoaded(const PeerId &id); - ChannelData *channelLoaded(const PeerId &id); - UserData *userLoaded(int32 user); - ChatData *chatLoaded(int32 chat); - ChannelData *channelLoaded(int32 channel); + PeerData *peer(const PeerId &id, PeerData::LoadedStatus restriction = PeerData::NotLoaded); + inline UserData *user(const PeerId &id, PeerData::LoadedStatus restriction = PeerData::NotLoaded) { + return asUser(peer(id, restriction)); + } + inline ChatData *chat(const PeerId &id, PeerData::LoadedStatus restriction = PeerData::NotLoaded) { + return asChat(peer(id, restriction)); + } + inline ChannelData *channel(const PeerId &id, PeerData::LoadedStatus restriction = PeerData::NotLoaded) { + return asChannel(peer(id, restriction)); + } + inline UserData *user(UserId userId, PeerData::LoadedStatus restriction = PeerData::NotLoaded) { + return asUser(peer(peerFromUser(userId), restriction)); + } + inline ChatData *chat(ChatId chatId, PeerData::LoadedStatus restriction = PeerData::NotLoaded) { + return asChat(peer(peerFromChat(chatId), restriction)); + } + inline ChannelData *channel(ChannelId channelId, PeerData::LoadedStatus restriction = PeerData::NotLoaded) { + return asChannel(peer(peerFromChannel(channelId), restriction)); + } + inline PeerData *peerLoaded(const PeerId &id) { + return peer(id, PeerData::FullLoaded); + } + inline UserData *userLoaded(const PeerId &id) { + return user(id, PeerData::FullLoaded); + } + inline ChatData *chatLoaded(const PeerId &id) { + return chat(id, PeerData::FullLoaded); + } + inline ChannelData *channelLoaded(const PeerId &id) { + return channel(id, PeerData::FullLoaded); + } + inline UserData *userLoaded(UserId userId) { + return user(userId, PeerData::FullLoaded); + } + inline ChatData *chatLoaded(ChatId chatId) { + return chat(chatId, PeerData::FullLoaded); + } + inline ChannelData *channelLoaded(ChannelId channelId) { + return channel(channelId, PeerData::FullLoaded); + } - PeerData *peer(const PeerId &id); - UserData *user(const PeerId &id); - ChatData *chat(const PeerId &id); - ChannelData *channel(const PeerId &id); - UserData *user(int32 user_id); - ChatData *chat(int32 chat_id); - ChannelData *channel(int32 channel_id); UserData *self(); PeerData *peerByName(const QString &username); QString peerName(const PeerData *peer, bool forDialogs = false); diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index b3e1c85c77..53d9e5d808 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -224,18 +224,15 @@ void AddContactBox::onImportDone(const MTPcontacts_ImportedContacts &res) { App::feedUsers(d.vusers); const QVector &v(d.vimported.c_vector().v); - int32 uid = 0; + UserData *user = nullptr; if (!v.isEmpty()) { const MTPDimportedContact &c(v.front().c_importedContact()); if (c.vclient_id.v != _contactId) return; - uid = c.vuser_id.v; - if (uid && !App::userLoaded(uid)) { - uid = 0; - } + user = App::userLoaded(c.vuser_id.v); } - if (uid) { - Notify::userIsContactChanged(App::userLoaded(peerFromUser(uid)), true); + if (user) { + Notify::userIsContactChanged(user, true); Ui::hideLayer(); } else { _save.hide(); diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 758dee9075..6aad20f74c 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9034; static const wchar_t *AppVersionStr = L"0.9.34"; static const bool DevVersion = false; -#define BETA_VERSION (9034003ULL) // just comment this line to build public version +#define BETA_VERSION (9034004ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 30eab680e6..f350a1f3e3 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -2534,20 +2534,32 @@ Text::Text(style::font font, const QString &text, const TextParseOptions &option } } -Text::Text(const Text &other) : -_minResizeWidth(other._minResizeWidth), _maxWidth(other._maxWidth), -_minHeight(other._minHeight), -_text(other._text), -_font(other._font), -_blocks(other._blocks.size()), -_links(other._links), -_startDir(other._startDir) -{ +Text::Text(const Text &other) +: _minResizeWidth(other._minResizeWidth) +, _maxWidth(other._maxWidth) +, _minHeight(other._minHeight) +, _text(other._text) +, _font(other._font) +, _blocks(other._blocks.size()) +, _links(other._links) +, _startDir(other._startDir) { for (int32 i = 0, l = _blocks.size(); i < l; ++i) { _blocks[i] = other._blocks.at(i)->clone(); } } +Text::Text(Text &&other) +: _minResizeWidth(other._minResizeWidth) +, _maxWidth(other._maxWidth) +, _minHeight(other._minHeight) +, _text(other._text) +, _font(other._font) +, _blocks(other._blocks) +, _links(other._links) +, _startDir(other._startDir) { + other.clearFields(); +} + Text &Text::operator=(const Text &other) { _minResizeWidth = other._minResizeWidth; _maxWidth = other._maxWidth; @@ -2563,10 +2575,23 @@ Text &Text::operator=(const Text &other) { return *this; } +Text &Text::operator=(Text &&other) { + _minResizeWidth = other._minResizeWidth; + _maxWidth = other._maxWidth; + _minHeight = other._minHeight; + _text = other._text; + _font = other._font; + _blocks = other._blocks; + _links = other._links; + _startDir = other._startDir; + other.clearFields(); + return *this; +} + void Text::setText(style::font font, const QString &text, const TextParseOptions &options) { if (!_textStyle) _initDefault(); _font = font; - clean(); + clear(); { TextParser parser(this, text, options); } @@ -2644,7 +2669,7 @@ void Text::recountNaturalSize(bool initial, Qt::LayoutDirection optionsDir) { void Text::setMarkedText(style::font font, const QString &text, const EntitiesInText &entities, const TextParseOptions &options) { if (!_textStyle) _initDefault(); _font = font; - clean(); + clear(); { // QString newText; // utf16 of the text for emoji // newText.reserve(8 * text.size()); @@ -3216,10 +3241,14 @@ EntitiesInText Text::originalEntities() const { return result; } -void Text::clean() { +void Text::clear() { for (TextBlocks::iterator i = _blocks.begin(), e = _blocks.end(); i != e; ++i) { delete *i; } + clearFields(); +} + +void Text::clearFields() { _blocks.clear(); _links.clear(); _maxWidth = _minHeight = 0; diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index d78f20cf57..7cb1e23a08 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -598,7 +598,9 @@ public: Text(int32 minResizeWidth = QFIXED_MAX); Text(style::font font, const QString &text, const TextParseOptions &options = _defaultOptions, int32 minResizeWidth = QFIXED_MAX, bool richText = false); Text(const Text &other); + Text(Text &&other); Text &operator=(const Text &other); + Text &operator=(Text &&other); int32 countWidth(int32 width) const; int32 countHeight(int32 width) const; @@ -686,15 +688,19 @@ public: return true; } - void clean(); + void clear(); ~Text() { - clean(); + clear(); } private: void recountNaturalSize(bool initial, Qt::LayoutDirection optionsDir = Qt::LayoutDirectionAuto); + // clear() deletes all blocks and calls this method + // it is also called from move constructor / assignment operator + void clearFields(); + QFixed _minResizeWidth, _maxWidth; int32 _minHeight; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index fd5a698d14..b04fb0b06d 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -75,12 +75,6 @@ namespace { _webpageDescriptionOptions.maxh = st::webPageDescriptionFont->height * 3; } - inline HistoryReply *toHistoryReply(HistoryItem *item) { - return item ? item->toHistoryReply() : 0; - } - inline const HistoryReply *toHistoryReply(const HistoryItem *item) { - return item ? item->toHistoryReply() : 0; - } inline const TextParseOptions &itemTextOptions(HistoryItem *item) { return itemTextOptions(item->history(), item->author()); } @@ -1235,7 +1229,7 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, switch (msg.type()) { case mtpc_messageEmpty: - result = HistoryServiceMessage::create(this, msg.c_messageEmpty().vid.v, date(), lang(lng_message_empty)); + result = HistoryService::create(this, msg.c_messageEmpty().vid.v, date(), lang(lng_message_empty)); break; case mtpc_message: { @@ -1287,15 +1281,11 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, 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 = HistoryMessage::create(this, 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.vreply_to_msg_id.v, m.vvia_bot_id.v, date(m.vdate), m.vfrom_id.v, text, entities); } else if (badMedia) { - 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); + result = HistoryService::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); - } else { - result = HistoryMessage::create(this, m); - } + result = HistoryMessage::create(this, m); if (m.has_reply_markup()) { App::feedReplyMarkup(channelId(), msgId, m.vreply_markup); } @@ -1304,7 +1294,7 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, case mtpc_messageService: { const MTPDmessageService &d(msg.c_messageService()); - result = HistoryServiceMessage::create(this, d); + result = HistoryService::create(this, d); if (applyServiceAction) { const MTPmessageAction &action(d.vaction); @@ -1424,12 +1414,12 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, peer->asChat()->flags |= MTPDchat::Flag::f_deactivated; //const MTPDmessageActionChatMigrateTo &d(action.c_messageActionChatMigrateTo()); - //PeerData *channel = App::peerLoaded(peerFromChannel(d.vchannel_id)); + //PeerData *channel = App::channelLoaded(d.vchannel_id.v); } break; case mtpc_messageActionChannelMigrateFrom: { //const MTPDmessageActionChannelMigrateFrom &d(action.c_messageActionChannelMigrateFrom()); - //PeerData *chat = App::peerLoaded(peerFromChat(d.vchat_id)); + //PeerData *chat = App::chatLoaded(d.vchat_id.v); } break; case mtpc_messageActionPinMessage: { @@ -1455,21 +1445,15 @@ HistoryItem *History::createItemForwarded(MsgId id, MTPDmessage::Flags flags, QD } 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); + return HistoryMessage::create(this, id, flags, replyTo, viaBotId, date, from, doc, caption); } 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); + return HistoryMessage::create(this, id, flags, replyTo, viaBotId, date, from, photo, caption); } HistoryItem *History::addNewService(MsgId msgId, QDateTime date, const QString &text, MTPDmessage::Flags flags, HistoryMedia *media, bool newMsg) { - return addNewItem(HistoryServiceMessage::create(this, msgId, date, text, flags, media), newMsg); + return addNewItem(HistoryService::create(this, msgId, date, text, flags, media), newMsg); } HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type) { @@ -2723,9 +2707,6 @@ void HistoryDependentItemCallback::call(ChannelData *channel, MsgId msgId) const } } -HistoryMessageUnreadBar::HistoryMessageUnreadBar(Interfaces*) : _width(0), _freezed(false) { -} - void HistoryMessageUnreadBar::init(int count) { if (_freezed) return; _text = lng_unread_bar(lt_count, count); @@ -2752,9 +2733,6 @@ void HistoryMessageUnreadBar::paint(Painter &p, int y, int w) const { 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::msgServiceFont->width(_text); @@ -2835,13 +2813,13 @@ void HistoryItem::detachFast() { void HistoryItem::previousItemChanged() { if (displayDate()) { - if (!Is()) { - AddInterfaces(HistoryMessageDate::Bit()); + if (!Has()) { + AddComponents(HistoryMessageDate::Bit()); Get()->init(date); setPendingInitDimensions(); } - } else if (Is()) { - RemoveInterfaces(HistoryMessageDate::Bit()); + } else if (Has()) { + RemoveComponents(HistoryMessageDate::Bit()); setPendingInitDimensions(); } @@ -2850,7 +2828,7 @@ void HistoryItem::previousItemChanged() { void HistoryItem::recountAttachToPrevious() { bool attach = false; - if (!isPost() && !Is() && !Is()) { + if (!isPost() && !Has() && !Has()) { if (HistoryItem *prev = previous()) { attach = !prev->isPost() && !prev->serviceMsg() && prev->from() == from() && qAbs(prev->date.secsTo(date)) < AttachMessageToPreviousSecondsDelta; } @@ -2875,7 +2853,7 @@ bool HistoryItem::canEdit(const QDateTime &cur) const { if (!channel || id < 0 || date.secsTo(cur) >= Global::EditTimeLimit()) return false; if (const HistoryMessage *msg = toHistoryMessage()) { - if (msg->Is() || msg->Is()) return false; + if (msg->Has() || msg->Has()) return false; if (HistoryMedia *media = msg->getMedia()) { HistoryMediaType t = media->type(); @@ -2898,8 +2876,8 @@ bool HistoryItem::canEdit(const QDateTime &cur) const { } void HistoryItem::destroyUnreadBar() { - if (Is()) { - RemoveInterfaces(HistoryMessageUnreadBar::Bit()); + if (Has()) { + RemoveComponents(HistoryMessageUnreadBar::Bit()); setPendingInitDimensions(); if (_history->unreadBar == this) { _history->unreadBar = nullptr; @@ -2912,8 +2890,8 @@ void HistoryItem::destroyUnreadBar() { void HistoryItem::setUnreadBarCount(int count) { if (count > 0) { HistoryMessageUnreadBar *bar; - if (!Is()) { - AddInterfaces(HistoryMessageUnreadBar::Bit()); + if (!Has()) { + AddComponents(HistoryMessageUnreadBar::Bit()); setPendingInitDimensions(); recountAttachToPrevious(); @@ -3795,15 +3773,15 @@ void HistoryDocumentVoice::ensurePlayback(const HistoryDocument *that) const { void HistoryDocumentVoice::checkPlaybackFinished() const { if (_playback && !_playback->_a_progress.animating()) { delete _playback; - _playback = 0; + _playback = nullptr; } } HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() -, _parent(0) +, _parent(nullptr) , _data(document) { createInterfaces(!caption.isEmpty()); - if (HistoryDocumentNamed *named = Get()) { + if (auto *named = Get()) { named->_name = documentName(_data); named->_namew = st::semiboldFont->width(named->_name); } @@ -3812,21 +3790,21 @@ HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, setStatusSize(FileStatusSizeReady); - if (HistoryDocumentCaptioned *captioned = Get()) { + if (auto *captioned = Get()) { captioned->_caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent)); } } HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedia() -, Interfaces() -, _parent(0) +, Composer() +, _parent(nullptr) , _data(other._data) { - const HistoryDocumentCaptioned *captioned = other.Get(); + auto *captioned = other.Get(); createInterfaces(captioned != 0); - if (HistoryDocumentNamed *named = Get()) { - if (const HistoryDocumentNamed *oin = other.Get()) { - named->_name = oin->_name; - named->_namew = oin->_namew; + if (auto *named = Get()) { + if (auto *othernamed = other.Get()) { + named->_name = othernamed->_name; + named->_namew = othernamed->_namew; } else { named->_name = documentName(_data); named->_namew = st::semiboldFont->width(named->_name); @@ -3855,8 +3833,8 @@ void HistoryDocument::createInterfaces(bool caption) { if (caption) { mask |= HistoryDocumentCaptioned::Bit(); } - UpdateInterfaces(mask); - if (HistoryDocumentThumbed *thumbed = Get()) { + UpdateComponents(mask); + if (auto *thumbed = Get()) { thumbed->_linksavel.reset(new DocumentSaveLink(_data)); thumbed->_linkcancell.reset(new DocumentCancelLink(_data)); } @@ -3865,12 +3843,12 @@ void HistoryDocument::createInterfaces(bool caption) { void HistoryDocument::initDimensions(const HistoryItem *parent) { _parent = parent; - HistoryDocumentCaptioned *captioned = Get(); + auto *captioned = Get(); if (captioned && captioned->_caption.hasSkipBlock()) { captioned->_caption.setSkipBlock(parent->skipBlockWidth(), parent->skipBlockHeight()); } - HistoryDocumentThumbed *thumbed = Get(); + auto *thumbed = Get(); if (thumbed) { _data->thumb->load(); int32 tw = convertScale(_data->thumb->width()), th = convertScale(_data->thumb->height()); @@ -3895,14 +3873,14 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) { _maxw = qMax(_maxw, tleft + documentMaxStatusWidth(_data) + unread + parent->skipBlockWidth() + st::msgPadding.right()); } - if (HistoryDocumentNamed *named = Get()) { + if (auto *named = Get()) { _maxw = qMax(tleft + named->_namew + tright, _maxw); _maxw = qMin(_maxw, int(st::msgMaxWidth)); } if (thumbed) { _minh = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); - if (!captioned && parent->Is()) { + if (!captioned && parent->Has()) { _minh += st::msgDateFont->height - st::msgDateDelta.y(); } } else { @@ -3917,7 +3895,7 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) { } int32 HistoryDocument::resize(int32 width, const HistoryItem *parent) { - HistoryDocumentCaptioned *captioned = Get(); + auto *captioned = Get(); if (!captioned) { return HistoryFileMedia::resize(width, parent); } @@ -3953,7 +3931,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r bool radial = isRadialAnimation(ms); int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0, bottom = 0; - if (const HistoryDocumentThumbed *thumbed = Get()) { + if (auto *thumbed = Get()) { nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); nametop = st::msgFileThumbNameTop; nameright = st::msgFileThumbPadding.left(); @@ -4061,7 +4039,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r } int32 namewidth = _width - nameleft - nameright; - if (const HistoryDocumentVoice *voice = Get()) { + if (auto *voice = Get()) { const VoiceWaveform *wf = 0; uchar norm_value = 0; if (_data->voice()) { @@ -4120,7 +4098,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r sum_i += bar_count; } } - } else if (const HistoryDocumentNamed *named = Get()) { + } else if (auto *named = Get()) { p.setFont(st::semiboldFont); p.setPen(st::black); if (namewidth < named->_namew) { @@ -4147,7 +4125,7 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r } } - if (const HistoryDocumentCaptioned *captioned = Get()) { + if (auto *captioned = Get()) { p.setPen(st::black); captioned->_caption.draw(p, st::msgPadding.left(), bottom, captionw); } @@ -4162,7 +4140,7 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 bool showPause = updateStatusText(parent); int32 nameleft = 0, nametop = 0, nameright = 0, statustop = 0, linktop = 0, bottom = 0; - if (const HistoryDocumentThumbed *thumbed = Get()) { + if (auto *thumbed = Get()) { nameleft = st::msgFileThumbPadding.left() + st::msgFileThumbSize + st::msgFileThumbPadding.right(); linktop = st::msgFileThumbLinkTop; bottom = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); @@ -4191,7 +4169,7 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 } int32 height = _height; - if (const HistoryDocumentCaptioned *captioned = Get()) { + if (auto *captioned = Get()) { if (y >= bottom) { bool inText = false; captioned->_caption.getState(lnk, inText, x - st::msgPadding.left(), y - bottom, _width - st::msgPadding.left() - st::msgPadding.right()); @@ -4208,13 +4186,15 @@ void HistoryDocument::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 const QString HistoryDocument::inDialogsText() const { QString result; - if (Get()) { + if (Has()) { result = lang(lng_in_dlg_audio); + } else if (_data->song()) { + result = lang(lng_in_dlg_audio_file); } else { - const HistoryDocumentNamed *named = Get(); + auto *named = Get(); result = (!named || named->_name.isEmpty()) ? lang(lng_in_dlg_file) : named->_name; } - if (const HistoryDocumentCaptioned *captioned = Get()) { + if (auto *captioned = Get()) { if (!captioned->_caption.isEmpty()) { result.append(' ').append(captioned->_caption.original(0, 0xFFFF, Text::ExpandLinksNone)); } @@ -4223,24 +4203,31 @@ const QString HistoryDocument::inDialogsText() const { } const QString HistoryDocument::inHistoryText() const { - QString result = qsl("[ ") + lang(Get() ? lng_in_dlg_audio : lng_in_dlg_file); - if (const HistoryDocumentNamed *named = Get()) { + QString result; + if (Has()) { + result = lang(lng_in_dlg_audio); + } else if (_data->song()) { + result = lang(lng_in_dlg_audio_file); + } else { + result = lang(lng_in_dlg_file); + } + if (auto *named = Get()) { if (!named->_name.isEmpty()) { result.append(qsl(" : ")).append(named->_name); } } - if (const HistoryDocumentCaptioned *captioned = Get()) { + if (auto *captioned = Get()) { if (!captioned->_caption.isEmpty()) { result.append(qsl(", ")).append(captioned->_caption.original(0, 0xFFFF, Text::ExpandLinksAll)); } } - return result.append(qsl(" ]")); + return qsl("[ ") + result.append(qsl(" ]")); } void HistoryDocument::setStatusSize(int32 newSize, qint64 realDuration) const { int32 duration = _data->song() ? _data->song()->duration : (_data->voice() ? _data->voice()->duration : -1); HistoryFileMedia::setStatusSize(newSize, _data->size, duration, realDuration); - if (const HistoryDocumentThumbed *thumbed = Get()) { + if (auto *thumbed = Get()) { if (_statusSize == FileStatusSizeReady) { thumbed->_link = lang(lng_media_download).toUpper(); } else if (_statusSize == FileStatusSizeLoaded) { @@ -4276,7 +4263,7 @@ bool HistoryDocument::updateStatusText(const HistoryItem *parent) const { } if (playing.msgId == parent->fullId() && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { - if (const HistoryDocumentVoice *voice = Get()) { + if (auto *voice = Get()) { bool was = voice->_playback; voice->ensurePlayback(this); if (!was || playingPosition != voice->_playback->_position) { @@ -4296,7 +4283,7 @@ bool HistoryDocument::updateStatusText(const HistoryItem *parent) const { showPause = (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting); } else { statusSize = FileStatusSizeLoaded; - if (const HistoryDocumentVoice *voice = Get()) { + if (auto *voice = Get()) { voice->checkPlaybackFinished(); } } @@ -4332,7 +4319,7 @@ bool HistoryDocument::updateStatusText(const HistoryItem *parent) const { } void HistoryDocument::step_voiceProgress(float64 ms, bool timer) { - if (HistoryDocumentVoice *voice = Get()) { + if (auto *voice = Get()) { if (voice->_playback) { float64 dt = ms / (2 * AudioVoiceMsgUpdateView); if (dt >= 1) { @@ -4372,12 +4359,12 @@ ImagePtr HistoryDocument::replyPreview() { } HistoryGif::HistoryGif(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() -, _parent(0) +, _parent(nullptr) , _data(document) , _thumbw(1) , _thumbh(1) , _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) -, _gif(0) { +, _gif(nullptr) { setLinks(new GifOpenLink(_data), new GifOpenLink(_data), new DocumentCancelLink(_data)); setStatusSize(FileStatusSizeReady); @@ -4390,12 +4377,12 @@ HistoryGif::HistoryGif(DocumentData *document, const QString &caption, const His } HistoryGif::HistoryGif(const HistoryGif &other) : HistoryFileMedia() -, _parent(0) +, _parent(nullptr) , _data(other._data) , _thumbw(other._thumbw) , _thumbh(other._thumbh) , _caption(other._caption) -, _gif(0) { +, _gif(nullptr) { setLinks(new GifOpenLink(_data), new GifOpenLink(_data), new DocumentCancelLink(_data)); setStatusSize(other._statusSize); @@ -4783,7 +4770,7 @@ void HistorySticker::initDimensions(const HistoryItem *parent) { if (_pixh < 1) _pixh = 1; _maxw = qMax(_pixw, int16(st::minPhotoSize)); _minh = qMax(_pixh, int16(st::minPhotoSize)); - if (const HistoryReply *reply = toHistoryReply(parent)) { + if (auto *reply = parent->Get()) { _maxw += st::msgReplyPadding.left() + reply->replyToWidth(); } _height = _minh; @@ -4791,10 +4778,10 @@ void HistorySticker::initDimensions(const HistoryItem *parent) { int32 HistorySticker::resize(int32 width, const HistoryItem *parent) { // return new height _width = qMin(width, _maxw); - if (const HistoryReply *reply = toHistoryReply(parent)) { + if (auto *reply = parent->Get()) { int32 usew = _maxw - st::msgReplyPadding.left() - reply->replyToWidth(); int32 rw = _width - usew - st::msgReplyPadding.left() - st::msgReplyPadding.left() - st::msgReplyPadding.right(); - reply->resizeVia(rw); + reply->resize(rw); } return _height; } @@ -4808,7 +4795,7 @@ void HistorySticker::draw(Painter &p, const HistoryItem *parent, const QRect &r, bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 usew = _maxw, usex = 0; - const HistoryReply *reply = toHistoryReply(parent); + auto *reply = parent->Get(); if (reply) { usew -= st::msgReplyPadding.left() + reply->replyToWidth(); if (isPost) { @@ -4842,7 +4829,11 @@ void HistorySticker::draw(Painter &p, const HistoryItem *parent, const QRect &r, App::roundRect(p, rx, ry, rw, rh, selected ? App::msgServiceSelectBg() : App::msgServiceBg(), selected ? ServiceSelectedCorners : ServiceCorners); - reply->drawReplyTo(p, rx + st::msgReplyPadding.left(), ry, rw - st::msgReplyPadding.left() - st::msgReplyPadding.right(), selected, true); + HistoryMessageReply::PaintFlags flags = 0; + if (selected) { + flags |= HistoryMessageReply::PaintSelected; + } + reply->paint(p, parent, rx + st::msgReplyPadding.left(), ry, rw - st::msgReplyPadding.left() - st::msgReplyPadding.right(), flags); } } } @@ -4853,7 +4844,7 @@ void HistorySticker::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 bool out = parent->out(), isPost = parent->isPost(), outbg = out && !isPost; int32 usew = _maxw, usex = 0; - const HistoryReply *reply = toHistoryReply(parent); + auto *reply = parent->Get(); if (reply) { usew -= reply->replyToWidth(); if (isPost) { @@ -5782,7 +5773,7 @@ void HistoryLocation::initDimensions(const HistoryItem *parent) { _minh += st::mediaPadding.top() + st::mediaPadding.bottom(); if (!_title.isEmpty() || !_description.isEmpty()) { _minh += st::webPagePhotoSkip; - if (!parent->Is() && !parent->toHistoryReply()) { + if (!parent->Has() && !parent->Has()) { _minh += st::msgPadding.top(); } } @@ -5822,7 +5813,7 @@ int32 HistoryLocation::resize(int32 width, const HistoryItem *parent) { } if (!_title.isEmpty() || !_description.isEmpty()) { _height += st::webPagePhotoSkip; - if (!parent->Is() && !parent->toHistoryReply()) { + if (!parent->Has() && !parent->Has()) { _height += st::msgPadding.top(); } } @@ -5841,7 +5832,7 @@ void HistoryLocation::draw(Painter &p, const HistoryItem *parent, const QRect &r skipy = st::mediaPadding.top(); if (!_title.isEmpty() || !_description.isEmpty()) { - if (!parent->Is() && !parent->toHistoryReply()) { + if (!parent->Has() && !parent->Has()) { skipy += st::msgPadding.top(); } } @@ -5904,7 +5895,7 @@ void HistoryLocation::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 skipy = st::mediaPadding.top(); if (!_title.isEmpty() || !_description.isEmpty()) { - if (!parent->Is() && !parent->toHistoryReply()) { + if (!parent->Has() && !parent->Has()) { skipy += st::msgPadding.top(); } } @@ -5956,12 +5947,6 @@ void ViaInlineBotLink::onClick(Qt::MouseButton button) const { App::insertBotCommand('@' + _bot->username); } -HistoryMessageVia::HistoryMessageVia(Interfaces *) -: _bot(0) -, _width(0) -, _maxWidth(0) { -} - void HistoryMessageVia::create(int32 userId) { _bot = App::user(peerFromUser(userId)); _maxWidth = st::msgServiceNameFont->width(lng_inline_bot_via(lt_inline_bot, '@' + _bot->username)); @@ -5983,14 +5968,6 @@ void HistoryMessageVia::resize(int32 availw) const { } } -HistoryMessageViews::HistoryMessageViews(Interfaces *) -: _views(0) -, _viewsWidth(0) { -} - -HistoryMessageSigned::HistoryMessageSigned(Interfaces *) { -} - void HistoryMessageSigned::create(UserData *from, const QDateTime &date) { QString time = qsl(", ") + date.toString(cTimeFormat()), name = App::peerName(from); int32 timew = st::msgDateFont->width(time), namew = st::msgDateFont->width(name); @@ -6000,17 +5977,10 @@ void HistoryMessageSigned::create(UserData *from, const QDateTime &date) { _signature.setText(st::msgDateFont, name + time, _textNameOptions); } -int32 HistoryMessageSigned::maxWidth() const { +int HistoryMessageSigned::maxWidth() const { return _signature.maxWidth(); } -HistoryMessageForwarded::HistoryMessageForwarded(Interfaces *) -: _authorOriginal(0) -, _fromOriginal(0) -, _originalId(0) -, _text(1) { -} - void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { QString text; if (_authorOriginal != _fromOriginal) { @@ -6041,8 +6011,150 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const { } } -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) { +bool HistoryMessageReply::updateData(HistoryMessage *holder, bool force) { + if (!force) { + if (replyToMsg || !replyToMsgId) { + return true; + } + } + if (!replyToMsg) { + replyToMsg = App::histItemById(holder->channelId(), replyToMsgId); + if (replyToMsg) { + App::historyRegDependency(holder, replyToMsg); + } + } + + if (replyToMsg) { + replyToText.setText(st::msgFont, replyToMsg->inReplyText(), _textDlgOptions); + + updateName(); + + replyToLnk = TextLinkPtr(new MessageLink(replyToMsg->history()->peer->id, replyToMsg->id)); + if (!replyToMsg->Has()) { + if (UserData *bot = replyToMsg->viaBot()) { + _replyToVia = new HistoryMessageVia(0); + _replyToVia->create(peerToUser(bot->id)); + } + } + } else if (force) { + replyToMsgId = 0; + } + if (force) { + holder->setPendingInitDimensions(); + } + return (replyToMsg || !replyToMsgId); +} + +void HistoryMessageReply::clearData(HistoryMessage *holder) { + delete _replyToVia; + _replyToVia = nullptr; + if (replyToMsg) { + App::historyUnregDependency(holder, replyToMsg); + replyToMsg = nullptr; + } + replyToMsgId = 0; +} + +void HistoryMessageReply::checkNameUpdate() const { + if (replyToMsg && replyToMsg->author()->nameVersion > replyToVersion) { + updateName(); + } +} + +void HistoryMessageReply::updateName() const { + if (replyToMsg) { + QString name = (_replyToVia && replyToMsg->author()->isUser()) ? replyToMsg->author()->asUser()->firstName : App::peerName(replyToMsg->author()); + replyToName.setText(st::msgServiceNameFont, name, _textNameOptions); + replyToVersion = replyToMsg->author()->nameVersion; + bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; + int32 previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; + int32 w = replyToName.maxWidth(); + if (_replyToVia) { + w += st::msgServiceFont->spacew + _replyToVia->_maxWidth; + } + + _maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize))); + } else { + _maxReplyWidth = st::msgDateFont->width(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message)); + } + _maxReplyWidth = st::msgReplyPadding.left() + st::msgReplyBarSkip + _maxReplyWidth + st::msgReplyPadding.right(); +} + +void HistoryMessageReply::resize(int width) const { + if (_replyToVia) { + bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; + int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; + _replyToVia->resize(width - st::msgReplyBarSkip - previewSkip - replyToName.maxWidth() - st::msgServiceFont->spacew); + } +} + +void HistoryMessageReply::itemRemoved(HistoryMessage *holder, HistoryItem *removed) { + if (replyToMsg == removed) { + clearData(holder); + holder->setPendingInitDimensions(); + } +} + +void HistoryMessageReply::paint(Painter &p, const HistoryItem *holder, int x, int y, int w, PaintFlags flags) const { + bool selected = (flags & PaintSelected), outbg = holder->hasOutLayout(); + + style::color bar; + if (flags & PaintInBubble) { + bar = ((flags & PaintSelected) ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor)); + } else { + bar = st::white; + } + QRect rbar(rtlrect(x + st::msgReplyBarPos.x(), y + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.width(), st::msgReplyBarSize.height(), w + 2 * x)); + p.fillRect(rbar, bar); + + if (w > st::msgReplyBarSkip) { + if (replyToMsg) { + bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; + int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; + + if (hasPreview) { + ImagePtr replyPreview = replyToMsg->getMedia()->replyPreview(); + if (!replyPreview->isNull()) { + QRect to(rtlrect(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height(), w + 2 * x)); + p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height())); + if (selected) { + App::roundRect(p, to, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); + } + } + } + if (w > st::msgReplyBarSkip + previewSkip) { + if (flags & PaintInBubble) { + p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); + } else { + p.setPen(st::white); + } + replyToName.drawLeftElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top(), w - st::msgReplyBarSkip - previewSkip, w + 2 * x); + if (_replyToVia && w > st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew) { + p.setFont(st::msgServiceFont); + p.drawText(x + st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew, y + st::msgReplyPadding.top() + st::msgServiceFont->ascent, _replyToVia->_text); + } + + HistoryMessage *replyToAsMsg = replyToMsg->toHistoryMessage(); + if (!(flags & PaintInBubble)) { + } else if ((replyToAsMsg && replyToAsMsg->emptyText()) || replyToMsg->serviceMsg()) { + style::color date(outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg)); + p.setPen(date); + } else { + p.setPen(st::msgColor); + } + replyToText.drawLeftElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top() + st::msgServiceNameFont->height, w - st::msgReplyBarSkip - previewSkip, w + 2 * x); + } + } else { + p.setFont(st::msgDateFont); + style::color date(outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg)); + p.setPen((flags & PaintInBubble) ? date : st::white); + p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message), w - st::msgReplyBarSkip)); + } + } +} + +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) { PeerId authorOriginalId = 0, fromOriginalId = 0; MsgId originalId = 0; if (msg.has_fwd_from() && msg.vfwd_from.type() == mtpc_messageFwdHeader) { @@ -6053,7 +6165,10 @@ HistoryMessage::HistoryMessage(History *history, const MTPDmessage &msg) : if (f.has_channel_post()) originalId = f.vchannel_post.v; } } - createInterfaces(msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0, msg.has_views() ? msg.vviews.v : -1, authorOriginalId, fromOriginalId, originalId); + MsgId replyTo = msg.has_reply_to_msg_id() ? msg.vreply_to_msg_id.v : 0; + int32 viaBotId = msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0; + int views = msg.has_views() ? msg.vviews.v : -1; + createInterfaces(replyTo, viaBotId, views, authorOriginalId, fromOriginalId, originalId); QString text(textClean(qs(msg.vmessage))); initMedia(msg.has_media() ? (&msg.vmedia) : 0, text); @@ -6064,8 +6179,9 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags fl : HistoryItem(history, id, newForwardedFlags(history->peer, from, fwd) | flags, date, from) { UserData *fwdViaBot = fwd->viaBot(); int32 viaBotId = fwdViaBot ? peerToUser(fwdViaBot->id) : 0; - int32 fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1); - createInterfaces(viaBotId, views, fwd->authorOriginal()->id, fwd->fromOriginal()->id, fwd->authorOriginal()->isChannel() ? fwd->id : 0); + int fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1); + MsgId replyTo = 0; + createInterfaces(replyTo, viaBotId, views, fwd->authorOriginal()->id, fwd->fromOriginal()->id, fwd->authorOriginal()->isChannel() ? fwd->id : 0); if (HistoryMedia *mediaOriginal = fwd->getMedia()) { _media = mediaOriginal->clone(); @@ -6074,32 +6190,41 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags fl setText(fwd->originalText(), fwd->originalEntities()); } -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) { - createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); +HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags flags, MsgId replyTo, 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) { + createInterfacesHelper(flags, replyTo, viaBotId); setText(msg, entities); } -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) { - createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); +HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) +: HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { + createInterfacesHelper(flags, replyTo, viaBotId); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); } -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) { - createInterfaces((flags & MTPDmessage::Flag::f_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1); +HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) +: HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { + createInterfacesHelper(flags, replyTo, viaBotId); _media = new HistoryPhoto(photo, caption, this); _media->attachToItem(this); setText(QString(), EntitiesInText()); } -void HistoryMessage::createInterfaces(int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal, MsgId originalId) { +void HistoryMessage::createInterfacesHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId) { + if (!(flags & MTPDmessage::Flag::f_via_bot_id)) viaBotId = 0; + if (!(flags & MTPDmessage::Flag::f_reply_to_msg_id)) replyTo = 0; + createInterfaces(replyTo, viaBotId, isPost() ? 1 : -1); +} + +void HistoryMessage::createInterfaces(MsgId replyTo, int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal, MsgId originalId) { uint64 mask = 0; + if (replyTo) { + mask |= HistoryMessageReply::Bit(); + } if (viaBotId) { mask |= HistoryMessageVia::Bit(); } @@ -6112,17 +6237,23 @@ void HistoryMessage::createInterfaces(int32 viaBotId, int32 viewsCount, const Pe if (authorIdOriginal && fromIdOriginal) { mask |= HistoryMessageForwarded::Bit(); } - UpdateInterfaces(mask); - if (HistoryMessageVia *via = Get()) { + UpdateComponents(mask); + if (auto *reply = Get()) { + reply->replyToMsgId = replyTo; + if (!reply->updateData(this) && App::api()) { + App::api()->requestMessageData(history()->peer->asChannel(), replyTo, new HistoryDependentItemCallback(fullId())); + } + } + if (auto *via = Get()) { via->create(viaBotId); } - if (HistoryMessageViews *views = Get()) { + if (auto *views = Get()) { views->_views = viewsCount; } - if (HistoryMessageSigned *msgsigned = Get()) { + if (auto *msgsigned = Get()) { msgsigned->create(_from->asUser(), date); } - if (HistoryMessageForwarded *fwd = Get()) { + if (auto *fwd = Get()) { fwd->_authorOriginal = App::peer(authorIdOriginal); fwd->_fromOriginal = App::peer(fromIdOriginal); fwd->_originalId = originalId; @@ -6150,13 +6281,13 @@ QString formatViewsCount(int32 views) { } void HistoryMessage::initTime() { - if (HistoryMessageSigned *msgsigned = Get()) { + if (auto *msgsigned = Get()) { _timeWidth = msgsigned->maxWidth(); } else { _timeText = date.toString(cTimeFormat()); _timeWidth = st::msgDateFont->width(_timeText); } - if (HistoryMessageViews *views = Get()) { + if (auto *views = Get()) { views->_viewsText = (views->_views >= 0) ? formatViewsCount(views->_views) : QString(); views->_viewsWidth = views->_viewsText.isEmpty() ? 0 : st::msgDateFont->width(views->_viewsText); } @@ -6228,9 +6359,10 @@ int32 HistoryMessage::plainMaxWidth() const { } void HistoryMessage::initDimensions() { + auto *reply = Get(); if (drawBubble()) { - HistoryMessageForwarded *fwd = Get(); - HistoryMessageVia *via = Get(); + auto fwd = Get(); + auto via = Get(); if (fwd) { fwd->create(via); } @@ -6286,6 +6418,16 @@ void HistoryMessage::initDimensions() { _maxw = _media->maxWidth(); _minh = _media->minHeight(); } + if (reply) { + reply->updateName(); + if (!_media) { + int replyw = st::msgPadding.left() + reply->_maxReplyWidth - st::msgReplyPadding.left() - st::msgReplyPadding.right() + st::msgPadding.right(); + if (reply->_replyToVia) { + replyw += st::msgServiceFont->spacew + reply->_replyToVia->_maxWidth; + } + if (replyw > _maxw) _maxw = replyw; + } + } } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { @@ -6312,8 +6454,8 @@ void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { void HistoryMessage::fromNameUpdated(int32 width) const { _authorNameVersion = author()->nameVersion; - if (!Is()) { - if (const HistoryMessageVia *via = Get()) { + if (!Has()) { + if (auto *via = Get()) { via->resize(width - st::msgPadding.left() - st::msgPadding.right() - author()->nameText.maxWidth() - st::msgServiceFont->spacew); } } @@ -6361,7 +6503,7 @@ QString HistoryMessage::selectedText(uint32 selection) const { uint16 selectedTo = (selection == FullSelection) ? 0xFFFF : (selection & 0xFFFF); result = _text.original(selectedFrom, selectedTo, Text::ExpandLinksAll); } - if (const HistoryMessageForwarded *fwd = Get()) { + if (auto *fwd = Get()) { if (selection == FullSelection) { QString fwdinfo = fwd->_text.original(0, 0xFFFF, Text::ExpandLinksAll), wrapped; wrapped.reserve(fwdinfo.size() + 4 + result.size()); @@ -6369,6 +6511,14 @@ QString HistoryMessage::selectedText(uint32 selection) const { result = wrapped; } } + if (auto *reply = Get()) { + if (selection == FullSelection && reply->replyToMsg) { + QString wrapped; + wrapped.reserve(lang(lng_in_reply_to).size() + reply->replyToMsg->author()->name.size() + 4 + result.size()); + wrapped.append('[').append(lang(lng_in_reply_to)).append(' ').append(reply->replyToMsg->author()->name).append(qsl("]\n")).append(result); + result = wrapped; + } + } return result; } @@ -6464,7 +6614,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width } dateX += HistoryMessage::timeLeft(); - if (const HistoryMessageSigned *msgsigned = Get()) { + if (auto *msgsigned = Get()) { msgsigned->_signature.drawElided(p, dateX, dateY, _timeWidth); } else { p.drawText(dateX, dateY + st::msgDateFont->ascent, _timeText); @@ -6472,7 +6622,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width QPoint iconPos; const QRect *iconRect = 0; - if (const HistoryMessageViews *views = Get()) { + if (auto *views = Get()) { iconPos = QPoint(infoRight - infoW + st::msgViewsPos.x(), infoBottom - st::msgViewsImg.pxHeight() + st::msgViewsPos.y()); if (id > 0) { if (outbg) { @@ -6511,7 +6661,7 @@ void HistoryMessage::drawInfo(Painter &p, int32 right, int32 bottom, int32 width } void HistoryMessage::setViewsCount(int32 count) { - HistoryMessageViews *views = Get(); + auto *views = Get(); if (!views || views->_views == count || (count >= 0 && views->_views > count)) return; int32 was = views->_viewsWidth; @@ -6588,9 +6738,14 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m // author()->paintUserpic(p, st::msgPhotoSize, photoleft, phototop); //} + auto *reply = Get(); + if (reply) { + reply->checkNameUpdate(); + } + if (bubble) { - const HistoryMessageForwarded *fwd = Get(); - const HistoryMessageVia *via = Get(); + auto *fwd = Get(); + auto *via = Get(); if (displayFromName() && author()->nameVersion > _authorNameVersion) { fromNameUpdated(width); } @@ -6619,7 +6774,16 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m } QRect trect(r.marginsAdded(-st::msgPadding)); - drawMessageText(p, trect, selection); + + paintForwardedInfo(p, trect, selected); + paintReplyInfo(p, trect, selected); + paintViaBotIdInfo(p, trect, selected); + + p.setPen(st::msgColor); + p.setFont(st::msgFont); + uint16 selectedFrom = selected ? 0 : ((selection >> 16) & 0xFFFF); + uint16 selectedTo = selected ? 0 : (selection & 0xFFFF); + _text.draw(p, trect.x(), trect.y(), trect.width(), style::al_left, 0, -1, selectedFrom, selectedTo); if (_media && _media->isDisplayed()) { int32 top = height - marginBottom() - _media->height(); @@ -6642,38 +6806,52 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m textstyleRestore(); } -void HistoryMessage::drawMessageText(Painter &p, QRect trect, uint32 selection) const { +void HistoryMessage::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const { if (displayForwardedFrom()) { style::font serviceFont(st::msgServiceFont), serviceName(st::msgServiceNameFont); - bool outbg = out() && !isPost(); - p.setPen((selection == FullSelection) ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); + p.setPen(selected ? (hasOutLayout() ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (hasOutLayout() ? st::msgOutServiceFg : st::msgInServiceFg)); p.setFont(serviceFont); - const HistoryMessageForwarded *fwd = Get(); + auto *fwd = Get(); bool breakEverywhere = (fwd->_text.countHeight(trect.width()) > 2 * serviceFont->height); - textstyleSet(&((selection == FullSelection) ? (outbg ? st::outFwdTextStyleSelected : st::inFwdTextStyleSelected) : (outbg ? st::outFwdTextStyle : st::inFwdTextStyle))); + textstyleSet(&(selected ? (hasOutLayout() ? st::outFwdTextStyleSelected : st::inFwdTextStyleSelected) : (hasOutLayout() ? st::outFwdTextStyle : st::inFwdTextStyle))); fwd->_text.drawElided(p, trect.x(), trect.y(), trect.width(), 2, style::al_left, 0, -1, 0, breakEverywhere); - textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); + textstyleSet(&(hasOutLayout() ? st::outTextStyle : st::inTextStyle)); trect.setY(trect.y() + (((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * serviceFont->height)); } +} - bool outbg = out() && !isPost(), selected = (selection == FullSelection); - if (!displayFromName() && !Is()) { - if (const HistoryMessageVia *via = Get()) { +void HistoryMessage::paintReplyInfo(Painter &p, QRect &trect, bool selected) const { + if (auto *reply = Get()) { + int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); + + HistoryMessageReply::PaintFlags flags = HistoryMessageReply::PaintInBubble; + if (selected) { + flags |= HistoryMessageReply::PaintSelected; + } + reply->paint(p, this, trect.x(), trect.y(), trect.width(), flags); + + trect.setY(trect.y() + h); + } +} + +void HistoryMessage::paintViaBotIdInfo(Painter &p, QRect &trect, bool selected) const { + if (!displayFromName() && !Has()) { + if (auto *via = Get()) { p.setFont(st::msgServiceNameFont); - p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); + p.setPen(selected ? (hasOutLayout() ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (hasOutLayout() ? st::msgOutServiceFg : st::msgInServiceFg)); p.drawTextLeft(trect.left(), trect.top(), _history->width, via->_text); trect.setY(trect.y() + st::msgServiceNameFont->height); } } +} - p.setPen(st::msgColor); - p.setFont(st::msgFont); - uint16 selectedFrom = (selection == FullSelection) ? 0 : (selection >> 16) & 0xFFFF; - uint16 selectedTo = (selection == FullSelection) ? 0 : selection & 0xFFFF; - _text.draw(p, trect.x(), trect.y(), trect.width(), style::al_left, 0, -1, selectedFrom, selectedTo); +void HistoryMessage::dependencyItemRemoved(HistoryItem *dependency) { + if (auto *reply = Get()) { + reply->itemRemoved(this, dependency); + } } void HistoryMessage::destroy() { @@ -6691,8 +6869,9 @@ int HistoryMessage::resizeGetHeight_(int width) { width = st::msgMaxWidth; } if (drawBubble()) { - HistoryMessageForwarded *fwd = Get(); - HistoryMessageVia *via = Get(); + auto *fwd = Get(); + auto *reply = Get(); + auto *via = Get(); bool media = (_media && _media->isDisplayed()); if (width >= _maxw) { @@ -6745,6 +6924,15 @@ int HistoryMessage::resizeGetHeight_(int width) { _height += fwdheight; } } + + if (reply) { + if (emptyText() && !displayFromName() && !Has()) { + _height += st::msgPadding.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom() + st::mediaHeaderSkip; + } else { + _height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); + } + reply->resize(width - st::msgPadding.left() - st::msgPadding.right()); + } } else { _height = _media->resize(width, this); } @@ -6800,26 +6988,27 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 if (width < 1) return; if (drawBubble()) { - const HistoryMessageForwarded *fwd = Get(); - const HistoryMessageVia *via = Get(); + auto *fwd = Get(); + auto *via = Get(); + auto *reply = Get(); 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()) { + QRect trect(r.marginsAdded(-st::msgPadding)); + if (displayFromName()) { + if (y >= trect.top() && y < trect.top() + st::msgNameFont->height) { + if (x >= trect.left() && x < trect.left() + trect.width() && x < trect.left() + author()->nameText.maxWidth()) { lnk = author()->lnk; return; } - if (via && !fwd && x >= r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew && x < r.left() + st::msgPadding.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew + via->_width) { + if (via && !fwd && x >= trect.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew && x < trect.left() + author()->nameText.maxWidth() + st::msgServiceFont->spacew + via->_width) { lnk = via->_lnk; return; } } - r.setTop(r.top() + st::msgNameFont->height); + trect.setTop(trect.top() + st::msgNameFont->height); } if (displayForwardedFrom()) { - QRect trect(r.marginsAdded(-st::msgPadding)); int32 fwdheight = ((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * st::semiboldFont->height; if (y >= trect.top() && y < trect.top() + fwdheight) { bool inText = false; @@ -6832,57 +7021,57 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 } return; } - y -= fwdheight; - r.setHeight(r.height() - fwdheight); + trect.setTop(trect.top() + fwdheight); } - getStateFromMessageText(lnk, state, x, y, r); - } else { - _media->getState(lnk, state, x - left, y - marginTop(), this); - } -} - -void HistoryMessage::getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const { - bool inDate = false; - - QRect trect(r.marginsAdded(-st::msgPadding)); - - const HistoryMessageForwarded *fwd = Get(); - if (!displayFromName() && !fwd) { - if (const HistoryMessageVia *via = Get()) { + if (via && !displayFromName() && !displayForwardedFrom()) { if (x >= trect.left() && y >= trect.top() && y < trect.top() + st::msgNameFont->height && x < trect.left() + via->_width) { lnk = via->_lnk; return; } trect.setTop(trect.top() + st::msgNameFont->height); } - } + if (reply) { + int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); + if (y >= trect.top() && y < trect.top() + h) { + if (reply->replyToMsg && y >= trect.top() + st::msgReplyPadding.top() && y < trect.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() && x >= trect.left() && x < trect.left() + trect.width()) { + lnk = reply->replyToLink(); + } + return; + } + trect.setTop(trect.top() + h); + } - TextLinkPtr medialnk; - if (_media && _media->isDisplayed()) { - if (!_media->customInfoLayout()) { + bool inDate = false; + + TextLinkPtr medialnk; + if (_media && _media->isDisplayed()) { + if (!_media->customInfoLayout()) { + inDate = HistoryMessage::pointInTime(r.x() + r.width(), r.y() + r.height(), x, y, InfoDisplayDefault); + } + if (y >= r.bottom() - _media->height() && y < r.bottom()) { + _media->getState(lnk, state, x - r.left(), y - (r.bottom() - _media->height()), this); + if (inDate) state = HistoryInDateCursorState; + return; + } + trect.setBottom(trect.bottom() - _media->height()); + } else { inDate = HistoryMessage::pointInTime(r.x() + r.width(), r.y() + r.height(), x, y, InfoDisplayDefault); } - if (y >= r.bottom() - _media->height() && y < r.bottom()) { - _media->getState(lnk, state, x - r.left(), y - (r.bottom() - _media->height()), this); - if (inDate) state = HistoryInDateCursorState; - return; + + textstyleSet(&((out() && !isPost()) ? st::outTextStyle : st::inTextStyle)); + bool inText = false; + _text.getState(lnk, inText, x - trect.x(), y - trect.y(), trect.width()); + textstyleRestore(); + + if (inDate) { + state = HistoryInDateCursorState; + } else if (inText) { + state = HistoryInTextCursorState; + } else { + state = HistoryDefaultCursorState; } - trect.setBottom(trect.bottom() - _media->height()); } else { - inDate = HistoryMessage::pointInTime(r.x() + r.width(), r.y() + r.height(), x, y, InfoDisplayDefault); - } - - textstyleSet(&((out() && !isPost()) ? st::outTextStyle : st::inTextStyle)); - bool inText = false; - _text.getState(lnk, inText, x - trect.x(), y - trect.y(), trect.width()); - textstyleRestore(); - - if (inDate) { - state = HistoryInDateCursorState; - } else if (inText) { - state = HistoryInTextCursorState; - } else { - state = HistoryDefaultCursorState; + _media->getState(lnk, state, x - left, y - marginTop(), this); } } @@ -6890,26 +7079,31 @@ void HistoryMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, symbol = 0; after = false; upon = false; + if (drawBubble()) { int left = 0, width = 0, height = _height; countPositionAndSize(left, width); if (width < 1) return; - const HistoryMessageForwarded *fwd = Get(); - const HistoryMessageVia *via = Get(); + auto *fwd = Get(); + auto *via = Get(); + auto *reply = Get(); 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) { - r.setTop(r.top() + st::msgNameFont->height); - } QRect trect(r.marginsAdded(-st::msgPadding)); + if (displayFromName()) { + trect.setTop(trect.top() + st::msgNameFont->height); + } else if (via && !fwd) { + trect.setTop(trect.top() + st::msgNameFont->height); + } if (displayForwardedFrom()) { int32 fwdheight = ((fwd->_text.maxWidth() > trect.width()) ? 2 : 1) * st::semiboldFont->height; - y -= fwdheight; - r.setHeight(r.height() - fwdheight); + trect.setTop(trect.top() + fwdheight); + } + if (reply) { + int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); + trect.setTop(trect.top() + h); } if (_media && _media->isDisplayed()) { trect.setBottom(trect.bottom() - _media->height()); @@ -6966,332 +7160,15 @@ HistoryMessage::~HistoryMessage() { _media->detachFromItem(this); deleteAndMark(_media); } + if (auto *reply = Get()) { + reply->clearData(this); + } if (_flags & MTPDmessage::Flag::f_reply_markup) { App::clearReplyMarkup(channelId(), id); } } -HistoryReply::HistoryReply(History *history, const MTPDmessage &msg) : HistoryMessage(history, msg) -, replyToMsgId(msg.vreply_to_msg_id.v) -, replyToMsg(0) -, replyToVersion(0) -, _maxReplyWidth(0) -, _replyToVia(0) { - if (!updateReplyTo() && App::api()) { - App::api()->requestMessageData(history->peer->asChannel(), replyToMsgId, new HistoryDependentItemCallback(fullId())); - } -} - -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) -, replyToVersion(0) -, _maxReplyWidth(0) -, _replyToVia(0) { - if (!updateReplyTo() && App::api()) { - App::api()->requestMessageData(history->peer->asChannel(), replyToMsgId, new HistoryDependentItemCallback(fullId())); - } -} - -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) -, replyToVersion(0) -, _maxReplyWidth(0) -, _replyToVia(0) { - if (!updateReplyTo() && App::api()) { - App::api()->requestMessageData(history->peer->asChannel(), replyToMsgId, new HistoryDependentItemCallback(fullId())); - } - replyToNameUpdated(); -} - -QString HistoryReply::selectedText(uint32 selection) const { - if (selection != FullSelection || !replyToMsg) return HistoryMessage::selectedText(selection); - QString result, original = HistoryMessage::selectedText(selection); - result.reserve(lang(lng_in_reply_to).size() + replyToMsg->author()->name.size() + 4 + original.size()); - result.append('[').append(lang(lng_in_reply_to)).append(' ').append(replyToMsg->author()->name).append(qsl("]\n")).append(original); - return result; -} - -void HistoryReply::initDimensions() { - replyToNameUpdated(); - HistoryMessage::initDimensions(); - if (!_media) { - int32 replyw = st::msgPadding.left() + _maxReplyWidth - st::msgReplyPadding.left() - st::msgReplyPadding.right() + st::msgPadding.right(); - if (_replyToVia) { - replyw += st::msgServiceFont->spacew + _replyToVia->_maxWidth; - } - if (replyw > _maxw) _maxw = replyw; - } -} - -bool HistoryReply::updateReplyTo(bool force) { - if (!force) { - if (replyToMsg || !replyToMsgId) { - return true; - } - } - if (!replyToMsg) { - replyToMsg = App::histItemById(channelId(), replyToMsgId); - if (replyToMsg) { - App::historyRegDependency(this, replyToMsg); - } - } - - if (replyToMsg) { - replyToText.setText(st::msgFont, replyToMsg->inReplyText(), _textDlgOptions); - - replyToNameUpdated(); - - replyToLnk = TextLinkPtr(new MessageLink(replyToMsg->history()->peer->id, replyToMsg->id)); - if (!replyToMsg->Is()) { - if (UserData *bot = replyToMsg->viaBot()) { - _replyToVia = new HistoryMessageVia(0); - _replyToVia->create(peerToUser(bot->id)); - } - } - } else if (force) { - replyToMsgId = 0; - } - if (force) { - setPendingInitDimensions(); - } - return (replyToMsg || !replyToMsgId); -} - -void HistoryReply::replyToNameUpdated() const { - if (replyToMsg) { - QString name = (_replyToVia && replyToMsg->author()->isUser()) ? replyToMsg->author()->asUser()->firstName : App::peerName(replyToMsg->author()); - replyToName.setText(st::msgServiceNameFont, name, _textNameOptions); - replyToVersion = replyToMsg->author()->nameVersion; - bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; - int32 previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; - int32 w = replyToName.maxWidth(); - if (_replyToVia) { - w += st::msgServiceFont->spacew + _replyToVia->_maxWidth; - } - - _maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize))); - } else { - _maxReplyWidth = st::msgDateFont->width(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message)); - } - _maxReplyWidth = st::msgReplyPadding.left() + st::msgReplyBarSkip + _maxReplyWidth + st::msgReplyPadding.right(); -} - -int32 HistoryReply::replyToWidth() const { - return _maxReplyWidth; -} - -TextLinkPtr HistoryReply::replyToLink() const { - return replyToLnk; -} - -MsgId HistoryReply::replyToId() const { - return replyToMsgId; -} - -HistoryItem *HistoryReply::replyToMessage() const { - return replyToMsg; -} - -void HistoryReply::dependencyItemRemoved(HistoryItem *dependency) { - if (replyToMsg == dependency) { - delete _replyToVia; - _replyToVia = 0; - - replyToMsg = nullptr; - replyToMsgId = 0; - initDimensions(); - } -} - -void HistoryReply::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { - if (replyToMsg && replyToMsg->author()->nameVersion > replyToVersion) { - replyToNameUpdated(); - } - HistoryMessage::draw(p, r, selection, ms); -} - -void HistoryReply::drawReplyTo(Painter &p, int32 x, int32 y, int32 w, bool selected, bool likeService) const { - style::color bar; - bool outbg = out() && !isPost(); - if (likeService) { - bar = st::white; - } else { - bar = (selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor)); - } - QRect rbar(rtlrect(x + st::msgReplyBarPos.x(), y + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.width(), st::msgReplyBarSize.height(), w + 2 * x)); - p.fillRect(rbar, bar); - - if (w > st::msgReplyBarSkip) { - if (replyToMsg) { - bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; - int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; - - if (hasPreview) { - ImagePtr replyPreview = replyToMsg->getMedia()->replyPreview(); - if (!replyPreview->isNull()) { - QRect to(rtlrect(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + st::msgReplyBarPos.y(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height(), w + 2 * x)); - p.drawPixmap(to.x(), to.y(), replyPreview->pixSingle(replyPreview->width() / cIntRetinaFactor(), replyPreview->height() / cIntRetinaFactor(), to.width(), to.height())); - if (selected) { - App::roundRect(p, to, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); - } - } - } - if (w > st::msgReplyBarSkip + previewSkip) { - if (likeService) { - p.setPen(st::white); - } else { - p.setPen(selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg)); - } - replyToName.drawLeftElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top(), w - st::msgReplyBarSkip - previewSkip, w + 2 * x); - if (_replyToVia && w > st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew) { - p.setFont(st::msgServiceFont); - p.drawText(x + st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew, y + st::msgReplyPadding.top() + st::msgServiceFont->ascent, _replyToVia->_text); - } - - HistoryMessage *replyToAsMsg = replyToMsg->toHistoryMessage(); - if (likeService) { - } else if ((replyToAsMsg && replyToAsMsg->emptyText()) || replyToMsg->serviceMsg()) { - style::color date(outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg)); - p.setPen(date); - } else { - p.setPen(st::msgColor); - } - replyToText.drawLeftElided(p, x + st::msgReplyBarSkip + previewSkip, y + st::msgReplyPadding.top() + st::msgServiceNameFont->height, w - st::msgReplyBarSkip - previewSkip, w + 2 * x); - } - } else { - p.setFont(st::msgDateFont); - style::color date(outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg)); - p.setPen(likeService ? st::white : date); - p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message), w - st::msgReplyBarSkip)); - } - } -} - -void HistoryReply::drawMessageText(Painter &p, QRect trect, uint32 selection) const { - int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - - drawReplyTo(p, trect.x(), trect.y(), trect.width(), (selection == FullSelection)); - - trect.setY(trect.y() + h); - HistoryMessage::drawMessageText(p, trect, selection); -} - -int32 HistoryReply::resizeGetHeight_(int32 width) { - HistoryMessage::resizeGetHeight_(width); - - if (drawBubble()) { - if (emptyText() && !displayFromName() && !Is()) { - _height += st::msgPadding.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom() + st::mediaHeaderSkip; - } else { - _height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - } - if (_replyToVia) { - bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; - int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; - _replyToVia->resize(width - st::msgPadding.left() - st::msgPadding.right() - st::msgReplyBarSkip + previewSkip + replyToName.maxWidth() + st::msgServiceFont->spacew); - } - } - return _height; -} - -void HistoryReply::resizeVia(int32 w) const { - if (!_replyToVia) return; - - bool hasPreview = replyToMsg->getMedia() ? replyToMsg->getMedia()->hasReplyPreview() : false; - int previewSkip = hasPreview ? (st::msgReplyBarSize.height() + st::msgReplyBarSkip - st::msgReplyBarSize.width() - st::msgReplyBarPos.x()) : 0; - _replyToVia->resize(w - st::msgReplyBarSkip - previewSkip - replyToName.maxWidth() - st::msgServiceFont->spacew); -} - -void HistoryReply::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { - lnk = TextLinkPtr(); - state = HistoryDefaultCursorState; - - if (drawBubble()) { - int32 left = 0, width = 0; - countPositionAndSize(left, width); - //if (displayFromPhoto()) { - // int32 photoleft = left + ((!isPost() && out()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - // if (x >= photoleft && x < photoleft + st::msgPhotoSize) { - // return HistoryMessage::getState(lnk, state, x, y); - // } - //} - if (width < 1) return; - - 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) { - return HistoryMessage::getState(lnk, state, x, y); - } - r.setTop(r.top() + nameFont->height); - } - QRect trect(r.marginsAdded(-st::msgPadding)); - - int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - if (y >= trect.top() && y < trect.top() + h) { - if (replyToMsg && y >= trect.top() + st::msgReplyPadding.top() && y < trect.top() + st::msgReplyPadding.top() + st::msgReplyBarSize.height() && x >= trect.left() && x < trect.left() + trect.width()) { - lnk = replyToLnk; - } - return; - } - y -= h; - } - return HistoryMessage::getState(lnk, state, x, y); -} - -void HistoryReply::getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const { - int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - - QRect realr(r); - realr.setHeight(r.height() - h); - HistoryMessage::getStateFromMessageText(lnk, state, x, y, realr); -} - -void HistoryReply::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { - symbol = 0; - after = false; - upon = false; - - if (drawBubble()) { - int32 left = 0, width = 0; - countPositionAndSize(left, width); - if (width < 1) return; - - 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) { - return HistoryMessage::getSymbol(symbol, after, upon, x, y); - } - r.setTop(r.top() + nameFont->height); - } - QRect trect(r.marginsAdded(-st::msgPadding)); - - int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); - y -= h; - } - return HistoryMessage::getSymbol(symbol, after, upon, x, y); -} - -HistoryReply::~HistoryReply() { - if (replyToMsg) { - App::historyUnregDependency(this, replyToMsg); - } - deleteAndMark(_replyToVia); -} - -HistoryServicePinned::HistoryServicePinned(Interfaces *) -: msgId(0) -, msg(0) { -} - -void HistoryServiceMessage::setMessageByAction(const MTPmessageAction &action) { +void HistoryService::setMessageByAction(const MTPmessageAction &action) { QList links; LangString text = lang(lng_message_empty); QString from = textcmdLink(1, _from->name); @@ -7399,7 +7276,7 @@ void HistoryServiceMessage::setMessageByAction(const MTPmessageAction &action) { case mtpc_messageActionChatMigrateTo: { _flags |= MTPDmessage_ClientFlag::f_is_group_migrate; const MTPDmessageActionChatMigrateTo &d(action.c_messageActionChatMigrateTo()); - if (true/*PeerData *channel = App::peerLoaded(peerFromChannel(d.vchannel_id))*/) { + if (true/*PeerData *channel = App::channelLoaded(d.vchannel_id.v)*/) { text = lang(lng_action_group_migrate); } else { text = lang(lng_contacts_loading); @@ -7409,7 +7286,7 @@ void HistoryServiceMessage::setMessageByAction(const MTPmessageAction &action) { case mtpc_messageActionChannelMigrateFrom: { _flags |= MTPDmessage_ClientFlag::f_is_group_migrate; const MTPDmessageActionChannelMigrateFrom &d(action.c_messageActionChannelMigrateFrom()); - if (true/*PeerData *chat = App::peerLoaded(peerFromChannel(d.vchat_id))*/) { + if (true/*PeerData *chat = App::chatLoaded(d.vchat_id.v)*/) { text = lang(lng_action_group_migrate); } else { text = lang(lng_contacts_loading); @@ -7418,7 +7295,7 @@ void HistoryServiceMessage::setMessageByAction(const MTPmessageAction &action) { case mtpc_messageActionPinMessage: { if (updatePinnedText(&from, &text)) { - HistoryServicePinned *pinned = Get(); + auto *pinned = Get(); t_assert(pinned != nullptr); links.push_back(pinned->lnk); @@ -7439,8 +7316,8 @@ void HistoryServiceMessage::setMessageByAction(const MTPmessageAction &action) { } } -bool HistoryServiceMessage::updatePinned(bool force) { - HistoryServicePinned *pinned = Get(); +bool HistoryService::updatePinned(bool force) { + auto *pinned = Get(); t_assert(pinned != nullptr); if (!force) { @@ -7478,7 +7355,7 @@ bool HistoryServiceMessage::updatePinned(bool force) { return (pinned->msg || !pinned->msgId); } -bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptext) { +bool HistoryService::updatePinnedText(const QString *pfrom, QString *ptext) { bool result = false; QString from, text; if (pfrom) { @@ -7488,7 +7365,7 @@ bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptex } TextLinkPtr second; - HistoryServicePinned *pinned = Get(); + auto *pinned = Get(); if (pinned && pinned->msg) { HistoryMedia *media = pinned->msg->getMedia(); QString mediaText; @@ -7550,10 +7427,10 @@ bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptex return result; } -HistoryServiceMessage::HistoryServiceMessage(History *history, const MTPDmessageService &msg) : +HistoryService::HistoryService(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) { if (msg.has_reply_to_msg_id()) { - UpdateInterfaces(HistoryServicePinned::Bit()); + UpdateComponents(HistoryServicePinned::Bit()); MsgId pinnedMsgId = Get()->msgId = msg.vreply_to_msg_id.v; if (!updatePinned() && App::api()) { App::api()->requestMessageData(history->peer->asChannel(), pinnedMsgId, new HistoryDependentItemCallback(fullId())); @@ -7562,19 +7439,19 @@ HistoryServiceMessage::HistoryServiceMessage(History *history, const MTPDmessage setMessageByAction(msg.vaction); } -HistoryServiceMessage::HistoryServiceMessage(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags, HistoryMedia *media, int32 from) : +HistoryService::HistoryService(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 HistoryServiceMessage::initDimensions() { +void HistoryService::initDimensions() { _maxw = _text.maxWidth() + st::msgServicePadding.left() + st::msgServicePadding.right(); _minh = _text.minHeight(); if (_media) _media->initDimensions(this); } -void HistoryServiceMessage::countPositionAndSize(int32 &left, int32 &width) const { +void HistoryService::countPositionAndSize(int32 &left, int32 &width) const { left = st::msgServiceMargin.left(); int32 maxwidth = _history->width; if (Adaptive::Wide()) { @@ -7583,29 +7460,29 @@ void HistoryServiceMessage::countPositionAndSize(int32 &left, int32 &width) cons width = maxwidth - st::msgServiceMargin.left() - st::msgServiceMargin.left(); } -QString HistoryServiceMessage::selectedText(uint32 selection) const { +QString HistoryService::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 HistoryServiceMessage::inDialogsText() const { +QString HistoryService::inDialogsText() const { return _text.original(0, 0xFFFF, Text::ExpandLinksNone); } -QString HistoryServiceMessage::inReplyText() const { - QString result = HistoryServiceMessage::inDialogsText(); +QString HistoryService::inReplyText() const { + QString result = HistoryService::inDialogsText(); return result.trimmed().startsWith(author()->name) ? result.trimmed().mid(author()->name.size()).trimmed() : result; } -void HistoryServiceMessage::setServiceText(const QString &text) { +void HistoryService::setServiceText(const QString &text) { textstyleSet(&st::serviceTextStyle); _text.setText(st::msgServiceFont, text, _historySrvOptions); textstyleRestore(); initDimensions(); } -void HistoryServiceMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const { +void HistoryService::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; @@ -7673,7 +7550,7 @@ void HistoryServiceMessage::draw(Painter &p, const QRect &r, uint32 selection, u } } -int32 HistoryServiceMessage::resizeGetHeight_(int32 width) { +int32 HistoryService::resizeGetHeight_(int32 width) { int32 maxwidth = _history->width; if (Adaptive::Wide()) { maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left())); @@ -7705,7 +7582,7 @@ int32 HistoryServiceMessage::resizeGetHeight_(int32 width) { return _height; } -bool HistoryServiceMessage::hasPoint(int32 x, int32 y) const { +bool HistoryService::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; @@ -7726,7 +7603,7 @@ bool HistoryServiceMessage::hasPoint(int32 x, int32 y) const { return QRect(left, st::msgServiceMargin.top(), width, height).contains(x, y); } -void HistoryServiceMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { +void HistoryService::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const { lnk = TextLinkPtr(); state = HistoryDefaultCursorState; @@ -7759,7 +7636,7 @@ void HistoryServiceMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state } } -void HistoryServiceMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { +void HistoryService::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const { symbol = 0; after = false; upon = false; @@ -7787,7 +7664,7 @@ void HistoryServiceMessage::getSymbol(uint16 &symbol, bool &after, bool &upon, i textstyleRestore(); } -void HistoryServiceMessage::drawInDialog(Painter &p, const QRect &r, bool act, const HistoryItem *&cacheFor, Text &cache) const { +void HistoryService::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); @@ -7797,17 +7674,17 @@ void HistoryServiceMessage::drawInDialog(Painter &p, const QRect &r, bool act, c cache.drawElided(p, tr.left(), tr.top(), tr.width(), tr.height() / st::dlgHistFont->height); } -QString HistoryServiceMessage::notificationText() const { +QString HistoryService::notificationText() const { QString msg = _text.original(); if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl("..."); return msg; } -HistoryMedia *HistoryServiceMessage::getMedia(bool inOverview) const { +HistoryMedia *HistoryService::getMedia(bool inOverview) const { return inOverview ? 0 : _media; } -HistoryServiceMessage::~HistoryServiceMessage() { +HistoryService::~HistoryService() { if (auto pinned = Get()) { if (pinned->msg) { App::historyUnregDependency(this, pinned->msg); @@ -7820,7 +7697,7 @@ HistoryServiceMessage::~HistoryServiceMessage() { } 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)*/) + : HistoryService(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) @@ -7828,7 +7705,7 @@ HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, cons } 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)*/) + : HistoryService(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) @@ -7898,7 +7775,7 @@ void HistoryGroup::updateText() { } HistoryCollapse::HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date) - : HistoryServiceMessage(history, clientMsgId(), date, qsl("-")) + : HistoryService(history, clientMsgId(), date, qsl("-")) , _wasMinId(wasMinId) { } @@ -7911,7 +7788,7 @@ void HistoryCollapse::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3 } HistoryJoined::HistoryJoined(History *history, const QDateTime &inviteDate, UserData *inviter, MTPDmessage::Flags flags) - : HistoryServiceMessage(history, clientMsgId(), inviteDate, QString(), flags) { + : HistoryService(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 1a8c9626d9..07bce6754c 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -936,7 +936,6 @@ protected: }; -class HistoryReply; // dynamic_cast optimize class HistoryMessage; // dynamic_cast optimize enum HistoryCursorState { @@ -962,43 +961,104 @@ enum HistoryItemType { HistoryItemJoined }; -struct HistoryMessageVia : public BasicInterface { - HistoryMessageVia(Interfaces *); +struct HistoryMessageVia : public BaseComponent { + HistoryMessageVia(Composer*) { + } void create(int32 userId); void resize(int32 availw) const; - UserData *_bot; + UserData *_bot = nullptr; mutable QString _text; - mutable int32 _width, _maxWidth; + mutable int _width = 0; + mutable int _maxWidth = 0; TextLinkPtr _lnk; }; -struct HistoryMessageViews : public BasicInterface { - HistoryMessageViews(Interfaces *); +struct HistoryMessageViews : public BaseComponent { + HistoryMessageViews(Composer*) { + } QString _viewsText; - int32 _views, _viewsWidth; + int _views = 0; + int _viewsWidth = 0; }; -struct HistoryMessageSigned : public BasicInterface { - HistoryMessageSigned(Interfaces *); +struct HistoryMessageSigned : public BaseComponent { + HistoryMessageSigned(Composer*) { + } void create(UserData *from, const QDateTime &date); - int32 maxWidth() const; + int maxWidth() const; Text _signature; }; -struct HistoryMessageForwarded : public BasicInterface { - HistoryMessageForwarded(Interfaces *); +struct HistoryMessageForwarded : public BaseComponent { + HistoryMessageForwarded(Composer*) { + } void create(const HistoryMessageVia *via) const; - bool display(bool hasVia) const; - PeerData *_authorOriginal, *_fromOriginal; - MsgId _originalId; - mutable Text _text; + PeerData *_authorOriginal = nullptr; + PeerData *_fromOriginal = nullptr; + MsgId _originalId = 0; + mutable Text _text = { 1 }; }; +struct HistoryMessageReply : public BaseComponent { + HistoryMessageReply(Composer*) { + } + HistoryMessageReply &operator=(HistoryMessageReply &&other) { + replyToMsgId = other.replyToMsgId; + std::swap(replyToMsg, other.replyToMsg); + replyToLnk = std11::move(other.replyToLnk); + replyToName = std11::move(other.replyToName); + replyToText = std11::move(other.replyToText); + replyToVersion = other.replyToVersion; + _maxReplyWidth = other._maxReplyWidth; + std::swap(_replyToVia, other._replyToVia); + return *this; + } + ~HistoryMessageReply() { + // clearData() should be called by holder + t_assert(replyToMsg == nullptr); + t_assert(_replyToVia == nullptr); + } + bool updateData(HistoryMessage *holder, bool force = false); + void clearData(HistoryMessage *holder); // must be called before destructor + + void checkNameUpdate() const; + void updateName() const; + void resize(int width) const; + void itemRemoved(HistoryMessage *holder, HistoryItem *removed); + + enum PaintFlag { + PaintInBubble = 0x01, + PaintSelected = 0x02, + }; + Q_DECLARE_FLAGS(PaintFlags, PaintFlag); + void paint(Painter &p, const HistoryItem *holder, int x, int y, int w, PaintFlags flags) const; + + MsgId replyToId() const { + return replyToMsgId; + } + int replyToWidth() const { + return _maxReplyWidth; + } + TextLinkPtr replyToLink() const { + return replyToLnk; + } + + MsgId replyToMsgId = 0; + HistoryItem *replyToMsg = nullptr; + TextLinkPtr replyToLnk; + mutable Text replyToName, replyToText; + mutable int replyToVersion = 0; + mutable int _maxReplyWidth = 0; + HistoryMessageVia *_replyToVia = nullptr; + int toWidth = 0; +}; +Q_DECLARE_OPERATORS_FOR_FLAGS(HistoryMessageReply::PaintFlags); + class HistoryDependentItemCallback : public SharedCallback2 { public: HistoryDependentItemCallback(FullMsgId dependent) : _dependent(dependent) { @@ -1012,28 +1072,30 @@ private: // any HistoryItem can have this Interface for // displaying the day mark above the message -struct HistoryMessageDate : public BasicInterface { - HistoryMessageDate(Interfaces *); +struct HistoryMessageDate : public BaseComponent { + HistoryMessageDate(Composer*) { + } void init(const QDateTime &date); int height() const; void paint(Painter &p, int y, int w) const; QString _text; - int _width; + int _width = 0; }; // any HistoryItem can have this Interface for // displaying the unread messages bar above the message -struct HistoryMessageUnreadBar : public BasicInterface { - HistoryMessageUnreadBar(Interfaces *); +struct HistoryMessageUnreadBar : public BaseComponent { + HistoryMessageUnreadBar(Composer*) { + } void init(int count); int height() const; void paint(Painter &p, int y, int w) const; QString _text; - int _width; + int _width = 0; // if unread bar is freezed the new messages do not // increment the counter displayed by this bar @@ -1041,11 +1103,11 @@ struct HistoryMessageUnreadBar : public BasicInterface // 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; + bool _freezed = false; }; class HistoryMedia; -class HistoryItem : public HistoryElem, public Interfaces { +class HistoryItem : public HistoryElem, public Composer { public: HistoryItem(const HistoryItem &) = delete; @@ -1075,8 +1137,11 @@ public: return true; } - virtual UserData *viaBot() const { - return 0; + UserData *viaBot() const { + if (const HistoryMessageVia *via = Get()) { + return via->_bot; + } + return nullptr; } History *history() const { @@ -1165,6 +1230,9 @@ public: bool isSilent() const { return _flags & MTPDmessage::Flag::f_silent; } + bool hasOutLayout() const { + return out() && !isPost(); + } virtual int32 viewsCount() const { return hasViews() ? 1 : -1; } @@ -1315,10 +1383,10 @@ public: virtual const HistoryMessage *toHistoryMessage() const { // dynamic_cast optimize return 0; } - virtual HistoryReply *toHistoryReply() { // dynamic_cast optimize - return 0; - } - virtual const HistoryReply *toHistoryReply() const { // dynamic_cast optimize + MsgId replyToId() const { + if (auto *reply = Get()) { + return reply->replyToId(); + } return 0; } @@ -1433,7 +1501,7 @@ protected: // this should be used only in previousItemChanged() // to add required bits to the Interfaces mask - // after that always use Is() + // after that always use Has() bool displayDate() const { if (HistoryItem *prev = previous()) { return prev->date.date().day() != date.date().day(); @@ -1750,7 +1818,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const override { - return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->Has() || parent->Has() || parent->viaBot(); } bool customInfoLayout() const override { return _caption.isEmpty(); @@ -1819,7 +1887,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const override { - return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->Has() || parent->Has() || parent->viaBot(); } bool customInfoLayout() const override { return _caption.isEmpty(); @@ -1850,25 +1918,25 @@ private: }; -struct HistoryDocumentThumbed : public BasicInterface { - HistoryDocumentThumbed(Interfaces *interfaces) : _thumbw(0), _linkw(0) { +struct HistoryDocumentThumbed : public BaseComponent { + HistoryDocumentThumbed(Composer*) { } TextLinkPtr _linksavel, _linkcancell; - int32 _thumbw; + int _thumbw = 0; - mutable int32 _linkw; + mutable int _linkw = 0; mutable QString _link; }; -struct HistoryDocumentCaptioned : public BasicInterface { - HistoryDocumentCaptioned(Interfaces *interfaces) : _caption(st::msgFileMinWidth - st::msgPadding.left() - st::msgPadding.right()) { +struct HistoryDocumentCaptioned : public BaseComponent { + HistoryDocumentCaptioned(Composer*) : _caption(st::msgFileMinWidth - st::msgPadding.left() - st::msgPadding.right()) { } Text _caption; }; -struct HistoryDocumentNamed : public BasicInterface { - HistoryDocumentNamed(Interfaces *interfaces) : _namew(0) { +struct HistoryDocumentNamed : public BaseComponent { + HistoryDocumentNamed(Composer*) { } QString _name; - int32 _namew; + int _namew = 0; }; class HistoryDocument; struct HistoryDocumentVoicePlayback { @@ -1878,18 +1946,22 @@ struct HistoryDocumentVoicePlayback { anim::fvalue a_progress; Animation _a_progress; }; -struct HistoryDocumentVoice : public BasicInterface { - HistoryDocumentVoice(Interfaces *that) : _playback(0) { +struct HistoryDocumentVoice : public BaseComponent { + HistoryDocumentVoice(Composer*) { + } + HistoryDocumentVoice &operator=(HistoryDocumentVoice &&other) { + std::swap(_playback, other._playback); + return *this; } ~HistoryDocumentVoice() { deleteAndMark(_playback); } void ensurePlayback(const HistoryDocument *interfaces) const; void checkPlaybackFinished() const; - mutable HistoryDocumentVoicePlayback *_playback; + mutable HistoryDocumentVoicePlayback *_playback = nullptr; }; -class HistoryDocument : public HistoryFileMedia, public Interfaces { +class HistoryDocument : public HistoryFileMedia, public Composer { public: HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent); @@ -2021,7 +2093,7 @@ public: return _caption.original(); } bool needsBubble(const HistoryItem *parent) const override { - return !_caption.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); + return !_caption.isEmpty() || parent->Has() || parent->Has() || parent->viaBot(); } bool customInfoLayout() const override { return _caption.isEmpty(); @@ -2327,7 +2399,7 @@ public: } bool needsBubble(const HistoryItem *parent) const { - return !_title.isEmpty() || !_description.isEmpty() || parent->Is() || parent->toHistoryReply() || parent->viaBot(); + return !_title.isEmpty() || !_description.isEmpty() || parent->Has() || parent->Has() || parent->viaBot(); } bool customInfoLayout() const { return true; @@ -2365,14 +2437,14 @@ public: 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, 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, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities) { + return _create(history, msgId, flags, replyTo, viaBotId, date, from, msg, entities); } - 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, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) { + return _create(history, msgId, flags, replyTo, viaBotId, date, from, doc, 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); + static HistoryMessage *create(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) { + return _create(history, msgId, flags, replyTo, viaBotId, date, from, photo, caption); } void initTime(); @@ -2380,13 +2452,6 @@ public: void initMediaFromDocument(DocumentData *doc, const QString &caption); void fromNameUpdated(int32 width) const; - virtual UserData *viaBot() const override { - if (const HistoryMessageVia *via = Get()) { - return via->_bot; - } - return 0; - } - int32 plainMaxWidth() const; void countPositionAndSize(int32 &left, int32 &width) const; @@ -2403,7 +2468,7 @@ public: if (!hasFromName()) return false; if (isAttachedToPrevious()) return false; - return (!emptyText() || !_media || !_media->isDisplayed() || toHistoryReply() || Is() || viaBot() || !_media->hideFromName()); + return (!emptyText() || !_media || !_media->isDisplayed() || Has() || Has() || viaBot() || !_media->hideFromName()); } bool uploading() const { return _media && _media->uploading(); @@ -2414,7 +2479,7 @@ public: void setId(MsgId newId) override; void draw(Painter &p, const QRect &r, uint32 selection, uint64 ms) const override; - virtual void drawMessageText(Painter &p, QRect trect, uint32 selection) const; + void dependencyItemRemoved(HistoryItem *dependency) override; void destroy() override; @@ -2422,7 +2487,6 @@ public: bool pointInTime(int32 right, int32 bottom, int32 x, int32 y, InfoDisplayType type) const override; void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y) const override; - virtual void getStateFromMessageText(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const QRect &r) const; void getSymbol(uint16 &symbol, bool &after, bool &upon, int32 x, int32 y) const override; uint32 adjustSelection(uint16 from, uint16 to, TextSelectType type) const override { @@ -2491,6 +2555,16 @@ public: return HistoryItem::viewsCount(); } + bool updateDependencyItem() override { + if (auto *reply = Get()) { + return reply->updateData(this, true); + } + return true; + } + MsgId dependencyMsgId() const override { + return replyToId(); + } + HistoryMessage *toHistoryMessage() override { // dynamic_cast optimize return this; } @@ -2509,23 +2583,26 @@ protected: HistoryMessage(History *history, const MTPDmessage &msg); 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 + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, const QString &msg, const EntitiesInText &entities); // local message + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption); // local document + HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption); // local photo friend class HistoryItemInstantiated; void initDimensions() override; int resizeGetHeight_(int width) override; - 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()) { - return Is() || !_media || !_media->isDisplayed() || fwd->_authorOriginal->isChannel() || !_media->hideForwardedFrom(); + return Has() || !_media || !_media->isDisplayed() || fwd->_authorOriginal->isChannel() || !_media->hideForwardedFrom(); } return false; } - void paintForwardedInfo(Painter &p, int32 x, int32 y, int32 w, bool selected) const; + + void paintForwardedInfo(Painter &p, QRect &trect, bool selected) const; + void paintReplyInfo(Painter &p, QRect &trect, bool selected) const; + + // this method draws "via @bot" if it is not painted in forwarded info or in from name + void paintViaBotIdInfo(Painter &p, QRect &trect, bool selected) const; Text _text = { int(st::msgMinWidth) }; @@ -2536,79 +2613,8 @@ protected: QString _timeText; int _timeWidth = 0; -}; - -class HistoryReply : public HistoryMessage, private HistoryItemInstantiated { -public: - - static HistoryReply *create(History *history, const MTPDmessage &msg) { - return _create(history, msg); - } - 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, 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); - } - - bool updateDependencyItem() override { - return updateReplyTo(true); - } - MsgId dependencyMsgId() const override { - return replyToId(); - } - int32 replyToWidth() const; - - TextLinkPtr replyToLink() const; - - MsgId replyToId() const; - HistoryItem *replyToMessage() const; - void dependencyItemRemoved(HistoryItem *dependency) override; - - 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; - void resizeVia(int32 w) const; - 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; - - PeerData *replyTo() const { - return replyToMsg ? replyToMsg->author() : 0; - } - QString selectedText(uint32 selection) const override; - - HistoryReply *toHistoryReply() override { // dynamic_cast optimize - return this; - } - const HistoryReply *toHistoryReply() const override { // dynamic_cast optimize - return this; - } - - ~HistoryReply(); - -protected: - - HistoryReply(History *history, const MTPDmessage &msg); - 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 resizeGetHeight_(int width) override; - - bool updateReplyTo(bool force = false); - void replyToNameUpdated() const; - - MsgId replyToMsgId; - HistoryItem *replyToMsg; - TextLinkPtr replyToLnk; - mutable Text replyToName, replyToText; - mutable int32 replyToVersion; - mutable int32 _maxReplyWidth; - HistoryMessageVia *_replyToVia; - int32 toWidth; + void createInterfacesHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId); + void createInterfaces(MsgId replyTo, int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal = 0, const PeerId &fromIdOriginal = 0, MsgId originalId = 0); }; @@ -2627,7 +2633,7 @@ inline MTPDmessage::Flags newForwardedFlags(PeerData *p, int32 from, HistoryMess if (from) { result |= MTPDmessage::Flag::f_from_id; } - if (fwd->Is()) { + if (fwd->Has()) { result |= MTPDmessage::Flag::f_via_bot_id; } if (!p->isChannel()) { @@ -2642,21 +2648,22 @@ inline MTPDmessage::Flags newForwardedFlags(PeerData *p, int32 from, HistoryMess return result; } -struct HistoryServicePinned : public BasicInterface { - HistoryServicePinned(Interfaces *); +struct HistoryServicePinned : public BaseComponent { + HistoryServicePinned(Composer*) { + } - MsgId msgId; - HistoryItem *msg; + MsgId msgId = 0; + HistoryItem *msg = nullptr; TextLinkPtr lnk; }; -class HistoryServiceMessage : public HistoryItem, private HistoryItemInstantiated { +class HistoryService : public HistoryItem, private HistoryItemInstantiated { public: - static HistoryServiceMessage *create(History *history, const MTPDmessageService &msg) { + static HistoryService *create(History *history, const MTPDmessageService &msg) { return _create(history, msg); } - static HistoryServiceMessage *create(History *history, MsgId msgId, QDateTime date, const QString &msg, MTPDmessage::Flags flags = 0, HistoryMedia *media = 0, int32 from = 0) { + static HistoryService *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); } @@ -2710,13 +2717,13 @@ public: void setServiceText(const QString &text); - ~HistoryServiceMessage(); + ~HistoryService(); protected: - 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; + HistoryService(History *history, const MTPDmessageService &msg); + HistoryService(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 resizeGetHeight_(int width) override; @@ -2731,7 +2738,7 @@ protected: int32 _textWidth, _textHeight; }; -class HistoryGroup : public HistoryServiceMessage, private HistoryItemInstantiated { +class HistoryGroup : public HistoryService, private HistoryItemInstantiated { public: static HistoryGroup *create(History *history, const MTPDmessageGroup &group, const QDateTime &date) { @@ -2787,7 +2794,7 @@ private: }; -class HistoryCollapse : public HistoryServiceMessage, private HistoryItemInstantiated { +class HistoryCollapse : public HistoryService, private HistoryItemInstantiated { public: static HistoryCollapse *create(History *history, MsgId wasMinId, const QDateTime &date) { @@ -2822,7 +2829,7 @@ private: }; -class HistoryJoined : public HistoryServiceMessage, private HistoryItemInstantiated { +class HistoryJoined : public HistoryService, 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 ab66e46394..902fe59c53 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -948,7 +948,8 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); bool lnkIsVideo = lnkDocument ? lnkDocument->document()->isVideo() : false; - bool lnkIsAudio = lnkDocument ? (lnkDocument->document()->voice() != 0) : false; + bool lnkIsAudio = lnkDocument ? (lnkDocument->document()->voice() != nullptr) : false; + bool lnkIsSong = lnkDocument ? (lnkDocument->document()->song() != nullptr) : false; if (lnkPhoto || lnkDocument) { if (isUponSelected > 0) { _menu->addAction(lang(lng_context_copy_selected), this, SLOT(copySelectedText()))->setEnabled(true); @@ -978,7 +979,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkDocument && !lnkDocument->document()->filepath(DocumentData::FilePathResolveChecked).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : (lnkIsSong ? lng_context_save_audio_file : lng_context_save_file))), this, SLOT(saveContextFile()))->setEnabled(true); } } if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) { @@ -5996,7 +5997,7 @@ void HistoryWidget::onPhotoUploaded(const FullMsgId &newId, bool silent, const M uint64 randomId = rand_value(); App::historyRegRandom(randomId, newId); History *hist = item->history(); - MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; + MsgId replyTo = item->replyToId(); MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; @@ -6048,7 +6049,7 @@ void HistoryWidget::onDocumentUploaded(const FullMsgId &newId, bool silent, cons uint64 randomId = rand_value(); App::historyRegRandom(randomId, newId); History *hist = item->history(); - MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; + MsgId replyTo = item->replyToId(); MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; @@ -6077,7 +6078,7 @@ void HistoryWidget::onThumbDocumentUploaded(const FullMsgId &newId, bool silent, uint64 randomId = rand_value(); App::historyRegRandom(randomId, newId); History *hist = item->history(); - MsgId replyTo = item->toHistoryReply() ? item->toHistoryReply()->replyToId() : 0; + MsgId replyTo = item->replyToId(); MTPmessages_SendMedia::Flags sendFlags = 0; if (replyTo) { sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to_msg_id; @@ -6986,7 +6987,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() { } else if (_pinnedBar->msgId != pinnedMsgId) { _pinnedBar->msgId = pinnedMsgId; _pinnedBar->msg = 0; - _pinnedBar->text.clean(); + _pinnedBar->text.clear(); updatePinnedBar(); update(); } diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 87998c2fc5..794d81de5c 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -293,9 +293,10 @@ void LayoutAbstractFileItem::setStatusSize(int32 newSize, int32 fullSize, int32 } } -LayoutOverviewDate::LayoutOverviewDate(const QDate &date, bool month) : LayoutItem(OverviewItemInfo::Bit()) +LayoutOverviewDate::LayoutOverviewDate(const QDate &date, bool month) : LayoutItem() , _date(date) , _text(month ? langMonthFull(date) : langDayOfMonthFull(date)) { + AddComponents(OverviewItemInfo::Bit()); } void LayoutOverviewDate::initDimensions() { @@ -311,7 +312,7 @@ void LayoutOverviewDate::paint(Painter &p, const QRect &clip, uint32 selection, } } -LayoutOverviewPhoto::LayoutOverviewPhoto(PhotoData *photo, HistoryItem *parent) : LayoutMediaItem(0, parent) +LayoutOverviewPhoto::LayoutOverviewPhoto(PhotoData *photo, HistoryItem *parent) : LayoutMediaItem(parent) , _data(photo) , _link(new PhotoLink(photo)) , _goodLoaded(false) { @@ -385,7 +386,7 @@ void LayoutOverviewPhoto::getState(TextLinkPtr &link, HistoryCursorState &cursor } } -LayoutOverviewVideo::LayoutOverviewVideo(DocumentData *video, HistoryItem *parent) : LayoutAbstractFileItem(0, parent) +LayoutOverviewVideo::LayoutOverviewVideo(DocumentData *video, HistoryItem *parent) : LayoutAbstractFileItem(parent) , _data(video) , _duration(formatDurationText(_data->duration())) , _thumbLoaded(false) { @@ -549,9 +550,11 @@ void LayoutOverviewVideo::updateStatusText() const { } } -LayoutOverviewVoice::LayoutOverviewVoice(DocumentData *voice, HistoryItem *parent) : LayoutAbstractFileItem(OverviewItemInfo::Bit(), parent) +LayoutOverviewVoice::LayoutOverviewVoice(DocumentData *voice, HistoryItem *parent) : LayoutAbstractFileItem(parent) , _data(voice) , _namel(new DocumentOpenLink(_data)) { + AddComponents(OverviewItemInfo::Bit()); + t_assert(_data->voice() != 0); setLinks(new DocumentOpenLink(_data), new DocumentOpenLink(_data), new DocumentCancelLink(_data)); @@ -741,7 +744,7 @@ bool LayoutOverviewVoice::updateStatusText() const { return showPause; } -LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryItem *parent) : LayoutAbstractFileItem(OverviewItemInfo::Bit(), parent) +LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryItem *parent) : LayoutAbstractFileItem(parent) , _data(document) , _msgl(new MessageLink(parent)) , _namel(new DocumentOpenLink(_data)) @@ -751,6 +754,8 @@ LayoutOverviewDocument::LayoutOverviewDocument(DocumentData *document, HistoryIt , _namew(st::semiboldFont->width(_name)) , _datew(st::normalFont->width(_date)) , _colorIndex(documentColorIndex(_data, _ext)) { + AddComponents(OverviewItemInfo::Bit()); + setLinks(new DocumentOpenLink(_data), new DocumentSaveLink(_data), new DocumentCancelLink(_data)); setStatusSize(FileStatusSizeReady, _data->size, _data->song() ? _data->song()->duration : -1, 0); @@ -1066,7 +1071,9 @@ namespace { } } -LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent) : LayoutMediaItem(OverviewItemInfo::Bit(), parent) { +LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent) : LayoutMediaItem(parent) { + AddComponents(OverviewItemInfo::Bit()); + QString text = _parent->originalText(); EntitiesInText entities = _parent->originalEntities(); @@ -1319,7 +1326,7 @@ LayoutOverviewLink::Link::Link(const QString &url, const QString &text) , lnk(linkFromUrl(url)) { } -LayoutInlineItem::LayoutInlineItem(InlineResult *result, DocumentData *doc, PhotoData *photo) : LayoutItem(0) +LayoutInlineItem::LayoutInlineItem(InlineResult *result, DocumentData *doc, PhotoData *photo) : LayoutItem() , _result(result) , _doc(doc) , _photo(photo) diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index d52d1e3eb5..a91d83bb2f 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -101,10 +101,11 @@ public: }; class LayoutMediaItem; -class LayoutItem : public Interfaces { +class LayoutItem : public Composer { public: - LayoutItem(uint64 i_mask) : Interfaces(i_mask), _maxw(0), _minh(0) { + LayoutItem() { } + LayoutItem &operator=(const LayoutItem &) = delete; int32 maxWidth() const { return _maxw; @@ -167,14 +168,16 @@ public: } protected: - int32 _width, _height, _maxw, _minh; - LayoutItem &operator=(const LayoutItem &); + int _width = 0; + int _height = 0; + int _maxw = 0; + int _minh = 0; }; class LayoutMediaItem : public LayoutItem { public: - LayoutMediaItem(uint64 i_mask, HistoryItem *parent) : LayoutItem(i_mask), _parent(parent) { + LayoutMediaItem(HistoryItem *parent) : _parent(parent) { } virtual LayoutMediaItem *toLayoutMediaItem() { @@ -194,7 +197,7 @@ protected: class LayoutRadialProgressItem : public LayoutMediaItem { public: - LayoutRadialProgressItem(uint64 i_mask, HistoryItem *parent) : LayoutMediaItem(i_mask, parent) + LayoutRadialProgressItem(HistoryItem *parent) : LayoutMediaItem(parent) , _radial(0) , a_iconOver(0, 0) , _a_iconOver(animation(this, &LayoutRadialProgressItem::step_iconOver)) { @@ -240,7 +243,7 @@ private: class LayoutAbstractFileItem : public LayoutRadialProgressItem { public: - LayoutAbstractFileItem(uint64 i_mask, HistoryItem *parent) : LayoutRadialProgressItem(i_mask, parent) { + LayoutAbstractFileItem(HistoryItem *parent) : LayoutRadialProgressItem(parent) { } protected: @@ -268,19 +271,19 @@ public: }; -class OverviewItemInfo : public BasicInterface { +class OverviewItemInfo : public BaseComponent { public: - OverviewItemInfo(Interfaces *) : _top(0) { + OverviewItemInfo(Composer*) { } - int32 top() const { + int top() const { return _top; } - void setTop(int32 top) { + void setTop(int top) { _top = top; } private: - int32 _top; + int _top = 0; }; diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 16fed59d54..035b1b5a37 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -3550,7 +3550,7 @@ namespace Local { return result; } - void _writePeer(QDataStream &stream, PeerData *peer, int32 fileVersion = AppVersion) { + void _writePeer(QDataStream &stream, PeerData *peer) { stream << quint64(peer->id) << quint64(peer->photoId); _writeStorageImageLocation(stream, peer->photoLoc); if (peer->isUser()) { @@ -3560,7 +3560,7 @@ namespace Local { if (AppVersion >= 9012) { stream << qint32(user->flags); } - if (AppVersion >= 9016 || fileVersion >= 9016) { + if (AppVersion >= 9016) { stream << (user->botInfo ? user->botInfo->inlinePlaceholder : QString()); } stream << qint32(user->onlineTill) << qint32(user->contact) << qint32(user->botInfo ? user->botInfo->version : -1); @@ -3580,18 +3580,16 @@ namespace Local { } PeerData *_readPeer(FileReadDescriptor &from, int32 fileVersion = 0) { - PeerData *result = 0; quint64 peerId = 0, photoId = 0; from.stream >> peerId >> photoId; StorageImageLocation photoLoc(_readStorageImageLocation(from)); - result = App::peerLoaded(peerId); - bool wasLoaded = (result && result->loaded); - + PeerData *result = App::peerLoaded(peerId); + bool wasLoaded = (result != nullptr); if (!wasLoaded) { result = App::peer(peerId); - result->loaded = true; + result->loadedStatus = PeerData::FullLoaded; } if (result->isUser()) { UserData *user = result->asUser(); @@ -3737,7 +3735,7 @@ namespace Local { } data.stream << quint32(botsCnt); for (RecentInlineBots::const_iterator i = bots.cbegin(), e = bots.cend(); i != e; ++i) { - _writePeer(data.stream, *i, 9016); + _writePeer(data.stream, *i); } FileWriteDescriptor file(_recentHashtagsAndBotsKey); file.writeEncrypted(data); diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 1833b42969..2f2805d1ed 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4099,17 +4099,17 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { case mtpc_updateShortMessage: { const MTPDupdateShortMessage &d(updates.c_updateShortMessage()); - if (!App::userLoaded(d.vuser_id.v) || (d.has_via_bot_id() && !App::peerLoaded(peerFromUser(d.vvia_bot_id)))) { + if (!App::userLoaded(d.vuser_id.v) || (d.has_via_bot_id() && !App::userLoaded(d.vvia_bot_id.v))) { MTP_LOG(0, ("getDifference { good - getting user for updateShortMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); } if (d.has_fwd_from() && d.vfwd_from.type() == mtpc_messageFwdHeader) { const MTPDmessageFwdHeader &f(d.vfwd_from.c_messageFwdHeader()); - if (f.has_from_id() && !App::peerLoaded(peerFromUser(f.vfrom_id))) { + if (f.has_from_id() && !App::userLoaded(f.vfrom_id.v)) { MTP_LOG(0, ("getDifference { good - getting user for updateShortMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); } - if (f.has_channel_id() && !App::peerLoaded(peerFromChannel(f.vchannel_id))) { + if (f.has_channel_id() && !App::channelLoaded(f.vchannel_id.v)) { MTP_LOG(0, ("getDifference { good - getting user for updateShortMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); } @@ -4133,18 +4133,18 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) { case mtpc_updateShortChatMessage: { const MTPDupdateShortChatMessage &d(updates.c_updateShortChatMessage()); bool noFrom = !App::userLoaded(d.vfrom_id.v); - if (!App::chatLoaded(d.vchat_id.v) || noFrom || (d.has_via_bot_id() && !App::peerLoaded(peerFromUser(d.vvia_bot_id)))) { + if (!App::chatLoaded(d.vchat_id.v) || noFrom || (d.has_via_bot_id() && !App::userLoaded(d.vvia_bot_id.v))) { MTP_LOG(0, ("getDifference { good - getting user for updateShortChatMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); if (noFrom && App::api()) App::api()->requestFullPeer(App::chatLoaded(d.vchat_id.v)); return getDifference(); } if (d.has_fwd_from() && d.vfwd_from.type() == mtpc_messageFwdHeader) { const MTPDmessageFwdHeader &f(d.vfwd_from.c_messageFwdHeader()); - if (f.has_from_id() && !App::peerLoaded(peerFromUser(f.vfrom_id))) { + if (f.has_from_id() && !App::userLoaded(f.vfrom_id.v)) { MTP_LOG(0, ("getDifference { good - getting user for updateShortChatMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); } - if (f.has_channel_id() && !App::peerLoaded(peerFromChannel(f.vchannel_id))) { + if (f.has_channel_id() && !App::channelLoaded(f.vchannel_id.v)) { MTP_LOG(0, ("getDifference { good - getting user for updateShortChatMessage }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); } @@ -4357,9 +4357,9 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { case mtpc_updateChatUserTyping: { const MTPDupdateChatUserTyping &d(update.c_updateChatUserTyping()); History *history = 0; - if (PeerData *chat = App::peerLoaded(peerFromChat(d.vchat_id.v))) { + if (PeerData *chat = App::chatLoaded(d.vchat_id.v)) { history = App::historyLoaded(chat->id); - } else if (PeerData *channel = App::peerLoaded(peerFromChannel(d.vchat_id.v))) { + } else if (PeerData *channel = App::channelLoaded(d.vchat_id.v)) { history = App::historyLoaded(channel->id); } UserData *user = (d.vuser_id.v == MTP::authedId()) ? 0 : App::userLoaded(d.vuser_id.v); diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index c75c846985..f0c06c53db 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1267,8 +1267,9 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { _contextMenuLnk = textlnkOver(); PhotoLink *lnkPhoto = dynamic_cast(_contextMenuLnk.data()); DocumentLink *lnkDocument = dynamic_cast(_contextMenuLnk.data()); - bool lnkIsAudio = lnkDocument ? (lnkDocument->document()->voice() != 0) : false; bool lnkIsVideo = lnkDocument ? lnkDocument->document()->isVideo() : false; + bool lnkIsAudio = lnkDocument ? (lnkDocument->document()->voice() != nullptr) : false; + bool lnkIsSong = lnkDocument ? (lnkDocument->document()->song() != nullptr) : false; if (lnkPhoto || lnkDocument) { _menu = new PopupMenu(); if (App::hoveredLinkItem()) { @@ -1282,7 +1283,7 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { if (lnkDocument && !lnkDocument->document()->filepath(DocumentData::FilePathResolveChecked).isEmpty()) { _menu->addAction(lang((cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? lng_context_show_in_finder : lng_context_show_in_folder), this, SLOT(showContextInFolder()))->setEnabled(true); } - _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : lng_context_save_file)), this, SLOT(saveContextFile()))->setEnabled(true); + _menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsAudio ? lng_context_save_audio : (lnkIsSong ? lng_context_save_audio_file : lng_context_save_file))), this, SLOT(saveContextFile()))->setEnabled(true); } } if (isUponSelected > 1) { diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 0426f86201..85932fb314 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -35,8 +35,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org #include "localstorage.h" namespace { - int32 peerColorIndex(const PeerId &peer) { - int32 myId(MTP::authedId()), peerId(peerToBareInt(peer)); + int peerColorIndex(const PeerId &peer) { + UserId myId(MTP::authedId()), peerId(peerToBareInt(peer)); QByteArray both(qsl("%1%2").arg(peerId).arg(myId).toUtf8()); if (both.size() > 15) { both = both.mid(0, 15); @@ -47,7 +47,7 @@ namespace { } } -style::color peerColor(int32 index) { +style::color peerColor(int index) { static const style::color peerColors[8] = { style::color(st::color1), style::color(st::color2), @@ -61,7 +61,7 @@ style::color peerColor(int32 index) { return peerColors[index]; } -ImagePtr userDefPhoto(int32 index) { +ImagePtr userDefPhoto(int index) { static const ImagePtr userDefPhotos[UserColorsCount] = { ImagePtr(qsl(":/ava/art/usercolor1.png"), "PNG"), ImagePtr(qsl(":/ava/art/usercolor2.png"), "PNG"), @@ -75,7 +75,7 @@ ImagePtr userDefPhoto(int32 index) { return userDefPhotos[index]; } -ImagePtr chatDefPhoto(int32 index) { +ImagePtr chatDefPhoto(int index) { static const ImagePtr chatDefPhotos[4] = { ImagePtr(qsl(":/ava/art/chatcolor1.png"), "PNG"), ImagePtr(qsl(":/ava/art/chatcolor2.png"), "PNG"), @@ -85,7 +85,7 @@ ImagePtr chatDefPhoto(int32 index) { return chatDefPhotos[index]; } -ImagePtr channelDefPhoto(int32 index) { +ImagePtr channelDefPhoto(int index) { static const ImagePtr channelDefPhotos[4] = { ImagePtr(qsl(":/ava/art/channelcolor1.png"), "PNG"), ImagePtr(qsl(":/ava/art/channelcolor2.png"), "PNG"), @@ -100,7 +100,7 @@ NotifySettingsPtr globalNotifyAllPtr = UnknownNotifySettings, globalNotifyUsersP PeerData::PeerData(const PeerId &id) : id(id) , lnk(new PeerLink(this)) -, loaded(false) +, loadedStatus(NotLoaded) , colorIndex(peerColorIndex(id)) , color(peerColor(colorIndex)) , photoId(UnknownPeerPhotoId) @@ -279,7 +279,7 @@ void UserData::setPhone(const QString &newPhone) { phone = newPhone; } -void UserData::setBotInfoVersion(int32 version) { +void UserData::setBotInfoVersion(int version) { if (version < 0) { if (botInfo) { if (!botInfo->commands.isEmpty()) { @@ -850,7 +850,7 @@ QString documentSaveFilename(const DocumentData *data, bool forceSavingAs = fals } else { filter = mimeType.filterString() + qsl(";;All files (*.*)"); } - caption = lang(lng_save_file); + caption = lang(data->song() ? lng_save_audio_file : lng_save_file); prefix = qsl("doc"); } diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 4896a0cea9..6546a8c039 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -20,9 +20,21 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once +typedef int32 UserId; +typedef int32 ChatId; typedef int32 ChannelId; static const ChannelId NoChannel = 0; +typedef int32 MsgId; +struct FullMsgId { + FullMsgId() : channel(NoChannel), msg(0) { + } + FullMsgId(ChannelId channel, MsgId msg) : channel(channel), msg(msg) { + } + ChannelId channel; + MsgId msg; +}; + typedef uint64 PeerId; static const uint64 PeerIdMask = 0xFFFFFFFFULL; static const uint64 PeerIdTypeMask = 0x300000000ULL; @@ -38,10 +50,10 @@ inline bool peerIsChat(const PeerId &id) { inline bool peerIsChannel(const PeerId &id) { return (id & PeerIdTypeMask) == PeerIdChannelShift; } -inline PeerId peerFromUser(int32 user_id) { +inline PeerId peerFromUser(UserId user_id) { return PeerIdUserShift | uint64(uint32(user_id)); } -inline PeerId peerFromChat(int32 chat_id) { +inline PeerId peerFromChat(ChatId chat_id) { return PeerIdChatShift | uint64(uint32(chat_id)); } inline PeerId peerFromChannel(ChannelId channel_id) { @@ -59,10 +71,10 @@ inline PeerId peerFromChannel(const MTPint &channel_id) { inline int32 peerToBareInt(const PeerId &id) { return int32(uint32(id & PeerIdMask)); } -inline int32 peerToUser(const PeerId &id) { +inline UserId peerToUser(const PeerId &id) { return peerIsUser(id) ? peerToBareInt(id) : 0; } -inline int32 peerToChat(const PeerId &id) { +inline ChatId peerToChat(const PeerId &id) { return peerIsChat(id) ? peerToBareInt(id) : 0; } inline ChannelId peerToChannel(const PeerId &id) { @@ -112,7 +124,7 @@ inline MTPDmessage::Flags flagsFromMessage(const MTPmessage &msg) { } return 0; } -inline int32 idFromMessage(const MTPmessage &msg) { +inline MsgId idFromMessage(const MTPmessage &msg) { switch (msg.type()) { case mtpc_messageEmpty: return msg.c_messageEmpty().vid.v; case mtpc_message: return msg.c_message().vid.v; @@ -120,7 +132,7 @@ inline int32 idFromMessage(const MTPmessage &msg) { } return 0; } -inline int32 dateFromMessage(const MTPmessage &msg) { +inline TimeId dateFromMessage(const MTPmessage &msg) { switch (msg.type()) { case mtpc_message: return msg.c_message().vdate.v; case mtpc_messageService: return msg.c_messageService().vdate.v; @@ -135,15 +147,6 @@ typedef uint64 DocumentId; typedef uint64 WebPageId; static const WebPageId CancelledWebPageId = 0xFFFFFFFFFFFFFFFFULL; -typedef int32 MsgId; -struct FullMsgId { - FullMsgId() : channel(NoChannel), msg(0) { - } - FullMsgId(ChannelId channel, MsgId msg) : channel(channel), msg(msg) { - } - ChannelId channel; - MsgId msg; -}; inline bool operator==(const FullMsgId &a, const FullMsgId &b) { return (a.channel == b.channel) && (a.msg == b.msg); } @@ -168,7 +171,7 @@ struct NotifySettings { NotifySettings() : flags(MTPDpeerNotifySettings::Flag::f_show_previews), mute(0), sound("default") { } MTPDpeerNotifySettings::Flags flags; - int32 mute; + TimeId mute; string sound; bool previews() const { return flags & MTPDpeerNotifySettings::Flag::f_show_previews; @@ -184,9 +187,9 @@ static const NotifySettingsPtr EmptyNotifySettings = NotifySettingsPtr(1); extern NotifySettings globalNotifyAll, globalNotifyUsers, globalNotifyChats; extern NotifySettingsPtr globalNotifyAllPtr, globalNotifyUsersPtr, globalNotifyChatsPtr; -inline bool isNotifyMuted(NotifySettingsPtr settings, int32 *changeIn = 0) { +inline bool isNotifyMuted(NotifySettingsPtr settings, TimeId *changeIn = 0) { if (settings != UnknownNotifySettings && settings != EmptyNotifySettings) { - int32 t = unixtime(); + TimeId t = unixtime(); if (settings->mute > t) { if (changeIn) *changeIn = settings->mute - t + 1; return true; @@ -196,12 +199,12 @@ inline bool isNotifyMuted(NotifySettingsPtr settings, int32 *changeIn = 0) { return false; } -static const int32 UserColorsCount = 8; +static const int UserColorsCount = 8; -style::color peerColor(int32 index); -ImagePtr userDefPhoto(int32 index); -ImagePtr chatDefPhoto(int32 index); -ImagePtr channelDefPhoto(int32 index); +style::color peerColor(int index); +ImagePtr userDefPhoto(int index); +ImagePtr chatDefPhoto(int index); +ImagePtr channelDefPhoto(int index); static const PhotoId UnknownPeerPhotoId = 0xFFFFFFFFFFFFFFFFULL; @@ -276,10 +279,15 @@ public: typedef QSet NameFirstChars; NameFirstChars chars; - bool loaded; + enum LoadedStatus { + NotLoaded = 0x00, + MinimalLoaded = 0x01, + FullLoaded = 0x02, + }; + LoadedStatus loadedStatus; MTPinputPeer input; - int32 colorIndex; + int colorIndex; style::color color; void setUserpic(ImagePtr userpic); @@ -297,7 +305,7 @@ public: PhotoId photoId; StorageImageLocation photoLoc; - int32 nameVersion; + int nameVersion; NotifySettingsPtr notify; @@ -358,7 +366,7 @@ struct BotInfo { } bool inited; bool readsAllHistory, cantJoinGroups; - int32 version; + int version; QString description, inlinePlaceholder; QList commands; Text text; // description @@ -382,7 +390,7 @@ public: void setPhoto(const MTPUserProfilePhoto &photo); void setName(const QString &first, const QString &last, const QString &phoneName, const QString &username); void setPhone(const QString &newPhone); - void setBotInfoVersion(int32 version); + void setBotInfoVersion(int version); void setBotInfo(const MTPBotInfo &info); void setNameOrPhone(const QString &newNameOrPhone); @@ -407,13 +415,13 @@ public: QString phone; QString nameOrPhone; Text phoneText; - int32 onlineTill = 0; + TimeId onlineTill = 0; int32 contact = -1; // -1 - not contact, cant add (self, empty, deleted, foreign), 0 - not contact, can add (request), 1 - contact UserBlockedStatus blocked = UserBlockUnknown; typedef QList Photos; Photos photos; - int32 photosCount = -1; // -1 not loaded, 0 all loaded + int photosCount = -1; // -1 not loaded, 0 all loaded QString about; @@ -462,10 +470,10 @@ public: ChannelData *migrateToPtr; - int32 count; - int32 date; - int32 version; - int32 creator; + int count; + TimeId date; + int version; + UserId creator; MTPDchat::Flags flags; bool isForbidden; @@ -499,7 +507,7 @@ public: bool isMigrated() const { return flags & MTPDchat::Flag::f_migrated_to; } - typedef QMap Participants; + typedef QMap Participants; Participants participants; typedef OrderedSet InvitedByMe; InvitedByMe invitedByMe; @@ -753,29 +761,59 @@ private: }; +inline bool isUser(const PeerData *peer) { + return peer ? peer->isUser() : false; +} inline UserData *PeerData::asUser() { - return isUser() ? static_cast(this) : 0; + return isUser() ? static_cast(this) : nullptr; +} +inline UserData *asUser(PeerData *peer) { + return peer ? peer->asUser() : nullptr; } inline const UserData *PeerData::asUser() const { - return isUser() ? static_cast(this) : 0; + return isUser() ? static_cast(this) : nullptr; +} +inline const UserData *asUser(const PeerData *peer) { + return peer ? peer->asUser() : nullptr; +} +inline bool isChat(const PeerData *peer) { + return peer ? peer->isChat() : false; } inline ChatData *PeerData::asChat() { - return isChat() ? static_cast(this) : 0; + return isChat() ? static_cast(this) : nullptr; +} +inline ChatData *asChat(PeerData *peer) { + return peer ? peer->asChat() : nullptr; } inline const ChatData *PeerData::asChat() const { - return isChat() ? static_cast(this) : 0; + return isChat() ? static_cast(this) : nullptr; +} +inline const ChatData *asChat(const PeerData *peer) { + return peer ? peer->asChat() : nullptr; +} +inline bool isChannel(const PeerData *peer) { + return peer ? peer->isChannel() : false; } inline ChannelData *PeerData::asChannel() { - return isChannel() ? static_cast(this) : 0; + return isChannel() ? static_cast(this) : nullptr; +} +inline ChannelData *asChannel(PeerData *peer) { + return peer ? peer->asChannel() : nullptr; } inline const ChannelData *PeerData::asChannel() const { - return isChannel() ? static_cast(this) : 0; + return isChannel() ? static_cast(this) : nullptr; +} +inline const ChannelData *asChannel(const PeerData *peer) { + return peer ? peer->asChannel() : nullptr; +} +inline bool isMegagroup(const PeerData *peer) { + return peer ? peer->isMegagroup() : false; } inline ChatData *PeerData::migrateFrom() const { - return (isMegagroup() && asChannel()->amIn()) ? asChannel()->mgInfo->migrateFromPtr : 0; + return (isMegagroup() && asChannel()->amIn()) ? asChannel()->mgInfo->migrateFromPtr : nullptr; } inline ChannelData *PeerData::migrateTo() const { - return (isChat() && asChat()->migrateToPtr && asChat()->migrateToPtr->amIn()) ? asChat()->migrateToPtr : 0; + return (isChat() && asChat()->migrateToPtr && asChat()->migrateToPtr->amIn()) ? asChat()->migrateToPtr : nullptr; } inline const Text &PeerData::dialogName() const { return migrateTo() ? migrateTo()->dialogName() : ((isUser() && !asUser()->phoneText.isEmpty()) ? asUser()->phoneText : nameText); @@ -998,11 +1036,14 @@ public: SongData *song() { return (type == SongDocument) ? static_cast(_additional) : 0; } + const SongData *song() const { + return (type == SongDocument) ? static_cast(_additional) : 0; + } VoiceData *voice() { return (type == VoiceDocument) ? static_cast(_additional) : 0; } const VoiceData *voice() const { - return (type == VoiceDocument) ? static_cast(_additional) : 0; + return (type == VoiceDocument) ? static_cast(_additional) : 0; } bool isAnimation() const { return (type == AnimatedDocument) || !mime.compare(qstr("image/gif"), Qt::CaseInsensitive); diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 6f0b408d91..e4541be906 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -120,8 +120,8 @@ namespace { } } -int32 myunixtime() { - return (int32)time(NULL); +TimeId myunixtime() { + return (TimeId)time(NULL); } void unixtimeInit() { @@ -149,19 +149,19 @@ void unixtimeSet(int32 serverTime, bool force) { _initMsgIdConstants(); } -int32 unixtime() { - int32 result = myunixtime(); +TimeId unixtime() { + TimeId result = myunixtime(); QReadLocker locker(&unixtimeLock); return result + unixtimeDelta; } -int32 fromServerTime(const MTPint &serverTime) { +TimeId fromServerTime(const MTPint &serverTime) { QReadLocker locker(&unixtimeLock); return serverTime.v - unixtimeDelta; } -MTPint toServerTime(const int32 &clientTime) { +MTPint toServerTime(const TimeId &clientTime) { QReadLocker locker(&unixtimeLock); return MTP_int(clientTime + unixtimeDelta); } @@ -1034,35 +1034,32 @@ MimeType mimeTypeForData(const QByteArray &data) { return MimeType(QMimeDatabase().mimeTypeForData(data)); } -class InterfacesMetadatasMap : public QMap { -public: - ~InterfacesMetadatasMap() { - for (const_iterator i = cbegin(), e = cend(); i != e; ++i) { - delete i.value(); +struct ComposerMetadatasMap { + QMap data; + ~ComposerMetadatasMap() { + for_const (const ComposerMetadata *p, data) { + delete p; } } }; -const InterfacesMetadata *GetInterfacesMetadata(uint64 mask) { - typedef QMap InterfacesMetadatasMap; - static InterfacesMetadatasMap InterfacesMetadatas; - static QMutex InterfacesMetadatasMutex; +const ComposerMetadata *GetComposerMetadata(uint64 mask) { + static ComposerMetadatasMap ComposerMetadatas; + static QMutex ComposerMetadatasMutex; - QMutexLocker lock(&InterfacesMetadatasMutex); - InterfacesMetadatasMap::const_iterator i = InterfacesMetadatas.constFind(mask); - if (i == InterfacesMetadatas.cend()) { - InterfacesMetadata *meta = new InterfacesMetadata(mask); - if (!meta) { // terminate if we can't allocate memory - throw "Can't allocate memory!"; - } + QMutexLocker lock(&ComposerMetadatasMutex); + auto i = ComposerMetadatas.data.constFind(mask); + if (i == ComposerMetadatas.data.cend()) { + ComposerMetadata *meta = new ComposerMetadata(mask); + t_assert(meta != nullptr); - i = InterfacesMetadatas.insert(mask, meta); + i = ComposerMetadatas.data.insert(mask, meta); } return i.value(); } -const InterfacesMetadata *Interfaces::ZeroInterfacesMetadata = GetInterfacesMetadata(0); +const ComposerMetadata *Composer::ZeroComposerMetadata = GetComposerMetadata(0); -InterfaceWrapStruct InterfaceWraps[64]; +ComponentWrapStruct ComponentWraps[64]; -QAtomicInt InterfaceIndexLast(0); +QAtomicInt ComponentIndexLast; diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index fd6ea24381..4d32633322 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -104,6 +104,30 @@ using std::string; using std::exception; using std::swap; +// we copy some parts of C++11 std:: library, because on OS X 10.6+ +// version we can use C++11, but we can't use its library :( +namespace std11 { + +template +struct remove_reference { + typedef T type; +}; +template +struct remove_reference { + typedef T type; +}; +template +struct remove_reference { + typedef T type; +}; + +template +inline typename remove_reference::type &&move(T &&value) { + return static_cast::type&&>(value); +} + +} // namespace std11 + #include "logs.h" static volatile int *t_assert_nullptr = 0; @@ -140,12 +164,12 @@ private: }; class MTPint; - -int32 myunixtime(); +typedef int32 TimeId; +TimeId myunixtime(); void unixtimeInit(); -void unixtimeSet(int32 servertime, bool force = false); -int32 unixtime(); -int32 fromServerTime(const MTPint &serverTime); +void unixtimeSet(TimeId servertime, bool force = false); +TimeId unixtime(); +TimeId fromServerTime(const MTPint &serverTime); uint64 msgid(); int32 reqid(); @@ -541,24 +565,26 @@ inline void destroyImplementation(I *&ptr) { deleteAndMark(ptr); } -class Interfaces; -typedef void(*InterfaceConstruct)(void *location, Interfaces *interfaces); -typedef void(*InterfaceDestruct)(void *location); -typedef void(*InterfaceMove)(void *location, void *waslocation); +class Composer; +typedef void(*ComponentConstruct)(void *location, Composer *composer); +typedef void(*ComponentDestruct)(void *location); +typedef void(*ComponentMove)(void *location, void *waslocation); -struct InterfaceWrapStruct { - InterfaceWrapStruct() : Size(0), Construct(0), Destruct(0) { +struct ComponentWrapStruct { + // don't init any fields, because it is only created in + // global scope, so it will be filled by zeros from the start + ComponentWrapStruct() { } - InterfaceWrapStruct(int size, InterfaceConstruct construct, InterfaceDestruct destruct, InterfaceMove move) + ComponentWrapStruct(int size, ComponentConstruct construct, ComponentDestruct destruct, ComponentMove move) : Size(size) , Construct(construct) , Destruct(destruct) , Move(move) { } int Size; - InterfaceConstruct Construct; - InterfaceDestruct Destruct; - InterfaceMove Move; + ComponentConstruct Construct; + ComponentDestruct Destruct; + ComponentMove Move; }; template @@ -567,36 +593,43 @@ struct CeilDivideMinimumOne { }; template -struct InterfaceWrapTemplate { +struct ComponentWrapTemplate { static const int Size = CeilDivideMinimumOne::Result * sizeof(uint64); - static void Construct(void *location, Interfaces *interfaces) { - new (location) Type(interfaces); + static void Construct(void *location, Composer *composer) { + new (location) Type(composer); } static void Destruct(void *location) { ((Type*)location)->~Type(); } static void Move(void *location, void *waslocation) { - *(Type*)location = *(Type*)waslocation; + *(Type*)location = std11::move(*(Type*)waslocation); } }; -extern InterfaceWrapStruct InterfaceWraps[64]; -extern QAtomicInt InterfaceIndexLast; +extern ComponentWrapStruct ComponentWraps[64]; +extern QAtomicInt ComponentIndexLast; template -class BasicInterface { +class BaseComponent { public: + BaseComponent() { + } + BaseComponent(const BaseComponent &other) = delete; + BaseComponent &operator=(const BaseComponent &other) = delete; + BaseComponent(BaseComponent &&other) = delete; + BaseComponent &operator=(BaseComponent &&other) = default; + static int Index() { static QAtomicInt _index(0); if (int index = _index.loadAcquire()) { return index - 1; } while (true) { - int last = InterfaceIndexLast.loadAcquire(); - if (InterfaceIndexLast.testAndSetOrdered(last, last + 1)) { + int last = ComponentIndexLast.loadAcquire(); + if (ComponentIndexLast.testAndSetOrdered(last, last + 1)) { t_assert(last < 64); if (_index.testAndSetOrdered(0, last + 1)) { - InterfaceWraps[last] = InterfaceWrapStruct(InterfaceWrapTemplate::Size, InterfaceWrapTemplate::Construct, InterfaceWrapTemplate::Destruct, InterfaceWrapTemplate::Move); + ComponentWraps[last] = ComponentWrapStruct(ComponentWrapTemplate::Size, ComponentWrapTemplate::Construct, ComponentWrapTemplate::Destruct, ComponentWrapTemplate::Move); } break; } @@ -609,22 +642,14 @@ public: }; -template -class BasicInterfaceWithPointer : public BasicInterface { -public: - BasicInterfaceWithPointer(Interfaces *interfaces) : interfaces(interfaces) { - } - Interfaces *interfaces = 0; -}; - -class InterfacesMetadata { +class ComposerMetadata { public: - InterfacesMetadata(uint64 mask) : size(0), last(64), _mask(mask) { + ComposerMetadata(uint64 mask) : size(0), last(64), _mask(mask) { for (int i = 0; i < 64; ++i) { uint64 m = (1 << i); if (_mask & m) { - int s = InterfaceWraps[i].Size; + int s = ComponentWraps[i].Size; if (s) { offsets[i] = size; size += s; @@ -660,15 +685,15 @@ private: }; -const InterfacesMetadata *GetInterfacesMetadata(uint64 mask); +const ComposerMetadata *GetComposerMetadata(uint64 mask); -class Interfaces { +class Composer { public: - Interfaces(uint64 mask = 0) : _data(zerodata()) { + Composer(uint64 mask = 0) : _data(zerodata()) { if (mask) { - const InterfacesMetadata *meta = GetInterfacesMetadata(mask); - int32 size = sizeof(const InterfacesMetadata *) + meta->size; + const ComposerMetadata *meta = GetComposerMetadata(mask); + int size = sizeof(meta) + meta->size; void *data = operator new(size); if (!data) { // terminate if we can't allocate memory throw "Can't allocate memory!"; @@ -680,13 +705,13 @@ public: int offset = meta->offsets[i]; if (offset >= 0) { try { - InterfaceWraps[i].Construct(_dataptrunsafe(offset), this); + ComponentWraps[i].Construct(_dataptrunsafe(offset), this); } catch (...) { while (i > 0) { --i; offset = meta->offsets[--i]; if (offset >= 0) { - InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); + ComponentWraps[i].Destruct(_dataptrunsafe(offset)); } } throw; @@ -695,38 +720,41 @@ public: } } } - void UpdateInterfaces(uint64 mask = 0) { + Composer(const Composer &other) = delete; + Composer &operator=(const Composer &other) = delete; + ~Composer() { + if (_data != zerodata()) { + const ComposerMetadata *meta = _meta(); + for (int i = 0; i < meta->last; ++i) { + int offset = meta->offsets[i]; + if (offset >= 0) { + ComponentWraps[i].Destruct(_dataptrunsafe(offset)); + } + } + operator delete(_data); + } + } + + void UpdateComponents(uint64 mask = 0) { if (!_meta()->equals(mask)) { - Interfaces tmp(mask); + Composer tmp(mask); tmp.swap(*this); if (_data != zerodata() && tmp._data != zerodata()) { - const InterfacesMetadata *meta = _meta(), *wasmeta = tmp._meta(); + const ComposerMetadata *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].Move(_dataptrunsafe(offset), tmp._dataptrunsafe(wasoffset)); + ComponentWraps[i].Move(_dataptrunsafe(offset), tmp._dataptrunsafe(wasoffset)); } } } } } - void AddInterfaces(uint64 mask = 0) { - UpdateInterfaces(_meta()->maskadd(mask)); + void AddComponents(uint64 mask = 0) { + UpdateComponents(_meta()->maskadd(mask)); } - void RemoveInterfaces(uint64 mask = 0) { - UpdateInterfaces(_meta()->maskremove(mask)); - } - ~Interfaces() { - if (_data != zerodata()) { - const InterfacesMetadata *meta = _meta(); - for (int i = 0; i < meta->last; ++i) { - int offset = meta->offsets[i]; - if (offset >= 0) { - InterfaceWraps[i].Destruct(_dataptrunsafe(offset)); - } - } - operator delete(_data); - } + void RemoveComponents(uint64 mask = 0) { + UpdateComponents(_meta()->maskremove(mask)); } template @@ -738,31 +766,28 @@ public: return static_cast(_dataptr(_meta()->offsets[Type::Index()])); } template - bool Is() const { + bool Has() const { return (_meta()->offsets[Type::Index()] >= 0); } private: - static const InterfacesMetadata *ZeroInterfacesMetadata; + static const ComposerMetadata *ZeroComposerMetadata; static void *zerodata() { - return &ZeroInterfacesMetadata; + return &ZeroComposerMetadata; } void *_dataptrunsafe(int skip) const { - return (char*)_data + sizeof(const InterfacesMetadata*) + skip; + return (char*)_data + sizeof(_meta()) + skip; } void *_dataptr(int skip) const { return (skip >= 0) ? _dataptrunsafe(skip) : 0; } - const InterfacesMetadata *&_meta() const { - return *static_cast(_data); + const ComposerMetadata *&_meta() const { + return *static_cast(_data); } void *_data; - Interfaces(const Interfaces &other); - Interfaces &operator=(const Interfaces &other); - - void swap(Interfaces &other) { + void swap(Composer &other) { std::swap(_data, other._data); } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 4c155538de..d2ce17a4f9 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1410,7 +1410,7 @@ void Window::notifySchedule(History *history, HistoryItem *item) { haveSetting = false; } - int delay = item->Is() ? 500 : 100, t = unixtime(); + int delay = item->Has() ? 500 : 100, t = unixtime(); uint64 ms = getms(true); bool isOnline = main->lastWasOnline(), otherNotOld = ((cOtherOnline() * uint64(1000)) + Global::OnlineCloudTimeout() > t * uint64(1000)); bool otherLaterThanMe = (cOtherOnline() * uint64(1000) + (ms - main->lastSetOnline()) > t * uint64(1000)); @@ -1629,7 +1629,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { notifyWaitTimer.start(next - ms); break; } else { - HistoryItem *fwd = notifyItem->Is() ? notifyItem : 0; // forwarded notify grouping + HistoryItem *fwd = notifyItem->Has() ? notifyItem : nullptr; // forwarded notify grouping int32 fwdCount = 1; uint64 ms = getms(true); @@ -1657,7 +1657,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { } while (history->hasNotification()); if (nextNotify) { if (fwd) { - HistoryItem *nextFwd = nextNotify->Is() ? nextNotify : 0; + HistoryItem *nextFwd = nextNotify->Has() ? nextNotify : nullptr; if (nextFwd && fwd->author() == nextFwd->author() && qAbs(int64(nextFwd->date.toTime_t()) - int64(fwd->date.toTime_t())) < 2) { fwd = nextFwd; ++fwdCount; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index cd7485bd72..863775349e 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,34,3 - PRODUCTVERSION 0,9,34,3 + FILEVERSION 0,9,34,4 + PRODUCTVERSION 0,9,34,4 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.34.3" + VALUE "FileVersion", "0.9.34.4" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.34.3" + VALUE "ProductVersion", "0.9.34.4" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 9c03708041..7d9e063d1c 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.34 AppVersionStr 0.9.34 DevChannel 0 -BetaVersion 9034003 +BetaVersion 9034004 From cbebf9ced70b4bdcc9a45fea9399ddcd7d67bbab Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 14:31:40 +0300 Subject: [PATCH 257/316] langs updated for 9034004 --- Telegram/SourceFiles/langs/lang_de.strings | 96 ++++++++-------- Telegram/SourceFiles/langs/lang_es.strings | 48 ++++---- Telegram/SourceFiles/langs/lang_it.strings | 84 +++++++------- Telegram/SourceFiles/langs/lang_ko.strings | 106 +++++++++--------- Telegram/SourceFiles/langs/lang_nl.strings | 74 ++++++------ Telegram/SourceFiles/langs/lang_pt_BR.strings | 96 ++++++++-------- 6 files changed, 270 insertions(+), 234 deletions(-) diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index 3e247d1c58..de9dec99a5 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -87,7 +87,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_continue" = "Weiter"; "lng_close" = "Schließen"; "lng_connecting" = "Verbinde..."; -"lng_reconnecting" = "Neu verbinden {count:jetzt|in # s|in # s}.."; +"lng_reconnecting" = "Neu verbinden {count:jetzt|in # s|in # s}..."; "lng_reconnecting_try_now" = "Jetzt versuchen"; "lng_status_service_notifications" = "Servicemeldungen"; @@ -108,7 +108,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_status_lastseen_date" = "zuletzt gesehen am {date}"; "lng_status_lastseen_date_time" = "zuletzt gesehen am {date} um {time}"; "lng_status_online" = "online"; -"lng_status_connecting" = "verbinden.."; +"lng_status_connecting" = "verbinden..."; "lng_chat_status_unaccessible" = "Gruppe ist nicht verfügbar"; "lng_chat_status_members" = "{count:keine Mitglieder|# Mitglied|# Mitglieder}"; @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "Diese Nachricht wurde gelöscht"; "lng_edit_too_long" = "Der Text ist leider zu lang"; "lng_edit_message" = "Nachricht bearbeiten"; -"lng_edit_message_text" = "Neuer Text.."; +"lng_edit_message_text" = "Neuer Text..."; "lng_deleted" = "Gelöschter Kontakt"; "lng_deleted_message" = "Gelöschte Nachricht"; "lng_pinned_message" = "Angeheftete Nachricht"; @@ -162,7 +162,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_code_telegram" = "Bitte den Code eingeben, den du in der\nzuvor benutzen [b]Telegram[/b]-App erhalten hast."; "lng_code_no_telegram" = "Code per SMS senden"; "lng_code_call" = "Telegram ruft dich an in {minutes}:{seconds}"; -"lng_code_calling" = "Telegram ruft dich an.."; +"lng_code_calling" = "Telegram ruft dich an..."; "lng_code_called" = "Telegram ruft dich gerade an."; "lng_bad_phone" = "Falsche Nummer, bitte erneut versuchen."; @@ -201,7 +201,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "Kanalname"; "lng_no_contacts" = "Du hast keine Kontakte"; "lng_no_chats" = "Noch keine Chats"; -"lng_contacts_loading" = "Lade.."; +"lng_contacts_loading" = "Lade..."; "lng_contacts_not_found" = "Keine Kontakte gefunden"; "lng_dlg_search_chat" = "In diesem Chat suchen"; "lng_dlg_search_channel" = "In diesem Kanal suchen"; @@ -210,7 +210,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Speichern"; "lng_settings_upload" = "Profilbild festlegen"; "lng_settings_crop_profile" = "Sichtbaren Bereich für Bild wählen"; -"lng_settings_uploading_photo" = "Bild wird geladen.."; +"lng_settings_uploading_photo" = "Bild wird geladen..."; "lng_username_title" = "Benutzername"; "lng_username_about" = "Wähle einen (optionalen) öffentlichen \nBenutzernamen, wenn du von anderen \ngefunden werden willst, ohne, dass sie \ndeine Nummer kennen müssen.\n\nErlaubt sind a-z, 0-9 und Unterstriche. \nDie Mindestlänge beträgt 5 Zeichen."; @@ -247,9 +247,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "Auto-Updates"; "lng_settings_current_version" = "Version {version}"; "lng_settings_check_now" = "Auf Updates prüfen"; -"lng_settings_update_checking" = "Prüfe auf Updates.."; +"lng_settings_update_checking" = "Prüfe auf Updates..."; "lng_settings_latest_installed" = "Aktuellste Version bereits installiert"; -"lng_settings_downloading" = "Update wird geladen {ready} / {total} MB.."; +"lng_settings_downloading" = "Update wird geladen {ready} / {total} MB..."; "lng_settings_update_ready" = "Neue Version kann installiert werden"; "lng_settings_update_now" = "Jetzt neustarten"; "lng_settings_update_fail" = "Konnte nicht auf Updates prüfen :("; @@ -291,7 +291,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "Download konnte nicht gestartet werden. Das kann am eingestellten Speicherort liegen.\n\nDu kannst den Speicherort in den Einstellungen ändern."; "lng_download_path_settings" = "Einstellungen"; "lng_download_finish_failed" = "Datei konnte nicht geladen werden.\n\nErneut versuchen?"; -"lng_download_path_clearing" = "Leeren.."; +"lng_download_path_clearing" = "Leeren..."; "lng_download_path_cleared" = "Geleert!"; "lng_download_path_clear_failed" = "Ein Fehler ist aufgetreten :("; @@ -300,7 +300,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|# Bild|# Bilder}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|# Sprachnachricht|# Sprachnachrichten}, {size}"; "lng_local_storage_clear" = "Leeren"; -"lng_local_storage_clearing" = "Entferne.."; +"lng_local_storage_clearing" = "Leeren..."; "lng_local_storage_cleared" = "Alles entfernt!"; "lng_local_storage_clear_failed" = "Ein Fehler ist aufgetreten :("; @@ -331,7 +331,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_passcode_logout" = "Abmelden"; "lng_passcode_need_unblock" = "Bitte erst entsperren."; -"lng_cloud_password_waiting" = "Bestätigungslink gesendet an {email}.."; +"lng_cloud_password_waiting" = "Bestätigungslink gesendet an {email}..."; "lng_cloud_password_change" = "Kennwort ändern"; "lng_cloud_password_create" = "Kennwort erstellen"; "lng_cloud_password_remove" = "Kennwort entfernen"; @@ -358,7 +358,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "Kennwort wurde nicht geändert"; "lng_connection_type" = "Verbindungsart:"; -"lng_connection_auto_connecting" = "Standard (verbinden..)"; +"lng_connection_auto_connecting" = "Standard (verbinden...)"; "lng_connection_auto" = "Standard ({transport} verwendet)"; "lng_connection_proxy_connecting" = "Verbinde über Proxy..."; "lng_connection_proxy" = "{transport} mit Proxy"; @@ -439,7 +439,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "{user} aus der Gruppe entfernen?"; "lng_profile_sure_kick_channel" = "{user} aus dem Kanal entfernen?"; "lng_profile_sure_kick_admin" = "{user} als Administrator entfernen?"; -"lng_profile_loading" = "Lade.."; +"lng_profile_loading" = "Lade..."; "lng_profile_shared_media" = "Geteilte Medien"; "lng_profile_no_media" = "Noch keine Medien in diesem Chat"; "lng_profile_photos" = "{count:_not_used_|# Bild|# Bilder} »"; @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# Link|# Links} »"; "lng_profile_shared_links_header" = "Links aus dem Chat"; "lng_profile_copy_phone" = "Telefonnummer kopieren"; +"lng_profile_copy_fullname" = "Anzeigename kopieren"; "lng_channel_add_admins" = "Neuer Administrator"; "lng_channel_add_members" = "Mitglieder hinzufügen"; @@ -659,12 +660,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_remove" = "Löschen"; "lng_stickers_return" = "Rückgängig"; "lng_stickers_restore" = "Zeigen"; -"lng_stickers_count" = "{count:Lade..|# Sticker|# Sticker}"; +"lng_stickers_count" = "{count:Lade...|# Sticker|# Sticker}"; "lng_in_dlg_photo" = "Bild"; -"lng_in_dlg_video" = "Video"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "Kontakt"; -"lng_in_dlg_audio" = "Sprachnachricht"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "Datei"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (Sticker)"; @@ -678,18 +680,20 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "Spam in dieser Gruppe melden?"; "lng_report_spam_sure_channel" = "Möchtest du wirklich Spam in diesem Kanal melden?"; "lng_report_spam_ok" = "Melden"; -"lng_cant_send_to_not_contact" = "Derzeit kannst du nur Personen schreiben, wenn ihr eure Nummern ausgetauscht habt. {more_info}"; -"lng_cant_invite_not_contact" = "Du kannst nur Personen hinzufügen, wenn ihr eure Nummern ausgetauscht habt. {more_info}"; -"lng_cant_invite_not_contact_channel" = "Du kannst nur Personen hinzufügen,wenn ihr\neure Nummern ausgetauscht habt. {more_info}\n"; +"lng_cant_send_to_not_contact" = "Derzeit kannst du nur Personen schreiben,\nwenn ihr eure Nummern ausgetauscht habt.\n{more_info}"; +"lng_cant_invite_not_contact" = "Du kannst nur Personen hinzufügen,\nwenn ihr eure Nummern ausgetauscht habt.\n{more_info}"; +"lng_cant_invite_not_contact_channel" = "Du kannst nur Personen hinzufügen,\nwenn ihr eure Nummern ausgetauscht habt.\n{more_info}"; "lng_cant_more_info" = "Weitere Infos »"; +"lng_cant_invite_banned" = "Nur Admins können diesen Nutzer hinzufügen."; "lng_cant_invite_privacy" = "Du kannst mit diesen Nutzern keine Gruppe erstellen, weil sie es nicht erlauben."; "lng_cant_invite_privacy_channel" = "Du kannst diese Nutzer keinen Kanälen hinzufügen, weil sie es nicht erlauben."; +"lng_cant_do_this" = "Verzeihung. Das ist leider nicht möglich."; "lng_send_button" = "Senden"; -"lng_message_ph" = "Schreibe deine Nachricht.."; -"lng_comment_ph" = "Schreibe ein Kommentar.."; -"lng_broadcast_ph" = "Sende einen Broadcast.."; -"lng_broadcast_silent_ph" = "Lautloser Broadcast"; +"lng_message_ph" = "Schreibe deine Nachricht..."; +"lng_comment_ph" = "Schreibe ein Kommentar..."; +"lng_broadcast_ph" = "Sende einen Broadcast..."; +"lng_broadcast_silent_ph" = "Lautloser Broadcast..."; "lng_record_cancel" = "Zum Abbrechen rausbewegen"; "lng_will_be_notified" = "Mitglieder werden benachrichtigt"; "lng_wont_be_notified" = "Mitglieder werden nicht benachrichtigt"; @@ -718,27 +722,28 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_users_typing" = "{user} und {second_user} tippen"; "lng_many_typing" = "{count:_not_used_|# tippt|# tippen}"; "lng_send_action_record_video" = "schickt Video"; -"lng_user_action_record_video" = "{user} sendet Video"; -"lng_send_action_upload_video" = "schickt Video"; -"lng_user_action_upload_video" = "{user} sendet Video"; -"lng_send_action_record_audio" = "nimmt Audio auf"; -"lng_user_action_record_audio" = "{user} nimmt Audio auf"; -"lng_send_action_upload_audio" = "nimmt Audio auf"; -"lng_user_action_upload_audio" = "{user} sendet Audio"; -"lng_send_action_upload_photo" = "sendet Bild"; -"lng_user_action_upload_photo" = "{user} sendet Bild"; -"lng_send_action_upload_file" = "sendet Datei"; -"lng_user_action_upload_file" = "{user} sendet Datei"; -"lng_send_action_geo_location" = "wählt Standort aus"; -"lng_user_action_geo_location" = "{user} wählt Standort aus"; -"lng_send_action_choose_contact" = "wählt Kontakt aus"; -"lng_user_action_choose_contact" = "{user} wählt Kontakt aus"; +"lng_user_action_record_video" = "{user} sendet ein Video"; +"lng_send_action_upload_video" = "schickt ein Video"; +"lng_user_action_upload_video" = "{user} sendet ein Video"; +"lng_send_action_record_audio" = "nimmt ein Audio auf"; +"lng_user_action_record_audio" = "{user} nimmt eine Sprachnachricht auf"; +"lng_send_action_upload_audio" = "sendet eine Sprachnachricht"; +"lng_user_action_upload_audio" = "{user} sendet eine Sprachnachricht"; +"lng_send_action_upload_photo" = "sendet ein Bild"; +"lng_user_action_upload_photo" = "{user} sendet ein Bild"; +"lng_send_action_upload_file" = "sendet eine Datei"; +"lng_user_action_upload_file" = "{user} sendet eine Datei"; +"lng_send_action_geo_location" = "wählt einen Standort aus"; +"lng_user_action_geo_location" = "{user} wählt einen Standort aus"; +"lng_send_action_choose_contact" = "wählt einen Kontakt aus"; +"lng_user_action_choose_contact" = "{user} wählt einen Kontakt aus"; "lng_unread_bar" = "{count:_not_used_|# Ungelesene Nachricht|# Ungelesene Nachrichten}"; "lng_maps_point" = "Standort"; "lng_save_photo" = "Bild speichern"; -"lng_save_video" = "Video speichern"; -"lng_save_audio" = "Sprachnachricht speichern"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "Datei speichern"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -755,7 +760,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "E-Mail-Adresse kopieren"; "lng_context_copy_hashtag" = "Hashtag kopieren"; "lng_context_copy_mention" = "Benutzername kopieren"; -"lng_context_save_image" = "Bild speichern unter"; +"lng_context_save_image" = "Bild speichern unter..."; "lng_context_forward_image" = "Bild weiterleiten"; "lng_context_delete_image" = "Bild löschen"; "lng_context_copy_image" = "Bild kopieren"; @@ -763,11 +768,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Download abbrechen"; "lng_context_show_in_folder" = "Im Ordner anzeigen"; "lng_context_show_in_finder" = "Im Finder zeigen"; -"lng_context_save_video" = "Video speichern unter.."; -"lng_context_save_audio" = "Sprachnachricht speichern unter.."; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "Sticker-Paket"; "lng_context_pack_add" = "Sticker hinzufügen"; -"lng_context_save_file" = "Datei speichern als.."; +"lng_context_save_file" = "Datei speichern unter..."; "lng_context_forward_file" = "Datei weiterleiten"; "lng_context_delete_file" = "Datei löschen"; "lng_context_close_file" = "Datei schließen"; @@ -794,7 +800,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Nur Dateien bis maximal 1,5 GB können gesendet werden :("; "lng_send_folder" = "Verzeichnis «{name}» kann nicht gesendet werden :("; -"lng_forward_choose" = "Empfänger wählen.."; +"lng_forward_choose" = "Empfänger wählen..."; "lng_forward_cant" = "Weiterleiten nicht möglich :("; "lng_forward_confirm" = "An {recipient} weiterleiten?"; "lng_forward_share_contact" = "Kontakt an {recipient} senden?"; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index dfa3a6261e..27e7041870 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "Este mensaje fue eliminado"; "lng_edit_too_long" = "Tu texto es demasiado largo"; "lng_edit_message" = "Editar mensaje"; -"lng_edit_message_text" = "Nuevo texto..."; +"lng_edit_message_text" = "Nuevo mensaje..."; "lng_deleted" = "Desconocido"; "lng_deleted_message" = "Mensaje eliminado"; "lng_pinned_message" = "Mensaje anclado"; @@ -210,7 +210,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Guardar"; "lng_settings_upload" = "Poner foto de perfil"; "lng_settings_crop_profile" = "Selecciona el área para tu foto de perfil"; -"lng_settings_uploading_photo" = "Cargando foto..."; +"lng_settings_uploading_photo" = "Subiendo foto..."; "lng_username_title" = "Alias"; "lng_username_about" = "Puedes elegir un alias en Telegram. \nSi lo haces, otras personas te podrán \nencontrar por ese alias y contactarte \nsin saber tu número de teléfono.\n\nPuedes usar a-z, 0-9 y guiones bajos.\nLa longitud mínima es de 5 caracteres."; @@ -360,7 +360,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_connection_type" = "Tipo de conexión:"; "lng_connection_auto_connecting" = "Por defecto (conectando...)"; "lng_connection_auto" = "Por defecto ({transport} en uso)"; -"lng_connection_proxy_connecting" = "Conectando a través de un proxy..."; +"lng_connection_proxy_connecting" = "Conectando a través de proxy..."; "lng_connection_proxy" = "{transport} con un proxy"; "lng_connection_header" = "Tipo de conexión"; "lng_connection_auto_rb" = "Automático (TCP si existe o HTTP)"; @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# enlace|# enlaces} »"; "lng_profile_shared_links_header" = "Enlaces"; "lng_profile_copy_phone" = "Copiar número"; +"lng_profile_copy_fullname" = "Copiar nombre"; "lng_channel_add_admins" = "Nuevo administrador"; "lng_channel_add_members" = "Añadir miembros"; @@ -662,9 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Cargando...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Vídeo"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "Contacto"; -"lng_in_dlg_audio" = "Audio"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "Archivo"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -678,12 +680,14 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "¿Quieres reportar el spam en este grupo?"; "lng_report_spam_sure_channel" = "¿Quieres reportar a este canal como spam?"; "lng_report_spam_ok" = "Reportar"; -"lng_cant_send_to_not_contact" = "Por ahora, sólo puedes enviar mensajes\na contactos mutuos. {more_info}"; -"lng_cant_invite_not_contact" = "Por ahora, sólo puedes añadir contactos \nmutuos a grupos. {more_info}"; -"lng_cant_invite_not_contact_channel" = "Lo sentimos, sólo puedes añadir contactos\nmutuos a canales. {more_info}"; +"lng_cant_send_to_not_contact" = "Por ahora, sólo puedes enviar\nmensajes a contactos mutuos. \n{more_info}"; +"lng_cant_invite_not_contact" = "Por ahora, sólo puedes añadir \ncontactos mutuos a grupos. \n{more_info}"; +"lng_cant_invite_not_contact_channel" = "Por ahora, sólo puedes añadir \ncontactos mutuos a canales. \n{more_info}"; "lng_cant_more_info" = "Más información »"; +"lng_cant_invite_banned" = "Sólo el administrador puede añadir a este usuario."; "lng_cant_invite_privacy" = "No puedes añadir a este usuario a grupos por sus ajustes de privacidad."; "lng_cant_invite_privacy_channel" = "No puedes añadir a este usuario a canales por sus ajustes de privacidad."; +"lng_cant_do_this" = "Lo sentimos, esta acción no está disponible."; "lng_send_button" = "Enviar"; "lng_message_ph" = "Escribe un mensaje..."; @@ -717,28 +721,29 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_typing" = "{user} está escribiendo"; "lng_users_typing" = "{user} y {second_user} están escribiendo"; "lng_many_typing" = "{count:_not_used_|# está|# están} escribiendo"; -"lng_send_action_record_video" = "grabando vídeo"; +"lng_send_action_record_video" = "grabando un vídeo"; "lng_user_action_record_video" = "{user} está grabando un vídeo"; -"lng_send_action_upload_video" = "enviando vídeo"; +"lng_send_action_upload_video" = "enviando un vídeo"; "lng_user_action_upload_video" = "{user} está enviando un vídeo"; -"lng_send_action_record_audio" = "grabando audio"; -"lng_user_action_record_audio" = "{user} está grabando un audio"; -"lng_send_action_upload_audio" = "enviando audio"; -"lng_user_action_upload_audio" = "{user} está enviando un audio"; -"lng_send_action_upload_photo" = "enviando foto"; +"lng_send_action_record_audio" = "grabando un mensaje de voz"; +"lng_user_action_record_audio" = "{user} está grabando un mensaje de voz"; +"lng_send_action_upload_audio" = "enviando un mensaje de voz"; +"lng_user_action_upload_audio" = "{user} está enviando un mensaje de voz"; +"lng_send_action_upload_photo" = "enviando una foto"; "lng_user_action_upload_photo" = "{user} está enviando una foto"; -"lng_send_action_upload_file" = "enviando archivo"; +"lng_send_action_upload_file" = "enviando un archivo"; "lng_user_action_upload_file" = "{user} está enviando un archivo"; "lng_send_action_geo_location" = "obteniendo ubicación"; "lng_user_action_geo_location" = "{user} está obteniendo una ubicación"; -"lng_send_action_choose_contact" = "eligiendo contacto"; +"lng_send_action_choose_contact" = "eligiendo un contacto"; "lng_user_action_choose_contact" = "{user} está eligiendo un contacto"; "lng_unread_bar" = "{count:_not_used_|# mensaje sin leer|# mensajes sin leer}"; "lng_maps_point" = "Ubicación"; "lng_save_photo" = "Guardar imagen"; -"lng_save_video" = "Guardar vídeo"; -"lng_save_audio" = "Guardar audio"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "Guardar archivo"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -763,8 +768,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancelar descarga"; "lng_context_show_in_folder" = "Mostrar en la carpeta"; "lng_context_show_in_finder" = "Mostrar en el Finder"; -"lng_context_save_video" = "Guardar como..."; -"lng_context_save_audio" = "Guardar como..."; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "Información del pack"; "lng_context_pack_add" = "Añadir stickers"; "lng_context_save_file" = "Guardar como..."; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 1a8e00d880..636096cb54 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "Questo messaggio è stato eliminato"; "lng_edit_too_long" = "Il tuo messaggio è troppo lungo"; "lng_edit_message" = "Modifica messaggio"; -"lng_edit_message_text" = "Nuovo testo messaggio.."; +"lng_edit_message_text" = "Nuovo testo messaggio..."; "lng_deleted" = "Sconosciuto"; "lng_deleted_message" = "Messaggio eliminato"; "lng_pinned_message" = "Messaggio fissato"; @@ -162,7 +162,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_code_telegram" = "Per favore inserisci il codice che hai\nappena ricevuto nell'altra app di [b]Telegram[/b]."; "lng_code_no_telegram" = "Invia codice via SMS"; "lng_code_call" = "Telegram ti chiamerà tra {minutes}:{seconds}"; -"lng_code_calling" = "Richiedendo una telefonata da Telegram.."; +"lng_code_calling" = "Richiedo una telefonata da Telegram..."; "lng_code_called" = "Telegram ti ha chiamato"; "lng_bad_phone" = "Numero di telefono non valido. Per favore riprova."; @@ -201,7 +201,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "Nome canale"; "lng_no_contacts" = "Non hai contatti"; "lng_no_chats" = "Le tua chat saranno qui"; -"lng_contacts_loading" = "Caricamento.."; +"lng_contacts_loading" = "Caricamento..."; "lng_contacts_not_found" = "Nessun contatto trovato"; "lng_dlg_search_chat" = "Cerca in questa chat"; "lng_dlg_search_channel" = "Cerca in questo canale"; @@ -210,7 +210,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Salva"; "lng_settings_upload" = "Imposta foto profilo"; "lng_settings_crop_profile" = "Seleziona un riquadro per la tua foto profilo"; -"lng_settings_uploading_photo" = "Caricamento foto.."; +"lng_settings_uploading_photo" = "Caricamento foto..."; "lng_username_title" = "Username"; "lng_username_about" = "Puoi scegliere un username su Telegram.\nSe lo fai, le altre persone potranno trovarti\ntramite questo username e contattarti \nsenza conoscere il tuo numero di telefono.\n\nPuoi usare a-z, 0-9 e underscore.\nLa lunghezza minima è di 5 caratteri."; @@ -247,9 +247,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "Aggiorna automaticamente"; "lng_settings_current_version" = "Versione {version}"; "lng_settings_check_now" = "Cerca aggiornamenti"; -"lng_settings_update_checking" = "Cerco aggiornamenti.."; +"lng_settings_update_checking" = "Cerco aggiornamenti..."; "lng_settings_latest_installed" = "L'ultima versione è installata"; -"lng_settings_downloading" = "Download aggiornamento {ready} / {total} MB.."; +"lng_settings_downloading" = "Download aggiornamento {ready} / {total} MB..."; "lng_settings_update_ready" = "La nuova versione è pronta"; "lng_settings_update_now" = "Riavvia ora"; "lng_settings_update_fail" = "Ricerca aggiornamenti fallita :("; @@ -291,7 +291,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "Il download del file non può iniziare. La causa potrebbe essere una posizione sbagliata per i download.\n\nPuoi cambiare il percorso di download nelle Impostazioni."; "lng_download_path_settings" = "Impostazioni"; "lng_download_finish_failed" = "Il download del file non può essere concluso.\n\nVuoi riprovare?"; -"lng_download_path_clearing" = "Eliminazione.."; +"lng_download_path_clearing" = "Elimino..."; "lng_download_path_cleared" = "Eliminato!"; "lng_download_path_clear_failed" = "Eliminazione fallita :("; @@ -300,7 +300,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|# immagine|# immagini}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|# messaggio vocale|# messaggi vocali}, {size}"; "lng_local_storage_clear" = "Elimina tutto"; -"lng_local_storage_clearing" = "Eliminando.."; +"lng_local_storage_clearing" = "Elimino..."; "lng_local_storage_cleared" = "Eliminato!"; "lng_local_storage_clear_failed" = "Eliminazione fallita :("; @@ -331,7 +331,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_passcode_logout" = "Disconnetti"; "lng_passcode_need_unblock" = "Devi prima sbloccarmi."; -"lng_cloud_password_waiting" = "Link di conferma inviato a {email}.."; +"lng_cloud_password_waiting" = "Link di conferma inviato a {email}..."; "lng_cloud_password_change" = "Cambia password"; "lng_cloud_password_create" = "Password cloud"; "lng_cloud_password_remove" = "Rimuovi password"; @@ -358,9 +358,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "La password non è stata cambiata"; "lng_connection_type" = "Tipo di connessione:"; -"lng_connection_auto_connecting" = "Predefinita (connetto..)"; +"lng_connection_auto_connecting" = "Predefinita (connetto...)"; "lng_connection_auto" = "Predefinita ({transport} in uso)"; -"lng_connection_proxy_connecting" = "Connetto tramite proxy.."; +"lng_connection_proxy_connecting" = "Connetto tramite proxy..."; "lng_connection_proxy" = "{transport} con proxy"; "lng_connection_header" = "Tipo di connessione"; "lng_connection_auto_rb" = "Auto (TCP se disponibile o HTTP)"; @@ -396,7 +396,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_sessions_other_desc" = "Ti puoi connettere a Telegram da altri dispositivi mobili, tablet e desktop usando lo stesso numero. Tutti i tuoi dati saranno sincronizzati istantaneamente."; "lng_sessions_terminate_all" = "Termina tutte le altre sessioni"; -"lng_preview_loading" = "Recupero le info del link.."; +"lng_preview_loading" = "Recupero le info del link..."; "lng_profile_chat_unaccessible" = "Gruppo non accessibile"; "lng_topbar_info" = "Info"; @@ -439,7 +439,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "Rimuovere {user} dal gruppo?"; "lng_profile_sure_kick_channel" = "Rimuovere {user} dal canale?"; "lng_profile_sure_kick_admin" = "Rimuovere {user} dagli amministratori?"; -"lng_profile_loading" = "Caricamento.."; +"lng_profile_loading" = "Caricamento..."; "lng_profile_shared_media" = "Media condivisi"; "lng_profile_no_media" = "Nessun media in questa chat."; "lng_profile_photos" = "{count:_not_used_|# foto|# foto} »"; @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# link condiviso|# link condivisi} »"; "lng_profile_shared_links_header" = "Panoramica link condivisi"; "lng_profile_copy_phone" = "Copia numero di telefono"; +"lng_profile_copy_fullname" = "Copia nome"; "lng_channel_add_admins" = "Nuovo amministratore"; "lng_channel_add_members" = "Aggiungi membri"; @@ -659,12 +660,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_remove" = "Elimina"; "lng_stickers_return" = "Annulla"; "lng_stickers_restore" = "Ripristina"; -"lng_stickers_count" = "{count:Caricamento..|# sticker|# sticker}"; +"lng_stickers_count" = "{count:Caricamento...|# sticker|# sticker}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Video"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "Contatto"; -"lng_in_dlg_audio" = "Audio"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "File"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -678,18 +680,20 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "Sei sicuro di voler segnalare dello spam in questo gruppo?"; "lng_report_spam_sure_channel" = "Sei sicuro di voler segnalare dello spam in questo canale?"; "lng_report_spam_ok" = "Segnala"; -"lng_cant_send_to_not_contact" = "Spiacenti, ma al momento puoi scrivere\nsolo ai contatti reciproci. {more_info}"; -"lng_cant_invite_not_contact" = "Spiacenti, ma al momento puoi aggiungere\nai gruppi solo contatti reciproci. {more_info}"; -"lng_cant_invite_not_contact_channel" = "Spiacenti, ma al momento puoi aggiungere\nai canali solo contatti reciproci. {more_info}"; +"lng_cant_send_to_not_contact" = "Spiacenti, ma al momento puoi scrivere\nsolo ai contatti reciproci.\n{more_info}"; +"lng_cant_invite_not_contact" = "Spiacenti, ma al momento puoi aggiungere\nai gruppi solo contatti reciproci.\n{more_info}"; +"lng_cant_invite_not_contact_channel" = "Spiacenti, ma al momento puoi aggiungere\nai canali solo contatti reciproci.\n{more_info}"; "lng_cant_more_info" = "Più info »"; +"lng_cant_invite_banned" = "Spiacenti, solo l'amministratore può aggiungere questo utente."; "lng_cant_invite_privacy" = "Spiacenti, non puoi aggiungere questo utente al gruppo a causa delle sue impostazioni di privacy."; "lng_cant_invite_privacy_channel" = "Spiacenti, non puoi aggiungere questo utente al canale a causa delle sue impostazioni di privacy."; +"lng_cant_do_this" = "Spiacenti, questa azione non è disponibile."; "lng_send_button" = "Invia"; -"lng_message_ph" = "Scrivi un messaggio.."; -"lng_comment_ph" = "Scrivi un commento.."; -"lng_broadcast_ph" = "Pubblica un post.."; -"lng_broadcast_silent_ph" = "Post silenzioso.."; +"lng_message_ph" = "Scrivi un messaggio..."; +"lng_comment_ph" = "Scrivi un commento..."; +"lng_broadcast_ph" = "Pubblica un post..."; +"lng_broadcast_silent_ph" = "Post silenzioso..."; "lng_record_cancel" = "Rilascia fuori da qui per annullare"; "lng_will_be_notified" = "I post saranno notificati ai membri"; "lng_wont_be_notified" = "I post non saranno notificati ai membri"; @@ -721,24 +725,25 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_action_record_video" = "{user} sta registrando un video"; "lng_send_action_upload_video" = "inviando un video"; "lng_user_action_upload_video" = "{user} sta inviando un video"; -"lng_send_action_record_audio" = "registrando un audio"; -"lng_user_action_record_audio" = "{user} sta registrando un audio"; -"lng_send_action_upload_audio" = "inviando un audio"; -"lng_user_action_upload_audio" = "{user} sta inviando un audio"; +"lng_send_action_record_audio" = "registrando un messaggio vocale"; +"lng_user_action_record_audio" = "{user} sta registrando un messaggio vocale"; +"lng_send_action_upload_audio" = "inviando un messaggio vocale"; +"lng_user_action_upload_audio" = "{user} sta inviando un messaggio vocale"; "lng_send_action_upload_photo" = "inviando una foto"; "lng_user_action_upload_photo" = "{user} sta inviando una foto"; "lng_send_action_upload_file" = "inviando un file"; "lng_user_action_upload_file" = "{user} sta inviando un file"; -"lng_send_action_geo_location" = "selezionando una posizione"; -"lng_user_action_geo_location" = "{user} sta selezionando una posizione"; -"lng_send_action_choose_contact" = "selezionando un contatto"; -"lng_user_action_choose_contact" = "{user} sta selezionando un contatto"; +"lng_send_action_geo_location" = "scegliendo una posizione"; +"lng_user_action_geo_location" = "{user} sta scegliendo una posizione"; +"lng_send_action_choose_contact" = "scegliendo un contatto"; +"lng_user_action_choose_contact" = "{user} sta scegliendo un contatto"; "lng_unread_bar" = "{count:_not_used_|# messaggio non letto|# messaggi non letti}"; "lng_maps_point" = "Posizione"; "lng_save_photo" = "Salva immagine"; -"lng_save_video" = "Salva video"; -"lng_save_audio" = "Salva audio"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "Salva file"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -755,7 +760,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "Copia indirizzo email"; "lng_context_copy_hashtag" = "Copia hashtag"; "lng_context_copy_mention" = "Copia username"; -"lng_context_save_image" = "Salva immagine come.."; +"lng_context_save_image" = "Salva immagine come..."; "lng_context_forward_image" = "Inoltra immagine"; "lng_context_delete_image" = "Elimina immagine"; "lng_context_copy_image" = "Copia immagine"; @@ -763,11 +768,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Annulla download"; "lng_context_show_in_folder" = "Mostra nella cartella"; "lng_context_show_in_finder" = "Mostra nel Finder"; -"lng_context_save_video" = "Salva video come.."; -"lng_context_save_audio" = "Salva audio come.."; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "Mostra sticker"; "lng_context_pack_add" = "Aggiungi sticker"; -"lng_context_save_file" = "Salva file come.."; +"lng_context_save_file" = "Salva file come..."; "lng_context_forward_file" = "Inoltra file"; "lng_context_delete_file" = "Elimina file"; "lng_context_close_file" = "Chiudi file"; @@ -794,7 +800,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Impossibile inviare il file, perchè è più grande di 1.5 GB :("; "lng_send_folder" = "Impossibile inviare «{name}» perchè è una cartella :("; -"lng_forward_choose" = "Scegli destinatario.."; +"lng_forward_choose" = "Scegli destinatario..."; "lng_forward_cant" = "Spiacenti, impossibile inoltrare qui :("; "lng_forward_confirm" = "Inoltra a {recipient}?"; "lng_forward_share_contact" = "Condividi contatto con {recipient}?"; @@ -857,7 +863,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_search_global_results" = "Risultati ricerca globale"; "lng_media_save_progress" = "{ready} di {total} {mb}"; -"lng_mediaview_save_as" = "Salva come.."; +"lng_mediaview_save_as" = "Salva come..."; "lng_mediaview_copy" = "Copia"; "lng_mediaview_forward" = "Inoltra"; "lng_mediaview_delete" = "Elimina"; diff --git a/Telegram/SourceFiles/langs/lang_ko.strings b/Telegram/SourceFiles/langs/lang_ko.strings index cf661c075c..ff30db37d1 100644 --- a/Telegram/SourceFiles/langs/lang_ko.strings +++ b/Telegram/SourceFiles/langs/lang_ko.strings @@ -86,8 +86,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cancel" = "취소"; "lng_continue" = "계속"; "lng_close" = "닫기"; -"lng_connecting" = "연결중입니다.."; -"lng_reconnecting" = " {count:지금| #초 후에| #초 후에} 다시 연결합니다.."; +"lng_connecting" = "Connecting..."; +"lng_reconnecting" = "Reconnect {count:now|in # s|in # s}..."; "lng_reconnecting_try_now" = "다시 시도"; "lng_status_service_notifications" = "서비스 알림"; @@ -108,7 +108,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_status_lastseen_date" = "{date}에 마지막으로 접속"; "lng_status_lastseen_date_time" = "{date}일 {time}에 마지막으로 접속"; "lng_status_online" = "온라인"; -"lng_status_connecting" = "연결중.."; +"lng_status_connecting" = "connecting..."; "lng_chat_status_unaccessible" = "그룹 접근 불가"; "lng_chat_status_members" = "{count:맴버 없음|#명|#명}"; @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "메시지는 삭제 되었습니다."; "lng_edit_too_long" = "메시지 길이가 너무 깁니다."; "lng_edit_message" = "메시지 수정"; -"lng_edit_message_text" = "새로운 메시지 내용."; +"lng_edit_message_text" = "New message text..."; "lng_deleted" = "알 수 없음"; "lng_deleted_message" = "삭제된 메시지"; "lng_pinned_message" = "고정된 메시지"; @@ -162,7 +162,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_code_telegram" = "[b]텔레그램[/b] 앱으로 부터 방금 수신받은,\n코드를 입력해주세요."; "lng_code_no_telegram" = "코드를 SMS로 전송"; "lng_code_call" = "텔레그램이 {minutes}:{seconds}후에는 전화를 겁니다."; -"lng_code_calling" = "텔레그램으로부터 전화 요청을 하고 있습니다.."; +"lng_code_calling" = "Requesting a call from Telegram..."; "lng_code_called" = "텔레그램이 회원님의 전화번호로 전화를 걸었습니다."; "lng_bad_phone" = "잘못된 전화번호입니다. 다시 시도해주세요."; @@ -201,7 +201,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "채널명"; "lng_no_contacts" = "연락처가 없습니다."; "lng_no_chats" = "대화시 대화방이 존재 할 곳입니다."; -"lng_contacts_loading" = "로드중.."; +"lng_contacts_loading" = "Loading..."; "lng_contacts_not_found" = "연락처를 찾을 수 없음"; "lng_dlg_search_chat" = "이 채팅에서 검색"; "lng_dlg_search_channel" = "이 채널방에서 검색"; @@ -210,7 +210,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "저장"; "lng_settings_upload" = "프로필 이미지 선택"; "lng_settings_crop_profile" = "프로필 사진으로 사용할 사각영역을 선택하세요"; -"lng_settings_uploading_photo" = "사진 업로드중.."; +"lng_settings_uploading_photo" = "Uploading photo..."; "lng_username_title" = "아이디"; "lng_username_about" = "텔레그램 아이디를 설정할 수 있습니다. \n아이디를 설정하면 회원님의 전화번호를 몰라도 아이디로 회원님을 찾아 대화를 나눌 수 있습니다.\n아이디는 영문, 밑줄, 숫자로 a-z, _, 0-9, \n다섯 글자 이상으로 설정해 주세요."; @@ -247,9 +247,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "자동 업데이트"; "lng_settings_current_version" = " {version}"; "lng_settings_check_now" = "업데이트 확인"; -"lng_settings_update_checking" = "업데이트 확인 중.."; +"lng_settings_update_checking" = "Checking for updates..."; "lng_settings_latest_installed" = "최신 버전이 설치되어 있습니다."; -"lng_settings_downloading" = "업데이트를 다운로드중입니다.. {ready} / {total} MB.."; +"lng_settings_downloading" = "Downloading update {ready} / {total} MB..."; "lng_settings_update_ready" = "새로운 버전을 설치 할 수 있습니다."; "lng_settings_update_now" = "재시작 합니다."; "lng_settings_update_fail" = "업데이트 확인 실패 :("; @@ -291,7 +291,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "파일 다운로드를 시작 할 수 없습니다. 올바르지 않은 다운로드 경로가 원인 일 수도 있습니다.\n\n설정에 가시면 다운로드 경로를 변경하실 수 있습니다."; "lng_download_path_settings" = "설정"; "lng_download_finish_failed" = "파일 다운로드를 끝낼 수 없습니다.\n\n다시 시도하시겠습니까?"; -"lng_download_path_clearing" = "초기화 중.."; +"lng_download_path_clearing" = "Clearing..."; "lng_download_path_cleared" = "초기화 완료!"; "lng_download_path_clear_failed" = "초기화 실패 :("; @@ -300,7 +300,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|이미지 #개|이미지 #개}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|음성 메시지 #개|음성 메시지 #개}, {size}"; "lng_local_storage_clear" = "전체 정리"; -"lng_local_storage_clearing" = "초기화 중.."; +"lng_local_storage_clearing" = "Clearing..."; "lng_local_storage_cleared" = "초기화 완료!"; "lng_local_storage_clear_failed" = "초기화 실패 :("; @@ -331,7 +331,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_passcode_logout" = "로그아웃"; "lng_passcode_need_unblock" = "잠금코드를 먼저 해제해주세요."; -"lng_cloud_password_waiting" = "{email}로 확인 이메일을 전송하였습니다.."; +"lng_cloud_password_waiting" = "Confirmation link sent to {email}..."; "lng_cloud_password_change" = "클라우드 비밀번호 변경"; "lng_cloud_password_create" = "클라우드 비밀번호"; "lng_cloud_password_remove" = "클라우드 비밀번호 삭제"; @@ -358,9 +358,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "비밀번호가 변경되지 않았습니다."; "lng_connection_type" = "연결 유형:"; -"lng_connection_auto_connecting" = "기본값 (연결중..)"; +"lng_connection_auto_connecting" = "Default (connecting...)"; "lng_connection_auto" = "기본값 ({transport} 사용)"; -"lng_connection_proxy_connecting" = "프록시 연결 중..."; +"lng_connection_proxy_connecting" = "Connecting through proxy..."; "lng_connection_proxy" = "{transport} 프록시 연결"; "lng_connection_header" = "연결 유형"; "lng_connection_auto_rb" = "자동 (사용 가능하다면 TCP 아니면 HTTP 사용)"; @@ -396,7 +396,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_sessions_other_desc" = "동일한 휴대번호로 다른 휴대기기, 태블릿과 데스크탑에서 텔레그램 로그인이 가능합니다. 모든 데이터는 즉시 동기화 됩니다."; "lng_sessions_terminate_all" = "다른 모든 세션 강제 종료"; -"lng_preview_loading" = "링크 정보를 가져오는 중.."; +"lng_preview_loading" = "Getting Link Info..."; "lng_profile_chat_unaccessible" = "그룹에 접근할 수 없습니다."; "lng_topbar_info" = "정보"; @@ -439,7 +439,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "{user}를 추방하시겠습니까?"; "lng_profile_sure_kick_channel" = "{user}를 추방하시겠습니까?"; "lng_profile_sure_kick_admin" = "{user}를 관리자에서 제외 하시겠습니까?"; -"lng_profile_loading" = "로딩중.."; +"lng_profile_loading" = "Loading..."; "lng_profile_shared_media" = "공유된 미디어"; "lng_profile_no_media" = "대화에 미디어가 존재하지 않습니다."; "lng_profile_photos" = "{count:_not_used_|#개의 사진|#개의 사진} »"; @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# 공유된 링크|# 공유된 링크} »"; "lng_profile_shared_links_header" = "공유된 링크 현황"; "lng_profile_copy_phone" = "전화번호 복사"; +"lng_profile_copy_fullname" = "Copy name"; "lng_channel_add_admins" = "새로운 관리자"; "lng_channel_add_members" = "구성원 추가"; @@ -659,12 +660,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_remove" = "삭제"; "lng_stickers_return" = "실행취소"; "lng_stickers_restore" = "복구"; -"lng_stickers_count" = "{count:Loading..|# 스티커|# 스티커} "; +"lng_stickers_count" = "{count:Loading...|# sticker|# stickers}"; "lng_in_dlg_photo" = "사진"; -"lng_in_dlg_video" = "비디오"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "연락처"; -"lng_in_dlg_audio" = "음성"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "파일"; "lng_in_dlg_sticker" = "스티커"; "lng_in_dlg_sticker_emoji" = "{emoji} (스티커)"; @@ -678,18 +680,20 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "선택한 그룹메시지를 스팸으로 신고하시겠습니까?"; "lng_report_spam_sure_channel" = "선택한 채널메시지를 스팸으로 신고하시겠습니까?"; "lng_report_spam_ok" = "신고하기"; -"lng_cant_send_to_not_contact" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 전송이 가능합니다. {more_info}"; -"lng_cant_invite_not_contact" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 추가 가능합니다. {more_info}"; -"lng_cant_invite_not_contact_channel" = "죄송하지만, 현재 서로 연락처가 추가된\n회원들끼리만 추가 가능합니다. {more_info}"; +"lng_cant_send_to_not_contact" = "Sorry, you can only send messages to\nmutual contacts at the moment.\n{more_info}"; +"lng_cant_invite_not_contact" = "Sorry, you can only add mutual contacts\nto groups at the moment.\n{more_info}"; +"lng_cant_invite_not_contact_channel" = "Sorry, you can only add mutual contacts\nto channels at the moment.\n{more_info}"; "lng_cant_more_info" = "자세한 정보 »"; +"lng_cant_invite_banned" = "Sorry, only admin can add this user."; "lng_cant_invite_privacy" = "죄송합니다, 개인설정으로 인하여 이 사용자를 그룹에 초대할 수 없습니다."; "lng_cant_invite_privacy_channel" = "죄송합니다, 개인설정으로 인하여 이 사용자를 채널에 초대할 수 없습니다."; +"lng_cant_do_this" = "Sorry, this action is unavailable."; "lng_send_button" = "보내기"; -"lng_message_ph" = "메시지 쓰기"; -"lng_comment_ph" = "코멘트 쓰기.."; -"lng_broadcast_ph" = "단체메시지 쓰기."; -"lng_broadcast_silent_ph" = "음소거 메시지.."; +"lng_message_ph" = "Write a message..."; +"lng_comment_ph" = "Write a comment..."; +"lng_broadcast_ph" = "Broadcast a message..."; +"lng_broadcast_silent_ph" = "Silent broadcast..."; "lng_record_cancel" = "이 영역 밖에서 마우스 클릭을 해제하시면 취소가 됩니다."; "lng_will_be_notified" = "메시지 작성시 구성원들에게 알림이 갑니다."; "lng_wont_be_notified" = "메시지 작성시 구성원들에게 알림이 가지 않습니다."; @@ -717,28 +721,29 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_typing" = "{user}님이 입력중입니다."; "lng_users_typing" = "{user}님과 {second_user}님이 입력중입니다."; "lng_many_typing" = "{count:_not_used_|#명이|#명이} 입력중입니다"; -"lng_send_action_record_video" = "비디오 녹화 중"; -"lng_user_action_record_video" = "{user}님이 녹화중입니다."; -"lng_send_action_upload_video" = "비디오 전송 중"; -"lng_user_action_upload_video" = "{user}님이 비디오를 전송 중입니다."; -"lng_send_action_record_audio" = "오디오 녹음 중"; -"lng_user_action_record_audio" = "{user}님이 오디오를 녹음 중입니다."; -"lng_send_action_upload_audio" = "오디오 전송 중"; -"lng_user_action_upload_audio" = "{user}님이 오디오를 전송 중입니다."; -"lng_send_action_upload_photo" = "사진 전송 중"; -"lng_user_action_upload_photo" = "{user}님이 사진을 전송 중입니다."; -"lng_send_action_upload_file" = "파일을 전송 중"; -"lng_user_action_upload_file" = "{user}님이 사진을 전송 중입니다."; -"lng_send_action_geo_location" = "위치 선택 중"; -"lng_user_action_geo_location" = "{user}님이 위치를 선택 중입니다."; -"lng_send_action_choose_contact" = "연락처 선택 중"; -"lng_user_action_choose_contact" = "{user}님이 연락처를 선택 중입니다."; +"lng_send_action_record_video" = "recording a video"; +"lng_user_action_record_video" = "{user} is recording a video"; +"lng_send_action_upload_video" = "sending a video"; +"lng_user_action_upload_video" = "{user} is sending a video"; +"lng_send_action_record_audio" = "recording a voice message"; +"lng_user_action_record_audio" = "{user} is recording a voice message"; +"lng_send_action_upload_audio" = "sending a voice message"; +"lng_user_action_upload_audio" = "{user} is sending a voice message"; +"lng_send_action_upload_photo" = "sending a photo"; +"lng_user_action_upload_photo" = "{user} is sending a photo"; +"lng_send_action_upload_file" = "sending a file"; +"lng_user_action_upload_file" = "{user} is sending a file"; +"lng_send_action_geo_location" = "picking a location"; +"lng_user_action_geo_location" = "{user} is picking a location"; +"lng_send_action_choose_contact" = "choosing a contact"; +"lng_user_action_choose_contact" = "{user} is choosing a contact"; "lng_unread_bar" = "{count:_not_used_|#개의 읽지 않은 메시지|#개의 읽지 않은 메시지}"; "lng_maps_point" = "위치"; "lng_save_photo" = "사진 저장"; -"lng_save_video" = "동영상 저장"; -"lng_save_audio" = "음성 저장"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "파일 저장"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -755,7 +760,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "이메일 복사"; "lng_context_copy_hashtag" = "해시태그 복사"; "lng_context_copy_mention" = "아이디 복사"; -"lng_context_save_image" = "이미지를 다른 이름으로 저장.."; +"lng_context_save_image" = "Save Image As..."; "lng_context_forward_image" = "이미지 전달"; "lng_context_delete_image" = "이미지 삭제"; "lng_context_copy_image" = "이미지 복사"; @@ -763,11 +768,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "다운로드 취소"; "lng_context_show_in_folder" = "탐색기에서 보기"; "lng_context_show_in_finder" = "탐색기에서 보기"; -"lng_context_save_video" = "비디오 이름을 다른이름으로 저장."; -"lng_context_save_audio" = "음성메시지를 다른 이름으로 저장.."; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "팩 정보"; "lng_context_pack_add" = "스티커 추가"; -"lng_context_save_file" = "파일을 다른 이름으로 저장.."; +"lng_context_save_file" = "Save File As..."; "lng_context_forward_file" = "파일 전달"; "lng_context_delete_file" = "파일 삭제"; "lng_context_close_file" = "파일 닫기"; @@ -794,7 +800,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "파일이 1.5GB 보다 큼으로 전송 할 수 없습니다 :("; "lng_send_folder" = " «{name}»은 폴더이기 때문에 전송 할 수 없습니다 :("; -"lng_forward_choose" = "수신자를 선택하세요.."; +"lng_forward_choose" = "Choose recipient..."; "lng_forward_cant" = "이쪽으로 전달 할 수 없습니다 :("; "lng_forward_confirm" = "{recipient} 님에게 전달하시겠습니까?"; "lng_forward_share_contact" = "{recipient} 님에게 연락처를 공유하시겠습니까?"; @@ -857,7 +863,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_search_global_results" = "아이디 검색 결과"; "lng_media_save_progress" = "{ready} / {total} {mb}"; -"lng_mediaview_save_as" = "다른 이름으로 저장하기"; +"lng_mediaview_save_as" = "Save As..."; "lng_mediaview_copy" = "복사하기"; "lng_mediaview_forward" = "전달"; "lng_mediaview_delete" = "삭제"; diff --git a/Telegram/SourceFiles/langs/lang_nl.strings b/Telegram/SourceFiles/langs/lang_nl.strings index 801c4b822a..635693b07e 100644 --- a/Telegram/SourceFiles/langs/lang_nl.strings +++ b/Telegram/SourceFiles/langs/lang_nl.strings @@ -86,8 +86,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cancel" = "Annuleren"; "lng_continue" = "Doorgaan"; "lng_close" = "Sluiten"; -"lng_connecting" = "Verbinden"; -"lng_reconnecting" = "Opnieuw verbinden {count:nu|over # s|over # s}"; +"lng_connecting" = "Verbinden..."; +"lng_reconnecting" = "Opnieuw verbinden {count:nu|over # s|over # s}..."; "lng_reconnecting_try_now" = "Probeer nu"; "lng_status_service_notifications" = "servicemeldingen"; @@ -108,7 +108,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_status_lastseen_date" = "laatst gezien {date}"; "lng_status_lastseen_date_time" = "laatst gezien {date} om {time}"; "lng_status_online" = "online"; -"lng_status_connecting" = "verbinden"; +"lng_status_connecting" = "verbinden..."; "lng_chat_status_unaccessible" = "groep is ontoegankelijk"; "lng_chat_status_members" = "{count:geen leden|# lid|# leden}"; @@ -162,7 +162,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_code_telegram" = "Voer de code in die je zojuist\nhebt ontvangen in je vorige [b]Telegram[/b]-app."; "lng_code_no_telegram" = "Verstuur code via SMS"; "lng_code_call" = "Telegram belt je over {minutes}:{seconds}"; -"lng_code_calling" = "Oproepverzoek versturen naar Telegram"; +"lng_code_calling" = "Oproepverzoek naar Telegram..."; "lng_code_called" = "Telegram heeft je nummer gebeld"; "lng_bad_phone" = "Ongeldig telefoonnummer. \nProbeer het opnieuw."; @@ -201,7 +201,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "Kanaalnaam"; "lng_no_contacts" = "Je hebt geen contacten"; "lng_no_chats" = "Hier komen je chats"; -"lng_contacts_loading" = "Bezig met laden"; +"lng_contacts_loading" = "Laden..."; "lng_contacts_not_found" = "Geen contacten gevonden"; "lng_dlg_search_chat" = "Zoek in deze chat"; "lng_dlg_search_channel" = "Zoek in dit kanaal"; @@ -210,7 +210,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Opslaan"; "lng_settings_upload" = "Profielfoto instellen"; "lng_settings_crop_profile" = "Kies een vierkant voor je profielfoto"; -"lng_settings_uploading_photo" = "Foto uploaden"; +"lng_settings_uploading_photo" = "Foto uploaden..."; "lng_username_title" = "Gebruikersnaam"; "lng_username_about" = "Je kunt hier je gebruikersnaam kiezen. \nHiermee kunnen anderen je vinden \nen contact met je opnemen zonder \nje telefoonnummer te weten.\n\na-z, 0-9 en underscore is toegestaan. \nDe minimale lengte is 5 tekens."; @@ -247,9 +247,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "Automatisch bijwerken"; "lng_settings_current_version" = "Versie {version}"; "lng_settings_check_now" = "Controleer op updates"; -"lng_settings_update_checking" = "Op updates controleren"; +"lng_settings_update_checking" = "Controleren op updates..."; "lng_settings_latest_installed" = "Meest recente versie is geïnstalleerd."; -"lng_settings_downloading" = "Update downloaden {ready} / {total} MB"; +"lng_settings_downloading" = "Update downloaden {ready} / {total} MB..."; "lng_settings_update_ready" = "Nieuwe versie staat klaar"; "lng_settings_update_now" = "Nu herstarten"; "lng_settings_update_fail" = "Controleren op updates mislukt"; @@ -291,7 +291,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "Download kon niet worden gestart. De oorzaak kan een ongeldige downloadmap zijn.\n\nJe kunt de map aanpassen via instellingen."; "lng_download_path_settings" = "Instellingen"; "lng_download_finish_failed" = "Downloaden mislukt.\n\nWil je het opnieuw proberen?"; -"lng_download_path_clearing" = "Wissen"; +"lng_download_path_clearing" = "Wissen..."; "lng_download_path_cleared" = "Gewist!"; "lng_download_path_clear_failed" = "Wissen mislukt"; @@ -300,7 +300,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|# afbeelding|# afbeeldingen}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|# spraakbericht|# spraakberichten}, {size}"; "lng_local_storage_clear" = "Alles wissen"; -"lng_local_storage_clearing" = "Wissen"; +"lng_local_storage_clearing" = "Wissen..."; "lng_local_storage_cleared" = "Gewist!"; "lng_local_storage_clear_failed" = "Wissen mislukt"; @@ -358,9 +358,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "Wachtwoord is niet gewijzigd"; "lng_connection_type" = "Verbindingstype:"; -"lng_connection_auto_connecting" = "Standaard (verbinden)"; +"lng_connection_auto_connecting" = "Standaard (verbinden...)"; "lng_connection_auto" = "Standaard ({transport} wordt gebruikt)"; -"lng_connection_proxy_connecting" = "Verbinden via proxy.."; +"lng_connection_proxy_connecting" = "Verbinden via proxy..."; "lng_connection_proxy" = "{transport} met proxy"; "lng_connection_header" = "Verbindingstype"; "lng_connection_auto_rb" = "Auto (TCP indien beschikbaar of HTTP)"; @@ -439,7 +439,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "{user} uit de groep verwijderen?"; "lng_profile_sure_kick_channel" = "{user} uit het kanaal verwijderen?"; "lng_profile_sure_kick_admin" = "{user} ontslaan als beheerder?"; -"lng_profile_loading" = "Bezig met laden"; +"lng_profile_loading" = "Laden..."; "lng_profile_shared_media" = "Gedeelde media"; "lng_profile_no_media" = "Geen media in deze chat."; "lng_profile_photos" = "{count:_not_used_|# foto|# foto's} »"; @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# gedeelde link|# gedeelde links} »"; "lng_profile_shared_links_header" = "Links-overzicht"; "lng_profile_copy_phone" = "Telefoonnummer kopiëren"; +"lng_profile_copy_fullname" = "Naam kopiëren"; "lng_channel_add_admins" = "Beheerder toevoegen"; "lng_channel_add_members" = "Leden toevoegen"; @@ -662,9 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Laden..|# sticker|# stickers}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Video"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "Contact"; -"lng_in_dlg_audio" = "Geluidsbestand"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "Bestand"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -678,18 +680,20 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "Spam van deze groep echt melden?"; "lng_report_spam_sure_channel" = "Spam van dit kanaal echt melden?"; "lng_report_spam_ok" = "Melden"; -"lng_cant_send_to_not_contact" = "Op dit moment kun je alleen berichten\nversturen naar onderlinge contacten. {more_info}"; -"lng_cant_invite_not_contact" = "Op dit moment kun je alleen onderlinge\ncontacten aan groepen toevoegen. {more_info}"; +"lng_cant_send_to_not_contact" = "Je kunt momenteel alleen berichten\nversturen naar onderlinge contacten.\n{more_info}"; +"lng_cant_invite_not_contact" = "Je kunt momenteel alleen onderlinge\ncontacten aan kanalen toevoegen.\n{more_info}"; "lng_cant_invite_not_contact_channel" = "Je kunt momenteel alleen onderlinge\ncontacten aan kanalen toevoegen.\n{more_info}"; "lng_cant_more_info" = "Meer informatie »"; +"lng_cant_invite_banned" = "Alleen beheerders kunnen deze gebruiker toevoegen."; "lng_cant_invite_privacy" = "Je kunt deze gebruiker niet toevoegen aan groepen door zijn/haar privacyinstellingen."; "lng_cant_invite_privacy_channel" = "Je kunt deze gebruiker niet toevoegen aan kanalen door zijn/haar privacyinstellingen."; +"lng_cant_do_this" = "Deze actie is niet beschikbaar."; "lng_send_button" = "Stuur"; -"lng_message_ph" = "Bericht schrijven"; -"lng_comment_ph" = "Reactie"; -"lng_broadcast_ph" = "Massabericht"; -"lng_broadcast_silent_ph" = "Stil massabericht.."; +"lng_message_ph" = "Bericht..."; +"lng_comment_ph" = "Reactie..."; +"lng_broadcast_ph" = "Massabericht..."; +"lng_broadcast_silent_ph" = "Stil massabericht..."; "lng_record_cancel" = "Annuleren: uit het vak loslaten"; "lng_will_be_notified" = "Berichtgeving voor leden"; "lng_wont_be_notified" = "Geen berichtgeving voor leden"; @@ -721,14 +725,14 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_action_record_video" = "{user} neemt video op"; "lng_send_action_upload_video" = "video versturen"; "lng_user_action_upload_video" = "{user} verstuurt video"; -"lng_send_action_record_audio" = "geluid opnemen"; -"lng_user_action_record_audio" = "{user} neemt geluid op"; -"lng_send_action_upload_audio" = "geluid versturen"; -"lng_user_action_upload_audio" = "{user} verstuurt geluid"; +"lng_send_action_record_audio" = "spraakbericht opnemen"; +"lng_user_action_record_audio" = "{user} neemt spraakbericht op"; +"lng_send_action_upload_audio" = "spraakbericht versturen"; +"lng_user_action_upload_audio" = "{user} verstuurt spraakbericht"; "lng_send_action_upload_photo" = "foto versturen"; "lng_user_action_upload_photo" = "{user} verstuurt een foto"; "lng_send_action_upload_file" = "bestand versturen"; -"lng_user_action_upload_file" = "{user} verstuurt een bestand"; +"lng_user_action_upload_file" = "{user} verstuurt bestand"; "lng_send_action_geo_location" = "locatie kiezen"; "lng_user_action_geo_location" = "{user} kiest een locatie"; "lng_send_action_choose_contact" = "contact kiezen"; @@ -737,8 +741,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_maps_point" = "Locatie"; "lng_save_photo" = "Afbeelding opslaan"; -"lng_save_video" = "Video opslaan"; -"lng_save_audio" = "Geluidsbestand opslaan"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "Bestand opslaan"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -755,7 +760,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "E-mailadres kopiëren"; "lng_context_copy_hashtag" = "Hashtag kopiëren"; "lng_context_copy_mention" = "Gebruikersnaam kopiëren"; -"lng_context_save_image" = "Afbeelding opslaan als"; +"lng_context_save_image" = "Afbeelding opslaan als..."; "lng_context_forward_image" = "Afbeelding doorsturen"; "lng_context_delete_image" = "Afbeelding verwijderen"; "lng_context_copy_image" = "Afbeelding kopiëren"; @@ -763,11 +768,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Download annuleren"; "lng_context_show_in_folder" = "Weergeven in map"; "lng_context_show_in_finder" = "Weergeven in Finder"; -"lng_context_save_video" = "Video opslaan als"; -"lng_context_save_audio" = "Geluidsbestand opslaan als"; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "Bundelinformatie"; "lng_context_pack_add" = "Stickers toevoegen"; -"lng_context_save_file" = "Bestand opslaan als"; +"lng_context_save_file" = "Bestand opslaan als..."; "lng_context_forward_file" = "Bestand doorsturen"; "lng_context_delete_file" = "Bestand verwijderen"; "lng_context_close_file" = "Bestand sluiten"; @@ -794,7 +800,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Dit bestand is groter dan 1,5 GB en kan niet worden verstuurd :("; "lng_send_folder" = "Kan de map «{name}» niet versturen, kies een bestand. :("; -"lng_forward_choose" = "Ontvanger kiezen"; +"lng_forward_choose" = "Ontvanger kiezen..."; "lng_forward_cant" = "Sorry, doorsturen hierheen kan niet :("; "lng_forward_confirm" = "Doorsturen naar {recipient}?"; "lng_forward_share_contact" = "Contact delen met {recipient}?"; @@ -857,7 +863,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_search_global_results" = "Wereldwijde zoekresultaten"; "lng_media_save_progress" = "{ready} van {total} {mb}"; -"lng_mediaview_save_as" = "Opslaan als"; +"lng_mediaview_save_as" = "Opslaan als..."; "lng_mediaview_copy" = "Kopiëren"; "lng_mediaview_forward" = "Doorsturen"; "lng_mediaview_delete" = "Verwijder"; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index e0e255d99a..cf8b4082ef 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -87,7 +87,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_continue" = "Continuar"; "lng_close" = "Fechar"; "lng_connecting" = "Conectando..."; -"lng_reconnecting" = "Reconectar {count:agora|em # s|em # s}.."; +"lng_reconnecting" = "Reconectar {count:agora|em # s|em # s}..."; "lng_reconnecting_try_now" = "Tentar agora"; "lng_status_service_notifications" = "notificações de serviço"; @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "Essa mensagem foi apagada"; "lng_edit_too_long" = "Sua mensagem está muito longa"; "lng_edit_message" = "Editar mensagem"; -"lng_edit_message_text" = "Nova mensagem..."; +"lng_edit_message_text" = "Nova mensagem de texto..."; "lng_deleted" = "Desconhecido"; "lng_deleted_message" = "Mensagem apagada"; "lng_pinned_message" = "Mensagem fixada"; @@ -201,7 +201,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "Nome do canal"; "lng_no_contacts" = "Você não possui contatos"; "lng_no_chats" = "Seus chats estarão aqui"; -"lng_contacts_loading" = "Carregando.."; +"lng_contacts_loading" = "Carregando..."; "lng_contacts_not_found" = "Nenhum contato encontrado"; "lng_dlg_search_chat" = "Buscar nesse chat"; "lng_dlg_search_channel" = "Buscar nesse canal"; @@ -210,7 +210,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Salvar"; "lng_settings_upload" = "Definir Foto de Perfil"; "lng_settings_crop_profile" = "Selecione uma área para a foto do perfil"; -"lng_settings_uploading_photo" = "Carregando foto.."; +"lng_settings_uploading_photo" = "Carregando foto..."; "lng_username_title" = "Nome de usuário"; "lng_username_about" = "Você pode escolher um nome de usuário no Telegram.\nAssim, outras pessoas poderão te encontrar\npelo nome de usuário e entrar em contato\nsem precisar saber seu telefone.\n\nVocê pode usar a-z, 0-9 e underline.\nO tamanho mínimo é 5 caracteres."; @@ -247,9 +247,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "Atualizar automaticamente"; "lng_settings_current_version" = "Versão {version}"; "lng_settings_check_now" = "Verificar atualizações"; -"lng_settings_update_checking" = "Verificando atualizações"; +"lng_settings_update_checking" = "Verificando atualizações..."; "lng_settings_latest_installed" = "Última versão está instalada"; -"lng_settings_downloading" = "Baixando atualização {ready} / {total} MB.."; +"lng_settings_downloading" = "Baixando atualização {ready} / {total} MB..."; "lng_settings_update_ready" = "Nova versão está pronta"; "lng_settings_update_now" = "Reiniciar Agora"; "lng_settings_update_fail" = "Verificação de atualização falhou :("; @@ -291,7 +291,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "Download do arquivo não pôde iniciar. Isso pode ter acontecido por um problema na pasta de downlaod.\n\nVocê pode alterar o caminho dos downloads em Configurações."; "lng_download_path_settings" = "Configurações"; "lng_download_finish_failed" = "Arquivo baixado não pôde ser finalizado.\n\nGostaria de tentar novamente?"; -"lng_download_path_clearing" = "Limpando.."; +"lng_download_path_clearing" = "Limpando..."; "lng_download_path_cleared" = "Concluído!"; "lng_download_path_clear_failed" = "Limpeza falhou :("; @@ -300,7 +300,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|# imagem|# imagens}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|# mensagem de voz|# mensagens de voz}, {size}"; "lng_local_storage_clear" = "Limpar tudo"; -"lng_local_storage_clearing" = "Limpando.."; +"lng_local_storage_clearing" = "Limpando..."; "lng_local_storage_cleared" = "Concluído!"; "lng_local_storage_clear_failed" = "Limpeza falhou :("; @@ -331,7 +331,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_passcode_logout" = "Sair"; "lng_passcode_need_unblock" = "Você precisa me desbloquear primeiro."; -"lng_cloud_password_waiting" = "Link de confirmação enviado para {email}.."; +"lng_cloud_password_waiting" = "Link de confirmação enviado para {email}..."; "lng_cloud_password_change" = "Alterar senha da nuvem"; "lng_cloud_password_create" = "Senha da nuvem"; "lng_cloud_password_remove" = "Remover senha da nuvem"; @@ -358,7 +358,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "Senha não alterada"; "lng_connection_type" = "Tipo de conexão:"; -"lng_connection_auto_connecting" = "Padrão (conectando..)"; +"lng_connection_auto_connecting" = "Padrão (conectando...)"; "lng_connection_auto" = "Padrão ({transport} usado)"; "lng_connection_proxy_connecting" = "Conectando via proxy..."; "lng_connection_proxy" = "{transport} com proxy"; @@ -396,7 +396,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_sessions_other_desc" = "Você pode entrar no Telegram de outro celular, tablet e computadores, usando o mesmo número de telefone. Todos seus dados estarão sincronizados."; "lng_sessions_terminate_all" = "Encerrar todas as outras sessões"; -"lng_preview_loading" = "Obtendo informações.."; +"lng_preview_loading" = "Obtendo Informações do Link..."; "lng_profile_chat_unaccessible" = "Grupo inacessível"; "lng_topbar_info" = "Info"; @@ -439,7 +439,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "Remover {user} do grupo?"; "lng_profile_sure_kick_channel" = "Remover {user} do canal?"; "lng_profile_sure_kick_admin" = "Remover {user} dos administradores?"; -"lng_profile_loading" = "Carregando.."; +"lng_profile_loading" = "Carregando..."; "lng_profile_shared_media" = "Mídia compartilhada"; "lng_profile_no_media" = "Nenhuma mídia nessa conversa."; "lng_profile_photos" = "{count:_not_used_|# foto|# fotos} »"; @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# link|# links} »"; "lng_profile_shared_links_header" = "Links"; "lng_profile_copy_phone" = "Copiar número de telefone"; +"lng_profile_copy_fullname" = "Copiar nome"; "lng_channel_add_admins" = "Novo administrador"; "lng_channel_add_members" = "Adicionar membros"; @@ -659,12 +660,13 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_remove" = "Remover"; "lng_stickers_return" = "Desfazer"; "lng_stickers_restore" = "Restaurar"; -"lng_stickers_count" = "{count:Carregando..|# sticker|# stickers}"; +"lng_stickers_count" = "{count:Carregando...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Vídeo"; +"lng_in_dlg_video" = "Video file"; +"lng_in_dlg_audio_file" = "Audio file"; "lng_in_dlg_contact" = "Contato"; -"lng_in_dlg_audio" = "Áudio"; +"lng_in_dlg_audio" = "Voice message"; "lng_in_dlg_file" = "Arquivo"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -678,18 +680,20 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_report_spam_sure_group" = "Tem certeza que deseja reportar spam desse grupo?"; "lng_report_spam_sure_channel" = "Tem certeza que deseja reportar spam desse canal?"; "lng_report_spam_ok" = "Reportar"; -"lng_cant_send_to_not_contact" = "Você só pode enviar mensagens para\ncontatos mútuos no momento. {more_info}"; -"lng_cant_invite_not_contact" = "Você só pode adicionar contatos\nmútuos ao grupo no momento. {more_info}"; -"lng_cant_invite_not_contact_channel" = "Desculpe, você só pode adicionar contatos\nmútuos para canais no momento. {more_info}"; +"lng_cant_send_to_not_contact" = "Desculpe, você só pode enviar mensagens\npara contatos mútuos no momento.\n{more_info}"; +"lng_cant_invite_not_contact" = "Desculpe, no momento você só pode adicionar\ncontatos mútuos em grupos.\n{more_info}"; +"lng_cant_invite_not_contact_channel" = "Desculpe, no momento você só pode adicionar\ncontatos mútuos nos canais.\n{more_info}"; "lng_cant_more_info" = "Informações »"; +"lng_cant_invite_banned" = "Apenas um administrador pode adicionar esse usuário."; "lng_cant_invite_privacy" = "Você não pode adicionar esse usuário em grupos devido as configurações de privacidade."; "lng_cant_invite_privacy_channel" = "Você não pode adicionar esse usuário em canais devido as configurações de privacidade."; +"lng_cant_do_this" = "Essa ação não está disponível."; "lng_send_button" = "Enviar"; -"lng_message_ph" = "Escrever a mensagem.."; +"lng_message_ph" = "Escrever uma mensagem..."; "lng_comment_ph" = "Escreva um comentário..."; -"lng_broadcast_ph" = "Transmitir a mensagem..."; -"lng_broadcast_silent_ph" = "Silenciar transmissão..."; +"lng_broadcast_ph" = "Transmitir uma mensagem..."; +"lng_broadcast_silent_ph" = "Transmissão silenciosa..."; "lng_record_cancel" = "Solte fora desse campo para cancelar"; "lng_will_be_notified" = "Os membros serão notificados quando você postar"; "lng_wont_be_notified" = "Os membros não serão notificados quando você postar"; @@ -717,28 +721,29 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_user_typing" = "{user} está escrevendo"; "lng_users_typing" = "{user} e {second_user} estão escrevendo"; "lng_many_typing" = "{count:_not_used_|# está|# estão} escrevendo"; -"lng_send_action_record_video" = "gravando vídeo"; -"lng_user_action_record_video" = "{user} está gravando vídeo"; -"lng_send_action_upload_video" = "enviando vídeo"; -"lng_user_action_upload_video" = "{user} está enviando vídeo"; -"lng_send_action_record_audio" = "gravando áudio"; -"lng_user_action_record_audio" = "{user} está gravando áudio"; -"lng_send_action_upload_audio" = "enviando áudio"; -"lng_user_action_upload_audio" = "{user} está gravando áudio"; -"lng_send_action_upload_photo" = "enviando foto"; -"lng_user_action_upload_photo" = "{user} está enviando foto"; -"lng_send_action_upload_file" = "enviando arquivo"; -"lng_user_action_upload_file" = "{user} está enviando arquivo"; -"lng_send_action_geo_location" = "escolhendo local"; -"lng_user_action_geo_location" = "{user} está escolhendo local"; -"lng_send_action_choose_contact" = "escolhendo contato"; -"lng_user_action_choose_contact" = "{user} está escolhendo contato"; +"lng_send_action_record_video" = "gravando um vídeo"; +"lng_user_action_record_video" = "{user} está gravando um vídeo"; +"lng_send_action_upload_video" = "enviando um vídeo"; +"lng_user_action_upload_video" = "{user} está enviando um vídeo"; +"lng_send_action_record_audio" = "gravando uma mensagem de voz"; +"lng_user_action_record_audio" = "{user} está gravando um áudio"; +"lng_send_action_upload_audio" = "enviando uma mensagem de voz"; +"lng_user_action_upload_audio" = "{user} está enviando um áudio"; +"lng_send_action_upload_photo" = "enviando uma foto"; +"lng_user_action_upload_photo" = "{user} está enviando uma foto"; +"lng_send_action_upload_file" = "enviando um arquivo"; +"lng_user_action_upload_file" = "{user} está enviando um arquivo"; +"lng_send_action_geo_location" = "escolhendo uma localização"; +"lng_user_action_geo_location" = "{user} está escolhendo uma localização"; +"lng_send_action_choose_contact" = "escolhendo um contato"; +"lng_user_action_choose_contact" = "{user} está escolhendo um contato"; "lng_unread_bar" = "{count:_not_used_|# mensagem não lida|# mensagens não lidas}"; "lng_maps_point" = "Localização"; "lng_save_photo" = "Salvar imagem"; -"lng_save_video" = "Salvar vídeo"; -"lng_save_audio" = "Salvar áudio"; +"lng_save_video" = "Save video file"; +"lng_save_audio_file" = "Save audio file"; +"lng_save_audio" = "Save voice message"; "lng_save_file" = "Salvar arquivo"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -755,7 +760,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "Copiar endereço de email"; "lng_context_copy_hashtag" = "Copiar hashtag"; "lng_context_copy_mention" = "Copiar nome de usuário"; -"lng_context_save_image" = "Salvar Imagem Como.."; +"lng_context_save_image" = "Salvar Imagem Como..."; "lng_context_forward_image" = "Encaminhar Imagem"; "lng_context_delete_image" = "Apagar Imagem"; "lng_context_copy_image" = "Copiar Imagem"; @@ -763,11 +768,12 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancelar Download"; "lng_context_show_in_folder" = "Mostrar na Pasta"; "lng_context_show_in_finder" = "Mostrar no Finder"; -"lng_context_save_video" = "Salvar Vídeo Como.."; -"lng_context_save_audio" = "Salvar Áudio Como.."; +"lng_context_save_video" = "Save Video File As..."; +"lng_context_save_audio_file" = "Save Audio File As..."; +"lng_context_save_audio" = "Save Voice Message As..."; "lng_context_pack_info" = "Informação do pacote"; "lng_context_pack_add" = "Adicionar aos Stickers"; -"lng_context_save_file" = "Salvar Arquivo Como.."; +"lng_context_save_file" = "Salvar Arquivo Como..."; "lng_context_forward_file" = "Encaminhar Arquivo"; "lng_context_delete_file" = "Apagar Arquivo"; "lng_context_close_file" = "Fechar Arquivo"; @@ -794,7 +800,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Não pude enviar, o arquivo é maior que 1.5GB :("; "lng_send_folder" = "Não pude enviar «{name}» porque é um diretório :("; -"lng_forward_choose" = "Escolher recipiente.."; +"lng_forward_choose" = "Escolher recipiente..."; "lng_forward_cant" = "Desculpe, não há como encaminhar aqui :("; "lng_forward_confirm" = "Encaminhar para {recipient}?"; "lng_forward_share_contact" = "Compartilhar contato com {recipient}?"; @@ -857,7 +863,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_search_global_results" = "Resultados da busca global"; "lng_media_save_progress" = "{ready} de {total} {mb}"; -"lng_mediaview_save_as" = "Salvar Como.."; +"lng_mediaview_save_as" = "Salvar Como..."; "lng_mediaview_copy" = "Copiar"; "lng_mediaview_forward" = "Encaminhar"; "lng_mediaview_delete" = "Apagar"; From 559a74847b0feee43e528db161c9b460f0c1eda7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 18:20:34 +0300 Subject: [PATCH 258/316] OrderedSet class done using QMap as implementation, instead of inheriting it, fixed replies delete code. --- Telegram/SourceFiles/app.cpp | 26 ++-- Telegram/SourceFiles/boxes/contactsbox.cpp | 11 +- Telegram/SourceFiles/dropdown.cpp | 3 +- Telegram/SourceFiles/facades.cpp | 4 +- Telegram/SourceFiles/history.cpp | 6 +- Telegram/SourceFiles/mtproto/dcenter.cpp | 6 +- Telegram/SourceFiles/mtproto/facade.cpp | 6 +- .../SourceFiles/mtproto/file_download.cpp | 20 +-- Telegram/SourceFiles/types.h | 121 +++++++++++++++++- 9 files changed, 161 insertions(+), 42 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 407ea84e96..b35fc9abc2 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1794,17 +1794,17 @@ namespace App { MsgsData *data = fetchMsgsData(item->channelId(), false); if (!data) return; - MsgsData::iterator i = data->find(item->id); + auto i = data->find(item->id); if (i != data->cend()) { if (i.value() == item) { data->erase(i); } } historyItemDetached(item); - DependentItems::iterator j = ::dependentItems.find(item); + auto j = ::dependentItems.find(item); if (j != ::dependentItems.cend()) { - for (OrderedSet::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { - k.key()->dependencyItemRemoved(item); + for_const (HistoryItem *dependent, j.value()) { + dependent->dependencyItemRemoved(item); } ::dependentItems.erase(j); } @@ -1816,8 +1816,8 @@ namespace App { void historyUpdateDependent(HistoryItem *item) { DependentItems::iterator j = ::dependentItems.find(item); if (j != ::dependentItems.cend()) { - for (OrderedSet::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) { - k.key()->updateDependencyItem(); + for_const (HistoryItem *dependent, j.value()) { + dependent->updateDependencyItem(); } } if (App::main()) { @@ -1829,15 +1829,15 @@ namespace App { ::dependentItems.clear(); QVector toDelete; - for (MsgsData::const_iterator i = msgsData.cbegin(), e = msgsData.cend(); i != e; ++i) { - if ((*i)->detached()) { - toDelete.push_back(*i); + for_const (HistoryItem *item, msgsData) { + if (item->detached()) { + toDelete.push_back(item); } } - for (ChannelMsgsData::const_iterator j = channelMsgsData.cbegin(), end = channelMsgsData.cend(); j != end; ++j) { - for (MsgsData::const_iterator i = j->cbegin(), e = j->cend(); i != e; ++i) { - if ((*i)->detached()) { - toDelete.push_back(*i); + for_const (const MsgsData &chMsgsData, channelMsgsData) { + for_const (HistoryItem *item, chMsgsData) { + if (item->detached()) { + toDelete.push_back(item); } } } diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 0d23989d5d..3e0cf92125 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1670,12 +1670,15 @@ void ContactsBox::getAdminsDone(const MTPmessages_ChatFull &result) { } } _saveRequestId = 0; - for (ChatData::Admins::const_iterator i = curadmins.cbegin(), e = curadmins.cend(); i != e; ++i) { - MTP::send(MTPmessages_EditChatAdmin(_inner.chat()->inputChat, i.key()->inputUser, MTP_boolFalse()), rpcDone(&ContactsBox::removeAdminDone, i.key()), rpcFail(&ContactsBox::editAdminFail), 0, (appoint.isEmpty() && i + 1 == e) ? 0 : 10); + + for_const (UserData *user, curadmins) { + MTP::send(MTPmessages_EditChatAdmin(_inner.chat()->inputChat, user->inputUser, MTP_boolFalse()), rpcDone(&ContactsBox::removeAdminDone, user), rpcFail(&ContactsBox::editAdminFail), 0, 10); } - for (int32 i = 0, l = appoint.size(); i < l; ++i) { - MTP::send(MTPmessages_EditChatAdmin(_inner.chat()->inputChat, appoint.at(i)->inputUser, MTP_boolTrue()), rpcDone(&ContactsBox::setAdminDone, appoint.at(i)), rpcFail(&ContactsBox::editAdminFail), 0, (i + 1 == l) ? 0 : 10); + for_const (UserData *user, appoint) { + MTP::send(MTPmessages_EditChatAdmin(_inner.chat()->inputChat, user->inputUser, MTP_boolTrue()), rpcDone(&ContactsBox::setAdminDone, user), rpcFail(&ContactsBox::editAdminFail), 0, 10); } + MTP::sendAnything(); + _saveRequestId = curadmins.size() + appoint.size(); if (!_saveRequestId) { onClose(); diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index 44d9d2653c..ee475348b0 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -4501,8 +4501,7 @@ void MentionsDropdown::updateFiltered(bool resetScroll) { if (_channel->mgInfo->bots.isEmpty()) { if (!_channel->mgInfo->botStatus && App::api()) App::api()->requestBots(_channel); } else { - for (MegagroupInfo::Bots::const_iterator i = _channel->mgInfo->bots.cbegin(), e = _channel->mgInfo->bots.cend(); i != e; ++i) { - UserData *user = i.key(); + for_const (auto *user, _channel->mgInfo->bots) { if (!user->botInfo) continue; if (!user->botInfo->inited && App::api()) App::api()->requestFullPeer(user); if (user->botInfo->commands.isEmpty()) continue; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 378d807f94..0b9557e3d4 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -216,8 +216,8 @@ namespace Notify { 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()); + for_const (HistoryItem *item, Global::PendingRepaintItems()) { + Ui::repaintHistoryItem(item); } Global::RefPendingRepaintItems().clear(); } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index b04fb0b06d..4110b299aa 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6090,7 +6090,11 @@ void HistoryMessageReply::resize(int width) const { void HistoryMessageReply::itemRemoved(HistoryMessage *holder, HistoryItem *removed) { if (replyToMsg == removed) { - clearData(holder); + delete _replyToVia; + _replyToVia = nullptr; + + replyToMsg = nullptr; + replyToMsgId = 0; holder->setPendingInitDimensions(); } } diff --git a/Telegram/SourceFiles/mtproto/dcenter.cpp b/Telegram/SourceFiles/mtproto/dcenter.cpp index 62e6bdaf73..6fbdeac248 100644 --- a/Telegram/SourceFiles/mtproto/dcenter.cpp +++ b/Telegram/SourceFiles/mtproto/dcenter.cpp @@ -269,11 +269,11 @@ void ConfigLoader::enumDC() { dcs.insert(MTP::bareDcId(i.key())); } } - OrderedSet::const_iterator i = dcs.constFind(_enumCurrent); + auto i = dcs.constFind(_enumCurrent); if (i == dcs.cend() || (++i) == dcs.cend()) { - _enumCurrent = dcs.cbegin().key(); + _enumCurrent = *dcs.cbegin(); } else { - _enumCurrent = i.key(); + _enumCurrent = *i; } _enumRequest = MTP::send(MTPhelp_GetConfig(), rpcDone(configLoaded), rpcFail(configFailed), MTP::cfgDcId(_enumCurrent)); diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index eb3b23f2f7..ed02dadb9f 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -837,9 +837,9 @@ void finish() { sessions.clear(); mainSession = nullptr; - for (MTPQuittingConnections::const_iterator i = quittingConnections.cbegin(), e = quittingConnections.cend(); i != e; ++i) { - i.key()->waitTillFinish(); - delete i.key(); + for_const (internal::Connection *connection, quittingConnections) { + connection->waitTillFinish(); + delete connection; } quittingConnections.clear(); diff --git a/Telegram/SourceFiles/mtproto/file_download.cpp b/Telegram/SourceFiles/mtproto/file_download.cpp index aa8251de43..b7333812bd 100644 --- a/Telegram/SourceFiles/mtproto/file_download.cpp +++ b/Telegram/SourceFiles/mtproto/file_download.cpp @@ -985,27 +985,27 @@ void WebLoadManager::process() { i.value() = 0; } } - for (Loaders::iterator i = _loaders.begin(), e = _loaders.end(); i != e;) { - LoaderPointers::iterator it = _loaderPointers.find(i.key()->_interface); - if (it != _loaderPointers.cend() && it.key()->_private != i.key()) { + for (auto i = _loaders.begin(), e = _loaders.end(); i != e;) { + LoaderPointers::iterator it = _loaderPointers.find((*i)->_interface); + if (it != _loaderPointers.cend() && it.key()->_private != (*i)) { it = _loaderPointers.end(); } if (it == _loaderPointers.cend()) { - if (QNetworkReply *reply = i.key()->reply()) { + if (QNetworkReply *reply = (*i)->reply()) { _replies.remove(reply); reply->abort(); reply->deleteLater(); } - delete i.key(); + delete (*i); i = _loaders.erase(i); } else { ++i; } } } - for (Loaders::const_iterator i = newLoaders.cbegin(), e = newLoaders.cend(); i != e; ++i) { - if (_loaders.contains(i.key())) { - sendRequest(i.key()); + for_const (webFileLoaderPrivate *loader, newLoaders) { + if (_loaders.contains(loader)) { + sendRequest(loader); } } } @@ -1047,8 +1047,8 @@ void WebLoadManager::clear() { } _loaderPointers.clear(); - for (Loaders::iterator i = _loaders.begin(), e = _loaders.end(); i != e; ++i) { - delete i.key(); + for_const (webFileLoaderPrivate *loader, _loaders) { + delete loader; } _loaders.clear(); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 4d32633322..0c0b3f34bb 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -36,13 +36,126 @@ T *getPointerAndReset(T *&ptr) { struct NullType { }; +// ordered set template based on QMap template -class OrderedSet : public QMap { +class OrderedSet { + typedef OrderedSet Self; + typedef QMap Impl; + typedef typename Impl::iterator IteratorImpl; + typedef typename Impl::const_iterator ConstIteratorImpl; + Impl impl_; + public: - void insert(const T &v) { - QMap::insert(v, NullType()); - } + inline bool operator==(const Self &other) const { return impl_ == other.impl_; } + inline bool operator!=(const Self &other) const { return impl_ != other.impl_; } + inline int size() const { return impl_.size(); } + inline bool isEmpty() const { return impl_.isEmpty(); } + inline void detach() { return impl_.detach(); } + inline bool isDetached() const { return impl_.isDetached(); } + inline void clear() { return impl_.clear(); } + inline QList values() const { return impl_.keys(); } + inline const T &first() const { return impl_.firstKey(); } + inline const T &last() const { return impl_.lastKey(); } + + class const_iterator; + class iterator { + public: + typedef typename IteratorImpl::iterator_category iterator_category; + typedef typename IteratorImpl::difference_type difference_type; + typedef T value_type; + typedef T *pointer; + typedef T &reference; + + explicit iterator(const IteratorImpl &impl) : impl_(impl) { + } + inline const T &operator*() const { return impl_.key(); } + inline const T *operator->() const { return &impl_.key(); } + inline bool operator==(const iterator &other) const { return impl_ == other.impl_; } + inline bool operator!=(const iterator &other) const { return impl_ != other.impl_; } + inline iterator &operator++() { ++impl_; return *this; } + inline iterator operator++(int) { return iterator(impl_++); } + inline iterator &operator--() { --impl_; return *this; } + inline iterator operator--(int) { return iterator(impl_--); } + inline iterator operator+(int j) const { return iterator(impl_ + j); } + inline iterator operator-(int j) const { return iterator(impl_ - j); } + inline iterator &operator+=(int j) { impl_ += j; return *this; } + inline iterator &operator-=(int j) { impl_ -= j; return *this; } + + friend class const_iterator; + inline bool operator==(const const_iterator &other) const { return impl_ == other.impl_; } + inline bool operator!=(const const_iterator &other) const { return impl_ != other.impl_; } + + private: + IteratorImpl impl_; + friend class Self; + + }; + friend class iterator; + + class const_iterator { + public: + typedef typename IteratorImpl::iterator_category iterator_category; + typedef typename IteratorImpl::difference_type difference_type; + typedef T value_type; + typedef T *pointer; + typedef T &reference; + + explicit const_iterator(const ConstIteratorImpl &impl) : impl_(impl) { + } + inline const T &operator*() const { return impl_.key(); } + inline const T *operator->() const { return &impl_.key(); } + inline bool operator==(const const_iterator &other) const { return impl_ == other.impl_; } + inline bool operator!=(const const_iterator &other) const { return impl_ != other.impl_; } + inline const_iterator &operator++() { ++impl_; return *this; } + inline const_iterator operator++(int) { return const_iterator(impl_++); } + inline const_iterator &operator--() { --impl_; return *this; } + inline const_iterator operator--(int) { return const_iterator(impl_--); } + inline const_iterator operator+(int j) const { return const_iterator(impl_ + j); } + inline const_iterator operator-(int j) const { return const_iterator(impl_ - j); } + inline const_iterator &operator+=(int j) { impl_ += j; return *this; } + inline const_iterator &operator-=(int j) { impl_ -= j; return *this; } + + friend class iterator; + inline bool operator==(const iterator &other) const { return impl_ == other.impl_; } + inline bool operator!=(const iterator &o) const { return impl_ != other.impl_; } + + private: + ConstIteratorImpl impl_; + friend class Self; + + }; + friend class const_iterator; + + // STL style + inline iterator begin() { return iterator(impl_.begin()); } + inline const_iterator begin() const { return const_iterator(impl_.cbegin()); } + inline const_iterator constBegin() const { return const_iterator(impl_.cbegin()); } + inline const_iterator cbegin() const { return const_iterator(impl_.cbegin()); } + inline iterator end() { detach(); return iterator(impl_.end()); } + inline const_iterator end() const { return const_iterator(impl_.cend()); } + inline const_iterator constEnd() const { return const_iterator(impl_.cend()); } + inline const_iterator cend() const { return const_iterator(impl_.cend()); } + inline iterator erase(iterator it) { return iterator(impl_.erase(it.impl_)); } + + inline iterator insert(const T &value) { return iterator(impl_.insert(value, NullType())); } + inline iterator insert(const_iterator pos, const T &value) { return iterator(impl_.insert(pos.impl_, value, NullType())); } + inline int remove(const T &value) { return impl_.remove(value); } + inline bool contains(const T &value) const { return impl_.contains(value); } + + // more Qt + typedef iterator Iterator; + typedef const_iterator ConstIterator; + inline int count() const { return impl_.count(); } + inline iterator find(const T &value) { return iterator(impl_.find(value)); } + inline const_iterator find(const T &value) const { return const_iterator(impl_.constFind(value)); } + inline const_iterator constFind(const T &value) const { return const_iterator(impl_.constFind(value)); } + inline Self &unite(const Self &other) { impl_.unite(other.impl_); return *this; } + + // STL compatibility + typedef typename Impl::difference_type difference_type; + typedef typename Impl::size_type size_type; + inline bool empty() const { return impl_.empty(); } }; From 844e375fac8e2aa7892a6a6b29bc5c40e7fe0256 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 19:03:57 +0300 Subject: [PATCH 259/316] fixed new not important message adding --- Telegram/SourceFiles/history.cpp | 10 +++++----- Telegram/SourceFiles/history.h | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 4110b299aa..26da94f50c 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -759,12 +759,12 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp if (prev && prev->type() == HistoryItemGroup) { static_cast(prev)->uniteWith(item); - return prev; + } else { + QDateTime date = prev ? prev->date : item->date; + HistoryBlock *block = prev ? prev->block() : pushBackNewBlock(); + addItemToBlock(HistoryGroup::create(this, item, date), block); } - - QDateTime date = prev ? prev->date : item->date; - HistoryBlock *block = prev ? prev->block() : pushBackNewBlock(); - return addItemToBlock(HistoryGroup::create(this, item, date), block); + return item; } // when we are receiving channel dialog rows we get one important and one not important diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 07bce6754c..cf4223b7b8 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -1163,7 +1163,10 @@ public: return !_block; } void attachToBlock(HistoryBlock *block, int index) { - t_assert(_block == nullptr && _indexInBlock < 0); + t_assert(_block == nullptr); + t_assert(_indexInBlock < 0); + t_assert(block != nullptr); + t_assert(index >= 0); _block = block; _indexInBlock = index; @@ -1172,6 +1175,9 @@ public: } } void setIndexInBlock(int index) { + t_assert(_block != nullptr); + t_assert(index >= 0); + _indexInBlock = index; } int indexInBlock() const { From 3132e4dc175a6e1afd6784e10df16d9bf0e8d1f4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 19:39:58 +0300 Subject: [PATCH 260/316] Fixed collapse button style (looks like service message now). Added some asserts because of unknown crash in switch in channel. --- Telegram/Resources/style.txt | 2 +- Telegram/SourceFiles/history.cpp | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index d8e2e8cbd8..5ada019a85 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1148,7 +1148,7 @@ collapseButton: flatButton(btnDefFlat) { textTop: 3px; overTextTop: 3px; downTextTop: 3px; - height: 24px; + height: 25px; } collapseHideDuration: 200; collapseShowDuration: 200; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 26da94f50c..2b1b3173bc 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -830,6 +830,7 @@ void ChannelHistory::switchMode() { int willAddToBlock = qMin(int(MessagesPerPage), count - i); block->items.reserve(willAddToBlock); for (int till = i + willAddToBlock; i < till; ++i) { + t_assert(_otherList.at(i)->detached()); addItemToBlock(_otherList.at(i), block); } @@ -2565,6 +2566,8 @@ void History::changeMsgId(MsgId oldId, MsgId newId) { void History::removeBlock(HistoryBlock *block) { setPendingResize(); + t_assert(block->items.isEmpty()); + int index = block->indexInHistory(); blocks.removeAt(index); for (int i = index, l = blocks.size(); i < l; ++i) { @@ -2614,7 +2617,7 @@ void HistoryBlock::clear(bool leaveItems) { void HistoryBlock::removeItem(HistoryItem *item) { t_assert(item->block() == this); - int32 itemIndex = item->indexInBlock(); + int itemIndex = item->indexInBlock(); if (history->showFrom == item) { history->getNextShowFrom(this, itemIndex); } @@ -2625,13 +2628,14 @@ void HistoryBlock::removeItem(HistoryItem *item) { history->getNextScrollTopItem(this, itemIndex); } - int myIndex = indexInHistory(); - if (myIndex >= 0) { // fix message groups + int blockIndex = indexInHistory(); + if (blockIndex >= 0) { // fix message groups if (item->isImportant()) { // unite message groups around this important message - HistoryGroup *nextGroup = 0, *prevGroup = 0; - HistoryCollapse *nextCollapse = 0; - HistoryItem *prevItem = 0; - for (int32 nextBlock = myIndex, nextIndex = qMin(items.size(), itemIndex + 1); nextBlock < history->blocks.size(); ++nextBlock) { + HistoryGroup *nextGroup = nullptr; + HistoryGroup *prevGroup = nullptr; + HistoryCollapse *nextCollapse = nullptr; + HistoryItem *prevItem = nullptr; + for (int nextBlock = blockIndex, 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); @@ -2651,7 +2655,7 @@ void HistoryBlock::removeItem(HistoryItem *item) { break; } } - for (int32 prevBlock = myIndex + 1, prevIndex = qMax(1, itemIndex); prevBlock > 0;) { + for (int prevBlock = blockIndex + 1, prevIndex = qMax(1, itemIndex); prevBlock > 0;) { --prevBlock; HistoryBlock *block = history->blocks.at(prevBlock); if (!prevIndex) prevIndex = block->items.size(); @@ -2680,7 +2684,9 @@ void HistoryBlock::removeItem(HistoryItem *item) { } } } - // myIndex can be invalid now, because of destroying previous blocks + // blockIndex can be invalid now, because of destroying previous blocks + blockIndex = indexInHistory(); + itemIndex = item->indexInBlock(); items.remove(itemIndex); for (int i = itemIndex, l = items.size(); i < l; ++i) { From 36f34472ba82cc450c0f49769506e08d4cc62571 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 19:43:14 +0300 Subject: [PATCH 261/316] langs updated, supported systems updated --- README.md | 4 ++-- Telegram/Deploy.sh | 6 +++++- Telegram/SourceFiles/langs/lang_de.strings | 18 +++++++++--------- Telegram/SourceFiles/langs/lang_es.strings | 18 +++++++++--------- Telegram/SourceFiles/langs/lang_it.strings | 18 +++++++++--------- Telegram/SourceFiles/langs/lang_pt_BR.strings | 18 +++++++++--------- 6 files changed, 43 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 6229b0d784..8d7c28ddf4 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ The source code is published under GPLv3 with OpenSSL exception, the license is ## Supported systems * Windows XP - Windows 10 (**not** RT) -* Mac OS X 10.8 - Mac OS X 10.10 +* Mac OS X 10.8 - Mac OS X 10.11 * Mac OS X 10.6 - Mac OS X 10.7 (separate build) -* Ubuntu 12.04 - Ubuntu 14.04 +* Ubuntu 12.04 - Ubuntu 15.04 * Fedora 22 ## Third-party libraries diff --git a/Telegram/Deploy.sh b/Telegram/Deploy.sh index f87d403cfd..3f40b0fc75 100755 --- a/Telegram/Deploy.sh +++ b/Telegram/Deploy.sh @@ -57,7 +57,11 @@ elif [ "$BuildTarget" == "mac" ]; then echo "Deploying version $AppVersionStrFull for Windows.." else DeployMac="1" - DeployMac32="1" + if [ "$BetaVersion" != "0" ]; then + DeployMac32="0" + else + DeployMac32="1" + fi DeployWin="1" echo "Deploying three versions of $AppVersionStrFull: for Windows, OS X 10.6 and 10.7 and OS X 10.8+.." fi diff --git a/Telegram/SourceFiles/langs/lang_de.strings b/Telegram/SourceFiles/langs/lang_de.strings index de9dec99a5..a89dc41e83 100644 --- a/Telegram/SourceFiles/langs/lang_de.strings +++ b/Telegram/SourceFiles/langs/lang_de.strings @@ -663,10 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Lade...|# Sticker|# Sticker}"; "lng_in_dlg_photo" = "Bild"; -"lng_in_dlg_video" = "Video file"; -"lng_in_dlg_audio_file" = "Audio file"; +"lng_in_dlg_video" = "Videodatei"; +"lng_in_dlg_audio_file" = "Audiodatei"; "lng_in_dlg_contact" = "Kontakt"; -"lng_in_dlg_audio" = "Voice message"; +"lng_in_dlg_audio" = "Sprachnachricht"; "lng_in_dlg_file" = "Datei"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (Sticker)"; @@ -741,9 +741,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_maps_point" = "Standort"; "lng_save_photo" = "Bild speichern"; -"lng_save_video" = "Save video file"; -"lng_save_audio_file" = "Save audio file"; -"lng_save_audio" = "Save voice message"; +"lng_save_video" = "Videodatei speichern"; +"lng_save_audio_file" = "Audiodatei speichern"; +"lng_save_audio" = "Sprachnachricht speichern"; "lng_save_file" = "Datei speichern"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -768,9 +768,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Download abbrechen"; "lng_context_show_in_folder" = "Im Ordner anzeigen"; "lng_context_show_in_finder" = "Im Finder zeigen"; -"lng_context_save_video" = "Save Video File As..."; -"lng_context_save_audio_file" = "Save Audio File As..."; -"lng_context_save_audio" = "Save Voice Message As..."; +"lng_context_save_video" = "Videodatei speichern unter..."; +"lng_context_save_audio_file" = "Audiodatei speichern unter..."; +"lng_context_save_audio" = "Sprachnachricht speichern unter..."; "lng_context_pack_info" = "Sticker-Paket"; "lng_context_pack_add" = "Sticker hinzufügen"; "lng_context_save_file" = "Datei speichern unter..."; diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 27e7041870..79a8f12473 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -663,10 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Cargando...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Video file"; -"lng_in_dlg_audio_file" = "Audio file"; +"lng_in_dlg_video" = "Vídeo"; +"lng_in_dlg_audio_file" = "Audio"; "lng_in_dlg_contact" = "Contacto"; -"lng_in_dlg_audio" = "Voice message"; +"lng_in_dlg_audio" = "Mensaje de voz"; "lng_in_dlg_file" = "Archivo"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -741,9 +741,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_maps_point" = "Ubicación"; "lng_save_photo" = "Guardar imagen"; -"lng_save_video" = "Save video file"; -"lng_save_audio_file" = "Save audio file"; -"lng_save_audio" = "Save voice message"; +"lng_save_video" = "Guardar vídeo"; +"lng_save_audio_file" = "Guardar audio"; +"lng_save_audio" = "Guardar mensaje de voz"; "lng_save_file" = "Guardar archivo"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -768,9 +768,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancelar descarga"; "lng_context_show_in_folder" = "Mostrar en la carpeta"; "lng_context_show_in_finder" = "Mostrar en el Finder"; -"lng_context_save_video" = "Save Video File As..."; -"lng_context_save_audio_file" = "Save Audio File As..."; -"lng_context_save_audio" = "Save Voice Message As..."; +"lng_context_save_video" = "Guardar como..."; +"lng_context_save_audio_file" = "Guardar como..."; +"lng_context_save_audio" = "Guardar como..."; "lng_context_pack_info" = "Información del pack"; "lng_context_pack_add" = "Añadir stickers"; "lng_context_save_file" = "Guardar como..."; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 636096cb54..2dd317d7ec 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -663,10 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Caricamento...|# sticker|# sticker}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Video file"; -"lng_in_dlg_audio_file" = "Audio file"; +"lng_in_dlg_video" = "File video"; +"lng_in_dlg_audio_file" = "File audio"; "lng_in_dlg_contact" = "Contatto"; -"lng_in_dlg_audio" = "Voice message"; +"lng_in_dlg_audio" = "Messaggio vocale"; "lng_in_dlg_file" = "File"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -741,9 +741,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_maps_point" = "Posizione"; "lng_save_photo" = "Salva immagine"; -"lng_save_video" = "Save video file"; -"lng_save_audio_file" = "Save audio file"; -"lng_save_audio" = "Save voice message"; +"lng_save_video" = "Salva file video"; +"lng_save_audio_file" = "Salva file audio"; +"lng_save_audio" = "Salva messaggio vocale"; "lng_save_file" = "Salva file"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -768,9 +768,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Annulla download"; "lng_context_show_in_folder" = "Mostra nella cartella"; "lng_context_show_in_finder" = "Mostra nel Finder"; -"lng_context_save_video" = "Save Video File As..."; -"lng_context_save_audio_file" = "Save Audio File As..."; -"lng_context_save_audio" = "Save Voice Message As..."; +"lng_context_save_video" = "Salva file video come..."; +"lng_context_save_audio_file" = "Salva file audio come..."; +"lng_context_save_audio" = "Salva messaggio vocale come..."; "lng_context_pack_info" = "Mostra sticker"; "lng_context_pack_add" = "Aggiungi sticker"; "lng_context_save_file" = "Salva file come..."; diff --git a/Telegram/SourceFiles/langs/lang_pt_BR.strings b/Telegram/SourceFiles/langs/lang_pt_BR.strings index cf8b4082ef..2113785ed7 100644 --- a/Telegram/SourceFiles/langs/lang_pt_BR.strings +++ b/Telegram/SourceFiles/langs/lang_pt_BR.strings @@ -663,10 +663,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_count" = "{count:Carregando...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Foto"; -"lng_in_dlg_video" = "Video file"; -"lng_in_dlg_audio_file" = "Audio file"; +"lng_in_dlg_video" = "Vídeo"; +"lng_in_dlg_audio_file" = "Áudio"; "lng_in_dlg_contact" = "Contato"; -"lng_in_dlg_audio" = "Voice message"; +"lng_in_dlg_audio" = "Mensagem de voz"; "lng_in_dlg_file" = "Arquivo"; "lng_in_dlg_sticker" = "Sticker"; "lng_in_dlg_sticker_emoji" = "{emoji} (sticker)"; @@ -741,9 +741,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_maps_point" = "Localização"; "lng_save_photo" = "Salvar imagem"; -"lng_save_video" = "Save video file"; -"lng_save_audio_file" = "Save audio file"; -"lng_save_audio" = "Save voice message"; +"lng_save_video" = "Salvar vídeo"; +"lng_save_audio_file" = "Salvar áudio"; +"lng_save_audio" = "Salvar mensagens de voz"; "lng_save_file" = "Salvar arquivo"; "lng_save_downloaded" = "{ready} / {total} {mb}"; "lng_duration_and_size" = "{duration}, {size}"; @@ -768,9 +768,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancelar Download"; "lng_context_show_in_folder" = "Mostrar na Pasta"; "lng_context_show_in_finder" = "Mostrar no Finder"; -"lng_context_save_video" = "Save Video File As..."; -"lng_context_save_audio_file" = "Save Audio File As..."; -"lng_context_save_audio" = "Save Voice Message As..."; +"lng_context_save_video" = "Salvar Vídeo Como..."; +"lng_context_save_audio_file" = "Salvar Áudio Como..."; +"lng_context_save_audio" = "Salvar Mensagem de Voz Como..."; "lng_context_pack_info" = "Informação do pacote"; "lng_context_pack_add" = "Adicionar aos Stickers"; "lng_context_save_file" = "Salvar Arquivo Como..."; From 4bb906b9f833516aa80ccd1c0bab73b995bc289f Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 19:48:55 +0300 Subject: [PATCH 262/316] 0.9.35 dev version --- Telegram/SourceFiles/application.cpp | 6 +++--- Telegram/SourceFiles/config.h | 8 ++++---- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 10 +++++----- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index d66874dbf7..f847708409 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1025,10 +1025,10 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9031) { + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9035) { // QString ctrl = (cPlatform() == dbipMac || cPlatform() == dbipMacOld) ? qsl("Cmd") : qsl("Ctrl"); -// versionFeatures = QString::fromUtf8("\xe2\x80\x94 %1+W or %2+F4 for close window\n\xe2\x80\x94 %3+L to lock Telegram if you use a local passcode\n\xe2\x80\x94 Bug fixes and other minor improvements").arg(ctrl).arg(ctrl).arg(ctrl);// .replace('@', qsl("@") + QChar(0x200D)); - versionFeatures = lng_new_version_text(lt_link, qsl("https://telegram.org/blog/supergroups5k")).trimmed(); + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Design improvements\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); +// versionFeatures = lng_new_version_text(lt_link, qsl("https://telegram.org/blog/supergroups5k")).trimmed(); } else if (Local::oldMapVersion() < 9031) { versionFeatures = lng_new_version_text(lt_link, qsl("https://telegram.org/blog/supergroups5k")).trimmed(); } else { diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 6aad20f74c..a50a650ce9 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,10 +20,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9034; -static const wchar_t *AppVersionStr = L"0.9.34"; -static const bool DevVersion = false; -#define BETA_VERSION (9034004ULL) // just comment this line to build public version +static const int32 AppVersion = 9035; +static const wchar_t *AppVersionStr = L"0.9.35"; +static const bool DevVersion = true; +//#define BETA_VERSION (9034004ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 9b9e5021ac..7b3b28ee35 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.34 + 0.9.35 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 863775349e..77b4f853b1 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,34,4 - PRODUCTVERSION 0,9,34,4 + FILEVERSION 0,9,35,0 + PRODUCTVERSION 0,9,35,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.34.4" + VALUE "FileVersion", "0.9.35.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.34.4" + VALUE "ProductVersion", "0.9.35.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index e0040cea41..f072eb2358 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1772,7 +1772,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.34; + CURRENT_PROJECT_VERSION = 0.9.35; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1791,7 +1791,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.34; + CURRENT_PROJECT_VERSION = 0.9.35; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1820,10 +1820,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.34; + CURRENT_PROJECT_VERSION = 0.9.35; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.34; + DYLIB_CURRENT_VERSION = 0.9.35; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1961,10 +1961,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.34; + CURRENT_PROJECT_VERSION = 0.9.35; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.34; + DYLIB_CURRENT_VERSION = 0.9.35; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 7d9e063d1c..da012363c7 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9034 +AppVersion 9035 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.34 -AppVersionStr 0.9.34 -DevChannel 0 -BetaVersion 9034004 +AppVersionStrSmall 0.9.35 +AppVersionStr 0.9.35 +DevChannel 1 +BetaVersion 0 9034004 From a69a5c7252cefe867943a336c3a87e96d94f2b92 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 20:00:44 +0300 Subject: [PATCH 263/316] fixed build for clang, 0.9.35 dev version --- Telegram/SourceFiles/types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 0c0b3f34bb..836b7af37a 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -88,7 +88,7 @@ public: private: IteratorImpl impl_; - friend class Self; + friend class OrderedSet; }; friend class iterator; @@ -118,11 +118,11 @@ public: friend class iterator; inline bool operator==(const iterator &other) const { return impl_ == other.impl_; } - inline bool operator!=(const iterator &o) const { return impl_ != other.impl_; } + inline bool operator!=(const iterator &other) const { return impl_ != other.impl_; } private: ConstIteratorImpl impl_; - friend class Self; + friend class OrderedSet; }; friend class const_iterator; From 40ab82e4bddb68bb9c49057914706f326728a86c Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 21:30:19 +0300 Subject: [PATCH 264/316] critical bug fixed in auth import, 0.9.35 dev version --- Telegram/SourceFiles/mtproto/connection.cpp | 12 ++++++------ Telegram/SourceFiles/mtproto/facade.cpp | 8 ++++---- Telegram/SourceFiles/mtproto/session.cpp | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index 9a2c9fa4d8..d057373822 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -452,7 +452,7 @@ ConnectionPrivate::ConnectionPrivate(QThread *thread, Connection *owner, Session connect(thread, SIGNAL(started()), this, SLOT(socketStart())); connect(thread, SIGNAL(finished()), this, SLOT(doFinish())); - connect(this, SIGNAL(finished(MTProtoConnection*)), globalSlotCarrier(), SLOT(connectionFinished(MTProtoConnection*)), Qt::QueuedConnection); + connect(this, SIGNAL(finished(Connection*)), globalSlotCarrier(), SLOT(connectionFinished(Connection*)), Qt::QueuedConnection); connect(&retryTimer, SIGNAL(timeout()), this, SLOT(retryByTimer())); connect(&_waitForConnectedTimer, SIGNAL(timeout()), this, SLOT(onWaitConnectedFailed())); @@ -765,13 +765,13 @@ void ConnectionPrivate::tryToSend() { if (_pingIdToSend) { if (prependOnly || dc != bareDcId(dc)) { MTPPing ping(MTPping(MTP_long(_pingIdToSend))); - uint32 pingSize = ping.innerLength() >> 2; // copy from MTProtoSession::send + uint32 pingSize = ping.innerLength() >> 2; // copy from Session::send pingRequest = mtpRequestData::prepare(pingSize); ping.write(*pingRequest); DEBUG_LOG(("MTP Info: sending ping, ping_id: %1").arg(_pingIdToSend)); } else { MTPPing_delay_disconnect ping(MTP_long(_pingIdToSend), MTP_int(MTPPingDelayDisconnect)); - uint32 pingSize = ping.innerLength() >> 2; // copy from MTProtoSession::send + uint32 pingSize = ping.innerLength() >> 2; // copy from Session::send pingRequest = mtpRequestData::prepare(pingSize); ping.write(*pingRequest); DEBUG_LOG(("MTP Info: sending ping_delay_disconnect, ping_id: %1").arg(_pingIdToSend)); @@ -1176,7 +1176,7 @@ void ConnectionPrivate::restart(bool mayBeBadKey) { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData) return; - DEBUG_LOG(("MTP Info: restarting MTProtoConnection, maybe bad key = %1").arg(Logs::b(mayBeBadKey))); + DEBUG_LOG(("MTP Info: restarting Connection, maybe bad key = %1").arg(Logs::b(mayBeBadKey))); _waitForReceivedTimer.stop(); _waitForConnectedTimer.stop(); @@ -2342,7 +2342,7 @@ void ConnectionPrivate::updateAuthKey() { QReadLocker lockFinished(&sessionDataMutex); if (!sessionData || !_conn) return; - DEBUG_LOG(("AuthKey Info: MTProtoConnection updating key from MTProtoSession, dc %1").arg(dc)); + DEBUG_LOG(("AuthKey Info: Connection updating key from Session, dc %1").arg(dc)); uint64 newKeyId = 0; { ReadLockerAttempt lock(sessionData->keyMutex()); @@ -2359,7 +2359,7 @@ void ConnectionPrivate::updateAuthKey() { clearMessages(); keyId = newKeyId; } - DEBUG_LOG(("AuthKey Info: MTProtoConnection update key from MTProtoSession, dc %1 result: %2").arg(dc).arg(Logs::mb(&keyId, sizeof(keyId)).str())); + DEBUG_LOG(("AuthKey Info: Connection update key from Session, dc %1 result: %2").arg(dc).arg(Logs::mb(&keyId, sizeof(keyId)).str())); if (keyId) { return authKeyCreated(); } diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index ed02dadb9f..ecda88d172 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -100,7 +100,7 @@ namespace { LOG(("MTP Error: could not find request %1 for resending").arg(requestId)); continue; } - int32 dcWithShift = newdc; + ShiftedDcId dcWithShift = newdc; { RequestsByDC::iterator k = requestsByDC.find(requestId); if (k == requestsByDC.cend()) { @@ -111,7 +111,7 @@ namespace { setdc(newdc); k.value() = -newdc; } else { - dcWithShift += getDcIdShift(k.value()); + dcWithShift = shiftDcId(newdc, getDcIdShift(k.value())); k.value() = dcWithShift; } DEBUG_LOG(("MTP Info: resending request %1 to dc %2 after import auth").arg(requestId).arg(k.value())); @@ -167,7 +167,7 @@ namespace { if ((m = QRegularExpression("^(FILE|PHONE|NETWORK|USER)_MIGRATE_(\\d+)$").match(err)).hasMatch()) { if (!requestId) return false; - int32 dcWithShift = 0, newdcWithShift = m.captured(2).toInt(); + ShiftedDcId dcWithShift = 0, newdcWithShift = m.captured(2).toInt(); { QMutexLocker locker(&requestByDCLock); RequestsByDC::iterator i = requestsByDC.find(requestId); @@ -193,7 +193,7 @@ namespace { MTP::setdc(newdcWithShift); } } else { - newdcWithShift += MTP::getDcIdShift(dcWithShift); + newdcWithShift = shiftDcId(newdcWithShift, getDcIdShift(dcWithShift)); } mtpRequest req; diff --git a/Telegram/SourceFiles/mtproto/session.cpp b/Telegram/SourceFiles/mtproto/session.cpp index 76c9de9cd8..70f5561a50 100644 --- a/Telegram/SourceFiles/mtproto/session.cpp +++ b/Telegram/SourceFiles/mtproto/session.cpp @@ -85,7 +85,7 @@ Session::Session(int32 dcenter) : QObject() return; } if (dcWithShift) { - DEBUG_LOG(("Session Info: MTProtoSession::start called on already started session")); + DEBUG_LOG(("Session Info: Session::start called on already started session")); return; } @@ -461,18 +461,18 @@ QReadWriteLock *Session::keyMutex() const { } void Session::authKeyCreatedForDC() { - DEBUG_LOG(("AuthKey Info: MTProtoSession::authKeyCreatedForDC slot, emitting authKeyCreated(), dcWithShift %1").arg(dcWithShift)); + DEBUG_LOG(("AuthKey Info: Session::authKeyCreatedForDC slot, emitting authKeyCreated(), dcWithShift %1").arg(dcWithShift)); data.setKey(dc->getKey()); emit authKeyCreated(); } void Session::notifyKeyCreated(const AuthKeyPtr &key) { - DEBUG_LOG(("AuthKey Info: MTProtoSession::keyCreated(), setting, dcWithShift %1").arg(dcWithShift)); + DEBUG_LOG(("AuthKey Info: Session::keyCreated(), setting, dcWithShift %1").arg(dcWithShift)); dc->setKey(key); } void Session::layerWasInitedForDC(bool wasInited) { - DEBUG_LOG(("MTP Info: MTProtoSession::layerWasInitedForDC slot, dcWithShift %1").arg(dcWithShift)); + DEBUG_LOG(("MTP Info: Session::layerWasInitedForDC slot, dcWithShift %1").arg(dcWithShift)); data.setLayerWasInited(wasInited); } From 29c6b8e2d2dd55794f94225f2442a931fe45073a Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 25 Mar 2016 23:46:35 +0300 Subject: [PATCH 265/316] Dependent items clearing done better Fixed crash on launch if audio playback could not be started --- Telegram/SourceFiles/app.cpp | 12 ++++++++---- Telegram/SourceFiles/audio.cpp | 7 +++++-- Telegram/SourceFiles/history.cpp | 6 +----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index b35fc9abc2..bfb2e8268e 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -67,7 +67,8 @@ namespace { SharedContactItems sharedContactItems; GifItems gifItems; - typedef QMap > DependentItems; + typedef OrderedSet DependentItemsSet; + typedef QMap DependentItems; DependentItems dependentItems; Histories histories; @@ -1803,10 +1804,13 @@ namespace App { historyItemDetached(item); auto j = ::dependentItems.find(item); if (j != ::dependentItems.cend()) { - for_const (HistoryItem *dependent, j.value()) { + DependentItemsSet items; + std::swap(items, j.value()); + ::dependentItems.erase(j); + + for_const (HistoryItem *dependent, items) { dependent->dependencyItemRemoved(item); } - ::dependentItems.erase(j); } if (App::main() && !App::quitting()) { App::main()->itemRemoved(item); @@ -1903,7 +1907,7 @@ namespace App { } void historyUnregDependency(HistoryItem *dependent, HistoryItem *dependency) { - DependentItems::iterator i = ::dependentItems.find(dependency); + auto i = ::dependentItems.find(dependency); if (i != ::dependentItems.cend()) { i.value().remove(dependent); if (i.value().isEmpty()) { diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 139c617d61..29205c7af2 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -227,12 +227,15 @@ void audioPlayNotify() { emit audioPlayer()->faderOnTimer(); } +// can be called at any moment when audio error void audioFinish() { if (player) { - deleteAndMark(player); + delete player; + player = nullptr; } if (capture) { - deleteAndMark(capture); + delete capture; + capture = nullptr; } alSourceStop(notifySource); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2b1b3173bc..ff82dc7773 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -6096,11 +6096,7 @@ void HistoryMessageReply::resize(int width) const { void HistoryMessageReply::itemRemoved(HistoryMessage *holder, HistoryItem *removed) { if (replyToMsg == removed) { - delete _replyToVia; - _replyToVia = nullptr; - - replyToMsg = nullptr; - replyToMsgId = 0; + clearData(holder); holder->setPendingInitDimensions(); } } From b32c6566ffe83902591d65b318bdface3b2e5b8e Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 26 Mar 2016 09:41:23 +0300 Subject: [PATCH 266/316] Fixed crash when deleting items. Fixed unread counter clear when logging out. --- Telegram/SourceFiles/app.cpp | 1 - Telegram/SourceFiles/history.cpp | 31 +++++++++++++++++-------------- Telegram/SourceFiles/history.h | 10 +++++++--- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index b35fc9abc2..fc6af5f1af 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1787,7 +1787,6 @@ namespace App { if (App::wnd()) { App::wnd()->notifyItemRemoved(item); } - item->history()->setPendingResize(); } void historyUnregItem(HistoryItem *item) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 2b1b3173bc..1ca6936507 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1138,6 +1138,10 @@ void Histories::clear() { for (Map::const_iterator i = map.cbegin(), e = map.cend(); i != e; ++i) { delete i.value(); } + _unreadFull = _unreadMuted = 0; + if (App::wnd()) { + App::wnd()->updateCounter(); + } App::historyClearItems(); typing.clear(); map.clear(); @@ -1999,7 +2003,7 @@ void History::setUnreadCount(int newUnreadCount, bool psUpdate) { if (loadedAtBottom()) showFrom = lastImportantMessage(); inboxReadBefore = qMax(inboxReadBefore, msgIdForRead()); } else if (!newUnreadCount) { - showFrom = 0; + showFrom = nullptr; inboxReadBefore = qMax(inboxReadBefore, msgIdForRead() + 1); } if (inChatList()) { @@ -2564,8 +2568,6 @@ void History::changeMsgId(MsgId oldId, MsgId newId) { } void History::removeBlock(HistoryBlock *block) { - setPendingResize(); - t_assert(block->items.isEmpty()); int index = block->indexInHistory(); @@ -2576,7 +2578,6 @@ void History::removeBlock(HistoryBlock *block) { if (index < blocks.size()) { blocks.at(index)->items.front()->previousItemChanged(); } - delete block; } History::~History() { @@ -2684,26 +2685,26 @@ void HistoryBlock::removeItem(HistoryItem *item) { } } } - // blockIndex can be invalid now, because of destroying previous blocks + + // itemIndex/blockIndex can be invalid now, because of destroying previous items/blocks blockIndex = indexInHistory(); itemIndex = item->indexInBlock(); + item->detachFast(); items.remove(itemIndex); for (int i = itemIndex, l = items.size(); i < l; ++i) { items.at(i)->setIndexInBlock(i); } - if (itemIndex < items.size()) { + if (items.isEmpty()) { + history->removeBlock(this); + } else 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); + } else if (blockIndex + 1 < history->blocks.size()) { + history->blocks.at(blockIndex + 1)->items.front()->previousItemChanged(); } if (items.isEmpty()) { - history->removeBlock(this); + delete this; } } @@ -2796,6 +2797,9 @@ void HistoryItem::destroy() { history()->clearLastKeyboard(); if (App::main()) App::main()->updateBotKeyboard(history()); } + if ((!out() || isPost()) && unread() && history()->unreadCount > 0) { + history()->setUnreadCount(history()->unreadCount - 1); + } delete this; } @@ -2806,7 +2810,6 @@ void HistoryItem::detach() { _history->asChannelHistory()->messageDetached(this); } _block->removeItem(this); - detachFast(); App::historyItemDetached(this); _history->setPendingResize(); diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index cf4223b7b8..497dd1060e 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -239,7 +239,6 @@ public: return blocks.isEmpty(); } void clear(bool leaveItems = false); - void removeBlock(HistoryBlock *block); virtual ~History(); @@ -498,11 +497,16 @@ private: MediaOverviewIds overviewIds[OverviewCount]; int32 overviewCountData[OverviewCount]; // -1 - not loaded, 0 - all loaded, > 0 - count, but not all loaded - void clearBlocks(bool leaveItems); - friend class HistoryBlock; friend class ChannelHistory; + // this method just removes a block from the blocks list + // when the last item from this block was detached and + // calls the required previousItemChanged() + void removeBlock(HistoryBlock *block); + + void clearBlocks(bool leaveItems); + 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); From 1b5905dc54731c05a366664959e2d871019b86a4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 26 Mar 2016 09:53:23 +0300 Subject: [PATCH 267/316] dev version 0.9.36 --- Telegram/SourceFiles/config.h | 4 ++-- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index a50a650ce9..39e5008f30 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9035; -static const wchar_t *AppVersionStr = L"0.9.35"; +static const int32 AppVersion = 9036; +static const wchar_t *AppVersionStr = L"0.9.36"; static const bool DevVersion = true; //#define BETA_VERSION (9034004ULL) // just comment this line to build public version diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 7b3b28ee35..8e055f9b76 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.35 + 0.9.36 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 77b4f853b1..a6392a42a8 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,35,0 - PRODUCTVERSION 0,9,35,0 + FILEVERSION 0,9,36,0 + PRODUCTVERSION 0,9,36,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.35.0" + VALUE "FileVersion", "0.9.36.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.35.0" + VALUE "ProductVersion", "0.9.36.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index f072eb2358..7c99556fbc 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1772,7 +1772,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.35; + CURRENT_PROJECT_VERSION = 0.9.36; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1791,7 +1791,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.35; + CURRENT_PROJECT_VERSION = 0.9.36; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1820,10 +1820,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.35; + CURRENT_PROJECT_VERSION = 0.9.36; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.35; + DYLIB_CURRENT_VERSION = 0.9.36; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1961,10 +1961,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.35; + CURRENT_PROJECT_VERSION = 0.9.36; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.35; + DYLIB_CURRENT_VERSION = 0.9.36; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index da012363c7..2227962ec4 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9035 +AppVersion 9036 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.35 -AppVersionStr 0.9.35 +AppVersionStrSmall 0.9.36 +AppVersionStr 0.9.36 DevChannel 1 BetaVersion 0 9034004 From 96e1f8e7cd1c824e68b992ffb7dbf9f488aa5578 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 26 Mar 2016 11:13:57 +0300 Subject: [PATCH 268/316] Fixed duplicate save file dialog --- Telegram/SourceFiles/structs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 85932fb314..1223807303 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -951,7 +951,7 @@ void GifOpenLink::onClick(Qt::MouseButton button) const { void DocumentSaveLink::doSave(DocumentData *data, bool forceSavingAs) { if (!data->date) return; - QString filepath = data->filepath(DocumentData::FilePathResolveSaveFromData, forceSavingAs); + QString filepath = data->filepath(DocumentData::FilePathResolveSaveFromDataSilent, forceSavingAs); if (!filepath.isEmpty() && !forceSavingAs) { QPoint pos(QCursor::pos()); if (!psShowOpenWithMenu(pos.x(), pos.y(), filepath)) { @@ -1376,7 +1376,7 @@ QString DocumentData::filepath(FilePathResolveType type, bool forceSavingAs) con if (saveFromData) { if (type != FilePathResolveSaveFromData && type != FilePathResolveSaveFromDataSilent) { saveFromData = false; - } else if (type == FilePathResolveSaveFromDataSilent && cAskDownloadPath()) { + } else if (type == FilePathResolveSaveFromDataSilent && (cAskDownloadPath() || forceSavingAs)) { saveFromData = false; } } From daa5016c2341069e4676b5ff4eb9fdf8f9073b38 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 28 Mar 2016 15:51:22 +0300 Subject: [PATCH 269/316] Components are now almost plain structs Moved reply markups to history items which hold them --- Telegram/Resources/style.txt | 10 ++ Telegram/SourceFiles/apiwrap.h | 4 +- Telegram/SourceFiles/app.cpp | 116 ------------ Telegram/SourceFiles/app.h | 12 -- Telegram/SourceFiles/facades.cpp | 5 + Telegram/SourceFiles/facades.h | 1 + Telegram/SourceFiles/gui/animation.h | 4 +- Telegram/SourceFiles/history.cpp | 200 +++++++++++++++------ Telegram/SourceFiles/history.h | 131 +++++++++----- Telegram/SourceFiles/historywidget.cpp | 45 ++--- Telegram/SourceFiles/historywidget.h | 16 +- Telegram/SourceFiles/layout.h | 16 +- Telegram/SourceFiles/mtproto/core_types.h | 2 +- Telegram/SourceFiles/mtproto/generate.py | 1 + Telegram/SourceFiles/mtproto/scheme_auto.h | 8 + Telegram/SourceFiles/overviewwidget.cpp | 28 +-- Telegram/SourceFiles/shortcuts.cpp | 2 +- Telegram/SourceFiles/types.h | 143 ++++++++++----- 18 files changed, 409 insertions(+), 335 deletions(-) diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5ada019a85..196059ae57 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1085,6 +1085,16 @@ msgInReplyBarColor: #2fa9e2; msgOutReplyBarSelColor: #4da79f; msgInReplyBarSelColor: #2fa9e2; +msgBotKbDuration: 200; +msgBotKbFont: semiboldFont; +msgBotKbButton: botKeyboardButton { + margin: 5px; + padding: 10px; + height: 36px; + textTop: 8px; + downTextTop: 9px; +} + msgServiceBg: #89a0b47f; msgServiceSelectBg: #bbc8d4a2; msgServiceColor: #FFF; diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index 3ea5eca0fa..8845d90bd0 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -28,7 +28,7 @@ public: ApiWrap(QObject *parent); void init(); - typedef SharedCallback2 RequestMessageDataCallback; + typedef SharedCallback RequestMessageDataCallback; void requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback *callback); void requestFullPeer(PeerData *peer); @@ -69,7 +69,7 @@ private: struct MessageDataRequest { MessageDataRequest() : req(0) { } - typedef SharedCallback2::Ptr CallbackPtr; + typedef SharedCallback::Ptr CallbackPtr; typedef QList Callbacks; mtpRequestId req; Callbacks callbacks; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 29cb003689..1edee0a39d 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -55,12 +55,6 @@ namespace { typedef QHash WebPagesData; WebPagesData webPagesData; - typedef QMap ReplyMarkups; - ReplyMarkups replyMarkups; - ReplyMarkup zeroMarkup(qFlags(MTPDreplyKeyboardMarkup_ClientFlag::f_zero)); - typedef QMap ChannelReplyMarkups; - ChannelReplyMarkups channelReplyMarkups; - PhotoItems photoItems; DocumentItems documentItems; WebPageItems webPageItems; @@ -1851,8 +1845,6 @@ namespace App { } ::hoveredItem = ::pressedItem = ::hoveredLinkItem = ::pressedLinkItem = ::contextItem = 0; - replyMarkups.clear(); - channelReplyMarkups.clear(); } void historyClearItems() { @@ -2396,114 +2388,6 @@ namespace App { ::inlineResultLoaders.remove(loader); } - InlineResult *inlineResultFromLoader(FileLoader *loader) { - InlineResultLoaders::const_iterator i = ::inlineResultLoaders.find(loader); - return (i == ::inlineResultLoaders.cend()) ? 0 : i.value(); - } - - inline void insertReplyMarkup(ChannelId channelId, MsgId msgId, const ReplyMarkup &markup) { - if (channelId == NoChannel) { - replyMarkups.insert(msgId, markup); - } else { - channelReplyMarkups[channelId].insert(msgId, markup); - } - } - - void feedReplyMarkup(ChannelId channelId, MsgId msgId, const MTPReplyMarkup &markup) { - ReplyMarkup data; - ReplyMarkup::Commands &commands(data.commands); - switch (markup.type()) { - case mtpc_replyKeyboardMarkup: { - const MTPDreplyKeyboardMarkup &d(markup.c_replyKeyboardMarkup()); - data.flags = d.vflags.v; - - const QVector &v(d.vrows.c_vector().v); - if (!v.isEmpty()) { - commands.reserve(v.size()); - for (int32 i = 0, l = v.size(); i < l; ++i) { - switch (v.at(i).type()) { - case mtpc_keyboardButtonRow: { - const MTPDkeyboardButtonRow &r(v.at(i).c_keyboardButtonRow()); - const QVector &b(r.vbuttons.c_vector().v); - if (!b.isEmpty()) { - QList btns; - btns.reserve(b.size()); - for (int32 j = 0, s = b.size(); j < s; ++j) { - switch (b.at(j).type()) { - case mtpc_keyboardButton: { - btns.push_back(qs(b.at(j).c_keyboardButton().vtext)); - } break; - - case mtpc_keyboardButtonCallback: { - - } break; - - case mtpc_keyboardButtonRequestGeoLocation: { - - } break; - - case mtpc_keyboardButtonRequestPhone: { - - } break; - - case mtpc_keyboardButtonUrl: { - - } break; - } - } - if (!btns.isEmpty()) commands.push_back(btns); - } - } break; - } - } - if (!commands.isEmpty()) { - insertReplyMarkup(channelId, msgId, data); - } - } - } break; - - case mtpc_replyKeyboardHide: { - const MTPDreplyKeyboardHide &d(markup.c_replyKeyboardHide()); - if (d.vflags.v) { - 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(mtpCastFlags(d.vflags.v) | MTPDreplyKeyboardMarkup_ClientFlag::f_force_reply)); - } break; - } - } - - void clearReplyMarkup(ChannelId channelId, MsgId msgId) { - if (channelId == NoChannel) { - replyMarkups.remove(msgId); - } else { - ChannelReplyMarkups::iterator i = channelReplyMarkups.find(channelId); - if (i != channelReplyMarkups.cend()) { - i->remove(msgId); - if (i->isEmpty()) { - channelReplyMarkups.erase(i); - } - } - } - } - - inline const ReplyMarkup &replyMarkup(const ReplyMarkups &markups, MsgId msgId) { - ReplyMarkups::const_iterator i = markups.constFind(msgId); - if (i == markups.cend()) return zeroMarkup; - return i.value(); - } - const ReplyMarkup &replyMarkup(ChannelId channelId, MsgId msgId) { - if (channelId == NoChannel) { - return replyMarkup(replyMarkups, msgId); - } - ChannelReplyMarkups::const_iterator j = channelReplyMarkups.constFind(channelId); - if (j == channelReplyMarkups.cend()) return zeroMarkup; - return replyMarkup(*j, msgId); - } - void setProxySettings(QNetworkAccessManager &manager) { #ifndef TDESKTOP_DISABLE_NETWORK_PROXY manager.setProxy(getHttpProxySettings()); diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index ebe1711e5f..a4039571ed 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -44,14 +44,6 @@ typedef QHash GifItems; typedef QHash PhotosData; typedef QHash DocumentsData; -struct ReplyMarkup { - ReplyMarkup(MTPDreplyKeyboardMarkup::Flags flags = 0) : flags(flags) { - } - typedef QList > Commands; - Commands commands; - MTPDreplyKeyboardMarkup::Flags flags; -}; - class LayeredWidget; namespace App { @@ -272,10 +264,6 @@ namespace App { void unregInlineResultLoader(FileLoader *loader); InlineResult *inlineResultFromLoader(FileLoader *loader); - void feedReplyMarkup(ChannelId channelId, MsgId msgId, const MTPReplyMarkup &markup); - void clearReplyMarkup(ChannelId channelId, MsgId msgId); - const ReplyMarkup &replyMarkup(ChannelId channelId, MsgId msgId); - void setProxySettings(QNetworkAccessManager &manager); #ifndef TDESKTOP_DISABLE_NETWORK_PROXY QNetworkProxy getHttpProxySettings(); diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 0b9557e3d4..9e955b272a 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -41,6 +41,11 @@ namespace App { return false; } + void activateBotCommand(const HistoryMessageReplyMarkup::Button &button, MsgId replyTo) { + QString cmd(button.text); + App::sendBotCommand(cmd, replyTo); + } + void searchByHashtag(const QString &tag, PeerData *inPeer) { if (MainWidget *m = main()) m->searchMessages(tag + ' ', (inPeer && inPeer->isChannel()) ? inPeer : 0); } diff --git a/Telegram/SourceFiles/facades.h b/Telegram/SourceFiles/facades.h index ba77a20a29..4622999870 100644 --- a/Telegram/SourceFiles/facades.h +++ b/Telegram/SourceFiles/facades.h @@ -26,6 +26,7 @@ namespace App { void sendBotCommand(const QString &cmd, MsgId replyTo = 0); bool insertBotCommand(const QString &cmd, bool specialGif = false); + void activateBotCommand(const HistoryMessageReplyMarkup::Button &button, MsgId replyTo = 0); void searchByHashtag(const QString &tag, PeerData *inPeer); void openPeerByName(const QString &username, MsgId msgId = ShowAtUnreadMsgId, const QString &startToken = QString()); void joinGroupByHash(const QString &hash); diff --git a/Telegram/SourceFiles/gui/animation.h b/Telegram/SourceFiles/gui/animation.h index cb61a09e0d..e31c08d290 100644 --- a/Telegram/SourceFiles/gui/animation.h +++ b/Telegram/SourceFiles/gui/animation.h @@ -211,7 +211,7 @@ public: AnimationImplementation *create() const { return getPointerAndReset(_ptr); } ~AnimationCreator() { deleteAndMark(_ptr); } private: - AnimationCreator &operator=(const AnimationCreator &other); + AnimationCreator &operator=(const AnimationCreator &other) = delete; mutable AnimationImplementation *_ptr; }; class AnimationCallbacks { @@ -222,7 +222,7 @@ public: ~AnimationCallbacks() { deleteAndMark(_implementation); } private: AnimationCallbacks(const AnimationCallbacks &other); - AnimationCallbacks &operator=(const AnimationCallbacks &other); + AnimationCallbacks &operator=(const AnimationCallbacks &other) = delete; AnimationImplementation *_implementation; }; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 1478fe97c7..1550814911 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1291,9 +1291,6 @@ HistoryItem *History::createItem(const MTPMessage &msg, bool applyServiceAction, result = HistoryService::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 { result = HistoryMessage::create(this, m); - if (m.has_reply_markup()) { - App::feedReplyMarkup(channelId(), msgId, m.vreply_markup); - } } } break; @@ -1589,8 +1586,8 @@ HistoryItem *History::addNewItem(HistoryItem *adding, bool newMsg) { } } } - if (adding->hasReplyMarkup()) { - MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), adding->id).flags; + if (adding->definesReplyKeyboard()) { + MTPDreplyKeyboardMarkup::Flags markupFlags = adding->replyKeyboardFlags(); if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || adding->mentionsMe()) { OrderedSet *markupSenders = 0; if (peer->isChat()) { @@ -1759,8 +1756,8 @@ void History::addOlderSlice(const QVector &slice, const QVectorauthor()->id) { if (markupSenders) { // chats with bots - if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { - MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; + if (!lastKeyboardInited && item->definesReplyKeyboard() && !item->out()) { + MTPDreplyKeyboardMarkup::Flags markupFlags = item->replyKeyboardFlags(); if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { bool wasKeyboardHide = markupSenders->contains(item->author()); if (!wasKeyboardHide) { @@ -1786,8 +1783,8 @@ void History::addOlderSlice(const QVector &slice, const QVectorhasReplyMarkup() && !item->out()) { // conversations with bots - MTPDreplyKeyboardMarkup::Flags markupFlags = App::replyMarkup(channelId(), item->id).flags; + } else if (!lastKeyboardInited && item->definesReplyKeyboard() && !item->out()) { // conversations with bots + MTPDreplyKeyboardMarkup::Flags markupFlags = item->replyKeyboardFlags(); if (!(markupFlags & MTPDreplyKeyboardMarkup::Flag::f_selective) || item->mentionsMe()) { if (markupFlags & MTPDreplyKeyboardMarkup_ClientFlag::f_zero) { clearLastKeyboard(); @@ -2708,6 +2705,63 @@ void HistoryBlock::removeItem(HistoryItem *item) { } } +void HistoryMessageReplyMarkup::create(const MTPReplyMarkup &markup) { + switch (markup.type()) { + case mtpc_replyKeyboardMarkup: { + const MTPDreplyKeyboardMarkup &d(markup.c_replyKeyboardMarkup()); + flags = d.vflags.v; + + const QVector &v(d.vrows.c_vector().v); + if (!v.isEmpty()) { + rows.reserve(v.size()); + for_const (const MTPKeyboardButtonRow &row, v) { + switch (row.type()) { + case mtpc_keyboardButtonRow: { + const MTPDkeyboardButtonRow &r(row.c_keyboardButtonRow()); + const QVector &b(r.vbuttons.c_vector().v); + if (!b.isEmpty()) { + ButtonRow buttonRow; + buttonRow.reserve(b.size()); + for_const (const MTPKeyboardButton &button, b) { + switch (button.type()) { + case mtpc_keyboardButton: { + buttonRow.push_back({ Button::Default, qs(button.c_keyboardButton().vtext), QString() }); + } break; + case mtpc_keyboardButtonCallback: { + buttonRow.push_back({ Button::Callback, qs(button.c_keyboardButtonCallback().vtext), QString() }); + } break; + case mtpc_keyboardButtonRequestGeoLocation: { + buttonRow.push_back({ Button::RequestLocation, qs(button.c_keyboardButtonRequestGeoLocation().vtext), QString() }); + } break; + case mtpc_keyboardButtonRequestPhone: { + buttonRow.push_back({ Button::RequestPhone, qs(button.c_keyboardButtonRequestPhone().vtext), QString() }); + } break; + case mtpc_keyboardButtonUrl: { + const MTPDkeyboardButtonUrl &u(button.c_keyboardButtonUrl()); + buttonRow.push_back({ Button::Url, qs(u.vtext), qs(u.vurl) }); + } break; + } + } + if (!buttonRow.isEmpty()) rows.push_back(buttonRow); + } + } break; + } + } + } + } break; + + case mtpc_replyKeyboardHide: { + const MTPDreplyKeyboardHide &d(markup.c_replyKeyboardHide()); + flags = mtpCastFlags(d.vflags) | MTPDreplyKeyboardMarkup_ClientFlag::f_zero; + } break; + + case mtpc_replyKeyboardForceReply: { + const MTPDreplyKeyboardForceReply &d(markup.c_replyKeyboardForceReply()); + flags = mtpCastFlags(d.vflags) | MTPDreplyKeyboardMarkup_ClientFlag::f_force_reply; + } break; + } +} + void HistoryDependentItemCallback::call(ChannelData *channel, MsgId msgId) const { if (HistoryItem *item = App::histItemById(_dependent)) { item->updateDependencyItem(); @@ -3789,7 +3843,7 @@ void HistoryDocumentVoice::checkPlaybackFinished() const { HistoryDocument::HistoryDocument(DocumentData *document, const QString &caption, const HistoryItem *parent) : HistoryFileMedia() , _parent(nullptr) , _data(document) { - createInterfaces(!caption.isEmpty()); + createComponents(!caption.isEmpty()); if (auto *named = Get()) { named->_name = documentName(_data); named->_namew = st::semiboldFont->width(named->_name); @@ -3809,7 +3863,7 @@ HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedi , _parent(nullptr) , _data(other._data) { auto *captioned = other.Get(); - createInterfaces(captioned != 0); + createComponents(captioned != 0); if (auto *named = Get()) { if (auto *othernamed = other.Get()) { named->_name = othernamed->_name; @@ -3829,7 +3883,7 @@ HistoryDocument::HistoryDocument(const HistoryDocument &other) : HistoryFileMedi } } -void HistoryDocument::createInterfaces(bool caption) { +void HistoryDocument::createComponents(bool caption) { uint64 mask = 0; if (_data->voice()) { mask |= HistoryDocumentVoice::Bit(); @@ -6041,7 +6095,7 @@ bool HistoryMessageReply::updateData(HistoryMessage *holder, bool force) { replyToLnk = TextLinkPtr(new MessageLink(replyToMsg->history()->peer->id, replyToMsg->id)); if (!replyToMsg->Has()) { if (UserData *bot = replyToMsg->viaBot()) { - _replyToVia = new HistoryMessageVia(0); + _replyToVia.reset(new HistoryMessageVia()); _replyToVia->create(peerToUser(bot->id)); } } @@ -6055,8 +6109,7 @@ bool HistoryMessageReply::updateData(HistoryMessage *holder, bool force) { } void HistoryMessageReply::clearData(HistoryMessage *holder) { - delete _replyToVia; - _replyToVia = nullptr; + _replyToVia.clear(); if (replyToMsg) { App::historyUnregDependency(holder, replyToMsg); replyToMsg = nullptr; @@ -6164,20 +6217,22 @@ void HistoryMessageReply::paint(Painter &p, const HistoryItem *holder, int x, in 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) { - PeerId authorOriginalId = 0, fromOriginalId = 0; - MsgId originalId = 0; + CreateConfig config; + if (msg.has_fwd_from() && msg.vfwd_from.type() == mtpc_messageFwdHeader) { const MTPDmessageFwdHeader &f(msg.vfwd_from.c_messageFwdHeader()); if (f.has_from_id() || f.has_channel_id()) { - authorOriginalId = f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id); - fromOriginalId = f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id); - if (f.has_channel_post()) originalId = f.vchannel_post.v; + config.authorIdOriginal = f.has_channel_id() ? peerFromChannel(f.vchannel_id) : peerFromUser(f.vfrom_id); + config.fromIdOriginal = f.has_from_id() ? peerFromUser(f.vfrom_id) : peerFromChannel(f.vchannel_id); + if (f.has_channel_post()) config.originalId = f.vchannel_post.v; } } - MsgId replyTo = msg.has_reply_to_msg_id() ? msg.vreply_to_msg_id.v : 0; - int32 viaBotId = msg.has_via_bot_id() ? msg.vvia_bot_id.v : 0; - int views = msg.has_views() ? msg.vviews.v : -1; - createInterfaces(replyTo, viaBotId, views, authorOriginalId, fromOriginalId, originalId); + if (msg.has_reply_to_msg_id()) config.replyTo = msg.vreply_to_msg_id.v; + if (msg.has_via_bot_id()) config.viaBotId = msg.vvia_bot_id.v; + if (msg.has_views()) config.viewsCount = msg.vviews.v; + if (msg.has_reply_markup()) config.markup = &msg.vreply_markup; + + createComponents(config); QString text(textClean(qs(msg.vmessage))); initMedia(msg.has_media() ? (&msg.vmedia) : 0, text); @@ -6186,11 +6241,18 @@ HistoryMessage::HistoryMessage(History *history, const MTPDmessage &msg) 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) { + CreateConfig config; + UserData *fwdViaBot = fwd->viaBot(); - int32 viaBotId = fwdViaBot ? peerToUser(fwdViaBot->id) : 0; - int fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1); - MsgId replyTo = 0; - createInterfaces(replyTo, viaBotId, views, fwd->authorOriginal()->id, fwd->fromOriginal()->id, fwd->authorOriginal()->isChannel() ? fwd->id : 0); + if (fwdViaBot) config.viaBotId = peerToUser(fwdViaBot->id); + int fwdViewsCount = fwd->viewsCount(); + if (fwdViewsCount > 0) { + config.viewsCount = fwdViewsCount; + } else if (isPost()) { + config.viewsCount = 1; + } + + createComponents(config); if (HistoryMedia *mediaOriginal = fwd->getMedia()) { _media = mediaOriginal->clone(); @@ -6201,14 +6263,14 @@ HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags fl HistoryMessage::HistoryMessage(History *history, MsgId id, MTPDmessage::Flags flags, MsgId replyTo, 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) { - createInterfacesHelper(flags, replyTo, viaBotId); + createComponentsHelper(flags, replyTo, viaBotId); setText(msg, entities); } HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, DocumentData *doc, const QString &caption) : HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { - createInterfacesHelper(flags, replyTo, viaBotId); + createComponentsHelper(flags, replyTo, viaBotId); initMediaFromDocument(doc, caption); setText(QString(), EntitiesInText()); @@ -6216,56 +6278,70 @@ HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags HistoryMessage::HistoryMessage(History *history, MsgId msgId, MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId, QDateTime date, int32 from, PhotoData *photo, const QString &caption) : HistoryItem(history, msgId, flags, date, (flags & MTPDmessage::Flag::f_from_id) ? from : 0) { - createInterfacesHelper(flags, replyTo, viaBotId); + createComponentsHelper(flags, replyTo, viaBotId); _media = new HistoryPhoto(photo, caption, this); _media->attachToItem(this); setText(QString(), EntitiesInText()); } -void HistoryMessage::createInterfacesHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId) { - if (!(flags & MTPDmessage::Flag::f_via_bot_id)) viaBotId = 0; - if (!(flags & MTPDmessage::Flag::f_reply_to_msg_id)) replyTo = 0; - createInterfaces(replyTo, viaBotId, isPost() ? 1 : -1); +void HistoryMessage::createComponentsHelper(MTPDmessage::Flags flags, MsgId replyTo, int32 viaBotId) { + CreateConfig config; + + if (flags & MTPDmessage::Flag::f_via_bot_id) config.viaBotId = viaBotId; + if (flags & MTPDmessage::Flag::f_reply_to_msg_id) config.replyTo = replyTo; + if (isPost()) config.viewsCount = 1; + + createComponents(config); } -void HistoryMessage::createInterfaces(MsgId replyTo, int32 viaBotId, int32 viewsCount, const PeerId &authorIdOriginal, const PeerId &fromIdOriginal, MsgId originalId) { +void HistoryMessage::createComponents(const CreateConfig &config) { uint64 mask = 0; - if (replyTo) { + if (config.replyTo) { mask |= HistoryMessageReply::Bit(); } - if (viaBotId) { + if (config.viaBotId) { mask |= HistoryMessageVia::Bit(); } - if (viewsCount >= 0) { + if (config.viewsCount >= 0) { mask |= HistoryMessageViews::Bit(); } if (isPost() && _from->isUser()) { mask |= HistoryMessageSigned::Bit(); } - if (authorIdOriginal && fromIdOriginal) { + if (config.authorIdOriginal && config.fromIdOriginal) { mask |= HistoryMessageForwarded::Bit(); } + if (config.markup) { + // optimization: don't create markup component for the case + // MTPDreplyKeyboardHide with flags = 0, assume it has f_zero flag + if (config.markup->type() != mtpc_replyKeyboardHide || config.markup->c_replyKeyboardHide().vflags.v != 0) { + mask |= HistoryMessageReplyMarkup::Bit(); + } + } UpdateComponents(mask); if (auto *reply = Get()) { - reply->replyToMsgId = replyTo; + reply->replyToMsgId = config.replyTo; if (!reply->updateData(this) && App::api()) { - App::api()->requestMessageData(history()->peer->asChannel(), replyTo, new HistoryDependentItemCallback(fullId())); + App::api()->requestMessageData(history()->peer->asChannel(), reply->replyToMsgId, new HistoryDependentItemCallback(fullId())); } } if (auto *via = Get()) { - via->create(viaBotId); + via->create(config.viaBotId); } if (auto *views = Get()) { - views->_views = viewsCount; + views->_views = config.viewsCount; } if (auto *msgsigned = Get()) { msgsigned->create(_from->asUser(), date); } if (auto *fwd = Get()) { - fwd->_authorOriginal = App::peer(authorIdOriginal); - fwd->_fromOriginal = App::peer(fromIdOriginal); - fwd->_originalId = originalId; + fwd->_authorOriginal = App::peer(config.authorIdOriginal); + fwd->_fromOriginal = App::peer(config.fromIdOriginal); + fwd->_originalId = config.originalId; + } + if (auto *markup = Get()) { + markup->create(*config.markup); } initTime(); } @@ -6368,7 +6444,6 @@ int32 HistoryMessage::plainMaxWidth() const { } void HistoryMessage::initDimensions() { - auto *reply = Get(); if (drawBubble()) { auto fwd = Get(); auto via = Get(); @@ -6427,7 +6502,7 @@ void HistoryMessage::initDimensions() { _maxw = _media->maxWidth(); _minh = _media->minHeight(); } - if (reply) { + if (auto *reply = Get()) { reply->updateName(); if (!_media) { int replyw = st::msgPadding.left() + reply->_maxReplyWidth - st::msgReplyPadding.left() - st::msgReplyPadding.right() + st::msgPadding.right(); @@ -6437,6 +6512,8 @@ void HistoryMessage::initDimensions() { if (replyw > _maxw) _maxw = replyw; } } + if (HistoryMessageReplyMarkup *markup = inlineReplyMarkup()) { + } } void HistoryMessage::countPositionAndSize(int32 &left, int32 &width) const { @@ -6741,11 +6818,15 @@ void HistoryMessage::draw(Painter &p, const QRect &r, uint32 selection, uint64 m textstyleSet(&(outbg ? st::outTextStyle : st::inTextStyle)); - //if (displayFromPhoto()) { - // int photoleft = left + ((outbg && !Adaptive::Wide()) ? (width + (st::msgPhotoSkip - st::msgPhotoSize)) : (-st::msgPhotoSkip)); - // int phototop = marginTop(); - // author()->paintUserpic(p, st::msgPhotoSize, photoleft, phototop); - //} + if (auto *markup = inlineReplyMarkup()) { + height -= markup->rows.size() * (st::msgBotKbButton.margin + st::msgBotKbButton.height); + int y = marginTop() + height + st::msgBotKbButton.margin; + for_const (const HistoryMessageReplyMarkup::ButtonRow &row, markup->rows) { + for_const (const HistoryMessageReplyMarkup::Button &button, row) { + + } + } + } auto *reply = Get(); if (reply) { @@ -6945,6 +7026,10 @@ int HistoryMessage::resizeGetHeight_(int width) { } else { _height = _media->resize(width, this); } + if (HistoryMessageReplyMarkup *markup = inlineReplyMarkup()) { + _height += (st::msgBotKbButton.margin + st::msgBotKbButton.height) * markup->rows.size(); + } + _height += marginTop() + marginBottom(); return _height; } @@ -6996,6 +7081,10 @@ void HistoryMessage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 //} if (width < 1) return; + if (const HistoryMessageReplyMarkup *markup = inlineReplyMarkup()) { + height -= (st::msgBotKbButton.margin + st::msgBotKbButton.height) * markup->rows.size(); + } + if (drawBubble()) { auto *fwd = Get(); auto *via = Get(); @@ -7172,9 +7261,6 @@ HistoryMessage::~HistoryMessage() { if (auto *reply = Get()) { reply->clearData(this); } - if (_flags & MTPDmessage::Flag::f_reply_markup) { - App::clearReplyMarkup(channelId(), id); - } } void HistoryService::setMessageByAction(const MTPmessageAction &action) { diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 497dd1060e..5f617c80e5 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -966,8 +966,6 @@ enum HistoryItemType { }; struct HistoryMessageVia : public BaseComponent { - HistoryMessageVia(Composer*) { - } void create(int32 userId); void resize(int32 availw) const; @@ -979,18 +977,12 @@ struct HistoryMessageVia : public BaseComponent { }; struct HistoryMessageViews : public BaseComponent { - HistoryMessageViews(Composer*) { - } - QString _viewsText; int _views = 0; int _viewsWidth = 0; }; struct HistoryMessageSigned : public BaseComponent { - HistoryMessageSigned(Composer*) { - } - void create(UserData *from, const QDateTime &date); int maxWidth() const; @@ -998,8 +990,6 @@ struct HistoryMessageSigned : public BaseComponent { }; struct HistoryMessageForwarded : public BaseComponent { - HistoryMessageForwarded(Composer*) { - } void create(const HistoryMessageVia *via) const; PeerData *_authorOriginal = nullptr; @@ -1009,24 +999,23 @@ struct HistoryMessageForwarded : public BaseComponent { }; struct HistoryMessageReply : public BaseComponent { - HistoryMessageReply(Composer*) { - } HistoryMessageReply &operator=(HistoryMessageReply &&other) { replyToMsgId = other.replyToMsgId; std::swap(replyToMsg, other.replyToMsg); - replyToLnk = std11::move(other.replyToLnk); - replyToName = std11::move(other.replyToName); - replyToText = std11::move(other.replyToText); + replyToLnk = std_::move(other.replyToLnk); + replyToName = std_::move(other.replyToName); + replyToText = std_::move(other.replyToText); replyToVersion = other.replyToVersion; _maxReplyWidth = other._maxReplyWidth; - std::swap(_replyToVia, other._replyToVia); + _replyToVia = std_::move(other._replyToVia); return *this; } ~HistoryMessageReply() { // clearData() should be called by holder t_assert(replyToMsg == nullptr); - t_assert(_replyToVia == nullptr); + t_assert(_replyToVia.data() == nullptr); } + bool updateData(HistoryMessage *holder, bool force = false); void clearData(HistoryMessage *holder); // must be called before destructor @@ -1058,12 +1047,45 @@ struct HistoryMessageReply : public BaseComponent { mutable Text replyToName, replyToText; mutable int replyToVersion = 0; mutable int _maxReplyWidth = 0; - HistoryMessageVia *_replyToVia = nullptr; + UniquePointer _replyToVia; int toWidth = 0; }; Q_DECLARE_OPERATORS_FOR_FLAGS(HistoryMessageReply::PaintFlags); -class HistoryDependentItemCallback : public SharedCallback2 { +class ReplyKeyboard { +public: + ReplyKeyboard(HistoryItem *item); + +}; + +struct HistoryMessageReplyMarkup : public BaseComponent { + HistoryMessageReplyMarkup() = default; + HistoryMessageReplyMarkup(MTPDreplyKeyboardMarkup::Flags f) : flags(f) { + } + + void create(const MTPReplyMarkup &markup); + + struct Button { + enum Type { + Default, + Url, + Callback, + RequestPhone, + RequestLocation, + }; + Type type; + QString text, url; + }; + using ButtonRow = QVector